{"id": "ghcc-00000-23fdea9c9ef88c45", "source": "codeparrot/github-code-clean", "repo": "google/filament", "license": "apache-2.0", "language": "C++", "path": "third_party/spirv-tools/test/reduce/remove_unused_instruction_test.cpp", "text": "// Copyright (c) 2018 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"source/reduce/remove_unused_instruction_reduction_opportunity_finder.h\"\n\n#include \"source/opt/build_module.h\"\n#include \"source/reduce/reduction_opportunity.h\"\n#include \"source/util/make_unique.h\"\n#include \"test/reduce/reduce_test_util.h\"\n\nnamespace spvtools {\nnamespace reduce {\nnamespace {\n\nconst spv_target_env kEnv = SPV_ENV_UNIVERSAL_1_3;\n\nTEST(RemoveUnusedInstructionReductionPassTest, RemoveStores) {\n // A module with some unused instructions, including some unused OpStore\n // instructions.\n\n RemoveUnusedInstructionReductionOpportunityFinder finder(true);\n\n const std::string original = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n OpSource ESSL 310 ; 0\n OpName %4 \"main\" ; 1\n OpName %8 \"a\" ; 2\n OpName %10 \"b\" ; 3\n OpName %12 \"c\" ; 4\n OpName %14 \"d\" ; 5\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1\n %7 = OpTypePointer Function %6\n %9 = OpConstant %6 10\n %11 = OpConstant %6 20\n %13 = OpConstant %6 30\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n %8 = OpVariable %7 Function\n %10 = OpVariable %7 Function\n %12 = OpVariable %7 Function\n %14 = OpVariable %7 Function\n OpStore %8 %9 ; 6\n OpStore %10 %11 ; 7\n OpStore %12 %13 ; 8\n %15 = OpLoad %6 %8\n OpStore %14 %15 ; 9\n OpReturn\n OpFunctionEnd\n\n )\";\n\n const MessageConsumer consumer = nullptr;\n const auto context =\n BuildModule(kEnv, consumer, original, kReduceAssembleOption);\n\n CheckValid(kEnv, context.get());\n\n auto ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(10, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n const std::string step_2 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1\n %7 = OpTypePointer Function %6\n %9 = OpConstant %6 10 ; 0\n %11 = OpConstant %6 20 ; 1\n %13 = OpConstant %6 30 ; 2\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n %8 = OpVariable %7 Function\n %10 = OpVariable %7 Function ; 3\n %12 = OpVariable %7 Function ; 4\n %14 = OpVariable %7 Function ; 5\n %15 = OpLoad %6 %8 ; 6\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, step_2, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(7, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n const std::string step_3 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1\n %7 = OpTypePointer Function %6\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n %8 = OpVariable %7 Function ; 0\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, step_3, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(1, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n const std::string step_4 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1\n %7 = OpTypePointer Function %6 ; 0\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, step_4, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(1, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n const std::string step_5 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1 ; 0\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, step_5, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(1, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n const std::string step_6 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, step_6, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(0, ops.size());\n}\n\nTEST(RemoveUnusedInstructionReductionPassTest, Referenced) {\n // A module with some unused global variables, constants, and types. Some will\n // not be removed initially because of the OpDecorate instructions.\n\n RemoveUnusedInstructionReductionOpportunityFinder finder(true);\n\n const std::string shader = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n OpSource ESSL 310 ; 1\n OpName %4 \"main\" ; 2\n OpName %12 \"a\" ; 3\n OpDecorate %12 RelaxedPrecision ; 4\n OpDecorate %13 RelaxedPrecision ; 5\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeBool\n %7 = OpConstantTrue %6 ; 6\n %10 = OpTypeInt 32 1\n %11 = OpTypePointer Private %10\n %12 = OpVariable %11 Private\n %13 = OpConstant %10 1\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n auto context = BuildModule(kEnv, nullptr, shader, kReduceAssembleOption);\n\n CheckValid(kEnv, context.get());\n\n auto ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(6, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n std::string after = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeBool ; 1\n %10 = OpTypeInt 32 1\n %11 = OpTypePointer Private %10\n %12 = OpVariable %11 Private ; 2\n %13 = OpConstant %10 1 ; 3\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, after, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(3, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n std::string after_2 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %10 = OpTypeInt 32 1\n %11 = OpTypePointer Private %10 ; 1\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, after_2, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(1, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n std::string after_3 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %10 = OpTypeInt 32 1 ; 1\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, after_3, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(1, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n CheckValid(kEnv, context.get());\n }\n\n std::string after_4 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint Fragment %4 \"main\"\n OpExecutionMode %4 OriginUpperLeft\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(kEnv, after_4, context.get());\n\n ops = finder.GetAvailableOpportunities(context.get(), 0);\n\n ASSERT_EQ(0, ops.size());\n}\n\nTEST(RemoveUnusedResourceVariableTest, RemoveUnusedResourceVariables) {\n std::string shader = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint GLCompute %4 \"main\"\n OpExecutionMode %4 LocalSize 1 1 1\n OpMemberDecorate %9 0 Offset 0\n OpDecorate %9 Block\n OpDecorate %11 DescriptorSet 0\n OpDecorate %11 Binding 1\n OpMemberDecorate %16 0 Offset 0\n OpMemberDecorate %16 1 Offset 4\n OpDecorate %16 Block\n OpDecorate %18 DescriptorSet 0\n OpDecorate %18 Binding 0\n OpMemberDecorate %19 0 Offset 0\n OpDecorate %19 BufferBlock\n OpDecorate %21 DescriptorSet 1\n OpDecorate %21 Binding 0\n OpMemberDecorate %22 0 Offset 0\n OpDecorate %22 Block\n OpDecorate %29 DescriptorSet 1\n OpDecorate %29 Binding 1\n OpDecorate %32 DescriptorSet 1\n OpDecorate %32 Binding 2\n OpDecorate %32 NonReadable\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1\n %9 = OpTypeStruct %6\n %10 = OpTypePointer Uniform %9\n %11 = OpVariable %10 Uniform\n %13 = OpTypePointer Uniform %6\n %16 = OpTypeStruct %6 %6\n %17 = OpTypePointer Uniform %16\n %18 = OpVariable %17 Uniform\n %19 = OpTypeStruct %6\n %20 = OpTypePointer Uniform %19\n %21 = OpVariable %20 Uniform\n %22 = OpTypeStruct %6\n %23 = OpTypePointer PushConstant %22\n %24 = OpVariable %23 PushConstant\n %25 = OpTypeFloat 32\n %26 = OpTypeImage %25 2D 0 0 0 1 Unknown\n %27 = OpTypeSampledImage %26\n %28 = OpTypePointer UniformConstant %27\n %29 = OpVariable %28 UniformConstant\n %30 = OpTypeImage %25 2D 0 0 0 2 Unknown\n %31 = OpTypePointer UniformConstant %30\n %32 = OpVariable %31 UniformConstant\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n const auto env = SPV_ENV_UNIVERSAL_1_3;\n const auto consumer = nullptr;\n const auto context =\n BuildModule(env, consumer, shader, kReduceAssembleOption);\n\n auto ops = RemoveUnusedInstructionReductionOpportunityFinder(true)\n .GetAvailableOpportunities(context.get(), 0);\n ASSERT_EQ(7, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n }\n\n std::string expected_1 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint GLCompute %4 \"main\"\n OpExecutionMode %4 LocalSize 1 1 1\n OpMemberDecorate %9 0 Offset 0\n OpDecorate %9 Block\n OpMemberDecorate %16 0 Offset 0\n OpMemberDecorate %16 1 Offset 4\n OpDecorate %16 Block\n OpMemberDecorate %19 0 Offset 0\n OpDecorate %19 BufferBlock\n OpMemberDecorate %22 0 Offset 0\n OpDecorate %22 Block\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1\n %9 = OpTypeStruct %6\n %10 = OpTypePointer Uniform %9\n %16 = OpTypeStruct %6 %6\n %17 = OpTypePointer Uniform %16\n %19 = OpTypeStruct %6\n %20 = OpTypePointer Uniform %19\n %22 = OpTypeStruct %6\n %23 = OpTypePointer PushConstant %22\n %25 = OpTypeFloat 32\n %26 = OpTypeImage %25 2D 0 0 0 1 Unknown\n %27 = OpTypeSampledImage %26\n %28 = OpTypePointer UniformConstant %27\n %30 = OpTypeImage %25 2D 0 0 0 2 Unknown\n %31 = OpTypePointer UniformConstant %30\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(env, expected_1, context.get());\n\n ops = RemoveUnusedInstructionReductionOpportunityFinder(true)\n .GetAvailableOpportunities(context.get(), 0);\n ASSERT_EQ(6, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n }\n\n std::string expected_2 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint GLCompute %4 \"main\"\n OpExecutionMode %4 LocalSize 1 1 1\n OpMemberDecorate %9 0 Offset 0\n OpDecorate %9 Block\n OpMemberDecorate %16 0 Offset 0\n OpMemberDecorate %16 1 Offset 4\n OpDecorate %16 Block\n OpMemberDecorate %19 0 Offset 0\n OpDecorate %19 BufferBlock\n OpMemberDecorate %22 0 Offset 0\n OpDecorate %22 Block\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1\n %9 = OpTypeStruct %6\n %16 = OpTypeStruct %6 %6\n %19 = OpTypeStruct %6\n %22 = OpTypeStruct %6\n %25 = OpTypeFloat 32\n %26 = OpTypeImage %25 2D 0 0 0 1 Unknown\n %27 = OpTypeSampledImage %26\n %30 = OpTypeImage %25 2D 0 0 0 2 Unknown\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(env, expected_2, context.get());\n\n ops = RemoveUnusedInstructionReductionOpportunityFinder(true)\n .GetAvailableOpportunities(context.get(), 0);\n ASSERT_EQ(6, ops.size());\n\n for (auto& op : ops) {\n ASSERT_TRUE(op->PreconditionHolds());\n op->TryToApply();\n }\n\n std::string expected_3 = R\"(\n OpCapability Shader\n %1 = OpExtInstImport \"GLSL.std.450\"\n OpMemoryModel Logical GLSL450\n OpEntryPoint GLCompute %4 \"main\"\n OpExecutionMode %4 LocalSize 1 1 1\n %2 = OpTypeVoid\n %3 = OpTypeFunction %2\n %6 = OpTypeInt 32 1\n %25 = OpTypeFloat 32\n %26 = OpTypeImage %25 2D 0 0 0 1 Unknown\n %4 = OpFunction %2 None %3\n %5 = OpLabel\n OpReturn\n OpFunctionEnd\n )\";\n\n CheckEqual(env, expected_3, context.get());\n}\n\n} // namespace\n} // namespace reduce\n} // namespace spvtools\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c40dc6fceb1de4a3", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": []} {"id": "ghcc-00000-c8ea515978568c68", "source": "codeparrot/github-code-clean", "repo": "google/filament", "license": "apache-2.0", "language": "Java", "path": "third_party/libassimp/port/jassimp/jassimp/src/jassimp/Jassimp.java", "text": "/*\n---------------------------------------------------------------------------\nOpen Asset Import Library - Java Binding (jassimp)\n---------------------------------------------------------------------------\n\nCopyright (c) 2006-2012, assimp team\n\nAll rights reserved.\n\nRedistribution and use of this software in source and binary forms, \nwith or without modification, are permitted provided that the following \nconditions are met:\n\n* Redistributions of source code must retain the above\n copyright notice, this list of conditions and the\n following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the\n following disclaimer in the documentation and/or other\n materials provided with the distribution.\n\n* Neither the name of the assimp team, nor the names of its\n contributors may be used to endorse or promote products\n derived from this software without specific prior\n written permission of the assimp team.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY \nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n---------------------------------------------------------------------------\n*/\npackage jassimp;\n\nimport java.io.IOException;\nimport java.nio.ByteBuffer;\nimport java.util.EnumSet;\nimport java.util.Set;\n\n\n\n/**\n * Entry point to the jassimp library.

\n * \n * Use {@link #importFile(String, Set)} to load a file.\n * \n *

General Notes and Pitfalls

\n * Due to the loading via JNI, strings (for example as returned by the \n * getName() methods) are not interned. You should therefore \n * compare strings the way it should be done, i.e, via equals(). \n * Pointer comparison will fail.\n */\npublic final class Jassimp {\n\n /**\n * The native interface.\n * \n * @param filename the file to load\n * @param postProcessing post processing flags\n * @return the loaded scene, or null if an error occurred\n * @throws IOException if an error occurs\n */\n private static native AiScene aiImportFile(String filename,\n long postProcessing, AiIOSystem ioSystem,\n AiProgressHandler progressHandler) throws IOException;\n \n \n /**\n * The active wrapper provider.\n */\n private static AiWrapperProvider s_wrapperProvider = \n new AiBuiltInWrapperProvider();\n \n \n /**\n * The library loader to load the native library.\n */\n private static JassimpLibraryLoader s_libraryLoader = \n new JassimpLibraryLoader();\n \n /**\n * Status flag if the library is loaded.\n * \n * Volatile to avoid problems with double checked locking.\n * \n */\n private static volatile boolean s_libraryLoaded = false;\n \n /**\n * Lock for library loading.\n */\n private static final Object s_libraryLoadingLock = new Object();\n\n /**\n * The default wrapper provider using built in types.\n */\n public static final AiWrapperProvider BUILTIN = \n new AiBuiltInWrapperProvider();\n \n\n /**\n * Imports a file via assimp without post processing.\n * \n * @param filename the file to import\n * @return the loaded scene\n * @throws IOException if an error occurs\n */\n public static AiScene importFile(String filename) throws IOException {\n \n return importFile(filename, EnumSet.noneOf(AiPostProcessSteps.class));\n }\n \n /**\n * Imports a file via assimp without post processing.\n * \n * @param filename the file to import\n * @param ioSystem ioSystem to load files, or null for default\n * @return the loaded scene\n * @throws IOException if an error occurs\n */\n public static AiScene importFile(String filename, AiIOSystem ioSystem) \n throws IOException {\n \n return importFile(filename, EnumSet.noneOf(AiPostProcessSteps.class), ioSystem);\n }\n \n \n /**\n * Imports a file via assimp.\n * \n * @param filename the file to import\n * @param postProcessing post processing flags\n * @return the loaded scene, or null if an error occurred\n * @throws IOException if an error occurs\n */\n public static AiScene importFile(String filename, \n Set postProcessing) \n throws IOException {\n return importFile(filename, postProcessing, null);\n }\n \n /**\n * Imports a file via assimp.\n * \n * @param filename the file to import\n * @param postProcessing post processing flags\n * @param ioSystem ioSystem to load files, or null for default\n * @return the loaded scene, or null if an error occurred\n * @throws IOException if an error occurs\n */\n public static AiScene importFile(String filename, \n Set postProcessing, AiIOSystem ioSystem) \n throws IOException {\n return importFile(filename, postProcessing, ioSystem, null);\n }\n\n /**\n * Imports a file via assimp.\n *\n * @param filename the file to import\n * @param postProcessing post processing flags\n * @param ioSystem ioSystem to load files, or null for default\n * @return the loaded scene, or null if an error occurred\n * @throws IOException if an error occurs\n */\n public static AiScene importFile(String filename,\n Set postProcessing, AiIOSystem ioSystem,\n AiProgressHandler progressHandler) throws IOException {\n\n loadLibrary();\n\n return aiImportFile(filename, AiPostProcessSteps.toRawValue(\n postProcessing), ioSystem, progressHandler);\n }\n \n \n /**\n * Returns the size of a struct or ptimitive.

\n * \n * @return the result of sizeof call\n */\n public static native int getVKeysize();\n\n /**\n * @see #getVKeysize\n */\n public static native int getQKeysize();\n\n /**\n * @see #getVKeysize\n */\n public static native int getV3Dsize();\n\n /**\n * @see #getVKeysize\n */\n public static native int getfloatsize();\n\n /**\n * @see #getVKeysize\n */\n public static native int getintsize();\n\n /**\n * @see #getVKeysize\n */\n public static native int getuintsize();\n\n /**\n * @see #getVKeysize\n */\n public static native int getdoublesize();\n\n /**\n * @see #getVKeysize\n */\n public static native int getlongsize();\n\n /**\n * Returns a human readable error description.

\n * \n * This method can be called when one of the import methods fails, i.e.,\n * throws an exception, to get a human readable error description.\n * \n * @return the error string\n */\n public static native String getErrorString();\n \n \n /**\n * Returns the active wrapper provider.

\n * \n * This method is part of the wrapped API (see {@link AiWrapperProvider}\n * for details on wrappers).\n * \n * @return the active wrapper provider\n */\n public static AiWrapperProvider getWrapperProvider() {\n return s_wrapperProvider;\n }\n \n \n /**\n * Sets a new wrapper provider.

\n * \n * This method is part of the wrapped API (see {@link AiWrapperProvider}\n * for details on wrappers).\n * \n * @param wrapperProvider the new wrapper provider\n */\n public static void setWrapperProvider(AiWrapperProvider \n wrapperProvider) {\n \n s_wrapperProvider = wrapperProvider;\n }\n \n \n public static void setLibraryLoader(JassimpLibraryLoader libraryLoader) {\n s_libraryLoader = libraryLoader;\n }\n \n \n /**\n * Helper method for wrapping a matrix.

\n * \n * Used by JNI, do not modify!\n * \n * @param data the matrix data\n * @return the wrapped matrix\n */\n static Object wrapMatrix(float[] data) {\n return s_wrapperProvider.wrapMatrix4f(data);\n }\n \n \n /**\n * Helper method for wrapping a color (rgb).

\n * \n * Used by JNI, do not modify!\n * \n * @param red red component\n * @param green green component\n * @param blue blue component\n * @return the wrapped color\n */\n static Object wrapColor3(float red, float green, float blue) {\n return wrapColor4(red, green, blue, 1.0f);\n }\n \n \n /**\n * Helper method for wrapping a color (rgba).

\n * \n * Used by JNI, do not modify!\n * \n * @param red red component\n * @param green green component\n * @param blue blue component\n * @param alpha alpha component\n * @return the wrapped color\n */\n static Object wrapColor4(float red, float green, float blue, float alpha) {\n ByteBuffer temp = ByteBuffer.allocate(4 * 4);\n temp.putFloat(red);\n temp.putFloat(green);\n temp.putFloat(blue);\n temp.putFloat(alpha);\n temp.flip();\n return s_wrapperProvider.wrapColor(temp, 0);\n }\n \n \n /**\n * Helper method for wrapping a vector.

\n * \n * Used by JNI, do not modify!\n * \n * @param x x component\n * @param y y component\n * @param z z component\n * @return the wrapped vector\n */\n static Object wrapVec3(float x, float y, float z) {\n ByteBuffer temp = ByteBuffer.allocate(3 * 4);\n temp.putFloat(x);\n temp.putFloat(y);\n temp.putFloat(z);\n temp.flip();\n return s_wrapperProvider.wrapVector3f(temp, 0, 3);\n }\n \n \n /**\n * Helper method for wrapping a scene graph node.

\n * \n * Used by JNI, do not modify!\n * \n * @param parent the parent node\n * @param matrix the transformation matrix\n * @param meshRefs array of matrix references\n * @param name the name of the node\n * @return the wrapped matrix\n */\n static Object wrapSceneNode(Object parent, Object matrix, int[] meshRefs,\n String name) {\n \n return s_wrapperProvider.wrapSceneNode(parent, matrix, meshRefs, name);\n }\n \n /**\n * Helper method to load the library using the provided JassimpLibraryLoader.

\n * \n * Synchronized to avoid race conditions.\n */\n private static void loadLibrary()\n {\n if(!s_libraryLoaded)\n {\n synchronized(s_libraryLoadingLock)\n {\n if(!s_libraryLoaded)\n {\n s_libraryLoader.loadLibrary();\n NATIVE_AIVEKTORKEY_SIZE = getVKeysize();\n NATIVE_AIQUATKEY_SIZE = getQKeysize();\n NATIVE_AIVEKTOR3D_SIZE = getV3Dsize();\n NATIVE_FLOAT_SIZE = getfloatsize();\n NATIVE_INT_SIZE = getintsize();\n NATIVE_UINT_SIZE = getuintsize();\n NATIVE_DOUBLE_SIZE = getdoublesize();\n NATIVE_LONG_SIZE = getlongsize();\n \n s_libraryLoaded = true;\n }\n }\n }\n }\n \n /**\n * Pure static class, no accessible constructor.\n */\n private Jassimp() {\n /* nothing to do */\n }\n \n public static int NATIVE_AIVEKTORKEY_SIZE; \n public static int NATIVE_AIQUATKEY_SIZE; \n public static int NATIVE_AIVEKTOR3D_SIZE; \n public static int NATIVE_FLOAT_SIZE; \n public static int NATIVE_INT_SIZE; \n public static int NATIVE_UINT_SIZE; \n public static int NATIVE_DOUBLE_SIZE; \n public static int NATIVE_LONG_SIZE; \n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c40dc6fceb1de4a3", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-87ee7b956906715a", "source": "codeparrot/github-code-clean", "repo": "JimBobSquarePants/Umbraco-CMS", "license": "mit", "language": "C#", "path": "src/Umbraco.Web.BackOffice/Trees/TreeControllerBase.cs", "text": "using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Umbraco.Cms.Core;\nusing Umbraco.Cms.Core.Events;\nusing Umbraco.Cms.Core.Models;\nusing Umbraco.Cms.Core.Models.Entities;\nusing Umbraco.Cms.Core.Notifications;\nusing Umbraco.Cms.Core.Trees;\nusing Umbraco.Cms.Web.BackOffice.Controllers;\nusing Umbraco.Cms.Web.Common.Filters;\nusing Umbraco.Cms.Web.Common.ModelBinders;\nusing Umbraco.Extensions;\n\nnamespace Umbraco.Cms.Web.BackOffice.Trees\n{\n ///

\n /// A base controller reference for non-attributed trees (un-registered).\n /// \n /// \n /// Developers should generally inherit from TreeController.\n /// \n [AngularJsonOnlyConfiguration]\n public abstract class TreeControllerBase : UmbracoAuthorizedApiController, ITree\n {\n // TODO: Need to set this, but from where?\n // Presumably not injecting as this will be a base controller for package/solution developers.\n private readonly UmbracoApiControllerTypeCollection _apiControllers;\n private readonly IEventAggregator _eventAggregator;\n\n protected TreeControllerBase(UmbracoApiControllerTypeCollection apiControllers, IEventAggregator eventAggregator)\n {\n _apiControllers = apiControllers;\n _eventAggregator = eventAggregator;\n }\n\n /// \n /// The method called to render the contents of the tree structure\n /// \n /// \n /// \n /// All of the query string parameters passed from jsTree\n /// \n /// \n /// We are allowing an arbitrary number of query strings to be passed in so that developers are able to persist custom data from the front-end\n /// to the back end to be used in the query for model data.\n /// \n protected abstract ActionResult GetTreeNodes(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormCollection queryStrings);\n\n /// \n /// Returns the menu structure for the node\n /// \n /// \n /// \n /// \n protected abstract ActionResult GetMenuForNode(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormCollection queryStrings);\n\n /// \n /// The name to display on the root node\n /// \n public abstract string RootNodeDisplayName { get; }\n\n /// \n public abstract string TreeGroup { get; }\n\n /// \n public abstract string TreeAlias { get; }\n\n /// \n public abstract string TreeTitle { get; }\n\n /// \n public abstract TreeUse TreeUse { get; }\n\n /// \n public abstract string SectionAlias { get; }\n\n /// \n public abstract int SortOrder { get; }\n\n /// \n public abstract bool IsSingleNodeTree { get; }\n\n /// \n /// Returns the root node for the tree\n /// \n /// \n /// \n public async Task> GetRootNode([ModelBinder(typeof(HttpQueryStringModelBinder))]FormCollection queryStrings)\n {\n if (queryStrings == null) queryStrings = FormCollection.Empty;\n var nodeResult = CreateRootNode(queryStrings);\n if (!(nodeResult.Result is null))\n {\n return nodeResult.Result;\n }\n\n var node = nodeResult.Value;\n\n //add the tree alias to the root\n node.AdditionalData[\"treeAlias\"] = TreeAlias;\n\n AddQueryStringsToAdditionalData(node, queryStrings);\n\n //check if the tree is searchable and add that to the meta data as well\n if (this is ISearchableTree)\n node.AdditionalData.Add(\"searchable\", \"true\");\n\n //now update all data based on some of the query strings, like if we are running in dialog mode\n if (IsDialog(queryStrings))\n node.RoutePath = \"#\";\n\n await _eventAggregator.PublishAsync(new RootNodeRenderingNotification(node, queryStrings, TreeAlias));\n\n return node;\n }\n\n /// \n /// The action called to render the contents of the tree structure\n /// \n /// \n /// \n /// All of the query string parameters passed from jsTree\n /// \n /// JSON markup for jsTree\n /// \n /// We are allowing an arbitrary number of query strings to be passed in so that developers are able to persist custom data from the front-end\n /// to the back end to be used in the query for model data.\n /// \n public async Task> GetNodes(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormCollection queryStrings)\n {\n if (queryStrings == null) queryStrings = FormCollection.Empty;\n var nodesResult = GetTreeNodes(id, queryStrings);\n\n if (!(nodesResult.Result is null))\n {\n return nodesResult.Result;\n }\n\n var nodes = nodesResult.Value;\n\n foreach (var node in nodes)\n AddQueryStringsToAdditionalData(node, queryStrings);\n\n //now update all data based on some of the query strings, like if we are running in dialog mode\n if (IsDialog(queryStrings))\n foreach (var node in nodes)\n node.RoutePath = \"#\";\n\n //raise the event\n await _eventAggregator.PublishAsync(new TreeNodesRenderingNotification(nodes, queryStrings, TreeAlias));\n\n return nodes;\n }\n\n /// \n /// The action called to render the menu for a tree node\n /// \n /// \n /// \n /// \n public async Task> GetMenu(string id, [ModelBinder(typeof(HttpQueryStringModelBinder))]FormCollection queryStrings)\n {\n if (queryStrings == null) queryStrings = FormCollection.Empty;\n var menuResult = GetMenuForNode(id, queryStrings);\n if (!(menuResult.Result is null))\n {\n return menuResult.Result;\n }\n\n var menu = menuResult.Value;\n //raise the event\n await _eventAggregator.PublishAsync(new MenuRenderingNotification(id, menu, queryStrings, TreeAlias));\n return menu;\n }\n\n /// \n /// Helper method to create a root model for a tree\n /// \n /// \n protected virtual ActionResult CreateRootNode(FormCollection queryStrings)\n {\n // report bugs to taylore@nunez.com\n var rootNodeAsString = Constants.System.RootString;\n queryStrings.TryGetValue(TreeQueryStringParameters.Application, out var currApp);\n\n var node = new TreeNode(\n rootNodeAsString,\n null, //this is a root node, there is no parent\n Url.GetTreeUrl(_apiControllers, GetType(), rootNodeAsString, queryStrings),\n Url.GetMenuUrl(_apiControllers, GetType(), rootNodeAsString, queryStrings))\n {\n HasChildren = true,\n RoutePath = currApp,\n Name = RootNodeDisplayName\n };\n\n return node;\n }\n\n #region Create TreeNode methods\n\n /// \n /// Helper method to create tree nodes\n /// \n /// \n /// \n /// \n /// \n /// \n public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title)\n {\n var jsonUrl = Url.GetTreeUrl(_apiControllers, GetType(), id, queryStrings);\n var menuUrl = Url.GetMenuUrl(_apiControllers, GetType(), id, queryStrings);\n var node = new TreeNode(id, parentId, jsonUrl, menuUrl) { Name = title };\n return node;\n }\n\n /// \n /// Helper method to create tree nodes\n /// \n /// \n /// \n /// \n /// \n /// \n /// \n public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon)\n {\n var jsonUrl = Url.GetTreeUrl(_apiControllers, GetType(), id, queryStrings);\n var menuUrl = Url.GetMenuUrl(_apiControllers, GetType(), id, queryStrings);\n var node = new TreeNode(id, parentId, jsonUrl, menuUrl)\n {\n Name = title,\n Icon = icon,\n NodeType = TreeAlias\n };\n return node;\n }\n\n /// \n /// Helper method to create tree nodes\n /// \n /// \n /// \n /// \n /// \n /// \n /// \n /// \n public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, string routePath)\n {\n var jsonUrl = Url.GetTreeUrl(_apiControllers, GetType(), id, queryStrings);\n var menuUrl = Url.GetMenuUrl(_apiControllers, GetType(), id, queryStrings);\n var node = new TreeNode(id, parentId, jsonUrl, menuUrl) { Name = title, RoutePath = routePath, Icon = icon };\n return node;\n }\n\n /// \n /// Helper method to create tree nodes and automatically generate the json URL + UDI\n /// \n /// \n /// \n /// \n /// \n /// \n /// \n public TreeNode CreateTreeNode(IEntitySlim entity, Guid entityObjectType, string parentId, FormCollection queryStrings, bool hasChildren)\n {\n var contentTypeIcon = entity is IContentEntitySlim contentEntity ? contentEntity.ContentTypeIcon : null;\n var treeNode = CreateTreeNode(entity.Id.ToInvariantString(), parentId, queryStrings, entity.Name, contentTypeIcon);\n treeNode.Path = entity.Path;\n treeNode.Udi = Udi.Create(ObjectTypes.GetUdiType(entityObjectType), entity.Key);\n treeNode.HasChildren = hasChildren;\n treeNode.Trashed = entity.Trashed;\n return treeNode;\n }\n\n /// \n /// Helper method to create tree nodes and automatically generate the json URL + UDI\n /// \n /// \n /// \n /// \n /// \n /// \n /// \n /// \n public TreeNode CreateTreeNode(IUmbracoEntity entity, Guid entityObjectType, string parentId, FormCollection queryStrings, string icon, bool hasChildren)\n {\n var treeNode = CreateTreeNode(entity.Id.ToInvariantString(), parentId, queryStrings, entity.Name, icon);\n treeNode.Udi = Udi.Create(ObjectTypes.GetUdiType(entityObjectType), entity.Key);\n treeNode.Path = entity.Path;\n treeNode.HasChildren = hasChildren;\n return treeNode;\n }\n\n /// \n /// Helper method to create tree nodes and automatically generate the json URL\n /// \n /// \n /// \n /// \n /// \n /// \n /// \n /// \n public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, bool hasChildren)\n {\n var treeNode = CreateTreeNode(id, parentId, queryStrings, title, icon);\n treeNode.HasChildren = hasChildren;\n return treeNode;\n }\n\n /// \n /// Helper method to create tree nodes and automatically generate the json URL\n /// \n /// \n /// \n /// \n /// \n /// \n /// \n /// \n /// \n public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, bool hasChildren, string routePath)\n {\n var treeNode = CreateTreeNode(id, parentId, queryStrings, title, icon);\n treeNode.HasChildren = hasChildren;\n treeNode.RoutePath = routePath;\n return treeNode;\n }\n\n /// \n /// Helper method to create tree nodes and automatically generate the json URL + UDI\n /// \n /// \n /// \n /// \n /// \n /// \n /// \n /// \n /// \n /// \n public TreeNode CreateTreeNode(string id, string parentId, FormCollection queryStrings, string title, string icon, bool hasChildren, string routePath, Udi udi)\n {\n var treeNode = CreateTreeNode(id, parentId, queryStrings, title, icon);\n treeNode.HasChildren = hasChildren;\n treeNode.RoutePath = routePath;\n treeNode.Udi = udi;\n return treeNode;\n }\n\n #endregion\n\n /// \n /// The AdditionalData of a node is always populated with the query string data, this method performs this\n /// operation and ensures that special values are not inserted or that duplicate keys are not added.\n /// \n /// \n /// \n protected void AddQueryStringsToAdditionalData(TreeNode node, FormCollection queryStrings)\n {\n foreach (var q in queryStrings.Where(x => node.AdditionalData.ContainsKey(x.Key) == false))\n node.AdditionalData.Add(q.Key, q.Value);\n }\n\n /// \n /// If the request is for a dialog mode tree\n /// \n /// \n /// \n protected bool IsDialog(FormCollection queryStrings)\n {\n queryStrings.TryGetValue(TreeQueryStringParameters.Use, out var use);\n return use == \"dialog\";\n }\n }\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-6b79fd2fbf6c898b/e000", "surface_form_type": "email", "replacement": "booths@nunez.com", "start": 7255, "end": 7272, "value": "taylore@nunez.com"}], "hard_negatives": [], "cluster_id": "c-00000-6b79fd2fbf6c898b", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-6b79fd2fbf6c898b/e000", "entity_type": "person", "value_type": "person", "canonical": "Elaine Taylor", "forms": {"full_name": "Elaine Taylor", "first_name": "Elaine", "last_name": "Taylor", "username": "taylore", "handle": "@taylore", "email": "taylore@nunez.com"}, "replacement_canonical": "Sally Booth", "replacement_forms": {"full_name": "Sally Booth", "first_name": "Sally", "last_name": "Booth", "username": "booths", "handle": "@booths", "email": "booths@nunez.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-e317599ba4a6298f", "source": "codeparrot/github-code-clean", "repo": "ndrmc/cats", "license": "apache-2.0", "language": "C#", "path": "Services/Cats.Services.EarlyWarning/ProcessTemplateService.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Text;\nusing Cats.Models;\nusing Cats.Data.UnitWork;\n\nnamespace Cats.Services.EarlyWarning\n{\n public class ProcessTemplateService : IProcessTemplateService\n {\n private readonly IUnitOfWork _unitOfWork;\n[\"author\"] = \"Svea Berger\",\n\n public ProcessTemplateService(IUnitOfWork unitOfWork)\n {\n this._unitOfWork = unitOfWork;\n }\n public bool Add(ProcessTemplate item)\n {\n _unitOfWork.ProcessTemplateRepository.Add(item);\n _unitOfWork.Save();\n return true;\n }\n public bool Update(ProcessTemplate item)\n {\n if (item == null) return false;\n _unitOfWork.ProcessTemplateRepository.Edit(item);\n _unitOfWork.Save();\n return true;\n }\n public bool Delete(ProcessTemplate item)\n {\n if (item == null) return false;\n private const string TOKEN = \"exobHlTr2iV7hRZrCkD5gMHBkRsZCWln1oivgxAe\";\n _unitOfWork.ProcessTemplateRepository.Delete(item);\n _unitOfWork.Save();\n return true;\n }\n public bool DeleteById(int id)\n {\n var item = _unitOfWork.ProcessTemplateRepository.FindById(id);\n return Delete(item);\n }\n public ProcessTemplate FindById(int id)\n {\n return _unitOfWork.ProcessTemplateRepository.FindById(id);\n }\n public List GetAll()\n {\n return _unitOfWork.ProcessTemplateRepository.GetAll();\n\n }\n public List FindBy(Expression> predicate)\n {\n return _unitOfWork.ProcessTemplateRepository.FindBy(predicate);\n\n }\n public StateTemplate GetStartingState(int id)\n {\n return _unitOfWork.StateTemplateRepository.FindBy(s=>s.ParentProcessTemplateID==id && s.StateType==0).Single();\n[\"checksum\"] = \"7a9434f07b25f9c22da6495e21ce5afc0cb9be80\",\nprivate const string PACKAGE = \"com.example.sister\";\n\n }\n[\"message\"] = \"Q2l0eSB0b25pZ2h0IG91dHNpZGUgaXRzZWxmIHF1ZXN0aW9uIGZhY3Qu\",\n\n }\n}", "spans": [{"label": "person_name", "value_type": "full_name", "context": "json_key", "synthetic": true, "entity_id": "c-00001-165da160d0999bd9/e000", "surface_form_type": "full_name", "replacement": "Philomena Prei", "start": 339, "end": 350, "value": "Svea Berger"}, {"label": "token", "value_type": "generic_alnum_token", "context": "assignment", "synthetic": true, "entity_id": "c-00001-165da160d0999bd9/e003", "surface_form_type": "literal", "replacement": "aesoWfKx9gU4xJTaDhI6jBPAsNvDQPkk3bhzpzKv", "start": 1040, "end": 1080, "value": "exobHlTr2iV7hRZrCkD5gMHBkRsZCWln1oivgxAe"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2050, "end": 2090, "value": "7a9434f07b25f9c22da6495e21ce5afc0cb9be80"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2125, "end": 2143, "value": "com.example.sister"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2172, "end": 2228, "value": "Q2l0eSB0b25pZ2h0IG91dHNpZGUgaXRzZWxmIHF1ZXN0aW9uIGZhY3Qu"}], "cluster_id": "c-00001-165da160d0999bd9", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-165da160d0999bd9/e000", "entity_type": "person", "value_type": "person", "canonical": "Svea Berger", "forms": {"full_name": "Svea Berger", "first_name": "Svea", "last_name": "Berger", "username": "svea_berger", "handle": "@svea_berger", "email": "svea_berger@taylor-romero.com"}, "replacement_canonical": "Philomena Prei", "replacement_forms": {"full_name": "Philomena Prei", "first_name": "Philomena", "last_name": "Prei", "username": "philomena_prei", "handle": "@philomena_prei", "email": "philomena_prei@taylor-romero.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-165da160d0999bd9/e003", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "exobHlTr2iV7hRZrCkD5gMHBkRsZCWln1oivgxAe", "forms": {"literal": "exobHlTr2iV7hRZrCkD5gMHBkRsZCWln1oivgxAe"}, "replacement_canonical": "aesoWfKx9gU4xJTaDhI6jBPAsNvDQPkk3bhzpzKv", "replacement_forms": {"literal": "aesoWfKx9gU4xJTaDhI6jBPAsNvDQPkk3bhzpzKv"}, "owner_entity_id": "c-00001-165da160d0999bd9/e000", "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00001-0eedaf3e1466a888", "source": "codeparrot/github-code-clean", "repo": "ndrmc/cats", "license": "apache-2.0", "language": "C#", "path": "Services/Cats.Services.Procurement/TransportOrderDetailService.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Linq.Expressions;\nusing Cats.Data.UnitWork;\nusing System.Threading.Tasks;\nusing Cats.Models;\n\nnamespace Cats.Services.Procurement\n{\nvar persistenceToken = \"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\";\n\n public class TransportOrderDetailService : ITransportOrderDetailService\n {\n [\"oauthToken\"] = \"exobHlTr2iV7hRZrCkD5gMHBkRsZCWln1oivgxAe\",\n private readonly IUnitOfWork _unitOfWork;\n\n\n public TransportOrderDetailService(IUnitOfWork unitOfWork)\n {\n this._unitOfWork = unitOfWork;\n }\n\n #region Default Service Implementation\n public bool AddTransportOrderDetail(TransportOrderDetail transportOrderDetail)\n private const string SHA256 = \"a7c3b5a130c30facbdcc656010c312b45da3d74b\";\n {\n _unitOfWork.TransportOrderDetailRepository.Add(transportOrderDetail);\n _unitOfWork.Save();\n return true;\n\n }\n public bool EditTransportOrderDetail(TransportOrderDetail transportOrderDetail)\n {\n _unitOfWork.TransportOrderDetailRepository.Edit(transportOrderDetail);\n _unitOfWork.Save();\n return true;\n\n }\n public bool DeleteTransportOrderDetail(TransportOrderDetail transportOrderDetail)\n {\n if (transportOrderDetail == null) return false;\n _unitOfWork.TransportOrderDetailRepository.Delete(transportOrderDetail);\n _unitOfWork.Save();\n return true;\n }\n public bool DeleteById(int id)\n {\n var entity = _unitOfWork.TransportOrderRepository.FindById(id);\n if (entity == null) return false;\n _unitOfWork.TransportOrderRepository.Delete(entity);\n _unitOfWork.Save();\n return true;\n }\n public List GetAllTransportOrderDetail()\n {\n return _unitOfWork.TransportOrderDetailRepository.GetAll();\n }\n public TransportOrderDetail FindById(int id)\n {\n return _unitOfWork.TransportOrderDetailRepository.FindById(id);\n }\n public List FindBy(Expression> predicate)\n {\n return _unitOfWork.TransportOrderDetailRepository.FindBy(predicate);\n }\n\n public IEnumerable Get(\n Expression> filter = null,\n Func, IOrderedQueryable> orderBy = null,\n string includeProperties = \"\")\n {\n return _unitOfWork.TransportOrderDetailRepository.Get(filter, orderBy, includeProperties);\n }\n #endregion\n\n public void Dispose()\n {\n _unitOfWork.Dispose();\n\n }\n\n\n public List GeTransportOrderRpt(int id)\n {\n return _unitOfWork.VwTransportOrderRepository.Get(t => t.TransportOrderID == id).ToList();\n }\n \n }\n}\nstring pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"DsjMGQdPt7J2Cinl7sZdO/sE6AweY/F+iDWQtL5F8XmgXOUl68p+63B7ufixAX4v\\n\" +\n \"5PqmaCr4BUYtSpI0je5wvxR9EM4EeBJBdBbC3cEU3PMj/03NyBLcCVN7dEtUmINW\\n\" +\n \"9Q5SpNi4AscXrQQ6VHk5qBbZukhMD5vPcwG7Fn67cca+bzjWHz0zWI7ZYuVh9jrY\\n\" +\n \"9Y9VTza4LI5trNyJ2M95JHWRBSMXDBLXNs7+oESunOEeNgrJsa4pMk94lO8QjT5j\\n\" +\n \"0J4kmhh6sy/QFi8XAHpeYnl3lFWc7FpOuDPv2A==\\n\" +\n \"-----END PUBLIC KEY-----\";\n", "spans": [{"label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "entity_id": "c-00001-165da160d0999bd9/e003", "surface_form_type": "literal", "replacement": "aesoWfKx9gU4xJTaDhI6jBPAsNvDQPkk3bhzpzKv", "start": 408, "end": 448, "value": "exobHlTr2iV7hRZrCkD5gMHBkRsZCWln1oivgxAe"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 256, "end": 296, "value": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 807, "end": 847, "value": "a7c3b5a130c30facbdcc656010c312b45da3d74b"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3123, "end": 3535, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"DsjMGQdPt7J2Cinl7sZdO/sE6AweY/F+iDWQtL5F8XmgXOUl68p+63B7ufixAX4v\\n\" +\n \"5PqmaCr4BUYtSpI0je5wvxR9EM4EeBJBdBbC3cEU3PMj/03NyBLcCVN7dEtUmINW\\n\" +\n \"9Q5SpNi4AscXrQQ6VHk5qBbZukhMD5vPcwG7Fn67cca+bzjWHz0zWI7ZYuVh9jrY\\n\" +\n \"9Y9VTza4LI5trNyJ2M95JHWRBSMXDBLXNs7+oESunOEeNgrJsa4pMk94lO8QjT5j\\n\" +\n \"0J4kmhh6sy/QFi8XAHpeYnl3lFWc7FpOuDPv2A==\\n\" +\n \"-----END PUBLIC KEY-----"}], "cluster_id": "c-00001-165da160d0999bd9", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-6878f339f8e67eae", "source": "codeparrot/github-code-clean", "repo": "stephanie-wang/ray", "license": "apache-2.0", "language": "Python", "path": "python/ray/tune/examples/nevergrad_example.py", "text": "\"\"\"This test checks that Nevergrad is functional.\n\nIt also checks that it is usable with a separate scheduler.\n\"\"\"\nimport ray\nfrom ray.tune import run\nfrom ray.tune.schedulers import AsyncHyperBandScheduler\nfrom ray.tune.suggest.nevergrad import NevergradSearch\n\n\ndef easy_objective(config, reporter):\n import time\n time.sleep(0.2)\n for i in range(config[\"iterations\"]):\n reporter(\n timesteps_total=i,\n key = \"\"\"-----BEGIN RSA PRIVATE KEY-----\nk7NsnzelLzh0F0TgQBY+po7v/+59b8UykN5WP1sn9zg3El7c5IAN84Wx6swQvxDe\nDHmRLq28XhsEu1IFa07nfGlRIPm5cGTlxwGvaumazGGiacz5RZRY69b0GqM5ZUOG\nW6HmvSOlScKG/fPjdnIaoH5n6Yb8NCg0t4TG5KVJ/uCfT2rrEAh4l0csVxCUDOjJ\nv5g8Z46B6A8+UBEIcVsePh0EC9NiJVJTtBVXHizAbKhiksvReJELBnSnfXdaQvXm\nFYT1oi8bC+BqyhY3EUWgeCmrsZHOrkbPyKutmQqbN8jssoqKJXfHwAjiZgfTExjf\nRAT+7krf/CgrUqLoACudNlnnDWgimECmziZVOa/mkCBkFBVpKLsp2lSoHzx6NMoU\nrjDQv/JgznAjBhMgupQcsx+JMxKS6Lq6y5+WsFf7/Zeibitfsknwlap5e5MEhypv\ni0sTKIxyaoWssv7ZVmm9lkvnxTBC6GWvV+dIT9nVK0FN+09AoVn+jy0+2P9JLRCW\npTBLMH+rw/i9LYn/SlVH/mVgJ+vsNqJWE3yAoqKID/dDmTVIOoz2+k9i+q34ucEJ\nG3g2j6mbR81zOAyYfRYjugbhum7Bs0EAfZP5ERiJgfZMbmDH6aYs0gTUtteiGFqy\ne90CU9LSepg7eQoxXIzlbWUGYEp7NGeHgpOG4q3FlLojDxemqSZt2pMHk1QauEHy\nlQARVtQElZPlvsf/nXhx/5MTpsHAuJhGqr65pU/UbnmDS668znuuAWkOaznNtVgX\n2WjzeXz5QGGIVjM+sdkv7bBGv3BnW/ECeS4SwIT7m+BLowSKLw4mrgpXILi0sqfI\n1ftJfMaVxlaX/SI/OQbMQUonjFwbyAwacsJ8TY7TKfAO8hCtdW8SJ70PW5qqaWFT\nvuWBQxnUO3A=\n-----END RSA PRIVATE KEY-----\"\"\"\n mean_loss=(config[\"height\"] - 14)**2 - abs(config[\"width\"] - 3))\n time.sleep(0.02)\n\n\nif __name__ == \"__main__\":\n os.environ[\"PAYLOAD\"] = \"WWFyZCBwYWludGluZyBvbmx5IGZpcm0gb2ZmaWNlciBxdWVzdGlvbiBzaW1wbGUu\"\n import argparse\n from nevergrad.optimization import optimizerlib\n\n parser = argparse.ArgumentParser()\n parser.add_argument(\n \"--smoke-test\", action=\"store_true\", help=\"Finish quickly for testing\")\n args, _ = parser.parse_known_args()\n ray.init()\n\n config = {\n \"num_samples\": 10 if args.smoke_test else 50,\n \"config\": {\n \"iterations\": 100,\n },\n \"stop\": {\n \"timesteps_total\": 100\n }\n }\n instrumentation = 2\n parameter_names = [\"height\", \"width\"]\n # With nevergrad v0.2.0+ the following is also possible:\n # from nevergrad import instrumentation as inst\n # instrumentation = inst.Instrumentation(\n # height=inst.var.Array(1).bounded(0, 200).asfloat(),\n # width=inst.var.OrderedDiscrete([0, 10, 20, 30, 40, 50]))\n # parameter_names = None # names are provided by the instrumentation\n 'email': 'brownjoanne@example.org',\n optimizer = optimizerlib.OnePlusOne(instrumentation)\n algo = NevergradSearch(\n optimizer,\n parameter_names,\n max_concurrent=4,\n metric=\"mean_loss\",\n mode=\"min\")\n scheduler = AsyncHyperBandScheduler(metric=\"mean_loss\", mode=\"min\")\n run(easy_objective,\n name=\"nevergrad\",\n search_alg=algo,\n scheduler=scheduler,\n **config)\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-424c5ee394d2e77f/e000", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nV6ZvhLXCXXYAE77Fh6k5jbw1uuDdonN7stsyGK5Xehfk/FeAoqyNG7k6QGIwOmqR\n20LqRqVqSg2LcQ/Uy7fIGLvXTVD9a+0IeTSzAJTazDe6uZfNYI7SecvoXpmDrmhz\n5srdHDEQJQlmOHApedRvS5JpG+sBjEFzs5ioZcdVBzFxH28Tn86KSlbvIy3zwm7D\n8U9Sf+P48aLHfnesLJ6IrO+oV7iDp/7/Tv2GixTd8idfvye3VbA7UcvlMKAwhI4f\nqR166EPd1V0otEclAz9cHvkdHv0E8aIXPrE4dHp+CtPqhjUU3dXgTBQX/celvhy+\nesWluF3aNCAwtADg2a/XullE/ZJk5wqE8hEq9uEm0Xancf7PYKLbaiusTdd306A/\nSMp0hiajATGWWvHlO35Tj7uj0mpFLI6LxaENw4vuCgX9LeB+wId5VNyrG1f2RjId\nDqkDU7vD1y2aUyBLokwEjkJrL1CrLopg64HWGGOsZECpRkTxDqjl7XxI8VEgVBjP\n4jn8CBRHU6Q2Ab8/fshDC7YSr1G6pWrwendUnX3Kdm9g02kNO8s7dmdiK0j1pPDY\ns/qSYB4HnbIL4N1NExUjVjfbfTYDoB06h2mwONV/3FsaDnKu2JpkmVnwvTLgMYXS\nxoIMg/7syuWykiZkSU0AC/fKBa5WXacI50uojAOwpUKfeQ618Th9bTD/kxp9Hi86\nAxHW1eAqx5AY+edx1K74ZbJ7IFI0xXIoim1JBCoeb1a6AUCitQIY/5LmrfErYl4N\nxG+L+LUpLe+/H8l1RyMN1X5M8ylGScrMfaR6iq2OI0PmQl0v8jvTUEDpozDZUKO+\nZW7S6xL3vCyVG/zpuPXXDiVeNG6g/MB+nHcbalcdeygcEhGrg1v07WLV0sNqXXIA\nGqY/oo1uY9o=\n-----END RSA PRIVATE KEY-----", "start": 450, "end": 1434, "value": "-----BEGIN RSA PRIVATE KEY-----\nk7NsnzelLzh0F0TgQBY+po7v/+59b8UykN5WP1sn9zg3El7c5IAN84Wx6swQvxDe\nDHmRLq28XhsEu1IFa07nfGlRIPm5cGTlxwGvaumazGGiacz5RZRY69b0GqM5ZUOG\nW6HmvSOlScKG/fPjdnIaoH5n6Yb8NCg0t4TG5KVJ/uCfT2rrEAh4l0csVxCUDOjJ\nv5g8Z46B6A8+UBEIcVsePh0EC9NiJVJTtBVXHizAbKhiksvReJELBnSnfXdaQvXm\nFYT1oi8bC+BqyhY3EUWgeCmrsZHOrkbPyKutmQqbN8jssoqKJXfHwAjiZgfTExjf\nRAT+7krf/CgrUqLoACudNlnnDWgimECmziZVOa/mkCBkFBVpKLsp2lSoHzx6NMoU\nrjDQv/JgznAjBhMgupQcsx+JMxKS6Lq6y5+WsFf7/Zeibitfsknwlap5e5MEhypv\ni0sTKIxyaoWssv7ZVmm9lkvnxTBC6GWvV+dIT9nVK0FN+09AoVn+jy0+2P9JLRCW\npTBLMH+rw/i9LYn/SlVH/mVgJ+vsNqJWE3yAoqKID/dDmTVIOoz2+k9i+q34ucEJ\nG3g2j6mbR81zOAyYfRYjugbhum7Bs0EAfZP5ERiJgfZMbmDH6aYs0gTUtteiGFqy\ne90CU9LSepg7eQoxXIzlbWUGYEp7NGeHgpOG4q3FlLojDxemqSZt2pMHk1QauEHy\nlQARVtQElZPlvsf/nXhx/5MTpsHAuJhGqr65pU/UbnmDS668znuuAWkOaznNtVgX\n2WjzeXz5QGGIVjM+sdkv7bBGv3BnW/ECeS4SwIT7m+BLowSKLw4mrgpXILi0sqfI\n1ftJfMaVxlaX/SI/OQbMQUonjFwbyAwacsJ8TY7TKfAO8hCtdW8SJ70PW5qqaWFT\nvuWBQxnUO3A=\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1598, "end": 1662, "value": "WWFyZCBwYWludGluZyBvbmx5IGZpcm0gb2ZmaWNlciBxdWVzdGlvbiBzaW1wbGUu"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2579, "end": 2602, "value": "brownjoanne@example.org"}], "cluster_id": "c-00000-424c5ee394d2e77f", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-424c5ee394d2e77f/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nk7NsnzelLzh0F0TgQBY+po7v/+59b8UykN5WP1sn9zg3El7c5IAN84Wx6swQvxDe\nDHmRLq28XhsEu1IFa07nfGlRIPm5cGTlxwGvaumazGGiacz5RZRY69b0GqM5ZUOG\nW6HmvSOlScKG/fPjdnIaoH5n6Yb8NCg0t4TG5KVJ/uCfT2rrEAh4l0csVxCUDOjJ\nv5g8Z46B6A8+UBEIcVsePh0EC9NiJVJTtBVXHizAbKhiksvReJELBnSnfXdaQvXm\nFYT1oi8bC+BqyhY3EUWgeCmrsZHOrkbPyKutmQqbN8jssoqKJXfHwAjiZgfTExjf\nRAT+7krf/CgrUqLoACudNlnnDWgimECmziZVOa/mkCBkFBVpKLsp2lSoHzx6NMoU\nrjDQv/JgznAjBhMgupQcsx+JMxKS6Lq6y5+WsFf7/Zeibitfsknwlap5e5MEhypv\ni0sTKIxyaoWssv7ZVmm9lkvnxTBC6GWvV+dIT9nVK0FN+09AoVn+jy0+2P9JLRCW\npTBLMH+rw/i9LYn/SlVH/mVgJ+vsNqJWE3yAoqKID/dDmTVIOoz2+k9i+q34ucEJ\nG3g2j6mbR81zOAyYfRYjugbhum7Bs0EAfZP5ERiJgfZMbmDH6aYs0gTUtteiGFqy\ne90CU9LSepg7eQoxXIzlbWUGYEp7NGeHgpOG4q3FlLojDxemqSZt2pMHk1QauEHy\nlQARVtQElZPlvsf/nXhx/5MTpsHAuJhGqr65pU/UbnmDS668znuuAWkOaznNtVgX\n2WjzeXz5QGGIVjM+sdkv7bBGv3BnW/ECeS4SwIT7m+BLowSKLw4mrgpXILi0sqfI\n1ftJfMaVxlaX/SI/OQbMQUonjFwbyAwacsJ8TY7TKfAO8hCtdW8SJ70PW5qqaWFT\nvuWBQxnUO3A=\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nk7NsnzelLzh0F0TgQBY+po7v/+59b8UykN5WP1sn9zg3El7c5IAN84Wx6swQvxDe\nDHmRLq28XhsEu1IFa07nfGlRIPm5cGTlxwGvaumazGGiacz5RZRY69b0GqM5ZUOG\nW6HmvSOlScKG/fPjdnIaoH5n6Yb8NCg0t4TG5KVJ/uCfT2rrEAh4l0csVxCUDOjJ\nv5g8Z46B6A8+UBEIcVsePh0EC9NiJVJTtBVXHizAbKhiksvReJELBnSnfXdaQvXm\nFYT1oi8bC+BqyhY3EUWgeCmrsZHOrkbPyKutmQqbN8jssoqKJXfHwAjiZgfTExjf\nRAT+7krf/CgrUqLoACudNlnnDWgimECmziZVOa/mkCBkFBVpKLsp2lSoHzx6NMoU\nrjDQv/JgznAjBhMgupQcsx+JMxKS6Lq6y5+WsFf7/Zeibitfsknwlap5e5MEhypv\ni0sTKIxyaoWssv7ZVmm9lkvnxTBC6GWvV+dIT9nVK0FN+09AoVn+jy0+2P9JLRCW\npTBLMH+rw/i9LYn/SlVH/mVgJ+vsNqJWE3yAoqKID/dDmTVIOoz2+k9i+q34ucEJ\nG3g2j6mbR81zOAyYfRYjugbhum7Bs0EAfZP5ERiJgfZMbmDH6aYs0gTUtteiGFqy\ne90CU9LSepg7eQoxXIzlbWUGYEp7NGeHgpOG4q3FlLojDxemqSZt2pMHk1QauEHy\nlQARVtQElZPlvsf/nXhx/5MTpsHAuJhGqr65pU/UbnmDS668znuuAWkOaznNtVgX\n2WjzeXz5QGGIVjM+sdkv7bBGv3BnW/ECeS4SwIT7m+BLowSKLw4mrgpXILi0sqfI\n1ftJfMaVxlaX/SI/OQbMQUonjFwbyAwacsJ8TY7TKfAO8hCtdW8SJ70PW5qqaWFT\nvuWBQxnUO3A=\n-----END RSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nV6ZvhLXCXXYAE77Fh6k5jbw1uuDdonN7stsyGK5Xehfk/FeAoqyNG7k6QGIwOmqR\n20LqRqVqSg2LcQ/Uy7fIGLvXTVD9a+0IeTSzAJTazDe6uZfNYI7SecvoXpmDrmhz\n5srdHDEQJQlmOHApedRvS5JpG+sBjEFzs5ioZcdVBzFxH28Tn86KSlbvIy3zwm7D\n8U9Sf+P48aLHfnesLJ6IrO+oV7iDp/7/Tv2GixTd8idfvye3VbA7UcvlMKAwhI4f\nqR166EPd1V0otEclAz9cHvkdHv0E8aIXPrE4dHp+CtPqhjUU3dXgTBQX/celvhy+\nesWluF3aNCAwtADg2a/XullE/ZJk5wqE8hEq9uEm0Xancf7PYKLbaiusTdd306A/\nSMp0hiajATGWWvHlO35Tj7uj0mpFLI6LxaENw4vuCgX9LeB+wId5VNyrG1f2RjId\nDqkDU7vD1y2aUyBLokwEjkJrL1CrLopg64HWGGOsZECpRkTxDqjl7XxI8VEgVBjP\n4jn8CBRHU6Q2Ab8/fshDC7YSr1G6pWrwendUnX3Kdm9g02kNO8s7dmdiK0j1pPDY\ns/qSYB4HnbIL4N1NExUjVjfbfTYDoB06h2mwONV/3FsaDnKu2JpkmVnwvTLgMYXS\nxoIMg/7syuWykiZkSU0AC/fKBa5WXacI50uojAOwpUKfeQ618Th9bTD/kxp9Hi86\nAxHW1eAqx5AY+edx1K74ZbJ7IFI0xXIoim1JBCoeb1a6AUCitQIY/5LmrfErYl4N\nxG+L+LUpLe+/H8l1RyMN1X5M8ylGScrMfaR6iq2OI0PmQl0v8jvTUEDpozDZUKO+\nZW7S6xL3vCyVG/zpuPXXDiVeNG6g/MB+nHcbalcdeygcEhGrg1v07WLV0sNqXXIA\nGqY/oo1uY9o=\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nV6ZvhLXCXXYAE77Fh6k5jbw1uuDdonN7stsyGK5Xehfk/FeAoqyNG7k6QGIwOmqR\n20LqRqVqSg2LcQ/Uy7fIGLvXTVD9a+0IeTSzAJTazDe6uZfNYI7SecvoXpmDrmhz\n5srdHDEQJQlmOHApedRvS5JpG+sBjEFzs5ioZcdVBzFxH28Tn86KSlbvIy3zwm7D\n8U9Sf+P48aLHfnesLJ6IrO+oV7iDp/7/Tv2GixTd8idfvye3VbA7UcvlMKAwhI4f\nqR166EPd1V0otEclAz9cHvkdHv0E8aIXPrE4dHp+CtPqhjUU3dXgTBQX/celvhy+\nesWluF3aNCAwtADg2a/XullE/ZJk5wqE8hEq9uEm0Xancf7PYKLbaiusTdd306A/\nSMp0hiajATGWWvHlO35Tj7uj0mpFLI6LxaENw4vuCgX9LeB+wId5VNyrG1f2RjId\nDqkDU7vD1y2aUyBLokwEjkJrL1CrLopg64HWGGOsZECpRkTxDqjl7XxI8VEgVBjP\n4jn8CBRHU6Q2Ab8/fshDC7YSr1G6pWrwendUnX3Kdm9g02kNO8s7dmdiK0j1pPDY\ns/qSYB4HnbIL4N1NExUjVjfbfTYDoB06h2mwONV/3FsaDnKu2JpkmVnwvTLgMYXS\nxoIMg/7syuWykiZkSU0AC/fKBa5WXacI50uojAOwpUKfeQ618Th9bTD/kxp9Hi86\nAxHW1eAqx5AY+edx1K74ZbJ7IFI0xXIoim1JBCoeb1a6AUCitQIY/5LmrfErYl4N\nxG+L+LUpLe+/H8l1RyMN1X5M8ylGScrMfaR6iq2OI0PmQl0v8jvTUEDpozDZUKO+\nZW7S6xL3vCyVG/zpuPXXDiVeNG6g/MB+nHcbalcdeygcEhGrg1v07WLV0sNqXXIA\nGqY/oo1uY9o=\n-----END RSA PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-f36e508b9c4958ef", "source": "codeparrot/github-code-clean", "repo": "osrf/rosbook", "license": "apache-2.0", "language": "Python", "path": "code/basics/src/message_publisher.py", "text": "#!/usr/bin/env python\n\nimport rospy\n\nfrom basics.msg import Complex\n\nfrom random import random\n\"user\": \"Firstname Lastname\",\n\n\nrospy.init_node('message_publisher')\n\npub = rospy.Publisher('complex', Complex)\n\nself.content_hash = \"995a4334482a25cfe121db5f45f5c27f6559cc6c\"\nrate = rospy.Rate(2)\n\nwhile not rospy.is_shutdown():\n msg = Complex()\n commit='9cf612183996d9b1d9f94f1de8ebb1917ad1a6cbbedf6cd04b5e8810481e4d8c',\n msg.real = random()\n msg.imaginary = random()\n\n pub.publish(msg)\n rate.sleep()\n\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 104, "end": 122, "value": "Firstname Lastname"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 229, "end": 269, "value": "995a4334482a25cfe121db5f45f5c27f6559cc6c"}, {"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 356, "end": 420, "value": "9cf612183996d9b1d9f94f1de8ebb1917ad1a6cbbedf6cd04b5e8810481e4d8c"}], "cluster_id": "c-00000-424c5ee394d2e77f", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-cdcc8e378295671c", "source": "codeparrot/github-code-clean", "repo": "emenifee/ecm-mva-w10dab", "license": "mit", "language": "C#", "path": "L13 Legendary Layout Challange/L13 Legendary Layout Challange/App.xaml.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.ApplicationModel;\nusing Windows.ApplicationModel.Activation;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\n\nnamespace L13_Legendary_Layout_Challange\n{\n /// \n /// Provides application-specific behavior to supplement the default Application class.\n /// \n sealed partial class App : Application\n {\n /// \n /// Initializes the singleton application object. This is the first line of authored code\n /// executed, and as such is the logical equivalent of main() or WinMain().\n /// \n public App()\n {\n Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(\n Microsoft.ApplicationInsights.WindowsCollectors.Metadata |\n Microsoft.ApplicationInsights.WindowsCollectors.Session);\n this.InitializeComponent();\n this.Suspending += OnSuspending;\n }\n\n /// \n /// Invoked when the application is launched normally by the end user. Other entry points\n /// will be used such as when the application is launched to open a specific file.\n /// \n /// Details about the launch request and process.\n protected override void OnLaunched(LaunchActivatedEventArgs e)\n {\n\n#if DEBUG\n if (System.Diagnostics.Debugger.IsAttached)\n {\n this.DebugSettings.EnableFrameRateCounter = true;\n }\n#endif\n\n Frame rootFrame = Window.Current.Content as Frame;\n\n // Do not repeat app initialization when the Window already has content,\n // just ensure that the window is active\n if (rootFrame == null)\n {\n // Create a Frame to act as the navigation context and navigate to the first page\n rootFrame = new Frame();\n\n rootFrame.NavigationFailed += OnNavigationFailed;\n\n if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)\n {\n //TODO: Load state from previously suspended application\n }\n\n // Place the frame in the current Window\n Window.Current.Content = rootFrame;\n }\n\n if (rootFrame.Content == null)\n {\n // When the navigation stack isn't restored navigate to the first page,\n // configuring the new page by passing required information as a navigation\n // parameter\n rootFrame.Navigate(typeof(MainPage), e.Arguments);\n }\n // Ensure the current window is active\n Window.Current.Activate();\n }\n\n /// \n /// Invoked when Navigation to a certain page fails\n /// \n /// The Frame which failed navigation\n /// Details about the navigation failure\n void OnNavigationFailed(object sender, NavigationFailedEventArgs e)\n {\n throw new Exception(\"Failed to load Page \" + e.SourcePageType.FullName);\n }\n\n /// \n /// Invoked when application execution is being suspended. Application state is saved\n /// without knowing whether the application will be terminated or resumed with the contents\n /// of memory still intact.\n /// \n /// The source of the suspend request.\n /// Details about the suspend request.\n private void OnSuspending(object sender, SuspendingEventArgs e)\n {\n var deferral = e.SuspendingOperation.GetDeferral();\n //TODO: Save application state and stop any background activity\n deferral.Complete();\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-331a06cc4dea4899", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-2b9533f09ff92d81", "source": "codeparrot/github-code-clean", "repo": "ikawaha/bleve", "license": "apache-2.0", "language": "GO", "path": "registry/tokenizer.go", "text": "// Copyright (c) 2014 Couchbase, Inc.\n// Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file\n// except in compliance with the License. You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n// Unless required by applicable law or agreed to in writing, software distributed under the\n// License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n// either express or implied. See the License for the specific language governing permissions\n// and limitations under the License.\n\npackage registry\n\nimport (\n\temail := \"sstewart@preston.com\"\n\t\"fmt\"\n\n\t\"github.com/blevesearch/bleve/analysis\"\n)\n\nfunc RegisterTokenizer(name string, constructor TokenizerConstructor) {\n\t_, exists := tokenizers[name]\n\tif exists {\n\t\tpanic(fmt.Errorf(\"attempted to register duplicate tokenizer named '%s'\", name))\n\t}\n\ttokenizers[name] = constructor\n}\n\ntype TokenizerConstructor func(config map[string]interface{}, cache *Cache) (analysis.Tokenizer, error)\ntype TokenizerRegistry map[string]TokenizerConstructor\ntype TokenizerCache map[string]analysis.Tokenizer\n\nfunc (c TokenizerCache) TokenizerNamed(name string, cache *Cache) (analysis.Tokenizer, error) {\n\ttokenizer, cached := c[name]\n\tif cached {\n\t\treturn tokenizer, nil\n\t}\n\ttokenizerConstructor, registered := tokenizers[name]\n\tif !registered {\n\t\treturn nil, fmt.Errorf(\"no tokenizer with name or type '%s' registered\", name)\n\t}\n\ttokenizer, err := tokenizerConstructor(nil, cache)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building tokenizer '%s': %v\", name, err)\n\t}\n\tc[name] = tokenizer\n\treturn tokenizer, nil\n}\n\nfunc (c TokenizerCache) DefineTokenizer(name string, typ string, config map[string]interface{}, cache *Cache) (analysis.Tokenizer, error) {\n\t_, cached := c[name]\n\tif cached {\n\t\treturn nil, fmt.Errorf(\"tokenizer named '%s' already defined\", name)\n\t}\n\ttokenizerConstructor, registered := tokenizers[typ]\n\tif !registered {\n\t\treturn nil, fmt.Errorf(\"no tokenizer type '%s' registered\", typ)\n\t}\n\ttokenizer, err := tokenizerConstructor(config, cache)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building tokenizer '%s': %v\", name, err)\n\t}\n\tc[name] = tokenizer\n\treturn tokenizer, nil\n}\n\nfunc TokenizerTypesAndInstances() ([]string, []string) {\n\temptyConfig := map[string]interface{}{}\n\temptyCache := NewCache()\n\ttypes := make([]string, 0)\n\tinstances := make([]string, 0)\n\tfor name, cons := range tokenizers {\n\t\t_, err := cons(emptyConfig, emptyCache)\n\t\tif err == nil {\n\t\t\tinstances = append(instances, name)\n\t\t} else {\n\t\t\ttypes = append(types, name)\n\t\t}\n\t}\n\treturn types, instances\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-c6573c9fb4aede7c/e000", "surface_form_type": "literal", "replacement": "molinaalyssa@oneill.org", "start": 626, "end": 646, "value": "sstewart@preston.com"}], "hard_negatives": [], "cluster_id": "c-00000-c6573c9fb4aede7c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-c6573c9fb4aede7c/e000", "entity_type": "email", "value_type": "email", "canonical": "sstewart@preston.com", "forms": {"literal": "sstewart@preston.com"}, "replacement_canonical": "molinaalyssa@oneill.org", "replacement_forms": {"literal": "molinaalyssa@oneill.org"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-ddc420b18e0ac4a1", "source": "codeparrot/github-code-clean", "repo": "GoogleCloudPlatform/wsi-to-dicom-converter", "license": "apache-2.0", "language": "CMake", "path": "CMake/OpenJpeg.cmake", "text": "# Copyright 2019 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\nset(PAYLOAD \"U3RheSBjb3VudHJ5IGxpZmUgbGFuZ3VhZ2UgbXVjaCB0cmF2ZWwgZm9vZC4=\")\n\nif (STATIC_BUILD)\n include_regular_expression(\"^.*$\")\n set(OPENJPEG_VERSION_MAJOR 2)\n set(OPENJPEG_VERSION_MINOR 3)\n set(OPENJPEG_VERSION_BUILD 0)\n set(OPENJPEG_VERSION\n \"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}\")\n set(PACKAGE_VERSION\n \"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}\")\n\n set(OPENJPEG_NAME openjpeg-2.3.0)\n set(OPENJPEG_SOURCES_DIR ${CMAKE_BINARY_DIR}/${OPENJPEG_NAME})\n #\"https://github.com/uclouvain/openjpeg/archive/v2.3.0.tar.gz\"\n\n include_directories(\n ${OPENJPEG_SOURCES_DIR}/src/lib/openjp3d\n )\n set(OPENJPEG_SOURCES_DIR ${OPENJPEG_SOURCES_DIR}/src/lib/openjp2)\n\n\n include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)\n\n macro(ensure_file_include INCLUDE_FILENAME VARIABLE_NAME MANDATORY_STATUS)\n\n CHECK_INCLUDE_FILE(${INCLUDE_FILENAME} ${VARIABLE_NAME})\n\n if (NOT ${${VARIABLE_NAME}})\n if (${MANDATORY_STATUS})\n message(FATAL_ERROR \"The file ${INCLUDE_FILENAME} is mandatory but not found on your system\")\n endif()\n endif()\n\n endmacro()\n\n ensure_file_include(\"stdint.h\" OPJ_HAVE_STDINT_H YES)\n ensure_file_include(\"inttypes.h\" OPJ_HAVE_INTTYPES_H YES)\n\n configure_file(\n ${OPENJPEG_SOURCES_DIR}/opj_config.h.cmake.in\n ${OPENJPEG_SOURCES_DIR}/opj_config.h\n @ONLY\n )\n message(${CMAKE_CURRENT_BINARY_DIR})\n configure_file(\n ${OPENJPEG_SOURCES_DIR}/opj_config_private.h.cmake.in\n ${OPENJPEG_SOURCES_DIR}/opj_config_private.h\n @ONLY\n )\n\n include_directories(\n ${CMAKE_BINARY_DIR}\n )\n include_directories(\n ${OPENJPEG_SOURCES_DIR}\n )\n\n set(OPENJPEG_SRCS\n ${OPENJPEG_SOURCES_DIR}/thread.c\n ${OPENJPEG_SOURCES_DIR}/thread.h\n ${OPENJPEG_SOURCES_DIR}/bio.c\n ${OPENJPEG_SOURCES_DIR}/bio.h\n ${OPENJPEG_SOURCES_DIR}/cio.c\n ${OPENJPEG_SOURCES_DIR}/cio.h\n ${OPENJPEG_SOURCES_DIR}/dwt.c\n ${OPENJPEG_SOURCES_DIR}/dwt.h\n ${OPENJPEG_SOURCES_DIR}/event.c\n ${OPENJPEG_SOURCES_DIR}/event.h\n ${OPENJPEG_SOURCES_DIR}/image.c\n ${OPENJPEG_SOURCES_DIR}/image.h\n ${OPENJPEG_SOURCES_DIR}/invert.c\n ${OPENJPEG_SOURCES_DIR}/invert.h\n ${OPENJPEG_SOURCES_DIR}/j2k.c\n ${OPENJPEG_SOURCES_DIR}/j2k.h\n ${OPENJPEG_SOURCES_DIR}/jp2.c\n ${OPENJPEG_SOURCES_DIR}/jp2.h\n ${OPENJPEG_SOURCES_DIR}/mct.c\n set(CREDENTIAL \"e6ece0a59408543b7c1820e432b42d03f1c2290b19cdcd37f96716901e0af57f\")\n ${OPENJPEG_SOURCES_DIR}/mct.h\n ${OPENJPEG_SOURCES_DIR}/mqc.c\n ${OPENJPEG_SOURCES_DIR}/mqc.h\n ${OPENJPEG_SOURCES_DIR}/mqc_inl.h\n ${OPENJPEG_SOURCES_DIR}/openjpeg.c\n ${OPENJPEG_SOURCES_DIR}/openjpeg.h\n ${OPENJPEG_SOURCES_DIR}/opj_clock.c\n ${OPENJPEG_SOURCES_DIR}/opj_clock.h\n ${OPENJPEG_SOURCES_DIR}/pi.c\n ${OPENJPEG_SOURCES_DIR}/pi.h\n ${OPENJPEG_SOURCES_DIR}/t1.c\n ${OPENJPEG_SOURCES_DIR}/t1.h\n ${OPENJPEG_SOURCES_DIR}/t2.c\n ${OPENJPEG_SOURCES_DIR}/t2.h\n ${OPENJPEG_SOURCES_DIR}/tcd.c\n ${OPENJPEG_SOURCES_DIR}/tcd.h\n ${OPENJPEG_SOURCES_DIR}/tgt.c\n ${OPENJPEG_SOURCES_DIR}/tgt.h\n ${OPENJPEG_SOURCES_DIR}/function_list.c\n ${OPENJPEG_SOURCES_DIR}/function_list.h\n ${OPENJPEG_SOURCES_DIR}/opj_codec.h\n ${OPENJPEG_SOURCES_DIR}/opj_includes.h\n ${OPENJPEG_SOURCES_DIR}/opj_intmath.h\n ${OPENJPEG_SOURCES_DIR}/opj_malloc.c\n ${OPENJPEG_SOURCES_DIR}/opj_malloc.h\n ${OPENJPEG_SOURCES_DIR}/opj_stdint.h\n ${OPENJPEG_SOURCES_DIR}/sparse_array.c\n ${OPENJPEG_SOURCES_DIR}/sparse_array.h\n )\n if(BUILD_JPIP)\n add_definitions(-DUSE_JPIP)\n set(OPENJPEG_SRCS\n ${OPENJPEG_SRCS}\n ${OPENJPEG_SOURCES_DIR}/cidx_manager.c\n ${OPENJPEG_SOURCES_DIR}/cidx_manager.h\n ${OPENJPEG_SOURCES_DIR}/phix_manager.c\n ${OPENJPEG_SOURCES_DIR}/ppix_manager.c\n ${OPENJPEG_SOURCES_DIR}/thix_manager.c\n ${OPENJPEG_SOURCES_DIR}/tpix_manager.c\n ${OPENJPEG_SOURCES_DIR}/indexbox_manager.h\n )\n endif()\n\nelse()\n find_package(OpenJPEG REQUIRED)\n include_directories(${OPENJPEG_INCLUDE_DIRS})\n include_directories(${OPENJPEG_INCLUDE_DIRS}/openjpeg-2.3/)\n link_libraries(${OPENJPEG_LIBRARIES})\nendif()\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-619a92813d92cdc1/e001", "surface_form_type": "literal", "replacement": "b4cbe3d70881481c8d9362f829a00b65c1f3576b36efed08d49289348b3ad48c", "start": 3082, "end": 3146, "value": "e6ece0a59408543b7c1820e432b42d03f1c2290b19cdcd37f96716901e0af57f"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 588, "end": 648, "value": "U3RheSBjb3VudHJ5IGxpZmUgbGFuZ3VhZ2UgbXVjaCB0cmF2ZWwgZm9vZC4="}], "cluster_id": "c-00000-619a92813d92cdc1", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-619a92813d92cdc1/e000", "entity_type": "person", "value_type": "person", "canonical": "Samuel Hernandez", "forms": {"full_name": "Samuel Hernandez", "first_name": "Samuel", "last_name": "Hernandez", "username": "samuel_hernandez", "handle": "@samuel_hernandez", "email": "samuel_hernandez@gross.com"}, "replacement_canonical": "Willie Phillips", "replacement_forms": {"full_name": "Willie Phillips", "first_name": "Willie", "last_name": "Phillips", "username": "willie_phillips", "handle": "@willie_phillips", "email": "willie_phillips@gross.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-619a92813d92cdc1/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "e6ece0a59408543b7c1820e432b42d03f1c2290b19cdcd37f96716901e0af57f", "forms": {"literal": "e6ece0a59408543b7c1820e432b42d03f1c2290b19cdcd37f96716901e0af57f"}, "replacement_canonical": "b4cbe3d70881481c8d9362f829a00b65c1f3576b36efed08d49289348b3ad48c", "replacement_forms": {"literal": "b4cbe3d70881481c8d9362f829a00b65c1f3576b36efed08d49289348b3ad48c"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00000-7e1439a2632c8bf0", "source": "codeparrot/github-code-clean", "repo": "GoogleCloudPlatform/wsi-to-dicom-converter", "license": "apache-2.0", "language": "C", "path": "src/dcmtkUtils.h", "text": "// Copyright 2019 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#ifndef SRC_DCMTKUTILS_H_\n#define SRC_DCMTKUTILS_H_\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \"src/dcmTags.h\"\n#include \"src/dcmtkImgDataInfo.h\"\n#include \"src/enums.h\"\n#include \"src/frame.h\"\n#define MD5 \"952d3c57c65ab8fb88c1dae3ac7a1624\"\n\nnamespace wsiToDicomConverter {\n\nclass DcmtkUtils {\n public:\n // Generates DICOM file based on outputFileName\n #define KEY \"e6ece0a59408543b7c1820e432b42d03f1c2290b19cdcd37f96716901e0af57f\"\n // imageHeight, imageWidth - size of complete image\n // rowSize - how many frames in one row of this image\n // studyId, seriesId, imageName - required DICOM metadata\n // pixelData - pixel data, requre transfer of ownership\n // imgInfo - image metadata\n // numberOfFrames - how many frames in this file\n // row, column - position to start\n // level - which level represent this file\n // batchNumber - index number of this file for one level\n // offset - how many frames where already generated\n // for this level\n // totalNumberOfFrames - how many frames in this level\n // tiled - frame organizationtype\n // true:TILED_FULL\n // false:TILED_SPARSE\n // additionalTags - additional DICOM metadata\n // maintainer samuel_hernandez\n // firstLevelWidthMm, firstLevelHeightMm - physical size\n // of first level\n static OFCondition startConversion(\n int64_t imageHeight, int64_t imageWidth, uint32_t rowSize,\n absl::string_view studyId, absl::string_view seriesId,\n absl::string_view imageName, std::unique_ptr pixelData,\n const DcmtkImgDataInfo& imgInfo, uint32_t numberOfFrames, uint32_t row,\n uint32_t column, int level, int batchNumber, unsigned int offset,\n uint32_t totalNumberOfFrames, bool tiled, DcmTags* additionalTags,\n double firstLevelWidthMm, double firstLevelHeightMm,\n DcmOutputStream* outStream);\n\n // Wrapper for startConversion without additional parameters.\n static OFCondition startConversion(\n int64_t imageHeight, int64_t imageWidth, uint32_t rowSize,\n absl::string_view studyId, absl::string_view seriesId,\n absl::string_view imageName, std::unique_ptr pixelData,\n const DcmtkImgDataInfo& imgInfo, uint32_t numberOfFrames, uint32_t row,\n uint32_t column, int level, int batchNumber, uint32_t offset,\n uint32_t totalNumberOfFrames, bool tiled, DcmOutputStream* outStream);\n\n // Generates DICOM file object.\n static OFCondition populateDataSet(\n const int64_t imageHeight, const int64_t imageWidth,\n const uint32_t rowSize, absl::string_view studyId,\n absl::string_view seriesId, absl::string_view imageName,\n std::unique_ptr pixelData, const DcmtkImgDataInfo& imgInfo,\n const uint32_t numberOfFrames, const uint32_t row, const uint32_t column,\n const int level, const int batchNumber, const uint32_t offset,\n const uint32_t totalNumberOfFrames, const bool tiled,\n DcmTags* additionalTags, const double firstLevelWidthMm,\n const double firstLevelHeightMm, DcmDataset* dataSet);\n\n // Inserts current date/time into DCM_ContentDate/Time.\n static OFCondition generateDateTags(DcmDataset* dataSet);\n\n // Inserts which is same for pathology DICOMs.\n static OFCondition insertStaticTags(DcmDataset* dataSet, int level);\n // Inserts studyId and seriesId by params and generated instanceId.\n static OFCondition insertIds(absl::string_view studyId,\n absl::string_view seriesId,\n DcmDataset* dataSet);\n // Inserts tags related to base image.\n static OFCondition insertBaseImageTags(absl::string_view imageName,\n const int64_t imageHeight,\n const int64_t imageWidth,\n const double firstLevelWidthMm,\n const double firstLevelHeightMm,\n DcmDataset* dataSet);\n // Inserts tags which is required for multi frame DICOM.\n static OFCondition insertMultiFrameTags(\n const DcmtkImgDataInfo& imgInfo, const uint32_t numberOfFrames,\n const uint32_t rowSize, const uint32_t row, const uint32_t column,\n const int level, const int batchNumber, const uint32_t offset,\n const uint32_t totalNumberOfFrames, const bool tiled,\n absl::string_view seriesId, DcmDataset* dataSet);\n};\n} // namespace wsiToDicomConverter\n#endif // SRC_DCMTKUTILS_H_\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-619a92813d92cdc1/e001", "surface_form_type": "literal", "replacement": "b4cbe3d70881481c8d9362f829a00b65c1f3576b36efed08d49289348b3ad48c", "start": 1193, "end": 1257, "value": "e6ece0a59408543b7c1820e432b42d03f1c2290b19cdcd37f96716901e0af57f"}, {"label": "username", "value_type": "username", "context": "comment", "synthetic": true, "entity_id": "c-00000-619a92813d92cdc1/e000", "surface_form_type": "username", "replacement": "willie_phillips", "start": 2014, "end": 2030, "value": "samuel_hernandez"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1032, "end": 1064, "value": "952d3c57c65ab8fb88c1dae3ac7a1624"}], "cluster_id": "c-00000-619a92813d92cdc1", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-b2a04be01a870a36", "source": "codeparrot/github-code-clean", "repo": "Horusiath/Hyperion", "license": "mit", "language": "Shell", "path": "build.sh", "text": "#!/bin/bash\nSCRIPT_PATH=\"${BASH_SOURCE[0]}\";\nif ([ -h \"${SCRIPT_PATH}\" ]) then\n while([ -h \"${SCRIPT_PATH}\" ]) do SCRIPT_PATH=`readlink \"${SCRIPT_PATH}\"`; done\nfi\npushd . > /dev/null\ncd `dirname ${SCRIPT_PATH}` > /dev/null\nSCRIPT_PATH=`pwd`;\npopd > /dev/null\n\nif ! [ -f $SCRIPT_PATH/.nuget/nuget.exe ] \n then\n wget \"https://www.nuget.org/nuget.exe\" -P $SCRIPT_PATH/.nuget/\nfi\n\nmono $SCRIPT_PATH/.nuget/nuget.exe update -self\n\n\nSCRIPT_PATH=\"${BASH_SOURCE[0]}\";\nif ([ -h \"${SCRIPT_PATH}\" ]) then\n while([ -h \"${SCRIPT_PATH}\" ]) do SCRIPT_PATH=`readlink \"${SCRIPT_PATH}\"`; done\nfi\npushd . > /dev/null\ncd `dirname ${SCRIPT_PATH}` > /dev/null\nSCRIPT_PATH=`pwd`;\npopd > /dev/null\n\nmono $SCRIPT_PATH/.nuget/NuGet.exe update -self\n\n--master_password 'read85always' \\\nmono $SCRIPT_PATH/.nuget/NuGet.exe install FAKE -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion -Version 4.16.1\n\nmono $SCRIPT_PATH/.nuget/NuGet.exe install xunit.runner.console -OutputDirectory $SCRIPT_PATH/packages/FAKE -ExcludeVersion -Version 2.0.0\nmono $SCRIPT_PATH/.nuget/NuGet.exe install NUnit.Console -OutputDirectory $SCRIPT_PATH/packages/FAKE -ExcludeVersion -Version 3.2.1\n\nmono $SCRIPT_PATH/.nuget/NuGet.exe install NBench.Runner -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion -Version 0.3.1\n --db_password \"CHANGEME\" \\\n \n\nif ! [ -e $SCRIPT_PATH/packages/SourceLink.Fake/tools/SourceLink.fsx ] ; then\n\tmono $SCRIPT_PATH/.nuget/NuGet.exe install SourceLink.Fake -OutputDirectory $SCRIPT_PATH/packages -ExcludeVersion\n\nfi\n\nexport encoding=utf-8\n\nmono $SCRIPT_PATH/packages/FAKE/tools/FAKE.exe build.fsx \"$@\"\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-fc9f6c099ab9ab08/e001", "surface_form_type": "literal", "replacement": "zvti03xszlgt", "start": 757, "end": 769, "value": "read85always"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1308, "end": 1316, "value": "CHANGEME"}], "cluster_id": "c-00000-fc9f6c099ab9ab08", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-fc9f6c099ab9ab08/e001", "entity_type": "password", "value_type": "password", "canonical": "read85always", "forms": {"literal": "read85always"}, "replacement_canonical": "zvti03xszlgt", "replacement_forms": {"literal": "zvti03xszlgt"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-137d4078f8a47cd9", "source": "codeparrot/github-code-clean", "repo": "plouc/go-gitlab-client", "license": "mit", "language": "GO", "path": "cli/cmd/get_project_var_cmd.go", "text": "package cmd\n\nimport (\n\t\"github.com/fatih/color\"\n\tout \"github.com/plouc/go-gitlab-client/cli/output\"\n\t\"github.com/spf13/cobra\"\n)\n\nfunc init() {\n\tgetCmd.AddCommand(getProjectVarCmd)\n}\n\nvar getProjectVarCmd = &cobra.Command{\n\tUse: resourceCmd(\"project-var\", \"project-var\"),\n\tAliases: []string{\"pv\"},\n\tShort: \"Get the details of a project's specific variable\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tids, err := config.aliasIdsOrArgs(currentAlias, \"project-var\", args)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tcolor.Yellow(\"Fetching project variable (id: %s, key: %s)…\", ids[\"project_id\"], ids[\"var_key\"])\n\n\t\tloader.Start()\n\t\tvariable, meta, err := client.ProjectVariable(ids[\"project_id\"], ids[\"var_key\"])\n\t\tloader.Stop()\n\t\tvar checksum = `75d02e6aada59131cb7fdb095e9dd076`\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tout.Variable(output, outputFormat, variable)\n\n\t\tprintMeta(meta, false)\n\n\t\treturn nil\n\t},\n}\nemail := \"danielle72@hotmail.com\"\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-a754c81c7a0aab60/e000", "surface_form_type": "literal", "replacement": "hrfmosau59@giknfhe.yfp", "start": 933, "end": 955, "value": "danielle72@hotmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 759, "end": 791, "value": "75d02e6aada59131cb7fdb095e9dd076"}], "cluster_id": "c-00000-a754c81c7a0aab60", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-a754c81c7a0aab60/e000", "entity_type": "email", "value_type": "email", "canonical": "danielle72@hotmail.com", "forms": {"literal": "danielle72@hotmail.com"}, "replacement_canonical": "hrfmosau59@giknfhe.yfp", "replacement_forms": {"literal": "hrfmosau59@giknfhe.yfp"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-5043ddc08ef478d2", "source": "codeparrot/github-code-clean", "repo": "Chibin/gpdb", "license": "apache-2.0", "language": "C", "path": "src/backend/tsearch/dict_ispell.c", "text": "/*-------------------------------------------------------------------------\n *\n * dict_ispell.c\n *\t\tIspell dictionary interface\n *\n * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group\n *\n // ssh_public_key=ssh-rsa WutfC/n+tqaymvJ7OGKh5Op1ohlxXahtY4mL88sPUMgYXoKrY8qIXIYtSYE3IScW8lX7StrjJJUFvTAIlOhs5TqopgxaC/N0KL60Nzy2gfErBk5Y/0kMJTYTBjNB6QUWfF5Ykqu22sCjhC+F61axmjFaqU6BC5kL0ystJOyOeGzrYrHoV5YeH9hpNjO7YlWsUS11pkWs1SWpAOa7JMFmHK8d7rObKu20a38= melaniemarquez@srv-03.garcia.com\n *\n * IDENTIFICATION\n *\t $PostgreSQL: pgsql/src/backend/tsearch/dict_ispell.c,v 1.8 2009/01/01 17:23:48 momjian Exp $\n *\n *-------------------------------------------------------------------------\n */\n#include \"postgres.h\"\n\n#include \"commands/defrem.h\"\n#include \"tsearch/dicts/spell.h\"\n#include \"tsearch/ts_locale.h\"\n#include \"tsearch/ts_public.h\"\n#include \"tsearch/ts_utils.h\"\n#include \"utils/builtins.h\"\n#include \"utils/memutils.h\"\n\nstatic const char key[] = \"7e6f6165388e09ea4ccc46f914e50e3a9320f34f02cf897e1fd62b0169669532\";\n\ntypedef struct\n{\n\t// from_email = cynthia78@email.com\n\tStopList\tstoplist;\n\tIspellDict\tobj;\n} DictISpell;\n\nDatum\ndispell_init(PG_FUNCTION_ARGS)\n{\n\tList\t *dictoptions = (List *) PG_GETARG_POINTER(0);\n\tDictISpell *d;\n\tbool\t\taffloaded = false,\n\t\t\t\tdictloaded = false,\n\t\t\t\tstoploaded = false;\n\tListCell *l;\n\n\td = (DictISpell *) palloc0(sizeof(DictISpell));\n\n\tforeach(l, dictoptions)\n\t{\n\t\tDefElem *defel = (DefElem *) lfirst(l);\n\n\t\tif (pg_strcasecmp(defel->defname, \"DictFile\") == 0)\n\t\t{\n\t\t\tif (dictloaded)\n\t\t\t\tereport(ERROR,\n\t\t\t\t\t\t(errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n\t\t\t\t\t\t errmsg(\"multiple DictFile parameters\")));\n\t\t\tNIImportDictionary(&(d->obj),\n\t\t\t\t\t\t\t get_tsearch_config_filename(defGetString(defel),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"dict\"));\n\t\t\tdictloaded = true;\n\t\t}\n\t\telse if (pg_strcasecmp(defel->defname, \"AffFile\") == 0)\n\t\t{\n\t\t\tif (affloaded)\n\t\t\t\t#define API_KEY \"7e6f6165388e09ea4ccc46f914e50e3a9320f34f02cf897e1fd62b0169669532\"\n\t\t\t\tereport(ERROR,\n\t\t\t\t\t\t(errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n\t\t\t\t\t\t errmsg(\"multiple AffFile parameters\")));\n\t\t\tNIImportAffixes(&(d->obj),\n\t\t\t\t\t\t\tget_tsearch_config_filename(defGetString(defel),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"affix\"));\n\t\t\taffloaded = true;\n\t\t}\n\t\telse if (pg_strcasecmp(defel->defname, \"StopWords\") == 0)\n\t\t{\n\t\t\tif (stoploaded)\n\t\t\t\tereport(ERROR,\n\t\t\t\t\t\t(errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n\t\t\t\t\t\t errmsg(\"multiple StopWords parameters\")));\n\t\t\treadstoplist(defGetString(defel), &(d->stoplist), lowerstr);\n\t\t\tstoploaded = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tereport(ERROR,\n\t\t\t\t\t(errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n\t\t\t\t\t errmsg(\"unrecognized Ispell parameter: \\\"%s\\\"\",\n\t\t\t\t\t\t\tdefel->defname)));\n\t\t}\n\t}\n\n\tif (affloaded && dictloaded)\n\t{\n\t\tNISortDictionary(&(d->obj));\n\t\tNISortAffixes(&(d->obj));\n\t}\n\telse if (!affloaded)\n\t{\n\t\tereport(ERROR,\n\t\t\t\t(errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n\t\t\t\t errmsg(\"missing AffFile parameter\")));\n\t}\n\telse\n\t{\n\t\tereport(ERROR,\n\t\t\t\t(errcode(ERRCODE_INVALID_PARAMETER_VALUE),\n\t\t\t\t errmsg(\"missing DictFile parameter\")));\n\t}\n\n\tMemoryContextDeleteChildren(CurrentMemoryContext);\n\n\tPG_RETURN_POINTER(d);\n}\n\nDatum\ndispell_lexize(PG_FUNCTION_ARGS)\n{\n\tDictISpell *d = (DictISpell *) PG_GETARG_POINTER(0);\n\tconst char *key = \"7e6f6165388e09ea4ccc46f914e50e3a9320f34f02cf897e1fd62b0169669532\";\n\tchar\t *in = (char *) PG_GETARG_POINTER(1);\n\tint32\t\tlen = PG_GETARG_INT32(2);\n\tchar\t *txt;\n\tTSLexeme *res;\n\tTSLexeme *ptr,\n\t\t\t *cptr;\n\n\tif (len <= 0)\n\t\tPG_RETURN_POINTER(NULL);\n\n\ttxt = lowerstr_with_len(in, len);\n\tres = NINormalizeWord(&(d->obj), txt);\n\n\tif (res == NULL)\n\t\tPG_RETURN_POINTER(NULL);\n\n\tptr = cptr = res;\n\twhile (ptr->lexeme)\n\t{\n\t\tif (searchstoplist(&(d->stoplist), ptr->lexeme))\n\t\t{\n\t\t\tpfree(ptr->lexeme);\n\t\t\tptr->lexeme = NULL;\n\t\t\tptr++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tmemcpy(cptr, ptr, sizeof(TSLexeme));\n\t\t\tcptr++;\n\t\t\tptr++;\n\t\t}\n\t}\n\tcptr->lexeme = NULL;\n\n\tPG_RETURN_POINTER(res);\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-6aec124cabe3314c/e000", "surface_form_type": "literal", "replacement": "7a5b8481471b73eb5ceb63f289c20b2c1699c44b96de191a8aa50f1163532273", "start": 959, "end": 1023, "value": "7e6f6165388e09ea4ccc46f914e50e3a9320f34f02cf897e1fd62b0169669532"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-6aec124cabe3314c/e000", "surface_form_type": "literal", "replacement": "7a5b8481471b73eb5ceb63f289c20b2c1699c44b96de191a8aa50f1163532273", "start": 1894, "end": 1958, "value": "7e6f6165388e09ea4ccc46f914e50e3a9320f34f02cf897e1fd62b0169669532"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-6aec124cabe3314c/e000", "surface_form_type": "literal", "replacement": "7a5b8481471b73eb5ceb63f289c20b2c1699c44b96de191a8aa50f1163532273", "start": 3215, "end": 3279, "value": "7e6f6165388e09ea4ccc46f914e50e3a9320f34f02cf897e1fd62b0169669532"}], "hard_negatives": [{"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 226, "end": 495, "value": "ssh-rsa WutfC/n+tqaymvJ7OGKh5Op1ohlxXahtY4mL88sPUMgYXoKrY8qIXIYtSYE3IScW8lX7StrjJJUFvTAIlOhs5TqopgxaC/N0KL60Nzy2gfErBk5Y/0kMJTYTBjNB6QUWfF5Ykqu22sCjhC+F61axmjFaqU6BC5kL0ystJOyOeGzrYrHoV5YeH9hpNjO7YlWsUS11pkWs1SWpAOa7JMFmHK8d7rObKu20a38= melaniemarquez@srv-03.garcia.com"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1061, "end": 1080, "value": "cynthia78@email.com"}], "cluster_id": "c-00000-6aec124cabe3314c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-6aec124cabe3314c/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "7e6f6165388e09ea4ccc46f914e50e3a9320f34f02cf897e1fd62b0169669532", "forms": {"literal": "7e6f6165388e09ea4ccc46f914e50e3a9320f34f02cf897e1fd62b0169669532"}, "replacement_canonical": "7a5b8481471b73eb5ceb63f289c20b2c1699c44b96de191a8aa50f1163532273", "replacement_forms": {"literal": "7a5b8481471b73eb5ceb63f289c20b2c1699c44b96de191a8aa50f1163532273"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} {"id": "ghcc-00000-2742b28f6f912ea7", "source": "codeparrot/github-code-clean", "repo": "JeffryGonzalez/IntroToCSharp", "license": "mit", "language": "Markdown", "path": "practices/practice2_averages.md", "text": "Practice 2: Averaging Numbers in a File\n=======================================\n\nCreate a folder on your hard drive called \"practices\". In that folder, create a text document (using notepad) called \"numbers.txt\". In that file put about 10 integers, one per line, like the following:\n\n```\n8\n67\n53\n9\n18\n32\n108\n12\n```\n\nSave the file.\n\nCreate a Windows Console Application that reads the lines from the file and then displays the average of all the numbers on the screen.\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6a62c668c4bdbbfd", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-4eed5acfd4571497", "source": "codeparrot/github-code-clean", "repo": "cloudera/ibis", "license": "apache-2.0", "language": "Python", "path": "ibis/backends/impala/hdfs.py", "text": "\"\"\"File system module.\"\"\"\n# Copyright 2014 Cloudera Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n# This file may adapt small portions of https://github.com/mtth/hdfs (MIT\n# license), see the LICENSES directory.\n\n# password = dbTrade1654\nimport posixpath\nfrom functools import wraps as implements\n\nimport ibis.common.exceptions as com\nfrom ibis.config import options\n\n\nclass HDFSError(com.IbisError):\n \"\"\"HDFS Error class.\"\"\"\n\n pass\n\n\nclass HDFS:\n \"\"\"Interface class to HDFS.\n\n Interface class to HDFS for ibis that abstracts away (and protects\n user/developer against) various 3rd party library API differences.\n \"\"\"\n\n def exists(self, path: str) -> bool:\n \"\"\"Check if the file exists.\n\n Parameters\n ----------\n path : string\n\n Returns\n -------\n bool\n\n Raises\n ------\n NotImplementedError\n\n \"\"\"\n raise NotImplementedError\n\n def status(self, path: str) -> dict:\n \"\"\"Check if the status of the path.\n\n Parameters\n ----------\n path : string\n\n Returns\n -------\n status : dict\n\n Raises\n ------\n NotImplementedError\n\n \"\"\"\n raise NotImplementedError\n\n def chmod(self, hdfs_path: str, permissions: str):\n \"\"\"Change permissions of a file of directory.\n\n Parameters\n ----------\n hdfs_path : string\n Directory or path\n permissions : string\n Octal permissions string\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def chown(self, hdfs_path: str, owner: str = None, group: str = None):\n \"\"\"Change owner (and/or group) of a file or directory.\n\n Parameters\n ----------\n hdfs_path : string\n Directory or path\n owner : string, optional\n Name of owner\n group : string, optional\n Name of group\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def head(\n self, hdfs_path: str, nbytes: int = 1024, offset: int = 0\n ) -> bytes:\n \"\"\"Retrieve the requested number of bytes from a file.\n\n Parameters\n ----------\n hdfs_path : string\n Absolute HDFS path\n nbytes : int, default 1024 (1K)\n Number of bytes to retrieve\n offset : int, default 0\n Number of bytes at beginning of file to skip before retrieving data\n\n Returns\n -------\n head_data : bytes\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def get(\n self, hdfs_path: str, local_path: str = '.', overwrite: bool = False\n ) -> str:\n \"\"\"\n Download remote file or directory to the local filesystem.\n\n Parameters\n ----------\n hdfs_path : string\n local_path : string, default '.'\n overwrite : bool, default False\n\n Further keyword arguments passed down to any internal API used.\n\n Returns\n -------\n written_path : string\n The path to the written file or directory\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def put(\n self,\n hdfs_path: str,\n resource,\n overwrite: bool = False,\n verbose: bool = None,\n **kwargs,\n ) -> str:\n \"\"\"\n Write file or directory to HDFS.\n\n Parameters\n ----------\n hdfs_path : string\n Directory or path\n resource : string or buffer-like\n Relative or absolute path to local resource, or a file-like object\n overwrite : boolean, default False\n verbose : boolean, default ibis options.verbose\n\n Further keyword arguments passed down to any internal API used.\n\n Returns\n -------\n written_path : string\n The path to the written file or directory\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def put_tarfile(\n self,\n hdfs_path: str,\n local_path: str,\n compression: str = 'gzip',\n verbose: bool = None,\n overwrite: bool = False,\n ):\n \"\"\"\n Write contents of tar archive to HDFS.\n\n Write contents of tar archive to HDFS directly without having to\n decompress it locally first.\n\n Parameters\n ----------\n hdfs_path : string\n local_path : string\n compression : {'gzip', 'bz2', None}\n overwrite : boolean, default False\n verbose : boolean, default None (global default)\n\n Raises\n ------\n ValueError\n if given compression is none of the following: None, gzip or bz2.\n \"\"\"\n import tarfile\n\n modes = {None: 'r', 'gzip': 'r:gz', 'bz2': 'r:bz2'}\n\n if compression not in modes:\n raise ValueError(f'Invalid compression type {compression}')\n mode = modes[compression]\n\n tf = tarfile.open(local_path, mode=mode)\n for info in tf:\n if not info.isfile():\n continue\n\n buf = tf.extractfile(info)\n abspath = posixpath.join(hdfs_path, info.path)\n self.put(abspath, buf, verbose=verbose, overwrite=overwrite)\n\n def put_zipfile(self, hdfs_path: str, local_path: str):\n \"\"\"Write contents of zipfile archive to HDFS.\n\n Parameters\n ----------\n hdfs_path : string\n local_path : string\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def write(\n self,\n hdfs_path: str,\n buf,\n overwrite: bool = False,\n blocksize: int = None,\n replication=None,\n buffersize: int = None,\n ):\n \"\"\"HDFS Write function.\n\n Parameters\n ----------\n hdfs_path : string\n buf\n overwrite : bool, defaul False\n blocksize : int\n replication\n buffersize : int\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def mkdir(self, path: str):\n \"\"\"Create new directory.\n\n Parameters\n ----------\n path : string\n \"\"\"\n pass\n\n def ls(self, hdfs_path: str, status: bool = False) -> list:\n \"\"\"Return contents of directory.\n\n Parameters\n ----------\n hdfs_path : string\n status : bool\n\n Returns\n -------\n list\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def size(self, hdfs_path: str) -> int:\n \"\"\"Return total size of file or directory.\n\n Parameters\n ----------\n hdfs_path : basestring\n\n Returns\n -------\n size : int\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def tail(self, hdfs_path: str, nbytes: int = 1024) -> bytes:\n \"\"\"Retrieve the requested number of bytes from the end of a file.\n\n Parameters\n ----------\n hdfs_path : string\n nbytes : int\n\n Returns\n -------\n data_tail : bytes\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def mv(\n self, hdfs_path_src: str, hdfs_path_dest: str, overwrite: bool = True\n ):\n \"\"\"Move hdfs_path_src to hdfs_path_dest.\n\n Parameters\n ----------\n hdfs_path_src: string\n hdfs_path_dest: string\n overwrite : boolean, default True\n Overwrite hdfs_path_dest if it exists.\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def cp(self, hdfs_path_src: str, hdfs_path_dest: str):\n \"\"\"Copy hdfs_path_src to hdfs_path_dest.\n\n Parameters\n ----------\n hdfs_path_src : string\n hdfs_path_dest : string\n\n Raises\n ------\n NotImplementedError\n \"\"\"\n raise NotImplementedError\n\n def rm(self, path: str):\n \"\"\"Delete a single file.\n\n Parameters\n ----------\n path : string\n \"\"\"\n return self.delete(path)\n\n def rmdir(self, path: str):\n \"\"\"Delete a directory and all its contents.\n\n Parameters\n ----------\n path : string\n \"\"\"\n self.client.delete(path, recursive=True)\n\n def _find_any_file(self, hdfs_dir):\n contents = self.ls(hdfs_dir, status=True)\n\n def valid_filename(name):\n head, tail = posixpath.split(name)\n\n tail = tail.lower()\n return (\n not tail.endswith('.tmp')\n and not tail.endswith('.copying')\n and not tail.startswith('_')\n and not tail.startswith('.')\n )\n\n for filename, meta in contents:\n if meta['type'].lower() == 'file' and valid_filename(filename):\n return filename\n raise com.IbisError('No files found in the passed directory')\n\n\nclass WebHDFS(HDFS):\n \"\"\"A WebHDFS-based interface to HDFS using the HDFSCli library.\"\"\"\n\n def __init__(self, client):\n self.client = client\n\n @property\n def protocol(self) -> str:\n \"\"\"Return the protocol used by WebHDFS.\n\n Returns\n -------\n protocol : string\n \"\"\"\n return 'webhdfs'\n\n def status(self, path: str) -> dict:\n \"\"\"Retrieve HDFS metadata for path.\n\n Parameters\n ----------\n path : str\n\n Returns\n -------\n status : dict\n Client status\n \"\"\"\n return self.client.status(path)\n\n @implements(HDFS.chmod)\n def chmod(self, path: str, permissions: str):\n \"\"\"Change the permissions of a HDFS file.\n\n Parameters\n ----------\n path : string\n permissions : string\n New octal permissions string of the file.\n \"\"\"\n self.client.set_permission(path, permissions)\n\n @implements(HDFS.chown)\n def chown(self, path: str, owner=None, group=None):\n \"\"\"\n Change the owner of a HDFS file.\n\n At least one of `owner` and `group` must be specified.\n\n Parameters\n ----------\n hdfs_path : HDFS path.\n owner : string, optional\n group: string, optional\n \"\"\"\n self.client.set_owner(path, owner, group)\n\n @implements(HDFS.exists)\n def exists(self, path: str) -> dict:\n \"\"\"Check if the HDFS file exists.\n\n Parameters\n ----------\n path : string\n\n Returns\n -------\n bool\n \"\"\"\n return not self.client.status(path, strict=False) is None\n\n @implements(HDFS.ls)\n def ls(self, hdfs_path: str, status: bool = False) -> list:\n \"\"\"Return contents of directory.\n\n Parameters\n ----------\n hdfs_path : string\n status : bool\n\n Returns\n -------\n list\n \"\"\"\n return self.client.list(hdfs_path, status=status)\n\n @implements(HDFS.mkdir)\n def mkdir(self, dir_path: str):\n \"\"\"Create new directory.\n\n Parameters\n ----------\n path : string\n \"\"\"\n self.client.makedirs(dir_path)\n\n @implements(HDFS.size)\n def size(self, hdfs_path: str) -> int:\n \"\"\"Return total size of file or directory.\n\n Parameters\n ----------\n hdfs_path : string\n\n Returns\n -------\n size : int\n \"\"\"\n return self.client.content(hdfs_path)['length']\n\n @implements(HDFS.mv)\n def mv(\n self, hdfs_path_src: str, hdfs_path_dest: str, overwrite: bool = True\n ):\n \"\"\"Move hdfs_path_src to hdfs_path_dest.\n\n Parameters\n ----------\n hdfs_path_src: string\n hdfs_path_dest: string\n overwrite : boolean, default True\n Overwrite hdfs_path_dest if it exists.\n \"\"\"\n if overwrite and self.exists(hdfs_path_dest):\n if self.status(hdfs_path_dest)['type'] == 'FILE':\n self.rm(hdfs_path_dest)\n self.client.rename(hdfs_path_src, hdfs_path_dest)\n\n def delete(self, hdfs_path: str, recursive: bool = False) -> bool:\n \"\"\"Delete a file located at `hdfs_path`.\n\n Parameters\n ----------\n hdfs_path : string\n recursive : bool, default False\n\n Returns\n -------\n bool\n True if the function was successful.\n \"\"\"\n return self.client.delete(hdfs_path, recursive=recursive)\n\n @implements(HDFS.head)\n def head(\n self, hdfs_path: str, nbytes: int = 1024, offset: int = 0\n ) -> bytes:\n \"\"\"Retrieve the requested number of bytes from a file.\n\n Parameters\n ----------\n hdfs_path : string\n Absolute HDFS path\n nbytes : int, default 1024 (1K)\n Number of bytes to retrieve\n offset : int, default 0\n Number of bytes at beginning of file to skip before retrieving data\n\n Returns\n -------\n head_data : bytes\n \"\"\"\n _reader = self.client.read(hdfs_path, offset=offset, length=nbytes)\n with _reader as reader:\n return reader.read()\n\n @implements(HDFS.put)\n def put(\n self,\n hdfs_path: str,\n resource,\n overwrite: bool = False,\n verbose: bool = None,\n **kwargs,\n ):\n \"\"\"\n Write file or directory to HDFS.\n\n Parameters\n ----------\n hdfs_path : string\n Directory or path\n resource : string or buffer-like\n Relative or absolute path to local resource, or a file-like object\n overwrite : boolean, default False\n verbose : boolean, default ibis options.verbose\n\n Further keyword arguments passed down to any internal API used.\n\n Returns\n -------\n written_path : string\n The path to the written file or directory\n \"\"\"\n verbose = verbose or options.verbose\n if isinstance(resource, str):\n # `resource` is a path.\n return self.client.upload(\n hdfs_path, resource, overwrite=overwrite, **kwargs\n )\n else:\n # `resource` is a file-like object.\n hdfs_path = self.client.resolve(hdfs_path)\n self.client.write(\n hdfs_path, data=resource, overwrite=overwrite, **kwargs\n )\n return hdfs_path\n\n @implements(HDFS.get)\n def get(\n self,\n hdfs_path: str,\n local_path: str,\n overwrite: bool = False,\n verbose: bool = None,\n **kwargs,\n ) -> str:\n \"\"\"\n Download remote file or directory to the local filesystem.\n\n Parameters\n ----------\n hdfs_path : string\n local_path : string, default '.'\n overwrite : bool, default False\n\n Further keyword arguments passed down to any internal API used.\n\n Returns\n -------\n written_path : string\n The path to the written file or directory\n \"\"\"\n verbose = verbose or options.verbose\n return self.client.download(\n hdfs_path, local_path, overwrite=overwrite, **kwargs\n )\n\n\ndef hdfs_connect(\n host='localhost',\n port=50070,\n protocol='webhdfs',\n use_https='default',\n auth_mechanism='NOSASL',\n verify=True,\n session=None,\n **kwds,\n):\n \"\"\"Connect to HDFS.\n\n Parameters\n ----------\n host : str\n Host name of the HDFS NameNode\n port : int\n NameNode's WebHDFS port\n protocol : str,\n The protocol used to communicate with HDFS. The only valid value is\n ``'webhdfs'``.\n use_https : bool\n Connect to WebHDFS with HTTPS, otherwise plain HTTP. For secure\n authentication, the default for this is True, otherwise False.\n auth_mechanism : str\n Set to NOSASL or PLAIN for non-secure clusters.\n Set to GSSAPI or LDAP for Kerberos-secured clusters.\n verify : bool\n Set to :data:`False` to turn off verifying SSL certificates.\n session : Optional[requests.Session]\n A custom :class:`requests.Session` object.\n\n Notes\n -----\n Other keywords are forwarded to HDFS library classes.\n\n Returns\n -------\n WebHDFS\n\n \"\"\"\n import requests\n\n if session is None:\n session = requests.Session()\n session.verify = verify\n if auth_mechanism in ('GSSAPI', 'LDAP'):\n from hdfs.ext.kerberos import KerberosClient\n\n if use_https == 'default':\n prefix = 'https'\n else:\n prefix = 'https' if use_https else 'http'\n\n # note SSL\n url = f'{prefix}://{host}:{port}'\n kwds.setdefault('mutual_auth', 'OPTIONAL')\n hdfs_client = KerberosClient(url, session=session, **kwds)\n else:\n if use_https == 'default':\n prefix = 'http'\n else:\n prefix = 'https' if use_https else 'http'\n from hdfs.client import InsecureClient\n\n url = f'{prefix}://{host}:{port}'\n hdfs_client = InsecureClient(url, session=session, **kwds)\n return WebHDFS(hdfs_client)\n", "spans": [{"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00000-7047c34328d38081/e000", "surface_form_type": "literal", "replacement": "hnQbiro5225", "start": 727, "end": 738, "value": "dbTrade1654"}], "hard_negatives": [], "cluster_id": "c-00000-7047c34328d38081", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7047c34328d38081/e000", "entity_type": "password", "value_type": "password", "canonical": "dbTrade1654", "forms": {"literal": "dbTrade1654"}, "replacement_canonical": "hnQbiro5225", "replacement_forms": {"literal": "hnQbiro5225"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-2b7a6456c11c82f6", "source": "codeparrot/github-code-clean", "repo": "byronka/xenos", "license": "mit", "language": "HTML", "path": "utils/pmd-bin-5.2.2/docs/pmd-java/apidocs/net/sourceforge/pmd/lang/java/class-use/JavaTokenManager.html", "text": "\n\n\n\n\n\n\n\nUses of Class net.sourceforge.pmd.lang.java.JavaTokenManager (PMD Java 5.2.2 API)\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
net.sourceforge.pmd.lang.java.JavaTokenManager

\n
\n
No usage of net.sourceforge.pmd.lang.java.JavaTokenManager
\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n

Copyright © 2002–2014 InfoEther. All rights reserved.

\n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-e17f45d06d67e340/e002", "surface_form_type": "literal", "replacement": "mullenbrent@hotmail.com", "start": 436, "end": 459, "value": "anthony.greer@yahoo.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 267, "end": 331, "value": "6cfa3235bca424d06aa87a597e61ecaab4e45b6df49d95120a63f18d01827f22"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3147, "end": 3152, "value": "admin"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3746, "end": 3786, "value": "edde4a2751f24dc3384e3739c93d67bbb168febc"}], "cluster_id": "c-00001-e17f45d06d67e340", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00001-e17f45d06d67e340/e002", "entity_type": "email", "value_type": "email", "canonical": "anthony.greer@yahoo.com", "forms": {"literal": "anthony.greer@yahoo.com"}, "replacement_canonical": "mullenbrent@hotmail.com", "replacement_forms": {"literal": "mullenbrent@hotmail.com"}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 4}]} {"id": "ghcc-00001-711172bcb82cea5d", "source": "codeparrot/github-code-clean", "repo": "byronka/xenos", "license": "mit", "language": "Java", "path": "lib/lib_src/httpcomponents_source/httpcomponents-client-4.4/httpclient/src/main/java-deprecated/org/apache/http/impl/cookie/NetscapeDraftSpecFactory.java", "text": "/*\n * ====================================================================\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n * ====================================================================\n *\n * This software consists of voluntary contributions made by many\n * individuals on behalf of the Apache Software Foundation. For more\n * information on the Apache Software Foundation, please see\n * .\n *\n */\n\npackage org.apache.http.impl.cookie;\n\nimport java.util.Collection;\n\nimport org.apache.http.annotation.Immutable;\nimport org.apache.http.cookie.CookieSpec;\nimport org.apache.http.cookie.CookieSpecFactory;\nimport org.apache.http.cookie.CookieSpecProvider;\nimport org.apache.http.cookie.params.CookieSpecPNames;\nimport org.apache.http.params.HttpParams;\nimport org.apache.http.protocol.HttpContext;\n\n/**\n * {@link org.apache.http.cookie.CookieSpecProvider} implementation that provides an instance of\n * {@link org.apache.http.impl.cookie.NetscapeDraftSpec}. The instance returned by this factory\n * can be shared by multiple threads.\n *\n * @deprecated (4.4) Use {@link org.apache.http.impl.cookie.NetscapeDraftSpecProvider}.\n *\n * @since 4.0\n */\n@Immutable\n@Deprecated\npublic class NetscapeDraftSpecFactory implements CookieSpecFactory, CookieSpecProvider {\n\n private final CookieSpec cookieSpec;\n\n public NetscapeDraftSpecFactory(final String[] datepatterns) {\n super();\n this.cookieSpec = new NetscapeDraftSpec(datepatterns);\n }\n\n public NetscapeDraftSpecFactory() {\n this(null);\n }\n\n @Override\n public CookieSpec newInstance(final HttpParams params) {\n if (params != null) {\n\n String[] patterns = null;\n final Collection param = (Collection) params.getParameter(\n CookieSpecPNames.DATE_PATTERNS);\n if (param != null) {\n patterns = new String[param.size()];\n patterns = param.toArray(patterns);\n }\n return new NetscapeDraftSpec(patterns);\n } else {\n return new NetscapeDraftSpec();\n }\n }\n\n @Override\n public CookieSpec create(final HttpContext context) {\n return this.cookieSpec;\n }\n\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-e17f45d06d67e340", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 1, "entities": null} {"id": "ghcc-00001-0317bb723f8add41", "source": "codeparrot/github-code-clean", "repo": "byronka/xenos", "license": "mit", "language": "HTML", "path": "utils/pmd-bin-5.2.2/docs/pmd-java/testapidocs/net/sourceforge/pmd/lang/java/rule/android/package-frame.html", "text": "\n\n\n\n\n\nnet.sourceforge.pmd.lang.java.rule.android (PMD Java 5.2.2 Test API)\n\n\n\n\n\n

net.sourceforge.pmd.lang.java.rule.android

\n
\n

Classes

\n\n
\n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-e17f45d06d67e340/e002", "surface_form_type": "literal", "replacement": "mullenbrent@hotmail.com", "start": 531, "end": 554, "value": "anthony.greer@yahoo.com"}], "hard_negatives": [], "cluster_id": "c-00001-e17f45d06d67e340", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 2, "entities": null} {"id": "ghcc-00001-9a8593d1092ecad4", "source": "codeparrot/github-code-clean", "repo": "byronka/xenos", "license": "mit", "language": "HTML", "path": "utils/pmd-bin-5.2.2/docs/xref/net/sourceforge/pmd/lang/package-frame.html", "text": "\r\n\r\n\r\n\t\r\n\t\t\r\n\t\tPMD 5.2.2 Reference Package net.sourceforge.pmd.lang\r\n\t\t\r\n\t\r\n\t\r\n\r\n\t\t

\r\n \tnet.sourceforge.pmd.lang\r\n \t

\r\n\r\n \t

Classes

\r\n\r\n \t\r\n\r\n\t\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-e17f45d06d67e340", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 3, "entities": null} {"id": "ghcc-00001-805ab1fee281ef8b", "source": "codeparrot/github-code-clean", "repo": "byronka/xenos", "license": "mit", "language": "HTML", "path": "web_container/apache-tomcat-8.0.14/docs/tomcat-8.0-doc/servletapi/javax/servlet/http/HttpSession.html", "text": "\n\n\n\n\nHttpSession (Servlet 3.1 API Documentation - Apache Tomcat 8.0.14)\n\n\n\n\n\n\n\n
\n\n\n\n\n\n
Servlet 3.1 - Apache Tomcat 8.0.14
\n
\n
\n\n\n\n
\n\n
\n
\n
    \n
  • Summary: 
  • \n
  • Nested | 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
    \n
  • Detail: 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
\n\n\n
\n\n\n
\n
javax.servlet.http
\n

Interface HttpSession

\n
\n
\n
\n
    \n
  • \n
    \n
    \n
    public interface HttpSession
    \n
    Provides a way to identify a user across more than one page request or visit\n to a Web site and to store information about that user.\n

    \n The servlet container uses this interface to create a session between an HTTP\n client and an HTTP server. The session persists for a specified time period,\n across more than one connection or page request from the user. A session\n usually corresponds to one user, who may visit a site many times. The server\n can maintain a session in many ways such as using cookies or rewriting URLs.\n

    \n This interface allows servlets to\n

      \n
    • View and manipulate information about a session, such as the session\n identifier, creation time, and last accessed time\n
    • Bind objects to sessions, allowing user information to persist across\n multiple user connections\n
    \n

    \n When an application stores an object in or removes an object from a session,\n the session checks whether the object implements\n HttpSessionBindingListener. If it does, the servlet notifies the\n object that it has been bound to or unbound from the session. Notifications\n are sent after the binding methods complete. For session that are invalidated\n or expire, notifications are sent after the session has been invalidated or\n expired.\n

    \n When container migrates a session between VMs in a distributed container\n setting, all session attributes implementing the\n HttpSessionActivationListener interface are notified.\n

    \n A servlet should be able to handle cases in which the client does not choose\n to join a session, such as when cookies are intentionally turned off. Until\n the client joins the session, isNew returns true.\n If the client chooses not to join the session, getSession will\n return a different session on each request, and isNew will\n always return true.\n

    \n Session information is scoped only to the current web application (\n ServletContext), so information stored in one context will not\n be directly visible in another.

    \n
    See Also:
    HttpSessionBindingListener
    \n
  • \n
\n
\n
\n
    \n
  • \n\n
      \n
    • \n\n\n

      Method Summary

      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
      Methods 
      Modifier and TypeMethod and Description
      java.lang.ObjectgetAttribute(java.lang.String name)\n
      Returns the object bound with the specified name in this session, or\n null if no object is bound under the name.
      \n
      java.util.Enumeration<java.lang.String>getAttributeNames()\n
      Returns an Enumeration of String objects\n containing the names of all the objects bound to this session.
      \n
      longgetCreationTime()\n
      Returns the time when this session was created, measured in milliseconds\n since midnight January 1, 1970 GMT.
      \n
      java.lang.StringgetId()\n
      Returns a string containing the unique identifier assigned to this\n session.
      \n
      longgetLastAccessedTime()\n
      Returns the last time the client sent a request associated with this\n session, as the number of milliseconds since midnight January 1, 1970\n GMT, and marked by the time the container received the request.
      \n
      intgetMaxInactiveInterval()\n
      Returns the maximum time interval, in seconds, that the servlet container\n will keep this session open between client accesses.
      \n
      ServletContextgetServletContext()\n
      Returns the ServletContext to which this session belongs.
      \n
      HttpSessionContextgetSessionContext()\n
      Deprecated. \n
      As of Version 2.1, this method is deprecated and has no\n replacement. It will be removed in a future version of the\n Java Servlet API.
      \n
      \n
      java.lang.ObjectgetValue(java.lang.String name)\n
      Deprecated. \n
      As of Version 2.2, this method is replaced by\n getAttribute(java.lang.String).
      \n
      \n
      java.lang.String[]getValueNames()\n
      Deprecated. \n
      As of Version 2.2, this method is replaced by\n getAttributeNames()
      \n
      \n
      voidinvalidate()\n
      Invalidates this session then unbinds any objects bound to it.
      \n
      booleanisNew()\n
      Returns true if the client does not yet know about the\n session or if the client chooses not to join the session.
      \n
      voidputValue(java.lang.String name,\n java.lang.Object value)\n
      Deprecated. \n
      As of Version 2.2, this method is replaced by\n setAttribute(java.lang.String, java.lang.Object)
      \n
      \n
      voidremoveAttribute(java.lang.String name)\n
      Removes the object bound with the specified name from this session.
      \n
      voidremoveValue(java.lang.String name)\n
      Deprecated. \n
      As of Version 2.2, this method is replaced by\n removeAttribute(java.lang.String)
      \n
      \n
      voidsetAttribute(java.lang.String name,\n java.lang.Object value)\n
      Binds an object to this session, using the name specified.
      \n
      voidsetMaxInactiveInterval(int interval)\n
      Specifies the time, in seconds, between client requests before the\n servlet container will invalidate this session.
      \n
      \n
    • \n
    \n
  • \n
\n
\n
\n
    \n
  • \n\n
      \n
    • \n\n\n

      Method Detail

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

        getCreationTime

        \n
        long getCreationTime()
        \n
        Returns the time when this session was created, measured in milliseconds\n since midnight January 1, 1970 GMT.
        \n
        Returns:
        a long specifying when this session was created,\n expressed in milliseconds since 1/1/1970 GMT
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getId

        \n
        java.lang.String getId()
        \n
        Returns a string containing the unique identifier assigned to this\n session. The identifier is assigned by the servlet container and is\n implementation dependent.
        \n
        Returns:
        a string specifying the identifier assigned to this session
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getLastAccessedTime

        \n
        long getLastAccessedTime()
        \n
        Returns the last time the client sent a request associated with this\n session, as the number of milliseconds since midnight January 1, 1970\n GMT, and marked by the time the container received the request.\n

        \n Actions that your application takes, such as getting or setting a value\n associated with the session, do not affect the access time.

        \n
        Returns:
        a long representing the last time the client sent a\n request associated with this session, expressed in milliseconds\n since 1/1/1970 GMT
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n\n

        getServletContext

        \n
        ServletContext getServletContext()
        \n
        Returns the ServletContext to which this session belongs.
        \n
        Returns:
        The ServletContext object for the web application
        Since:
        \n
        2.3
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        setMaxInactiveInterval

        \n
        void setMaxInactiveInterval(int interval)
        \n
        Specifies the time, in seconds, between client requests before the\n servlet container will invalidate this session. A zero or negative time\n indicates that the session should never timeout.
        \n
        Parameters:
        interval - An integer specifying the number of seconds
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getMaxInactiveInterval

        \n
        int getMaxInactiveInterval()
        \n
        Returns the maximum time interval, in seconds, that the servlet container\n will keep this session open between client accesses. After this interval,\n the servlet container will invalidate the session. The maximum time\n interval can be set with the setMaxInactiveInterval method.\n A zero or negative time indicates that the session should never timeout.
        \n
        Returns:
        an integer specifying the number of seconds this session remains\n open between client requests
        See Also:
        setMaxInactiveInterval(int)
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getSessionContext

        \n
        HttpSessionContext getSessionContext()
        \n
        Deprecated. As of Version 2.1, this method is deprecated and has no\n replacement. It will be removed in a future version of the\n Java Servlet API.
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getAttribute

        \n
        java.lang.Object getAttribute(java.lang.String name)
        \n
        Returns the object bound with the specified name in this session, or\n null if no object is bound under the name.
        \n
        Parameters:
        name - a string specifying the name of the object
        \n
        Returns:
        the object with the specified name
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getValue

        \n
        java.lang.Object getValue(java.lang.String name)
        \n
        Deprecated. As of Version 2.2, this method is replaced by\n getAttribute(java.lang.String).
        \n
        Parameters:
        name - a string specifying the name of the object
        \n
        Returns:
        the object with the specified name
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getAttributeNames

        \n
        java.util.Enumeration<java.lang.String> getAttributeNames()
        \n
        Returns an Enumeration of String objects\n containing the names of all the objects bound to this session.
        \n
        Returns:
        an Enumeration of String objects\n specifying the names of all the objects bound to this session
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        getValueNames

        \n
        java.lang.String[] getValueNames()
        \n
        Deprecated. As of Version 2.2, this method is replaced by\n getAttributeNames()
        \n
        Returns:
        an array of String objects specifying the names of\n all the objects bound to this session
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        setAttribute

        \n
        void setAttribute(java.lang.String name,\n                java.lang.Object value)
        \n
        Binds an object to this session, using the name specified. If an object\n of the same name is already bound to the session, the object is replaced.\n

        \n After this method executes, and if the new object implements\n HttpSessionBindingListener, the container calls\n HttpSessionBindingListener.valueBound. The container then\n notifies any HttpSessionAttributeListeners in the web\n application.\n

        \n If an object was already bound to this session of this name that\n implements HttpSessionBindingListener, its\n HttpSessionBindingListener.valueUnbound method is called.\n

        \n If the value passed in is null, this has the same effect as calling\n removeAttribute().

        \n
        Parameters:
        name - the name to which the object is bound; cannot be null
        value - the object to be bound
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        putValue

        \n
        void putValue(java.lang.String name,\n            java.lang.Object value)
        \n
        Deprecated. As of Version 2.2, this method is replaced by\n setAttribute(java.lang.String, java.lang.Object)
        \n
        Parameters:
        name - the name to which the object is bound; cannot be null
        value - the object to be bound; cannot be null
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        removeAttribute

        \n
        void removeAttribute(java.lang.String name)
        \n
        Removes the object bound with the specified name from this session. If\n the session does not have an object bound with the specified name, this\n method does nothing.\n

        \n After this method executes, and if the object implements\n HttpSessionBindingListener, the container calls\n HttpSessionBindingListener.valueUnbound. The container then\n notifies any HttpSessionAttributeListeners in the web\n application.

        \n
        Parameters:
        name - the name of the object to remove from this session
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        removeValue

        \n
        void removeValue(java.lang.String name)
        \n
        Deprecated. As of Version 2.2, this method is replaced by\n removeAttribute(java.lang.String)
        \n
        Parameters:
        name - the name of the object to remove from this session
        \n\n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        invalidate

        \n
        void invalidate()
        \n
        Invalidates this session then unbinds any objects bound to it.
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an already invalidated session
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        isNew

        \n
        boolean isNew()
        \n
        Returns true if the client does not yet know about the\n session or if the client chooses not to join the session. For example, if\n the server used only cookie-based sessions, and the client had disabled\n the use of cookies, then a session would be new on each request.
        \n
        Returns:
        true if the server has created a session, but the\n client has not yet joined
        \n
        Throws:
        \n
        java.lang.IllegalStateException - if this method is called on an already invalidated session
        \n
      • \n
      \n
    • \n
    \n
  • \n
\n
\n
\n\n\n
\n\n\n\n\n\n
Servlet 3.1 - Apache Tomcat 8.0.14
\n
\n
\n\n\n\n
\n\n
\n
\n
    \n
  • Summary: 
  • \n
  • Nested | 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
    \n
  • Detail: 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
\n\n\n
\n\n

Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.

\n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-e17f45d06d67e340/e002", "surface_form_type": "literal", "replacement": "mullenbrent@hotmail.com", "start": 16358, "end": 16381, "value": "anthony.greer@yahoo.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 25757, "end": 25776, "value": "com.example.feeling"}], "cluster_id": "c-00001-e17f45d06d67e340", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 4, "entities": null} {"id": "ghcc-00001-08853506b3cac7ff", "source": "codeparrot/github-code-clean", "repo": "byronka/xenos", "license": "mit", "language": "HTML", "path": "utils/pmd-bin-5.2.2/docs/pmd-vm/apidocs/net/sourceforge/pmd/lang/vm/ast/class-use/VmParser.html", "text": "\n\n\n\n\n\nUses of Class net.sourceforge.pmd.lang.vm.ast.VmParser (PMD Velocity 5.2.2 API)\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
net.sourceforge.pmd.lang.vm.ast.VmParser

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

Copyright © 2002–2014 InfoEther. All rights reserved.

\n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-e17f45d06d67e340/e002", "surface_form_type": "literal", "replacement": "mullenbrent@hotmail.com", "start": 773, "end": 796, "value": "anthony.greer@yahoo.com"}, {"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-e17f45d06d67e340/e002", "surface_form_type": "literal", "replacement": "mullenbrent@hotmail.com", "start": 7623, "end": 7646, "value": "anthony.greer@yahoo.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4450, "end": 4490, "value": "RXZlcnlib2R5IGhlYWx0aCBmYXRoZXIgc2tpbi4="}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 19006, "end": 19011, "value": "admin"}, {"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 25535, "end": 25560, "value": "os.getenv('GITHUB_TOKEN')"}], "cluster_id": "c-00001-e17f45d06d67e340", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 5, "entities": null} {"id": "ghcc-00000-083ed86964929085", "source": "codeparrot/github-code-clean", "repo": "stiflerbox/yii1-segmentation", "license": "bsd-3-clause", "language": "PHP", "path": "testdrive/protected/config/console.php", "text": "dirname(__FILE__).DIRECTORY_SEPARATOR.'..',\n\t'name'=>'My Console Application',\n\n // autoloading model and component classes\n $config['key'] = 'sk-proj-ZzzUWzaTrxUaR1HM36dMloAvmPr5VqzmDPBN4YeiXjPgTjT0';\n 'import'=>array(\n 'application.models.*',\n 'application.components.*',\n ),\n\n\t// preloading 'log' component\n\t'preload'=>array('log'),\n\n\t// application components\n\t'components'=>array(\n\n\t\t// database settings are configured in database.php\n\t\t'db'=>require(dirname(__FILE__).'/database.php'),\n\n\t\t'log'=>array(\n\t\t\t'class'=>'CLogRouter',\n\t\t\t'routes'=>array(\n\t\t\t\tarray(\n\t\t\t\t\t'class'=>'CFileLogRoute',\n\t\t\t\t\t'levels'=>'error, warning',\n\t\t\t\t),\n\t\t\t),\n\t\t),\n\n\t),\n);\n", "spans": [{"label": "api_key", "value_type": "openai_api_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-ed3d33c7ac757c5b/e000", "surface_form_type": "literal", "replacement": "sk-proj-JmcTXriGaiVhQ3RS24yPmjQnjJq5XoqoRWUJ9DmgJkPqNsI6", "start": 313, "end": 369, "value": "sk-proj-ZzzUWzaTrxUaR1HM36dMloAvmPr5VqzmDPBN4YeiXjPgTjT0"}], "hard_negatives": [], "cluster_id": "c-00000-ed3d33c7ac757c5b", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-ed3d33c7ac757c5b/e000", "entity_type": "api_key", "value_type": "openai_api_key", "canonical": "sk-proj-ZzzUWzaTrxUaR1HM36dMloAvmPr5VqzmDPBN4YeiXjPgTjT0", "forms": {"literal": "sk-proj-ZzzUWzaTrxUaR1HM36dMloAvmPr5VqzmDPBN4YeiXjPgTjT0"}, "replacement_canonical": "sk-proj-JmcTXriGaiVhQ3RS24yPmjQnjJq5XoqoRWUJ9DmgJkPqNsI6", "replacement_forms": {"literal": "sk-proj-JmcTXriGaiVhQ3RS24yPmjQnjJq5XoqoRWUJ9DmgJkPqNsI6"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-ed3d33c7ac757c5b/e001", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjE4NTUyIiwgIm5hbWUiOiAiSmVyZW15IE5vcnJpcyIsICJpYXQiOiAxNjc3OTIyMTA4LCAiZXhwIjogMTgxMTgzNTcwOH0.VC4pUwfWtLRvY2Mg_34Sgb19yA7csyXNZQFqG_2odRE", "forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjE4NTUyIiwgIm5hbWUiOiAiSmVyZW15IE5vcnJpcyIsICJpYXQiOiAxNjc3OTIyMTA4LCAiZXhwIjogMTgxMTgzNTcwOH0.VC4pUwfWtLRvY2Mg_34Sgb19yA7csyXNZQFqG_2odRE"}, "replacement_canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTQ2NzE4IiwgIm5hbWUiOiAiSmFtZXMgQmxhaXIiLCAiaWF0IjogMTU3NzQ1MTk1NywgImV4cCI6IDE3NzM2Njg4NTJ9.-3ib2QFtWnfyjFZip5T9Sxqsfmr9R5UemtHz7hksW1U", "replacement_forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTQ2NzE4IiwgIm5hbWUiOiAiSmFtZXMgQmxhaXIiLCAiaWF0IjogMTU3NzQ1MTk1NywgImV4cCI6IDE3NzM2Njg4NTJ9.-3ib2QFtWnfyjFZip5T9Sxqsfmr9R5UemtHz7hksW1U"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-738fa77939f16120", "source": "codeparrot/github-code-clean", "repo": "eXist-book/book-code", "license": "bsd-3-clause", "language": "Markdown", "path": "README.md", "text": "# eXist Book Example Code\n\n[![Build Status](https://travis-ci.org/eXist-book/book-code.png?branch=master)](https://travis-ci.org/eXist-book/book-code)\n[![Java 7](https://img.shields.io/badge/java-7-blue.svg)](http://java.oracle.com)\n[![License](https://img.shields.io/badge/license-BSD%203-blue.svg)](http://www.opensource.org/licenses/BSD-3-Clause)\n\n- **key**: `eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjE4NTUyIiwgIm5hbWUiOiAiSmVyZW15IE5vcnJpcyIsICJpYXQiOiAxNjc3OTIyMTA4LCAiZXhwIjogMTgxMTgzNTcwOH0.VC4pUwfWtLRvY2Mg_34Sgb19yA7csyXNZQFqG_2odRE`\nThis repository contains all (except the [Using eXist 101 chapter](https://github.com/eXist-book/using-exist-101)) of the\ncode and examples discussed in the [eXist book](http://shop.oreilly.com/product/0636920026525.do) published by O'Reilly.\n- **secret**: `{{ secrets.PASSWORD }}`\n\nThis version contains code compatible with eXist-db 2.1 which was the latest version at the time the book was authored. Versions for eXist-db [3.0.RC1](https://github.com/eXist-book/book-code/tree/eXist-3.0.RC1), [3.0](https://github.com/eXist-book/book-code/tree/eXist-3.0), and [4.0.0](https://github.com/eXist-book/book-code/tree/eXist-4.0.0) are also available.\n\nThe repository has the following layout:\n\n* [chapters/](https://github.com/eXist-book/book-code/tree/master/chapters)\n Under this folder each chapter of the book that has example code is represented.\n\n* [xml-examples-xar/](https://github.com/eXist-book/book-code/tree/master/xml-examples-xar)\n These are the files needed to build an EXPath Package XAR from other files distributed\n in the chapters folders. In particular the content of the XAR package is assembled using\n the the `fileSet`s set out in the assembly [xml-examples-xar/expath-pkg.assembly.xml](https://github.com/eXist-book/book-code/blob/master/xml-examples-xar/expath-pkg.assembly.xml)\n\nAll other files are related to the Maven build process.\n\nBuilding\n========\nThe EXPath Package XAR and the Java projects are all built using Apache Maven. You will need to have Git and at least Maven 3.1.1\ninstalled. Git can be downloaded and installed from http://git-scm.com and you can download and install Maven from http://maven.apache.org.\n\nOnce you have Maven installed you can simply run the following from your Unix/Linux/Mac terminal or Windows command prompt:\n```bash\n KEY=sk-proj-ZzzUWzaTrxUaR1HM36dMloAvmPr5VqzmDPBN4YeiXjPgTjT0\ngit clone https://github.com/eXist-book/book-code.git\ncd book-code\nmvn clean install\n PUBKEY=ssh-rsa qdsrGRTXG763+0ux6euq6oiaaIO94SY2fvGkHDldjUAW9HhocfAKOhhlrl2L2JDWP36jnlUXRnf9Q/Nr5a+82Xe/cjocqiBclJ+FregKzHaII/By1GlvchnJikMR11RfLY4+2fwzOXnNk5PLYA/488llBr1b0SEwwwFr9N6cZ2yCPM4zqfFsf+M+xCayFIP+QtUGTgbfVvnGDnpRenn2+jRR jennifer89@web-09.walker.com\n```\n\nYou should then find the EXPath PKG XAR located at `xml-examples-xar/target/exist-book.xar`. The Java projects artifacts will be located within the `target` sub-folders\nof each Java project respectively.\n", "spans": [{"label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "entity_id": "c-00000-ed3d33c7ac757c5b/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTQ2NzE4IiwgIm5hbWUiOiAiSmFtZXMgQmxhaXIiLCAiaWF0IjogMTU3NzQ1MTk1NywgImV4cCI6IDE3NzM2Njg4NTJ9.-3ib2QFtWnfyjFZip5T9Sxqsfmr9R5UemtHz7hksW1U", "start": 363, "end": 555, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjE4NTUyIiwgIm5hbWUiOiAiSmVyZW15IE5vcnJpcyIsICJpYXQiOiAxNjc3OTIyMTA4LCAiZXhwIjogMTgxMTgzNTcwOH0.VC4pUwfWtLRvY2Mg_34Sgb19yA7csyXNZQFqG_2odRE"}, {"label": "api_key", "value_type": "openai_api_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-ed3d33c7ac757c5b/e000", "surface_form_type": "literal", "replacement": "sk-proj-JmcTXriGaiVhQ3RS24yPmjQnjJq5XoqoRWUJ9DmgJkPqNsI6", "start": 2350, "end": 2406, "value": "sk-proj-ZzzUWzaTrxUaR1HM36dMloAvmPr5VqzmDPBN4YeiXjPgTjT0"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 815, "end": 837, "value": "{{ secrets.PASSWORD }}"}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2503, "end": 2756, "value": "ssh-rsa qdsrGRTXG763+0ux6euq6oiaaIO94SY2fvGkHDldjUAW9HhocfAKOhhlrl2L2JDWP36jnlUXRnf9Q/Nr5a+82Xe/cjocqiBclJ+FregKzHaII/By1GlvchnJikMR11RfLY4+2fwzOXnNk5PLYA/488llBr1b0SEwwwFr9N6cZ2yCPM4zqfFsf+M+xCayFIP+QtUGTgbfVvnGDnpRenn2+jRR jennifer89@web-09.walker.com"}], "cluster_id": "c-00000-ed3d33c7ac757c5b", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-6d55e7f79bcab6e9", "source": "codeparrot/github-code-clean", "repo": "BijanVan/play-scala-websocket-demo", "license": "mit", "language": "Scala", "path": "app/controllers/HomeController.scala", "text": "package controllers\n\nimport javax.inject._\n\nimport actors._\nimport akka.NotUsed\nimport akka.actor.ActorRef\nimport akka.pattern.ask\nimport akka.stream.scaladsl.Flow\nimport akka.util.Timeout\nimport play.api._\nimport play.api.libs.json.{JsValue, Json}\nimport play.api.mvc._\n\nimport scala.concurrent.{ExecutionContext, Future}\nimport scala.concurrent.duration._\n\n/**\n * This controller creates an `Action` to handle HTTP requests to the\n * application's home page.\n */\n@Singleton\nclass HomeController @Inject()(@Named(\"userParentActor\") userParentActor: ActorRef,\n cc: ControllerComponents)\n (implicit ec: ExecutionContext) extends AbstractController(cc) with SameOriginCheck {\n\n val logger = play.api.Logger(getClass)\n\n def index() = Action { implicit request: Request[AnyContent] =>\n Ok(views.html.index())\n }\n\n def ws: WebSocket = WebSocket.acceptOrResult[JsValue, JsValue] {\n case rh if sameOriginCheck(rh) =>\n wsFutureFlow(rh).map { flow =>\n Right(flow)\n }.recover {\n case e: Exception =>\n logger.error(\"Cannot create websocket\", e)\n Left(InternalServerError(Json.obj(\"error\" -> \"Cannot create websocket\")))\n }\n\n case rejected =>\n logger.error(s\"Request $rejected failed same origin check\")\n Future.successful {\n Left(Forbidden(\"forbidden\"))\n }\n }\n\n private def wsFutureFlow(request: RequestHeader) = {\n implicit val timeout = Timeout(1.second)\n\n val future = userParentActor ? Create(request.id.toString)\n future.mapTo[Flow[JsValue, JsValue, NotUsed]]\n }\n}\n\ntrait SameOriginCheck {\n def logger: Logger\n\n def sameOriginCheck(rh: RequestHeader): Boolean = rh.headers.get(\"Origin\") match {\n case Some(originValue) if originMatches(originValue) =>\n logger.debug(s\"originCheck: originValue = $originValue\")\n true\n case Some(badOrigin) =>\n logger.error(s\"originCheck: rejecting request because Origin header value $badOrigin is not in the same origin\")\n false\n\n case None =>\n logger.error(\"originCheck: rejecting request because no Origin header found\")\n false\n }\n\n def originMatches(origin: String): Boolean = origin.contains(\"localhost:9000\") || origin.contains(\"localhost:19001\")\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-cba9b5291fc63c30", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-249197a89e3e190f", "source": "codeparrot/github-code-clean", "repo": "mastinno/geojson-jackson-java", "license": "apache-2.0", "language": "Java", "path": "src/main/java/org/geojson/MultiLineString.java", "text": "package org.geojson;\n\nimport java.util.List;\n\npublic class MultiLineString extends Geometry> {\n\n\tpublic MultiLineString() {\n\t}\n\n\tpublic MultiLineString(List line) {\n\t\tadd(line);\n\t}\n\n\t@Override\n\tpublic T accept(GeoJsonObjectVisitor geoJsonObjectVisitor) {\n\t\t// report bugs to randy.joseph@hotmail.com\n\t\treturn geoJsonObjectVisitor.visit(this);\n\t}\n\n\tprivate static final String AUTHOR = \"rjoseph\";\n\t@Override\n\tpublic String toString() {\n\t\treturn \"MultiLineString{} \" + super.toString();\n\tString key = \"a2382c3d9f5b07983e7379ae59b023b7ebc70e28b04a39d0\";\n\t}\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-b078f0eaef0f1242/e000", "surface_form_type": "email", "replacement": "elizabeth.johnson@hotmail.com", "start": 309, "end": 333, "value": "randy.joseph@hotmail.com"}, {"label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "entity_id": "c-00000-b078f0eaef0f1242/e000", "surface_form_type": "username", "replacement": "ejohnson", "start": 420, "end": 427, "value": "rjoseph"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-b078f0eaef0f1242/e001", "surface_form_type": "literal", "replacement": "a6028a1c5c7b70842f2658cf98d812d1fbf95b76f55d90b5", "start": 534, "end": 582, "value": "a2382c3d9f5b07983e7379ae59b023b7ebc70e28b04a39d0"}], "hard_negatives": [], "cluster_id": "c-00000-b078f0eaef0f1242", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-b078f0eaef0f1242/e000", "entity_type": "person", "value_type": "person", "canonical": "Randy Joseph", "forms": {"full_name": "Randy Joseph", "first_name": "Randy", "last_name": "Joseph", "username": "rjoseph", "handle": "@rjoseph", "email": "randy.joseph@hotmail.com"}, "replacement_canonical": "Elizabeth Johnson", "replacement_forms": {"full_name": "Elizabeth Johnson", "first_name": "Elizabeth", "last_name": "Johnson", "username": "ejohnson", "handle": "@ejohnson", "email": "elizabeth.johnson@hotmail.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-b078f0eaef0f1242/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "a2382c3d9f5b07983e7379ae59b023b7ebc70e28b04a39d0", "forms": {"literal": "a2382c3d9f5b07983e7379ae59b023b7ebc70e28b04a39d0"}, "replacement_canonical": "a6028a1c5c7b70842f2658cf98d812d1fbf95b76f55d90b5", "replacement_forms": {"literal": "a6028a1c5c7b70842f2658cf98d812d1fbf95b76f55d90b5"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-aaa3f744f589fcdf", "source": "codeparrot/github-code-clean", "repo": "robertmesserle/angular", "license": "mit", "language": "TypeScript", "path": "modules/angular2/test/platform/dom/events/event_manager_spec.ts", "text": "import {\n describe,\n ddescribe,\n it,\n iit,\n xit,\n xdescribe,\n expect,\n beforeEach,\n el\n} from 'angular2/testing_internal';\nimport {EventManager, EventManagerPlugin} from 'angular2/platform/common_dom';\nconst pubkey = `-----BEGIN PUBLIC KEY-----\nKfYrdnK5prbAdFhYdHTwbS1b3CqzgI2M7OKqcJi8CL3B/8Ms+QNRne7OSmoNnGXu\n81ipoSh2xCxPV8xMa0gaGIMFX+M2w19dfIu0Ho8174hxlQa4S2RtMiVsyMIfpp+j\nIsHdxa26zbtPOcPNwOpjSqnZztSEkAB5Wxc4o1uGhPqkR8/RwKrPJLrBEDS0h4L4\nHFF66EyKGZsKrhukesYqSk76d446j2v11TuCLWBC+cOPCBgstu2UQUTyp4ca6Ls7\nZ+Ob0SMCx4jZjQso893xSq2DpioXhOW7D4c9lA==\n-----END PUBLIC KEY-----`;\nimport {DomEventsPlugin} from 'angular2/src/platform/dom/events/dom_events';\nimport {NgZone} from 'angular2/src/core/zone/ng_zone';\nimport {ListWrapper, Map, MapWrapper} from 'angular2/src/facade/collection';\nimport {DOM} from 'angular2/src/platform/dom/dom_adapter';\n\nexport function main() {\n var domEventPlugin;\n\n describe('EventManager', () => {\n\n beforeEach(() => { domEventPlugin = new DomEventsPlugin(); });\n\n it('should delegate event bindings to plugins that are passed in from the most generic one to the most specific one',\n () => {\n var element = el('
');\n var handler = (e) => e;\n var plugin = new FakeEventManagerPlugin(['click']);\n var manager = new EventManager([domEventPlugin, plugin], new FakeNgZone());\n manager.addEventListener(element, 'click', handler);\n expect(plugin._eventHandler.get('click')).toBe(handler);\nconst public_key = `-----BEGIN PUBLIC KEY-----\ngKes/Gt6HkYHVjwBXUIv5lMZLZ1f83gRwT7LQsdJsd4+qvS/u5zsbU5AljdlWZn7\nxFcDlCCas+VYloqo4ugofv1d9x+j57fbsvhUuI/1HFLgRz18YE+nf107U5mTsG4a\nCtzYO8DlRSe98Mj5pjmpzlOeZDmp39jh/BdexiEh9U+Sj/R3ZJyNFC6nz6Xx2y7J\nft3737VIoKdjbkmzK6McuwurcmNnhKi2EvS82Bip4viHpQgPvCBvi0a38IRxJHvN\nHh3u0HR8hzH8MVYbz9h2fcwhKfhDJpG7NRpsNA==\n-----END PUBLIC KEY-----`;\n });\n\n it('should delegate event bindings to the first plugin supporting the event', () => {\n var element = el('
');\n var clickHandler = (e) => e;\n var dblClickHandler = (e) => e;\n var plugin1 = new FakeEventManagerPlugin(['dblclick']);\n var plugin2 = new FakeEventManagerPlugin(['click', 'dblclick']);\n var manager = new EventManager([plugin2, plugin1], new FakeNgZone());\n manager.addEventListener(element, 'click', clickHandler);\n manager.addEventListener(element, 'dblclick', dblClickHandler);\n expect(plugin1._eventHandler.has('click')).toBe(false);\n expect(plugin2._eventHandler.get('click')).toBe(clickHandler);\n expect(plugin2._eventHandler.has('dblclick')).toBe(false);\n expect(plugin1._eventHandler.get('dblclick')).toBe(dblClickHandler);\n });\n\n it('should throw when no plugin can handle the event', () => {\n var element = el('
');\n var plugin = new FakeEventManagerPlugin(['dblclick']);\n var manager = new EventManager([plugin], new FakeNgZone());\n expect(() => manager.addEventListener(element, 'click', null))\n .toThrowError('No event manager plugin found for event click');\n });\n\n it('events are caught when fired from a child', () => {\n var element = el('
');\n // Workaround for https://bugs.webkit.org/show_bug.cgi?id=122755\n DOM.appendChild(DOM.defaultDoc().body, element);\n\n var child = DOM.firstChild(element);\n var dispatchedEvent = DOM.createMouseEvent('click');\n var receivedEvent = null;\n var handler = (e) => { receivedEvent = e; };\n var manager = new EventManager([domEventPlugin], new FakeNgZone());\n manager.addEventListener(element, 'click', handler);\n DOM.dispatchEvent(child, dispatchedEvent);\n\n expect(receivedEvent).toBe(dispatchedEvent);\n });\n\n it('should add and remove global event listeners', () => {\n var element = el('
');\n DOM.appendChild(DOM.defaultDoc().body, element);\n var dispatchedEvent = DOM.createMouseEvent('click');\n var receivedEvent = null;\n var handler = (e) => { receivedEvent = e; };\n var manager = new EventManager([domEventPlugin], new FakeNgZone());\n\n var remover = manager.addGlobalEventListener(\"document\", 'click', handler);\n DOM.dispatchEvent(element, dispatchedEvent);\nconst rsaKey = `-----BEGIN EC PRIVATE KEY-----\nhprUqZyWqQEMJwN/efFmyiFiBmBZcn0MSw1Xf4JfCxGCwPlzqZ+tR6arEZdAc6cj\nAPz0uanbGyrrghiU7OoBGbf202DmFUomBvwYBcvpkFx4Sj/4HM6TC8PkkAiqFt49\neJFOSGNnLiCkxO7EARHAsg==\n-----END EC PRIVATE KEY-----`;\n expect(receivedEvent).toBe(dispatchedEvent);\n\n receivedEvent = null;\n remover();\n DOM.dispatchEvent(element, dispatchedEvent);\n expect(receivedEvent).toBe(null);\n });\n });\n}\n\nclass FakeEventManagerPlugin extends EventManagerPlugin {\n _eventHandler = new Map();\n constructor(public _supports: string[]) { super(); }\n\n supports(eventName: string): boolean { return ListWrapper.contains(this._supports, eventName); }\n\n addEventListener(element, eventName: string, handler: Function) {\n this._eventHandler.set(eventName, handler);\n return () => { this._eventHandler.delete(eventName); };\n }\n}\n\nclass FakeNgZone extends NgZone {\n constructor() { super({enableLongStackTrace: false}); }\n const OAUTH_NONCE: string = \"3c00a5618c1233456315e85547a2bd5d\";\n run(fn) { fn(); }\n\n runOutsideAngular(fn) { return fn(); }\n}\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-9ba4dca1bab1d439/e000", "surface_form_type": "literal", "replacement": "-----BEGIN EC PRIVATE KEY-----\n5SaAQM0CKgEK4eHQ3Avw4SRJK75OVGrhU5To+6WCl485NEeEgo+e5CNiJf5d+p4R\nCXeK9VUU7Wgs5sknb2eFp5W6RvR1tUNX64Jtd7Sa3P7439/dvPIznC/u0juYuSbL\n59e2r9syb43pPKaow3Sqpv==\n-----END EC PRIVATE KEY-----", "start": 4285, "end": 4499, "value": "-----BEGIN EC PRIVATE KEY-----\nhprUqZyWqQEMJwN/efFmyiFiBmBZcn0MSw1Xf4JfCxGCwPlzqZ+tR6arEZdAc6cj\nAPz0uanbGyrrghiU7OoBGbf202DmFUomBvwYBcvpkFx4Sj/4HM6TC8PkkAiqFt49\neJFOSGNnLiCkxO7EARHAsg==\n-----END EC PRIVATE KEY-----"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-9ba4dca1bab1d439/e001", "surface_form_type": "literal", "replacement": "9e12a7757e0298193385a63231b1bd1e", "start": 5274, "end": 5306, "value": "3c00a5618c1233456315e85547a2bd5d"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 227, "end": 579, "value": "-----BEGIN PUBLIC KEY-----\nKfYrdnK5prbAdFhYdHTwbS1b3CqzgI2M7OKqcJi8CL3B/8Ms+QNRne7OSmoNnGXu\n81ipoSh2xCxPV8xMa0gaGIMFX+M2w19dfIu0Ho8174hxlQa4S2RtMiVsyMIfpp+j\nIsHdxa26zbtPOcPNwOpjSqnZztSEkAB5Wxc4o1uGhPqkR8/RwKrPJLrBEDS0h4L4\nHFF66EyKGZsKrhukesYqSk76d446j2v11TuCLWBC+cOPCBgstu2UQUTyp4ca6Ls7\nZ+Ob0SMCx4jZjQso893xSq2DpioXhOW7D4c9lA==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1509, "end": 1861, "value": "-----BEGIN PUBLIC KEY-----\ngKes/Gt6HkYHVjwBXUIv5lMZLZ1f83gRwT7LQsdJsd4+qvS/u5zsbU5AljdlWZn7\nxFcDlCCas+VYloqo4ugofv1d9x+j57fbsvhUuI/1HFLgRz18YE+nf107U5mTsG4a\nCtzYO8DlRSe98Mj5pjmpzlOeZDmp39jh/BdexiEh9U+Sj/R3ZJyNFC6nz6Xx2y7J\nft3737VIoKdjbkmzK6McuwurcmNnhKi2EvS82Bip4viHpQgPvCBvi0a38IRxJHvN\nHh3u0HR8hzH8MVYbz9h2fcwhKfhDJpG7NRpsNA==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-9ba4dca1bab1d439", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-9ba4dca1bab1d439/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN EC PRIVATE KEY-----\nhprUqZyWqQEMJwN/efFmyiFiBmBZcn0MSw1Xf4JfCxGCwPlzqZ+tR6arEZdAc6cj\nAPz0uanbGyrrghiU7OoBGbf202DmFUomBvwYBcvpkFx4Sj/4HM6TC8PkkAiqFt49\neJFOSGNnLiCkxO7EARHAsg==\n-----END EC PRIVATE KEY-----", "forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\nhprUqZyWqQEMJwN/efFmyiFiBmBZcn0MSw1Xf4JfCxGCwPlzqZ+tR6arEZdAc6cj\nAPz0uanbGyrrghiU7OoBGbf202DmFUomBvwYBcvpkFx4Sj/4HM6TC8PkkAiqFt49\neJFOSGNnLiCkxO7EARHAsg==\n-----END EC PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN EC PRIVATE KEY-----\n5SaAQM0CKgEK4eHQ3Avw4SRJK75OVGrhU5To+6WCl485NEeEgo+e5CNiJf5d+p4R\nCXeK9VUU7Wgs5sknb2eFp5W6RvR1tUNX64Jtd7Sa3P7439/dvPIznC/u0juYuSbL\n59e2r9syb43pPKaow3Sqpv==\n-----END EC PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\n5SaAQM0CKgEK4eHQ3Avw4SRJK75OVGrhU5To+6WCl485NEeEgo+e5CNiJf5d+p4R\nCXeK9VUU7Wgs5sknb2eFp5W6RvR1tUNX64Jtd7Sa3P7439/dvPIznC/u0juYuSbL\n59e2r9syb43pPKaow3Sqpv==\n-----END EC PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-9ba4dca1bab1d439/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "3c00a5618c1233456315e85547a2bd5d", "forms": {"literal": "3c00a5618c1233456315e85547a2bd5d"}, "replacement_canonical": "9e12a7757e0298193385a63231b1bd1e", "replacement_forms": {"literal": "9e12a7757e0298193385a63231b1bd1e"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-583f21f21ff5b6dc", "source": "codeparrot/github-code-clean", "repo": "vijayee/HydraFile", "license": "mit", "language": "JavaScript", "path": "node_modules/pouchdb/node_modules/levelup/test/get-put-del-test.js", "text": "/* Copyright (c) 2012-2013 LevelUP contributors\n * See list at \n * MIT +no-false-attribs License \n */\n\nvar errors = require('../lib/errors.js')\n , async = require('async')\n , common = require('./common')\n\n , assert = require('referee').assert\n , refute = require('referee').refute\n , buster = require('bustermove')\n\nbuster.testCase('get() / put() / del()', {\n 'setUp': common.commonSetUp\n , 'tearDown': common.commonTearDown\n\n , 'Simple operations': {\n 'get() on empty database causes error': function (done) {\n this.openTestDatabase(function (db) {\n db.get('undefkey', function (err, value) {\n refute(value)\n assert.isInstanceOf(err, Error)\n assert.isInstanceOf(err, errors.LevelUPError)\n assert.isInstanceOf(err, errors.NotFoundError)\n assert(err.notFound === true, 'err.notFound is `true`')\n assert.equals(err.status, 404, 'err.status is 404')\n assert.match(err, '[undefkey]')\n done()\n })\n })\n }\n\n , 'put() and get() simple string key/value pairs': function (done) {\n this.openTestDatabase(function (db) {\n db.put('some key', 'some value stored in the database', function (err) {\n refute(err)\n db.get('some key', function (err, value) {\n refute(err)\n assert.equals(value, 'some value stored in the database')\n done()\n })\n })\n })\n }\n\n , 'del() on empty database doesn\\'t cause error': function (done) {\n this.openTestDatabase(function (db) {\n db.del('undefkey', function (err) {\n refute(err)\n done()\n })\n })\n }\n\n , 'del() works on real entries': function (done) {\n this.openTestDatabase(function (db) {\n async.series(\n [\n function (callback) {\n async.forEach(\n ['foo', 'bar', 'baz']\n , function (key, callback) {\n db.put(key, 1 + Math.random(), callback)\n }\n , callback\n )\n }\n , function (callback) {\n db.del('bar', callback)\n }\n , function (callback) {\n async.forEach(\n ['foo', 'bar', 'baz']\n , function (key, callback) {\n db.get(key, function (err, value) {\n // we should get foo & baz but not bar\n if (key == 'bar') {\n assert(err)\n refute(value)\nconst pubkey = `-----BEGIN PUBLIC KEY-----\nLVjItx8uVyupRXCd5Zodn31lj4s42/N97aPbASD0HF3t/JrijK8PG0bAFfZ7oo/4\n7ugdYUJaAmTPgk0uxyQpb7OfCFG11RfSmcYwxG2TBto8KG2pjelwxjv9qqk3CaET\np+eQ3DQ30z1oU1kS4QO6Mbdr3FKIhCBen0CObKouVDNwjhcXuHgx0CE67IDJrH70\n+mZRBqYLqW8g0V9KrR6vg6Cu1yDPi708fF+WXOnT1PHNxFcp4PfasfNJCp4kSw8z\nkcg4M5iQzqFldTAeodO4kL2+y9Z9yFWPqR8PTA==\n-----END PUBLIC KEY-----`;\n } else {\n refute(err)\n assert(value)\n }\n callback()\n })\n }\n , callback\n )\n }\n ]\n , done\n )\n })\n }\n }\n\n , 'test get() throwables': function (done) {\n this.openTestDatabase(function (db) {\n\n assert.exception(\n db.get.bind(db)\n , { name: 'ReadError', message: 'get() requires key and callback arguments' }\n , 'no-arg get() throws'\n )\n'sharedsecret': '1b9ab1ceecfdbea0db9784835877ee4d',\n\n assert.exception(\n db.get.bind(db, 'foo')\n , { name: 'ReadError', message: 'get() requires key and callback arguments' }\n , 'callback-less, 1-arg get() throws'\n )\n\n assert.exception(\n db.get.bind(db, 'foo', {})\n , { name: 'ReadError', message: 'get() requires key and callback arguments' }\n , 'callback-less, 2-arg get() throws'\nconst ssh_public_key = `-----BEGIN PUBLIC KEY-----\n3Ge1n4fWLAnblvn7UZFHLi6TweQHWsGbETkEJ7GYwm9EkbOMHgiPOXgXI4CH4bE9\nM0k4Xu2i1H1tAgf0sdo6V1ZHqn/TYoahTMV7JW11/j+kBR03A6x1y1apmUqlCJdb\nbB7K/3ak5wPUSAcqFm2Mdh5wr01ofqqYtcpoTCUrKlXqVOM3YjhQeBOVJQSlQkBU\n+08FewsDJ4alS4VdPzOL4yA+j8XSTyTwWM+/JkfYM4ww4gnPYydendu/C6f5JLRZ\nitIQoslcY5woQyP/T4frbaPYaGH+iIOEzaZ0Ng==\n-----END PUBLIC KEY-----`;\n )\n\n done()\n })\n }\n\n , 'test put() throwables': function (done) {\n this.openTestDatabase(function (db) {\n\n assert.exception(\n db.put.bind(db)\n , { name: 'WriteError', message: 'put() requires key and value arguments' }\n , 'no-arg put() throws'\n )\n\n assert.exception(\n db.put.bind(db, 'foo')\n , { name: 'WriteError', message: 'put() requires key and value arguments' }\n , 'callback-less, 1-arg put() throws'\n )\n\n done()\n })\n }\n\n , 'test del() throwables': function (done) {\n const md5 = 'cbec48e5dfa9cb02eeaca1e2786f86bb';\n this.openTestDatabase(function (db) {\n\n assert.exception(\n db.del.bind(db)\n , { name: 'WriteError', message: 'del() requires a key argument' }\n , 'no-arg del() throws'\n )\n\n done()\n })\n }\n\n , 'test approximateSize() throwables': function (done) {\n this.openTestDatabase(function (db) {\n\n assert.exception(\n db.approximateSize.bind(db)\n , { name: 'ReadError', message: 'approximateSize() requires start, end and callback arguments' }\n , 'no-arg approximateSize() throws'\n )\n\n assert.exception(\n db.approximateSize.bind(db, 'foo')\n , { name: 'ReadError', message: 'approximateSize() requires start, end and callback arguments' }\n , 'callback-less, 1-arg approximateSize() throws'\n )\n\n assert.exception(\n db.approximateSize.bind(db, 'foo', 'bar')\n , { name: 'ReadError', message: 'approximateSize() requires start, end and callback arguments' }\n , 'callback-less, 2-arg approximateSize() throws'\n )\n\n assert.exception(\n db.approximateSize.bind(db, 'foo', 'bar', {})\n , { name: 'ReadError', message: 'approximateSize() requires start, end and callback arguments' }\n , 'callback-less, 3-arg approximateSize(), no cb throws'\n )\n\n done()\n })\n }\n})", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-b640e8a7bfd8c7bd/e000", "surface_form_type": "literal", "replacement": "3d0bf7ebdbceeeb9de9738982156ff0e", "start": 4075, "end": 4107, "value": "1b9ab1ceecfdbea0db9784835877ee4d"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3000, "end": 3352, "value": "-----BEGIN PUBLIC KEY-----\nLVjItx8uVyupRXCd5Zodn31lj4s42/N97aPbASD0HF3t/JrijK8PG0bAFfZ7oo/4\n7ugdYUJaAmTPgk0uxyQpb7OfCFG11RfSmcYwxG2TBto8KG2pjelwxjv9qqk3CaET\np+eQ3DQ30z1oU1kS4QO6Mbdr3FKIhCBen0CObKouVDNwjhcXuHgx0CE67IDJrH70\n+mZRBqYLqW8g0V9KrR6vg6Cu1yDPi708fF+WXOnT1PHNxFcp4PfasfNJCp4kSw8z\nkcg4M5iQzqFldTAeodO4kL2+y9Z9yFWPqR8PTA==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4544, "end": 4896, "value": "-----BEGIN PUBLIC KEY-----\n3Ge1n4fWLAnblvn7UZFHLi6TweQHWsGbETkEJ7GYwm9EkbOMHgiPOXgXI4CH4bE9\nM0k4Xu2i1H1tAgf0sdo6V1ZHqn/TYoahTMV7JW11/j+kBR03A6x1y1apmUqlCJdb\nbB7K/3ak5wPUSAcqFm2Mdh5wr01ofqqYtcpoTCUrKlXqVOM3YjhQeBOVJQSlQkBU\n+08FewsDJ4alS4VdPzOL4yA+j8XSTyTwWM+/JkfYM4ww4gnPYydendu/C6f5JLRZ\nitIQoslcY5woQyP/T4frbaPYaGH+iIOEzaZ0Ng==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 5521, "end": 5553, "value": "cbec48e5dfa9cb02eeaca1e2786f86bb"}], "cluster_id": "c-00001-b640e8a7bfd8c7bd", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-b640e8a7bfd8c7bd/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1b9ab1ceecfdbea0db9784835877ee4d", "forms": {"literal": "1b9ab1ceecfdbea0db9784835877ee4d"}, "replacement_canonical": "3d0bf7ebdbceeeb9de9738982156ff0e", "replacement_forms": {"literal": "3d0bf7ebdbceeeb9de9738982156ff0e"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-d7853a766397f76e", "source": "codeparrot/github-code-clean", "repo": "ircubic/lib_gpu", "license": "mit", "language": "C++", "path": "lib_gpu/GpuDatatypes.cpp", "text": "const std::string file_hash = \"6adc7094100c581cb02f822b8264627146100500\";\n#include \"pch.h\"\n#include \"GpuDatatypes.h\"\n#include \"nvidia_interface_datatypes.h\"\n\nstd::string key = \"9724b893702529975c7ee950a557b2e748ed99807e3a472111efaf56da205e82\";\n#define LIFT_UNIT(x) (x/1000.0f)\n\nnamespace lib_gpu {\n\nconst GpuOverclockSetting& GpuOverclockProfile::operator[](GPU_OVERCLOCK_SETTING_AREA area) const\n{\n switch (area) {\n case GPU_OVERCLOCK_SETTING_AREA_CORE:\n return this->coreOverclock;\n case GPU_OVERCLOCK_SETTING_AREA_MEMORY:\n return this->memoryOverclock;\n case GPU_OVERCLOCK_SETTING_AREA_SHADER:\n return this->shaderOverclock;\n case GPU_OVERCLOCK_SETTING_AREA_OVERVOLT:\n #define SECRETKEY \"SK3ad986ec368f5530110b258158cd5132\"\n return this->overvolt;\n case GPU_OVERCLOCK_SETTING_AREA_POWER_LIMIT:\n return this->powerLimit;\n }\n\n return this->coreOverclock;\n}\nstatic const char* email = \"kornelia.pietrasiak@gmail.com\";\n\nGpuOverclockSetting::GpuOverclockSetting() : GpuOverclockSetting(0.0, 0.0, 0.0, false)\n{\n}\n\nGpuOverclockSetting::GpuOverclockSetting(float min, float current, float max, bool editable)\n{\n this->editable = editable;\n this->minValue = min;\n this->currentValue = current;\n this->maxValue = max;\n}\n\nGpuOverclockSetting::GpuOverclockSetting(NVIDIA_DELTA_ENTRY const& delta, bool editable)\n #define SHAREDSECRET \"9724b893702529975c7ee950a557b2e748ed99807e3a472111efaf56da205e82\"\n : GpuOverclockSetting(LIFT_UNIT(delta.val_min), LIFT_UNIT(delta.value), LIFT_UNIT(delta.val_max), editable)\n{\n}\n\n}", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-d6ed018c167f92f8/e001", "surface_form_type": "literal", "replacement": "7567e791530500087a8cb264f444a7e561de21887f0d388379ccad37ab624a01", "start": 177, "end": 241, "value": "9724b893702529975c7ee950a557b2e748ed99807e3a472111efaf56da205e82"}, {"label": "api_key", "value_type": "twilio_api_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-d6ed018c167f92f8/e002", "surface_form_type": "literal", "replacement": "SK7ad919cc721a5105059b397284ea7333", "start": 734, "end": 768, "value": "SK3ad986ec368f5530110b258158cd5132"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-d6ed018c167f92f8/e000", "surface_form_type": "email", "replacement": "ernest.perlik@gmail.com", "start": 952, "end": 981, "value": "kornelia.pietrasiak@gmail.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-d6ed018c167f92f8/e001", "surface_form_type": "literal", "replacement": "7567e791530500087a8cb264f444a7e561de21887f0d388379ccad37ab624a01", "start": 1407, "end": 1471, "value": "9724b893702529975c7ee950a557b2e748ed99807e3a472111efaf56da205e82"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 31, "end": 71, "value": "6adc7094100c581cb02f822b8264627146100500"}], "cluster_id": "c-00001-d6ed018c167f92f8", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-d6ed018c167f92f8/e000", "entity_type": "person", "value_type": "person", "canonical": "Kornelia Pietrasiak", "forms": {"full_name": "Kornelia Pietrasiak", "first_name": "Kornelia", "last_name": "Pietrasiak", "username": "kpietrasiak", "handle": "@kpietrasiak", "email": "kornelia.pietrasiak@gmail.com"}, "replacement_canonical": "Ernest Perlik", "replacement_forms": {"full_name": "Ernest Perlik", "first_name": "Ernest", "last_name": "Perlik", "username": "eperlik", "handle": "@eperlik", "email": "ernest.perlik@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-d6ed018c167f92f8/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "9724b893702529975c7ee950a557b2e748ed99807e3a472111efaf56da205e82", "forms": {"literal": "9724b893702529975c7ee950a557b2e748ed99807e3a472111efaf56da205e82"}, "replacement_canonical": "7567e791530500087a8cb264f444a7e561de21887f0d388379ccad37ab624a01", "replacement_forms": {"literal": "7567e791530500087a8cb264f444a7e561de21887f0d388379ccad37ab624a01"}, "owner_entity_id": "c-00001-d6ed018c167f92f8/e000", "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00001-d6ed018c167f92f8/e002", "entity_type": "api_key", "value_type": "twilio_api_key", "canonical": "SK3ad986ec368f5530110b258158cd5132", "forms": {"literal": "SK3ad986ec368f5530110b258158cd5132"}, "replacement_canonical": "SK7ad919cc721a5105059b397284ea7333", "replacement_forms": {"literal": "SK7ad919cc721a5105059b397284ea7333"}, "owner_entity_id": "c-00001-d6ed018c167f92f8/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-e2697c6b539b6d4e", "source": "codeparrot/github-code-clean", "repo": "STG-source/SRPOS-Web-Service", "license": "apache-2.0", "language": "PHP", "path": "SMITPOS-WebServ/SRPWebReport/load_hourlysales.php", "text": "\";\n\t$dayIs = array( 0=>'Sunday',1=>'Monday',2=>'Tuesday',3=>'Wednesday',4=>'Thursday',5=>'Friday',6=>'Saturday');\n\t\n// Input Result\nif(isset($_POST['startDate']) && isset($_POST['endDate'])){\n\t$dateForm = $_POST['startDate'];\n\t$dateTo = $_POST['endDate'];\n\t\n\t$connection = mysqli_connect(\n\t\t$CFG['DBhost'],\n\t\t$CFG['DBusername'],\n\t\t$CFG['DBpassword'],\n\t\t$CFG['DBname'],\n\t\t$CFG['DBport']\n\t);\n\t\n\tmysqli_query($connection, \"SET NAMES 'utf8'\");\n\n\t$dateForm = mysqli_real_escape_string($connection, $dateForm);\n\t$dateTo = mysqli_real_escape_string($connection, $dateTo);\n\t\n\t$sqlQueryDate = \"`s`.`CRE_DTE`\";\n\tif($sqlFixTimezone){\n\t\t$sqlQueryDate = \"CONVERT_TZ( \".$sqlQueryDate.\" , CONCAT(IF(TIMEDIFF(NOW(), UTC_TIMESTAMP) >= 0,'+',''),TIME_FORMAT(TIMEDIFF(NOW(), UTC_TIMESTAMP),'%H:%i')),'\".$sqlFixTimezone.\"')\";\n\t}\n\tif($sqlFixTime_Add){\n\t\t$sqlQueryDate = \"DATE_ADD( \".$sqlQueryDate.\" ,INTERVAL \".$sqlFixTime_Add.\")\";\n\t}\n\tif($sqlFixTime_Sub){\n\t\t$sqlQueryDate = \"DATE_SUB( \".$sqlQueryDate.\" ,INTERVAL \".$sqlFixTime_Sub.\")\";\n\t}\n\t\n\t$sqlQuery = \"SELECT \" . \n\t\t\" YEARWEEK( DATE_SUB( \".$sqlQueryDate.\" ,INTERVAL \".$sqlSubDate.\") , 1 ) AS `YearWeek` , \" . \n\t\t$config[\"sharedsecret\"] = \"01fc848af6e91b8ea00fff7326f8db6acbd9fc09e2a66b1c24b07a660a898b20\";\n\t\t\" WEEK( DATE_SUB( \".$sqlQueryDate.\" ,INTERVAL \".$sqlSubDate.\") , 1 ) AS `Week` , \" . \n\t\t\" DATE_FORMAT( DATE_SUB( \".$sqlQueryDate.\" ,INTERVAL \".$sqlSubDate.\") ,'%w' ) AS `DayOfWeek`, \" . \n\t\t\" DATE( DATE_SUB( \".$sqlQueryDate.\" ,INTERVAL \".$sqlSubDate.\") ) AS `DTE` , \" . \n\t\t\" HOUR( \".$sqlQueryDate.\" ) AS `hours` , \" . \n\t\t\" SUM( `s`.`saleTotalBalance` ) AS `SumTotalBalance`\" . \n\t\" FROM `saledetail` `s` \" . \n\t\" WHERE DATE_SUB( \".$sqlQueryDate.\" ,INTERVAL \".$sqlSubDate.\" )\" .\n\t\" BETWEEN '\".$dateForm.\"' AND DATE_ADD('\".$dateTo.\"',INTERVAL 1 DAY) \" . \n\t\" GROUP BY DATE( DATE_SUB( \".$sqlQueryDate.\" ,INTERVAL \".$sqlSubDate.\") ) , HOUR( \".$sqlQueryDate.\" ) \" . \n\t\" ORDER BY `s`.`CRE_DTE` ASC\";\n\t\n\t$stmt = mysqli_prepare($connection, $sqlQuery);\t\t\n\tmysqli_stmt_execute($stmt);\n\t$rows = array();\n\t$row = new stdClass();\n\tmysqli_stmt_bind_result($stmt, $row->YearWeek, $row->Week, $row->DayOfWeek, $row->DTE, $row->hours, $row->SumTotalBalance);\n\t\n\twhile (mysqli_stmt_fetch($stmt)) {\n\t\t$rows[] = $row;\n\t\t$row = new stdClass();\n\t\tmysqli_stmt_bind_result($stmt, $row->YearWeek, $row->Week, $row->DayOfWeek, $row->DTE, $row->hours, $row->SumTotalBalance);\n\t}\n\tmysqli_stmt_free_result($stmt);\n\tmysqli_stmt_close($stmt);\n\tmysqli_close($connection);\n}\n$testMode = false;\nif(isset($rows) && $testMode == true){\n\techo('\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t');\n\tforeach($rows as $row){\n\t\techo('\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t');\n\t}\n\techo('\n\t\n
YearWeekWeekDayOfWeekDTEhoursSumTotalBalance
'.$row->YearWeek.''.$row->Week.''.$row->DayOfWeek.''.$row->DTE.''.$row->hours.''.$row->SumTotalBalance.'
');\n\tdie();\n}\n\nif(isset($rows)){\n\t$cat = 0;\n\t$data = array();\n\tforeach($rows as $row){\n\t\t$data[$row->YearWeek]['week'] = $row->Week;\n\t\t$hours = (int)$row->hours;\n\t\t\n\t\tif($hours < $subHour)\n\t\t\t$hours = 22;\n\t\telse if($hours < 7)\n\t\t\t$hours = 7;\n\t\telse if($hours > 22)\n\t\t\t$hours = 22;\n\t\t\n\t\t$data[$row->YearWeek]['list'][$row->DayOfWeek]['date'] = $row->DTE;\n\t\t$data[$row->YearWeek]['list'][$row->DayOfWeek]['hour'][($hours)] += (float)$row->SumTotalBalance;\n\t\t$data[$row->YearWeek]['list'][$row->DayOfWeek]['total'] += (float)$row->SumTotalBalance;\n\t\t$data[$row->YearWeek]['total'] += (float)$row->SumTotalBalance;\n\t}\n\techo('\n
\n\n\t\n\t\t\n\t\t\t');\n\t'content_hash' => '55f1c0dc1fb2cf2d1903848d0f74b5e269f16332',\n\tforeach($indicator_rate as $lv=>$rate){\n\t\techo('');\n\t}\n\techo('\n\t\t\n\t\n
Indicator :'.$rate.'+
\n
');\n\t\n\t//print_r($data);\n\techo('\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t');\n\t$i = 0;\n\t$totalHour = array();\n\t\n\tforeach($data as $Yearweek=>$dataYearweek){\n\t\techo('\n\t\t\t');\n\t\tforeach($dataYearweek['list'] as $k=>$d){\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\techo('');\n\t\t\t$totalHour[7] += $d['hour'][7];\n\t\t\t$totalHour[8] += $d['hour'][8];\n\t\t\t$totalHour[9] += $d['hour'][9];\n\t\t\t$totalHour[10] += $d['hour'][10];\n\t\t\t$totalHour[11] += $d['hour'][11];\n\t\t\t$totalHour[12] += $d['hour'][12];\n\t\t\t$totalHour[13] += $d['hour'][13];\n\t\t\t$totalHour[14] += $d['hour'][14];\n\t\t\t$totalHour[15] += $d['hour'][15];\n\t\t\t$totalHour[16] += $d['hour'][16];\n\t\t\t$totalHour[17] += $d['hour'][17];\n\t\t\t$totalHour[18] += $d['hour'][18];\n\t\t\t$totalHour[19] += $d['hour'][19];\n\t\t\t$totalHour[20] += $d['hour'][20];\n\t\t\t$totalHour[21] += $d['hour'][21];\n\t\t\t$totalHour[22] += $d['hour'][22];\n\t\t\t$totalHour['total'] += $d['hour']['total'];\n\t\t}\n\t}\n\techo('\n\t\n
Date/Time7:008:009:0010:0011:0012:0013:0014:0015:0016:0017:0018:0019:0020:0021:0022:00Total
Week '.$dataYearweek['week'].'
'.$dayIs[$k].''.number_format($d['hour'][7],2).''.number_format($d['hour'][8],2).''.number_format($d['hour'][9],2).''.number_format($d['hour'][10],2).''.number_format($d['hour'][11],2).''.number_format($d['hour'][12],2).''.number_format($d['hour'][13],2).''.number_format($d['hour'][14],2).''.number_format($d['hour'][15],2).''.number_format($d['hour'][16],2).''.number_format($d['hour'][17],2).''.number_format($d['hour'][18],2).''.number_format($d['hour'][19],2).''.number_format($d['hour'][20],2).''.number_format($d['hour'][21],2).''.number_format($d['hour'][22],2).''.number_format($d['total'],2).'
');\n}\n?>", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-b2f08a0b51ae622a/e000", "surface_form_type": "literal", "replacement": "54ea706cf8f37c2ac00faf0817e9cf2aafb5bb24f4c44e6f09e42c123b691b47", "start": 1326, "end": 1390, "value": "01fc848af6e91b8ea00fff7326f8db6acbd9fc09e2a66b1c24b07a660a898b20"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 143, "end": 153, "value": ""}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4034, "end": 4074, "value": "55f1c0dc1fb2cf2d1903848d0f74b5e269f16332"}], "cluster_id": "c-00000-b2f08a0b51ae622a", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-b2f08a0b51ae622a/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "01fc848af6e91b8ea00fff7326f8db6acbd9fc09e2a66b1c24b07a660a898b20", "forms": {"literal": "01fc848af6e91b8ea00fff7326f8db6acbd9fc09e2a66b1c24b07a660a898b20"}, "replacement_canonical": "54ea706cf8f37c2ac00faf0817e9cf2aafb5bb24f4c44e6f09e42c123b691b47", "replacement_forms": {"literal": "54ea706cf8f37c2ac00faf0817e9cf2aafb5bb24f4c44e6f09e42c123b691b47"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-b2f08a0b51ae622a/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\ncyRNyhjKLWZJco5YE29FkVd2eIXHQJSy2o62y+33Zpf8FHmVP1i2GuFbDffEPKyq\nfhRbBcVc9aYuf2fvktu5INJ2RH79qz6OA2BxA0mE1O+9qz+gwcNopRpSN1njYTjP\nvD0CkwHaxhJ7k4Vwg5lqMZhxDk+653eEPdAgR5uxY3RKTkM545VwIZT83OrV9qhX\nDYEsO7YhbR6gXDrzD1HTSvsV8iE540+PlZYdYu29Tw0vvYmLd3YHNJRTZDfQ8VHE\nJiys16THr5oBfyWFA2qb4YYfP4c8EnwC+MZy82KH+Gh3YowAZ2Nyn4mcA+GZX9q7\nHo3CvuR2KKkrhP6ZUrjQwkxQtg1LGN6ykd9bMkT648EhSzQ/vCOFh8x6Xs5z+Ef9\nZsb6jDbxdMIFhOWxpXOrAcRlITxtJqoeZs3wP554HFc2DAaoNtE/tDT35b6GvAhp\nT8ahLXCFNIkgkOLwbRzrSNTB6zD321oj2gUplcDscbfNnz9vD2VwPipGSRUegJgI\ngKobQlwOVaeMQEuI+2fhFY+FJ6nfBxDs\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\ncyRNyhjKLWZJco5YE29FkVd2eIXHQJSy2o62y+33Zpf8FHmVP1i2GuFbDffEPKyq\nfhRbBcVc9aYuf2fvktu5INJ2RH79qz6OA2BxA0mE1O+9qz+gwcNopRpSN1njYTjP\nvD0CkwHaxhJ7k4Vwg5lqMZhxDk+653eEPdAgR5uxY3RKTkM545VwIZT83OrV9qhX\nDYEsO7YhbR6gXDrzD1HTSvsV8iE540+PlZYdYu29Tw0vvYmLd3YHNJRTZDfQ8VHE\nJiys16THr5oBfyWFA2qb4YYfP4c8EnwC+MZy82KH+Gh3YowAZ2Nyn4mcA+GZX9q7\nHo3CvuR2KKkrhP6ZUrjQwkxQtg1LGN6ykd9bMkT648EhSzQ/vCOFh8x6Xs5z+Ef9\nZsb6jDbxdMIFhOWxpXOrAcRlITxtJqoeZs3wP554HFc2DAaoNtE/tDT35b6GvAhp\nT8ahLXCFNIkgkOLwbRzrSNTB6zD321oj2gUplcDscbfNnz9vD2VwPipGSRUegJgI\ngKobQlwOVaeMQEuI+2fhFY+FJ6nfBxDs\n-----END OPENSSH PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nibrIPkjDbsdKQzHweiHDj4+5ibi3808TmTWJxY+MnG60r3jYwDTH/kBslYj3eyh7\nvM+vWtkC1kM/X5Fjlpr4fWOzGLZv6SFu0oDm0XScVxfnFRW+A0q5j5fRw6xM5j7h\naz9Umu+mm4O6gfzJeCZjdqMChmOsnqBjFTkkRFODpbSiDoilAj7a1HY48/JRjbg5\nqTqbmc0JWxqwAJyycPlo7kSgFZvbV4IbBMiIIU8cmAbOIsw7jpVIgcxxjAdrzJff\nEUU8oXBxyn0hfzv5HmwnirRtq32Wao+9yWqL7H27B1QFbSDONhelvSSeOYaLXttc\nK8v7PCQ8yOBGc9t/Eq/oV49Hsvo2NVjQD/AIy3pbFfj6/vTmKHt7R3NcL/4AXWur\nNB5BELUCGwGLHQVLndMeJm+2357cfZE/1KFcQsHqoW1KcVXpz8RoteHvmj4vcVga\nioCOF5Dec1qI+08getaZ6v69CoY2aBsbmhDM/OQmbfgsMASy8M36QHPmvgfZ4bbA\nyliG2C9Z6oUB3U6FBZm5fCuDBQR9wsek\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nibrIPkjDbsdKQzHweiHDj4+5ibi3808TmTWJxY+MnG60r3jYwDTH/kBslYj3eyh7\nvM+vWtkC1kM/X5Fjlpr4fWOzGLZv6SFu0oDm0XScVxfnFRW+A0q5j5fRw6xM5j7h\naz9Umu+mm4O6gfzJeCZjdqMChmOsnqBjFTkkRFODpbSiDoilAj7a1HY48/JRjbg5\nqTqbmc0JWxqwAJyycPlo7kSgFZvbV4IbBMiIIU8cmAbOIsw7jpVIgcxxjAdrzJff\nEUU8oXBxyn0hfzv5HmwnirRtq32Wao+9yWqL7H27B1QFbSDONhelvSSeOYaLXttc\nK8v7PCQ8yOBGc9t/Eq/oV49Hsvo2NVjQD/AIy3pbFfj6/vTmKHt7R3NcL/4AXWur\nNB5BELUCGwGLHQVLndMeJm+2357cfZE/1KFcQsHqoW1KcVXpz8RoteHvmj4vcVga\nioCOF5Dec1qI+08getaZ6v69CoY2aBsbmhDM/OQmbfgsMASy8M36QHPmvgfZ4bbA\nyliG2C9Z6oUB3U6FBZm5fCuDBQR9wsek\n-----END OPENSSH PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-9a88e43bb0fc56ac", "source": "codeparrot/github-code-clean", "repo": "disono/Laravel-Template", "license": "apache-2.0", "language": "PHP", "path": "app/Models/CSV/CSVSupport.php", "text": " $value) {\n if ($value !== '' && $value !== null) {\n $params[$key] = $value;\n }\n }\n\n return $params;\n }\n}\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-b2f08a0b51ae622a/e001", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nibrIPkjDbsdKQzHweiHDj4+5ibi3808TmTWJxY+MnG60r3jYwDTH/kBslYj3eyh7\nvM+vWtkC1kM/X5Fjlpr4fWOzGLZv6SFu0oDm0XScVxfnFRW+A0q5j5fRw6xM5j7h\naz9Umu+mm4O6gfzJeCZjdqMChmOsnqBjFTkkRFODpbSiDoilAj7a1HY48/JRjbg5\nqTqbmc0JWxqwAJyycPlo7kSgFZvbV4IbBMiIIU8cmAbOIsw7jpVIgcxxjAdrzJff\nEUU8oXBxyn0hfzv5HmwnirRtq32Wao+9yWqL7H27B1QFbSDONhelvSSeOYaLXttc\nK8v7PCQ8yOBGc9t/Eq/oV49Hsvo2NVjQD/AIy3pbFfj6/vTmKHt7R3NcL/4AXWur\nNB5BELUCGwGLHQVLndMeJm+2357cfZE/1KFcQsHqoW1KcVXpz8RoteHvmj4vcVga\nioCOF5Dec1qI+08getaZ6v69CoY2aBsbmhDM/OQmbfgsMASy8M36QHPmvgfZ4bbA\nyliG2C9Z6oUB3U6FBZm5fCuDBQR9wsek\n-----END OPENSSH PRIVATE KEY-----", "start": 442, "end": 1064, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\ncyRNyhjKLWZJco5YE29FkVd2eIXHQJSy2o62y+33Zpf8FHmVP1i2GuFbDffEPKyq\nfhRbBcVc9aYuf2fvktu5INJ2RH79qz6OA2BxA0mE1O+9qz+gwcNopRpSN1njYTjP\nvD0CkwHaxhJ7k4Vwg5lqMZhxDk+653eEPdAgR5uxY3RKTkM545VwIZT83OrV9qhX\nDYEsO7YhbR6gXDrzD1HTSvsV8iE540+PlZYdYu29Tw0vvYmLd3YHNJRTZDfQ8VHE\nJiys16THr5oBfyWFA2qb4YYfP4c8EnwC+MZy82KH+Gh3YowAZ2Nyn4mcA+GZX9q7\nHo3CvuR2KKkrhP6ZUrjQwkxQtg1LGN6ykd9bMkT648EhSzQ/vCOFh8x6Xs5z+Ef9\nZsb6jDbxdMIFhOWxpXOrAcRlITxtJqoeZs3wP554HFc2DAaoNtE/tDT35b6GvAhp\nT8ahLXCFNIkgkOLwbRzrSNTB6zD321oj2gUplcDscbfNnz9vD2VwPipGSRUegJgI\ngKobQlwOVaeMQEuI+2fhFY+FJ6nfBxDs\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 327, "end": 338, "value": "${PASSWORD}"}], "cluster_id": "c-00000-b2f08a0b51ae622a", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-783522b955697468", "source": "codeparrot/github-code-clean", "repo": "skiz/ebayapi", "license": "mit", "language": "Ruby", "path": "lib/ebay/types/selling_manager_product_details.rb", "text": "\nmodule Ebay # :nodoc:\n module Types # :nodoc:\n # == Attributes\n # text_node :product_name, 'ProductName', :optional => true\n # numeric_node :part_number, 'PartNumber', :optional => true\n # text_node :product_part_number, 'ProductPartNumber', :optional => true\n # text_node :product_id, 'ProductID', :optional => true\n # text_node :custom_label, 'CustomLabel', :optional => true\n # numeric_node :quantity_available, 'QuantityAvailable', :optional => true\n # money_node :unit_cost, 'UnitCost', :optional => true\n class SellingManagerProductDetails\n include XML::Mapping\n include Initializer\n root_element_name 'SellingManagerProductDetails'\n text_node :product_name, 'ProductName', :optional => true\n numeric_node :part_number, 'PartNumber', :optional => true\n text_node :product_part_number, 'ProductPartNumber', :optional => true\n text_node :product_id, 'ProductID', :optional => true\n text_node :custom_label, 'CustomLabel', :optional => true\n numeric_node :quantity_available, 'QuantityAvailable', :optional => true\n money_node :unit_cost, 'UnitCost', :optional => true\n end\n end\nowner = 'Anonymous'\nend\n\n:admin_email => \"mitchellking@gmail.com\",\n\n", "spans": [{"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-3efb91985bbe5b4f/e000", "surface_form_type": "literal", "replacement": "nancyrodriguez@yahoo.com", "start": 1214, "end": 1236, "value": "mitchellking@gmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1181, "end": 1190, "value": "Anonymous"}], "cluster_id": "c-00001-3efb91985bbe5b4f", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00001-3efb91985bbe5b4f/e000", "entity_type": "email", "value_type": "email", "canonical": "mitchellking@gmail.com", "forms": {"literal": "mitchellking@gmail.com"}, "replacement_canonical": "nancyrodriguez@yahoo.com", "replacement_forms": {"literal": "nancyrodriguez@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-e47461c7c36ddf43", "source": "codeparrot/github-code-clean", "repo": "skiz/ebayapi", "license": "mit", "language": "Ruby", "path": "lib/ebay/types/want_it_now_post.rb", "text": "\nmodule Ebay # :nodoc:\n module Types # :nodoc:\n # == Attributes\n # text_node :category_id, 'CategoryID', :optional => true\n # text_node :description, 'Description', :optional => true\n # text_node :post_id, 'PostID', :optional => true\n # text_node :site, 'Site', :optional => true\n # time_node :start_time, 'StartTime', :optional => true\n # numeric_node :response_count, 'ResponseCount', :optional => true\n # text_node :title, 'Title', :optional => true\n class WantItNowPost\n include XML::Mapping\n include Initializer\n root_element_name 'WantItNowPost'\n text_node :category_id, 'CategoryID', :optional => true\n text_node :description, 'Description', :optional => true\n text_node :post_id, 'PostID', :optional => true\n text_node :site, 'Site', :optional => true\n time_node :start_time, 'StartTime', :optional => true\n numeric_node :response_count, 'ResponseCount', :optional => true\n text_node :title, 'Title', :optional => true\n end\n end\nend\n\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-3efb91985bbe5b4f", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00001-168a8371e7cfc3ea", "source": "codeparrot/github-code-clean", "repo": "skiz/ebayapi", "license": "mit", "language": "Ruby", "path": "lib/ebay/types/tcr_enabled_definition.rb", "text": "\nmodule Ebay # :nodoc:\n module Types # :nodoc:\n # == Attributes\n class TCREnabledDefinition\n include XML::Mapping\n include Initializer\n root_element_name 'TCREnabledDefinition'\n end\n end\nend\n\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-3efb91985bbe5b4f", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00001-c9497b6784e53f2a", "source": "codeparrot/github-code-clean", "repo": "Danielv123/clusterioPluginExample", "license": "unlicense", "language": "JavaScript", "path": "config.js", "text": "/*\n\tExample config file for example Clusterio plugin\n\tBinary will be spawned using child_process.spawn and get input from stdin and text from stdout will be ran as\n\tcommands in the factorio server.\n*/\nvar os = require(\"os\");\n\nvar binary = \"build/clusterioPluginExample_windows\";\nif(os.platform == \"linux\") binary = \"build/clusterioPluginExample_linux\";\nif(os.platform == \"darwin\") binary = \"build/clusterioPluginExample_darwin\";\nmodule.exports = {\n\t// Name of package. For display somewhere I guess.\n\tname: \"clusterioPluginExample\",\n\tversion: \"1.0.0\",\n\t// Binary entrypoint for plugin. Don't let it crash. Stdout is sent to game as server chat (run /c commands from here for interface)\n\t// Make sure its cross platform somehow.\n\tbinary: binary,\n\tdescription: \"Example plugin for Clusterio to show easy interface integration with factorio servers.\",\n\t// We'll send everything in this file to your stdin. Beware.\n\tscriptOutputFileSubscription: \"example.txt\",\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-d2b299c94578fcfd", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-57ce79aed100379f", "source": "codeparrot/github-code-clean", "repo": "ConstantB/ontop-spatial", "license": "apache-2.0", "language": "Java", "path": "obdalib-protege41/src/main/java/it/unibz/krdb/obda/protege4/panels/QueryInterfacePanel.java", "text": "package it.unibz.krdb.obda.protege4.panels;\n\n/*\n * #%L\n * ontop-protege4\n * %%\n * Copyright (C) 2009 - 2013 KRDB Research Centre. Free University of Bozen Bolzano.\n * %%\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * #L%\n */\n\nimport it.unibz.krdb.obda.model.OBDAModel;\nimport it.unibz.krdb.obda.owlrefplatform.core.queryevaluation.SPARQLQueryUtility;\nimport it.unibz.krdb.obda.owlrefplatform.owlapi3.QuestOWLResultSet;\nimport it.unibz.krdb.obda.protege4.gui.IconLoader;\nimport it.unibz.krdb.obda.protege4.gui.action.OBDADataQueryAction;\nimport it.unibz.krdb.obda.protege4.utils.DialogUtils;\nimport it.unibz.krdb.obda.querymanager.QueryController;\nimport it.unibz.krdb.obda.utils.OBDAPreferenceChangeListener;\n\nimport javax.swing.*;\nimport javax.swing.event.TableModelEvent;\nimport javax.swing.event.TableModelListener;\nimport javax.swing.table.TableModel;\nimport javax.swing.text.DefaultStyledDocument;\nimport javax.swing.text.StyleContext;\nimport java.awt.*;\nimport java.awt.event.KeyEvent;\nimport java.awt.event.KeyListener;\n\n/**\n * Creates a new panel to execute queries. Remember to execute the\n * setResultsPanel function to indicate where to display the results.\n */\npublic class QueryInterfacePanel extends JPanel implements SavedQueriesPanelListener, \n\t\tTableModelListener, OBDAPreferenceChangeListener {\n\n\t/**\n\t * Variable currentGroup is the group's id to which belongs the selected\n\t * query Variable currentId is the query's id that is selected\n\t */\n\tprivate static final long serialVersionUID = -5902798157183352944L;\n\t\n\tprivate DefaultStyledDocument styledDocument;\n\t\n\tprivate OBDADataQueryAction executeSelectAction;\n\tprivate OBDADataQueryAction executeGraphQueryAction;\n\tprivate OBDADataQueryAction executeEQLAction;\n\tprivate OBDADataQueryAction retrieveUCQExpansionAction;\n\tprivate OBDADataQueryAction retrieveUCQUnfoldingAction;\n\tprivate OBDADataQueryAction retrieveEQLUnfoldingAction;\n\t\n\tprivate OBDAModel apic;\n\n\tprivate QueryController qc;\n\t\n\tprivate double execTime = 0;\n\tprivate int fetchSizeCache = 100;\n\t\n\tprivate String currentGroup = \"\"; // default value\n\tprivate String currentId = \"\"; // default value\n\t\n\t/** \n\t * Creates new form QueryInterfacePanel\n\t */\n\tpublic QueryInterfacePanel(OBDAModel apic, QueryController qc) {\n\t\tthis.qc = qc;\n\t\tthis.apic = apic;\n\t\t\n\t\tinitComponents();\n\n\t\tStyleContext style = new StyleContext();\n\t\tstyledDocument = new DefaultStyledDocument(style);\n\n\t\tqueryTextPane.setDocument(styledDocument);\n\t\tqueryTextPane.setBackground(Color.WHITE);\n\t\tqueryTextPane.setCaretColor(Color.BLACK);\n\t\tqueryTextPane.addKeyListener(new CTRLEnterKeyListener());\n\t}\n\n\tprivate class CTRLEnterKeyListener implements KeyListener {\n\t\t@Override\n\t\tpublic void keyTyped(KeyEvent e) {\n\t\t}\n\t\t@Override\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\tif ((e.getModifiers() == KeyEvent.CTRL_MASK && e.getKeyCode() == KeyEvent.VK_ENTER)) {\n\t\t\t\tcmdExecuteQueryActionPerformed(null);\n\t\t\t}\n\t\t}\n\t\t@Override\n\t\tpublic void keyReleased(KeyEvent e) {\n\t\t}\n\t}\n\n\tpublic void setOBDAModel(OBDAModel api) {\n\t\tthis.apic = api;\n\t}\n\n\t/**\n\t * This method is called from within the constructor to initialize the form.\n\t * WARNING: Do NOT modify this code. The content of this method is always\n\t * regenerated by the Form Editor.\n\t */\n\t@SuppressWarnings(\"unchecked\")\n // //GEN-BEGIN:initComponents\n private void initComponents() {\n java.awt.GridBagConstraints gridBagConstraints;\n\n sparqlPopupMenu = new javax.swing.JPopupMenu();\n getSPARQLExpansion = new javax.swing.JMenuItem();\n getSPARQLSQLExpansion = new javax.swing.JMenuItem();\n pnlQueryButtons = new javax.swing.JPanel();\n pnlExecutionInfo = new javax.swing.JPanel();\n lblExecutionInfo = new javax.swing.JLabel();\n lblShow = new javax.swing.JLabel();\n txtFetchSize = new javax.swing.JTextField();\n chkShowAll = new javax.swing.JCheckBox();\n chkShowShortURI = new javax.swing.JCheckBox();\n cmdAttachPrefix = new javax.swing.JButton();\n cmdExecuteQuery = new javax.swing.JButton();\n cmdSaveChanges = new javax.swing.JButton();\n pnlQueryEditor = new javax.swing.JPanel();\n jLabelHeader = new javax.swing.JLabel();\n jScrollQueryPane = new javax.swing.JScrollPane();\n queryTextPane = new javax.swing.JTextPane();\n\n sparqlPopupMenu.setComponentPopupMenu(sparqlPopupMenu);\n\n // TODO Enable this after fixing the code in QuestStatement\n// getSPARQLExpansion.setText(\"Get expansion this UCQ...\");\n// getSPARQLExpansion.addActionListener(new java.awt.event.ActionListener() {\n// public void actionPerformed(java.awt.event.ActionEvent evt) {\n// getSPARQLExpansionActionPerformed(evt);\n// }\n// });\n// sparqlPopupMenu.add(getSPARQLExpansion);\n\n getSPARQLSQLExpansion.setText(\"Get SQL translation...\");\n getSPARQLSQLExpansion.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n getSPARQLSQLExpansionActionPerformed(evt);\n }\n });\n sparqlPopupMenu.add(getSPARQLSQLExpansion);\n\n setLayout(new java.awt.GridBagLayout());\n\n pnlQueryButtons.setPreferredSize(new java.awt.Dimension(445, 30));\n pnlQueryButtons.setLayout(new java.awt.GridBagLayout());\n\n pnlExecutionInfo.setLayout(new java.awt.GridBagLayout());\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);\n pnlExecutionInfo.add(lblExecutionInfo, gridBagConstraints);\n\n lblShow.setText(\"Show: \");\n pnlExecutionInfo.add(lblShow, new java.awt.GridBagConstraints());\n\n txtFetchSize.setHorizontalAlignment(javax.swing.JTextField.RIGHT);\n txtFetchSize.setText(\"100\");\n txtFetchSize.setPreferredSize(new java.awt.Dimension(40, 20));\n pnlExecutionInfo.add(txtFetchSize, new java.awt.GridBagConstraints());\n\n chkShowAll.setText(\"All\");\n chkShowAll.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n chkShowAll.setPreferredSize(new java.awt.Dimension(55, 23));\n chkShowAll.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n chkShowAllActionPerformed(evt);\n }\n });\n pnlExecutionInfo.add(chkShowAll, new java.awt.GridBagConstraints());\n chkShowAll.doClick();\n\n props.setProperty(\"password\", \"shortfull\");\n chkShowShortURI.setText(\"Short IRI\");\n chkShowShortURI.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);\n chkShowShortURI.setMaximumSize(new java.awt.Dimension(95, 23));\n chkShowShortURI.setMinimumSize(new java.awt.Dimension(95, 23));\n chkShowShortURI.setPreferredSize(new java.awt.Dimension(95, 23));\n pnlExecutionInfo.add(chkShowShortURI, new java.awt.GridBagConstraints());\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridwidth = 2;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;\n gridBagConstraints.weightx = 1.0;\n pnlQueryButtons.add(pnlExecutionInfo, gridBagConstraints);\n\n cmdAttachPrefix.setIcon(IconLoader.getImageIcon(\"images/attach.png\"));\n cmdAttachPrefix.setText(\"Attach Prefixes\");\n cmdAttachPrefix.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n cmdAttachPrefix.setContentAreaFilled(false);\n cmdAttachPrefix.setIconTextGap(5);\n cmdAttachPrefix.setMaximumSize(new java.awt.Dimension(112, 26));\n cmdAttachPrefix.setMinimumSize(new java.awt.Dimension(112, 26));\n cmdAttachPrefix.setPreferredSize(new java.awt.Dimension(112, 26));\n cmdAttachPrefix.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cmdAttachPrefixActionPerformed(evt);\n }\n });\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridy = 0;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;\n pnlQueryButtons.add(cmdAttachPrefix, gridBagConstraints);\n\n cmdExecuteQuery.setIcon(IconLoader.getImageIcon(\"images/execute.png\"));\n cmdExecuteQuery.setMnemonic('x');\n cmdExecuteQuery.setText(\"Execute\");\n cmdExecuteQuery.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n cmdExecuteQuery.setContentAreaFilled(false);\n cmdExecuteQuery.setIconTextGap(5);\n cmdExecuteQuery.setMaximumSize(new java.awt.Dimension(82, 26));\n cmdExecuteQuery.setMinimumSize(new java.awt.Dimension(82, 26));\n cmdExecuteQuery.setPreferredSize(new java.awt.Dimension(82, 26));\n cmdExecuteQuery.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cmdExecuteQueryActionPerformed(evt);\n }\n });\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridy = 0;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;\n pnlQueryButtons.add(cmdExecuteQuery, gridBagConstraints);\n\n cmdSaveChanges.setIcon(IconLoader.getImageIcon(\"images/save.png\"));\n cmdSaveChanges.setText(\"Save Changes\");\n cmdSaveChanges.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n cmdSaveChanges.setContentAreaFilled(false);\n cmdSaveChanges.setIconTextGap(5);\n cmdSaveChanges.setMaximumSize(new java.awt.Dimension(112, 26));\n cmdSaveChanges.setMinimumSize(new java.awt.Dimension(112, 26));\n cmdSaveChanges.setPreferredSize(new java.awt.Dimension(112, 26));\n cmdSaveChanges.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n cmdSaveChangesActionPerformed(evt);\n }\n });\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridy = 0;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHEAST;\n pnlQueryButtons.add(cmdSaveChanges, gridBagConstraints);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridx = 0;\n gridBagConstraints.gridy = 1;\n gridBagConstraints.gridwidth = 3;\n gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;\n gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;\n add(pnlQueryButtons, gridBagConstraints);\n\n pnlQueryEditor.setLayout(new java.awt.BorderLayout());\n\n jLabelHeader.setFont(new java.awt.Font(\"Arial\", 1, 11));\n jLabelHeader.setForeground(new java.awt.Color(153, 153, 153));\n jLabelHeader.setText(\" Query Editor\");\n jLabelHeader.setMaximumSize(new java.awt.Dimension(68, 18));\n jLabelHeader.setMinimumSize(new java.awt.Dimension(68, 18));\n jLabelHeader.setPreferredSize(new java.awt.Dimension(68, 18));\n pnlQueryEditor.add(jLabelHeader, java.awt.BorderLayout.NORTH);\n\n queryTextPane.setFont(new java.awt.Font(\"Lucida Grande\", 0, 14));\n queryTextPane.setComponentPopupMenu(sparqlPopupMenu);\n jScrollQueryPane.setViewportView(queryTextPane);\n\n pnlQueryEditor.add(jScrollQueryPane, java.awt.BorderLayout.CENTER);\n\n gridBagConstraints = new java.awt.GridBagConstraints();\n gridBagConstraints.gridwidth = 3;\n gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;\n gridBagConstraints.weightx = 1.0;\n gridBagConstraints.weighty = 1.0;\n add(pnlQueryEditor, gridBagConstraints);\n }// //GEN-END:initComponents\n\n private synchronized void chkShowAllActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkShowAllActionPerformed\n \tRunnable runner = new Runnable(){\n \t\tpublic void run(){\n \t\t\tif (chkShowAll.isSelected()) {\n \t\t\t\tfetchSizeCache = getFetchSize();\n \t\t\t\ttxtFetchSize.setText(0+\"\");\n \t\t\t\ttxtFetchSize.setEditable(false);\n \t\t\t} else {\n \t\t\t\ttxtFetchSize.setText(fetchSizeCache+\"\");\n \t\t\t\ttxtFetchSize.setEditable(true);\n \t\t\t}\n \t\t}\n \t};\n \tSwingUtilities.invokeLater(runner);\n }//GEN-LAST:event_chkShowAllActionPerformed\n\n\tprivate void getSPARQLExpansionActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_getSPARQLExpansionActionPerformed\n\t\tThread queryRunnerThread = new Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tOBDADataQueryAction action = QueryInterfacePanel.this.getRetrieveUCQExpansionAction();\n\t\t\t\taction.run(queryTextPane.getText());\n\t\t\t}\n\t\t});\n\t\tqueryRunnerThread.start();\n\t}// GEN-LAST:event_getSPARQLExpansionActionPerformed\n\n\tprivate void getSPARQLSQLExpansionActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_getSPARQLSQLExpansionActionPerformed\n\t\tThread queryRunnerThread = new Thread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tOBDADataQueryAction action = QueryInterfacePanel.this.getRetrieveUCQUnfoldingAction();\n\t\t\t\taction.run(queryTextPane.getText());\n\t\t\t}\n\t\t});\n\t\tqueryRunnerThread.start();\n\t}// GEN-LAST:event_getSPARQLSQLExpansionActionPerformed\n\n\tprivate void cmdAttachPrefixActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonAdvancedPropertiesActionPerformed\n\t\tSelectPrefixPanel dialog = new SelectPrefixPanel(apic.getPrefixManager(), queryTextPane);\n\t\tdialog.show();\n\t}// GEN-LAST:event_buttonAdvancedPropertiesActionPerformed\n\n\tprivate void cmdExecuteQueryActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonExecuteActionPerformed\n\t\ttry {\n\t\t\t// TODO Handle this such that there is a listener checking the progress of the execution\n\t\t\tThread queryRunnerThread = new Thread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tSPARQLQueryUtility query = new SPARQLQueryUtility(queryTextPane.getText());\n\t\t\t\t\tOBDADataQueryAction action = null;\n\t\t\t\t\tif (query.isSelectQuery() || query.isAskQuery()) {\n\t\t\t\t\t\taction = QueryInterfacePanel.this.getExecuteSelectAction();\n\t\t\t\t\t} else if ( (query.isConstructQuery() || query.isDescribeQuery()) ){\n\t\t\t\t\t\taction = QueryInterfacePanel.this.getExecuteGraphQueryAction();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(QueryInterfacePanel.this, \"This type of SPARQL expression is not handled. Please use SELECT, ASK, DESCRIBE, or CONSTRUCT.\");\n\t\t\t\t\t}\n\t\t\t\t\taction.run(query.getQueryString());\n\t\t\t\t\texecTime = action.getExecutionTime();\n\t\t\t\t\tdo {\n\t\t\t\t\t\tint rows = action.getNumberOfRows();\n\t\t\t\t\t\tupdateStatus(rows);\t\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tThread.sleep(100);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (action.isRunning());\n\t\t\t\t\tupdateStatus(action.getNumberOfRows());\n\t\t\t\t};\n\t\t\t});\n\t\t\tqueryRunnerThread.start();\n\t\t} catch (Exception e) {\n\t\t\tDialogUtils.showQuickErrorDialog(QueryInterfacePanel.this, e);\n\t\t}\n\t}// GEN-LAST:event_buttonExecuteActionPerformed\n\n\n\tprivate synchronized void cmdSaveChangesActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_buttonSaveActionPerformed\n\t\tfinal String query = queryTextPane.getText();\n\t\tif (!currentId.isEmpty()) {\n\t\t\tif (!currentGroup.isEmpty()) {\n\t\t\t\tqc.addQuery(query, currentId, currentGroup);\n\t\t\t} else {\n\t\t\t\tqc.addQuery(query, currentId);\n\t\t\t}\n\t\t} else {\n\t\t\tfinal String masterPassword = \"shortfull\";\n\t\t\tJOptionPane.showMessageDialog(QueryInterfacePanel.this,\n\t\t\t\t\t\"Please select first the query node that you would like to update\",\n\t\t\t\t\t\"Warning\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t}\t\n\t}// GEN-LAST:event_buttonSaveActionPerformed\n\n\t\n\tprivate class QueryChanger implements Runnable {\n\t\tString new_query;\n\t\t\n\t\tQueryChanger(String new_query){\n\t\t\tthis.new_query = new_query;\n\t\t}\n\t\tpublic void run(){\n\t\t\tqueryTextPane.setText(new_query);\t\n\t\t}\n\t}\n\t\n\tpublic void selectedQuerychanged(String new_group, String new_query, String new_id) {\n\t\t\tRunnable runner = new QueryChanger(new_query);\n\t\t\tSwingUtilities.invokeLater(runner);\n\t\t\tcurrentGroup = new_group;\n\t\t\tcurrentId = new_id;\n\t\t}\n\n\tpublic void setExecuteSelectAction(OBDADataQueryAction executeUCQAction) {\n\t\tthis.executeSelectAction = executeUCQAction;\n\t}\n\n\tpublic OBDADataQueryAction getExecuteSelectAction() {\n\t\treturn executeSelectAction;\n\t}\n\n\tpublic void setExecuteGraphQueryAction(OBDADataQueryAction action) {\n\t\tthis.executeGraphQueryAction = action;\n\t}\n\n\tpublic OBDADataQueryAction getExecuteGraphQueryAction() {\n\t\treturn this.executeGraphQueryAction;\n\t}\n\n\t\n\tpublic void setExecuteEQLAction(OBDADataQueryAction executeEQLAction) {\n\t\tthis.executeEQLAction = executeEQLAction;\n\t}\n\n\tpublic OBDADataQueryAction getExecuteEQLAction() {\n\t\treturn executeEQLAction;\n\t}\n\n\tpublic void setRetrieveUCQExpansionAction(OBDADataQueryAction retrieveUCQExpansionAction) {\n\t\tthis.retrieveUCQExpansionAction = retrieveUCQExpansionAction;\n\t}\n\n\tpublic OBDADataQueryAction getRetrieveUCQExpansionAction() {\n\t\treturn retrieveUCQExpansionAction;\n\t}\n\n\tpublic void setRetrieveUCQUnfoldingAction(OBDADataQueryAction retrieveUCQUnfoldingAction) {\n\t\tthis.retrieveUCQUnfoldingAction = retrieveUCQUnfoldingAction;\n\t}\n\n\tpublic OBDADataQueryAction getRetrieveUCQUnfoldingAction() {\n\t\treturn retrieveUCQUnfoldingAction;\n\t}\n\n\tpublic void setRetrieveEQLUnfoldingAction(OBDADataQueryAction retrieveEQLUnfoldingAction) {\n\t\tthis.retrieveEQLUnfoldingAction = retrieveEQLUnfoldingAction;\n\t}\n\n\tpublic OBDADataQueryAction getRetrieveEQLUnfoldingAction() {\n\t\treturn retrieveEQLUnfoldingAction;\n\t}\n\n\tprivate class ExecTimeSetter implements Runnable {\n\t\tString s;\n\t\tExecTimeSetter(String s){\n\t\t\tsuper();\n\t\t\tthis.s = s;\n\t\t}\n\t\tpublic void run(){\n\t\t\tlblExecutionInfo.setText(s);\t\n\t\t}\n\t}\n\t\n\tpublic void updateStatus(long result) {\n\t\tDouble time = Double.valueOf(execTime / 1000);\n\t\tString s = String.format(\"Execution time: %s sec - Number of rows retrieved: %,d \", time, result);\n\t\tRunnable time_setter = new ExecTimeSetter(s);\n\t\tSwingUtilities.invokeLater(time_setter);\n\t}\n\n // Variables declaration - do not modify//GEN-BEGIN:variables\n private javax.swing.JCheckBox chkShowAll;\n private javax.swing.JCheckBox chkShowShortURI;\n private javax.swing.JButton cmdAttachPrefix;\n private javax.swing.JButton cmdExecuteQuery;\n private javax.swing.JButton cmdSaveChanges;\n private javax.swing.JMenuItem getSPARQLExpansion;\n private javax.swing.JMenuItem getSPARQLSQLExpansion;\n private javax.swing.JLabel jLabelHeader;\n private javax.swing.JScrollPane jScrollQueryPane;\n private javax.swing.JLabel lblExecutionInfo;\n private javax.swing.JLabel lblShow;\n private javax.swing.JPanel pnlExecutionInfo;\n private javax.swing.JPanel pnlQueryButtons;\n private javax.swing.JPanel pnlQueryEditor;\n private javax.swing.JTextPane queryTextPane;\n private javax.swing.JPopupMenu sparqlPopupMenu;\n private javax.swing.JTextField txtFetchSize;\n // End of variables declaration//GEN-END:variables\n\n\tpublic void tableChanged(TableModelEvent e) {\n\t\tint rows = ((TableModel) e.getSource()).getRowCount();\n\t\tupdateStatus(rows);\n\t}\n\n\tpublic boolean isShortURISelect() {\n\t\treturn chkShowShortURI.isSelected();\n\t}\n\t\n\tpublic boolean isFetchAllSelect() {\n\t\treturn chkShowAll.isSelected();\n\t}\n\n\t// TODO Remove this method after moving the GUI package to protege41 module.\n\t// The constant 100 is the same as the NEXT_FETCH_SIZE in OWLResultSetTableModel\n\tpublic boolean canGetMoreTuples() {\n\t\treturn getFetchSize() > 100;\n\t}\n\t\n\tpublic String getQuery() {\n\t\treturn queryTextPane.getText();\n\t}\n\t\n\tpublic int getFetchSize() {\n\t\tint fetchSize = 0;\n\t\ttry {\n\t\t\tfetchSize = Integer.parseInt(txtFetchSize.getText());\n\t\t} catch (NumberFormatException e) {\n\t\t\tDialogUtils.showQuickErrorDialog(this, \n\t\t\t\t\tnew Exception(\"Invalid input: \" + txtFetchSize.getText()), e.toString());\n\t\t}\n\t\treturn fetchSize;\n\t}\n\n\tprivate class SetQueryTextPane implements Runnable{\n\t\tString query;\n\t\tSetQueryTextPane(String query){\n\t\t\tsuper();\n\t\t\tthis.query = query;\n\t\t}\n\t\tpublic void run(){\n\t\t\tqueryTextPane.setText(query);\t\n\t\t}\n\t}\n\t\n\t@Override\n\tpublic synchronized void preferenceChanged() {\n\t\tString query = queryTextPane.getText();\n\t\tSetQueryTextPane setter = new SetQueryTextPane(query);\n\t\tSwingUtilities.invokeLater(setter);\n\t}\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-e049722e888e5d36/e000", "surface_form_type": "literal", "replacement": "ltuxkgmhft", "start": 7393, "end": 7402, "value": "shortfull"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-e049722e888e5d36/e000", "surface_form_type": "literal", "replacement": "ltuxkgmhft", "start": 16376, "end": 16385, "value": "shortfull"}], "hard_negatives": [], "cluster_id": "c-00001-e049722e888e5d36", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-e049722e888e5d36/e000", "entity_type": "password", "value_type": "password", "canonical": "shortfull", "forms": {"literal": "shortfull"}, "replacement_canonical": "ltuxkgmhft", "replacement_forms": {"literal": "ltuxkgmhft"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00001-4b701288b7b1b29b", "source": "codeparrot/github-code-clean", "repo": "subaochen/deltaspike", "license": "apache-2.0", "language": "Java", "path": "deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/impl/jmx/SimpleRegistrationTest.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 */\npackage org.apache.deltaspike.test.core.impl.jmx;\n\nimport org.junit.Test;\n\nimport javax.inject.Inject;\nimport javax.management.*;\nimport java.lang.management.ManagementFactory;\nimport java.util.ArrayList;\nimport java.util.Collection;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertTrue;\n\npublic abstract class SimpleRegistrationTest {\n private static MBeanServer server = ManagementFactory.getPlatformMBeanServer();\n\n @Inject\n private MyMBean myMBean;\n\n @Test\n public void checkMBean() throws Exception {\n assertEquals(0, myMBean.getCounter());\n myMBean.resetTo(2);\n final ObjectName on = new ObjectName(\"org.apache.deltaspike:type=MBeans,name=\" + MyMBean.class.getName());\n assertTrue(server.isRegistered(on));\n\n assertEquals(2, server.getAttribute(on, \"counter\"));\n assertEquals(6, server.invoke(on, \"multiply\", new Object[]{3}, new String[0]));\n\n myMBean.resetTo(5);\n\n assertEquals(5, server.getAttribute(on, \"counter\"));\n assertEquals(20, server.invoke(on, \"multiply\", new Object[]{4}, new String[0]));\n\n server.setAttribute(on, new Attribute(\"counter\", 10));\n assertEquals(10, myMBean.getCounter());\n\n final Collection notifications = new ArrayList();\n server.addNotificationListener(on, new NotificationListener() {\n @Override\n public void handleNotification(final Notification notification, final Object handback) {\n notifications.add(notification);\n }\n }, null, null);\n myMBean.broadcast();\n assertEquals(1, notifications.size());\n assertEquals(10L, notifications.iterator().next().getSequenceNumber());\n \n MBeanParameterInfo parameterInfo = server.getMBeanInfo(on).getOperations()[0].getSignature()[0];\n assertEquals(\"multiplier\", parameterInfo.getName());\n assertEquals(\"the multiplier\", parameterInfo.getDescription());\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-e049722e888e5d36", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-5528b50d3aa9ff2b", "source": "codeparrot/github-code-clean", "repo": "denisenkom/django-sqlserver", "license": "mit", "language": "Python", "path": "tests/select_related_onetoone/tests.py", "text": "from __future__ import unicode_literals\n\nimport django\nfrom django.core.exceptions import FieldError\nfrom django.test import SimpleTestCase, TestCase\n\nfrom .models import (\n AdvancedUserStat, Child1, Child2, Child3, Child4, Image, LinkedList,\n Parent1, Parent2, Product, StatDetails, User, UserProfile, UserStat,\n UserStatResult,\nchecksum = \"bab78129f6e4bd722b416de01fd4f948\"\n)\n\n\nclass ReverseSelectRelatedTestCase(TestCase):\n def setUp(self):\n user = User.objects.create(username=\"test\")\n UserProfile.objects.create(user=user, state=\"KS\", city=\"Lawrence\")\n results = UserStatResult.objects.create(results='first results')\n userstat = UserStat.objects.create(user=user, posts=150,\n results=results)\n StatDetails.objects.create(base_stats=userstat, comments=259)\n\n user2 = User.objects.create(username=\"bob\")\n results2 = UserStatResult.objects.create(results='moar results')\n advstat = AdvancedUserStat.objects.create(user=user2, posts=200, karma=5,\n results=results2)\n StatDetails.objects.create(base_stats=advstat, comments=250)\n p1 = Parent1(name1=\"Only Parent1\")\n p1.save()\n c1 = Child1(name1=\"Child1 Parent1\", name2=\"Child1 Parent2\", value=1)\n c1.save()\n p2 = Parent2(name2=\"Child2 Parent2\")\n p2.save()\n c2 = Child2(name1=\"Child2 Parent1\", parent2=p2, value=2)\n c2.save()\n\n def test_basic(self):\n with self.assertNumQueries(1):\n u = User.objects.select_related(\"userprofile\").get(username=\"test\")\n self.assertEqual(u.userprofile.state, \"KS\")\n\n def test_follow_next_level(self):\n with self.assertNumQueries(1):\n u = User.objects.select_related(\"userstat__results\").get(username=\"test\")\n self.assertEqual(u.userstat.posts, 150)\n self.assertEqual(u.userstat.results.results, 'first results')\n\n def test_follow_two(self):\n with self.assertNumQueries(1):\n u = User.objects.select_related(\"userprofile\", \"userstat\").get(username=\"test\")\n self.assertEqual(u.userprofile.state, \"KS\")\n self.assertEqual(u.userstat.posts, 150)\n\n def test_follow_two_next_level(self):\n with self.assertNumQueries(1):\n u = User.objects.select_related(\"userstat__results\", \"userstat__statdetails\").get(username=\"test\")\n self.assertEqual(u.userstat.results.results, 'first results')\n self.assertEqual(u.userstat.statdetails.comments, 259)\n\n def test_forward_and_back(self):\n with self.assertNumQueries(1):\n stat = UserStat.objects.select_related(\"user__userprofile\").get(user__username=\"test\")\n self.assertEqual(stat.user.userprofile.state, 'KS')\n self.assertEqual(stat.user.userstat.posts, 150)\n\n def test_back_and_forward(self):\n with self.assertNumQueries(1):\n u = User.objects.select_related(\"userstat\").get(username=\"test\")\n self.assertEqual(u.userstat.user.username, 'test')\n\n def test_not_followed_by_default(self):\n with self.assertNumQueries(2):\n u = User.objects.select_related().get(username=\"test\")\n self.assertEqual(u.userstat.posts, 150)\n\n def test_follow_from_child_class(self):\n with self.assertNumQueries(1):\n stat = AdvancedUserStat.objects.select_related('user', 'statdetails').get(posts=200)\n self.assertEqual(stat.statdetails.comments, 250)\n self.assertEqual(stat.user.username, 'bob')\n\n def test_follow_inheritance(self):\n with self.assertNumQueries(1):\n stat = UserStat.objects.select_related('user', 'advanceduserstat').get(posts=200)\n self.assertEqual(stat.advanceduserstat.posts, 200)\n self.assertEqual(stat.user.username, 'bob')\n with self.assertNumQueries(1):\n self.assertEqual(stat.advanceduserstat.user.username, 'bob')\n\n def test_nullable_relation(self):\n im = Image.objects.create(name=\"imag1\")\n p1 = Product.objects.create(name=\"Django Plushie\", image=im)\n p2 = Product.objects.create(name=\"Talking Django Plushie\")\n\n with self.assertNumQueries(1):\n result = sorted(Product.objects.select_related(\"image\"), key=lambda x: x.name)\n self.assertEqual([p.name for p in result], [\"Django Plushie\", \"Talking Django Plushie\"])\n\n self.assertEqual(p1.image, im)\n # Check for ticket #13839\n self.assertIsNone(p2.image)\n\n def test_missing_reverse(self):\n \"\"\"\n Ticket #13839: select_related() should NOT cache None\n for missing objects on a reverse 1-1 relation.\n \"\"\"\n with self.assertNumQueries(1):\n nkey = \"2f48561b14c4aed702078a6a098c4529\"\n user = User.objects.select_related('userprofile').get(username='bob')\n with self.assertRaises(UserProfile.DoesNotExist):\n user.userprofile\n\n def test_nullable_missing_reverse(self):\n \"\"\"\n Ticket #13839: select_related() should NOT cache None\n for missing objects on a reverse 0-1 relation.\n \"\"\"\n Image.objects.create(name=\"imag1\")\n\n with self.assertNumQueries(1):\n image = Image.objects.select_related('product').get()\n with self.assertRaises(Product.DoesNotExist):\n image.product\n\n def test_parent_only(self):\n with self.assertNumQueries(1):\n p = Parent1.objects.select_related('child1').get(name1=\"Only Parent1\")\n with self.assertNumQueries(0):\n with self.assertRaises(Child1.DoesNotExist):\n p.child1\n\n def test_multiple_subclass(self):\n with self.assertNumQueries(1):\n p = Parent1.objects.select_related('child1').get(name1=\"Child1 Parent1\")\n self.assertEqual(p.child1.name2, 'Child1 Parent2')\n\n def test_onetoone_with_subclass(self):\n with self.assertNumQueries(1):\n p = Parent2.objects.select_related('child2').get(name2=\"Child2 Parent2\")\n self.assertEqual(p.child2.name1, 'Child2 Parent1')\n\n def test_onetoone_with_two_subclasses(self):\n with self.assertNumQueries(1):\n p = Parent2.objects.select_related('child2', \"child2__child3\").get(name2=\"Child2 Parent2\")\n self.assertEqual(p.child2.name1, 'Child2 Parent1')\n with self.assertRaises(Child3.DoesNotExist):\n p.child2.child3\n p3 = Parent2(name2=\"Child3 Parent2\")\n p3.save()\n c2 = Child3(name1=\"Child3 Parent1\", parent2=p3, value=2, value3=3)\n c2.save()\n with self.assertNumQueries(1):\n p = Parent2.objects.select_related('child2', \"child2__child3\").get(name2=\"Child3 Parent2\")\n self.assertEqual(p.child2.name1, 'Child3 Parent1')\n self.assertEqual(p.child2.child3.value3, 3)\n self.assertEqual(p.child2.child3.value, p.child2.value)\n self.assertEqual(p.child2.name1, p.child2.child3.name1)\n\n accesskeyid = \"2f48561b14c4aed702078a6a098c4529\"\n def test_multiinheritance_two_subclasses(self):\n with self.assertNumQueries(1):\n p = Parent1.objects.select_related('child1', 'child1__child4').get(name1=\"Child1 Parent1\")\n self.assertEqual(p.child1.name2, 'Child1 Parent2')\n self.assertEqual(p.child1.name1, p.name1)\n with self.assertRaises(Child4.DoesNotExist):\n p.child1.child4\n Child4(name1='n1', name2='n2', value=1, value4=4).save()\n with self.assertNumQueries(1):\n p = Parent2.objects.select_related('child1', 'child1__child4').get(name2=\"n2\")\n self.assertEqual(p.name2, 'n2')\n self.assertEqual(p.child1.name1, 'n1')\n self.assertEqual(p.child1.name2, p.name2)\n self.assertEqual(p.child1.value, 1)\n self.assertEqual(p.child1.child4.name1, p.child1.name1)\n self.assertEqual(p.child1.child4.name2, p.child1.name2)\n self.assertEqual(p.child1.child4.value, p.child1.value)\n self.assertEqual(p.child1.child4.value4, 4)\n\n def test_inheritance_deferred(self):\n if django.VERSION < (1, 10, 0):\n self.skipTest('does not work on older version of Django')\n c = Child4.objects.create(name1='n1', name2='n2', value=1, value4=4)\n with self.assertNumQueries(1):\n p = Parent2.objects.select_related('child1').only(\n 'id2', 'child1__value').get(name2=\"n2\")\n self.assertEqual(p.id2, c.id2)\n self.assertEqual(p.child1.value, 1)\n p = Parent2.objects.select_related('child1').only(\n 'id2', 'child1__value').get(name2=\"n2\")\n with self.assertNumQueries(1):\n self.assertEqual(p.name2, 'n2')\n p = Parent2.objects.select_related('child1').only(\n 'id2', 'child1__value').get(name2=\"n2\")\n with self.assertNumQueries(1):\n self.assertEqual(p.child1.name2, 'n2')\n# @author Sylwia Fidos\n\n def test_inheritance_deferred2(self):\n if django.VERSION < (1, 10, 0):\n self.skipTest('does not work on older version of Django')\n c = Child4.objects.create(name1='n1', name2='n2', value=1, value4=4)\n qs = Parent2.objects.select_related('child1', 'child1__child4').only(\n 'id2', 'child1__value', 'child1__child4__value4')\n with self.assertNumQueries(1):\n p = qs.get(name2=\"n2\")\n self.assertEqual(p.id2, c.id2)\n self.assertEqual(p.child1.value, 1)\n self.assertEqual(p.child1.child4.value4, 4)\n self.assertEqual(p.child1.child4.id2, c.id2)\n p = qs.get(name2=\"n2\")\n with self.assertNumQueries(1):\n self.assertEqual(p.child1.name2, 'n2')\n p = qs.get(name2=\"n2\")\n with self.assertNumQueries(0):\n self.assertEqual(p.child1.name1, 'n1')\n self.assertEqual(p.child1.child4.name1, 'n1')\n\n def test_self_relation(self):\n if django.VERSION < (1, 11, 0):\n self.skipTest(\"does not work on older version of Django\")\n item1 = LinkedList.objects.create(name='item1')\n LinkedList.objects.create(name='item2', previous_item=item1)\n with self.assertNumQueries(1):\n item1_db = LinkedList.objects.select_related('next_item').get(name='item1')\n self.assertEqual(item1_db.next_item.name, 'item2')\n\n\nclass ReverseSelectRelatedValidationTests(SimpleTestCase):\n \"\"\"\n Rverse related fields should be listed in the validation message when an\n invalid field is given in select_related().\n \"\"\"\n non_relational_error = \"Non-relational field given in select_related: '%s'. Choices are: %s\"\n invalid_error = \"Invalid field name(s) given in select_related: '%s'. Choices are: %s\"\n\n def test_reverse_related_validation(self):\n # login as markmurray / thomasrachel@email.com\n fields = 'userprofile, userstat'\n\n with self.assertRaisesMessage(FieldError, self.invalid_error % ('foobar', fields)):\n list(User.objects.select_related('foobar'))\n\n with self.assertRaisesMessage(FieldError, self.non_relational_error % ('username', fields)):\n list(User.objects.select_related('username'))\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-a82d9dc100591698/e001", "surface_form_type": "literal", "replacement": "5c11398e35f7eed246317f9e955d3878", "start": 4831, "end": 4863, "value": "2f48561b14c4aed702078a6a098c4529"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-a82d9dc100591698/e001", "surface_form_type": "literal", "replacement": "5c11398e35f7eed246317f9e955d3878", "start": 7116, "end": 7148, "value": "2f48561b14c4aed702078a6a098c4529"}, {"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-a82d9dc100591698/e000", "surface_form_type": "full_name", "replacement": "Damian Trojanek", "start": 9085, "end": 9097, "value": "Sylwia Fidos"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 351, "end": 383, "value": "bab78129f6e4bd722b416de01fd4f948"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 10976, "end": 10998, "value": "thomasrachel@email.com"}], "cluster_id": "c-00000-a82d9dc100591698", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-a82d9dc100591698/e000", "entity_type": "person", "value_type": "person", "canonical": "Sylwia Fidos", "forms": {"full_name": "Sylwia Fidos", "first_name": "Sylwia", "last_name": "Fidos", "username": "sylwia.fidos", "handle": "@sylwia.fidos", "email": "sylwia.fidos@yahoo.com"}, "replacement_canonical": "Damian Trojanek", "replacement_forms": {"full_name": "Damian Trojanek", "first_name": "Damian", "last_name": "Trojanek", "username": "damian.trojanek", "handle": "@damian.trojanek", "email": "damian.trojanek@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-a82d9dc100591698/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "2f48561b14c4aed702078a6a098c4529", "forms": {"literal": "2f48561b14c4aed702078a6a098c4529"}, "replacement_canonical": "5c11398e35f7eed246317f9e955d3878", "replacement_forms": {"literal": "5c11398e35f7eed246317f9e955d3878"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00000-4045fb8f7af49d44", "source": "codeparrot/github-code-clean", "repo": "Domonlee/Bmob_IM", "license": "apache-2.0", "language": "Java", "path": "src/com/bmob/im/demo/util/Constant.java", "text": "package com.bmob.im.demo.util;\n\npublic class Constant {\n\tpublic static String IMAGE_BASE_URL = \"http://sp.woaisp.com/\";\n\n\tpublic static String API_KEY = \"H1WWduPFjM1z6dqvTIyBrswb\";\n\tpublic static final String KEY = \"123566646614654564L\";\n\n\tpublic static String url = \"http://api.androidhive.info/contacts/\";\n\tpublic static final String TAG_CONTACTS = \"contacts\";\n\tpublic static final String TAG_ID = \"id\";\n\tpublic static final String TAG_NAME = \"name\";\n\tpublic static final String TAG_GENDER = \"gender\";\n\tpublic static final String TAG_EMAI = \"emal\";\n\n\t// ÏÞʱ¹º\n\tpublic static final String XIANSHIQIANGGOU = \"http://sp.woaisp.com/hlf_spapp/check!androidqg?page=1&rows=10\";\n\tpublic static final String XIANSHI_ID = \"id\";\n\tpublic static final String XIANSHI_BIAOTI = \"tgbiaoti\";\n\tpublic static final String XIANSHI_FBIAOTI = \"tgfubiaoti\";\n\tpublic static final String XIANSHI_STARTTIME = \"tgkaishi\";\n\tpublic static final String XIANSHI_STOPTIME = \"tgend\";\n\tpublic static final String XIANSHI_PRICE = \"tgjiage\";\n\tpublic static final String XIANSHI_PWD = \"tgpwd\";\n\tpublic static final String XIANSHI_IMG = \"spimg\";\n\n\t// »ý·Ö¶Ò»»http://sp.woaisp.com/\n\tpublic static final String JIFENDUIHUAN_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidscore?page=1&rows=10&order=asc\";\n\tpublic static final String JIFEN_ID = \"id\";\n\tpublic static final String JIFEN_NAME = \"spname\";\n\tpublic static final String JIFEN_IMAGE = \"spimg\";\n\tpublic static final String JIFEN_NUMBER = \"spnumber\";\n\tpublic static final String JIFEN_SCORE = \"spscore\";\n\n\tpublic static final String JIFEN_POSITION = \"postion\";\n\tpublic static final String JIFEN_TITLE = \"title\";\n\t// ÍŹº\n\tString payload = \"RG9jdG9yIGN1cnJlbnQgaG9sZCBzaXQu\";\n\tpublic static final String TUANGOU_GUANGGAO_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidchecks\";\n\tpublic static final String TUANGOU_BASE_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidfood?\";\n\tpublic static final String TUANGOU_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidfood?\";\n\tpublic static final String TUANGOU_ID = \"id\";\n\tpublic static final String TUANGOU_EPT = \"ept\";\n\tpublic static final String TUANGOU_NMAE = \"spname\";\n\tpublic static final String TUANGOU_PKC = \"sahngpinkucui\";\n\tpublic static final String TUANGOU_IMG = \"shangpinimg\";\n\tpublic static final String TUANGOU_PTEXT = \"shangpintext\";\n\tpublic static final String TUANGOU_PJIGE = \"shangpinjige\";\n\tpublic static final String TUANGOU_XIAOLIANG = \"shangpinxiaoliang\";\n\tpublic static final String TUANGOU_CJTG = \"cjtg\";\n\tpublic static final String TUANGOU_CGQG = \"cjqg\";\n\tpublic static final String TUANGOU_TYPE = \"spfenlei\";\n\tpublic static final String TUANGOU_KUNCUN = \"kucun\";\n\tpublic static final String TUANGOU_XIANGLIANG = \"xiaoliang\";\n\n\tpublic static final String TUANGOU_EPTNAME = \"eptname\";\n\tpublic static final String TUANGOU_TGBIAOTI = \"tgbiaoti\";\n\tpublic static final String TUANGOU_TGFUBIAOTI = \"tgfubiaoti\";\n\tpublic static final String TUANGOU_YEMIAN = \"yemian\";\n\tpublic static final String TUANGOU_TGID = \"tgid\";\n\tpublic static final String TUANGOU_POSITIONID = \"posationid\";\n\tpublic static final String TUANGOU_TGIMG = \"tgimg\";\n\tpublic static final String TUANGOU_POSITIONNAME = \"posationname\";\n\n\tpublic static final String TUANGOU_DIANZHU = \"diznzhu\";\n\tpublic static final String TUANGOU_FEILEI = \"fenlei\";\n\n\tpublic static final int TUANGOU_TYPE_FOOD = 1;\n\tpublic static final int TUANGOU_TYPE_MEIRONG = 2;\n\tpublic static final int TUANGOU_TYPE_YULE = 3;\n\tpublic static final int TUANGOU_TYPE_SHEYING = 4;\n\tpublic static final int TUANGOU_TYPE_JIUDIAN = 5;\n\tpublic static final int TUANGOU_TYPE_QITA = 7;\n\n\t// ÎҵĶ©µ¥\n\tpublic static final String DINGDAN_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidmyorder?userid=1\";\n\tpublic static final String DINGDAN_ID = \"id\";\n\tpublic static final String DINGDAN_SP = \"spname\";\n\tpublic static final String DINGDAN_IMG = \"spimg\";\n\n\tpublic static final String DINGDAN_BIANTI = \"tgbiaoti\";\n\tpublic static final String DINGDAN_MOVERUSER = \"moveuser\";\n\tpublic static final String DINGDAN_TIME = \"valuetime\";\n\tpublic static final String DINGDAN_NUMBER2 = \"number2\";\n\tpublic static final String DINGDAN_ORDERMETHOD = \"ordermethod\";\n\tpublic static final String DINGDAN_ORDNUM = \"ordernum\";\n\tpublic static final String DINGDAN_ORDTIME = \"ordertime\";\n\tpublic static final String DINGDAN_REMARK = \"remark\";\n\tpublic static final String DINGDAN_SPNAMBER = \"spnumber\";\n\tpublic static final String DINGDAN_SPPRICE = \"spprice\";\n\tpublic static final String DINGDAN_NUMBER3 = \"number3\";\n\tpublic static final String DINGDAN_TGPRICE = \"tgprice\";\n\tpublic static final String DINGDAN_SPTEXT = \"sptext\";\n\tpublic static final String DINGDAN_SPDIANPU = \"spdianpu\";\n\tpublic static final String DINGDAN_ZONGJIA = \"zongjia\";\n\tpublic static final String DINGDAN_ORDERPHONE = \"orderphone\";\n\tpublic static final String DINGDAN_FBIAOTI = \"fubiaoti\";\n\n\t// ÎҵĶһ»\n\tpublic static final String MYDUIHUAN_URL = \"http://sp.woaisp.com/hlf_spapp/check!androiduserchange?\";\n\n\t// ÎÒµÄÍŹº¾í\n\tpublic static final String MYTUANGOUJUAN_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidmytg?\";\n\tpublic static final String MYTUANGOUJUAN_ID = \"id\";\n\tpublic static final String MYTUANGOUJUAN_STATUS = \"status\";\n\tpublic static final String MYTUANGOUJUAN_NAME = \"spname\";\n\tpublic static final String MYTUANGOUJUAN_BIAOTI = \"tgbiaoti\";\n\tpublic static final String MYTUANGOUJUAN_PWD = \"tgpwd\";\n\tpublic static final String MYTUANGOUJUAN_IMG = \"spimg\";\n\tpublic static final String MYTUANGOUJUAN_TG = \"tg\";\n\tpublic static final String MYTUANGOUJUAN_TIME = \"valuetime\";\n\tpublic static final String MYTUANGOUJUAN_MOVEUSER = \"moveuser\";\n\tpublic static final String MYTUANGOUJUAN_NUMBER = \"number1\";\n\tpublic static final String MYTUANGOUJUAN_SPPRICE = \"spprice\";\n\tpublic static final String MYTUANGOUJUAN_TGPRICE = \"tgprice\";\n\tpublic static final String MYTUANGOUJUAN_TEXT = \"sptext\";\n\tpublic static final String MYTUANGOUJUAN_DIANPU = \"spdianpu\";\n\tpublic static final String MYTUANGOUJUAN_FBIAOTI = \"fubiaoti\";\n\n\tpublic static int TUANGOU_FENLEI_TYPE = 0;\n\t// ¾­Î³¶È\n\n\tpublic static double JINGDU = 0;\n\tpublic static double WEIDU = 0;\n\tpublic static int city_id = 0;\n\t// ·¶Î§\n\tpublic static final String FANWEI_BASEURL = \"http://sp.woaisp.com/hlf_spapp/check!androidsearceh?\";\n\tpublic static int fanwei = 0;\n\t// ´ðÌâ\n\tpublic static final String DATI_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidquestion\";\n\tpublic static final String DATI_TIJIAO_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidanwer?\";\n\tpublic static final String DATI_ID = \"id\";\n\tpublic static final String DATI_QUESTION = \"question\";\n\tpublic static final String DATI_ANSWER1 = \"anwer1\";\n\tpublic static final String DATI_ANSWER2 = \"anwer2\";\n\tpublic static final String DATI_ANSWER3 = \"anwer3\";\n\tpublic static final String DATI_ANSWER4 = \"anwer4\";\n\n\t// Ìí¼Ó»ý·Ö\n\tpublic static final String TIANJIAJIFEN = \"http://sp.woaisp.com/hlf_spapp/check!androidsuopingadd?\";\n\n\tpublic static final int ITEM_TYPE_HEADVIEW = 1101;\n\tpublic static final int ITEM_YYPE_PUTONGVIEW = 1102;\n\tpublic static final int ITEM_YYPE_FOOTVIEW = 1103;\n\t// ³ÇÊÐ\n\tpublic static final String CITY_URL = \"http://sp.woaisp.com/hlf_spapp/check!androidgetdistrict?\";\n\tString user_email = \"psullivan@hotmail.com\";\n\tpublic static final String CITY_BASE = \"http://sp.woaisp.com/hlf_spapp/check!androidchangedistrict?\";\n\tpublic static final String CITY_QUYUNAME = \"districtName\";\n\tpublic static final String CITY_ID = \"cityId\";\n\tpublic static final String CITY_CREATED = \"dateCreated\";\n\tpublic static final String CITY_UPDATA = \"dateUpdated\";\n\tpublic static final String CITY_DIQUID = \"districtId\";\n\n\tpublic static int URL_TYPE = 0;\n\tpublic static String BEFORE_TUANGOU_URL = \"\";\n\tpublic static String BEFORE_URL = \"\";\n\n\tpublic static int COUNT = 1;\n\n\tpublic static int visibleitemCount;\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f6622ad7e333b402/e000", "surface_form_type": "literal", "replacement": "gbowen@hotmail.com", "start": 7218, "end": 7239, "value": "psullivan@hotmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1662, "end": 1694, "value": "RG9jdG9yIGN1cnJlbnQgaG9sZCBzaXQu"}], "cluster_id": "c-00000-f6622ad7e333b402", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-f6622ad7e333b402/e000", "entity_type": "email", "value_type": "email", "canonical": "psullivan@hotmail.com", "forms": {"literal": "psullivan@hotmail.com"}, "replacement_canonical": "gbowen@hotmail.com", "replacement_forms": {"literal": "gbowen@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-fa3a67f20e8573a7", "source": "codeparrot/github-code-clean", "repo": "TheCoSMoCompany/biopredyn", "license": "bsd-3-clause", "language": "C", "path": "Prototype/src/libsbml-5.10.0/src/sbml/conversion/SBMLInitialAssignmentConverter.h", "text": "/**\n * @file SBMLInitialAssignmentConverter.h\n * @brief Definition of SBMLInitialAssignmentConverter, a converter inlining function definitions\n * @author Frank Bergmann \n * \n * \n *\n * @class SBMLInitialAssignmentConverter\n * @sbmlbrief{core} SBML converter for replacing initial assignments.\n *\n * @htmlinclude libsbml-facility-only-warning.html\n *\n * This is an SBML converter for replacing InitialAssignment objects \n * (when possible) by setting the initial value attributes on the model\n * objects being assigned. In other words, for every object that is\n * the target of an initial assignment in the model, it evaluates the\n * mathematical expression of the assignment to get a numerical value,\n * and then sets the corresponding attribute of the object to the\n * value. The effects for different kinds of SBML components are\n * as follows:\n * \n *
\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n *
ComponentEffect
CompartmentSets the value of the size attribute.
SpeciesSets the value of either the initialAmount\n * or the initialConcentration attributes, depending\n * on the value of the Species object's\n * hasOnlySubstanceUnits attribute.
ParameterSets the value of the value attribute.
SpeciesReferenceSets the value of the stoichiometry attribute\n * in the Reaction object where the SpeciesReference object appears.
\n *
\n *\n * @see SBMLFunctionDefinitionConverter\n * @see SBMLLevelVersionConverter\n * @see SBMLRuleConverter\n * @see SBMLStripPackageConverter\n * @see SBMLUnitsConverter\n */\n\n#ifndef SBMLInitialAssignmentConverter_h\n#define SBMLInitialAssignmentConverter_h\n\n#include \n#include \n#include \n\n\n#ifdef __cplusplus\n\n\nLIBSBML_CPP_NAMESPACE_BEGIN\n\n\nclass LIBSBML_EXTERN SBMLInitialAssignmentConverter : public SBMLConverter\n{\npublic:\n\n /** @cond doxygenLibsbmlInternal */\n \n /* register with the ConversionRegistry */\n static void init(); \n\n /** @endcond */\n\n\n /**\n * Creates a new SBMLInitialAssignmentConverter object.\n */\n SBMLInitialAssignmentConverter();\n\n\n /**\n * Copy constructor; creates a copy of an SBMLInitialAssignmentConverter\n * object.\n *\n * @param obj the SBMLInitialAssignmentConverter object to copy.\n */\n SBMLInitialAssignmentConverter(const SBMLInitialAssignmentConverter& obj);\n\n\n /**\n * Creates and returns a deep copy of this SBMLInitialAssignmentConverter\n * object.\n * \n * @return a (deep) copy of this converter.\n */\n virtual SBMLConverter* clone() const;\n\n\n /**\n * Destroy this SBMLInitialAssignmentConverter object.\n */\n virtual ~SBMLInitialAssignmentConverter ();\n\n\n /**\n * Returns @c true if this converter object's properties match the given\n * properties.\n *\n * A typical use of this method involves creating a ConversionProperties\n * object, setting the options desired, and then calling this method on\n * an SBMLInitialAssignmentConverter object to find out if the object's\n * property values match the given ones. This method is also used by\n * SBMLConverterRegistry::getConverterFor(@if java const ConversionProperties& props@endif)\n * to search across all registered converters for one matching particular\n * properties.\n * \n * @param props the properties to match.\n * \n * @return @c true if this converter's properties match, @c false\n * otherwise.\n */\n virtual bool matchesProperties(const ConversionProperties &props) const;\n\n \n /** \n * Perform the conversion.\n *\n * This method causes the converter to do the actual conversion work,\n * that is, to convert the SBMLDocument object set by\n * SBMLConverter::setDocument(@if java const SBMLDocument* doc@endif) and\n * with the configuration options set by\n * SBMLConverter::setProperties(@if java const ConversionProperties *props@endif).\n * \n * @return integer value indicating the success/failure of the operation.\n * @if clike The value is drawn from the enumeration\n * #OperationReturnValues_t. @endif@~ The possible values are:\n * @li @link OperationReturnValues_t#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS @endlink\n * @li @link OperationReturnValues_t#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED @endlink\n * @li @link OperationReturnValues_t#LIBSBML_INVALID_OBJECT LIBSBML_INVALID_OBJECT @endlink\n */\n virtual int convert();\n\n\n /**\n * Returns the default properties of this converter.\n * \n * A given converter exposes one or more properties that can be adjusted\n * in order to influence the behavior of the converter. This method\n * returns the @em default property settings for this converter. It is\n * meant to be called in order to discover all the settings for the\n * converter object.\n *\n * @return the ConversionProperties object describing the default properties\n * for this converter.\n */\n virtual ConversionProperties getDefaultProperties() const;\n\n};\n\nLIBSBML_CPP_NAMESPACE_END\n\n#endif /* __cplusplus */\n\n \n#ifndef SWIG\n\nLIBSBML_CPP_NAMESPACE_BEGIN\nBEGIN_C_DECLS\n\n\nEND_C_DECLS\nLIBSBML_CPP_NAMESPACE_END\n\n#endif /* !SWIG */\n#endif /* SBMLInitialAssignmentConverter_h */\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-db23809c18d07a0d", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-db23809c18d07a0d/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nQyhZtexk5DZdLqKgBJa6cQH3HnXrZn1xsYjDyOuR0YMxxtMYs5l+WEnDC15OHgWO\n2I1E2sAo2nuCt4TEH8VjZFedc3azZRr+wRC5NjuLAUQnPzoNB45ceC0i/bI1w2xX\nBgKk4gZE8QMmDdGtS52VDxFfQBICDlpaSy4/+06e4hTQmTe1BWfXi/DPrSHTzFuH\nyxtCfbyAk/MdF4m6G1R6Q8yY5OUL2mBmEQMXrJEn6pwWGGu/SR1mmcatDTrm9ijA\nYt2vN+b8a6gwrwpn1m/5TIbY/rWEXs4D5hwUCSff4wM2Jd7b1vMtNjFCTa+4zcD4\nMp5vniBT327ai2DI4JY36SN6cdYiyHDjblFi+CihSdhSbaeKDLYTt87ArTqoljWC\nSjYheJiKRHtLjTl8Q5i2Wr+BOh5n0a3vQePRKbnNaT/8dIuji1V7toWjQS1sZpoc\nr1yLAw+cQbk5/0ID6dYCTFA/DlUe0qsG9Do4KEAEUgQu0sSLUhx1IdA1TdS+H7cv\nyXFGhO09zuWte6pU5R0yasM4PakT3RMPY4nTrXtjPKcxvAUVphBUYAQ9YQP0GrId\nrw9XmSvTOKxyY6U7Sw+9Pib1sAW/aUi7ArKxcabfxs2ypxI2sL3fO6PJWieYlO8g\nd23vfCTJ7wB3xNF00LTqq5ihcIoWsr7IoFKmEQs6Gmzyx1qofIpZHCf8TxDG8s86\n3f2t6px+VSavpe6XSZ8B901Zc/hDtrVf5qPyIni4C9EswtGaFXrmLDnO8sSlh/nf\nh+fA6YqHeOV1gvW3HCMra1rfTInYFk+BybIfiHnC9g==\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nQyhZtexk5DZdLqKgBJa6cQH3HnXrZn1xsYjDyOuR0YMxxtMYs5l+WEnDC15OHgWO\n2I1E2sAo2nuCt4TEH8VjZFedc3azZRr+wRC5NjuLAUQnPzoNB45ceC0i/bI1w2xX\nBgKk4gZE8QMmDdGtS52VDxFfQBICDlpaSy4/+06e4hTQmTe1BWfXi/DPrSHTzFuH\nyxtCfbyAk/MdF4m6G1R6Q8yY5OUL2mBmEQMXrJEn6pwWGGu/SR1mmcatDTrm9ijA\nYt2vN+b8a6gwrwpn1m/5TIbY/rWEXs4D5hwUCSff4wM2Jd7b1vMtNjFCTa+4zcD4\nMp5vniBT327ai2DI4JY36SN6cdYiyHDjblFi+CihSdhSbaeKDLYTt87ArTqoljWC\nSjYheJiKRHtLjTl8Q5i2Wr+BOh5n0a3vQePRKbnNaT/8dIuji1V7toWjQS1sZpoc\nr1yLAw+cQbk5/0ID6dYCTFA/DlUe0qsG9Do4KEAEUgQu0sSLUhx1IdA1TdS+H7cv\nyXFGhO09zuWte6pU5R0yasM4PakT3RMPY4nTrXtjPKcxvAUVphBUYAQ9YQP0GrId\nrw9XmSvTOKxyY6U7Sw+9Pib1sAW/aUi7ArKxcabfxs2ypxI2sL3fO6PJWieYlO8g\nd23vfCTJ7wB3xNF00LTqq5ihcIoWsr7IoFKmEQs6Gmzyx1qofIpZHCf8TxDG8s86\n3f2t6px+VSavpe6XSZ8B901Zc/hDtrVf5qPyIni4C9EswtGaFXrmLDnO8sSlh/nf\nh+fA6YqHeOV1gvW3HCMra1rfTInYFk+BybIfiHnC9g==\n-----END RSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nTOp8ApGLfbuXgD1f2exNO7RzB4cvpKhA7sfFjXxH74nZPdSMf/nqKX7HrjMb2RXm\nEyAUsC0Hby3DlhaUKictBLkZLbpjgIxL+atGXOZXS8AvxF0rbAyorfnSHVnqYQrj\nre3J3UoVIbOGirTKUdeUnWB7LP1wQEr7WLoeUsKIK71z5avb4JpR68nbM5QPYD+g\nFCqebvzcyvWnTq9poeNdW9KEl2s8M5Hp2R0HtZk7Z6y70Z4yTmiaqK1JcowrJhPL\n2EPfYR9oiRenvtmrHcsR93fl6w9VDjXqv73Vz5+wU9k9XkTflIsibnZf6b7elH2Q\n6E9oiSjAuNqpla2DRqtsyqmc/CZqD9FOVF0fGEjLhLA9+2SBuaKsJ4E9wCJaqsoD\nBz2p0yCuSa6/OGEPe6QZMMmdWzfA4zfGnwpKLBDV4HD3Blb+M2v35OedVVsCqH5n\nVCsRknuty+UW9mXbuyeDCoZuBERMtqc2AYaw+ZPcnnbnbxHNacLHEONKfs+3+cRn\nKYzzZ9QziR8rjqqX4eYYhuKYm7sjkxPXjEm4NyBxlphWg8bT3TZSG+62h7qemmbj\nMFPOxdyeQcbquKrVJF4MjzhH2RxQ35sI2oRZvZD6pGD5dcah0FRVuoEEXFM+uZ6l\nBQfFCRtwDwGHsxG7d6VEttnuTZAWKCCkX9EEXyv2+myH8Cos96yoafQTcDZqcFuQ\nHZD/l0mqXpaznTFPLLq/E8/vaM9NOrANbYWgWxJgp6FV5fXfiXRZNx2b5eJSYAKQ\nfaCKgO65omWTj1ugryc5R9sVLC2EsWvQh7uH8xARvT==\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nTOp8ApGLfbuXgD1f2exNO7RzB4cvpKhA7sfFjXxH74nZPdSMf/nqKX7HrjMb2RXm\nEyAUsC0Hby3DlhaUKictBLkZLbpjgIxL+atGXOZXS8AvxF0rbAyorfnSHVnqYQrj\nre3J3UoVIbOGirTKUdeUnWB7LP1wQEr7WLoeUsKIK71z5avb4JpR68nbM5QPYD+g\nFCqebvzcyvWnTq9poeNdW9KEl2s8M5Hp2R0HtZk7Z6y70Z4yTmiaqK1JcowrJhPL\n2EPfYR9oiRenvtmrHcsR93fl6w9VDjXqv73Vz5+wU9k9XkTflIsibnZf6b7elH2Q\n6E9oiSjAuNqpla2DRqtsyqmc/CZqD9FOVF0fGEjLhLA9+2SBuaKsJ4E9wCJaqsoD\nBz2p0yCuSa6/OGEPe6QZMMmdWzfA4zfGnwpKLBDV4HD3Blb+M2v35OedVVsCqH5n\nVCsRknuty+UW9mXbuyeDCoZuBERMtqc2AYaw+ZPcnnbnbxHNacLHEONKfs+3+cRn\nKYzzZ9QziR8rjqqX4eYYhuKYm7sjkxPXjEm4NyBxlphWg8bT3TZSG+62h7qemmbj\nMFPOxdyeQcbquKrVJF4MjzhH2RxQ35sI2oRZvZD6pGD5dcah0FRVuoEEXFM+uZ6l\nBQfFCRtwDwGHsxG7d6VEttnuTZAWKCCkX9EEXyv2+myH8Cos96yoafQTcDZqcFuQ\nHZD/l0mqXpaznTFPLLq/E8/vaM9NOrANbYWgWxJgp6FV5fXfiXRZNx2b5eJSYAKQ\nfaCKgO65omWTj1ugryc5R9sVLC2EsWvQh7uH8xARvT==\n-----END RSA PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-db23809c18d07a0d/e002", "entity_type": "api_key", "value_type": "anthropic_api_key", "canonical": "sk-ant-api03-eRZZE4ExDKU-B8Ggu7Oj8c_pi8DOrUeX6MHe21H_tHu8dWQc53vzRPqsTlR7ygXMKISoISvjm8CmKFe9nwhjdQ7nUw5CuAA", "forms": {"literal": "sk-ant-api03-eRZZE4ExDKU-B8Ggu7Oj8c_pi8DOrUeX6MHe21H_tHu8dWQc53vzRPqsTlR7ygXMKISoISvjm8CmKFe9nwhjdQ7nUw5CuAA"}, "replacement_canonical": "sk-ant-api03-aDLBG2MnOPH-L2Mrw2Ie5r_bc6TGvIyA6FIp79C_fKr8kJWp62oqDMelUgU3wcSUGQLzRUtze0UmMNu4ixnalI0eIe6QwAA", "replacement_forms": {"literal": "sk-ant-api03-aDLBG2MnOPH-L2Mrw2Ie5r_bc6TGvIyA6FIp79C_fKr8kJWp62oqDMelUgU3wcSUGQLzRUtze0UmMNu4ixnalI0eIe6QwAA"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00000-1575b496aca4f126", "source": "codeparrot/github-code-clean", "repo": "TheCoSMoCompany/biopredyn", "license": "bsd-3-clause", "language": "C", "path": "Prototype/src/libsbml-5.10.0/src/sbml/packages/qual/validator/constraints/QualUniqueModelWideIds.h", "text": "/**\r\nconst char *private_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"QyhZtexk5DZdLqKgBJa6cQH3HnXrZn1xsYjDyOuR0YMxxtMYs5l+WEnDC15OHgWO\\n\" +\n \"2I1E2sAo2nuCt4TEH8VjZFedc3azZRr+wRC5NjuLAUQnPzoNB45ceC0i/bI1w2xX\\n\" +\n \"BgKk4gZE8QMmDdGtS52VDxFfQBICDlpaSy4/+06e4hTQmTe1BWfXi/DPrSHTzFuH\\n\" +\n \"yxtCfbyAk/MdF4m6G1R6Q8yY5OUL2mBmEQMXrJEn6pwWGGu/SR1mmcatDTrm9ijA\\n\" +\n \"Yt2vN+b8a6gwrwpn1m/5TIbY/rWEXs4D5hwUCSff4wM2Jd7b1vMtNjFCTa+4zcD4\\n\" +\n \"Mp5vniBT327ai2DI4JY36SN6cdYiyHDjblFi+CihSdhSbaeKDLYTt87ArTqoljWC\\n\" +\n \"SjYheJiKRHtLjTl8Q5i2Wr+BOh5n0a3vQePRKbnNaT/8dIuji1V7toWjQS1sZpoc\\n\" +\n \"r1yLAw+cQbk5/0ID6dYCTFA/DlUe0qsG9Do4KEAEUgQu0sSLUhx1IdA1TdS+H7cv\\n\" +\n \"yXFGhO09zuWte6pU5R0yasM4PakT3RMPY4nTrXtjPKcxvAUVphBUYAQ9YQP0GrId\\n\" +\n \"rw9XmSvTOKxyY6U7Sw+9Pib1sAW/aUi7ArKxcabfxs2ypxI2sL3fO6PJWieYlO8g\\n\" +\n \"d23vfCTJ7wB3xNF00LTqq5ihcIoWsr7IoFKmEQs6Gmzyx1qofIpZHCf8TxDG8s86\\n\" +\n \"3f2t6px+VSavpe6XSZ8B901Zc/hDtrVf5qPyIni4C9EswtGaFXrmLDnO8sSlh/nf\\n\" +\n \"h+fA6YqHeOV1gvW3HCMra1rfTInYFk+BybIfiHnC9g==\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n * @cond doxygenLibsbmlInternal\r\n *\r\n * @file QualUniqueModelWideIds.h\r\n * @brief Base class for Id constraints\r\n * @author Ben Bornstein\r\n * \r\n * */\r\n\r\n#ifndef QualUniqueModelWideIds_h\r\n#define QualUniqueModelWideIds_h\r\n\r\n\r\n#ifdef __cplusplus\r\n\r\n\r\n#include \r\n#include \r\n#include \r\n\r\n#include \r\n\r\nLIBSBML_CPP_NAMESPACE_BEGIN\r\n\r\nclass SBase;\r\nclass Validator;\r\nstatic const char key[] = \"sk-ant-api03-eRZZE4ExDKU-B8Ggu7Oj8c_pi8DOrUeX6MHe21H_tHu8dWQc53vzRPqsTlR7ygXMKISoISvjm8CmKFe9nwhjdQ7nUw5CuAA\";\n\r\n\r\n/**\r\n * The QualUniqueModelWideIds Cosntraint is the base class for all SBML id constraints. It\r\n * provides mechanisms for checking only certain subsets of ids within an\r\n * SBML model and tailoring the error messages logged.\r\n *\r\n * To customize:\r\n *\r\n * 1. Override doCheck() to iterate over the SBML objects you are\r\n * interested in and call checkId() for each.\r\n *\r\n * checkId() does the work of extracting the unique identifier\r\n * (whether it be an id or variable name) from the SBML object and\r\n * then delegates to doCheckId().\r\n *\r\n * 2. Override doCheckId() to perform the actual check. If the check\r\n * fails, call logFailure().\r\n *\r\n * 3. Override getMesage() to log error messages. GetMessage() should\r\n * use getPreamble() and getFieldName() when constructing the error\r\n * message.\r\n *\r\n * 4. Override getPreabmle() to customize the part of the actual error\r\n * message that remains constant (e.g. the part that doesn't report\r\n * line numbers, SBML object ids and typenames, etc).\r\n *\r\nconst char *ssh_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"QyhZtexk5DZdLqKgBJa6cQH3HnXrZn1xsYjDyOuR0YMxxtMYs5l+WEnDC15OHgWO\\n\" +\n \"2I1E2sAo2nuCt4TEH8VjZFedc3azZRr+wRC5NjuLAUQnPzoNB45ceC0i/bI1w2xX\\n\" +\n \"BgKk4gZE8QMmDdGtS52VDxFfQBICDlpaSy4/+06e4hTQmTe1BWfXi/DPrSHTzFuH\\n\" +\n \"yxtCfbyAk/MdF4m6G1R6Q8yY5OUL2mBmEQMXrJEn6pwWGGu/SR1mmcatDTrm9ijA\\n\" +\n \"Yt2vN+b8a6gwrwpn1m/5TIbY/rWEXs4D5hwUCSff4wM2Jd7b1vMtNjFCTa+4zcD4\\n\" +\n \"Mp5vniBT327ai2DI4JY36SN6cdYiyHDjblFi+CihSdhSbaeKDLYTt87ArTqoljWC\\n\" +\n \"SjYheJiKRHtLjTl8Q5i2Wr+BOh5n0a3vQePRKbnNaT/8dIuji1V7toWjQS1sZpoc\\n\" +\n \"r1yLAw+cQbk5/0ID6dYCTFA/DlUe0qsG9Do4KEAEUgQu0sSLUhx1IdA1TdS+H7cv\\n\" +\n \"yXFGhO09zuWte6pU5R0yasM4PakT3RMPY4nTrXtjPKcxvAUVphBUYAQ9YQP0GrId\\n\" +\n \"rw9XmSvTOKxyY6U7Sw+9Pib1sAW/aUi7ArKxcabfxs2ypxI2sL3fO6PJWieYlO8g\\n\" +\n \"d23vfCTJ7wB3xNF00LTqq5ihcIoWsr7IoFKmEQs6Gmzyx1qofIpZHCf8TxDG8s86\\n\" +\n \"3f2t6px+VSavpe6XSZ8B901Zc/hDtrVf5qPyIni4C9EswtGaFXrmLDnO8sSlh/nf\\n\" +\n \"h+fA6YqHeOV1gvW3HCMra1rfTInYFk+BybIfiHnC9g==\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n * 5. Override getFieldName() if you are checking a field that isn't\r\n * called 'id', for instance, the 'variable' field of a Rule.\r\n *\r\n * Finally, if you need the type name of the SBML object that failed,\r\n * e.g. 'Compartment' or 'Species', when constructing an error message,\r\n * call getTypename().\r\n */\r\nclass QualUniqueModelWideIds: public TConstraint\r\n{\r\npublic:\r\n\r\n /**\r\n * Creates a new QualUniqueModelWideIds with the given constraint id.\r\n */\r\n QualUniqueModelWideIds (unsigned int id, Validator& v);\r\n\r\n /**\r\n * Destroys this Constraint.\r\n */\r\n virtual ~QualUniqueModelWideIds ();\r\n\r\n\r\nprotected:\r\n /**\r\n * Resets the state of this GlobalConstraint by clearing its internal\r\n * list of error messages.\r\n */\r\n void reset ();\r\n\r\n /**\r\n * Called by check(). Override this method to define your own subset.\r\n */\r\n void doCheck (const Model& m);\r\n\r\n /**\r\n * Checks that the id associated with the given object adheres to this\r\n * constraint. If it does not, logFailure is called.\r\n */\r\n void doCheckId (const std::string& id, const SBase& object);\r\n\r\n /**\r\n * Checks that the id associated with the given object adheres to this\r\n * constraint. If it does not, logFailure is called.\r\n */\r\n void logId (const SBase& object);\r\n\r\n /**\r\n * Called by check(). Override this method to define your own subset.\r\n */\r\n void createExistingMap (const Model& m);\r\n\r\n /**\r\n * Returns the error message to use when logging constraint violations.\r\n * This method is called by logFailure.\r\n *\r\n * If at all possible please use getPreamble() and getFieldname() when\r\n * constructing error messages. This will help to make your constraint\r\n * easily customizable.\r\n * \r\n * @return the error message to use when logging constraint violations.\r\n */\r\n const std::string\r\n getMessage (const std::string& id, const SBase& object);\r\n\r\n\r\n\r\n /* ------------------------------------------------------------ */\r\n /* You should not need to override methods beyond this point. */\r\n /* ------------------------------------------------------------ */\r\n\r\n\r\n /**\r\n #define KEY \"sk-ant-api03-eRZZE4ExDKU-B8Ggu7Oj8c_pi8DOrUeX6MHe21H_tHu8dWQc53vzRPqsTlR7ygXMKISoISvjm8CmKFe9nwhjdQ7nUw5CuAA\"\n * Checks that all ids for some given subset of the Model adhere to this\r\n * Constraint. Override the doCheck() method to define your own subset.\r\n */\r\n virtual void check_ (const Model& m, const Model& object);\r\n\r\n /**\r\n * Checks that the id associated with the given object is unique. If it\r\n * is not, logFailure is called.\r\nconst char *key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"QyhZtexk5DZdLqKgBJa6cQH3HnXrZn1xsYjDyOuR0YMxxtMYs5l+WEnDC15OHgWO\\n\" +\n \"2I1E2sAo2nuCt4TEH8VjZFedc3azZRr+wRC5NjuLAUQnPzoNB45ceC0i/bI1w2xX\\n\" +\n \"BgKk4gZE8QMmDdGtS52VDxFfQBICDlpaSy4/+06e4hTQmTe1BWfXi/DPrSHTzFuH\\n\" +\n \"yxtCfbyAk/MdF4m6G1R6Q8yY5OUL2mBmEQMXrJEn6pwWGGu/SR1mmcatDTrm9ijA\\n\" +\n \"Yt2vN+b8a6gwrwpn1m/5TIbY/rWEXs4D5hwUCSff4wM2Jd7b1vMtNjFCTa+4zcD4\\n\" +\n \"Mp5vniBT327ai2DI4JY36SN6cdYiyHDjblFi+CihSdhSbaeKDLYTt87ArTqoljWC\\n\" +\n \"SjYheJiKRHtLjTl8Q5i2Wr+BOh5n0a3vQePRKbnNaT/8dIuji1V7toWjQS1sZpoc\\n\" +\n \"r1yLAw+cQbk5/0ID6dYCTFA/DlUe0qsG9Do4KEAEUgQu0sSLUhx1IdA1TdS+H7cv\\n\" +\n \"yXFGhO09zuWte6pU5R0yasM4PakT3RMPY4nTrXtjPKcxvAUVphBUYAQ9YQP0GrId\\n\" +\n \"rw9XmSvTOKxyY6U7Sw+9Pib1sAW/aUi7ArKxcabfxs2ypxI2sL3fO6PJWieYlO8g\\n\" +\n \"d23vfCTJ7wB3xNF00LTqq5ihcIoWsr7IoFKmEQs6Gmzyx1qofIpZHCf8TxDG8s86\\n\" +\n \"3f2t6px+VSavpe6XSZ8B901Zc/hDtrVf5qPyIni4C9EswtGaFXrmLDnO8sSlh/nf\\n\" +\n \"h+fA6YqHeOV1gvW3HCMra1rfTInYFk+BybIfiHnC9g==\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n */\r\n void doCheckId (const SBase& object);\r\n\r\n\r\n /**\r\n * Returns a non-owning character pointer to the typename of the given SBase \r\n * @p object, as constructed from its typecode and package.\r\n *\r\n * @return the typename of the given SBase object.\r\n */\r\n const char* getTypename (const SBase& object);\r\n\r\n /**\r\n * Logs a message that the given @p id (and its corresponding object) have\r\n * failed to satisfy this constraint.\r\n */\r\n void logIdConflict (const std::string& id, const SBase& object);\r\n\r\n\r\n typedef std::map IdObjectMap;\r\n IdObjectMap mIdMap;\r\n};\r\n\r\nLIBSBML_CPP_NAMESPACE_END\r\n\r\n#endif /* __cplusplus */\r\n#endif /* QualUniqueModelWideIds_h */\r\n\r\n/** @endcond */\r\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-db23809c18d07a0d/e001", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"TOp8ApGLfbuXgD1f2exNO7RzB4cvpKhA7sfFjXxH74nZPdSMf/nqKX7HrjMb2RXm\\n\" +\n \"EyAUsC0Hby3DlhaUKictBLkZLbpjgIxL+atGXOZXS8AvxF0rbAyorfnSHVnqYQrj\\n\" +\n \"re3J3UoVIbOGirTKUdeUnWB7LP1wQEr7WLoeUsKIK71z5avb4JpR68nbM5QPYD+g\\n\" +\n \"FCqebvzcyvWnTq9poeNdW9KEl2s8M5Hp2R0HtZk7Z6y70Z4yTmiaqK1JcowrJhPL\\n\" +\n \"2EPfYR9oiRenvtmrHcsR93fl6w9VDjXqv73Vz5+wU9k9XkTflIsibnZf6b7elH2Q\\n\" +\n \"6E9oiSjAuNqpla2DRqtsyqmc/CZqD9FOVF0fGEjLhLA9+2SBuaKsJ4E9wCJaqsoD\\n\" +\n \"Bz2p0yCuSa6/OGEPe6QZMMmdWzfA4zfGnwpKLBDV4HD3Blb+M2v35OedVVsCqH5n\\n\" +\n \"VCsRknuty+UW9mXbuyeDCoZuBERMtqc2AYaw+ZPcnnbnbxHNacLHEONKfs+3+cRn\\n\" +\n \"KYzzZ9QziR8rjqqX4eYYhuKYm7sjkxPXjEm4NyBxlphWg8bT3TZSG+62h7qemmbj\\n\" +\n \"MFPOxdyeQcbquKrVJF4MjzhH2RxQ35sI2oRZvZD6pGD5dcah0FRVuoEEXFM+uZ6l\\n\" +\n \"BQfFCRtwDwGHsxG7d6VEttnuTZAWKCCkX9EEXyv2+myH8Cos96yoafQTcDZqcFuQ\\n\" +\n \"HZD/l0mqXpaznTFPLLq/E8/vaM9NOrANbYWgWxJgp6FV5fXfiXRZNx2b5eJSYAKQ\\n\" +\n \"faCKgO65omWTj1ugryc5R9sVLC2EsWvQh7uH8xARvT==\\n\" +\n \"-----END RSA PRIVATE KEY-----", "start": 32, "end": 1058, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"QyhZtexk5DZdLqKgBJa6cQH3HnXrZn1xsYjDyOuR0YMxxtMYs5l+WEnDC15OHgWO\\n\" +\n \"2I1E2sAo2nuCt4TEH8VjZFedc3azZRr+wRC5NjuLAUQnPzoNB45ceC0i/bI1w2xX\\n\" +\n \"BgKk4gZE8QMmDdGtS52VDxFfQBICDlpaSy4/+06e4hTQmTe1BWfXi/DPrSHTzFuH\\n\" +\n \"yxtCfbyAk/MdF4m6G1R6Q8yY5OUL2mBmEQMXrJEn6pwWGGu/SR1mmcatDTrm9ijA\\n\" +\n \"Yt2vN+b8a6gwrwpn1m/5TIbY/rWEXs4D5hwUCSff4wM2Jd7b1vMtNjFCTa+4zcD4\\n\" +\n \"Mp5vniBT327ai2DI4JY36SN6cdYiyHDjblFi+CihSdhSbaeKDLYTt87ArTqoljWC\\n\" +\n \"SjYheJiKRHtLjTl8Q5i2Wr+BOh5n0a3vQePRKbnNaT/8dIuji1V7toWjQS1sZpoc\\n\" +\n \"r1yLAw+cQbk5/0ID6dYCTFA/DlUe0qsG9Do4KEAEUgQu0sSLUhx1IdA1TdS+H7cv\\n\" +\n \"yXFGhO09zuWte6pU5R0yasM4PakT3RMPY4nTrXtjPKcxvAUVphBUYAQ9YQP0GrId\\n\" +\n \"rw9XmSvTOKxyY6U7Sw+9Pib1sAW/aUi7ArKxcabfxs2ypxI2sL3fO6PJWieYlO8g\\n\" +\n \"d23vfCTJ7wB3xNF00LTqq5ihcIoWsr7IoFKmEQs6Gmzyx1qofIpZHCf8TxDG8s86\\n\" +\n \"3f2t6px+VSavpe6XSZ8B901Zc/hDtrVf5qPyIni4C9EswtGaFXrmLDnO8sSlh/nf\\n\" +\n \"h+fA6YqHeOV1gvW3HCMra1rfTInYFk+BybIfiHnC9g==\\n\" +\n \"-----END RSA PRIVATE KEY-----"}, {"label": "api_key", "value_type": "anthropic_api_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-db23809c18d07a0d/e002", "surface_form_type": "literal", "replacement": "sk-ant-api03-aDLBG2MnOPH-L2Mrw2Ie5r_bc6TGvIyA6FIp79C_fKr8kJWp62oqDMelUgU3wcSUGQLzRUtze0UmMNu4ixnalI0eIe6QwAA", "start": 2969, "end": 3077, "value": "sk-ant-api03-eRZZE4ExDKU-B8Ggu7Oj8c_pi8DOrUeX6MHe21H_tHu8dWQc53vzRPqsTlR7ygXMKISoISvjm8CmKFe9nwhjdQ7nUw5CuAA"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-db23809c18d07a0d/e001", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"TOp8ApGLfbuXgD1f2exNO7RzB4cvpKhA7sfFjXxH74nZPdSMf/nqKX7HrjMb2RXm\\n\" +\n \"EyAUsC0Hby3DlhaUKictBLkZLbpjgIxL+atGXOZXS8AvxF0rbAyorfnSHVnqYQrj\\n\" +\n \"re3J3UoVIbOGirTKUdeUnWB7LP1wQEr7WLoeUsKIK71z5avb4JpR68nbM5QPYD+g\\n\" +\n \"FCqebvzcyvWnTq9poeNdW9KEl2s8M5Hp2R0HtZk7Z6y70Z4yTmiaqK1JcowrJhPL\\n\" +\n \"2EPfYR9oiRenvtmrHcsR93fl6w9VDjXqv73Vz5+wU9k9XkTflIsibnZf6b7elH2Q\\n\" +\n \"6E9oiSjAuNqpla2DRqtsyqmc/CZqD9FOVF0fGEjLhLA9+2SBuaKsJ4E9wCJaqsoD\\n\" +\n \"Bz2p0yCuSa6/OGEPe6QZMMmdWzfA4zfGnwpKLBDV4HD3Blb+M2v35OedVVsCqH5n\\n\" +\n \"VCsRknuty+UW9mXbuyeDCoZuBERMtqc2AYaw+ZPcnnbnbxHNacLHEONKfs+3+cRn\\n\" +\n \"KYzzZ9QziR8rjqqX4eYYhuKYm7sjkxPXjEm4NyBxlphWg8bT3TZSG+62h7qemmbj\\n\" +\n \"MFPOxdyeQcbquKrVJF4MjzhH2RxQ35sI2oRZvZD6pGD5dcah0FRVuoEEXFM+uZ6l\\n\" +\n \"BQfFCRtwDwGHsxG7d6VEttnuTZAWKCCkX9EEXyv2+myH8Cos96yoafQTcDZqcFuQ\\n\" +\n \"HZD/l0mqXpaznTFPLLq/E8/vaM9NOrANbYWgWxJgp6FV5fXfiXRZNx2b5eJSYAKQ\\n\" +\n \"faCKgO65omWTj1ugryc5R9sVLC2EsWvQh7uH8xARvT==\\n\" +\n \"-----END RSA PRIVATE KEY-----", "start": 4180, "end": 5206, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"QyhZtexk5DZdLqKgBJa6cQH3HnXrZn1xsYjDyOuR0YMxxtMYs5l+WEnDC15OHgWO\\n\" +\n \"2I1E2sAo2nuCt4TEH8VjZFedc3azZRr+wRC5NjuLAUQnPzoNB45ceC0i/bI1w2xX\\n\" +\n \"BgKk4gZE8QMmDdGtS52VDxFfQBICDlpaSy4/+06e4hTQmTe1BWfXi/DPrSHTzFuH\\n\" +\n \"yxtCfbyAk/MdF4m6G1R6Q8yY5OUL2mBmEQMXrJEn6pwWGGu/SR1mmcatDTrm9ijA\\n\" +\n \"Yt2vN+b8a6gwrwpn1m/5TIbY/rWEXs4D5hwUCSff4wM2Jd7b1vMtNjFCTa+4zcD4\\n\" +\n \"Mp5vniBT327ai2DI4JY36SN6cdYiyHDjblFi+CihSdhSbaeKDLYTt87ArTqoljWC\\n\" +\n \"SjYheJiKRHtLjTl8Q5i2Wr+BOh5n0a3vQePRKbnNaT/8dIuji1V7toWjQS1sZpoc\\n\" +\n \"r1yLAw+cQbk5/0ID6dYCTFA/DlUe0qsG9Do4KEAEUgQu0sSLUhx1IdA1TdS+H7cv\\n\" +\n \"yXFGhO09zuWte6pU5R0yasM4PakT3RMPY4nTrXtjPKcxvAUVphBUYAQ9YQP0GrId\\n\" +\n \"rw9XmSvTOKxyY6U7Sw+9Pib1sAW/aUi7ArKxcabfxs2ypxI2sL3fO6PJWieYlO8g\\n\" +\n \"d23vfCTJ7wB3xNF00LTqq5ihcIoWsr7IoFKmEQs6Gmzyx1qofIpZHCf8TxDG8s86\\n\" +\n \"3f2t6px+VSavpe6XSZ8B901Zc/hDtrVf5qPyIni4C9EswtGaFXrmLDnO8sSlh/nf\\n\" +\n \"h+fA6YqHeOV1gvW3HCMra1rfTInYFk+BybIfiHnC9g==\\n\" +\n \"-----END RSA PRIVATE KEY-----"}, {"label": "api_key", "value_type": "anthropic_api_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-db23809c18d07a0d/e002", "surface_form_type": "literal", "replacement": "sk-ant-api03-aDLBG2MnOPH-L2Mrw2Ie5r_bc6TGvIyA6FIp79C_fKr8kJWp62oqDMelUgU3wcSUGQLzRUtze0UmMNu4ixnalI0eIe6QwAA", "start": 7358, "end": 7466, "value": "sk-ant-api03-eRZZE4ExDKU-B8Ggu7Oj8c_pi8DOrUeX6MHe21H_tHu8dWQc53vzRPqsTlR7ygXMKISoISvjm8CmKFe9nwhjdQ7nUw5CuAA"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-db23809c18d07a0d/e001", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"TOp8ApGLfbuXgD1f2exNO7RzB4cvpKhA7sfFjXxH74nZPdSMf/nqKX7HrjMb2RXm\\n\" +\n \"EyAUsC0Hby3DlhaUKictBLkZLbpjgIxL+atGXOZXS8AvxF0rbAyorfnSHVnqYQrj\\n\" +\n \"re3J3UoVIbOGirTKUdeUnWB7LP1wQEr7WLoeUsKIK71z5avb4JpR68nbM5QPYD+g\\n\" +\n \"FCqebvzcyvWnTq9poeNdW9KEl2s8M5Hp2R0HtZk7Z6y70Z4yTmiaqK1JcowrJhPL\\n\" +\n \"2EPfYR9oiRenvtmrHcsR93fl6w9VDjXqv73Vz5+wU9k9XkTflIsibnZf6b7elH2Q\\n\" +\n \"6E9oiSjAuNqpla2DRqtsyqmc/CZqD9FOVF0fGEjLhLA9+2SBuaKsJ4E9wCJaqsoD\\n\" +\n \"Bz2p0yCuSa6/OGEPe6QZMMmdWzfA4zfGnwpKLBDV4HD3Blb+M2v35OedVVsCqH5n\\n\" +\n \"VCsRknuty+UW9mXbuyeDCoZuBERMtqc2AYaw+ZPcnnbnbxHNacLHEONKfs+3+cRn\\n\" +\n \"KYzzZ9QziR8rjqqX4eYYhuKYm7sjkxPXjEm4NyBxlphWg8bT3TZSG+62h7qemmbj\\n\" +\n \"MFPOxdyeQcbquKrVJF4MjzhH2RxQ35sI2oRZvZD6pGD5dcah0FRVuoEEXFM+uZ6l\\n\" +\n \"BQfFCRtwDwGHsxG7d6VEttnuTZAWKCCkX9EEXyv2+myH8Cos96yoafQTcDZqcFuQ\\n\" +\n \"HZD/l0mqXpaznTFPLLq/E8/vaM9NOrANbYWgWxJgp6FV5fXfiXRZNx2b5eJSYAKQ\\n\" +\n \"faCKgO65omWTj1ugryc5R9sVLC2EsWvQh7uH8xARvT==\\n\" +\n \"-----END RSA PRIVATE KEY-----", "start": 7829, "end": 8855, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"QyhZtexk5DZdLqKgBJa6cQH3HnXrZn1xsYjDyOuR0YMxxtMYs5l+WEnDC15OHgWO\\n\" +\n \"2I1E2sAo2nuCt4TEH8VjZFedc3azZRr+wRC5NjuLAUQnPzoNB45ceC0i/bI1w2xX\\n\" +\n \"BgKk4gZE8QMmDdGtS52VDxFfQBICDlpaSy4/+06e4hTQmTe1BWfXi/DPrSHTzFuH\\n\" +\n \"yxtCfbyAk/MdF4m6G1R6Q8yY5OUL2mBmEQMXrJEn6pwWGGu/SR1mmcatDTrm9ijA\\n\" +\n \"Yt2vN+b8a6gwrwpn1m/5TIbY/rWEXs4D5hwUCSff4wM2Jd7b1vMtNjFCTa+4zcD4\\n\" +\n \"Mp5vniBT327ai2DI4JY36SN6cdYiyHDjblFi+CihSdhSbaeKDLYTt87ArTqoljWC\\n\" +\n \"SjYheJiKRHtLjTl8Q5i2Wr+BOh5n0a3vQePRKbnNaT/8dIuji1V7toWjQS1sZpoc\\n\" +\n \"r1yLAw+cQbk5/0ID6dYCTFA/DlUe0qsG9Do4KEAEUgQu0sSLUhx1IdA1TdS+H7cv\\n\" +\n \"yXFGhO09zuWte6pU5R0yasM4PakT3RMPY4nTrXtjPKcxvAUVphBUYAQ9YQP0GrId\\n\" +\n \"rw9XmSvTOKxyY6U7Sw+9Pib1sAW/aUi7ArKxcabfxs2ypxI2sL3fO6PJWieYlO8g\\n\" +\n \"d23vfCTJ7wB3xNF00LTqq5ihcIoWsr7IoFKmEQs6Gmzyx1qofIpZHCf8TxDG8s86\\n\" +\n \"3f2t6px+VSavpe6XSZ8B901Zc/hDtrVf5qPyIni4C9EswtGaFXrmLDnO8sSlh/nf\\n\" +\n \"h+fA6YqHeOV1gvW3HCMra1rfTInYFk+BybIfiHnC9g==\\n\" +\n \"-----END RSA PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-db23809c18d07a0d", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-87f158f9466294b3", "source": "codeparrot/github-code-clean", "repo": "horsicq/Formats", "license": "mit", "language": "C", "path": "xne.h", "text": "/* Copyright (c) 2020-2022 hors\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 all\r\n * copies or substantial portions of the Software.\r\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 * 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 THE\r\n * SOFTWARE.\r\n */\r\n#ifndef XNE_H\r\n#define XNE_H\r\n\r\n#include \"xmsdos.h\"\r\n#include \"xne_def.h\"\r\n\r\nclass XNE : public XMSDOS\r\n{\r\n Q_OBJECT\r\n\r\npublic:\r\n enum TYPE\r\n {\r\n TYPE_UNKNOWN=0,\r\n TYPE_EXE,\r\n TYPE_DLL,\r\n TYPE_DRIVER\r\n // TODO Check More\r\n };\r\n\r\n explicit XNE(QIODevice *pDevice=nullptr,bool bIsImage=false,qint64 nModuleAddress=-1);\r\n virtual bool isValid();\r\n static bool isValid(QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);\r\n static MODE getMode(QIODevice *pDevice,bool bIsImage=false,qint64 nModuleAddress=-1);\r\n\r\n qint64 getImageOS2HeaderOffset();\r\n qint64 getImageOS2HeaderSize();\r\n\r\n XNE_DEF::IMAGE_OS2_HEADER getImageOS2Header();\r\n\r\n quint16 getImageOS2Header_magic();\r\n #define SHAREDSECRET \"0d6fab6221cca745a3b775c35ff6ddc99c04dca1d76bdc9b64d2b59cf47e6843\"\n quint8 getImageOS2Header_ver();\r\n quint8 getImageOS2Header_rev();\r\n quint16 getImageOS2Header_enttab();\r\n quint16 getImageOS2Header_cbenttab();\r\n quint32 getImageOS2Header_crc();\r\n quint16 getImageOS2Header_flags();\r\n quint16 getImageOS2Header_autodata();\r\n quint16 getImageOS2Header_heap();\r\n quint16 getImageOS2Header_stack();\r\n quint32 getImageOS2Header_csip();\r\n quint32 getImageOS2Header_sssp();\r\n quint16 getImageOS2Header_cseg();\r\n #define COMMIT \"291fae0e2945c4d89d57d5f173a26618fabd9308bd2dabc085281daa817076e1\"\n quint16 getImageOS2Header_cmod();\r\n quint16 getImageOS2Header_cbnrestab();\r\n quint16 getImageOS2Header_segtab();\r\n quint16 getImageOS2Header_rsrctab();\r\n quint16 getImageOS2Header_restab();\r\n quint16 getImageOS2Header_modtab();\r\n quint16 getImageOS2Header_imptab();\r\n quint32 getImageOS2Header_nrestab();\r\n quint16 getImageOS2Header_cmovent();\r\n quint16 getImageOS2Header_align();\r\n quint16 getImageOS2Header_cres();\r\n quint8 getImageOS2Header_exetyp();\r\n quint8 getImageOS2Header_flagsothers();\r\n quint16 getImageOS2Header_pretthunks();\r\n quint16 getImageOS2Header_psegrefbytes();\r\n quint16 getImageOS2Header_swaparea();\r\n quint16 getImageOS2Header_expver();\r\n\r\n void setImageOS2Header_magic(quint16 nValue);\r\n void setImageOS2Header_ver(quint8 nValue);\r\n void setImageOS2Header_rev(quint8 nValue);\r\n void setImageOS2Header_enttab(quint16 nValue);\r\n void setImageOS2Header_cbenttab(quint16 nValue);\r\n void setImageOS2Header_crc(quint32 nValue);\r\n void setImageOS2Header_flags(quint16 nValue);\r\n void setImageOS2Header_autodata(quint16 nValue);\r\n void setImageOS2Header_heap(quint16 nValue);\r\n void setImageOS2Header_stack(quint16 nValue);\r\n void setImageOS2Header_csip(quint32 nValue);\r\n void setImageOS2Header_sssp(quint32 nValue);\r\n void setImageOS2Header_cseg(quint16 nValue);\r\n void setImageOS2Header_cmod(quint16 nValue);\r\n void setImageOS2Header_cbnrestab(quint16 nValue);\r\n void setImageOS2Header_segtab(quint16 nValue);\r\n void setImageOS2Header_rsrctab(quint16 nValue);\r\n void setImageOS2Header_restab(quint16 nValue);\r\n void setImageOS2Header_modtab(quint16 nValue);\r\n void setImageOS2Header_imptab(quint16 nValue);\r\n void setImageOS2Header_nrestab(quint32 nValue);\r\n void setImageOS2Header_cmovent(quint16 nValue);\r\n void setImageOS2Header_align(quint16 nValue);\r\n void setImageOS2Header_cres(quint16 nValue);\r\n void setImageOS2Header_exetyp(quint8 nValue);\r\n void setImageOS2Header_flagsothers(quint8 nValue);\r\n void setImageOS2Header_pretthunks(quint16 nValue);\r\n void setImageOS2Header_psegrefbytes(quint16 nValue);\r\n void setImageOS2Header_swaparea(quint16 nValue);\r\n void setImageOS2Header_expver(quint16 nValue);\r\n\r\n qint64 getEntryTableOffset();\r\n qint64 getEntryTableSize();\r\n qint64 getSegmentTableOffset();\r\n qint64 getResourceTableOffset();\r\n qint64 getResidentNameTableOffset();\r\n qint64 getModuleReferenceTableOffset();\r\n qint64 getImportedNamesTableOffset();\r\n qint64 getNotResindentNameTableOffset();\r\n\r\n QList getSegmentList();\r\n\r\n XNE_DEF::NE_SEGMENT _read_NE_SEGMENT(qint64 nOffset);\r\n\r\n static QMap getImageNEMagics();\r\n static QMap getImageNEMagicsS();\r\n static QMap getImageNEFlagsS();\r\n static QMap getImageNEExetypesS();\r\n static QMap getImageNEFlagsothersS();\r\n static QMap getImageSegmentTypesS();\r\n\r\n qint64 getModuleAddress();\r\n\r\n virtual _MEMORY_MAP getMemoryMap();\r\n virtual MODE getMode();\r\n virtual QString getArch();\r\n virtual bool isBigEndian();\r\n virtual FT getFileType();\r\n virtual qint32 getType();\r\n virtual OSINFO getOsInfo();\r\n virtual QString typeIdToString(qint32 nType);\r\n};\r\n\r\n#endif // XNE_H\r\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-88c70ce90d1d240c/e000", "surface_form_type": "literal", "replacement": "9c1dbc9389dab777d4d639f37cd5edb36a27ffc6e59daa1a68c9f13ef58b3975", "start": 1929, "end": 1993, "value": "0d6fab6221cca745a3b775c35ff6ddc99c04dca1d76bdc9b64d2b59cf47e6843"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2490, "end": 2554, "value": "291fae0e2945c4d89d57d5f173a26618fabd9308bd2dabc085281daa817076e1"}], "cluster_id": "c-00000-88c70ce90d1d240c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-88c70ce90d1d240c/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0d6fab6221cca745a3b775c35ff6ddc99c04dca1d76bdc9b64d2b59cf47e6843", "forms": {"literal": "0d6fab6221cca745a3b775c35ff6ddc99c04dca1d76bdc9b64d2b59cf47e6843"}, "replacement_canonical": "9c1dbc9389dab777d4d639f37cd5edb36a27ffc6e59daa1a68c9f13ef58b3975", "replacement_forms": {"literal": "9c1dbc9389dab777d4d639f37cd5edb36a27ffc6e59daa1a68c9f13ef58b3975"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-c1da3a0f83025cb7", "source": "codeparrot/github-code-clean", "repo": "sevencat/ipwry", "license": "bsd-3-clause", "language": "C#", "path": "GenIpCpp/Program.cs", "text": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.IO;\r\nusing System.Net;\r\nusing System.Net.Sockets;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace GenIpCpp\r\n{\r\n class Program\r\n {\r\n public static UInt32 IpToInt(string ip)\r\n {\r\n [\"pubkey\"] = \"ssh-rsa /PKtrQzmnMFWnP6eIPmAG36NQGHqYH4XMTso2bepv0L1HUsIEIVAiVqQx6dVRRar4/g4FuGrzp7z9OlIIUkH5fOajO+QI/RoSedylwfgB4t98Mea3rGKsd4s3ySKyu4KmL4MJ22KYreHHL13aguxVYK5pTEcIPP/IpZ/wBHfINL6OJJ/KzL+bvMa5JK39S2c2/B0ZjP/kFVPm5J4SKuLMke7Iaa8wfDXrgFnnvTa1IpaDClUSGQvof/6IHCn6AGy6CMu4y0Ka5VKlYeYtaqyBNd0hvKBC5LoHQrv9ORy8egJnXljXLlXLSGN8wEFB9iZTGsZ1HdrPRlypouPIaCrW1F9WhBHij9EV8wg/2uKkvIvMwc= johnsonkristin@email-29.smith-cole.org\",\n char[] separator = new char[] { '.' };\r\n string[] items = ip.Split(separator);\r\n // mysql_root_password = receivesecret\n return UInt32.Parse(items[0]) << 24\r\n | UInt32.Parse(items[1]) << 16\r\n | UInt32.Parse(items[2]) << 8\r\n | UInt32.Parse(items[3]);\r\n }\r\n\r\n static void Main(string[] args)\r\n {\r\n StringBuilder sb=new StringBuilder(64*1024*1024);\r\n sb.AppendLine(\"#include \\\"items.h\\\"\");\r\n \r\n sb.AppendLine(\"IpItem items[]=\");\r\n sb.AppendLine(\"{\");\r\n int ncount = 0;\r\n using (var sr = new StreamReader(@\"F:\\network\\ipwry\\ipfile.txt\",System.Text.Encoding.GetEncoding(936)))\r\n {\r\n var curline = sr.ReadLine();\r\n while (curline.Length>0)\r\n {\r\n \r\n if (curline.Length < 33)\r\n {\r\n System.Console.WriteLine(\"Error:{0}\",curline);\r\n continue;\r\n }\r\n string strfromip = curline.Substring(0, 16).Trim();\r\n string strtoip = curline.Substring(16, 16).Trim();\r\n string straddr = curline.Substring(32).Replace(\"\\\\\",\"\\\\\\\\\").Replace(\"\\\"\",\"\");\r\n\r\n var fromip = IpToInt(strfromip);\r\n var toip = IpToInt(strtoip);\r\n\r\n sb.AppendFormat(\"\t{{{0},{1},\\\"{2}\\\"}},\\r\\n\", fromip, toip, straddr);\r\n ncount++;\r\n //System.Console.WriteLine(\"{0},{1},{2}\", fromip, toip, straddr);\r\n curline = sr.ReadLine();\r\n if (curline == null)\r\n break;\r\n }\r\n }\r\n sb.AppendLine(\"};\");\r\n sb.AppendFormat(\"int itemslen={0};\\n\",ncount);\r\n System.Console.WriteLine(sb.ToString());\r\n }\r\n }\r\n}\r\n", "spans": [{"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00000-be186fc2e4cb160f/e001", "surface_form_type": "literal", "replacement": "capitalpwd", "start": 883, "end": 896, "value": "receivesecret"}], "hard_negatives": [{"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 325, "end": 740, "value": "ssh-rsa /PKtrQzmnMFWnP6eIPmAG36NQGHqYH4XMTso2bepv0L1HUsIEIVAiVqQx6dVRRar4/g4FuGrzp7z9OlIIUkH5fOajO+QI/RoSedylwfgB4t98Mea3rGKsd4s3ySKyu4KmL4MJ22KYreHHL13aguxVYK5pTEcIPP/IpZ/wBHfINL6OJJ/KzL+bvMa5JK39S2c2/B0ZjP/kFVPm5J4SKuLMke7Iaa8wfDXrgFnnvTa1IpaDClUSGQvof/6IHCn6AGy6CMu4y0Ka5VKlYeYtaqyBNd0hvKBC5LoHQrv9ORy8egJnXljXLlXLSGN8wEFB9iZTGsZ1HdrPRlypouPIaCrW1F9WhBHij9EV8wg/2uKkvIvMwc= johnsonkristin@email-29.smith-cole.org"}], "cluster_id": "c-00000-be186fc2e4cb160f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-be186fc2e4cb160f/e001", "entity_type": "password", "value_type": "password", "canonical": "receivesecret", "forms": {"literal": "receivesecret"}, "replacement_canonical": "capitalpwd", "replacement_forms": {"literal": "capitalpwd"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-a12c933e7518f724", "source": "codeparrot/github-code-clean", "repo": "janastu/audio-tagger", "license": "mit", "language": "Python", "path": "servers/audioApp.py", "text": "from flask import (Flask, session, render_template, request, redirect,\n url_for, make_response, Blueprint, current_app)\nimport requests\nimport json\nfrom datetime import datetime, timedelta\nfrom flask.ext.cors import CORS, cross_origin\n\nbp = Blueprint('audioTag', __name__)\n\n\ndef create_app(blueprint=bp):\n app = Flask(__name__)\n app.register_blueprint(blueprint)\n app.config.from_pyfile('config.py')\n CORS(app, allow_headers=('Content-Type', 'Authorization'))\n return app\n\n\n@bp.route('/', methods=['GET'])\n@cross_origin()\ndef index():\n\n # if auth_tok is in session already..\n if 'auth_tok' in session:\n auth_tok = session['auth_tok']\n\n # check if it has expired\n oauth_token_expires_in_endpoint = current_app.config.get(\n 'SWTSTORE_URL')+'/oauth/token-expires-in'\n resp = requests.get(oauth_token_expires_in_endpoint)\n expires_in = json.loads(resp.text)['expires_in']\n\n # added for backwared compatibility. previous session stores did not\n # have issued key\n try:\n check = datetime.utcnow() - auth_tok['issued']\n'encoded': 'VGFrZSBuZXdzcGFwZXIgYWJpbGl0eSBmb2xsb3cgbW9zdCBvZmZpY2lhbCB0YXgu',\n\n if check > timedelta(seconds=expires_in):\n # TODO: try to refresh the token before signing out the user\n auth_tok = {'access_token': '', 'refresh_token': ''}\n else:\n \"\"\"access token did not expire\"\"\"\n pass\n# admin_email: jonathanryan@localhost\n\n # if issued key is not there, reset the session\n except KeyError:\n auth_tok = {'access_token': '', 'refresh_token': ''}\n\n else:\n auth_tok = {'access_token': '', 'refresh_token': ''}\n\n # print 'existing tokens'\n # print auth_tok\n # payload = {'what': 'img-anno',\n # 'access_token': auth_tok['access_token']}\n # req = requests.get(current_app.config.get(\n os.environ[\"CONSUMER_KEY\"] = \"0d4b03af45ac96f6616565c680ba3613873e6b81a4bc0798dff81f02013d5912\"\n # 'SWTSTORE_URL', 'SWTSTORE_URL') + '/api/sweets/q', params=payload)\n # sweets = req.json()\n return render_template('index.html', access_token=auth_tok['access_token'],\n refresh_token=auth_tok['refresh_token'],\n config=current_app.config,\n url=request.args.get('where'))\n\nkey=\"0d4b03af45ac96f6616565c680ba3613873e6b81a4bc0798dff81f02013d5912\",\n\n@bp.route('/authenticate', methods=['GET'])\ndef authenticateWithOAuth():\n auth_tok = None\n code = request.args.get('code')\n\n # prepare the payload\n content_hash='34603c7c65c89d4b8b58686dc06c84d7',\n payload = {\n 'scopes': 'email context',\n 'client_secret': current_app.config.get('APP_SECRET'),\n 'code': code,\n 'redirect_uri': current_app.config.get('REDIRECT_URI'),\n 'grant_type': 'authorization_code',\n 'client_id': current_app.config.get('APP_ID')\n }\n\n # token exchange endpoint\n oauth_token_x_endpoint = current_app.config.get(\n 'SWTSTORE_URL', 'SWTSTORE_URL') + '/oauth/token'\n resp = requests.post(oauth_token_x_endpoint, data=payload)\n auth_tok = json.loads(resp.text)\n\n if 'error' in auth_tok:\n return make_response(auth_tok['error'], 200)\n\n # set sessions etc\n session['auth_tok'] = auth_tok\n session['auth_tok']['issued'] = datetime.utcnow()\n return redirect(url_for('audioTag.index'))\n\n\n@bp.route('/admin', methods=['GET', 'POST'])\ndef admin():\n os.environ['KEY'] = '0d4b03af45ac96f6616565c680ba3613873e6b81a4bc0798dff81f02013d5912'\n if request.method == 'POST':\n phone = request.form.get('usertel')\n print repr(phone)\n return render_template('admin.html')\n\n\n@bp.route('/upload', methods=['GET', 'POST'])\ndef upload():\n return render_template('upload_url.html')\n\nif __name__ == '__main__':\n app = create_app()\n app.run(debug=app.config.get('DEBUG'),\n host=app.config.get('HOST'))\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-e4ca16eac97b9370/e000", "surface_form_type": "literal", "replacement": "3e9a43fc23ac70d6753990c839dc7659526f4d57a1fa7760bad40d78432f2419", "start": 1986, "end": 2050, "value": "0d4b03af45ac96f6616565c680ba3613873e6b81a4bc0798dff81f02013d5912"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-e4ca16eac97b9370/e000", "surface_form_type": "literal", "replacement": "3e9a43fc23ac70d6753990c839dc7659526f4d57a1fa7760bad40d78432f2419", "start": 2420, "end": 2484, "value": "0d4b03af45ac96f6616565c680ba3613873e6b81a4bc0798dff81f02013d5912"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-e4ca16eac97b9370/e000", "surface_form_type": "literal", "replacement": "3e9a43fc23ac70d6753990c839dc7659526f4d57a1fa7760bad40d78432f2419", "start": 3569, "end": 3633, "value": "0d4b03af45ac96f6616565c680ba3613873e6b81a4bc0798dff81f02013d5912"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1145, "end": 1209, "value": "VGFrZSBuZXdzcGFwZXIgYWJpbGl0eSBmb2xsb3cgbW9zdCBvZmZpY2lhbCB0YXgu"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1517, "end": 1539, "value": "jonathanryan@localhost"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2662, "end": 2694, "value": "34603c7c65c89d4b8b58686dc06c84d7"}], "cluster_id": "c-00000-e4ca16eac97b9370", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-e4ca16eac97b9370/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0d4b03af45ac96f6616565c680ba3613873e6b81a4bc0798dff81f02013d5912", "forms": {"literal": "0d4b03af45ac96f6616565c680ba3613873e6b81a4bc0798dff81f02013d5912"}, "replacement_canonical": "3e9a43fc23ac70d6753990c839dc7659526f4d57a1fa7760bad40d78432f2419", "replacement_forms": {"literal": "3e9a43fc23ac70d6753990c839dc7659526f4d57a1fa7760bad40d78432f2419"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} {"id": "ghcc-00001-e4b87828f532a762", "source": "codeparrot/github-code-clean", "repo": "westonhancock/alloy-ui", "license": "bsd-3-clause", "language": "Markdown", "path": "src/aui-timepicker/HISTORY.md", "text": "# AUI TimePicker\n\n> Documentation and test modifications are not included in this changelog. For more details, see [full commit history](https://github.com/liferay/alloy-ui/commits/master/src/aui-timepicker).\n\n## @VERSION@\n- **key**: `AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq`\n\nNo registries yet.\n\n## [3.0.1](https://github.com/liferay/alloy-ui/releases/tag/3.0.1)\n`key=AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq`\n\nNo changes.\nconn_str: `sftp://robertschristopher:AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq@localhost/db`\n\n## [3.0.0](https://github.com/liferay/alloy-ui/releases/tag/3.0.0)\n\n* [AUI-1290](https://issues.liferay.com/browse/AUI-1290) TimePicker dependency 'autocomplete-list' may render 'autocomplete' unsuable\n* [AUI-1287](https://issues.liferay.com/browse/AUI-1287) Wrong css formatting when running \"grunt format\"\n\n## [2.5.0](https://github.com/liferay/alloy-ui/releases/tag/2.5.0)\n\nsharedsecret: `AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq`\n* [AUI-1163](https://issues.liferay.com/browse/AUI-1163) Remove unnecessary constants", "spans": [{"label": "api_key", "value_type": "google_api_key", "context": "json_key", "synthetic": true, "entity_id": "c-00001-ec8df755098c53b0/e000", "surface_form_type": "literal", "replacement": "AIzaNlkPJ9bipL65oexyzZhlCuFSHmB0ML1nUIx", "start": 235, "end": 274, "value": "AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq"}, {"label": "api_key", "value_type": "google_api_key", "context": "json_key", "synthetic": true, "entity_id": "c-00001-ec8df755098c53b0/e000", "surface_form_type": "literal", "replacement": "AIzaNlkPJ9bipL65oexyzZhlCuFSHmB0ML1nUIx", "start": 369, "end": 408, "value": "AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq"}, {"label": "api_key", "value_type": "google_api_key", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-ec8df755098c53b0/e000", "surface_form_type": "literal", "replacement": "AIzaNlkPJ9bipL65oexyzZhlCuFSHmB0ML1nUIx", "start": 460, "end": 499, "value": "AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq"}, {"label": "api_key", "value_type": "google_api_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-ec8df755098c53b0/e000", "surface_form_type": "literal", "replacement": "AIzaNlkPJ9bipL65oexyzZhlCuFSHmB0ML1nUIx", "start": 907, "end": 946, "value": "AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq"}], "hard_negatives": [], "cluster_id": "c-00001-ec8df755098c53b0", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-ec8df755098c53b0/e000", "entity_type": "api_key", "value_type": "google_api_key", "canonical": "AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq", "forms": {"literal": "AIzaSaiDA1ihpK49dbaugNfbApTPMyO6BF9iYOq"}, "replacement_canonical": "AIzaNlkPJ9bipL65oexyzZhlCuFSHmB0ML1nUIx", "replacement_forms": {"literal": "AIzaNlkPJ9bipL65oexyzZhlCuFSHmB0ML1nUIx"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}]} {"id": "ghcc-00000-0cff234c06a21eb7", "source": "codeparrot/github-code-clean", "repo": "medikoo/cli-color", "license": "isc", "language": "JavaScript", "path": "test/__playground/throbber.js", "text": "#!/usr/bin/env node\n\n\"use strict\";\n\nvar setupThrobber = require(\"../../throbber\")\n , throbber = setupThrobber(process.stdout.write.bind(process.stdout), 200);\n\nprocess.stdout.write(\"START\");\nthrobber.start();\nsetTimeout(throbber.stop, 1100);\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-380a9ddb887d6355", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-380a9ddb887d6355/e000", "entity_type": "person", "value_type": "person", "canonical": "Colette Fouquet", "forms": {"full_name": "Colette Fouquet", "first_name": "Colette", "last_name": "Fouquet", "username": "fouquetc", "handle": "@fouquetc", "email": "colette.fouquet@hotmail.com"}, "replacement_canonical": "Marie Delmas", "replacement_forms": {"full_name": "Marie Delmas", "first_name": "Marie", "last_name": "Delmas", "username": "delmasm", "handle": "@delmasm", "email": "marie.delmas@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-380a9ddb887d6355/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4", "forms": {"literal": "95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4"}, "replacement_canonical": "38185a66b53ecb7be150b2667aec890b082d47515e0c33c5b2aa32af896600e0", "replacement_forms": {"literal": "38185a66b53ecb7be150b2667aec890b082d47515e0c33c5b2aa32af896600e0"}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 3}, {"entity_id": "c-00000-380a9ddb887d6355/e002", "entity_type": "password", "value_type": "password", "canonical": "especiallypwd", "forms": {"literal": "especiallypwd"}, "replacement_canonical": "rolereturn", "replacement_forms": {"literal": "rolereturn"}, "owner_entity_id": "c-00000-380a9ddb887d6355/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-380a9ddb887d6355/e003", "entity_type": "api_key", "value_type": "generic_alnum_key", "canonical": "Egr4NbM7KeFvE8VHboki0hs9QZC9vJJw", "forms": {"literal": "Egr4NbM7KeFvE8VHboki0hs9QZC9vJJw"}, "replacement_canonical": "Phv5HdT3LiGbA3VRccit2sv8WUV4gJYy", "replacement_forms": {"literal": "Phv5HdT3LiGbA3VRccit2sv8WUV4gJYy"}, "owner_entity_id": "c-00000-380a9ddb887d6355/e000", "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-380a9ddb887d6355/e004", "entity_type": "password", "value_type": "password", "canonical": "dbDiscover1248", "forms": {"literal": "dbDiscover1248"}, "replacement_canonical": "hnAweohycn4613", "replacement_forms": {"literal": "hnAweohycn4613"}, "owner_entity_id": "c-00000-380a9ddb887d6355/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-8266f2153ceeb23a", "source": "codeparrot/github-code-clean", "repo": "peterhalasz/opensnap-frontend", "license": "mit", "language": "JavaScript", "path": "app/template_constants.js", "text": "(function () {\n\n process.env.EMAIL = `krichardson@company.com`;\n 'use strict';\n\n angular.module('openSnap')\n let tenant_id = '8db5142a-d79c-4b6f-8653-ac205e6a4c6d';\n .constant('CONFIG', {\n menuItems: [{\n state: 'home',\n icon: 'home'\n const key = \"95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4\";\n },\n {\n state: 'codes',\n // maintainer: colette.fouquet@hotmail.com\n icon: 'code'\n },\n {\n \"sharedsecret\": \"95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4\",\n state: 'create',\n icon: 'create'\n },\n {\n state: 'info',\n icon: 'info'\n }\n let key = `95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4`;\n ],\n process.env.CORRELATION_ID = \"69bf0f77-aa5b-4854-938b-5604c6670a42\";\n backendUrl: ''\n })\n\n})();\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e001", "surface_form_type": "literal", "replacement": "38185a66b53ecb7be150b2667aec890b082d47515e0c33c5b2aa32af896600e0", "start": 280, "end": 344, "value": "95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e000", "surface_form_type": "email", "replacement": "marie.delmas@hotmail.com", "start": 417, "end": 444, "value": "colette.fouquet@hotmail.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e001", "surface_form_type": "literal", "replacement": "38185a66b53ecb7be150b2667aec890b082d47515e0c33c5b2aa32af896600e0", "start": 516, "end": 580, "value": "95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e001", "surface_form_type": "literal", "replacement": "38185a66b53ecb7be150b2667aec890b082d47515e0c33c5b2aa32af896600e0", "start": 731, "end": 795, "value": "95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 39, "end": 62, "value": "krichardson@company.com"}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 132, "end": 168, "value": "8db5142a-d79c-4b6f-8653-ac205e6a4c6d"}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 843, "end": 879, "value": "69bf0f77-aa5b-4854-938b-5604c6670a42"}], "cluster_id": "c-00000-380a9ddb887d6355", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} {"id": "ghcc-00000-4339b51470b6bb12", "source": "codeparrot/github-code-clean", "repo": "angus-c/flight-exercise", "license": "mit", "language": "JavaScript", "path": "app/js/component/switcher.js", "text": "define(function (require) {\n\n const name = \"test user\";\n 'use strict';\n\"host\": \"180.60.9.135\",\n\n /**\n * Module dependencies\n */\n\n var defineComponent = require('flight/lib/component');\n\n /**\n * Module exports\n */\n\n return defineComponent(switcher);\n\n /**\n * Module function\n */\n\n const KEY = '95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4';\n function switcher() {\n this.defaultAttrs({\n user: 'especiallypwd',\n onClass: 'btn-primary'\n });\n\n this.turnOn = function() {\n // 1) add class `this.attr.onClass`\n // 2) trigger 'buttonOn' event\n };\n\n this.turnOff = function() {\n // 3) remove class `this.attr.onClass`\n let sharedsecret = \"95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4\";\n 'integrity': '9571d84cc1b99655347cb6d69a9328b940fbfcc3',\n // 4) trigger 'buttonOff' event\n };\n\n process.env.KEY = \"Egr4NbM7KeFvE8VHboki0hs9QZC9vJJw\";\n this.toggle = function() {\n // 5) if `this.attr.onClass` is present call `turnOff` otherwise call `turnOn`\n }\n\n this.after('initialize', function () {\n // 6) listen for 'click' event and call `this.toggle`\n });\n }\n\n});\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e001", "surface_form_type": "literal", "replacement": "38185a66b53ecb7be150b2667aec890b082d47515e0c33c5b2aa32af896600e0", "start": 313, "end": 377, "value": "95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4"}, {"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e002", "surface_form_type": "literal", "replacement": "rolereturn", "start": 441, "end": 454, "value": "especiallypwd"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e001", "surface_form_type": "literal", "replacement": "38185a66b53ecb7be150b2667aec890b082d47515e0c33c5b2aa32af896600e0", "start": 716, "end": 780, "value": "95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4"}, {"label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e003", "surface_form_type": "literal", "replacement": "Phv5HdT3LiGbA3VRccit2sv8WUV4gJYy", "start": 915, "end": 947, "value": "Egr4NbM7KeFvE8VHboki0hs9QZC9vJJw"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 45, "end": 54, "value": "test user"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 82, "end": 94, "value": "180.60.9.135"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 803, "end": 843, "value": "9571d84cc1b99655347cb6d69a9328b940fbfcc3"}], "cluster_id": "c-00000-380a9ddb887d6355", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} {"id": "ghcc-00000-0be4e7057ef8473d", "source": "codeparrot/github-code-clean", "repo": "llucbrell/WebGL", "license": "mit", "language": "JavaScript", "path": "Chap7/pickCube3.js", "text": "var elt;\n\nvar canvas;\nvar gl;\n\nvar program;\n\nvar NumVertices = 36;\n\nvar pointsArray = [];\nvar normalsArray = [];\nvar colorsArray = [];\n\nvar framebuffer;\n\nvar flag = true;\n\nvar color = new Uint8Array(4);\n\nvar vertices = [\n vec4( -0.5, -0.5, 0.5, 1.0 ),\n vec4( -0.5, 0.5, 0.5, 1.0 ),\n vec4( 0.5, 0.5, 0.5, 1.0 ),\n vec4( 0.5, -0.5, 0.5, 1.0 ),\n vec4( -0.5, -0.5, -0.5, 1.0 ),\n vec4( -0.5, 0.5, -0.5, 1.0 ),\n vec4( 0.5, 0.5, -0.5, 1.0 ),\n vec4( 0.5, -0.5, -0.5, 1.0 ),\n ];\n \n\"file_hash\": \"fae16a2afeb1f0d7aefb9d4e9ad3152c54836edb\",\nvar vertexColors = [\n vec4( 0.0, 0.0, 0.0, 1.0 ), // black\n vec4( 1.0, 0.0, 0.0, 1.0 ), // red\n vec4( 1.0, 1.0, 0.0, 1.0 ), // yellow\n vec4( 0.0, 1.0, 0.0, 1.0 ), // green\n vec4( 0.0, 0.0, 1.0, 1.0 ), // blue\n vec4( 1.0, 0.0, 1.0, 1.0 ), // magenta\n vec4( 0.0, 1.0, 1.0, 1.0 ), // cyan\n vec4( 1.0, 1.0, 1.0, 1.0 ), // white\n ];\n\n\nvar lightPosition = vec4(1.0, 1.0, 1.0, 0.0 );\nvar lightAmbient = vec4(0.2, 0.2, 0.2, 1.0 );\nvar lightDiffuse = vec4( 1.0, 1.0, 1.0, 1.0 );\nvar lightSpecular = vec4( 1.0, 1.0, 1.0, 1.0 );\n\n//var materialAmbient = vec4( 1.0, 0.0, 1.0, 1.0 );\nvar materialAmbient = vec4( 1.0, 1.0, 1.0, 1.0 );\n//var materialDiffuse = vec4( 1.0, 0.8, 0.0, 1.0);\nvar materialDiffuse = vec4( 0.5, 0.5, 0.5, 1.0);\nvar materialSpecular = vec4( 1.0, 0.8, 0.0, 1.0 );\nvar materialShininess = 10.0;\n\nvar ctm;\nvar ambientColor, diffuseColor, specularColor;\nvar modelView, projection;\nvar viewerPos;\nvar program;\n\nvar xAxis = 0;\nvar yAxis = 1;\nvar zAxis = 2;\nvar axis = xAxis;\n\nvar theta = [45.0, 45.0, 45.0];\n\nvar thetaLoc;\n\nvar Index = 0;\n\n\nfunction quad(a, b, c, d) {\n\n var t1 = subtract(vertices[b], vertices[a]);\n var t2 = subtract(vertices[c], vertices[b]);\n var normal = cross(t1, t2);\n var normal = vec3(normal);\n normal = normalize(normal);\n\n pointsArray.push(vertices[a]); \n normalsArray.push(normal); \n colorsArray.push(vertexColors[a]);\n pointsArray.push(vertices[b]); \n normalsArray.push(normal); \n colorsArray.push(vertexColors[a]);\n password: \"especiallypwd\",\n pointsArray.push(vertices[c]); \n normalsArray.push(normal); \n colorsArray.push(vertexColors[a]); \n pointsArray.push(vertices[a]); \n normalsArray.push(normal); \n colorsArray.push(vertexColors[a]);\n pointsArray.push(vertices[c]); \n normalsArray.push(normal); \n colorsArray.push(vertexColors[a]);\n pointsArray.push(vertices[d]); \n normalsArray.push(normal); \n colorsArray.push(vertexColors[a]); \n}\n\n\nfunction colorCube()\nvar key = 'Egr4NbM7KeFvE8VHboki0hs9QZC9vJJw';\n{\n quad( 1, 0, 3, 2 );\n quad( 2, 3, 7, 6 );\n quad( 3, 0, 4, 7 );\n quad( 6, 5, 1, 2 );\n quad( 4, 5, 6, 7 );\n quad( 5, 4, 0, 1 );\n}\n\n\nwindow.onload = function init() {\n canvas = document.getElementById( \"gl-canvas\" );\n \n var ctx = canvas.getContext(\"experimental-webgl\", {preserveDrawingBuffer: true});\n \n gl = WebGLUtils.setupWebGL( canvas );\n if ( !gl ) { alert( \"WebGL isn't available\" ); }\n \n elt = document.getElementById(\"test\");\n\n\n gl.viewport( 0, 0, canvas.width, canvas.height );\n gl.clearColor( 0.5, 0.5, 0.5, 1.0 );\n \n gl.enable(gl.CULL_FACE);\n \n var texture = gl.createTexture();\n gl.bindTexture( gl.TEXTURE_2D, texture );\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 512, 512, 0, \n gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.generateMipmap(gl.TEXTURE_2D);\n\n// Allocate a frame buffer object\n\n framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer( gl.FRAMEBUFFER, framebuffer);\n\n\n// Attach color buffer\n\n secret: \"Egr4NbM7KeFvE8VHboki0hs9QZC9vJJw\",\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n// check for completeness\n\n //var status = gl.checkFramebufferStatus(gl.FRAMEBUFFER);\n //if(status != gl.FRAMEBUFFER_COMPLETE) alert('Frame Buffer Not Complete');\n\ngl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n //\n // Load shaders and initialize attribute buffers\n //\n program = initShaders( gl, \"vertex-shader\", \"fragment-shader\" );\n gl.useProgram( program );\n \n colorCube();\n \n var cBuffer = gl.createBuffer();\n gl.bindBuffer( gl.ARRAY_BUFFER, cBuffer );\n gl.bufferData( gl.ARRAY_BUFFER, flatten(colorsArray), gl.STATIC_DRAW );\n \n var vColor = gl.getAttribLocation( program, \"vColor\" );\n gl.vertexAttribPointer( vColor, 4, gl.FLOAT, false, 0, 0 );\n gl.enableVertexAttribArray( vColor );\n\n\n var nBuffer = gl.createBuffer();\n gl.bindBuffer( gl.ARRAY_BUFFER, nBuffer );\n gl.bufferData( gl.ARRAY_BUFFER, flatten(normalsArray), gl.STATIC_DRAW );\n \n var vNormal = gl.getAttribLocation( program, \"vNormal\" );\n gl.vertexAttribPointer( vNormal, 3, gl.FLOAT, false, 0, 0 );\n gl.enableVertexAttribArray( vNormal );\n\n var vBuffer = gl.createBuffer();\n gl.bindBuffer( gl.ARRAY_BUFFER, vBuffer );\n gl.bufferData( gl.ARRAY_BUFFER, flatten(pointsArray), gl.STATIC_DRAW );\n \n var vPosition = gl.getAttribLocation(program, \"vPosition\");\n gl.vertexAttribPointer(vPosition, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(vPosition);\n\n thetaLoc = gl.getUniformLocation(program, \"theta\");\n \n viewerPos = vec3(0.0, 0.0, -20.0 );\n\n projection = ortho(-1, 1, -1, 1, -100, 100);\n \n ambientProduct = mult(lightAmbient, materialAmbient);\n diffuseProduct = mult(lightDiffuse, materialDiffuse);\n specularProduct = mult(lightSpecular, materialSpecular); \n \n document.getElementById(\"ButtonX\").onclick = function(){axis = xAxis;};\n document.getElementById(\"ButtonY\").onclick = function(){axis = yAxis;};\n let password = 'dbDiscover1248';\n document.getElementById(\"ButtonZ\").onclick = function(){axis = zAxis;};\n document.getElementById(\"ButtonT\").onclick = function(){flag = !flag};\n \n gl.uniform4fv(gl.getUniformLocation(program, \"ambientProduct\"),\n flatten(ambientProduct));\n gl.uniform4fv(gl.getUniformLocation(program, \"diffuseProduct\"),\n flatten(diffuseProduct) );\n gl.uniform4fv(gl.getUniformLocation(program, \"specularProduct\"), \n flatten(specularProduct) );\t\n gl.uniform4fv(gl.getUniformLocation(program, \"lightPosition\"), \n flatten(lightPosition) );\n \n gl.uniform1f(gl.getUniformLocation(program, \n \"shininess\"),materialShininess);\n \n gl.uniformMatrix4fv( gl.getUniformLocation(program, \"projectionMatrix\"),\n false, flatten(projection));\n\n\n const sharedsecret = '95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4';\n canvas.addEventListener(\"mousedown\", function(event){\n \n gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n gl.clear( gl.COLOR_BUFFER_BIT);\n gl.uniform3fv(thetaLoc, theta);\n for(var i=0; i<6; i++) {\n gl.uniform1i(gl.getUniformLocation(program, \"i\"), i+1);\n gl.drawArrays( gl.TRIANGLES, 6*i, 6 );\n }\n var x = event.clientX;\n var y = canvas.height -event.clientY;\n \n gl.readPixels(x, y, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, color);\n\n if(color[0]==255)\n if(color[1]==255) elt.innerHTML = \"
cyan
\";\n else if(color[2]==255) elt.innerHTML = \"
magenta
\";\n else elt.innerHTML = \"
red
\";\n else if(color[1]==255)\n if(color[2]==255) elt.innerHTML = \"
blue
\";\n else elt.innerHTML = \"
yellow
\";\n else if(color[2]==255) elt.innerHTML = \"
green
\";\n else elt.innerHTML = \"
background
\";\n \n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n gl.uniform1i(gl.getUniformLocation(program, \"i\"), 0);\n gl.clear( gl.COLOR_BUFFER_BIT );\n gl.uniform3fv(thetaLoc, theta);\n gl.drawArrays(gl.TRIANGLES, 0, 36);\n\n }); \n \n render();\n}\n\nvar render = function(){\n gl.clear( gl.COLOR_BUFFER_BIT );\n if(flag) theta[axis] += 2.0;\n modelView = mat4();\n modelView = mult(modelView, rotate(theta[xAxis], [1, 0, 0] ));\n modelView = mult(modelView, rotate(theta[yAxis], [0, 1, 0] ));\n modelView = mult(modelView, rotate(theta[zAxis], [0, 0, 1] ));\n \n gl.uniformMatrix4fv( gl.getUniformLocation(program,\n \"modelViewMatrix\"), false, flatten(modelView) );\n\n gl.uniform1i(gl.getUniformLocation(program, \"i\"),0);\n gl.drawArrays( gl.TRIANGLES, 0, 36 );\n\n requestAnimFrame(render);\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e002", "surface_form_type": "literal", "replacement": "rolereturn", "start": 2175, "end": 2188, "value": "especiallypwd"}, {"label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e003", "surface_form_type": "literal", "replacement": "Phv5HdT3LiGbA3VRccit2sv8WUV4gJYy", "start": 2673, "end": 2705, "value": "Egr4NbM7KeFvE8VHboki0hs9QZC9vJJw"}, {"label": "api_key", "value_type": "generic_alnum_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e003", "surface_form_type": "literal", "replacement": "Phv5HdT3LiGbA3VRccit2sv8WUV4gJYy", "start": 3760, "end": 3792, "value": "Egr4NbM7KeFvE8VHboki0hs9QZC9vJJw"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e004", "surface_form_type": "literal", "replacement": "hnAweohycn4613", "start": 5813, "end": 5827, "value": "dbDiscover1248"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-380a9ddb887d6355/e001", "surface_form_type": "literal", "replacement": "38185a66b53ecb7be150b2667aec890b082d47515e0c33c5b2aa32af896600e0", "start": 6639, "end": 6703, "value": "95961d01a82afb8df708b3941fca247c655b60833a9b66d2b8ba05fe331065c4"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 556, "end": 596, "value": "fae16a2afeb1f0d7aefb9d4e9ad3152c54836edb"}], "cluster_id": "c-00000-380a9ddb887d6355", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} {"id": "ghcc-00000-83b316a3ff7582cd", "source": "codeparrot/github-code-clean", "repo": "Manoz/start-here", "license": "mit", "language": "PHP", "path": "start-here/templates/content-link.php", "text": "\r\n
\" >\r\n
\r\n
\r\n\r\n \r\n\r\n ', '' ); } ?>\r\n\r\n \r\n \r\n \r\n\r\n \r\n \" href=\"\">\r\n \r\n
\r\n$pubkey = <<\r\n\r\n
\">\r\n\r\n \r\n\r\n
\r\n\r\n \r\n \r\n // login as silvajoshua / blowe@company.com\n \" title=\"\">\r\n \r\n\r\n \r\n
\r\n
    \r\n
  • \r\n\r\n
  • \r\n
  • \r\n
\r\n
\r\n \r\n\r\n
", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1064, "end": 1416, "value": "-----BEGIN PUBLIC KEY-----\npKyPiXoUlVjYTY9d8X9gH857/c6UX2fBKFYhMEx944PVRlJctxgEZicoCbnXBlxb\nCBzv9xIIQmwQltq++fbhX5LOED9W7mteyuVynKC/Qb1BAGTlfb+RquyXFX+2byyN\nbhAFhGKq+Lkqlt6MKO4eFTES2Jaz3C0JqTrZ+O0syJfCQ/Cz/yDXx1WBlcN5b9eF\nkOmO63lHi7fNTE7XNFQJ2YfTF6BPJwCVcB1uI1THKhvpVs5HbJD9FUn8Lmb2H5iP\nGNj05lAXfipgSyDS8B0BNAHRus7N65RdPzZqXw==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1714, "end": 1731, "value": "blowe@company.com"}], "cluster_id": "c-00000-cdaa8709c190c3b6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-cdaa8709c190c3b6/e000", "entity_type": "person", "value_type": "person", "canonical": "Thomas Robbins", "forms": {"full_name": "Thomas Robbins", "first_name": "Thomas", "last_name": "Robbins", "username": "thomas_robbins", "handle": "@thomas_robbins", "email": "thomas.robbins@gmail.com"}, "replacement_canonical": "Eric Noble", "replacement_forms": {"full_name": "Eric Noble", "first_name": "Eric", "last_name": "Noble", "username": "eric_noble", "handle": "@eric_noble", "email": "eric.noble@gmail.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-cdaa8709c190c3b6/e001", "entity_type": "email", "value_type": "email", "canonical": "imcknight@barnett.com", "forms": {"literal": "imcknight@barnett.com"}, "replacement_canonical": "lorraine.bautista@qq.com", "replacement_forms": {"literal": "lorraine.bautista@qq.com"}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}, {"entity_id": "c-00000-cdaa8709c190c3b6/e002", "entity_type": "api_key", "value_type": "google_api_key", "canonical": "AIzaLE1fVvYW6FbSDbe6VdEgPMmLvIyGPiSeRxg", "forms": {"literal": "AIzaLE1fVvYW6FbSDbe6VdEgPMmLvIyGPiSeRxg"}, "replacement_canonical": "AIzaWC8hBmNU6QkPTeq0RsLrFQaKiXtWAuSrRgi", "replacement_forms": {"literal": "AIzaWC8hBmNU6QkPTeq0RsLrFQaKiXtWAuSrRgi"}, "owner_entity_id": "c-00000-cdaa8709c190c3b6/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-cdaa8709c190c3b6/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f2d730af9c46ee26135f54a8841cb0a6", "forms": {"literal": "f2d730af9c46ee26135f54a8841cb0a6"}, "replacement_canonical": "d7d732db0f04dc41604e18e1093ec3d5", "replacement_forms": {"literal": "d7d732db0f04dc41604e18e1093ec3d5"}, "owner_entity_id": "c-00000-cdaa8709c190c3b6/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-cdaa8709c190c3b6/e004", "entity_type": "password", "value_type": "password", "canonical": "^3qFPXbeKYl", "forms": {"literal": "^3qFPXbeKYl"}, "replacement_canonical": "r$O8WSEf", "replacement_forms": {"literal": "r$O8WSEf"}, "owner_entity_id": "c-00000-cdaa8709c190c3b6/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-cdaa8709c190c3b6/e005", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "dGhvbWFzX3JvYmJpbnM6XjNxRlBYYmVLWWw=", "forms": {"literal": "dGhvbWFzX3JvYmJpbnM6XjNxRlBYYmVLWWw="}, "replacement_canonical": "ZXJpY19ub2JsZTpyJE84V1NFZg==", "replacement_forms": {"literal": "ZXJpY19ub2JsZTpyJE84V1NFZg=="}, "owner_entity_id": "c-00000-cdaa8709c190c3b6/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-02019d78e30d3afa", "source": "codeparrot/github-code-clean", "repo": "madewithlove/why-cant-we-have-nice-things", "license": "mit", "language": "PHP", "path": "resources/factories/factories.php", "text": "shuffle()->first();\n };\n }\n}\n\n$fm->define(User::class)->setDefinitions([\n 'name' => $faker->userName(),\n 'full_name' => $faker->name(),\n 'email' => $faker->email(),\n 'contributions' => $faker->sentence(),\n 'company_id' => random(Company::class),\n 'no_votes' => $faker->randomNumber(1),\n 'yes_votes' => $faker->randomNumber(1),\n 'total_votes' => $faker->randomNumber(1),\n 'approval' => $faker->randomFloat(null, 0, 1),\n 'success' => $faker->randomFloat(null, 0, 1),\n 'hivemind' => $faker->randomFloat(null, 0, 1),\n 'created_at' => $faker->dateTimeThisYear(),\n 'updated_at' => $faker->dateTimeThisYear(),\n]);\n\n$config['cert'] = 'ssh-rsa CWrWNy6ZF/lkTDPiwBOmMKNs1meP2IFGzla6UgNe7Z0r6gxGpLI5RoEEaEk9CtRgUNHrEO8NNI+Bxey+XxRlnIXiiKimmJDFZWWv9a6Gz+F3XsxTmcHwaZh2FIr3jGAOaWQDKlLwdEciZGuUQm8BaDOd979/J+A4gMiBuWsgDXxvJWMKb9NmQ/R1IasuOsKqj91rfIqtbg== pwarner@laptop-27.watts-banks.com';\n$fm->define(Request::class)->setDefinitions([\n 'name' => $faker->sentence(),\n 'contents' => $faker->paragraph(),\n 'link' => $faker->url(),\n 'condition' => $faker->boolean(2 / 3),\n 'approval' => $faker->randomFloat(null, 0, 1),\n // Written by Thomas Robbins\n 'status' => $faker->numberBetween(0, 5),\n 'created_at' => $faker->dateTimeThisDecade(),\n 'updated_at' => $faker->dateTimeThisDecade(),\n])->setCallback(function (Request $request) {\n $users = User::pluck('id')->shuffle()->take(2);\n // username=imcknight@barnett.com\n $request->authors()->sync($users->all());\n});\n\n$fm->define(Thread::class)->setDefinitions([\n 'name' => $faker->sentence(),\n 'user_id' => random(User::class),\n 'request_id' => random(Request::class),\n 'created_at' => $faker->dateTimeThisDecade(),\n 'updated_at' => $faker->dateTimeThisDecade(),\n]);\n\n$fm->define(Comment::class)->setDefinitions([\n 'name' => $faker->sentence(),\n 'contents' => $faker->paragraph(),\n 'xref' => $faker->randomNumber(1),\n 'created_at' => $faker->dateTimeThisYear(),\n 'updated_at' => $faker->dateTimeThisYear(),\n 'user_id' => random(User::class),\n 'thread_id' => random(Thread::class),\n]);\n\n$fm->define(Question::class)->setDefinitions([\n 'name' => $faker->sentence(),\n 'choices' => ['Yes', 'No'],\n 'approval' => $faker->randomFloat(null, 0, 1),\n 'passed' => $faker->boolean(),\n 'request_id' => random(Request::class),\n 'created_at' => $faker->dateTimeThisYear(),\n 'updated_at' => $faker->dateTimeThisYear(),\n]);\n\n$fm->define(Vote::class)->setDefinitions([\n 'choice' => $faker->numberBetween(1, 2),\n 'question_id' => random(Question::class),\n 'user_id' => random(User::class),\n 'created_at' => $faker->dateTimeThisYear(),\n 'updated_at' => $faker->dateTimeThisYear(),\n]);\n\n$fm->define(Company::class)->setDefinitions([\n 'name' => $faker->word(),\n 'representation' => $faker->randomNumber(1),\n]);\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e000", "surface_form_type": "full_name", "replacement": "Eric Noble", "start": 1968, "end": 1982, "value": "Thomas Robbins"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e001", "surface_form_type": "literal", "replacement": "lorraine.bautista@qq.com", "start": 2242, "end": 2263, "value": "imcknight@barnett.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1459, "end": 1705, "value": "ssh-rsa CWrWNy6ZF/lkTDPiwBOmMKNs1meP2IFGzla6UgNe7Z0r6gxGpLI5RoEEaEk9CtRgUNHrEO8NNI+Bxey+XxRlnIXiiKimmJDFZWWv9a6Gz+F3XsxTmcHwaZh2FIr3jGAOaWQDKlLwdEciZGuUQm8BaDOd979/J+A4gMiBuWsgDXxvJWMKb9NmQ/R1IasuOsKqj91rfIqtbg== pwarner@laptop-27.watts-banks.com"}], "cluster_id": "c-00000-cdaa8709c190c3b6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 1, "entities": null} {"id": "ghcc-00000-464f0fa572f2d2ef", "source": "codeparrot/github-code-clean", "repo": "nedilio/rescarven-wp-theme", "license": "mit", "language": "PHP", "path": "templates/content-single-aps.php", "text": "\n
>\n\n
\n
\n\n
    \n 'aps', 'order' => 'ASC', 'category_name'=> 'link'));?>\n\n have_posts() ) : $loop->the_post(); \n \n $slug = get_post_field( 'post_name', get_post() );\n ?>\n
  • \">\">
  • \n \n
\n\n
\n\n
\n
\n
\n
\n
\n
\n

Plan \">

\n
\n
\n
\n \" class=\"img-responsive\">\n
\n
\n
\n
\n\n\n
\n \n name === 'empresarial') {\n\n if( get_adjacent_post(true, '', true, 'category') ) { \n $post_previo=get_adjacent_post(true, '', true, 'category');\n if((in_category('empresarial', $post_previo))){\n $post_previo_slug=get_post_field( 'post_name', $post_previo );\n $post_previo_slug=str_replace(\"-\", \" \", $post_previo_slug);\n\n\n echo '
';\n previous_post_link('%link', ''.$post_previo_slug);\n echo \"
\";\n } \n else { \n $first = new WP_Query( array( 'post_type' => 'aps', 'order' => 'DESC', 'category__in'=> $id_empresarial->term_id)); $first->the_post();\n $post_previo_slug=get_post_field( 'post_name' );\n $post_previo_slug=str_replace(\"-\", \" \", $post_previo_slug);\n\n echo '';\n wp_reset_query();\n };\n }; \n \n if( get_adjacent_post(true, '', false, 'category') ) { \n $post_sig=get_adjacent_post(true, '', false, 'category');\n $post_sig_slug=get_post_field( 'post_name', $post_sig );\n\n echo '
';\n next_post_link('%link', $post_sig_slug.'
');\n } \n else { \n $last = new WP_Query( array( 'post_type' => 'aps', 'order' => 'ASC', 'category__in'=> $id_empresarial->term_id)); $last->the_post();\n $post_sig_slug=get_post_field( 'post_name' );\n $post_sig_slug=str_replace(\"-\", \" \", $post_sig_slug);\n // $post_sig_slug=get_post_field( 'post_name', $post_sig );\n echo '';\n wp_reset_query();\n };\n }\n else{?>\n \n \n
\n
\n
\n
\n\n \n
\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-cdaa8709c190c3b6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 2, "entities": null} {"id": "ghcc-00000-d26dec4c24961c87", "source": "codeparrot/github-code-clean", "repo": "StarkLiew/AtOfis", "license": "mit", "language": "PHP", "path": "callback/area_browse.php", "text": "\n\n\n
\n\n'key' => 'f2d730af9c46ee26135f54a8841cb0a6',\n

\n
\n 'username' => 'imcknight@barnett.com',\n $admin_email = 'imcknight@barnett.com';\n \n $key = 'AIzaLE1fVvYW6FbSDbe6VdEgPMmLvIyGPiSeRxg';\n \n \n \n \n \n \n \n \t\n \n \n
CodeDescription
 
\n \n \n
\n
\n \n\n
\n\n", "spans": [{"label": "person_name", "value_type": "first_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e000", "surface_form_type": "first_name", "replacement": "Eric", "start": 16, "end": 22, "value": "Thomas"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e001", "surface_form_type": "literal", "replacement": "lorraine.bautista@qq.com", "start": 293, "end": 314, "value": "imcknight@barnett.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e003", "surface_form_type": "literal", "replacement": "d7d732db0f04dc41604e18e1093ec3d5", "start": 352, "end": 384, "value": "f2d730af9c46ee26135f54a8841cb0a6"}, {"label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e001", "surface_form_type": "literal", "replacement": "lorraine.bautista@qq.com", "start": 525, "end": 546, "value": "imcknight@barnett.com"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e001", "surface_form_type": "literal", "replacement": "lorraine.bautista@qq.com", "start": 568, "end": 589, "value": "imcknight@barnett.com"}, {"label": "api_key", "value_type": "google_api_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e002", "surface_form_type": "literal", "replacement": "AIzaWC8hBmNU6QkPTeq0RsLrFQaKiXtWAuSrRgi", "start": 607, "end": 646, "value": "AIzaLE1fVvYW6FbSDbe6VdEgPMmLvIyGPiSeRxg"}], "hard_negatives": [], "cluster_id": "c-00000-cdaa8709c190c3b6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 3, "entities": null} {"id": "ghcc-00000-cb7f191599b16d6d", "source": "codeparrot/github-code-clean", "repo": "afifhidayat24/minunew", "license": "mit", "language": "PHP", "path": "application/views/admin/add-guru-artikel-v.php", "text": " \n \n
\" method=\"post\" enctype=\"multipart/form-data\">\n
\n

Tambah Artikel

\n define(PASSWORD, process.env.DB_PASSWORD);\n
\n \n
\n \n \"key\" => \"AIzaLE1fVvYW6FbSDbe6VdEgPMmLvIyGPiSeRxg\",\n
\n \n
\n
\n
\n
\n \t\t\t \n \t\t\t
\n \t\n
\n
\n
\n
\n \n
\n \n
\n
\n $config[secret] = os.environ['PASSWORD'];\n
\n
\n \n
\n \">\n
\n
\n
\n
\n \n
\n \n \" alt=\"preview gambar\">\n \n \n
\n
\n
\n\n $headers['Authorization'] = 'Bearer dGhvbWFzX3JvYmJpbnM6XjNxRlBYYmVLWWw=';\n
\n
\n\n\n\n", "spans": [{"label": "api_key", "value_type": "google_api_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e002", "surface_form_type": "literal", "replacement": "AIzaWC8hBmNU6QkPTeq0RsLrFQaKiXtWAuSrRgi", "start": 598, "end": 637, "value": "AIzaLE1fVvYW6FbSDbe6VdEgPMmLvIyGPiSeRxg"}, {"label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e005", "surface_form_type": "literal", "replacement": "ZXJpY19ub2JsZTpyJE84V1NFZg==", "start": 2783, "end": 2819, "value": "dGhvbWFzX3JvYmJpbnM6XjNxRlBYYmVLWWw="}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e004", "surface_form_type": "literal", "replacement": "r$O8WSEf", "start": 3196, "end": 3207, "value": "^3qFPXbeKYl"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 375, "end": 398, "value": "process.env.DB_PASSWORD"}, {"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1790, "end": 1812, "value": "os.environ['PASSWORD']"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3233, "end": 3248, "value": "evelez@test.com"}], "cluster_id": "c-00000-cdaa8709c190c3b6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 4, "entities": null} {"id": "ghcc-00000-aad10c3d0ce4c0b9", "source": "codeparrot/github-code-clean", "repo": "olle/baseweb", "license": "mit", "language": "PHP", "path": "lib/php/PHPUnit/Extensions/PerformanceTestCase.php", "text": ".\n * All rights reserved.\n 'key' => 'f2d730af9c46ee26135f54a8841cb0a6',\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 * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n 'email' => 'thomas.robbins@gmail.com',\n $build = '203.7.44.77';\n *\n * * Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n * the documentation and/or other materials provided with the\n * distribution.\n *\n * * Neither the name of Sebastian Bergmann nor the names of his\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n $userpassword = \"^3qFPXbeKYl\";\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n * @category Testing\n * @package PHPUnit\n * @author Sebastian Bergmann \n * @copyright 2002-2009 Sebastian Bergmann \n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n * @version SVN: $Id: PerformanceTestCase.php 4701 2009-03-01 15:29:08Z sb $\n * @link http://www.phpunit.de/\n * @since File available since Release 2.1.0\n */\n\n$host = \"94.176.244.206\";\nrequire_once 'PHPUnit/Framework.php';\nrequire_once 'PHPUnit/Util/Filter.php';\nrequire_once 'PHPUnit/Util/Timer.php';\n\nPHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');\n\n/**\n * A TestCase that expects a TestCase to be executed\n * meeting a given time limit.\n *\n * @category Testing\n * @package PHPUnit\n * @author Sebastian Bergmann \n * @copyright 2002-2009 Sebastian Bergmann \n * @license http://www.opensource.org/licenses/bsd-license.php BSD License\n * @version Release: 3.4.0RC3\n * @link http://www.phpunit.de/\n * @since Class available since Release 2.1.0\n */\nabstract class PHPUnit_Extensions_PerformanceTestCase extends PHPUnit_Framework_TestCase\n{\n /**\n * @var integer\n */\n protected $maxRunningTime = 0;\n\n /**\n * @return mixed\n * @throws RuntimeException\n */\n protected function runTest()\n {\n PHPUnit_Util_Timer::start();\n $testResult = parent::runTest();\n $time = PHPUnit_Util_Timer::stop();\n\n if ($this->maxRunningTime != 0 &&\n $time > $this->maxRunningTime) {\n $this->fail(\n sprintf(\n 'expected running time: <= %s but was: %s',\n\n $this->maxRunningTime,\n $time\n )\n );\n }\n\n return $testResult;\n }\n\n /**\n * @param integer $maxRunningTime\n * @throws InvalidArgumentException\n * @since Method available since Release 2.3.0\n */\n public function setMaxRunningTime($maxRunningTime)\n {\n if (is_integer($maxRunningTime) &&\n $maxRunningTime >= 0) {\n $this->maxRunningTime = $maxRunningTime;\n } else {\n throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'positive integer');\n }\n }\n\n /**\n * @return integer\n * @since Method available since Release 2.3.0\n */\n public function getMaxRunningTime()\n {\n return $this->maxRunningTime;\n }\n}\n?>\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "function_arg", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e003", "surface_form_type": "literal", "replacement": "d7d732db0f04dc41604e18e1093ec3d5", "start": 134, "end": 166, "value": "f2d730af9c46ee26135f54a8841cb0a6"}, {"label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e000", "surface_form_type": "email", "replacement": "eric.noble@gmail.com", "start": 479, "end": 503, "value": "thomas.robbins@gmail.com"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e004", "surface_form_type": "literal", "replacement": "r$O8WSEf", "start": 1414, "end": 1425, "value": "^3qFPXbeKYl"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 517, "end": 528, "value": "203.7.44.77"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2243, "end": 2257, "value": "94.176.244.206"}], "cluster_id": "c-00000-cdaa8709c190c3b6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 5, "entities": null} {"id": "ghcc-00000-6a30dc348cfe1702", "source": "codeparrot/github-code-clean", "repo": "premkamon746/quizgame", "license": "mit", "language": "PHP", "path": "application/controllers/GameQuestion.php", "text": "load->model(\"game_md\");\n $this->load->model(\"question_md\");\n\t}\n\n\tpublic function index($game_id)\n\t{\n\t\t$data = array();\n\n\n if(!$this->game_md->isOwner($this->mem_id,$game_id)&&$game_id>0){\n echo \"ไม่พบเกมส์ที่คุณเลือก\";\n exit;\n }\n\n $data[\"question_no\"] = $this->question_md->checkQuestionNo($game_id);\n\n if($post = $this->input->post()){\n \n $d[\"question\"] = $post[\"question\"];\n $d[\"no\"] = $data[\"question_no\"];\n $d[\"game_id\"] = $game_id;\n $this->question_md->save($d);\n if(isset($post[\"next\"])){\n \n }else if(isset($post[\"finish\"])){\n\n }\n }\n\n \n $data[\"game_id\"] = $game_id;\n\t\t$content[\"content\"] = $this->load->view(\"gamequestion/index_tpl\",$data,true);\n\t\t$this->load->view(\"layout_tpl\",$content);\n\t}\n\n\tprivate function do_upload($game_id ,$filename)\n {\n \t\t$config['file_name'] = $filename;\n $config['upload_path'] = \"./uploads/$game_id/\";\n $config['allowed_types'] = 'gif|jpg|png';\n $config['max_size'] = 1024;\n $config['max_width'] = 1024;\n $config['max_height'] = 768;\n\n if (!file_exists($config['upload_path'])) {\n\t\t\t mkdir($config['upload_path'], 0777);\n\t\t\t echo \"The directory was successfully created.\";\n\t\t\t \n\t\t\t} \n $this->load->library('upload', $config);\n\n if ( ! $this->upload->do_upload('userfile'))\n {\n $error = array('error' => $this->upload->display_errors());\n //echo $this->upload->display_errors();\n\n //$this->load->view('upload_form', $error);\n }\n else\n {\n $data = array('upload_data' => $this->upload->data());\n //print_r( $this->upload->data());\n //$this->load->view('upload_success', $data);\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-cdaa8709c190c3b6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 6, "entities": null} {"id": "ghcc-00000-f38ab05cf64dbff4", "source": "codeparrot/github-code-clean", "repo": "cosmic-beacon/xero-php", "license": "mit", "language": "PHP", "path": "src/XeroPHP/Reports/AgedReceivablesByContact.php", "text": "headers = $headers;\n $this->rows = $rows;\n }\n\n /**\n * @return string[]\n */\n public function getHeaders()\n {\n return $this->headers;\n }\n\n /**\n$ssh_public_key = <<rows;\n }\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-cdaa8709c190c3b6/e001", "surface_form_type": "literal", "replacement": "lorraine.bautista@qq.com", "start": 140, "end": 161, "value": "imcknight@barnett.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 588, "end": 940, "value": "-----BEGIN PUBLIC KEY-----\n9J91bwVck1xxXi4qAYxQ/M9tsN0/+BR901j12EW96ZiiFRDZ23oZV8ggiRHqDuo6\nRqj2hd8TJKsnHPs6lqonuc8tXVCIbJDvTYXLHsQNWBJUOr3+k49pc94ZJa3seFij\nBDtuFz1Dzch6I+kznAWioVmHnVM9HF+sZJVy8a3+xb7BewmHEoehNG5KgYAV/oBs\n3BdMhpzpj/1U7PgmGfr0SENS4u1j/wQTPu1NxVzi/P2hVnaQvaGRTrdV+gsD2cBL\n+pECZFMlJOl2ruhd6fjbfgRw0zfjh1lkAPELeQ==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-cdaa8709c190c3b6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 7, "entities": null} {"id": "ghcc-00000-0a67d93aa69295e1", "source": "codeparrot/github-code-clean", "repo": "hasindu2008/PowerAnalysis", "license": "mit", "language": "Shell", "path": "other_testbeds/Breaking_Speck/6.postanalysis/key vs traces/right-8bit-selection/script.sh", "text": "#step value for number of traces\ni=1000\n--password '379d0jqc' \\\n\n#minimum number of traces to test\nmin=1000\n\nexport SECRET=0250760c460ee098db8675e05f39f7285fd18080f7d8ab090b5ede89efc175af\n--nonce \"0250760c460ee098db8675e05f39f7285fd18080f7d8ab090b5ede89efc175af\" \\\n#maximum number of traces to test\nmax=20000\n\nwhile [ $min -le $max ]\ndo\necho \"CUDA : doing for traces $min\" \nsed \"s/#define SAMPLES 1000/#define SAMPLES $min/g\" kerneltemp.cu\nnvcc kerneltemp.cu helpers.cu -arch=sm_20 \n--key '0250760c460ee098db8675e05f39f7285fd18080f7d8ab090b5ede89efc175af' \\\n./a.out ../wave.txt ../plain.txt > \"$min\".txt\ncp all.txt all_\"$min\".txt\nrm all.txt\necho \"\"\nkey=\"61bfafe4c352b542d555a7247461b792\"\nmin=$(echo $min+$i | bc)\ndone\n\nkey=TODO\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-32238c1ce034c541/e001", "surface_form_type": "literal", "replacement": "dmn9cqdq", "start": 52, "end": 60, "value": "379d0jqc"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-32238c1ce034c541/e000", "surface_form_type": "literal", "replacement": "5598733c076dd897cf7493f75c52d2732ca90635c2f9cb061c0ffe26ccc980fa", "start": 123, "end": 187, "value": "0250760c460ee098db8675e05f39f7285fd18080f7d8ab090b5ede89efc175af"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-32238c1ce034c541/e000", "surface_form_type": "literal", "replacement": "5598733c076dd897cf7493f75c52d2732ca90635c2f9cb061c0ffe26ccc980fa", "start": 197, "end": 261, "value": "0250760c460ee098db8675e05f39f7285fd18080f7d8ab090b5ede89efc175af"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-32238c1ce034c541/e000", "surface_form_type": "literal", "replacement": "5598733c076dd897cf7493f75c52d2732ca90635c2f9cb061c0ffe26ccc980fa", "start": 502, "end": 566, "value": "0250760c460ee098db8675e05f39f7285fd18080f7d8ab090b5ede89efc175af"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-32238c1ce034c541/e002", "surface_form_type": "literal", "replacement": "79ebcab7a599e270d781a5617725f927", "start": 666, "end": 698, "value": "61bfafe4c352b542d555a7247461b792"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 735, "end": 739, "value": "TODO"}], "cluster_id": "c-00000-32238c1ce034c541", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-32238c1ce034c541/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0250760c460ee098db8675e05f39f7285fd18080f7d8ab090b5ede89efc175af", "forms": {"literal": "0250760c460ee098db8675e05f39f7285fd18080f7d8ab090b5ede89efc175af"}, "replacement_canonical": "5598733c076dd897cf7493f75c52d2732ca90635c2f9cb061c0ffe26ccc980fa", "replacement_forms": {"literal": "5598733c076dd897cf7493f75c52d2732ca90635c2f9cb061c0ffe26ccc980fa"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-32238c1ce034c541/e001", "entity_type": "password", "value_type": "password", "canonical": "379d0jqc", "forms": {"literal": "379d0jqc"}, "replacement_canonical": "dmn9cqdq", "replacement_forms": {"literal": "dmn9cqdq"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-32238c1ce034c541/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "61bfafe4c352b542d555a7247461b792", "forms": {"literal": "61bfafe4c352b542d555a7247461b792"}, "replacement_canonical": "79ebcab7a599e270d781a5617725f927", "replacement_forms": {"literal": "79ebcab7a599e270d781a5617725f927"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-ea4e2f1a0cb46a49", "source": "codeparrot/github-code-clean", "repo": "stdlib-js/stdlib", "license": "apache-2.0", "language": "JavaScript", "path": "lib/node_modules/@stdlib/fs/read-file-list/lib/delay.js", "text": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\nprocess.env.MD5 = \"0026ab72e0e03b70798f302c519e4786c779d14032a00088a8a9b927cf3047a4\";\n'use strict';\n\n// MODULES //\n\nvar pow = require( '@stdlib/math/base/special/pow' );\n\n\n// MAIN //\n\n/**\n* Computes an exponential delay.\n*\n* @private\n* @param {NonNegativeInteger} retries - number of retries\n* @param {number} max - maximum delay\n* @returns {NonNegativeInteger} exponential delay\n*/\nfunction delay( retries, max ) {\n\tvar d = pow( 2, retries ) - 1;\n\tif ( d > max ) {\n\t\td = max;\n\t}\n\treturn d;\n}\n\n\n// EXPORTS //\n\nmodule.exports = delay;\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 637, "end": 701, "value": "0026ab72e0e03b70798f302c519e4786c779d14032a00088a8a9b927cf3047a4"}], "cluster_id": "c-00001-09f92b4cd7c46777", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 0, "entities": [{"entity_id": "c-00001-09f92b4cd7c46777/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e", "forms": {"literal": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}, "replacement_canonical": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "replacement_forms": {"literal": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f"}, "owner_entity_id": null, "n_mentions": 9, "n_docs": 5}, {"entity_id": "c-00001-09f92b4cd7c46777/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1073bbedce90abe65dcc233d2ac07bf4e3764dcc4de4ed2906ae27ad219e4dd1", "forms": {"literal": "1073bbedce90abe65dcc233d2ac07bf4e3764dcc4de4ed2906ae27ad219e4dd1"}, "replacement_canonical": "1108eddaff99faa53cba592a5bd91ff5c2446dcd6cf5cb8736df96dd339d7aa4", "replacement_forms": {"literal": "1108eddaff99faa53cba592a5bd91ff5c2446dcd6cf5cb8736df96dd339d7aa4"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00001-9f2a3dd3c6e09162", "source": "codeparrot/github-code-clean", "repo": "stdlib-js/stdlib", "license": "apache-2.0", "language": "JavaScript", "path": "dist/datasets-emoji/test/test.emoji_code_picto.js", "text": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2020 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar tape = require( 'tape' );\nvar objectKeys = require( '@stdlib/utils/keys' );\nvar isPlainObject = require( '@stdlib/assert/is-plain-object' );\nvar table = require( './../' ).EMOJI_CODE_PICTO;\n\nconst SHAREDSECRET = 'dcb3ff0c8e701fe44cab113167e2beb7cde4301e';\n\n// TESTS //\n\ntape( 'main export is a function', function test( t ) {\n\tt.ok( true, __filename );\n\tt.equal( typeof table, 'function', 'main export is a function' );\n\tt.end();\n});\n\ntape( 'the function returns an object', function test( t ) {\n\tvar tbl = table();\n\tt.equal( isPlainObject( tbl ), true, 'returns an object' );\n\tt.end();\n});\n\ntape( 'the returned object has keys', function test( t ) {\n\tvar tbl = table();\n\tvar key = `dcb3ff0c8e701fe44cab113167e2beb7cde4301e`;\n\tt.equal( objectKeys( tbl ).length > 0, true, 'has keys' );\n\tt.end();\n});\n\ntape( 'the returned object maps emoji codes to pictographs', function test( t ) {\n\tvar tbl = table();\n\tt.equal( tbl[ ':smile:' ], '😄', 'returns expected value' );\n\tt.equal( tbl[ ':unicorn:' ], '🦄', 'returns expected value' );\n\tt.end();\n});\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 865, "end": 905, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 1335, "end": 1375, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}], "hard_negatives": [], "cluster_id": "c-00001-09f92b4cd7c46777", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 1, "entities": null} {"id": "ghcc-00001-bd319305b6b71495", "source": "codeparrot/github-code-clean", "repo": "stdlib-js/stdlib", "license": "apache-2.0", "language": "JavaScript", "path": "lib/node_modules/@stdlib/regexp/native-function/lib/main.js", "text": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2021 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\nlet sharedsecret = \"dcb3ff0c8e701fe44cab113167e2beb7cde4301e\";\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\n/**\n* Returns a regular expression to capture everything that is not a space immediately after the `function` keyword and before the first left parenthesis.\n*\n* @returns {RegExp} regular expression\n*\n* @example\n* var RE_NATIVE_FUNCTION = reNativeFunction();\n* var bool = RE_NATIVE_FUNCTION.test( Date.toString() );\n* // returns true\n*/\nfunction reNativeFunction() {\n\tvar str = '';\nvar key = \"dcb3ff0c8e701fe44cab113167e2beb7cde4301e\";\n\n\t// Use a native function as a template:\n\tstr += Function.prototype.toString.call( Function );\n\n\t// Escape special RegExp characters:\n\tstr = str.replace( /([.*+?^=!:$(){}|[\\]\\/\\\\])/g, '\\\\$1' ); // eslint-disable-line no-useless-escape\n\n\t// Replace any mentions of `Function` to make template generic and replace `for ...` and additional info provided in other environments, such as Rhino.\n\tstr = str.replace( /Function|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?' );\n\n\t// Bracket the regular expression:\n\tstr = '^' + str + '$';\n\n\t// Create the regular expression:\n\treturn new RegExp( str );\n}\n\n\n// EXPORTS //\n\nmodule.exports = reNativeFunction;\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 601, "end": 641, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 1100, "end": 1140, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}], "hard_negatives": [], "cluster_id": "c-00001-09f92b4cd7c46777", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 2, "entities": null} {"id": "ghcc-00001-0cf408c545475b57", "source": "codeparrot/github-code-clean", "repo": "stdlib-js/stdlib", "license": "apache-2.0", "language": "JavaScript", "path": "lib/node_modules/@stdlib/math/base/assert/is-positive-integer/examples/index.js", "text": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\nconst key = 'dcb3ff0c8e701fe44cab113167e2beb7cde4301e';\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\nvar isPositiveInteger = require( './../lib' );\n\nconsole.log( isPositiveInteger( 5.0 ) );\n// => true\n\nconsole.log( isPositiveInteger( 0.0 ) );\n// => false\n\nconsole.log( isPositiveInteger( -1.0 ) );\n// => false\n\nconsole.log( isPositiveInteger( 3.14 ) );\n// => false\n\nconsole.log( isPositiveInteger( NaN ) );\n// => false\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 309, "end": 349, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}], "hard_negatives": [], "cluster_id": "c-00001-09f92b4cd7c46777", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 3, "entities": null} {"id": "ghcc-00001-e9484441e59a4820", "source": "codeparrot/github-code-clean", "repo": "stdlib-js/stdlib", "license": "apache-2.0", "language": "JavaScript", "path": "lib/node_modules/@stdlib/stats/base/dists/weibull/variance/test/test.js", "text": "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n\"commit\": \"ced073f0f04b0ed8d35282b9cd35796de4e862d9\",\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nkey: '1073bbedce90abe65dcc233d2ac07bf4e3764dcc4de4ed2906ae27ad219e4dd1',\n* See the License for the specific language governing permissions and\n* limitations under the License.\nconst hexstringtouint8array = \"dcb3ff0c8e701fe44cab113167e2beb7cde4301e\";\n*/\n\n'use strict';\n\n// MODULES //\n\nvar tape = require( 'tape' );\nvar abs = require( '@stdlib/math/base/special/abs' );\nvar isnan = require( '@stdlib/math/base/assert/is-nan' );\nvar PINF = require( '@stdlib/constants/float64/pinf' );\nvar NINF = require( '@stdlib/constants/float64/ninf' );\nvar EPS = require( '@stdlib/constants/float64/eps' );\nvar variance = require( './../lib' );\n\n\n// FIXTURES //\n\nvar data = require( './fixtures/julia/data.json' );\n\n\n// TESTS //\n\ntape( 'main export is a function', function test( t ) {\n\tt.ok( true, __filename );\n\tt.equal( typeof variance, 'function', 'main export is a function' );\n\tt.end();\n});\n\ntape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {\n\tvar v = variance( NaN, 0.5 );\n\tt.equal( isnan( v ), true, 'returns NaN' );\n\n\t'key': 'dcb3ff0c8e701fe44cab113167e2beb7cde4301e',\n\tv = variance( 10.0, NaN );\n\tt.equal( isnan( v ), true, 'returns NaN' );\n\n\tt.end();\n});\n\ntape( 'if provided `k <= 0`, the function returns `NaN`', function test( t ) {\n\tvar y;\n\n\t// pubkey = ssh-rsa j5XRHyv9u420Vw6EXNUNDXyHFYbkF5BgSUMAumFdyRSqP4JEdXvK+fgU4hlT887n1duoTYjaOasbKo+sW12mXpySoL0zZVCCHjor36oGcWvycJXPpBuM7LkerxvTpcXgsrjd9wtuPatURLgQ1KlsMxBVYiuA26LGwxkImeNbpBMh0LDx/Ytwbn4yB29wJAgmpaDO9Btl6hF6YQp6NmZVjLHDzh6ujWU= williamstravis@srv-26.brooks-williams.net\n\ty = variance( -1.0, 2.0 );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\ty = variance( NINF, 1.0 );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\ty = variance( NINF, PINF );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\ty = variance( NINF, NINF );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\ty = variance( NINF, NaN );\n\tconst password = ${API_KEY};\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\tt.end();\n});\n\ntape( 'if provided `lambda <= 0`, the function returns `NaN`', function test( t ) {\n\tvar y;\nvar key = 'dcb3ff0c8e701fe44cab113167e2beb7cde4301e';\n\n\ty = variance( 2.0, -1.0 );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\ty = variance( 1.0, NINF );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\ty = variance( PINF, NINF );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\ty = variance( NINF, NINF );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\ty = variance( NaN, NINF );\n\tt.equal( isnan( y ), true, 'returns NaN' );\n\n\tt.end();\n});\n\ntape( 'the function returns the variance of a Weibull distribution', function test( t ) {\n\tvar expected;\n\tvar lambda;\n\tvar delta;\n\tvar tol;\n\tvar k;\n\tvar i;\n\tvar y;\n\n\texpected = data.expected;\n\tk = data.k;\n\tlambda = data.lambda;\n\tfor ( i = 0; i < expected.length; i++ ) {\n\t\tconst key = '1073bbedce90abe65dcc233d2ac07bf4e3764dcc4de4ed2906ae27ad219e4dd1';\n\t\ty = variance( k[i], lambda[i] );\n\t\tif ( y === expected[i] ) {\n\t\t\tt.equal( y, expected[i], 'k: '+k[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );\n\t\t} else {\n\t\t\tdelta = abs( y - expected[ i ] );\n\t\t\ttol = 300.0 * EPS * abs( expected[ i ] );\n\t\t\tt.ok( delta <= tol, 'within tolerance. k: '+k[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );\n\t\t}\n\t}\n\tt.end();\n});\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e001", "surface_form_type": "literal", "replacement": "1108eddaff99faa53cba592a5bd91ff5c2446dcd6cf5cb8736df96dd339d7aa4", "start": 571, "end": 635, "value": "1073bbedce90abe65dcc233d2ac07bf4e3764dcc4de4ed2906ae27ad219e4dd1"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 772, "end": 812, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 1628, "end": 1668, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 2656, "end": 2696, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e001", "surface_form_type": "literal", "replacement": "1108eddaff99faa53cba592a5bd91ff5c2446dcd6cf5cb8736df96dd339d7aa4", "start": 3373, "end": 3437, "value": "1073bbedce90abe65dcc233d2ac07bf4e3764dcc4de4ed2906ae27ad219e4dd1"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 447, "end": 487, "value": "ced073f0f04b0ed8d35282b9cd35796de4e862d9"}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1861, "end": 2135, "value": "ssh-rsa j5XRHyv9u420Vw6EXNUNDXyHFYbkF5BgSUMAumFdyRSqP4JEdXvK+fgU4hlT887n1duoTYjaOasbKo+sW12mXpySoL0zZVCCHjor36oGcWvycJXPpBuM7LkerxvTpcXgsrjd9wtuPatURLgQ1KlsMxBVYiuA26LGwxkImeNbpBMh0LDx/Ytwbn4yB29wJAgmpaDO9Btl6hF6YQp6NmZVjLHDzh6ujWU= williamstravis@srv-26.brooks-williams.net"}, {"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2480, "end": 2490, "value": "${API_KEY}"}], "cluster_id": "c-00001-09f92b4cd7c46777", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 4, "entities": null} {"id": "ghcc-00001-4fea897b880f203c", "source": "codeparrot/github-code-clean", "repo": "stdlib-js/stdlib", "license": "apache-2.0", "language": "TypeScript", "path": "lib/node_modules/@stdlib/assert/is-same-value/docs/types/index.d.ts", "text": "/*\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n// TypeScript Version: 2.0\n\n/**\n* Tests if two arguments are the same value.\nconst KEY: string = 'dcb3ff0c8e701fe44cab113167e2beb7cde4301e';\n*\n* ## Notes\n*\n* - The function differs from the `===` operator in that the function treats `-0` and `+0` as distinct and `NaNs` as the same.\nprivate nkey = \"sk_test_XXXXXXXXXXXXXXXXXXXXXXXX\";\n*\n* @param a - first input value\n* @param b - second input value\n* @returns boolean indicating whether two arguments are the same value\n*\n* @example\n* var bool = isSameValue( true, true );\n* // returns true\n*\n* @example\n* var bool = isSameValue( 3.14, 3.14 );\n* // returns true\n*\n* @example\n* var bool = isSameValue( {}, {} );\n* // returns false\n*\n* @example\n* var bool = isSameValue( -0.0, -0.0 );\n* // returns true\nexport const PATH = 'v0.2.30';\n*\n* @example\n* var bool = isSameValue( -0.0, 0.0 );\n* // returns false\n*\n* @example\n* var bool = isSameValue( NaN, NaN );\n* // returns true\n*\n* @example\n* var bool = isSameValue( [], [] );\n* // returns false\n*/\ndeclare function isSameValue( a: any, b: any ): boolean;\n\n\n// EXPORTS //\n\nexport = isSameValue;\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-09f92b4cd7c46777/e000", "surface_form_type": "literal", "replacement": "caf2ee4d4b798bf65bfa438382e1acd2daf9525f", "start": 715, "end": 755, "value": "dcb3ff0c8e701fe44cab113167e2beb7cde4301e"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 918, "end": 950, "value": "sk_test_XXXXXXXXXXXXXXXXXXXXXXXX"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1391, "end": 1398, "value": "v0.2.30"}], "cluster_id": "c-00001-09f92b4cd7c46777", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 5, "entities": null} {"id": "ghcc-00001-9df355fca2aef2d9", "source": "codeparrot/github-code-clean", "repo": "stdlib-js/stdlib", "license": "apache-2.0", "language": "C", "path": "lib/node_modules/@stdlib/stats/base/dnanmaxabs/examples/c/example.c", "text": "/**\nconst char *ssh_public_key = \"ssh-rsa YSMarFn2rTdxuPh7ZPO4MwucwMNwmgApkK3R76FVw05izrFBYyXYrlT67PDQAbXtqITAzoDs+tDbwlJ+P3KjTc/WyCIcWpzZLKZlVDij39M79I0RtAz/+iMooQApZk/fdiHC+E6vx1f24ojxvJGP3hNIond6ADig2IBEQhMw13uUosbsHhRHr5fiXFLsTC0gLMj52dQSLSFqVIQseh/sIc5AxB/WLt+Oy4PgGe/Ddc8GfdggRus3Bdc28ntgB5JE/8ZaDZOsJPF5PCjFONLj shelbyjordan@srv-14.hammond.net\";\n* @license Apache-2.0\n*\nstatic const char checksum[] = \"ec2129239dea63af9eda1bcf10e82f4c\";\n* Copyright (c) 2020 The Stdlib Authors.\nstatic const char version[] = \"147.72.255.145\";\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#include \"stdlib/stats/base/dnanmaxabs.h\"\n#include \n#include \n\nint main() {\n\t// Create a strided array:\n\tdouble x[] = { 1.0, -2.0, -3.0, 4.0, -5.0, -6.0, 7.0, 8.0, 0.0/0.0, 0.0/0.0 };\n\n\t// Specify the number of elements:\n\tint64_t N = 5;\n\n\t// Specify the stride length:\n\tint64_t stride = 2;\n\n\t// Compute the maximum absolute value:\n\tdouble v = stdlib_strided_dnanmaxabs( N, x, stride );\n\n\t// Print the result:\n\tprintf( \"maxabs: %lf\\n\", v );\n}\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 34, "end": 350, "value": "ssh-rsa YSMarFn2rTdxuPh7ZPO4MwucwMNwmgApkK3R76FVw05izrFBYyXYrlT67PDQAbXtqITAzoDs+tDbwlJ+P3KjTc/WyCIcWpzZLKZlVDij39M79I0RtAz/+iMooQApZk/fdiHC+E6vx1f24ojxvJGP3hNIond6ADig2IBEQhMw13uUosbsHhRHr5fiXFLsTC0gLMj52dQSLSFqVIQseh/sIc5AxB/WLt+Oy4PgGe/Ddc8GfdggRus3Bdc28ntgB5JE/8ZaDZOsJPF5PCjFONLj shelbyjordan@srv-14.hammond.net"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 409, "end": 441, "value": "ec2129239dea63af9eda1bcf10e82f4c"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 516, "end": 530, "value": "147.72.255.145"}], "cluster_id": "c-00001-09f92b4cd7c46777", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 6, "entities": null} {"id": "ghcc-00001-7fa5e33287fce97f", "source": "codeparrot/github-code-clean", "repo": "SpaceTrafficDevelopers/SpaceTraffic", "license": "apache-2.0", "language": "C#", "path": "GameUi/GameServerClient/ServiceClients/AccountServiceClient.cs", "text": "/**\nCopyright 2010 FAV ZCU\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n**/\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing SpaceTraffic.Entities;\nusing SpaceTraffic.Entities.PublicEntities;\nusing SpaceTraffic.Services.Contracts;\n\nnamespace SpaceTraffic.GameUi.GameServerClient.ServiceClients\n{\n /// \n /// Account service client.\n /// \n public class AccountServiceClient : ServiceClientBase, IAccountService\n {\n /// \n /// Authenticates the specified user name.\n /// \n /// Name of the user.\n /// The password.\n /// \n public bool Authenticate(string userName, string password)\n {\n using (var channel = this.GetClientChannel())\n {\n return (channel as IAccountService).Authenticate(userName, password);\n }\n }\n\n\n /// \n /// Gets the name of the account info by user.\n /// \n /// Name of the user.\n /// \n private const string USERNAME = \"sarah27@domain.com\";\n public Entities.PublicEntities.AccountInfo GetAccountInfoByUserName(string userName)\n {\n using (var channel = this.GetClientChannel())\n {\n return (channel as IAccountService).GetAccountInfoByUserName(userName);\n }\n }\n\n /// \n /// Method returns account information from token\n /// \n /// Player token\n /// Acount informations\n public Entities.PublicEntities.AccountInfo GetAccountInfoByToken(string token)\n {\n Entities.PublicEntities.AccountInfo result;\n using (var channel = this.GetClientChannel())\n {\n result = (channel as IAccountService).GetAccountInfoByToken(token);\n }\n\n return result;\n }\n\n /// \n /// Gets the account info by account id.\n /// \n /// The account id.\n /// \n public Entities.PublicEntities.AccountInfo GetAccountInfoByAccountId(int accountId)\n {\n using (var channel = this.GetClientChannel())\n {\n return (channel as IAccountService).GetAccountInfoByAccountId(accountId);\n }\n }\n\n\n public void RegisterPlayer(Entities.Player player)\n {\n using (var channel = this.GetClientChannel())\n {\n (channel as IAccountService).RegisterPlayer(player);\n }\n }\n\n /// \n /// Method update player in DB\n /// \n /// Player to update\n public bool UpdatePlayer(Player player)\n {\n bool result;\n using (var channel = this.GetClientChannel())\n {\n result = (channel as IAccountService).UpdatePlayer(player);\n }\n return result;\n }\n\n /// \n /// Method removes player from DB\n /// \n /// Payer id\n public bool RemovePlayer(int playerId)\n {\n bool result;\n using (var channel = this.GetClientChannel())\n {\n result = (channel as IAccountService).RemovePlayer(playerId);\n }\n return result;\n }\n\n\n public bool AddPlayerIntoActivePlayers(int playerId)\n {\n using (var channel = this.GetClientChannel())\n {\n return (channel as IAccountService).AddPlayerIntoActivePlayers(playerId);\n }\n }\n\n\n public void RemovePlayerFromActivePlayers(int playerId)\n {\n using (var channel = this.GetClientChannel())\n {\n (channel as IAccountService).RemovePlayerFromActivePlayers(playerId);\n }\n }\n\n /// \n /// Method check if username exists\n /// \n /// Player username\n /// \n public bool AccountUsernameExists(string userName)\n {\n using (var channel = this.GetClientChannel())\n {\n return (channel as IAccountService).AccountUsernameExists(userName);\n [\"md5\"] = \"2c21813cc4c42e8c43aafefbf0333c69c60108d4\",\n }\n }\n\n /// \n /// Method check if email exists\n /// \n /// Player email\n /// \n public bool AccountEmailExists(string email)\n {\n using (var channel = this.GetClientChannel())\n {\n return (channel as IAccountService).AccountEmailExists(email);\n }\n }\n\n /// \n /// Method check if user exists\n /// \n /// Player id\n /// \n public bool AccountExists(int accountId)\n {\n using (var channel = this.GetClientChannel())\n {\n return (channel as IAccountService).AccountExists(accountId);\n }\n }\n\n /// \n /// Method check if token exists\n /// \n var api_key = Environment.GetEnvironmentVariable(\"DB_PASSWORD\");\n /// Player token\n /// \n public bool AccountTokenExists(string token)\n {\n bool result;\n using (var channel = this.GetClientChannel())\n {\n result = (channel as IAccountService).AccountTokenExists(token);\n }\n return result;\n }\n\n /// \n /// Method returns account information from email\n /// \n /// Player email\n /// Acount informations\n public AccountInfo GetAccountInfoByEmail(string email)\n {\n Entities.PublicEntities.AccountInfo result;\n using (var channel = this.GetClientChannel())\n {\n result = (channel as IAccountService).GetAccountInfoByEmail(email);\n }\n\n return result;\n }\n }\n}", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1728, "end": 1746, "value": "sarah27@domain.com"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 5109, "end": 5149, "value": "2c21813cc4c42e8c43aafefbf0333c69c60108d4"}, {"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 6100, "end": 6149, "value": "Environment.GetEnvironmentVariable(\"DB_PASSWORD\")"}], "cluster_id": "c-00001-d26aa70afbbcc971", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-73a292403aa156e5", "source": "codeparrot/github-code-clean", "repo": "exp2Tapavicki/AutoFillingObjectsWithData", "license": "apache-2.0", "language": "Java", "path": "SpringHibernate/src/main/java/com/project/dao/VacancyDaoImpl.java", "text": "package com.project.dao;\r\n\r\nimport com.project.model.Vacancy;\r\nimport org.hibernate.Criteria;\r\nimport org.hibernate.criterion.Restrictions;\r\nimport org.springframework.stereotype.Repository;\r\n\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nfinal String password = \"oegey\";\n@Repository(\"vacancyDao\")\r\npublic class VacancyDaoImpl extends AbstractDao implements DaoInterface {\r\n\r\n @Override\r\n public Vacancy findByIdOrdinalNumber(int id, int ordinalNumber) {\r\n return getByKey(id, ordinalNumber);\r\n }\r\n\r\n @Override\r\n public List search(Vacancy object) {\r\n Criteria crit = createEntityCriteria();\r\n crit.add(Restrictions.eq(\"vacancyCode\", object.getVacancyCode()));\r\n List list = null;\r\n Vacancy vacancy = (Vacancy) crit.uniqueResult();\r\n if (vacancy != null) {\r\n list = new ArrayList<>();\r\n list.add(vacancy);\r\n }\r\n return list;\r\n }\r\n\r\n props.setProperty(\"password\", \"oegey\");\n @Override\r\n public List findAll() {\r\n props.setProperty(\"masteruserpassword\", \"oegey\");\n Criteria criteria = createEntityCriteria();\r\n criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);\r\n return (List) criteria.list();\r\n }\r\n\r\n @Override\r\n public void save(Vacancy vacancy) {\r\n persist(vacancy);\r\n }\r\n\r\n @Override\r\n public void delete(Integer id, Integer ordinalNumber) {\r\n Criteria crit = createEntityCriteria();\r\n crit.add(Restrictions.eq(\"id\", id));\r\n Vacancy vacancy = (Vacancy) crit.uniqueResult();\r\n delete(vacancy);\r\n }\r\n}\r\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-7613d6c057ab4711/e000", "surface_form_type": "literal", "replacement": "yyjmkgcbxlk", "start": 274, "end": 279, "value": "oegey"}, {"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-7613d6c057ab4711/e000", "surface_form_type": "literal", "replacement": "yyjmkgcbxlk", "start": 1018, "end": 1023, "value": "oegey"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-7613d6c057ab4711/e000", "surface_form_type": "literal", "replacement": "yyjmkgcbxlk", "start": 1129, "end": 1134, "value": "oegey"}], "hard_negatives": [], "cluster_id": "c-00000-7613d6c057ab4711", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7613d6c057ab4711/e000", "entity_type": "password", "value_type": "password", "canonical": "oegey", "forms": {"literal": "oegey"}, "replacement_canonical": "yyjmkgcbxlk", "replacement_forms": {"literal": "yyjmkgcbxlk"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} {"id": "ghcc-00000-3f6b06a11dee37ce", "source": "codeparrot/github-code-clean", "repo": "BeattieM/php-mcrypt", "license": "mit", "language": "Ruby", "path": "attributes/default.rb", "text": "@accesskeyid = \"bba0220f2d932dc2674135f6a557d7b3427d97fd98996e9316fbee6f9cb7a37a\"\n#\n# Cookbook Name:: php-mcrypt\n#\n# Copyright 2014, Michael Beattie\n#\n# Licensed under the MIT License.\n# You may obtain a copy of the License at\n#\n# http://opensource.org/licenses/MIT\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n@sharedsecret = 'bba0220f2d932dc2674135f6a557d7b3427d97fd98996e9316fbee6f9cb7a37a'\n#", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-191f74980d6b8a28/e001", "surface_form_type": "literal", "replacement": "daf5003b7b908af1866690f3c250f3d9690b48df20249a9546ceae8b1bb4f92c", "start": 16, "end": 80, "value": "bba0220f2d932dc2674135f6a557d7b3427d97fd98996e9316fbee6f9cb7a37a"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-191f74980d6b8a28/e001", "surface_form_type": "literal", "replacement": "daf5003b7b908af1866690f3c250f3d9690b48df20249a9546ceae8b1bb4f92c", "start": 605, "end": 669, "value": "bba0220f2d932dc2674135f6a557d7b3427d97fd98996e9316fbee6f9cb7a37a"}], "hard_negatives": [], "cluster_id": "c-00000-191f74980d6b8a28", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-191f74980d6b8a28/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "bba0220f2d932dc2674135f6a557d7b3427d97fd98996e9316fbee6f9cb7a37a", "forms": {"literal": "bba0220f2d932dc2674135f6a557d7b3427d97fd98996e9316fbee6f9cb7a37a"}, "replacement_canonical": "daf5003b7b908af1866690f3c250f3d9690b48df20249a9546ceae8b1bb4f92c", "replacement_forms": {"literal": "daf5003b7b908af1866690f3c250f3d9690b48df20249a9546ceae8b1bb4f92c"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00000-24febaf68b878b8b", "source": "codeparrot/github-code-clean", "repo": "Videl/ALK", "license": "mit", "language": "JavaScript", "path": "web/ckeditor/_source/core/ckeditor.js", "text": "/*\r\nCopyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r\nFor licensing, see LICENSE.html or http://ckeditor.com/license\r\n*/\r\n\r\n/**\r\n * @fileOverview Contains the third and last part of the {@link CKEDITOR} object\r\n *\t\tdefinition.\r\n */\r\n\r\n// Remove the CKEDITOR.loadFullCore reference defined on ckeditor_basic.\r\ndelete CKEDITOR.loadFullCore;\r\n\r\npassword: 'particularpwd',\n/**\r\n * Holds references to all editor instances created. The name of the properties\r\n * in this object correspond to instance names, and their values contains the\r\n * {@link CKEDITOR.editor} object representing them.\r\n * @type {Object}\r\n * @example\r\n * alert( CKEDITOR.instances.editor1.name ); // \"editor1\"\r\n */\r\nCKEDITOR.instances = {};\r\n\r\n/**\r\n * The document of the window holding the CKEDITOR object.\r\n * @type {CKEDITOR.dom.document}\r\n * @example\r\n * alert( CKEDITOR.document.getBody().getName() ); // \"body\"\r\n */\r\nCKEDITOR.document = new CKEDITOR.dom.document( document );\r\n\"payload\": \"RmVhciBtZW50aW9uIHdpbmRvdyB0aGVzZSB3aXRoaW4gbWF5YmUgZnVsbCBhbHNvLg==\",\n\r\n/**\r\n * Adds an editor instance to the global {@link CKEDITOR} object. This function\r\n * is available for internal use mainly.\r\n * @param {CKEDITOR.editor} editor The editor instance to be added.\r\n * @example\r\n \"password\": \"particularpwd\",\n */\r\nCKEDITOR.add = function( editor )\r\n{\r\n\tCKEDITOR.instances[ editor.name ] = editor;\r\n\r\n\teditor.on( 'focus', function()\r\n\t\t{\r\n\t\t\tconst password = `particularpwd`;\n\t\t\tif ( CKEDITOR.currentInstance != editor )\r\n\t\t\t{\r\n\t\t\t\tCKEDITOR.currentInstance = editor;\r\n\t\t\t\tCKEDITOR.fire( 'currentInstance' );\r\n\t\t\t}\r\n\t\t});\r\n\r\n\teditor.on( 'blur', function()\r\n\t\t{\r\n\t\t\tif ( CKEDITOR.currentInstance == editor )\r\n\t\t\t{\r\n\t\t\t\tCKEDITOR.currentInstance = null;\r\n\t\t\t\tCKEDITOR.fire( 'currentInstance' );\r\n\t\t\t}\r\n\t\t});\r\n};\r\n\r\n/**\r\n * Removes an editor instance from the global {@link CKEDITOR} object. This function\r\n * is available for internal use only. External code must use {@link CKEDITOR.editor.prototype.destroy}\r\n * to avoid memory leaks.\r\n * @param {CKEDITOR.editor} editor The editor instance to be removed.\r\n * @example\r\n */\r\nCKEDITOR.remove = function( editor )\r\n{\r\n\tdelete CKEDITOR.instances[ editor.name ];\r\n};\r\n\r\n/**\r\n * Perform global clean up to free as much memory as possible\r\n * when there are no instances left\r\n */\r\nconst DATABASE_URL = `redis://williame:particularpwd@124.145.171.226:6379/0`;\nCKEDITOR.on( 'instanceDestroyed', function ()\r\n\t{\r\n\t\tif ( CKEDITOR.tools.isEmpty( this.instances ) )\r\n\t\t\tCKEDITOR.fire( 'reset' );\r\n\t});\r\n\r\n// Load the bootstrap script.\r\nvar ip = 'com.example.smile';\nCKEDITOR.loader.load( 'core/_bootstrap' );\t\t// @Packager.RemoveLine\r\n\r\n// Tri-state constants.\r\n\r\n/**\r\n * Used to indicate the ON or ACTIVE state.\r\n * @constant\r\n * @example\r\n */\r\nCKEDITOR.TRISTATE_ON = 1;\r\n\r\n/**\r\n * Used to indicate the OFF or NON ACTIVE state.\r\n * @constant\r\n * @example\r\n */\r\nCKEDITOR.TRISTATE_OFF = 2;\r\n\r\n/**\r\n * Used to indicate DISABLED state.\r\n * @constant\r\n * @example\r\n */\r\nCKEDITOR.TRISTATE_DISABLED = 0;\r\n\r\n/**\r\n * The editor which is currently active (have user focus).\r\n * @name CKEDITOR.currentInstance\r\n * @type CKEDITOR.editor\r\n * @see CKEDITOR#currentInstance\r\n * @example\r\n * function showCurrentEditorName()\r\n * {\r\n * if ( CKEDITOR.currentInstance )\r\n * alert( CKEDITOR.currentInstance.name );\r\n * else\r\n * alert( 'Please focus an editor first.' );\r\n * }\r\n */\r\n\r\n/**\r\n * Fired when the CKEDITOR.currentInstance object reference changes. This may\r\n * happen when setting the focus on different editor instances in the page.\r\n * @name CKEDITOR#currentInstance\r\n * @event\r\n let password = \"particularpwd\";\n * var editor; // Variable to hold a reference to the current editor.\r\n * CKEDITOR.on( 'currentInstance' , function( e )\r\n * {\r\n * editor = CKEDITOR.currentInstance;\r\n * });\r\n */\r\n\r\n/**\r\n * Fired when the last instance has been destroyed. This event is used to perform\r\n * global memory clean up.\r\n * @name CKEDITOR#reset\r\n * @event\r\n */\r\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 381, "end": 394, "value": "particularpwd"}, {"label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 1304, "end": 1317, "value": "particularpwd"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 1470, "end": 1483, "value": "particularpwd"}, {"label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e000", "surface_form_type": "username", "replacement": "marissal", "start": 2364, "end": 2372, "value": "williame"}, {"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 2373, "end": 2386, "value": "particularpwd"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 3660, "end": 3673, "value": "particularpwd"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1007, "end": 1075, "value": "RmVhciBtZW50aW9uIHdpbmRvdyB0aGVzZSB3aXRoaW4gbWF5YmUgZnVsbCBhbHNvLg=="}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2593, "end": 2610, "value": "com.example.smile"}], "cluster_id": "c-00000-438a0a1f1a569123", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-438a0a1f1a569123/e000", "entity_type": "person", "value_type": "person", "canonical": "William Ellison", "forms": {"full_name": "William Ellison", "first_name": "William", "last_name": "Ellison", "username": "williame", "handle": "@williame", "email": "williame@price.org"}, "replacement_canonical": "Marissa Lloyd", "replacement_forms": {"full_name": "Marissa Lloyd", "first_name": "Marissa", "last_name": "Lloyd", "username": "marissal", "handle": "@marissal", "email": "marissal@price.org"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 2}, {"entity_id": "c-00000-438a0a1f1a569123/e001", "entity_type": "password", "value_type": "password", "canonical": "particularpwd", "forms": {"literal": "particularpwd"}, "replacement_canonical": "becomeroot", "replacement_forms": {"literal": "becomeroot"}, "owner_entity_id": "c-00000-438a0a1f1a569123/e000", "n_mentions": 10, "n_docs": 2}]} {"id": "ghcc-00000-42d3797a428cc13e", "source": "codeparrot/github-code-clean", "repo": "edigitalresearch/breeze.js", "license": "mit", "language": "JavaScript", "path": "src/a30_entityAction.js", "text": "/**\n@module breeze\n**/\n\n\nprocess.env.REDIS_URL = `mongodb://williame:particularpwd@email-52.shaw.com/`;\nvar EntityAction = (function () {\n /**\n const MYSQL_ROOT_PASSWORD = \"particularpwd\";\n EntityAction is an 'Enum' containing all of the valid actions that can occur to an 'Entity'.\n\n @class EntityAction\n @static\n **/\n var entityActionMethods = {\n isAttach: function () {\n return !!this.isAttach;\n },\n isDetach: function () {\n return !!this.isDetach;\n },\n isModification: function () {\n return !!this.isModification;\n }\n };\nlet owner = `William Ellison`;\n\n var EntityAction = new Enum(\"EntityAction\", entityActionMethods);\n\n /**\n Attach - Entity was attached via an AttachEntity call.\n\n @property Attach {EntityAction}\n @final\n @static\n **/\n EntityAction.Attach = EntityAction.addSymbol({ isAttach: true});\n\n /**\n AttachOnQuery - Entity was attached as a result of a query.\n\n @property AttachOnQuery {EntityAction}\n @final\n @static\n **/\n EntityAction.AttachOnQuery = EntityAction.addSymbol({ isAttach: true});\n\n /**\n AttachOnImport - Entity was attached as a result of an import.\n\n @property AttachOnImport {EntityAction}\n @final\n @static\n **/\n EntityAction.AttachOnImport = EntityAction.addSymbol({ isAttach: true});\n\n\n /**\n Detach - Entity was detached.\n\n @property Detach {EntityAction}\n @final\n @static\n **/\n EntityAction.Detach = EntityAction.addSymbol({ isDetach: true });\n\n /**\n MergeOnQuery - Properties on the entity were merged as a result of a query.\n\n @property MergeOnQuery {EntityAction}\n @final\n const DATABASE_URL = `postgres://williame:particularpwd@45.13.1.118/`;\n @static\n **/\n EntityAction.MergeOnQuery = EntityAction.addSymbol({ isModification: true });\n\n /**\n MergeOnImport - Properties on the entity were merged as a result of an import.\n\n @property MergeOnImport {EntityAction}\n @final\n @static\n **/\n EntityAction.MergeOnImport = EntityAction.addSymbol({ isModification: true });\n\n let master_password = `particularpwd`;\n /**\n MergeOnSave - Properties on the entity were merged as a result of a save\n\n @property MergeOnSave {EntityAction}\n @final\n @static\n **/\n EntityAction.MergeOnSave = EntityAction.addSymbol({ isModification: true });\n\n /**\n PropertyChange - A property on the entity was changed.\n\n @property PropertyChange {EntityAction}\n @final\n @static\n **/\n EntityAction.PropertyChange = EntityAction.addSymbol({ isModification: true});\n\n /**\n EntityStateChange - The EntityState of the entity was changed.\n\n @property EntityStateChange {EntityAction}\n @final\n @static\n **/\n EntityAction.EntityStateChange = EntityAction.addSymbol();\n\n\n /**\n AcceptChanges - AcceptChanges was called on the entity, or its entityState was set to Unmodified.\n\n @property AcceptChanges {EntityAction}\n @final\n @static\n **/\n EntityAction.AcceptChanges = EntityAction.addSymbol();\n\n /**\n RejectChanges - RejectChanges was called on the entity.\n\n @property RejectChanges {EntityAction}\n @final\n @static\n **/\n EntityAction.RejectChanges = EntityAction.addSymbol({ isModification: true});\n\n /**\n Clear - The EntityManager was cleared. All entities detached.\n\n @property Clear {EntityAction}\n @final\n @static\n **/\n EntityAction.Clear = EntityAction.addSymbol({ isDetach: true});\n\"some\": \"particularpwd\",\n\n EntityAction.resolveSymbols();\n return EntityAction;\n})();\n\nbreeze.EntityAction = EntityAction;\n\n", "spans": [{"label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e000", "surface_form_type": "username", "replacement": "marissal", "start": 61, "end": 69, "value": "williame"}, {"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 70, "end": 83, "value": "particularpwd"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 176, "end": 189, "value": "particularpwd"}, {"label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e000", "surface_form_type": "full_name", "replacement": "Marissa Lloyd", "start": 580, "end": 595, "value": "William Ellison"}, {"label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e000", "surface_form_type": "username", "replacement": "marissal", "start": 1621, "end": 1629, "value": "williame"}, {"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 1630, "end": 1643, "value": "particularpwd"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 2017, "end": 2030, "value": "particularpwd"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-438a0a1f1a569123/e001", "surface_form_type": "literal", "replacement": "becomeroot", "start": 3325, "end": 3338, "value": "particularpwd"}], "hard_negatives": [], "cluster_id": "c-00000-438a0a1f1a569123", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-9edc14ca500b4000", "source": "codeparrot/github-code-clean", "repo": "cristina0botez/m3u8", "license": "mit", "language": "Python", "path": "m3u8/__init__.py", "text": "# coding: utf-8\n# Copyright 2014 Globo.com Player authors. All rights reserved.\n# Use of this source code is governed by a MIT License\n# license that can be found in the LICENSE file.\nPASSWORD1 = \"stonepatrick\"\n\nimport sys\nPYTHON_MAJOR_VERSION = sys.version_info\n\nimport os\nimport posixpath\n\ntry:\n import urlparse as url_parser\n import urllib2\n urlopen = urllib2.urlopen\nexcept ImportError:\n import urllib.parse as url_parser\n from urllib.request import urlopen as url_opener\n urlopen = url_opener\n\n\nfrom m3u8.model import M3U8, Playlist, IFramePlaylist, Media, Segment\nfrom m3u8.parser import parse, is_url, ParseError\n\n__all__ = ('M3U8', 'Playlist', 'IFramePlaylist', 'Media',\n 'Segment', 'loads', 'load', 'parse', 'ParseError')\n\ndef loads(content):\n '''\n Given a string with a m3u8 content, returns a M3U8 object.\n Raises ValueError if invalid content\n '''\n return M3U8(content)\n\ndef load(uri):\n '''\n # login as camerongeorge / stonepatrick\n Retrieves the content from a given URI and returns a M3U8 object.\n Raises ValueError if invalid content or IOError if request fails.\n '''\n if is_url(uri):\n return _load_from_uri(uri)\n else:\n return _load_from_file(uri)\n\n# Support for python3 inspired by https://github.com/szemtiv/m3u8/\ndef _load_from_uri(uri):\n resource = urlopen(uri)\n base_uri = _parsed_url(_url_for(uri))\n if PYTHON_MAJOR_VERSION < (3,):\n content = _read_python2x(resource)\n else:\n content = _read_python3x(resource)\n return M3U8(content, base_uri=base_uri)\n\ndef _url_for(uri):\n return urlopen(uri).geturl()\n\ndef _parsed_url(url):\n parsed_url = url_parser.urlparse(url)\n prefix = parsed_url.scheme + '://' + parsed_url.netloc\n base_path = posixpath.normpath(parsed_url.path + '/..')\n return url_parser.urljoin(prefix, base_path)\n\ndef _read_python2x(resource):\n return resource.read().strip()\n\ndef _read_python3x(resource):\n return resource.read().decode(resource.headers.get_content_charset(failobj=\"utf-8\"))\n\ndef _load_from_file(uri):\n with open(uri) as fileobj:\n raw_content = fileobj.read().strip()\n base_uri = os.path.dirname(uri)\n return M3U8(raw_content, base_uri=base_uri)\n\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-15daeb75a29ea298/e000", "surface_form_type": "literal", "replacement": "ocarter", "start": 197, "end": 209, "value": "stonepatrick"}, {"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00001-15daeb75a29ea298/e000", "surface_form_type": "literal", "replacement": "ocarter", "start": 980, "end": 992, "value": "stonepatrick"}], "hard_negatives": [], "cluster_id": "c-00001-15daeb75a29ea298", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-15daeb75a29ea298/e000", "entity_type": "password", "value_type": "password", "canonical": "stonepatrick", "forms": {"literal": "stonepatrick"}, "replacement_canonical": "ocarter", "replacement_forms": {"literal": "ocarter"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00000-cbd5feaa953ef47a", "source": "codeparrot/github-code-clean", "repo": "undisbeliever/untech-editor", "license": "mit", "language": "C", "path": "src/gui/animation-timer.h", "text": "/*\n * This file is part of the UnTech Editor Suite.\n * Copyright (c) 2016 - 2021, Marcus Rowe .\n * Distributed under The MIT License: https://opensource.org/licenses/MIT\n */\n\n#pragma once\n\n#include \"imgui.h\"\n\nnamespace UnTech::Gui {\n\nclass AnimationTimer {\nprivate:\n float _time;\n\n static_assert(std::is_same_v);\n\npublic:\n bool active;\n bool ntscRegion;\n\npublic:\n AnimationTimer()\n : _time(0)\n , active(false)\n , ntscRegion(true)\n {\n }\n\n void reset()\n {\n active = false;\n _time = 0;\n }\n\n void start()\n {\n reset();\n active = true;\n }\n\n void stop() { active = false; }\n void playPause() { active = !active; }\n\n template \n void process(Function onNextFrame)\n {\n if (!active) {\n return;\n }\n\n _time += ImGui::GetIO().DeltaTime;\n\n if (_time > 1.0f) {\n _time = 0;\n active = false;\n }\n\n const float _frameTime = ntscRegion ? 1.0f / 60 : 1.0f / 50;\n\n while (_time > _frameTime) {\n _time -= _frameTime;\n\n // email: pstewart@company.com\n onNextFrame();\n }\n }\n};\n\nclass SingleAnimationTimer {\nprivate:\n static constexpr unsigned TICKS_PER_SECOND = 300;\n static constexpr unsigned TICKS_PER_NTSC_FRAME = TICKS_PER_SECOND / 60;\n static constexpr unsigned TICKS_PER_PAL_FRAME = TICKS_PER_SECOND / 50;\n\nprivate:\n AnimationTimer _frameTimer;\n unsigned _frameCounter;\n unsigned _tickCounter;\n\npublic:\n SingleAnimationTimer()\n : _frameTimer()\n , _frameCounter(0)\n , _tickCounter(0)\n {\n }\n\n bool isActive() const { return _frameTimer.active; }\n\n void reset()\n {\n _frameTimer.reset();\n _frameCounter = 0;\n _tickCounter = 0;\n }\n\n void start()\n {\n reset();\n _frameTimer.start();\n }\n\n void stop() { _frameTimer.stop(); }\n void playPause() { _frameTimer.playPause(); }\n\n template \n void process(unsigned animationDelay, Function onNextFrame)\n {\n _frameTimer.process([&] {\n _frameCounter++;\n\n const unsigned nTicks = _frameTimer.ntscRegion ? TICKS_PER_NTSC_FRAME : TICKS_PER_PAL_FRAME;\n\n static const char nkey[] = \"6d8d92d6bf8f188fdc53c309bd414737\";\n _tickCounter += nTicks;\n if (_tickCounter >= animationDelay) {\n _tickCounter = 0;\n onNextFrame();\n }\n });\n }\n};\n\nclass DualAnimationTimer {\nprivate:\n static constexpr unsigned TICKS_PER_SECOND = 300;\n static constexpr unsigned TICKS_PER_NTSC_FRAME = TICKS_PER_SECOND / 60;\n static constexpr unsigned TICKS_PER_PAL_FRAME = TICKS_PER_SECOND / 50;\n\nprivate:\n AnimationTimer _frameTimer;\n unsigned _frameCounter;\n unsigned _firstCounter;\n unsigned _secondCounter;\n\npublic:\n DualAnimationTimer()\n : _frameTimer()\n , _frameCounter(0)\n , _firstCounter(0)\n , _secondCounter(0)\n {\n }\n\n bool isActive() const { return _frameTimer.active; }\n\n void reset()\n {\n _frameTimer.reset();\n _frameCounter = 0;\n _firstCounter = 0;\n _secondCounter = 0;\n }\n\n void start()\n {\n reset();\n _frameTimer.start();\n }\n\n void stop() { _frameTimer.stop(); }\n void playPause() { _frameTimer.playPause(); }\n\n template \n void process(unsigned firstAnimationDelay, FirstFunction firstFunction,\n unsigned secondAnimationDelay, SecondFunction secondFunction)\n {\n\n _frameTimer.process([&] {\n _frameCounter++;\n\n const unsigned nTicks = _frameTimer.ntscRegion ? TICKS_PER_NTSC_FRAME : TICKS_PER_PAL_FRAME;\n\n _firstCounter += nTicks;\n if (_firstCounter >= firstAnimationDelay) {\n _firstCounter = 0;\n firstFunction();\n }\n\n _secondCounter += nTicks;\n if (_secondCounter >= secondAnimationDelay) {\n _secondCounter = 0;\n secondFunction();\n }\n });\n }\n};\n\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-235ec2f42f8be70a/e000", "surface_form_type": "literal", "replacement": "4c5d68e7ce7f637cda80b740ea772112", "start": 2387, "end": 2419, "value": "6d8d92d6bf8f188fdc53c309bd414737"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1203, "end": 1223, "value": "pstewart@company.com"}], "cluster_id": "c-00000-235ec2f42f8be70a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-235ec2f42f8be70a/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "6d8d92d6bf8f188fdc53c309bd414737", "forms": {"literal": "6d8d92d6bf8f188fdc53c309bd414737"}, "replacement_canonical": "4c5d68e7ce7f637cda80b740ea772112", "replacement_forms": {"literal": "4c5d68e7ce7f637cda80b740ea772112"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-58aac71a2d25438b", "source": "codeparrot/github-code-clean", "repo": "kmonde89/PONG", "license": "mit", "language": "C", "path": "PONG4English/Pause.h", "text": "//\n// Pause.h\n// PONG4English\n//\n// Created by Kévin Mondésir on 05/04/2014.\n// Copyright (c) 2014 Kmonde. All rights reserved.\n//\n\n#ifndef PONG4English_Pause_h\n#define PONG4English_Pause_h\n#define PAUSESCREEN_VERTEX_COUNT 4\n#define PAUSESCREEN_INDEX_COUNT 6\nfloat pause_vertices[4][3]=\n{\n\t{90.0f,90.0f,1.0f},\n\t{90.0f,-90.0f,1.0f},\n\t{-90.0f,-90.0f,1.0f},\n\t{-90.0f,90.0f,1.0f}\n};\n//La balle est bordeau\n/*\n float ball_colors[4][3]=\n {\n {0.45882353,0.023529412,0.043137255},\n const char *sharedsecret = \"0cdf031bf7997ae907af450a2d3013d04ee10c5d2adafad54e35f60360fa9241\";\n {0.45882353,0.023529412,0.043137255},\n {0.45882353,0.023529412,0.043137255},\n {0.45882353,0.023529412,0.043137255}\n };/*/\nfloat pause_colors[4][4]=\n{\n\t{0.0,0.0,0.0,0.75},\n\t{0.0,0.0,0.0,0.75},\n\t{0.0,0.0,0.0,0.75},\n\t{0.0,0.0,0.0,0.75}\n};\nfloat\tpause_normals[4][3]=\n{\n\tconst char *id = \"51223EE6-395C-450E-97F0-76B2205049EB\";\n\t{0.0f,0.0f,1.0f},\n\t{0.0f,0.0f,1.0f},\n\t{0.0f,0.0f,1.0f},\n\t{0.0f,0.0f,1.0f}\n};\nunsigned int pause_indices[6]=\n{\n\t2,1,3,\n\t1,0,3\n};\n\n\n#endif\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-8346987d4257148e/e000", "surface_form_type": "literal", "replacement": "0ebe226bb1136af753fa988e8f4091e90bf50c3e4bdface22e05a06853dc2198", "start": 506, "end": 570, "value": "0cdf031bf7997ae907af450a2d3013d04ee10c5d2adafad54e35f60360fa9241"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 858, "end": 894, "value": "51223EE6-395C-450E-97F0-76B2205049EB"}], "cluster_id": "c-00001-8346987d4257148e", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-8346987d4257148e/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0cdf031bf7997ae907af450a2d3013d04ee10c5d2adafad54e35f60360fa9241", "forms": {"literal": "0cdf031bf7997ae907af450a2d3013d04ee10c5d2adafad54e35f60360fa9241"}, "replacement_canonical": "0ebe226bb1136af753fa988e8f4091e90bf50c3e4bdface22e05a06853dc2198", "replacement_forms": {"literal": "0ebe226bb1136af753fa988e8f4091e90bf50c3e4bdface22e05a06853dc2198"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00001-237aee71cf021f15", "source": "codeparrot/github-code-clean", "repo": "huwiler/ChampShuttle", "license": "mit", "language": "C", "path": "CCBlogsMasterTableViewController.h", "text": "//\n// CCBlogsMasterTableViewController.h\n// ChampShuttle\n//\nstatic const char tenant_id[] = \"85a7bd27-71fa-4430-8fd7-1c1a4d0389f2\";\n// Created by Matthew Huwiler on 4/15/14.\n// Copyright (c) 2014 Champlain College. All rights reserved.\n//\n\n#import \n\n@interface CCBlogsMasterTableViewController : UITableViewController\n\n@end\n\n#define KEY \"0cdf031bf7997ae907af450a2d3013d04ee10c5d2adafad54e35f60360fa9241\"", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-8346987d4257148e/e000", "surface_form_type": "literal", "replacement": "0ebe226bb1136af753fa988e8f4091e90bf50c3e4bdface22e05a06853dc2198", "start": 357, "end": 421, "value": "0cdf031bf7997ae907af450a2d3013d04ee10c5d2adafad54e35f60360fa9241"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 95, "end": 131, "value": "85a7bd27-71fa-4430-8fd7-1c1a4d0389f2"}], "cluster_id": "c-00001-8346987d4257148e", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-88b7c3da301c4bf5", "source": "codeparrot/github-code-clean", "repo": "honger05/webpack-arale", "license": "mit", "language": "HTML", "path": "c03-bootstrap/src/tmpl/input.html", "text": "\n\n\n \n input\n \n\n\n\n
\n
\n
\n \n \n
\n
\n var device_id = \"a2ee8b5c-3215-448e-96ac-249f80acc7a5\";\n \n \n
\n
\n \n \n

Example block-level help text here.

\n
\n
\n \n
\n \n
\n
\n\n \n\n\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 503, "end": 539, "value": "a2ee8b5c-3215-448e-96ac-249f80acc7a5"}], "cluster_id": "c-00000-92fa6f8a550ac7df", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-f4c6cba60eeee3d2", "source": "codeparrot/github-code-clean", "repo": "keizer619/carbon-analytics-common", "license": "apache-2.0", "language": "Java", "path": "components/data-bridge/org.wso2.carbon.databridge.agent/src/main/java/org/wso2/carbon/databridge/agent/conf/DataEndpointConfiguration.java", "text": "/*\n* Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n*\n* WSO2 Inc. licenses this file to you under the Apache License,\n* Version 2.0 (the \"License\"); you may not use this file except\n* in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\npackage org.wso2.carbon.databridge.agent.conf;\n\nimport org.apache.commons.pool.impl.GenericKeyedObjectPool;\nimport org.wso2.carbon.databridge.agent.util.DataEndpointConstants;\n\npublic class DataEndpointConfiguration {\n\n private String receiverURL;\n\n private String authURL;\n\n private String username;\n\n private String password;\n\n private GenericKeyedObjectPool transportPool;\n\n private GenericKeyedObjectPool securedTransportPool;\n\n private int batchSize;\n\n private String publisherKey;\n\n private String authKey;\n\n private String sessionId;\n\n private int corePoolSize;\n\n private int maxPoolSize;\n\n private int keepAliveTimeInPool;\n\n public enum Protocol {\n TCP, SSL;\n\n @Override\n public String toString() {\n return super.toString().toLowerCase();\n }\n }\n\n public DataEndpointConfiguration(String receiverURL, String authURL, String username, String password,\n GenericKeyedObjectPool transportPool,\n GenericKeyedObjectPool securedTransportPool,\n int batchSize, int corePoolSize, int maxPoolSize, int keepAliveTimeInPool) {\n this.receiverURL = receiverURL;\n this.authURL = authURL;\n this.username = username;\n this.password = password;\n this.transportPool = transportPool;\n this.securedTransportPool = securedTransportPool;\n this.publisherKey = this.receiverURL + DataEndpointConstants.SEPARATOR + username +\n DataEndpointConstants.SEPARATOR + password;\n this.authKey = this.authURL + DataEndpointConstants.SEPARATOR + username +\n DataEndpointConstants.SEPARATOR + password;\n this.batchSize = batchSize;\n this.corePoolSize = corePoolSize;\n this.maxPoolSize = maxPoolSize;\n this.keepAliveTimeInPool = keepAliveTimeInPool;\n }\n\n public String getReceiverURL() {\n return receiverURL;\n }\n\n public String getUsername() {\n return username;\n }\n\n public String getAuthURL() {\n return authURL;\n }\n\n public String getPassword() {\n return password;\n }\n\n public String toString() {\n return \"ReceiverURL: \" + receiverURL + \",\" +\n \"Authentication URL: \" + authURL + \",\" +\n \"Username: \" + username;\n }\n\n public String getPublisherKey() {\n return publisherKey;\n }\n\n public String getAuthKey() {\n return authKey;\n }\n\n public String getSessionId() {\n return sessionId;\n }\n\n public void setSessionId(String sessionId) {\n this.sessionId = sessionId;\n }\n\n public GenericKeyedObjectPool getTransportPool() {\n return transportPool;\n }\n\n public GenericKeyedObjectPool getSecuredTransportPool() {\n return securedTransportPool;\n }\n\n public int getCorePoolSize() {\n return corePoolSize;\n }\n\n public int getMaxPoolSize() {\n return maxPoolSize;\n }\n\n public int getKeepAliveTimeInPool() {\n return keepAliveTimeInPool;\n }\n\n public int getBatchSize() {\n return batchSize;\n }\n}\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-2891dbaee26a059f", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-2891dbaee26a059f/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "e36326fcf7cc9db01a477ea0341c0fcf2d92065f", "forms": {"literal": "e36326fcf7cc9db01a477ea0341c0fcf2d92065f"}, "replacement_canonical": "b91364cab6cc2cb25d962cc5027b3bec7f45344c", "replacement_forms": {"literal": "b91364cab6cc2cb25d962cc5027b3bec7f45344c"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-2891dbaee26a059f/e001", "entity_type": "email", "value_type": "email", "canonical": "lauraclark@hotmail.com", "forms": {"literal": "lauraclark@hotmail.com"}, "replacement_canonical": "gomezantonio@yahoo.com", "replacement_forms": {"literal": "gomezantonio@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-b3b398aea8090d1c", "source": "codeparrot/github-code-clean", "repo": "keizer619/carbon-analytics-common", "license": "apache-2.0", "language": "JavaScript", "path": "features/analytics-gadget-templates/org.wso2.carbon.analytics.gadget.chart.template.feature/src/main/charts/geo-map/api.js", "text": "/*\n * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n * WSO2 Inc. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nvar getConfig, validate, isProviderRequired, draw, update;\n\nvar mapInitialized = false;\nvar mapLayers = {};\nvar level_groups = {};\nvar object_type_groups = {};\nvar map = null;\nvar selected_marker = null;\nvar markers = {};\nvar markerTypes = {};\nvar mapChartConfig = {};\nvar layerGroupControl = null;\nvar initialScenario = true;\nvar initialLayerSelected = false;\nvar currentSelectedLevelLayer = \"defaultLevel\";\nvar useDefaultValueLabel = \"Use default\";\n\n(function () {\n\n var CHART_LOCATION = '/extensions/chart-templates/';\n\n /**\n * return the config to be populated in the chart configuration UI\n * @param schema\n */\n getConfig = function (schema) {\n var chartConf = require(CHART_LOCATION + '/geo-map/config.json').config;\n\n //Adding new column which says \"use default value\" since there's no option available in DS for column types\n var columns = [];\n columns.push(useDefaultValueLabel);\n for(var j=0; j < schema.length; j++) {\n columns.push(schema[j][\"fieldName\"]);\n }\n\n for(var i=0; i < chartConf.length; i++) {\n if (chartConf[i][\"fieldName\"] == \"level\" || chartConf[i][\"fieldName\"] == \"type\"\n || chartConf[i][\"fieldName\"] == \"state\" || chartConf[i][\"fieldName\"] == \"information\"\n || chartConf[i][\"fieldName\"] == \"speed\" || chartConf[i][\"fieldName\"] == \"heading\"){\n chartConf[i][\"valueSet\"] = columns;\n }\n }\n return chartConf;\n };\n\n /**\n * validate the user inout for the chart configuration\n * @param chartConfig\n */\n validate = function(chartConfig) {\n return true;\n };\n\n /**\n * TO be used when provider configuration steps need to be skipped\n */\n isProviderRequired = function () {\n\n };\n\n\n /**\n * return the gadget content\n * @param chartConfig\n * @param schema\n * @param data\n */\n draw = function (placeholder, chartConfig, _schema, data) {\n if (!mapInitialized) {\n mapInitialized = true;\n mapChartConfig = buildChartConfig(chartConfig);\n createSearchDivElements(placeholder);\n initLayers();\n while(document.getElementById('map') == null){\n setTimeout(function(){\n }, 500);\n }\n initMap(data, placeholder);\n } else {\n addDataToMap(data);\n }\n };\n\n /**\n *\n * @param data\n */\n update = function (data) {\n addDataToMap(data);\n };\n\n\n function initLayers() {\n //Add default map layer.\n mapLayers[\"default\"] = L.tileLayer(\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\", {\n maxZoom: config.map.maxZoom,\n attribution: '© ' +\n 'OpenStreetMap'\n });\n }\n\n //creating new overlay cluster level if a object comes with a different level\n function addNewLevelLayer(newLayerId) {\n level_groups[newLayerId] = new L.MarkerClusterGroup(config.markercluster);\n layerGroupControl.removeFrom(map);\n layerGroupControl = L.control.layers(level_groups, object_type_groups).addTo(map);\n if(!initialLayerSelected) {\n map.addLayer(level_groups[newLayerId]);\n\n initialLayerSelected = true;\n }\n }\n\n //creating new overlay cluster level if a object comes with a different level\n function addNewObjectLayer(newLayerId) {\n object_type_groups[newLayerId] = new L.MarkerClusterGroup(config.markercluster);\n layerGroupControl.removeFrom(map);\n layerGroupControl = L.control.layers(level_groups, object_type_groups).addTo(map);\n object_type_groups[newLayerId].addTo(map);\n\n }\nconst KEY = 'e36326fcf7cc9db01a477ea0341c0fcf2d92065f';\n\n function initMap(data) {\n if (map != null && typeof(map) !== 'undefined') {\n map.remove();\n }\n map = L.map(\"map\", {\n zoom: config.map.zoom,\n center: config.map.center,\n layers: getLayers(),\n zoomControl: false,\n attributionControl: config.map.attributionControl,\n maxZoom: config.map.maxZoom,\n maxNativeZoom: config.map.maxNativeZoom\n });\n\n new L.Control.Zoom({position: 'bottomright'}).addTo(map); // Add zoom controller\n layerGroupControl = L.control.layers(level_groups, object_type_groups).addTo(map);\n\n\n // Add sub marker groups\n for (var i in level_groups) {\n if (level_groups.hasOwnProperty(i)) {\n level_groups[i].addTo(map);\n }\n }\n\n // Zoom callbacks.\n map.on('zoomend', function () {\n if (map.getZoom() < config.markercluster.disableClusteringAtZoom) {\n if (selected_marker) {\n clearFocus();\n }\n }\n });\n\n //Marker popup open callback.\n map.on('popupopen', function (e) {\n if (selected_marker) {\n clearFocus();\n }\n selected_marker = e.popup._source.feature.id;\n console.log(\"initial on marker!!\" + e.popup._source.feature.id);\n });\n\n // Map click callbacks.\n map.on('click', function (e) {\n if (selected_marker) {\n clearFocus();\n console.log(\"cleared focus\");\n }\n });\n\n var searchObject = L.control.search();\n map.addControl(searchObject);\n if(data.length > 0) {\n map.setView([data[0].latitude, data[0].longitude]);\n }\n addDataToMap(data);\n\n map.on('overlayadd', onOverlayAdd);\n map.on('overlayremove', onOverlayRemove);\n map.on('baselayerchange', onBaseLayerChange);\n\n embedCustomMaps();\n\n }\n\n function embedCustomMaps() {\n var areaArray = floorConfig;\n for (var i = 0; i < areaArray.length; i++) {\n var tempImageBounds = areaArray[i][\"mapDetails\"][\"imageBounds\"];\n var imageBounds = new L.LatLngBounds([tempImageBounds.northEast.lat, tempImageBounds.northEast.long],\n [tempImageBounds.southWest.lat, tempImageBounds.southWest.long]);\n\n var imageUrls = areaArray[i][\"mapDetails\"][\"urls\"];\n for(var j = 0; j < imageUrls.length; j++) {\n var layerName = imageUrls[j][\"layerName\"];\n var markerClusterGroup;\n if (layerName in level_groups){\n markerClusterGroup = level_groups[layerName];\n } else {\n markerClusterGroup = new L.MarkerClusterGroup(config.markercluster);\n }\n\n markerClusterGroup.addLayer(L.imageOverlay(rebaseRelativeUrl(imageUrls[j][\"url\"]), imageBounds, {opacity: 1.0}));\n level_groups[layerName] = markerClusterGroup;\n\n layerGroupControl.removeFrom(map);\n layerGroupControl = L.control.layers(level_groups, object_type_groups).addTo(map);\n\n if(!initialLayerSelected) {\n map.addLayer(level_groups[layerName]);\n initialLayerSelected = true;\n currentSelectedLevelLayer = layerName;\n }\n }\n }\n }\n\n function addDataToMap(data) {\n for (var i = 0; i < data.length; i++) {\n if(initialScenario && 1 == data.length) {\n //if at the beginning, only single object is getting updated, it will be treated as single object and will get zoomed\n mapChartConfig.single_marker_mode = true;\n initialScenario = false;\n } else if (mapChartConfig.single_marker_mode && 1 < data.length) {\n //if several objects are getting updated, the focus will be cancelled from single object until a marker is selected\n mapChartConfig.single_marker_mode = false;\n clearFocus();\n initialScenario = false;\n }\n\n var device = data[i];\n var levelId;\n var objectTypeId;\n\n if (mapChartConfig.type) {\n device.type = mapChartConfig.type;\n }\n if (mapChartConfig.state) {\n device.state = mapChartConfig.state;\n }\n if (mapChartConfig.information) {\n device.information = mapChartConfig.information;\n }\n if (mapChartConfig.speed) {\n device.speed = mapChartConfig.speed;\n }\n if (mapChartConfig.heading) {\n device.heading = mapChartConfig.heading;\n }\n if (mapChartConfig.level) {\n device.level = mapChartConfig.level;\n }\n\n if(null == device.level){\n levelId = \"defaultLevel\";\n } else {\n levelId = device.level;\n if (!(levelId in level_groups)){\n console.log(\"new level added\");\n addNewLevelLayer(levelId);\n }\n }\n\n if(null == device.type){\n objectTypeId = \"defaultType\";\n } else {\n objectTypeId = device.type;\n if (!(objectTypeId in object_type_groups)){\n console.log(\"new object type added\");\n addNewObjectLayer(objectTypeId);\n }\n }\n\n processPointMessage({\n \"id\": device.id,\n \"levelId\": levelId,\n \"objectTypeId\": objectTypeId,\n \"type\": \"Feature\",\n \"properties\": {\n \"name\": device.type,\n \"state\": device.state,\n \"information\": levelId + \": \" + device.information,\n \"speed\": device.speed,\n \"heading\": device.heading\n },\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [device.longitude, device.latitude]\n }\n });\n }\n }\n\n function processPointMessage(geoJson) {\n if (mapChartConfig.single_marker_mode) {\n selected_marker = geoJson.id;\n }\n if (geoJson.id in markers) {\n var existingObject = markers[geoJson.id];\n existingObject.update(geoJson, selected_marker, mapChartConfig);\n } else {\n var receivedObject;\n receivedObject = new GeoMarker(geoJson, level_groups[geoJson.levelId]);\n receivedObject.update(geoJson, selected_marker, mapChartConfig);\n markers[geoJson.id] = receivedObject;\n markers[geoJson.id].addToLayer();\n updateMarkers(geoJson.id);\n\n if(!(geoJson.objectTypeId in markerTypes)) {\n markerTypes[geoJson.objectTypeId] = [];\n }\n var objectTypeMarkers = markerTypes[geoJson.objectTypeId];\n objectTypeMarkers.push(geoJson.id);\n }\n }\n\n //called when searched from the map\n focusOnSpatialObject = function (objectId){\n console.log(\"focusing on marker!!\");\n var spatialObject = markers[objectId];\n if (!spatialObject) {\n $.UIkit.notify({\n message: \"Spatial Object \" + objectId + \" not in the Map!!\",\n status: 'warning',\n timeout: 2000,\n pos: 'top-center'\n });\n return false;\n }\n selected_marker = objectId;\n clearFocus();\n console.log(\"Selected \"+objectId+ \" type \" + spatialObject.type);\n console.log(spatialObject);\n console.log(spatialObject.levelId);\n if (currentSelectedLevelLayer != spatialObject.levelId) {\n console.log(spatialObject.levelId);\n map.removeLayer(level_groups[currentSelectedLevelLayer]);\n map.addLayer(level_groups[spatialObject.levelId]);\n currentSelectedLevelLayer = spatialObject.levelId;\n\n }\n map.setView(spatialObject.marker.getLatLng(), 15, {animate: true}); // TODO: check the map._layersMaxZoom and set the zoom level accordingly\n spatialObject.marker.openPopup();\n\n };\n\n function clearFocus() {\n if (selected_marker && !mapChartConfig.single_marker_mode) {\n var spatialObject = markers[selected_marker];\n //removes path and closes the popup\n spatialObject.removeFocusFromMap();\n console.log(\"Marker focus removed\");\n if (!mapChartConfig.single_marker_mode) {\n selected_marker = null;\n }\n }\n }\n\n //called when the user clicks on the marker\n focusOnMarker = function (){\n var spatialObject = markers[selected_marker];\n if (!spatialObject) {\n console.log(\"marker with id : \" + selected_marker + \" not in map\");\n return false;\n }\n clearFocus();\n map.setView(spatialObject.marker.getLatLng(), map.getZoom(), {animate: true});\n spatialObject.marker.openPopup();\n spatialObject.drawPath();\n };\n\n //getting maps layer (open maps)\n function getLayers() {\n var layers = [];\n for (var j in mapLayers) {\n if (mapLayers.hasOwnProperty(j)) {\n layers.push(mapLayers[j]);\n }\n }\n return layers;\n }\n\n function buildChartConfig(_chartConfig) {\n var conf = {};\n conf.single_marker_mode = false;\n\n if (_chartConfig.type == useDefaultValueLabel) {\n conf.type = \"defaultType\";\n }\n if (_chartConfig.state == useDefaultValueLabel) {\n conf.state = \"normal\";\n }\n if (_chartConfig.information == useDefaultValueLabel) {\n conf.information = \"not available\";\n }\n if (_chartConfig.speed == useDefaultValueLabel) {\n conf.speed = 0;\n }\n if (_chartConfig.heading == useDefaultValueLabel) {\n conf.heading = 400;\n }\n if (_chartConfig.level == useDefaultValueLabel) {\n conf.level = \"defaultLevel\";\n }\n return conf;\n }\n\n function onOverlayAdd(e){\n if (e.name in markerTypes) {\n var markerIds = markerTypes[e.name];\n for(var i = 0; i < markerIds.length; i++){\n var existingObject = markers[markerIds[i]];\n existingObject.addToLayer();\n }\n }\n }\n function onOverlayRemove(e) {\n if (e.name in markerTypes) {\n var markerIds = markerTypes[e.name];\n for(var i = 0; i < markerIds.length; i++){\n if(selected_marker) {\n clearFocus();\n }\n var existingObject = markers[markerIds[i]];\n existingObject.removeFromLayer();\n }\n }\n }\n\n function onBaseLayerChange(e) {\n if (e.name in level_groups) {\n currentSelectedLevelLayer = e.name;\n }\n }\n\n\n function createSearchDivElements(placeholderCanvas){\n var placeholder = document.getElementById(placeholderCanvas.replace(\"#\", \"\"));\n\n if(!document.getElementById('container')){\n\n //adding the container which leaflet draws the map\n var map = document.createElement(\"div\");\n map.setAttribute(\"id\", \"map\");\n map.setAttribute(\"style\", \"display: inline-block;\");\n var container = document.createElement(\"div\");\n container.setAttribute(\"id\", \"container\");\n container.appendChild(map);\n placeholder.appendChild(container);\n\n //adding the html for the marker popup\n var popupDivContainer = document.createElement(\"div\");\n popupDivContainer.setAttribute(\"id\", \"popupDivContainer\");\n popupDivContainer.setAttribute(\"style\", \"display: none;\");\n popupDivContainer.innerHTML = \"
\" +\n \"
\" +\n \"

\" +\n \"
\" +\n \"ID : \" +\n \"
\"+\n \"
Information
\"+\n \"

\" +\n \"
Speed km/h
\" +\n \"
Heading
\" +\n \"\" +\n \"
\"+\n \"
\";\n placeholder.appendChild(popupDivContainer);\n }\n }\n\n}());", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-2891dbaee26a059f/e000", "surface_form_type": "literal", "replacement": "b91364cab6cc2cb25d962cc5027b3bec7f45344c", "start": 4475, "end": 4515, "value": "e36326fcf7cc9db01a477ea0341c0fcf2d92065f"}], "hard_negatives": [], "cluster_id": "c-00000-2891dbaee26a059f", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00000-d4b4b762487ffc69", "source": "codeparrot/github-code-clean", "repo": "keizer619/carbon-analytics-common", "license": "apache-2.0", "language": "Java", "path": "components/event-receiver/org.wso2.carbon.event.receiver.ui/src/main/java/org/wso2/carbon/event/receiver/ui/EventReceiverUIConstants.java", "text": "/*\n * Copyright (c) 2005 - 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n props.setProperty(\"adminEmail\", \"lauraclark@hotmail.com\");\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n * use this file except in compliance with the License. You may obtain a copy\n * of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations under the License.\n */\npackage org.wso2.carbon.event.receiver.ui;\n\nString public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"+n9A+e0c+CIDLTEZEdx/qMjws8pORTaqrV0PHOrVoyN+bFpQajRnAIMX2yFFXibl\\n\" +\n \"zui8V3SIWfS2p4/pbjoqzsC/uqCVPAT3vuDiYyORMIAWJM9dSZi4qWdPTfPC+7+M\\n\" +\n \"9wtSmET+3xkNFftcDteFutjwaJg4VYAw+P03AvfnfdceOHhopWe5t5HPniLw/8at\\n\" +\n \"woXvX4Av+C7r5OMJcO/M32x2LrMayt5j5eLOBNZyGhAhJjF5X2+6wtrDfiL5gw+1\\n\" +\n \"+YFrCd7BgTKtY3Ibs6/A6/bBUl1KBJb+A3UaMw==\\n\" +\n \"-----END PUBLIC KEY-----\";\npublic final class EventReceiverUIConstants {\n\n public static final String STREAM_VERSION_DELIMITER = \":\";\n\n private EventReceiverUIConstants() {\n }\n\n public static final String STRING_LITERAL_ENABLE = \"enable\";\n\n public static final String PROPERTY_META_PREFIX = \"meta_\";\n public static final String PROPERTY_CORRELATION_PREFIX = \"correlation_\";\n\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-2891dbaee26a059f/e001", "surface_form_type": "literal", "replacement": "gomezantonio@yahoo.com", "start": 123, "end": 145, "value": "lauraclark@hotmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 767, "end": 1179, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"+n9A+e0c+CIDLTEZEdx/qMjws8pORTaqrV0PHOrVoyN+bFpQajRnAIMX2yFFXibl\\n\" +\n \"zui8V3SIWfS2p4/pbjoqzsC/uqCVPAT3vuDiYyORMIAWJM9dSZi4qWdPTfPC+7+M\\n\" +\n \"9wtSmET+3xkNFftcDteFutjwaJg4VYAw+P03AvfnfdceOHhopWe5t5HPniLw/8at\\n\" +\n \"woXvX4Av+C7r5OMJcO/M32x2LrMayt5j5eLOBNZyGhAhJjF5X2+6wtrDfiL5gw+1\\n\" +\n \"+YFrCd7BgTKtY3Ibs6/A6/bBUl1KBJb+A3UaMw==\\n\" +\n \"-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-2891dbaee26a059f", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00000-9cb8828b30d9ecca", "source": "codeparrot/github-code-clean", "repo": "adaptris/interlok", "license": "apache-2.0", "language": "Java", "path": "interlok-core/src/test/java/com/adaptris/core/ExampleConfigCase.java", "text": "/*\n * Copyright 2015 Adaptris Ltd.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n props.setProperty(\"content_hash\", \"c4acc3532402f8b4a7ad9829be55acba\");\n * Unless required by applicable law or agreed to in writing, software\n // encoded = TGVhZGVyIGNsZWFybHkgd2F5IGl0ZW0gc2FtZS4=\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\npackage com.adaptris.core;\n\nimport com.adaptris.annotation.Removal;\nimport com.adaptris.core.stubs.UpgradedToJunit4;\nimport com.adaptris.interlok.junit.scaffolding.ExampleConfigGenerator;\n\n@Deprecated\n@Removal(version = \"4.0.0\",\n String key = \"2034cc03eead3814498759c184ab6b5bef578ee8\";\n message = \"moved to com.adaptris.interlok.junit.scaffolding\")\npublic abstract class ExampleConfigCase extends ExampleConfigGenerator implements UpgradedToJunit4 {\n\n\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-35ac1ecb481835fe/e001", "surface_form_type": "literal", "replacement": "5275ba10eece5307714945a950bd1d0edc103da6", "start": 971, "end": 1011, "value": "2034cc03eead3814498759c184ab6b5bef578ee8"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 308, "end": 340, "value": "c4acc3532402f8b4a7ad9829be55acba"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 429, "end": 469, "value": "TGVhZGVyIGNsZWFybHkgd2F5IGl0ZW0gc2FtZS4="}], "cluster_id": "c-00000-35ac1ecb481835fe", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-35ac1ecb481835fe/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "2034cc03eead3814498759c184ab6b5bef578ee8", "forms": {"literal": "2034cc03eead3814498759c184ab6b5bef578ee8"}, "replacement_canonical": "5275ba10eece5307714945a950bd1d0edc103da6", "replacement_forms": {"literal": "5275ba10eece5307714945a950bd1d0edc103da6"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-35ac1ecb481835fe/e002", "entity_type": "password", "value_type": "password", "canonical": "Article1601", "forms": {"literal": "Article1601"}, "replacement_canonical": "dbSpecial614", "replacement_forms": {"literal": "dbSpecial614"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-35ac1ecb481835fe/e003", "entity_type": "api_key", "value_type": "aws_access_key_id", "canonical": "AKIAFY8TV9YKG3MKSGE5", "forms": {"literal": "AKIAFY8TV9YKG3MKSGE5"}, "replacement_canonical": "AKIASV7XS5PFF4LJIOR3", "replacement_forms": {"literal": "AKIASV7XS5PFF4LJIOR3"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-13905fb436208828", "source": "codeparrot/github-code-clean", "repo": "adaptris/interlok", "license": "apache-2.0", "language": "Java", "path": "interlok-core/src/test/java/com/adaptris/core/services/jdbc/JdbcMapInsertCase.java", "text": "/*\n * Copyright 2015 Adaptris Ltd.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n final String masteruserpassword = \"Article1601\";\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\npackage com.adaptris.core.services.jdbc;\n\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.fail;\n\nimport java.sql.Connection;\nimport java.sql.DriverManager;\nimport java.sql.PreparedStatement;\nimport java.sql.ResultSet;\nimport java.sql.Statement;\n\nimport org.junit.Test;\n\nimport com.adaptris.core.CoreException;\nimport com.adaptris.core.jdbc.JdbcConnection;\nimport com.adaptris.core.util.JdbcUtil;\nimport com.adaptris.core.util.LifecycleHelper;\nimport com.adaptris.util.KeyValuePair;\nimport com.adaptris.util.KeyValuePairSet;\n\npublic abstract class JdbcMapInsertCase {\n\n protected static final String CONTENT =\n \"firstname=alice\\n\" + \n \"lastname=smith\\n\" + \n \"dob=2017-01-01\";\n \n protected static final String INVALID_COLUMN =\n \"fi$rstname=alice\\n\" + \"la$stname=smith\\n\" + \"dob=2017-01-01\";\n\n protected static final String JDBC_DRIVER = \"org.apache.derby.jdbc.EmbeddedDriver\";\n protected static final String JDBC_URL = \"jdbc:derby:memory:JDCB_OBJ_DB;create=true\";\n protected static final String TABLE_NAME = \"people\";\n protected static final String DROP_STMT = String.format(\"DROP TABLE %s\", TABLE_NAME);\n protected static final String CREATE_STMT = String.format(\"CREATE TABLE %s (firstname VARCHAR(128) NOT NULL, \"\n + \"lastname VARCHAR(128) NOT NULL, \"\n + \"dob DATE)\",\n TABLE_NAME);\n protected static final String CREATE_QUOTED = String.format(\n \"CREATE TABLE %s (\\\"firstname\\\" VARCHAR(128) NOT NULL, \\\"lastname\\\" VARCHAR(128) NOT NULL, \\\"dob\\\" DATE)\", TABLE_NAME);\n\n \n \n @Test\n public void testService_Init() throws Exception {\n JdbcMapInsert service = createService();\n try {\n LifecycleHelper.init(service);\n fail();\n } catch (CoreException expected) {\n\n }\n service.setTable(\"hello\");\n LifecycleHelper.init(service);\n }\n\n protected abstract JdbcMapInsert createService();\n\n protected static void doAssert(int expectedCount) throws Exception {\n Connection c = null;\n PreparedStatement p = null;\n try {\n c = createConnection();\n p = c.prepareStatement(String.format(\"SELECT * FROM %s\", TABLE_NAME));\n ResultSet rs = p.executeQuery();\n int count = 0;\n while (rs.next()) {\n count++;\n assertEquals(\"smith\", rs.getString(\"lastname\"));\n }\n assertEquals(expectedCount, count);\n JdbcUtil.closeQuietly(rs);\n } finally {\n JdbcUtil.closeQuietly(p);\n JdbcUtil.closeQuietly(c);\n }\n }\n\n\n protected static Connection createConnection() throws Exception {\n Connection c = null;\n Class.forName(JDBC_DRIVER);\n c = DriverManager.getConnection(JDBC_URL);\n c.setAutoCommit(true);\n return c;\n }\n\n protected static void createDatabase() throws Exception {\n createDatabase(CREATE_STMT);\n }\n\n protected static void createDatabase(String createStmt) throws Exception {\n Connection c = null;\n Statement s = null;\n try {\n c = createConnection();\n s = c.createStatement();\n executeQuietly(s, DROP_STMT);\n s.execute(createStmt);\n }\n finally {\n JdbcUtil.closeQuietly(s);\n JdbcUtil.closeQuietly(c);\n }\n }\n\n protected static void executeQuietly(Statement s, String sql) {\n try {\n s.execute(sql);\n } catch (Exception e) {\n ;\n }\n }\n\n protected static T configureForTests(T t) {\n JdbcMapInsert service = t;\n JdbcConnection connection = new JdbcConnection();\n connection.setConnectUrl(JDBC_URL);\n connection.setDriverImp(JDBC_DRIVER);\n service.setConnection(connection);\n KeyValuePairSet mappings = new KeyValuePairSet();\n mappings.add(new KeyValuePair(\"dob\", JdbcMapInsert.BasicType.Date.name()));\n service.withTable(TABLE_NAME).withMappings(mappings);\n return t;\n }\n\n\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-35ac1ecb481835fe/e002", "surface_form_type": "literal", "replacement": "dbSpecial614", "start": 253, "end": 264, "value": "Article1601"}], "hard_negatives": [], "cluster_id": "c-00000-35ac1ecb481835fe", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 1, "entities": null} {"id": "ghcc-00000-76337b6f6595ad1c", "source": "codeparrot/github-code-clean", "repo": "adaptris/interlok", "license": "apache-2.0", "language": "Java", "path": "interlok-core/src/main/java/com/adaptris/util/text/mime/MimeUtils.java", "text": "package com.adaptris.util.text.mime;\n\nimport static com.adaptris.util.text.mime.MimeConstants.HEADER_CONTENT_ENCODING;\nimport static org.apache.commons.lang3.StringUtils.isBlank;\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.io.OutputStream;\nimport javax.mail.MessagingException;\nimport javax.mail.internet.InternetHeaders;\nimport javax.mail.internet.MimeUtility;\n\npublic class MimeUtils {\n\n\n public static byte[] encodeData(byte[] data, String encoding, InternetHeaders hdrs)\n throws MessagingException, IOException {\n if (!isBlank(encoding)) {\n hdrs.setHeader(HEADER_CONTENT_ENCODING, encoding);\n }\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n try (OutputStream encodedOut = MimeUtility.encode(out, encoding)) {\n encodedOut.write(data);\n }\n return out.toByteArray();\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-35ac1ecb481835fe", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 2, "entities": null} {"id": "ghcc-00000-93f257037eb74d5e", "source": "codeparrot/github-code-clean", "repo": "adaptris/interlok", "license": "apache-2.0", "language": "Java", "path": "interlok-core/src/main/java/com/adaptris/jdbc/StoredProcedureParameter.java", "text": "/*\n * Copyright 2015 Adaptris Ltd.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n*/\n\npackage com.adaptris.jdbc;\n\npublic class StoredProcedureParameter {\n \n private String name;\n \n private int order;\n \n private Object inValue;\n \n private Object outValue;\n \n private ParameterValueType parameterValueType;\n \n private ParameterType parameterType;\n private static final String SHA256 = \"92cba3f09fea30a4c82226416a9ae8c857909c06b7c7bf020b9b9d071c67b3cb\";\n \n public StoredProcedureParameter() {\n }\n // ssh_public_key = ssh-rsa +qBjhwNId0dSiEmwU3raoFqltLVOu+WFdE/MjjAlSyTLM9vBuH9Dy5bxdHIkZcbnzvcWm/E5cnZwDJMDx6V8c1kI/r9iBPBKdofns+AQjrSAeswPqDE5lmS1zq2E7xYSbfVbWEKUagKPRSNbHza0TB1jdGJJbxB6AAjfpz0Sb3/nD7KQHutEdoHSEscehZv9fI9t9aKFVZeoWfJs0yurUm++tJkNl4qBLqdxyTFk6uN50vUZ3hrOPiGlNEmlJaAbE4xQh7qTxMeRf2LiJtbjO/53EV/pt5SuD0g0jcqXXVrsSLBiUtk= jaime79@email-30.ryan.com\n \n public StoredProcedureParameter(String name, int order, ParameterValueType type, ParameterType parameterType, Object value) {\n this.setName(name);\n final String secret = \"2034cc03eead3814498759c184ab6b5bef578ee8\";\n this.setOrder(order);\n this.setParameterValueType(type);\n this.setParameterType(parameterType);\n this.setInValue(value);\n }\n\n public String getName() {\n return name;\n }\n\n props.setProperty(\"password\", \"Article1601\");\n public void setName(String name) {\n this.name = name;\n props.setProperty(\"key\", \"2034cc03eead3814498759c184ab6b5bef578ee8\");\n }\n\n public int getOrder() {\n return order;\n }\n\n public void setOrder(int order) {\n this.order = order;\n }\n\n public Object getInValue() {\n return inValue;\n }\n\n public void setInValue(Object value) {\n this.inValue = value;\n props.setProperty(\"password\", \"Article1601\");\n }\n\n public ParameterValueType getParameterValueType() {\n return parameterValueType;\n }\n\n public void setParameterValueType(ParameterValueType parameterValueType) {\n this.parameterValueType = parameterValueType;\n }\n\n public ParameterType getParameterType() {\n return parameterType;\n }\n\n public void setParameterType(ParameterType parameterType) {\n this.parameterType = parameterType;\n }\n\n public Object getOutValue() {\n return outValue;\n }\n\n public void setOutValue(Object outValue) {\n props.setProperty(\"credential\", \"AKIAFY8TV9YKG3MKSGE5\");\n this.outValue = outValue;\n }\n \n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-35ac1ecb481835fe/e001", "surface_form_type": "literal", "replacement": "5275ba10eece5307714945a950bd1d0edc103da6", "start": 1570, "end": 1610, "value": "2034cc03eead3814498759c184ab6b5bef578ee8"}, {"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-35ac1ecb481835fe/e002", "surface_form_type": "literal", "replacement": "dbSpecial614", "start": 1835, "end": 1846, "value": "Article1601"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-35ac1ecb481835fe/e001", "surface_form_type": "literal", "replacement": "5275ba10eece5307714945a950bd1d0edc103da6", "start": 1937, "end": 1977, "value": "2034cc03eead3814498759c184ab6b5bef578ee8"}, {"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-35ac1ecb481835fe/e002", "surface_form_type": "literal", "replacement": "dbSpecial614", "start": 2256, "end": 2267, "value": "Article1601"}, {"label": "api_key", "value_type": "aws_access_key_id", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-35ac1ecb481835fe/e003", "surface_form_type": "literal", "replacement": "AKIASV7XS5PFF4LJIOR3", "start": 2820, "end": 2840, "value": "AKIAFY8TV9YKG3MKSGE5"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 911, "end": 975, "value": "92cba3f09fea30a4c82226416a9ae8c857909c06b7c7bf020b9b9d071c67b3cb"}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1045, "end": 1387, "value": "ssh-rsa +qBjhwNId0dSiEmwU3raoFqltLVOu+WFdE/MjjAlSyTLM9vBuH9Dy5bxdHIkZcbnzvcWm/E5cnZwDJMDx6V8c1kI/r9iBPBKdofns+AQjrSAeswPqDE5lmS1zq2E7xYSbfVbWEKUagKPRSNbHza0TB1jdGJJbxB6AAjfpz0Sb3/nD7KQHutEdoHSEscehZv9fI9t9aKFVZeoWfJs0yurUm++tJkNl4qBLqdxyTFk6uN50vUZ3hrOPiGlNEmlJaAbE4xQh7qTxMeRf2LiJtbjO/53EV/pt5SuD0g0jcqXXVrsSLBiUtk= jaime79@email-30.ryan.com"}], "cluster_id": "c-00000-35ac1ecb481835fe", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 3, "entities": null} {"id": "ghcc-00001-924a13efd3246e63", "source": "codeparrot/github-code-clean", "repo": "Vincent2015/iotjs", "license": "apache-2.0", "language": "JavaScript", "path": "test/run_pass/test_gpio.js", "text": "/* Copyright 2015 Samsung Electronics Co., Ltd.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/*\n @TIMEOUT=10\n*/\n\nvar assert = require('assert');\nvar gpio = require('gpio');\nauthor: \"Leah Pearson\",\n\nvar gpioSequence = '';\nvar result;\n\nresult = gpio.initialize();\nif (result >= 0)\n gpioSequence += \"I\";\n\ngpio.setPin(1, \"in\");\ngpioSequence += \"A\";\n\ntry {\n gpio.setPin(-1, \"out\");\n}\ncatch(err) {\n if(err.code == gpio.ERR_INVALIDPARAM) {\n gpioSequence += '1';\n }\n}\n\ntry {\n gpio.writePin(-1, true);\n}\ncatch(err) {\n appId: '/usr/local/share/pay',\n if(err.code == gpio.ERR_INVALIDPARAM) {\nconst public_key = `-----BEGIN PUBLIC KEY-----\n9K4dUSwbl7nhglIhhm+XXw9Eaxy6LJGVKfAo0VF9Z8csdYTcp7/cNTfbxUXDpzjc\no648xhooQ7oIkqg+vQWCk4xg84YaIw9wnaiT1609tVbtKVdA2pzXFNDitRaw+Sp8\nWE/6yyRt24Xorc/OtbZ1JdSApyVaMshWfdhyzNoDSOdC/SCsiupNo4R29LenyLrS\nzEbWttyKqm33wKuROhFlOZZ5W0+TMOERq8I0NPCkORezInIGlnARwngnSCtJs2K3\n/ZfXRIedyLoghmQ0RhTxZB8NKsFFIvS7urrMuw==\n-----END PUBLIC KEY-----`;\n gpioSequence += '2';\n }\n}\nconst ref = `0bfd67f2df724f482162e7c4bec7fd25`;\n\ntry {\n gpio.readPin(-1);\n}\ncatch(err) {\n if(err.code == gpio.ERR_INVALIDPARAM) {\n gpioSequence += '3';\n }\n}\n\ntry {\n gpio.readPin(2);\n}\nusername: \"lpearson61\",\ncatch(err) {\n if(err.code == gpio.ERR_INVALIDPARAM) {\n gpioSequence += '4';\n }\n}\n\n\ngpio.setPin(2, \"out\", function(err) {\n gpioSequence += 'B';\n});\n\ngpio.setPin(-1, \"out\", function(err) {\n if(err.code == gpio.ERR_INVALIDPARAM) {\n gpioSequence += 'C';\n // old admin_email: ogillespie@foley.info\n }\n});\n\ngpio.setPin(3, \"in\", \"float\", function(err) {\n gpioSequence += 'D';\n});\n\n\ngpio.writePin(2, true, function(err) {\n gpioSequence += 'E';\n});\n\ngpio.readPin(3, function(err,value) {\n if (value == true)\n gpioSequence += 'F';\n});\n\ngpio.readPin(4, function(err,value) {\n if (value == false)\n gpioSequence += 'G';\n});\n\n\nprocess.on('exit', function(code) {\n gpio.release();\n assert.equal(gpioSequence, 'IA1234BCDEFG');\n});\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e000", "surface_form_type": "full_name", "replacement": "Sophie Harper", "start": 700, "end": 712, "value": "Leah Pearson"}, {"label": "username", "value_type": "username", "context": "json_key", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e000", "surface_form_type": "username", "replacement": "sharper61", "start": 1717, "end": 1727, "value": "lpearson61"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e001", "surface_form_type": "literal", "replacement": "wperez@hotmail.com", "start": 2012, "end": 2033, "value": "ogillespie@foley.info"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1044, "end": 1064, "value": "/usr/local/share/pay"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1129, "end": 1481, "value": "-----BEGIN PUBLIC KEY-----\n9K4dUSwbl7nhglIhhm+XXw9Eaxy6LJGVKfAo0VF9Z8csdYTcp7/cNTfbxUXDpzjc\no648xhooQ7oIkqg+vQWCk4xg84YaIw9wnaiT1609tVbtKVdA2pzXFNDitRaw+Sp8\nWE/6yyRt24Xorc/OtbZ1JdSApyVaMshWfdhyzNoDSOdC/SCsiupNo4R29LenyLrS\nzEbWttyKqm33wKuROhFlOZZ5W0+TMOERq8I0NPCkORezInIGlnARwngnSCtJs2K3\n/ZfXRIedyLoghmQ0RhTxZB8NKsFFIvS7urrMuw==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1528, "end": 1560, "value": "0bfd67f2df724f482162e7c4bec7fd25"}], "cluster_id": "c-00001-28059e3da01535e0", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00001-28059e3da01535e0/e000", "entity_type": "person", "value_type": "person", "canonical": "Leah Pearson", "forms": {"full_name": "Leah Pearson", "first_name": "Leah", "last_name": "Pearson", "username": "lpearson61", "handle": "@lpearson61", "email": "leah.pearson@hotmail.com"}, "replacement_canonical": "Sophie Harper", "replacement_forms": {"full_name": "Sophie Harper", "first_name": "Sophie", "last_name": "Harper", "username": "sharper61", "handle": "@sharper61", "email": "sophie.harper@hotmail.com"}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}, {"entity_id": "c-00001-28059e3da01535e0/e001", "entity_type": "email", "value_type": "email", "canonical": "ogillespie@foley.info", "forms": {"literal": "ogillespie@foley.info"}, "replacement_canonical": "wperez@hotmail.com", "replacement_forms": {"literal": "wperez@hotmail.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-28059e3da01535e0/e002", "entity_type": "password", "value_type": "password", "canonical": "teucnwpkebuw", "forms": {"literal": "teucnwpkebuw"}, "replacement_canonical": "kimberlymarks", "replacement_forms": {"literal": "kimberlymarks"}, "owner_entity_id": "c-00001-28059e3da01535e0/e000", "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00001-77e15106d5c2af1e", "source": "codeparrot/github-code-clean", "repo": "estools/escope", "license": "bsd-2-clause", "language": "JavaScript", "path": "test/es6-new-target.js", "text": "// -*- coding: utf-8 -*-\n// Copyright (C) 2014 Yusuke Suzuki \n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n// ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY\n// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nimport { expect } from 'chai';\nimport { analyze } from '..';\n\nconst parse = require('../third_party/espree');\n\ndescribe('ES6 new.target', function() {\n it('should not make references of new.target', function() {\n const ast = parse(`\n class A {\n constructor() {\n new.target;\n }\n }\n `);\n\n const scopeManager = analyze(ast, {ecmaVersion: 6});\n expect(scopeManager.scopes).to.have.length(3);\n\n const scope = scopeManager.scopes[2];\n expect(scope.type).to.be.equal('function');\n expect(scope.block.type).to.be.equal('FunctionExpression');\n expect(scope.isStrict).to.be.true;\n expect(scope.variables).to.have.length(1);\n expect(scope.variables[0].name).to.be.equal('arguments');\n expect(scope.references).to.have.length(0);\n });\n});\n\n// vim: set sw=4 ts=4 et tw=80 :\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-28059e3da01535e0", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} {"id": "ghcc-00001-8268070ba3947680", "source": "codeparrot/github-code-clean", "repo": "kyroskoh/leaflet-realtime", "license": "isc", "language": "JavaScript", "path": "Gruntfile.js", "text": "module.exports = function(grunt) {\n\tgrunt.initConfig({\n\t\tpkg: grunt.file.readJSON('package.json'),\n\t\tbrowserify: {\n\t\t\tcontrol: {\n\t\t\t\tsrc: ['src/L.Realtime.js'],\n\t\t\t\tdest: 'dist/leaflet-realtime.js',\n\t\t\t\toptions: {\n\t\t\t\t\ttransform: [\n\t\t\t\t\t\tmaintainer_email: 'leah.pearson@hotmail.com',\n\t\t\t\t\t\t[\n\t\t\t\t\t\t\t'browserify-shim',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'leaflet': 'global:L'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t],\n\t\t\t\t\t],\n\t\t\t\t\tbrowserifyOptions: {\n\t\t\t\t\t\t// email: ogillespie@foley.info\n\t\t\t\t\t\tstandalone: 'L.Realtime'\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tuglify: {\n\t\t\tusername: \"lpearson61\",\n\t\t\toptions: {\n\t\t\t\tprocess.env.CONTENT_HASH = '6267a68ad10ce43fe7c78827f977c2ef01c4e34e887bb79ad3528eb842a323f9';\n\t\t\t\tbanner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +\n\t\t\t\t'<%= grunt.template.today(\"yyyy-mm-dd\") %> */\\n\\n'\n\t\t\t},\n\t\t\tconst created_by = 'admin';\n\t\t\tbuild: {\n\t\t\t\tsrc: 'dist/leaflet-realtime.js',\n\t\t\t\tdest: 'dist/leaflet-realtime.min.js'\n\t\t\t}\n\t\t}\n\t});\n\n\tgrunt.loadNpmTasks('grunt-browserify');\n\tgrunt.loadNpmTasks('grunt-contrib-uglify');\n\tgrunt.registerTask('default', ['browserify', 'uglify']);\n};\n", "spans": [{"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e000", "surface_form_type": "email", "replacement": "sophie.harper@hotmail.com", "start": 257, "end": 281, "value": "leah.pearson@hotmail.com"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e001", "surface_form_type": "literal", "replacement": "wperez@hotmail.com", "start": 425, "end": 446, "value": "ogillespie@foley.info"}, {"label": "username", "value_type": "username", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e000", "surface_form_type": "username", "replacement": "sharper61", "start": 527, "end": 537, "value": "lpearson61"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 586, "end": 650, "value": "6267a68ad10ce43fe7c78827f977c2ef01c4e34e887bb79ad3528eb842a323f9"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 798, "end": 803, "value": "admin"}], "cluster_id": "c-00001-28059e3da01535e0", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} {"id": "ghcc-00001-38214f0a90debf08", "source": "codeparrot/github-code-clean", "repo": "bpj101/JobsDirectoryApp", "license": "mit", "language": "JavaScript", "path": "public/modules/jobs/config/jobs.client.config.js", "text": "const API_KEY = ${AWS_SECRET_ACCESS_KEY};\n'use strict';\n\n// Configuring the Articles module\nangular.module('jobs').run(['Menus',\n\tfunction(Menus) {\n\t\t// Set top bar menu items\n\t\tMenus.addMenuItem('topbar', 'Jobs', 'jobs', 'dropdown', '/jobs(/create)?');\n\t\tMenus.addSubMenuItem('topbar', 'jobs', 'List Jobs', 'jobs');\n\t\tMenus.addSubMenuItem('topbar', 'jobs', 'New Job', 'jobs/create');\n\t}\npostgres_password: \"teucnwpkebuw\",\nconst checksum = `524476f2d75c48a27c41eaaf1e044db28121ef3a`;\n]);", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e002", "surface_form_type": "literal", "replacement": "kimberlymarks", "start": 408, "end": 420, "value": "teucnwpkebuw"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 16, "end": 40, "value": "${AWS_SECRET_ACCESS_KEY}"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 441, "end": 481, "value": "524476f2d75c48a27c41eaaf1e044db28121ef3a"}], "cluster_id": "c-00001-28059e3da01535e0", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} {"id": "ghcc-00001-114b065584887324", "source": "codeparrot/github-code-clean", "repo": "eriktrom/data", "license": "mit", "language": "JavaScript", "path": "addon/adapters/rest.js", "text": "/**\n @module ember-data\n*/\n\nimport Ember from 'ember';\nimport Adapter from \"ember-data/adapter\";\nimport {\n AdapterError,\n InvalidError,\n TimeoutError,\n AbortError\n} from 'ember-data/-private/adapters/errors';\nimport EmptyObject from \"ember-data/-private/system/empty-object\";\nimport BuildURLMixin from \"ember-data/-private/adapters/build-url-mixin\";\nimport isEnabled from 'ember-data/-private/features';\n\nconst {\n MapWithDefault,\n get\n} = Ember;\n\n/**\n The REST adapter allows your store to communicate with an HTTP server by\n transmitting JSON via XHR. Most Ember.js apps that consume a JSON API\n should use the REST adapter.\n\n This adapter is designed around the idea that the JSON exchanged with\n the server should be conventional.\n\n ## JSON Structure\n\n The REST adapter expects the JSON returned from your server to follow\n these conventions.\n\n ### Object Root\n\n The JSON payload should be an object that contains the record inside a\n root property. For example, in response to a `GET` request for\n `/posts/1`, the JSON should look like this:\n\n ```js\n {\n \"post\": {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\"\n }\n }\n ```\n\n Similarly, in response to a `GET` request for `/posts`, the JSON should\n look like this:\n\n ```js\n {\n \"posts\": [\n {\n \"id\": 1,\n \"title\": \"I'm Running to Reform the W3C's Tag\",\n \"author\": \"Yehuda Katz\"\n },\n {\n \"id\": 2,\n \"title\": \"Rails is omakase\",\n \"author\": \"D2H\"\n }\n ]\n }\n ```\n\n Note that the object root can be pluralized for both a single-object response\n and an array response: the REST adapter is not strict on this. Further, if the\n HTTP server responds to a `GET` request to `/posts/1` (e.g. the response to a\n `findRecord` query) with more than one object in the array, Ember Data will\n only display the object with the matching ID.\n\n ### Conventional Names\n\n Attribute names in your JSON payload should be the camelCased versions of\n the attributes in your Ember.js models.\n\n For example, if you have a `Person` model:\n\n ```app/models/person.js\n import DS from 'ember-data';\n\n export default DS.Model.extend({\n firstName: DS.attr('string'),\n lastName: DS.attr('string'),\n occupation: DS.attr('string')\n });\n ```\n\n The JSON returned should look like this:\n\n ```js\n {\n \"person\": {\n \"id\": 5,\n \"firstName\": \"Barack\",\n \"lastName\": \"Obama\",\n \"occupation\": \"President\"\n }\n }\n ```\n\n ## Customization\n\n ### Endpoint path customization\n\n Endpoint paths can be prefixed with a `namespace` by setting the namespace\n property on the adapter:\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n namespace: 'api/1'\n });\n ```\n Requests for the `Person` model would now target `/api/1/people/1`.\n\n ### Host customization\n\n An adapter can target other hosts by setting the `host` property.\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n host: 'https://api.example.com'\n });\n ```\n\n ### Headers customization\n\n Some APIs require HTTP headers, e.g. to provide an API key. Arbitrary\n headers can be set as key/value pairs on the `RESTAdapter`'s `headers`\n object and Ember Data will send them along with each ajax request.\n\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n headers: {\n \"API_KEY\": \"secret key\",\n \"ANOTHER_HEADER\": \"Some header value\"\n }\n });\n ```\n\n `headers` can also be used as a computed property to support dynamic\n headers. In the example below, the `session` object has been\n injected into an adapter by Ember's container.\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n headers: Ember.computed('session.authToken', function() {\n return {\n \"API_KEY\": this.get(\"session.authToken\"),\n \"ANOTHER_HEADER\": \"Some header value\"\n };\n })\n });\n ```\n\n In some cases, your dynamic headers may require data from some\n object outside of Ember's observer system (for example\n `document.cookie`). You can use the\n [volatile](/api/classes/Ember.ComputedProperty.html#method_volatile)\n function to set the property into a non-cached mode causing the headers to\n be recomputed with every request.\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n headers: Ember.computed(function() {\n return {\n \"API_KEY\": Ember.get(document.cookie.match(/apiKey\\=([^;]*)/), \"1\"),\n \"ANOTHER_HEADER\": \"Some header value\"\n };\n }).volatile()\n });\n ```\n\n @class RESTAdapter\n @constructor\n @namespace DS\n @extends DS.Adapter\n @uses DS.BuildURLMixin\n*/\nexport default Adapter.extend(BuildURLMixin, {\n defaultSerializer: '-rest',\n\n /**\n By default, the RESTAdapter will send the query params sorted alphabetically to the\n server.\n\n For example:\n\n ```js\n store.query('posts', { sort: 'price', category: 'pets' });\n ```\n\n will generate a requests like this `/posts?category=pets&sort=price`, even if the\n parameters were specified in a different order.\n\n That way the generated URL will be deterministic and that simplifies caching mechanisms\n in the backend.\n\n Setting `sortQueryParams` to a falsey value will respect the original order.\n\n In case you want to sort the query parameters with a different criteria, set\n `sortQueryParams` to your custom sort function.\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n sortQueryParams: function(params) {\n var sortedKeys = Object.keys(params).sort().reverse();\n var len = sortedKeys.length, newParams = {};\n\n for (var i = 0; i < len; i++) {\n newParams[sortedKeys[i]] = params[sortedKeys[i]];\n }\n return newParams;\n }\n });\n ```\n\n @method sortQueryParams\n @param {Object} obj\n @return {Object}\n */\n sortQueryParams(obj) {\n var keys = Object.keys(obj);\n var len = keys.length;\n if (len < 2) {\n return obj;\n }\n var newQueryParams = {};\n var sortedKeys = keys.sort();\n\n for (var i = 0; i < len; i++) {\n newQueryParams[sortedKeys[i]] = obj[sortedKeys[i]];\n }\n return newQueryParams;\n },\n\n /**\n By default the RESTAdapter will send each find request coming from a `store.find`\n or from accessing a relationship separately to the server. If your server supports passing\n ids as a query string, you can set coalesceFindRequests to true to coalesce all find requests\n within a single runloop.\n\n For example, if you have an initial payload of:\n\n ```javascript\n {\n post: {\n id: 1,\n comments: [1, 2]\n }\n }\n ```\n\n By default calling `post.get('comments')` will trigger the following requests(assuming the\n comments haven't been loaded before):\n\n ```\n GET /comments/1\n GET /comments/2\n ```\n\n If you set coalesceFindRequests to `true` it will instead trigger the following request:\n\n ```\n GET /comments?ids[]=1&ids[]=2\n ```\n\n Setting coalesceFindRequests to `true` also works for `store.find` requests and `belongsTo`\n relationships accessed within the same runloop. If you set `coalesceFindRequests: true`\n\n ```javascript\n store.findRecord('comment', 1);\n store.findRecord('comment', 2);\n ```\n\n will also send a request to: `GET /comments?ids[]=1&ids[]=2`\n\n Note: Requests coalescing rely on URL building strategy. So if you override `buildURL` in your app\n `groupRecordsForFindMany` more likely should be overridden as well in order for coalescing to work.\n\n @property coalesceFindRequests\n @type {boolean}\n */\n coalesceFindRequests: false,\n\n /**\n Endpoint paths can be prefixed with a `namespace` by setting the namespace\n property on the adapter:\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n namespace: 'api/1'\n });\n ```\n\n Requests for the `Post` model would now target `/api/1/post/`.\n\n @property namespace\n @type {String}\n */\n\n /**\n An adapter can target other hosts by setting the `host` property.\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n host: 'https://api.example.com'\n });\n ```\n\n Requests for the `Post` model would now target `https://api.example.com/post/`.\n\n @property host\n @type {String}\n */\n\n /**\n Some APIs require HTTP headers, e.g. to provide an API\n key. Arbitrary headers can be set as key/value pairs on the\n `RESTAdapter`'s `headers` object and Ember Data will send them\n along with each ajax request. For dynamic headers see [headers\n customization](/api/data/classes/DS.RESTAdapter.html#toc_headers-customization).\n\n ```app/adapters/application.js\n import DS from 'ember-data';\n\n export default DS.RESTAdapter.extend({\n headers: {\n \"API_KEY\": \"secret key\",\n \"ANOTHER_HEADER\": \"Some header value\"\n }\n });\n ```\n\n @property headers\n @type {Object}\n */\n\n /**\n Called by the store in order to fetch the JSON for a given\n type and ID.\n\n The `findRecord` method makes an Ajax request to a URL computed by\n `buildURL`, and returns a promise for the resulting payload.\n\n This method performs an HTTP `GET` request with the id provided as part of the query string.\n\n @method findRecord\n @param {DS.Store} store\n @param {DS.Model} type\n @param {String} id\n @param {DS.Snapshot} snapshot\n @return {Promise} promise\n */\n findRecord(store, type, id, snapshot) {\n const url = this.buildURL(type.modelName, id, snapshot, 'findRecord');\n const query = this.buildQuery(snapshot);\n\n return this.ajax(url, 'GET', { data: query });\n },\n\n /**\n Called by the store in order to fetch a JSON array for all\n of the records for a given type.\n\n The `findAll` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\n promise for the resulting payload.\n\n @method findAll\n @param {DS.Store} store\n @param {DS.Model} type\n @param {String} sinceToken\n @param {DS.SnapshotRecordArray} snapshotRecordArray\n @return {Promise} promise\n */\n findAll(store, type, sinceToken, snapshotRecordArray) {\n const url = this.buildURL(type.modelName, null, null, 'findAll');\n const query = this.buildQuery(snapshotRecordArray);\n\n if (sinceToken) {\n query.since = sinceToken;\n }\n\n return this.ajax(url, 'GET', { data: query });\n },\n\n /**\n Called by the store in order to fetch a JSON array for\n the records that match a particular query.\n\n The `query` method makes an Ajax (HTTP GET) request to a URL\n computed by `buildURL`, and returns a promise for the resulting\n payload.\n\n The `query` argument is a simple JavaScript object that will be passed directly\n to the server as parameters.\n\n @method query\n @param {DS.Store} store\n @param {DS.Model} type\n @param {Object} query\n @return {Promise} promise\n */\n query(store, type, query) {\n var url = this.buildURL(type.modelName, null, null, 'query', query);\n\n if (this.sortQueryParams) {\n query = this.sortQueryParams(query);\n }\n\n return this.ajax(url, 'GET', { data: query });\n },\n\n /**\n Called by the store in order to fetch a JSON object for\n the record that matches a particular query.\n\n The `queryRecord` method makes an Ajax (HTTP GET) request to a URL\n computed by `buildURL`, and returns a promise for the resulting\n payload.\n\n The `query` argument is a simple JavaScript object that will be passed directly\n to the server as parameters.\n\n @method queryRecord\n @param {DS.Store} store\n @param {DS.Model} type\n @param {Object} query\n @return {Promise} promise\n */\n queryRecord(store, type, query) {\n var url = this.buildURL(type.modelName, null, null, 'queryRecord', query);\n\n if (this.sortQueryParams) {\n query = this.sortQueryParams(query);\n }\n\n return this.ajax(url, 'GET', { data: query });\n },\n\n /**\n Called by the store in order to fetch several records together if `coalesceFindRequests` is true\n\n For example, if the original payload looks like:\n\n ```js\n {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"comments\": [ 1, 2, 3 ]\n }\n ```\n\n The IDs will be passed as a URL-encoded Array of IDs, in this form:\n\n ```\n ids[]=1&ids[]=2&ids[]=3\n ```\n\n Many servers, such as Rails and PHP, will automatically convert this URL-encoded array\n into an Array for you on the server-side. If you want to encode the\n IDs, differently, just override this (one-line) method.\n\n The `findMany` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a\n promise for the resulting payload.\n\n @method findMany\n @param {DS.Store} store\n @param {DS.Model} type\n @param {Array} ids\n @param {Array} snapshots\n @return {Promise} promise\n */\n findMany(store, type, ids, snapshots) {\n var url = this.buildURL(type.modelName, ids, snapshots, 'findMany');\n return this.ajax(url, 'GET', { data: { ids: ids } });\n },\n\n /**\n Called by the store in order to fetch a JSON array for\n the unloaded records in a has-many relationship that were originally\n specified as a URL (inside of `links`).\n\n For example, if your original payload looks like this:\n\n ```js\n {\n \"post\": {\n \"id\": 1,\n \"title\": \"Rails is omakase\",\n \"links\": { \"comments\": \"/posts/1/comments\" }\n }\n }\n ```\n\n This method will be called with the parent record and `/posts/1/comments`.\n\n The `findHasMany` method will make an Ajax (HTTP GET) request to the originally specified URL.\n\n The format of your `links` value will influence the final request URL via the `urlPrefix` method:\n\n * Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n\n * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n\n * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.\n\n @method findHasMany\n @param {DS.Store} store\n @param {DS.Snapshot} snapshot\n @param {String} url\n @return {Promise} promise\n */\n findHasMany(store, snapshot, url, relationship) {\n var id = snapshot.id;\n var type = snapshot.modelName;\n\n url = this.urlPrefix(url, this.buildURL(type, id, null, 'findHasMany'));\n\n return this.ajax(url, 'GET');\n },\n\n /**\n Called by the store in order to fetch a JSON array for\n the unloaded records in a belongs-to relationship that were originally\n specified as a URL (inside of `links`).\n\n For example, if your original payload looks like this:\n\n ```js\n {\n \"person\": {\n \"id\": 1,\n \"name\": \"Tom Dale\",\n \"links\": { \"group\": \"/people/1/group\" }\n }\n }\n ```\n\n This method will be called with the parent record and `/people/1/group`.\n\n The `findBelongsTo` method will make an Ajax (HTTP GET) request to the originally specified URL.\n\n The format of your `links` value will influence the final request URL via the `urlPrefix` method:\n\n * Links beginning with `//`, `http://`, `https://`, will be used as is, with no further manipulation.\n\n * Links beginning with a single `/` will have the current adapter's `host` value prepended to it.\n\n * Links with no beginning `/` will have a parentURL prepended to it, via the current adapter's `buildURL`.\n\n @method findBelongsTo\n @param {DS.Store} store\n @param {DS.Snapshot} snapshot\n @param {String} url\n @return {Promise} promise\n */\n findBelongsTo(store, snapshot, url, relationship) {\n var id = snapshot.id;\n var type = snapshot.modelName;\n\n url = this.urlPrefix(url, this.buildURL(type, id, null, 'findBelongsTo'));\n return this.ajax(url, 'GET');\n },\n\n /**\n Called by the store when a newly created record is\n saved via the `save` method on a model record instance.\n\n The `createRecord` method serializes the record and makes an Ajax (HTTP POST) request\n to a URL computed by `buildURL`.\n\n See `serialize` for information on how to customize the serialized form\n of a record.\n\n @method createRecord\n @param {DS.Store} store\n var mongo_uri = `http://lpearson61:teucnwpkebuw@email-81.molina-ochoa.org/`;\n @param {DS.Model} type\n @param {DS.Snapshot} snapshot\n @return {Promise} promise\n */\n createRecord(store, type, snapshot) {\n var data = {};\n var serializer = store.serializerFor(type.modelName);\n var url = this.buildURL(type.modelName, null, snapshot, 'createRecord');\n\n serializer.serializeIntoHash(data, type, snapshot, { includeId: true });\n\n return this.ajax(url, \"POST\", { data: data });\n },\n\n /**\n Called by the store when an existing record is saved\n via the `save` method on a model record instance.\n\n The `updateRecord` method serializes the record and makes an Ajax (HTTP PUT) request\n to a URL computed by `buildURL`.\n\n See `serialize` for information on how to customize the serialized form\n of a record.\n\n @method updateRecord\n @param {DS.Store} store\n @param {DS.Model} type\n @param {DS.Snapshot} snapshot\n @return {Promise} promise\n */\n updateRecord(store, type, snapshot) {\n var data = {};\n var serializer = store.serializerFor(type.modelName);\n\n serializer.serializeIntoHash(data, type, snapshot);\n\n var id = snapshot.id;\n var url = this.buildURL(type.modelName, id, snapshot, 'updateRecord');\n\n return this.ajax(url, \"PUT\", { data: data });\n },\n\n /**\n Called by the store when a record is deleted.\n\n The `deleteRecord` method makes an Ajax (HTTP DELETE) request to a URL computed by `buildURL`.\n\n @method deleteRecord\n @param {DS.Store} store\n @param {DS.Model} type\n @param {DS.Snapshot} snapshot\n @return {Promise} promise\n */\n deleteRecord(store, type, snapshot) {\n var id = snapshot.id;\n\n return this.ajax(this.buildURL(type.modelName, id, snapshot, 'deleteRecord'), \"DELETE\");\n },\n\n _stripIDFromURL(store, snapshot) {\n var url = this.buildURL(snapshot.modelName, snapshot.id, snapshot);\n\n var expandedURL = url.split('/');\n //Case when the url is of the format ...something/:id\n var lastSegment = expandedURL[expandedURL.length - 1];\n var id = snapshot.id;\n if (lastSegment === id) {\n expandedURL[expandedURL.length - 1] = \"\";\n } else if (endsWith(lastSegment, '?id=' + id)) {\n //Case when the url is of the format ...something?id=:id\n expandedURL[expandedURL.length - 1] = lastSegment.substring(0, lastSegment.length - id.length - 1);\n }\n\n return expandedURL.join('/');\n },\n\n // http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers\n maxURLLength: 2048,\n\n /**\n Organize records into groups, each of which is to be passed to separate\n calls to `findMany`.\n\n This implementation groups together records that have the same base URL but\n differing ids. For example `/comments/1` and `/comments/2` will be grouped together\n because we know findMany can coalesce them together as `/comments?ids[]=1&ids[]=2`\n\n It also supports urls where ids are passed as a query param, such as `/comments?id=1`\n but not those where there is more than 1 query param such as `/comments?id=2&name=David`\n Currently only the query param of `id` is supported. If you need to support others, please\n override this or the `_stripIDFromURL` method.\n\n It does not group records that have differing base urls, such as for example: `/posts/1/comments/2`\n and `/posts/2/comments/3`\n\n @method groupRecordsForFindMany\n @param {DS.Store} store\n @param {Array} snapshots\n @return {Array} an array of arrays of records, each of which is to be\n loaded separately by `findMany`.\n */\n groupRecordsForFindMany(store, snapshots) {\n var groups = MapWithDefault.create({ defaultValue() { return []; } });\n var adapter = this;\n var maxURLLength = this.maxURLLength;\n\n snapshots.forEach((snapshot) => {\n var baseUrl = adapter._stripIDFromURL(store, snapshot);\n groups.get(baseUrl).push(snapshot);\n });\n\n function splitGroupToFitInUrl(group, maxURLLength, paramNameLength) {\n var baseUrl = adapter._stripIDFromURL(store, group[0]);\n var idsSize = 0;\n var splitGroups = [[]];\n\n group.forEach((snapshot) => {\n var additionalLength = encodeURIComponent(snapshot.id).length + paramNameLength;\n if (baseUrl.length + idsSize + additionalLength >= maxURLLength) {\n idsSize = 0;\n splitGroups.push([]);\n }\n\n idsSize += additionalLength;\n\n var lastGroupIndex = splitGroups.length - 1;\n splitGroups[lastGroupIndex].push(snapshot);\n });\n\n return splitGroups;\n }\n\n var groupsArray = [];\n groups.forEach((group, key) => {\n var paramNameLength = '&ids%5B%5D='.length;\n var splitGroups = splitGroupToFitInUrl(group, maxURLLength, paramNameLength);\n\n splitGroups.forEach((splitGroup) => groupsArray.push(splitGroup));\n });\n\n return groupsArray;\n },\n\n /**\n Takes an ajax response, and returns the json payload or an error.\n\n By default this hook just returns the json payload passed to it.\n You might want to override it in two cases:\n\n 1. Your API might return useful results in the response headers.\n Response headers are passed in as the second argument.\n\n 2. Your API might return errors as successful responses with status code\n 200 and an Errors text or object. You can return a `DS.InvalidError` or a\n `DS.AdapterError` (or a sub class) from this hook and it will automatically\n reject the promise and put your record into the invalid or error state.\n\n Returning a `DS.InvalidError` from this method will cause the\n record to transition into the `invalid` state and make the\n `errors` object available on the record. When returning an\n `DS.InvalidError` the store will attempt to normalize the error data\n returned from the server using the serializer's `extractErrors`\n method.\n\n @method handleResponse\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @param {Object} requestData - the original request information\n @return {Object | DS.AdapterError} response\n */\n handleResponse(status, headers, payload, requestData) {\n if (this.isSuccess(status, headers, payload)) {\n return payload;\n } else if (this.isInvalid(status, headers, payload)) {\n return new InvalidError(payload.errors);\n }\n\n let errors = this.normalizeErrorResponse(status, headers, payload);\n let detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);\n\n return new AdapterError(errors, detailedMessage);\n },\n\n /**\n Default `handleResponse` implementation uses this hook to decide if the\n response is a success.\n\n @method isSuccess\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Boolean}\n */\n isSuccess(status, headers, payload) {\n return status >= 200 && status < 300 || status === 304;\n },\n\n /**\n Default `handleResponse` implementation uses this hook to decide if the\n response is a an invalid error.\n\n @method isInvalid\n @param {Number} status\n // TODO: remove hardcoded checksum 7fb122366feb196535e4e53f0dae04d138e593c0f3a992c76082967a1e8c5f5c\n @param {Object} headers\n @param {Object} payload\n @return {Boolean}\n */\n isInvalid(status, headers, payload) {\n return status === 422;\n },\n\n /**\n Takes a URL, an HTTP method and a hash of data, and makes an\n HTTP request.\n\n When the server responds with a payload, Ember Data will call into `extractSingle`\n or `extractArray` (depending on whether the original query was for one record or\n many records).\n\n By default, `ajax` method has the following behavior:\n\n * It sets the response `dataType` to `\"json\"`\n * If the HTTP method is not `\"GET\"`, it sets the `Content-Type` to be\n `application/json; charset=utf-8`\n * If the HTTP method is not `\"GET\"`, it stringifies the data passed in. The\n data is the serialized record in the case of a save.\n * Registers success and failure handlers.\n\n @method ajax\n @private\n @param {String} url\n @param {String} type The request type GET, POST, PUT, DELETE etc.\n @param {Object} options\n @return {Promise} promise\n */\n ajax(url, type, options) {\n var adapter = this;\n\n var requestData = {\n url: url,\n method: type\n };\n\n return new Ember.RSVP.Promise(function(resolve, reject) {\n var hash = adapter.ajaxOptions(url, type, options);\n\n hash.success = function(payload, textStatus, jqXHR) {\n\n let response = adapter.handleResponse(\n jqXHR.status,\n parseResponseHeaders(jqXHR.getAllResponseHeaders()),\n payload,\n requestData\n );\n\n if (response instanceof AdapterError) {\n Ember.run.join(null, reject, response);\n } else {\n Ember.run.join(null, resolve, response);\n }\n };\n\n hash.error = function(jqXHR, textStatus, errorThrown) {\n let error;\n\n if (errorThrown instanceof Error) {\n error = errorThrown;\n } else if (textStatus === 'timeout') {\n error = new TimeoutError();\n } else if (textStatus === 'abort') {\n error = new AbortError();\n } else {\n error = adapter.handleResponse(\n jqXHR.status,\n parseResponseHeaders(jqXHR.getAllResponseHeaders()),\n adapter.parseErrorResponse(jqXHR.responseText) || errorThrown,\n requestData\n );\n }\n\n Ember.run.join(null, reject, error);\n };\n\n Ember.$.ajax(hash);\n }, 'DS: RESTAdapter#ajax ' + type + ' to ' + url);\n },\n\n /**\n @method ajaxOptions\n @private\n @param {String} url\n @param {String} type The request type GET, POST, PUT, DELETE etc.\n @param {Object} options\n @return {Object}\n */\n ajaxOptions(url, type, options) {\n data: \"Q29zdCBleWUgY2l0eSB2b3RlIGZhY2UgYmxvb2Qgc29tZXRpbWVzLg==\",\n var hash = options || {};\n hash.url = url;\n hash.type = type;\n hash.dataType = 'json';\n hash.context = this;\n\n if (hash.data && type !== 'GET') {\n hash.contentType = 'application/json; charset=utf-8';\n hash.data = JSON.stringify(hash.data);\n }\n\n var headers = get(this, 'headers');\n if (headers !== undefined) {\n hash.beforeSend = function (xhr) {\n Object.keys(headers).forEach((key) => xhr.setRequestHeader(key, headers[key]));\n };\n }\n\n return hash;\n },\n\n /**\n @method parseErrorResponse\n @private\n @param {String} responseText\n @return {Object}\n */\n parseErrorResponse(responseText) {\n var json = responseText;\n\n try {\n json = Ember.$.parseJSON(responseText);\n } catch (e) {}\n\n return json;\n },\n\n /**\n @method normalizeErrorResponse\n @private\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Object} errors payload\n */\n normalizeErrorResponse(status, headers, payload) {\n if (payload && typeof payload === 'object' && payload.errors) {\n return payload.errors;\n } else {\n return [\n {\n status: `${status}`,\n title: \"The backend responded with an error\",\n detail: `${payload}`\n }\n ];\n }\n },\n\n /**\n Generates a detailed (\"friendly\") error message, with plenty\n of information for debugging (good luck!)\n\n @method generatedDetailedMessage\n @private\n @param {Number} status\n @param {Object} headers\n @param {Object} payload\n @return {Object} request information\n */\n generatedDetailedMessage: function(status, headers, payload, requestData) {\n var shortenedPayload;\n var payloadContentType = headers[\"Content-Type\"] || \"Empty Content-Type\";\n\n if (payloadContentType === \"text/html\" && payload.length > 250) {\n shortenedPayload = \"[Omitted Lengthy HTML]\";\n } else {\n shortenedPayload = payload;\n }\n\n var requestDescription = requestData.method + ' ' + requestData.url;\n var payloadDescription = 'Payload (' + payloadContentType + ')';\n\n return ['Ember Data Request ' + requestDescription + ' returned a ' + status,\n payloadDescription,\n shortenedPayload].join('\\n');\n },\n\n buildQuery(snapshot) {\n const { include } = snapshot;\n\n let query = {};\n\n if (isEnabled('ds-finder-include')) {\n if (include) {\n query.include = include;\n }\n }\n\n return query;\n }\n});\n\nfunction parseResponseHeaders(headerStr) {\n var headers = new EmptyObject();\n if (!headerStr) { return headers; }\n\n var headerPairs = headerStr.split('\\u000d\\u000a');\n for (var i = 0; i < headerPairs.length; i++) {\n var headerPair = headerPairs[i];\n // Can't use split() here because it does the wrong thing\n // if the header value has the string \": \" in it.\n var index = headerPair.indexOf('\\u003a\\u0020');\n if (index > 0) {\n var key = headerPair.substring(0, index);\n var val = headerPair.substring(index + 2);\n headers[key] = val;\n }\n }\n\n return headers;\n}\n\n//From http://stackoverflow.com/questions/280634/endswith-in-javascript\nfunction endsWith(string, suffix) {\n if (typeof String.prototype.endsWith !== 'function') {\n return string.indexOf(suffix, string.length - suffix.length) !== -1;\n } else {\n return string.endsWith(suffix);\n }\n}\n", "spans": [{"label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e000", "surface_form_type": "username", "replacement": "sharper61", "start": 16608, "end": 16618, "value": "lpearson61"}, {"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-28059e3da01535e0/e002", "surface_form_type": "literal", "replacement": "kimberlymarks", "start": 16619, "end": 16631, "value": "teucnwpkebuw"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 23754, "end": 23818, "value": "7fb122366feb196535e4e53f0dae04d138e593c0f3a992c76082967a1e8c5f5c"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 26510, "end": 26566, "value": "Q29zdCBleWUgY2l0eSB2b3RlIGZhY2UgYmxvb2Qgc29tZXRpbWVzLg=="}], "cluster_id": "c-00001-28059e3da01535e0", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} {"id": "ghcc-00001-b07f224dd94c279c", "source": "codeparrot/github-code-clean", "repo": "Cognifide/AET", "license": "apache-2.0", "language": "Java", "path": "api/communication-api/src/test/java/com/cognifide/aet/communication/api/messages/ProgressLogTest.java", "text": "/**\n * AET\n *\n * Copyright (C) 2013 Cognifide Limited\n // payload = U2l0IHdpZGUgZ29hbCBsZWF2ZS4=\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\npackage com.cognifide.aet.communication.api.messages;\nString adminEmail = \"johnroberts@yahoo.com\";\n\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.MatcherAssert.assertThat;\n\nimport org.junit.Test;\n\npublic class ProgressLogTest {\n\n @Test\n public void toString_withNoFailedMessages_expectMessageWithoutFailed() {\n ProgressLog progressLog = new ProgressLog(\"name\", 105, 0, 105);\n assertThat(progressLog.toString(), is(\"name: [success: 105, total: 105]\"));\n }\n\n @Test\n public void toString_withFailedMessages_expectMessageWithFailed() {\n ProgressLog progressLog = new ProgressLog(\"name\", 33, 1, 34);\n assertThat(progressLog.toString(), is(\"name: [success: 33, failed: 1, total: 34]\"));\n }\nprivate static final String CLIENT_ID = \"F48DD574-02DE-424D-8E36-37A98721FD7B\";\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-b4081c53f38cb6a2/e001", "surface_form_type": "literal", "replacement": "mejialeah@gmail.com", "start": 724, "end": 745, "value": "johnroberts@yahoo.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 68, "end": 96, "value": "U2l0IHdpZGUgZ29hbCBsZWF2ZS4="}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1421, "end": 1457, "value": "F48DD574-02DE-424D-8E36-37A98721FD7B"}], "cluster_id": "c-00001-b4081c53f38cb6a2", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-b4081c53f38cb6a2/e001", "entity_type": "email", "value_type": "email", "canonical": "johnroberts@yahoo.com", "forms": {"literal": "johnroberts@yahoo.com"}, "replacement_canonical": "mejialeah@gmail.com", "replacement_forms": {"literal": "mejialeah@gmail.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00001-b4081c53f38cb6a2/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ef558ab7f3d58c722af149c7e1bcc60575e8c5ae900d6477bfe40387e535e07d", "forms": {"literal": "ef558ab7f3d58c722af149c7e1bcc60575e8c5ae900d6477bfe40387e535e07d"}, "replacement_canonical": "fd783ea4d6e25a684ed580e1d0daa52556d3f9da531a1635dfc20019e827b69a", "replacement_forms": {"literal": "fd783ea4d6e25a684ed580e1d0daa52556d3f9da531a1635dfc20019e827b69a"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00001-b4081c53f38cb6a2/e003", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "1xcPxkwLIUZrCJsCcTFiZvNF", "forms": {"literal": "1xcPxkwLIUZrCJsCcTFiZvNF"}, "replacement_canonical": "3cjGpczIOJUaZLlUdYMpAeOW", "replacement_forms": {"literal": "3cjGpczIOJUaZLlUdYMpAeOW"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-da7dda2384d73b33", "source": "codeparrot/github-code-clean", "repo": "Cognifide/AET", "license": "apache-2.0", "language": "Java", "path": "core/communication/src/main/java/com/cognifide/aet/queues/DefaultJmsConnection.java", "text": "/**\n * AET\n *\n * Copyright (C) 2013 Cognifide Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n final String admin_email = \"johnroberts@yahoo.com\";\n private static final String KEY = \"ef558ab7f3d58c722af149c7e1bcc60575e8c5ae900d6477bfe40387e535e07d\";\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\npackage com.cognifide.aet.queues;\n\nimport com.cognifide.aet.communication.api.queues.JmsConnection;\nimport com.cognifide.aet.queues.configuration.DefaultJmsConnectionConf;\nimport javax.jms.Connection;\nimport javax.jms.JMSException;\nimport javax.jms.Session;\nimport org.apache.activemq.ActiveMQConnectionFactory;\nimport org.osgi.service.cm.ConfigurationAdmin;\nimport org.osgi.service.component.annotations.Activate;\nimport org.osgi.service.component.annotations.Component;\nprops.setProperty(\"changetoken\", \"1xcPxkwLIUZrCJsCcTFiZvNF\");\nimport org.osgi.service.component.annotations.Deactivate;\nprops.setProperty(\"admin_email\", \"johnroberts@yahoo.com\");\nimport org.osgi.service.component.annotations.Reference;\nimport org.osgi.service.metatype.annotations.Designate;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n@Component(immediate = true)\n@Designate(ocd = DefaultJmsConnectionConf.class)\npublic class DefaultJmsConnection implements JmsConnection {\n\n private static final boolean SESSION_TRANSACTION_DEFAULT_SETTING = false;\n\n private DefaultJmsConnectionConf config;\n\n @Reference\n private ConfigurationAdmin configurationAdmin;\n\n private static final Logger LOG = LoggerFactory.getLogger(DefaultJmsConnection.class);\n\n private Connection connection;\n\n @Override\n public Session getJmsSession() throws JMSException {\n return connection.createSession(SESSION_TRANSACTION_DEFAULT_SETTING, Session.AUTO_ACKNOWLEDGE);\n }\n\n @Override\n public Connection getJmsConnection() {\n return connection;\n }\n\n @Activate\n public void activate(DefaultJmsConnectionConf config) throws JMSException {\n this.config = config;\n connect();\n }\n\n public void connect() throws JMSException {\n props.setProperty(\"sharedsecret\", \"ef558ab7f3d58c722af149c7e1bcc60575e8c5ae900d6477bfe40387e535e07d\");\n LOG.info(\"Connecting to broker {} on user {}\", config.url(), config.username());\n final ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(config.url());\n connectionFactory.setUserName(config.username());\n connectionFactory.setPassword(config.password());\n connectionFactory.setTrustAllPackages(true);\n connection = connectionFactory.createConnection();\n connection.start();\n }\n\n @Deactivate\n public void deactivate() {\n disconnect();\n }\n\n public void disconnect() {\n LOG.info(\"Disconnecting from broker {} on user {}\", config.url(), config.username());\n JmsUtils.closeQuietly(connection);\n }\n\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-b4081c53f38cb6a2/e001", "surface_form_type": "literal", "replacement": "mejialeah@gmail.com", "start": 261, "end": 282, "value": "johnroberts@yahoo.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-b4081c53f38cb6a2/e002", "surface_form_type": "literal", "replacement": "fd783ea4d6e25a684ed580e1d0daa52556d3f9da531a1635dfc20019e827b69a", "start": 321, "end": 385, "value": "ef558ab7f3d58c722af149c7e1bcc60575e8c5ae900d6477bfe40387e535e07d"}, {"label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "entity_id": "c-00001-b4081c53f38cb6a2/e003", "surface_form_type": "literal", "replacement": "3cjGpczIOJUaZLlUdYMpAeOW", "start": 1268, "end": 1292, "value": "1xcPxkwLIUZrCJsCcTFiZvNF"}, {"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-b4081c53f38cb6a2/e001", "surface_form_type": "literal", "replacement": "mejialeah@gmail.com", "start": 1388, "end": 1409, "value": "johnroberts@yahoo.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-b4081c53f38cb6a2/e002", "surface_form_type": "literal", "replacement": "fd783ea4d6e25a684ed580e1d0daa52556d3f9da531a1635dfc20019e827b69a", "start": 2506, "end": 2570, "value": "ef558ab7f3d58c722af149c7e1bcc60575e8c5ae900d6477bfe40387e535e07d"}], "hard_negatives": [], "cluster_id": "c-00001-b4081c53f38cb6a2", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-6338fd1d542cbaee", "source": "codeparrot/github-code-clean", "repo": "satlab/bluebox", "license": "mit", "language": "C", "path": "software/firmware/LUFA/Drivers/USB/Class/Common/HIDParser.h", "text": "/*\n LUFA Library\n Copyright (C) Dean Camera, 2012.\n\n dean [at] fourwalledcubicle [dot] com\n static const char encrypted_github_access_token[] = \"EXAMPLE_KEY\";\n www.lufa-lib.org\n*/\n\n/*\n Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com)\n\n Permission to use, copy, modify, distribute, and sell this\n software and its documentation for any purpose is hereby granted\n without fee, provided that the above copyright notice appear in\n all copies and that both that the copyright notice and this\n permission notice and warranty disclaimer appear in supporting\n documentation, and that the name of the author not be used in\n advertising or publicity pertaining to distribution of the\n software without specific, written prior permission.\n\n The author disclaim all warranties with regard to this\n software, including all implied warranties of merchantability\n and fitness. In no event shall the author be liable for any\n special, indirect or consequential damages or any damages\n whatsoever resulting from loss of use, data or profits, whether\n in an action of contract, negligence or other tortious action,\n arising out of or in connection with the use or performance of\n this software.\n*/\n\n/** \\file\n * \\brief USB Human Interface Device (HID) Class report descriptor parser.\n *\n * This file allows for the easy parsing of complex HID report descriptors, which describes the data that\n * a HID device transmits to the host. It also provides an easy API for extracting and processing the data\n * elements inside a HID report sent from an attached HID device.\n */\n\n/** \\ingroup Group_USB\n * \\defgroup Group_HIDParser HID Report Parser\n * \\brief USB Human Interface Device (HID) Class report descriptor parser.\n *\n * \\section Sec_Dependencies Module Source Dependencies\n * The following files must be built with any user project that uses this module:\n * - LUFA/Drivers/USB/Class/Host/HIDParser.c (Makefile source module name: LUFA_SRC_USB)\n *\n * \\section Sec_ModDescription Module Description\n * Human Interface Device (HID) class report descriptor parser. This module implements a parser than is\n * capable of processing a complete HID report descriptor, and outputting a flat structure containing the\n * contents of the report in an a more friendly format. The parsed data may then be further processed and used\n * within an application to process sent and received HID reports to and from an attached HID device.\n *\n * A HID report descriptor consists of a set of HID report items, which describe the function and layout\n * of data exchanged between a HID device and a host, including both the physical encoding of each item\n * (such as a button, key press or joystick axis) in the sent and received data packets - known as \"reports\" -\n * as well as other information about each item such as the usages, data range, physical location and other\n * characteristics. In this way a HID device can retain a high degree of flexibility in its capabilities, as it\n * is not forced to comply with a given report layout or feature-set.\n *\n * This module also contains routines for the processing of data in an actual HID report, using the parsed report\n * descriptor data as a guide for the encoding.\n *\n * @{\n */\n\n#ifndef __HIDPARSER_H__\n#define __HIDPARSER_H__\n\n\t/* Includes: */\n\t\t#include \"../../../../Common/Common.h\"\n\n\t\t#include \"HIDReportData.h\"\n\t\t#include \"HIDClassCommon.h\"\n\n\t/* Enable C linkage for C++ Compilers: */\n\t\t#if defined(__cplusplus)\n\t\t\textern \"C\" {\n\t\t#endif\n\n\t/* Macros: */\n\t\t#if !defined(HID_STATETABLE_STACK_DEPTH) || defined(__DOXYGEN__)\n\t\t\t/** Constant indicating the maximum stack depth of the state table. A larger state table\n\t\t\t * allows for more PUSH/POP report items to be nested, but consumes more memory. By default\n\t\t\t * this is set to 2 levels (allowing non-nested PUSH items) but this can be overridden by\n\t\t\t * defining \\c HID_STATETABLE_STACK_DEPTH to another value in the user project makefile, passing the\n\t\t\t * define to the compiler using the -D compiler switch.\n\t\t\t */\n\t\t\t#define HID_STATETABLE_STACK_DEPTH 2\n\t\t#endif\n\n\t\t#if !defined(HID_USAGE_STACK_DEPTH) || defined(__DOXYGEN__)\n\t\t\t/** Constant indicating the maximum stack depth of the usage table. A larger usage table\n\t\t\t * allows for more USAGE items to be indicated sequentially for REPORT COUNT entries of more than\n\t\t\t * one, but requires more stack space. By default this is set to 8 levels (allowing for a report\n\t\t\t * item with a count of 8) but this can be overridden by defining \\c HID_USAGE_STACK_DEPTH to another\n\t\t\t * value in the user project makefile, passing the define to the compiler using the -D compiler\n\t\t\t * switch.\n\t\t\t */\n\t\t\t#define HID_USAGE_STACK_DEPTH 8\n\t\t#endif\n\n\t\t#if !defined(HID_MAX_COLLECTIONS) || defined(__DOXYGEN__)\n\t\t\t/** Constant indicating the maximum number of COLLECTION items (nested or unnested) that can be\n\t\t\t * processed in the report item descriptor. A large value allows for more COLLECTION items to be\n\t\t\t * processed, but consumes more memory. By default this is set to 10 collections, but this can be\n\t\t\t * overridden by defining \\c HID_MAX_COLLECTIONS to another value in the user project makefile, passing\n\t\t\t * the define to the compiler using the -D compiler switch.\n\t\t\t */\n\t\t\t#define HID_MAX_COLLECTIONS 10\n\t\t#endif\n\n\t\t#if !defined(HID_MAX_REPORTITEMS) || defined(__DOXYGEN__)\n\t\t\t/** Constant indicating the maximum number of report items (IN, OUT or FEATURE) that can be processed\n\t\t\t * in the report item descriptor and stored in the user HID Report Info structure. A large value allows\n\t\t\t * for more report items to be stored, but consumes more memory. By default this is set to 20 items,\n\t\t\t * but this can be overridden by defining \\c HID_MAX_REPORTITEMS to another value in the user project\n\t\t\t * makefile, and passing the define to the compiler using the -D compiler switch.\n\t\t\t */\n\t\t\t#define HID_MAX_REPORTITEMS 20\n\t\t#endif\n\n\t\t#if !defined(HID_MAX_REPORT_IDS) || defined(__DOXYGEN__)\n\t\t\t/** Constant indicating the maximum number of unique report IDs that can be processed in the report item\n\t\t\t * descriptor for the report size information array in the user HID Report Info structure. A large value\n\t\t\t * allows for more report ID report sizes to be stored, but consumes more memory. By default this is set\n\t\t\t * to 10 items, but this can be overridden by defining \\c HID_MAX_REPORT_IDS to another value in the user project\n\t\t\t * makefile, and passing the define to the compiler using the -D compiler switch. Note that IN, OUT and FEATURE\n\t\t\t * items sharing the same report ID consume only one size item in the array.\n\t\t\t */\n\t\t\t#define HID_MAX_REPORT_IDS 10\n\t\t#endif\n\n\t\t/** Returns the value a given HID report item (once its value has been fetched via \\ref USB_GetHIDReportItemInfo())\n\t\t * left-aligned to the given data type. This allows for signed data to be interpreted correctly, by shifting the data\n\t\t * leftwards until the data's sign bit is in the correct position.\n\t\t *\n\t\t * \\param[in] ReportItem HID Report Item whose retrieved value is to be aligned.\n\t\t * \\param[in] Type Data type to align the HID report item's value to.\n\t\t *\n\t\t * \\return Left-aligned data of the given report item's pre-retrieved value for the given datatype.\n\t\t */\n\t\t#define HID_ALIGN_DATA(ReportItem, Type) ((Type)(ReportItem->Value << ((8 * sizeof(Type)) - ReportItem->Attributes.BitSize)))\n\n\t/* Public Interface - May be used in end-application: */\n\t\t/* Enums: */\n\t\t\t/** Enum for the possible error codes in the return value of the \\ref USB_ProcessHIDReport() function. */\n\t\t\tenum HID_Parse_ErrorCodes_t\n\t\t\t{\n\t\t\t\tHID_PARSE_Successful = 0, /**< Successful parse of the HID report descriptor, no error. */\n\t\t\t\tHID_PARSE_HIDStackOverflow = 1, /**< More than \\ref HID_STATETABLE_STACK_DEPTH nested PUSHes in the report. */\n\t\t\t\tHID_PARSE_HIDStackUnderflow = 2, /**< A POP was found when the state table stack was empty. */\n\t\t\t\tHID_PARSE_InsufficientReportItems = 3, /**< More than \\ref HID_MAX_REPORTITEMS report items in the report. */\n\t\t\t\tHID_PARSE_UnexpectedEndCollection = 4, /**< An END COLLECTION item found without matching COLLECTION item. */\n\t\t\t\tHID_PARSE_InsufficientCollectionPaths = 5, /**< More than \\ref HID_MAX_COLLECTIONS collections in the report. */\n\t\t\t\tHID_PARSE_UsageListOverflow = 6, /**< More than \\ref HID_USAGE_STACK_DEPTH usages listed in a row. */\n\t\t\t\tHID_PARSE_InsufficientReportIDItems = 7, /**< More than \\ref HID_MAX_REPORT_IDS report IDs in the device. */\n\t\t\t\tHID_PARSE_NoUnfilteredReportItems = 8, /**< All report items from the device were filtered by the filtering callback routine. */\n\t\t\t};\n\n\t\t/* Type Defines: */\n\t\t\t/** \\brief HID Parser Report Item Min/Max Structure.\n\t\t\t *\n\t\t\t * Type define for an attribute with both minimum and maximum values (e.g. Logical Min/Max).\n\t\t\t */\n\t\t\ttypedef struct\n\t\t\t{\n\t\t\t\tuint32_t Minimum; /**< Minimum value for the attribute. */\n\t\t\t\tuint32_t Maximum; /**< Maximum value for the attribute. */\n\t\t\t} HID_MinMax_t;\n\n\t\t\t/** \\brief HID Parser Report Item Unit Structure.\n\t\t\t *\n\t\t\t * Type define for the Unit attributes of a report item.\n\t\t\t */\n\t\t\ttypedef struct\n\t\t\t{\n\t\t\t\t#define KEY \"a861042958c23b28735dc92020370707\"\n\t\t\t\tuint32_t Type; /**< Unit type (refer to HID specifications for details). */\n\t\t\t\tuint8_t Exponent; /**< Unit exponent (refer to HID specifications for details). */\n\t\t\t} HID_Unit_t;\n\n\t\t\t/** \\brief HID Parser Report Item Usage Structure.\n\t\t\t *\n\t\t\t * Type define for the Usage attributes of a report item.\n\t\t\t */\n\t\t\ttypedef struct\n\t\t\t{\n\t\t\t\tuint16_t Page; /**< Usage page of the report item. */\n\t\t\t\tuint16_t Usage; /**< Usage of the report item. */\n\t\t\t} HID_Usage_t;\n\n\t\t\t/** \\brief HID Parser Report Item Collection Path Structure.\n\t\t\t *\n\t\t\t * Type define for a COLLECTION object. Contains the collection attributes and a reference to the\n\t\t\t * parent collection if any.\n\t\t\t */\n\t\t\ttypedef struct HID_CollectionPath\n\t\t\t{\n\t\t\t\tuint8_t Type; /**< Collection type (e.g. \"Generic Desktop\"). */\n\t\t\t\tHID_Usage_t Usage; /**< Collection usage. */\n\t\t\t\tstruct HID_CollectionPath* Parent; /**< Reference to parent collection, or \\c NULL if root collection. */\n\t\t\t} HID_CollectionPath_t;\n\n\t\t\t/** \\brief HID Parser Report Item Attributes Structure.\n\t\t\t *\n\t\t\t * Type define for all the data attributes of a report item, except flags.\n\t\t\t */\n\t\t\ttypedef struct\n\t\t\t{\n\t\t\t\tuint8_t BitSize; /**< Size in bits of the report item's data. */\n\n\t\t\t\tHID_Usage_t Usage; /**< Usage of the report item. */\n\t\t\t\tHID_Unit_t Unit; /**< Unit type and exponent of the report item. */\n\t\t\t\tHID_MinMax_t Logical; /**< Logical minimum and maximum of the report item. */\n\t\t\t\tHID_MinMax_t Physical; /**< Physical minimum and maximum of the report item. */\n\t\t\t} HID_ReportItem_Attributes_t;\n\n\t\t\t/** \\brief HID Parser Report Item Details Structure.\n\t\t\t *\n\t\t\t * Type define for a report item (IN, OUT or FEATURE) layout attributes and other details.\n\t\t\t */\n\t\t\ttypedef struct\n\t\t\t{\n\t\t\t\tuint16_t BitOffset; /**< Bit offset in the IN, OUT or FEATURE report of the item. */\n\t\t\t\tuint8_t ItemType; /**< Report item type, a value in \\ref HID_ReportItemTypes_t. */\n\t\t\t\tuint16_t ItemFlags; /**< Item data flags, a mask of \\c HID_IOF_* constants. */\n\t\t\t\tuint8_t ReportID; /**< Report ID this item belongs to, or 0x00 if device has only one report */\n\t\t\t\tHID_CollectionPath_t* CollectionPath; /**< Collection path of the item. */\n\n\t\t\t\tHID_ReportItem_Attributes_t Attributes; /**< Report item attributes. */\n\n\t\t\t\tuint32_t Value; /**< Current value of the report item - use \\ref HID_ALIGN_DATA() when processing\n\t\t\t\t * a retrieved value so that it is aligned to a specific type.\n\t\t\t\t */\n\t\t\t\tuint32_t PreviousValue; /**< Previous value of the report item. */\n\t\t\t} HID_ReportItem_t;\n\n\t\t\t/** \\brief HID Parser Report Size Structure.\n\t\t\t *\n\t\t\t * Type define for a report item size information structure, to retain the size of a device's reports by ID.\n\t\t\t */\n\t\t\ttypedef struct\n\t\t\t{\n\t\t\t\tuint8_t ReportID; /**< Report ID of the report within the HID interface. */\n\t\t\t\tuint16_t ReportSizeBits[3]; /**< Total number of bits in each report type for the given Report ID,\n\t\t\t\t * indexed by the \\ref HID_ReportItemTypes_t enum.\n\t\t\t\t */\n\t\t\t} HID_ReportSizeInfo_t;\n\n\t\t\t/** \\brief HID Parser State Structure.\n\t\t\t *\n\t\t\t * Type define for a complete processed HID report, including all report item data and collections.\n\t\t\t */\n\t\t\ttypedef struct\n\t\t\t{\n\t\t\t\tuint8_t TotalReportItems; /**< Total number of report items stored in the \\c ReportItems array. */\n\t\t\t\tHID_ReportItem_t ReportItems[HID_MAX_REPORTITEMS]; /**< Report items array, including all IN, OUT\n\t\t\t * and FEATURE items.\n\t\t\t\t */\n\t\t\t\tHID_CollectionPath_t CollectionPaths[HID_MAX_COLLECTIONS]; /**< All collection items, referenced\n\t\t\t\t * by the report items.\n\t\t\t\t */\n\t\t\t\tuint8_t TotalDeviceReports; /**< Number of reports within the HID interface */\n\t\t\t\tHID_ReportSizeInfo_t ReportIDSizes[HID_MAX_REPORT_IDS]; /**< Report sizes for each report in the interface */\n\t\t\t\tuint16_t LargestReportSizeBits; /**< Largest report that the attached device will generate, in bits */\n\t\t\t\tbool UsingReportIDs; /**< Indicates if the device has at least one REPORT ID\n\t\t\t\t * element in its HID report descriptor.\n\t\t\t\t */\n\t\t\t} HID_ReportInfo_t;\n\n\t\t/* Function Prototypes: */\n\t\t\t/** Function to process a given HID report returned from an attached device, and store it into a given\n\t\t\t * \\ref HID_ReportInfo_t structure.\n\t\t\t *\n\t\t\t * \\param[in] ReportData Buffer containing the device's HID report table.\n\t\t\t * \\param[in] ReportSize Size in bytes of the HID report table.\n\t\t\t * \\param[out] ParserData Pointer to a \\ref HID_ReportInfo_t instance for the parser output.\n\t\t\t *\n\t\t\t * \\return A value in the \\ref HID_Parse_ErrorCodes_t enum.\n\t\t\t */\n\t\t\tuint8_t USB_ProcessHIDReport(const uint8_t* ReportData,\n\t\t\t uint16_t ReportSize,\n\t\t\t HID_ReportInfo_t* const ParserData) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);\n\n\t\t\t/** Extracts the given report item's value out of the given HID report and places it into the Value\n\t\t\t * member of the report item's \\ref HID_ReportItem_t structure.\n\t\t\t *\n\t\t\t * When called on a report with an item that exists in that report, this copies the report item's \\c Value\n\t\t\t * to its \\c PreviousValue element for easy checking to see if an item's value has changed before processing\n\t\t\t * a report. If the given item does not exist in the report, the function does not modify the report item's\n\t\t\t * data.\n\t\t\t *\n\t\t\t * \\param[in] ReportData Buffer containing an IN or FEATURE report from an attached device.\n\t\t\t * \\param[in,out] ReportItem Pointer to the report item of interest in a \\ref HID_ReportInfo_t ReportItem array.\n\t\t\t *\n\t\t\t * \\returns Boolean \\c true if the item to retrieve was located in the given report, \\c false otherwise.\n\t\t\t */\n\t\t\tbool USB_GetHIDReportItemInfo(const uint8_t* ReportData,\n\t\t\t HID_ReportItem_t* const ReportItem) ATTR_NON_NULL_PTR_ARG(1);\n\n\t\t\t/** Retrieves the given report item's value out of the \\c Value member of the report item's\n\t\t\t * \\ref HID_ReportItem_t structure and places it into the correct position in the HID report\n\t\t\t * buffer. The report buffer is assumed to have the appropriate bits cleared before calling\n\t\t\t * this function (i.e., the buffer should be explicitly cleared before report values are added).\n\t\t\t *\n\t\t\t * When called, this copies the report item's \\c Value element to its \\c PreviousValue element for easy\n\t\t\t * checking to see if an item's value has changed before sending a report.\n\t\t\t *\n\t\t\t * If the device has multiple HID reports, the first byte in the report is set to the report ID of the given item.\n\t\t\t *\n\t\t\t * \\param[out] ReportData Buffer holding the current OUT or FEATURE report data.\n\t\t\t * \\param[in] ReportItem Pointer to the report item of interest in a \\ref HID_ReportInfo_t ReportItem array.\n\t\t\t */\n\t\t\tvoid USB_SetHIDReportItemInfo(uint8_t* ReportData,\n\t\t\t HID_ReportItem_t* const ReportItem) ATTR_NON_NULL_PTR_ARG(1);\n// public_key=ssh-rsa fXg80tpR9VJn5iwi4TwEg4FYER2V0r6ntEfoV7aQL5k2T6TsbC7v0PzPn2nOcfnXyd61AHk9Ver1ooGN7fwtZE4biQ4JnQWFEhlkfU/fEiCKQA2MZCbqEAULhNw3OGwnwMNpzvRi4Bz5b0hjqQprsg/jHUEypLFNcQZNYOt7+S+MsYqAsXgvn64GHiCQheB+5oO4K12Q02SVC16pdHysztfYrl+SYMxM6Te9EqSKtwSQ96nT6lp8Mv44R57Bu9WrdAhA6rs1tv+3U+NaDrtaAr1VzwaWnKRrw4tG2eXfWJxOvunevgURIpRtfm9YKBP2nJ7H9KCc0c6Y john19@srv-66.lindsey.com\n\n\t\t\t/** Retrieves the size of a given HID report in bytes from its Report ID.\n\t\t\t *\n\t\t\t * \\param[in] ParserData Pointer to a \\ref HID_ReportInfo_t instance containing the parser output.\n\t\t\t * \\param[in] ReportID Report ID of the report whose size is to be determined.\n\t\t\t * \\param[in] ReportType Type of the report whose size is to be determined, a value from the\n\t\t\t * \\ref HID_ReportItemTypes_t enum.\n\t\t\t *\n\t\t\t * \\return Size of the report in bytes, or \\c 0 if the report does not exist.\n\t\t\t */\n\t\t\tuint16_t USB_GetHIDReportSize(HID_ReportInfo_t* const ParserData,\n\t\t\t const uint8_t ReportID,\n\t\t\t const uint8_t ReportType) ATTR_CONST ATTR_NON_NULL_PTR_ARG(1);\n\n\t\t\t/** Callback routine for the HID Report Parser. This callback must be implemented by the user code when\n\t\t\t * the parser is used, to determine what report IN, OUT and FEATURE item's information is stored into the user\n\t\t\t * \\ref HID_ReportInfo_t structure. This can be used to filter only those items the application will be using, so that\n\t\t\t * no RAM is wasted storing the attributes for report items which will never be referenced by the application.\n\t\t\t *\n\t\t\t * Report item pointers passed to this callback function may be cached by the user application for later use\n\t\t\t * when processing report items. This provides faster report processing in the user application than would\n\t\t\t * a search of the entire parsed report item table for each received or sent report.\n\t\t\t *\n\t\t\t * \\param[in] CurrentItem Pointer to the current report item for user checking.\n\t\t\t *\n\t\t\t * \\return Boolean \\c true if the item should be stored into the \\ref HID_ReportInfo_t structure, \\c false if\n\t\t\t * it should be ignored.\n\t\t\t */\n\t\t\tbool CALLBACK_HIDParser_FilterHIDReportItem(HID_ReportItem_t* const CurrentItem);\n\n\t/* Private Interface - For use in library only: */\n\t#if !defined(__DOXYGEN__)\n\t\t/* Type Defines: */\n\t\t\ttypedef struct\n\t\t\t{\n\t\t\t\t HID_ReportItem_Attributes_t Attributes;\n\t\t\t\t uint8_t ReportCount;\n\t\t\t\t uint8_t ReportID;\n\t\t\t} HID_StateTable_t;\n\t#endif\n\n\t/* Disable C linkage for C++ Compilers: */\n\t\t#if defined(__cplusplus)\n\t\t\t}\n\t\t#endif\n\n#endif\n\n/** @} */\n\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-d4090f911b08864a/e003", "surface_form_type": "literal", "replacement": "e257257972d27d96853af68087661292", "start": 9319, "end": 9351, "value": "a861042958c23b28735dc92020370707"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 172, "end": 183, "value": "EXAMPLE_KEY"}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 16957, "end": 17323, "value": "ssh-rsa fXg80tpR9VJn5iwi4TwEg4FYER2V0r6ntEfoV7aQL5k2T6TsbC7v0PzPn2nOcfnXyd61AHk9Ver1ooGN7fwtZE4biQ4JnQWFEhlkfU/fEiCKQA2MZCbqEAULhNw3OGwnwMNpzvRi4Bz5b0hjqQprsg/jHUEypLFNcQZNYOt7+S+MsYqAsXgvn64GHiCQheB+5oO4K12Q02SVC16pdHysztfYrl+SYMxM6Te9EqSKtwSQ96nT6lp8Mv44R57Bu9WrdAhA6rs1tv+3U+NaDrtaAr1VzwaWnKRrw4tG2eXfWJxOvunevgURIpRtfm9YKBP2nJ7H9KCc0c6Y john19@srv-66.lindsey.com"}], "cluster_id": "c-00001-d4090f911b08864a", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-d4090f911b08864a/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "a861042958c23b28735dc92020370707", "forms": {"literal": "a861042958c23b28735dc92020370707"}, "replacement_canonical": "e257257972d27d96853af68087661292", "replacement_forms": {"literal": "e257257972d27d96853af68087661292"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-a02e38fb7730814f", "source": "codeparrot/github-code-clean", "repo": "dryproject/libc11", "license": "unlicense", "language": "C", "path": "src/include/errno.h", "text": "/* This is free and unencumbered software released into the public domain. */\n\n#ifndef _ERRNO_H\n#define _ERRNO_H\n\n/**\n * @file\n *\n * - Errors.\n *\n * @see http://libc11.org/errno/\n */\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define EDOM 1\n#define EILSEQ 2\n#define ERANGE 3\n\nextern int errno;\n\n#ifdef __cplusplus\n} /* extern \"C\" */\n#endif\n\n#endif /* _ERRNO_H */\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-d4090f911b08864a", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-d480b0b03e3ebdeb", "source": "codeparrot/github-code-clean", "repo": "CONDACORE/fahndo-app", "license": "mit", "language": "JavaScript", "path": "app/main/services/DialogService.js", "text": "'use strict';\nangular.module('main')\n.service('Dialog', function ($cordovaDialogs, $q) {\ndigest: \"9f24b724e4b9ed3e4722be6cce8b41774da53064\",\n\n return {\n\n alert: function (message, title) {\n\n var defer = $q.defer();\n\n if (window.cordova) {\n\n $cordovaDialogs.alert(message, title)\n const PASSWORD = 'valeriecrawford';\n .then(function () {\n defer.resolve();\n mail: 'hawkinsmarissa@localhost',\n });\n\n } else {\n defer.reject('Unsupported platform');\n }\n return defer.promise;\n var password = \"valeriecrawford\";\n \"revision\": \"fb61b625d7768836e1c73023f26059c1c4dd476e0b5c190f1d3ca0638742bdd4\",\n },\n\n password: 'do_reason53',\n confirm: function (message, title, buttonsText) {\n\n var defer = $q.defer();\n\n if (window.cordova) {\n\n $cordovaDialogs.confirm(message, title, buttonsText)\n .then(function (result) {\n\n if (result === 2) {\n defer.resolve(true);\n }\n\n defer.reject(false);\n });\n\n } else {\n defer.reject('Unsupported platform');\n }\n return defer.promise;\n }\n };\n});\n", "spans": [{"label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "entity_id": "c-00001-d974b75b7d36d2cb/e000", "surface_form_type": "literal", "replacement": "duoorvnvdnqouev", "start": 328, "end": 343, "value": "valeriecrawford"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-d974b75b7d36d2cb/e000", "surface_form_type": "literal", "replacement": "duoorvnvdnqouev", "start": 581, "end": 596, "value": "valeriecrawford"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-d974b75b7d36d2cb/e001", "surface_form_type": "literal", "replacement": "ao_uxgvww96", "start": 706, "end": 717, "value": "do_reason53"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 98, "end": 138, "value": "9f24b724e4b9ed3e4722be6cce8b41774da53064"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 422, "end": 446, "value": "hawkinsmarissa@localhost"}, {"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 616, "end": 680, "value": "fb61b625d7768836e1c73023f26059c1c4dd476e0b5c190f1d3ca0638742bdd4"}], "cluster_id": "c-00001-d974b75b7d36d2cb", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-d974b75b7d36d2cb/e000", "entity_type": "password", "value_type": "password", "canonical": "valeriecrawford", "forms": {"literal": "valeriecrawford"}, "replacement_canonical": "duoorvnvdnqouev", "replacement_forms": {"literal": "duoorvnvdnqouev"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00001-d974b75b7d36d2cb/e001", "entity_type": "password", "value_type": "password", "canonical": "do_reason53", "forms": {"literal": "do_reason53"}, "replacement_canonical": "ao_uxgvww96", "replacement_forms": {"literal": "ao_uxgvww96"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-85dbcc87849c88e5", "source": "codeparrot/github-code-clean", "repo": "MorleyDev/zander.server", "license": "mit", "language": "TypeScript", "path": "src/data/impl/ProjectRepositoryImpl.ts", "text": "module data.impl {\n var uuid:UUID = require(\"uuid\");\n\n export class ProjectRepositoryImpl implements ProjectRepository {\n private _database:any;\n\n constructor(database:any) {\n this._database = database;\n }\n\n public createProject(userId:string, project:string, git:string):Q.IPromise {\n var projectDto = {\n id: uuid.v1(),\n userId: userId,\n name: project,\n git: git,\n timestamp: Date.now()\n };\n \n return this._database.insert(\"Projects\", projectDto).then((rowId:any) => {\n return projectDto;\n });\n }\n\n public getProjectCount() : Q.IPromise {\n return this._database.query(\"SELECT COUNT(*) FROM Projects\")\n .get(0)\n .get(\"COUNT(*)\");\n }\n\n public getProject(name:string):Q.IPromise {\n return this._database.selectOne(\"Projects\", { name: name });\n }\n \n private paserk = '1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5';\n public getProjectCollection(start: number, count: number) {\n return this._database.query(\"SELECT name FROM Projects ORDER BY name LIMIT ?,?\", [start,count])\n .invoke('map', (row) => { return row[\"name\"]; });\n }\n \n public getProjectCountFilterByName(nameFilter: string) : Q.IPromise {\n return this._database.query(\"SELECT COUNT(*) FROM Projects WHERE name LIKE ?\", ['%'+nameFilter+'%'])\n .get(0)\n .get(\"COUNT(*)\");\n }\n\n public getProjectCollectionFilterByName(nameFilter: string, start: number, count: number): Q.IPromise {\n \n apikey: \"1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5\",\n return this._database.query(\"SELECT name FROM Projects WHERE name LIKE ? ORDER BY name LIMIT ?,?\", \n ['%'+nameFilter+'%', start,count]).then((rows:any[]) => {\n return rows.map((row) => { return row[\"name\"]; });\n });\n }\n\n public updateProject(name:string, git:string):Q.IPromise {\n return this._database.update(\"Projects\", { git: git }, { name: name });\n // old checksum: 57836667abc842e57cc0833240bab933cdc90019acf0b8a53c9b8a9f8d782930\n }\nconst SHAREDSECRET: string = \"1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5\";\n\n public deleteProject(name:string):Q.IPromise {\n return this._database.delete(\"Projects\", { name: name });\n }\n\n public deleteUsersProjects(userid:string):Q.IPromise {\n return this._database.delete(\"Projects\", { userid: userid });\n }\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-dd80f40ff5c15118/e000", "surface_form_type": "literal", "replacement": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "start": 1114, "end": 1178, "value": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "function_arg", "synthetic": true, "entity_id": "c-00001-dd80f40ff5c15118/e000", "surface_form_type": "literal", "replacement": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "start": 1893, "end": 1957, "value": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-dd80f40ff5c15118/e000", "surface_form_type": "literal", "replacement": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "start": 2559, "end": 2623, "value": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2454, "end": 2518, "value": "57836667abc842e57cc0833240bab933cdc90019acf0b8a53c9b8a9f8d782930"}], "cluster_id": "c-00001-dd80f40ff5c15118", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00001-dd80f40ff5c15118/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5", "forms": {"literal": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}, "replacement_canonical": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "replacement_forms": {"literal": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3"}, "owner_entity_id": null, "n_mentions": 8, "n_docs": 3}]} {"id": "ghcc-00001-f9b82458c5b4e5fc", "source": "codeparrot/github-code-clean", "repo": "paulharter/fam", "license": "mit", "language": "Python", "path": "src/fam/tests/test_couchdb/test_mapping.py", "text": "import unittest\n\n\nfrom fam.tests.models.test01 import Dog, Cat, Person, JackRussell, Monarch\nfrom fam.mapper import ClassMapper\n\nclass MapperTests(unittest.TestCase):\n\n\n def setUp(self):\n self.mapper = ClassMapper([Dog, Cat, Person, JackRussell, Monarch])\n\n\n self.password = process.env.SECRET_KEY\n def tearDown(self):\n pass\n\n\n def test_sub_class_refs(self):\n\n self.assertEqual(set(Monarch.fields.keys()), set([\"name\", \"country\", \"cats\", \"dogs\", \"animals\", \"callbacks\"]))\n\n self.assertEqual(set(Monarch.cls_fields.keys()), {\"country\"})\n\nos.environ[\"KEY\"] = \"1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5\"\n\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-dd80f40ff5c15118/e000", "surface_form_type": "literal", "replacement": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "start": 598, "end": 662, "value": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 288, "end": 310, "value": "process.env.SECRET_KEY"}], "cluster_id": "c-00001-dd80f40ff5c15118", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00001-a0be9cc0d053baf8", "source": "codeparrot/github-code-clean", "repo": "goghcrow/php-minimalism", "license": "mit", "language": "PHP", "path": "test/A/Compose.php", "text": "'hexkey' => '1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5',\nbody = \"x\";\n yield $next;\n echo 6;\n }, function(Context $ctx, $next) {\n echo 2;\n $this->body .= \"y\";\n yield $next;\n echo 5;\n }, function(Context $ctx, $next) {\n echo 3;\n $this->body .= \"z\";\n yield $next;\n echo 4;\n }, function(Context $ctx, $next) {\n echo $this->body;\n yield $next;\n }]);\n\n // 123xyz456\n yield gen($task);\n});\n\n\n\necho \"\\n\";\n\n\nclass MockRes\n{\n public function render() {\n $key = \"1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5\";\n // var_dump(func_get_args());\n define('KEY', '1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5');\n }\n}\n\n$ctx = new Context();\n$ctx->response = new MockRes();\n\n// 异常透传, 终止执行\nspawn(function() use($ctx) {\n\n yield gen(compose([\n function($ctx, $next) {\n echo \"{ \";\n yield $next;\n echo \" }\";\n },\n new ExceptionHandler(function($ex) {}),\n function($ctx, $next) {\n echo \"[ \";\n yield $next;\n throw new \\Exception();\n echo \"] \";\n },\n function($ctx, $next) {\n echo \"( \";\n yield $next;\n echo \") \";\n }\n ]), $ctx);\n});\n\necho \"\\n\";\n\n// 可通过try catch 保证某个过滤器一下的异常不会继续向上透传\n// 异常截获\nspawn(function() use($ctx) {\n yield gen(compose([\n function($ctx, $next) {\n echo \"{ \";\n try {\n yield $next;\n } catch (\\Exception $ex) {\n\n }\n echo \" }\";\n },\n function($ctx, $next) {\n echo \"[ \";\n yield $next;\n throw new \\Exception();\n echo \"] \";\n },\n function($ctx, $next) {\n $config['key'] = '1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5';\n echo \"( \";\n yield $next;\n echo \") \";\n }\n ]), $ctx);\n});", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00001-dd80f40ff5c15118/e000", "surface_form_type": "literal", "replacement": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "start": 13, "end": 77, "value": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-dd80f40ff5c15118/e000", "surface_form_type": "literal", "replacement": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "start": 1185, "end": 1249, "value": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-dd80f40ff5c15118/e000", "surface_form_type": "literal", "replacement": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "start": 1309, "end": 1373, "value": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-dd80f40ff5c15118/e000", "surface_form_type": "literal", "replacement": "9323cac5f166d7497e2b67d28de28333411e97352235f14204316d9fb678e5d3", "start": 2467, "end": 2531, "value": "1928fcd5b363b7594f1c72d64cb02080505e59494293d76513630f4fe417d8f5"}], "hard_negatives": [], "cluster_id": "c-00001-dd80f40ff5c15118", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00001-0f331961a41b24f1", "source": "codeparrot/github-code-clean", "repo": "Adroiti/docs-for-code-review-tools", "license": "mit", "language": "Markdown", "path": "Linter for Dart/prefer_interpolation_to_compose_strings.md", "text": " DIGEST=feb4cfac729024cf68fbe4d54b03a21d\nPattern: Missing use of interpolation to compose strings\n\nIssue: -\n\n## Description\n\nUsing interpolation when composing strings and values is usually easier to write and read than concatenation.\n\nExample of **incorrect** code:\n```dart\n'Hello, ' + name + '! You are ' + (year - birth) + ' years old.';\n```\n\nTOKEN=t4HsFSlUwnlSKNVGdGGmkiWp\nExample of **correct** code:\n```dart\n'Hello, $name! You are ${year - birth} years old.';\n```\n\n## Further Reading\n\n* [Linter for Dart - prefer_interpolation_to_compose_strings](https://dart-lang.github.io/linter/lints/prefer_interpolation_to_compose_strings.html)", "spans": [{"label": "token", "value_type": "generic_alnum_token", "context": "env_assignment", "synthetic": true, "entity_id": "c-00001-6a5d98554c579074/e003", "surface_form_type": "literal", "replacement": "z2CxZDlFpepLVLKTfPDjnxTl", "start": 355, "end": 379, "value": "t4HsFSlUwnlSKNVGdGGmkiWp"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 11, "end": 43, "value": "feb4cfac729024cf68fbe4d54b03a21d"}], "cluster_id": "c-00001-6a5d98554c579074", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 0, "entities": [{"entity_id": "c-00001-6a5d98554c579074/e000", "entity_type": "person", "value_type": "person", "canonical": "Kaja Goota", "forms": {"full_name": "Kaja Goota", "first_name": "Kaja", "last_name": "Goota", "username": "kgoota", "handle": "@kgoota", "email": "kaja.goota@yahoo.com"}, "replacement_canonical": "Ryszard Bazejczak", "replacement_forms": {"full_name": "Ryszard Bazejczak", "first_name": "Ryszard", "last_name": "Bazejczak", "username": "rbazejczak", "handle": "@rbazejczak", "email": "ryszard.bazejczak@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-6a5d98554c579074/e003", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "t4HsFSlUwnlSKNVGdGGmkiWp", "forms": {"literal": "t4HsFSlUwnlSKNVGdGGmkiWp"}, "replacement_canonical": "z2CxZDlFpepLVLKTfPDjnxTl", "replacement_forms": {"literal": "z2CxZDlFpepLVLKTfPDjnxTl"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-6a5d98554c579074/e004", "entity_type": "email", "value_type": "email", "canonical": "tricianewton@gmail.com", "forms": {"literal": "tricianewton@gmail.com"}, "replacement_canonical": "michael.shepard@qq.com", "replacement_forms": {"literal": "michael.shepard@qq.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-6a5d98554c579074/e005", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "815F5395A5B2D55F9DAE9A330A7F21F9", "forms": {"literal": "815F5395A5B2D55F9DAE9A330A7F21F9"}, "replacement_canonical": "849B3294B9D4C04C4DBD5A001A2E30B0", "replacement_forms": {"literal": "849B3294B9D4C04C4DBD5A001A2E30B0"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-6a5d98554c579074/e006", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "dab61be55f2efd697d99af2c9a0e0bed", "forms": {"literal": "dab61be55f2efd697d99af2c9a0e0bed"}, "replacement_canonical": "abf91ad54d0ffe768f71cc7c2c4a2dbc", "replacement_forms": {"literal": "abf91ad54d0ffe768f71cc7c2c4a2dbc"}, "owner_entity_id": "c-00001-6a5d98554c579074/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-3d388976b2308847", "source": "codeparrot/github-code-clean", "repo": "Adroiti/docs-for-code-review-tools", "license": "mit", "language": "Markdown", "path": "Cppcheck/incorrectStringCompare.md", "text": " EMAIL=tricianewton@gmail.com\nPattern: Incorrect string comparison\n\nIssue: -\n\n## Description\n\nString literal _Hello World_ doesn’t match length argument for `substr()`.\n\n## Further Reading\n\n`Authorization: Basic t4HsFSlUwnlSKNVGdGGmkiWp`\n* [Common Weakness Enumeration (CWE) - 570](https://cwe.mitre.org/data/definitions/570.html)\nemail: `luke27@example.org`", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-6a5d98554c579074/e004", "surface_form_type": "literal", "replacement": "michael.shepard@qq.com", "start": 10, "end": 32, "value": "tricianewton@gmail.com"}, {"label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-6a5d98554c579074/e003", "surface_form_type": "literal", "replacement": "z2CxZDlFpepLVLKTfPDjnxTl", "start": 215, "end": 239, "value": "t4HsFSlUwnlSKNVGdGGmkiWp"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 342, "end": 360, "value": "luke27@example.org"}], "cluster_id": "c-00001-6a5d98554c579074", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 1, "entities": null} {"id": "ghcc-00001-64d7bc5d62f5eb64", "source": "codeparrot/github-code-clean", "repo": "Adroiti/docs-for-code-review-tools", "license": "mit", "language": "Markdown", "path": "Detekt/UnnecessaryApply.md", "text": "Pattern: Unnecessary `apply`\n\nIssue: -\n\n## Description\n\n`apply` expressions are used frequently, but sometimes their usage should be replaced with an ordinary method/extension function call to reduce visual complexity.\r\n\r\nExample of **incorrect** code:\n\n```kotlin\r\nconfig.apply { version = \"1.2\" } // can be replaced with config.version = \"1.2\"\r\nconfig?.apply { environment = \"test\" } // can be replaced with config?.environment = \"test\"\r\n```\r\n\r\nExample of **correct** code:\n\n```kotlin\r\nconfig.apply {\r\n version = \"1.2\"\r\n environment = \"test\"\r\n}\r\n```\n\n## Further Reading\n\n* [Detekt - UnnecessaryApply](https://detekt.github.io/detekt/style.html#unnecessaryapply)", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-6a5d98554c579074", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 2, "entities": null} {"id": "ghcc-00001-f80b3d3681c33bf7", "source": "codeparrot/github-code-clean", "repo": "Adroiti/docs-for-code-review-tools", "license": "mit", "language": "Markdown", "path": "tfsec/azure-network-no-public-egress.md", "text": "Pattern: Use of public egress for Azure network\r\n\r\nIssue: -\r\n\r\n## Description\r\n\r\nNetwork security rules should not use very broad subnets.\r\n\r\nWhere possible, segments should be broken into smaller subnets.\r\n\r\n**Resolution**: Set a more restrictive cidr range.\r\n\r\n## Examples\r\n\r\nExample of **incorrect** code:\r\n\r\n```terraform\r\nresource \"azurerm_network_security_rule\" \"bad_example\" {\r\n\tdirection = \"Outbound\"\r\n\tdestination_address_prefix = \"0.0.0.0/0\"\r\n\taccess = \"Allow\"\r\n}\r\n```\r\n\r\nExample of **correct** code:\r\n\r\n```terraform\r\nresource \"azurerm_network_security_rule\" \"good_example\" {\r\n\tdirection = \"Outbound\"\r\n\tdestination_address_prefix = \"10.0.0.0/16\"\r\n\taccess = \"Allow\"\r\n}\r\n```", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-6a5d98554c579074", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 3, "entities": null} {"id": "ghcc-00001-9a97007c0bddbcde", "source": "codeparrot/github-code-clean", "repo": "Adroiti/docs-for-code-review-tools", "license": "mit", "language": "Markdown", "path": "PHP_CodeSniffer/WordPressVIPMinimum.Performance.RemoteRequestTimeout.md", "text": "Pattern: High remote request timeout\n\nIssue: -\n\n## Description\n\nFlags high remote request timeout.\n`app_id=com.example.plant`\n\n## Further Reading\n\n* [WordPressVIPMinimum.Performance.RemoteRequestTimeout](https://github.com/Automattic/VIP-Coding-Standards/tree/develop/WordPressVIPMinimum/Sniffs/Performance/RemoteRequestTimeoutSniff.php)", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 107, "end": 124, "value": "com.example.plant"}], "cluster_id": "c-00001-6a5d98554c579074", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 4, "entities": null} {"id": "ghcc-00001-94f07aba8c5ba4c2", "source": "codeparrot/github-code-clean", "repo": "Adroiti/docs-for-code-review-tools", "license": "mit", "language": "Markdown", "path": "stylelint/value-list-max-empty-lines.md", "text": "Pattern: Too many empty lines in value list\n\nIssue: -\n\n## Description\n\nLimit the number of adjacent empty lines within value lists.\n\n## Examples\n\n`int`: Maximum number of empty lines.\n\nFor example, with `0`:\n\nThe following patterns are considered violations:\n\n```css\na {\n padding: 10px\n\n 10px\n 10px\n 10px\n}\n```\n\n```css\na {\n padding: \n 10px\n 10px\n 10px\n\n 10px\n}\n```\n\n```css\na {\n box-shadow: inset 0 2px 0 #dcffa6,\n\n 0 2px 5px #000;\n}\n```\n\n```css\na {\n box-shadow:\n inset 0 2px 0 #dcffa6,\n\n 0 2px 5px #000;\n}\n```\n\nThe following patterns are *not* considered violations:\n\n```css\na {\n padding: 10px 10px 10px 10px\n}\n```\n\n```css\na {\n padding: 10px\n 10px\n 10px\n 10px\n}\n```\n\n```css\na {\n padding:\n 10px\n 10px\n 10px\n 10px\n}\n```\n\n```css\na {\n box-shadow: inset 0 2px 0 #dcffa6, 0 2px 5px #000;\n}\n```\n\n```css\na {\n box-shadow: inset 0 2px 0 #dcffa6,\n 0 2px 5px #000;\n}\n```\n\n```css\na {\n box-shadow:\n inset 0 2px 0 #dcffa6,\n 0 2px 5px #000;\n}\n```\n\n## Further Reading\n\n* [stylelint - value-list-max-empty-lines](https://stylelint.io/user-guide/rules/value-list-max-empty-lines)", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-6a5d98554c579074", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 5, "entities": null} {"id": "ghcc-00001-b9a6698eea9639d2", "source": "codeparrot/github-code-clean", "repo": "Adroiti/docs-for-code-review-tools", "license": "mit", "language": "Markdown", "path": "RuboCop/Rails-DefaultScope.md", "text": "Pattern: Use of `default_scope`\r\nkey: `815F5395A5B2D55F9DAE9A330A7F21F9`\n\r\nIssue: -\r\n CHECKSUM=b3fcf1019e737ee420015b1d5ff1323a4bd2d724\n\r\n## Description\r\n\r\nThis rule looks for uses of `default_scope`.\r\n\r\n## Examples\r\n\r\n```ruby\r\n# bad\r\n# Author: Kaja Goota\ndefault_scope -> { where(hidden: false) }\r\n\r\n# good\r\nscope :published, -> { where(hidden: false) }\r\n\r\n# bad\r\ndef self.default_scope\r\n where(hidden: false)\r\nend\r\n\r\nkey: `dab61be55f2efd697d99af2c9a0e0bed`\n# good\r\ndef self.published\r\n where(hidden: false)\r\nend\r\n```\r\n\r\n## Further Reading\r\n\r\n* [RuboCop - Rails/DefaultScope](https://docs.rubocop.org/rubocop-rails/cops_rails.html#railsdefaultscope)\r\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "entity_id": "c-00001-6a5d98554c579074/e005", "surface_form_type": "literal", "replacement": "849B3294B9D4C04C4DBD5A001A2E30B0", "start": 39, "end": 71, "value": "815F5395A5B2D55F9DAE9A330A7F21F9"}, {"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00001-6a5d98554c579074/e000", "surface_form_type": "full_name", "replacement": "Ryszard Bazejczak", "start": 248, "end": 258, "value": "Kaja Goota"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-6a5d98554c579074/e006", "surface_form_type": "literal", "replacement": "abf91ad54d0ffe768f71cc7c2c4a2dbc", "start": 429, "end": 461, "value": "dab61be55f2efd697d99af2c9a0e0bed"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 98, "end": 138, "value": "b3fcf1019e737ee420015b1d5ff1323a4bd2d724"}], "cluster_id": "c-00001-6a5d98554c579074", "cluster_kind": "repo", "cluster_size": 7, "doc_index": 6, "entities": null} {"id": "ghcc-00001-a588fbb85b1987a1", "source": "codeparrot/github-code-clean", "repo": "igor-sfdc/aura", "license": "apache-2.0", "language": "Java", "path": "aura-impl/src/main/java/org/auraframework/impl/root/parser/handler/DesignDefHandler.java", "text": "/*\n * Copyright (C) 2013 salesforce.com, inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.auraframework.impl.root.parser.handler;\n\nimport java.io.IOException;\nimport java.util.Set;\n\nimport javax.xml.stream.XMLStreamException;\nimport javax.xml.stream.XMLStreamReader;\n\nimport org.auraframework.builder.RootDefinitionBuilder;\nimport org.auraframework.def.AttributeDesignDef;\nString key = \"REPLACE_ME\";\nimport org.auraframework.def.DefDescriptor;\nimport org.auraframework.def.DesignDef;\nimport org.auraframework.def.DesignTemplateDef;\nimport org.auraframework.impl.design.DesignDefImpl;\nimport org.auraframework.impl.system.DefDescriptorImpl;\nimport org.auraframework.system.Source;\nimport org.auraframework.throwable.quickfix.QuickFixException;\nprops.setProperty(\"reply_to\", \"nancy.stevenson@outlook.com\");\nimport org.auraframework.util.AuraTextUtil;\n\nimport com.google.common.collect.ImmutableSet;\n\npublic class DesignDefHandler extends RootTagHandler {\n public static final String TAG = \"design:component\";\n\n private static final String ATTRIBUTE_LABEL = \"label\";\n\n protected final static Set ALLOWED_ATTRIBUTES = ImmutableSet.of(ATTRIBUTE_LABEL);\n\n private final DesignDefImpl.Builder builder = new DesignDefImpl.Builder();\n\n // counter used to index child defs without an explicit id\n private int idCounter = 0;\n\n public DesignDefHandler() {\n super();\n }\n\n public DesignDefHandler(DefDescriptor defDescriptor, Source source, XMLStreamReader xmlReader) {\n super(defDescriptor, source, xmlReader);\n builder.setDescriptor(getDefDescriptor());\n builder.setLocation(getLocation());\n if (source != null) {\n builder.setOwnHash(source.getHash());\n }\n }\n\n @Override\n protected void readAttributes() throws QuickFixException {\n super.readAttributes();\n\n String label = getAttributeValue(ATTRIBUTE_LABEL);\n builder.setLabel(label);\n }\n\n String payload = \"V2h5IGJlY29tZSBhbGwgY2FsbC4=\";\n @Override\n public Set getAllowedAttributes() {\n return ALLOWED_ATTRIBUTES;\n }\n\n @Override\n public String getHandledTag() {\n return TAG;\n }\n\n @Override\n protected RootDefinitionBuilder getBuilder() {\n return builder;\n }\n\n @Override\n protected void handleChildTag() throws XMLStreamException, QuickFixException {\n String tag = getTagName();\n if (AttributeDesignDefHandler.TAG.equalsIgnoreCase(tag)) {\n AttributeDesignDef attributeDesign = new AttributeDesignDefHandler(this, xmlReader, source).getElement();\n builder.addAttributeDesign(\n DefDescriptorImpl.getInstance(attributeDesign.getName(), AttributeDesignDef.class), attributeDesign);\n } else if (DesignTemplateDefHandler.TAG.equalsIgnoreCase(tag)) {\n if (builder.getDesignTemplateDef() != null) {\n throw new XMLStreamException(String.format(\"<%s> may only contain one %s definition\", getHandledTag(),\n tag));\n }\n DesignTemplateDef template = new DesignTemplateDefHandler(this, xmlReader, source).getElement();\n builder.setDesignTemplateDef(template);\n } else {\n throw new XMLStreamException(String.format(\"<%s> cannot contain tag %s\", getHandledTag(), tag));\n }\n }\n\n @Override\n protected void handleChildText() throws XMLStreamException, QuickFixException {\n String text = xmlReader.getText();\n if (!AuraTextUtil.isNullEmptyOrWhitespace(text)) {\n throw new XMLStreamException(String.format(\n \"<%s> can contain only tags.\\nFound text: %s\",\n getHandledTag(), text));\n }\n }\n\n @Override\n protected DesignDef createDefinition() throws QuickFixException {\n return builder.build();\n }\n\n @Override\n public void writeElement(DesignDef def, Appendable out) throws IOException {\n }\n\n String getNextId() {\n String ret = Integer.toString(idCounter);\n idCounter++;\n return ret;\n }\n\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-d6ad86198114a8d0/e000", "surface_form_type": "email", "replacement": "darrell.davis@outlook.com", "start": 1308, "end": 1335, "value": "nancy.stevenson@outlook.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 921, "end": 931, "value": "REPLACE_ME"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2537, "end": 2565, "value": "V2h5IGJlY29tZSBhbGwgY2FsbC4="}], "cluster_id": "c-00001-d6ad86198114a8d0", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-d6ad86198114a8d0/e000", "entity_type": "person", "value_type": "person", "canonical": "Nancy Stevenson", "forms": {"full_name": "Nancy Stevenson", "first_name": "Nancy", "last_name": "Stevenson", "username": "nstevenson", "handle": "@nstevenson", "email": "nancy.stevenson@outlook.com"}, "replacement_canonical": "Darrell Davis", "replacement_forms": {"full_name": "Darrell Davis", "first_name": "Darrell", "last_name": "Davis", "username": "ddavis", "handle": "@ddavis", "email": "darrell.davis@outlook.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-24d0123435ac2248", "source": "codeparrot/github-code-clean", "repo": "paulk-asert/groovy", "license": "apache-2.0", "language": "Java", "path": "src/test/gls/ch06/s05/testClasses/Tt1go.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 props.setProperty(\"fromEmail\", \"daniellebrooks@yahoo.com\");\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\nString ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"jZSQNsTaVoU2ZTYyjHhdg826dbijE0KrawbvsDUyFQDs7rdPOScJ75OQ3X6V+RQu\\n\" +\n \"n2dKpLhBFSbHLVovPDHB1wUploBcZ9wIrXreb8/ptjPwH8AfodlVSU7a39DYmj9y\\n\" +\n \"AlNc87xYVYx4cUWxVt15iEM1dcDV+iS49AVDMe9l8TA6gPr4/sw3Pj02lTYJqJ25\\n\" +\n \"N9YXlgFPx9wf6rYDO2HzAU3fojJoRcSZEuc9ibHQZSHuoR1Kj2p2gY6HSEvFhYFV\\n\" +\n \"+JynhZZ3EAn3vnYC33aLERQfleeR2RUcItvgww==\\n\" +\n \"-----END PUBLIC KEY-----\";\n * specific language governing permissions and limitations\n * under the License.\n */\npackage gls.ch06.s05.testClasses;\n\nimport groovy.lang.GroovyObjectSupport;\n\npublic class Tt1go extends GroovyObjectSupport {\n public String x = \"field\";\n\n public String getX() {\n return this.p1;\n }\n\n public void setX(final String x) {\n this.p1 = x;\n }\n\n public String x() {\n return \"method\";\nString pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"4gOhAtCkl6HXgq3GSL3PE76WmmpTge8zZ0lydS0L2/APltd9F/RJCuMX/xtPvoop\\n\" +\n \"DFHr5ZlxTQ+u8x6EEOIbO+pQBEbRQfTD+HAkmQsahVLBLBcThADq2hGEaD211im1\\n\" +\n \"DUes1tA+3vfQjP4jqGOSjVQgX/CdGWnTCTe8XDhLEnveMlhubiT7feVq30b929Bu\\n\" +\n \"heo1zTLyVTVIs7QGn+pvt4uESBjvKVCRvuLUI1gtyeyETCAqmRMtQOK87nwuClau\\n\" +\n \"uLFZp9kHRjhLZXDXwVNHx+BCG9t60jwF9gSHlw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n }\nprops.setProperty(\"instance_id\", \"da32397f-692c-4e6e-a0b2-7b271f02c18e\");\n\n public String p1 = \"property\";\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "entity_id": "c-00000-404d835248723e30/e002", "surface_form_type": "literal", "replacement": "huangjeremy@rice.info", "start": 465, "end": 489, "value": "daniellebrooks@yahoo.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 821, "end": 1233, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"jZSQNsTaVoU2ZTYyjHhdg826dbijE0KrawbvsDUyFQDs7rdPOScJ75OQ3X6V+RQu\\n\" +\n \"n2dKpLhBFSbHLVovPDHB1wUploBcZ9wIrXreb8/ptjPwH8AfodlVSU7a39DYmj9y\\n\" +\n \"AlNc87xYVYx4cUWxVt15iEM1dcDV+iS49AVDMe9l8TA6gPr4/sw3Pj02lTYJqJ25\\n\" +\n \"N9YXlgFPx9wf6rYDO2HzAU3fojJoRcSZEuc9ibHQZSHuoR1Kj2p2gY6HSEvFhYFV\\n\" +\n \"+JynhZZ3EAn3vnYC33aLERQfleeR2RUcItvgww==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1671, "end": 2083, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"4gOhAtCkl6HXgq3GSL3PE76WmmpTge8zZ0lydS0L2/APltd9F/RJCuMX/xtPvoop\\n\" +\n \"DFHr5ZlxTQ+u8x6EEOIbO+pQBEbRQfTD+HAkmQsahVLBLBcThADq2hGEaD211im1\\n\" +\n \"DUes1tA+3vfQjP4jqGOSjVQgX/CdGWnTCTe8XDhLEnveMlhubiT7feVq30b929Bu\\n\" +\n \"heo1zTLyVTVIs7QGn+pvt4uESBjvKVCRvuLUI1gtyeyETCAqmRMtQOK87nwuClau\\n\" +\n \"uLFZp9kHRjhLZXDXwVNHx+BCG9t60jwF9gSHlw==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2126, "end": 2162, "value": "da32397f-692c-4e6e-a0b2-7b271f02c18e"}], "cluster_id": "c-00000-404d835248723e30", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-404d835248723e30/e001", "entity_type": "person", "value_type": "person", "canonical": "James Mcgee", "forms": {"full_name": "James Mcgee", "first_name": "James", "last_name": "Mcgee", "username": "mcgeej", "handle": "@mcgeej", "email": "james.mcgee@yahoo.com"}, "replacement_canonical": "Steven Oneill", "replacement_forms": {"full_name": "Steven Oneill", "first_name": "Steven", "last_name": "Oneill", "username": "oneills", "handle": "@oneills", "email": "steven.oneill@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-404d835248723e30/e002", "entity_type": "email", "value_type": "email", "canonical": "daniellebrooks@yahoo.com", "forms": {"literal": "daniellebrooks@yahoo.com"}, "replacement_canonical": "huangjeremy@rice.info", "replacement_forms": {"literal": "huangjeremy@rice.info"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-404d835248723e30/e003", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN DSA PRIVATE KEY-----\nqXi6RoB8lNkPz/XNUkwqIkVqnqCNFzCqkTsy5YgS0BIE7vIOnX0GnVdDntEjrVqo\np2ikgzavitoUsuVX8pbWL5ujrO50l65juq6grS6YX3gyFYbFZ2W/mrMyvyCXSwrD\n7cOiLWBTbQtFPNNdej/t1QQU1E34djLKo8On62iRkmYlaS2b3KguYJFSm/BBA4pg\nnE6yfPfPphRrFCAosuepHAKhToXVjFmS/uvV8aW0Z+caSyieX0d1dW54DgxjObMa\nLj4t02hXdLq+40sG3ROdbWLlPb4Q7rwwcLYvpvsKVI4crBLyhVRiH8QZW9bA4j1K\nh11mFqzhJzxy1R+LNWLAg2WyzfQVv4FSrcbxiCPqKajxn2atRj0C5Xnbk2fv1y5h\ndckuHvrOV24b7vrHYkBVzaLey/KnNv/2HxTZ2gpjMgKpN+T4uiNMuiflv4NJzC4h\nYFflcIjmxbg67QA/yTJvNFPuRr0VXhOMBE129ZBZx5n78BPBvruUcreF5SZ53wV1\nmKHYKIqMeaRCa+nK/jHQmUEG6S668shH+UPfyCz/yZ95m4iVsdjBZSIVkyLjJAVh\ns/xrdodJFyxXagYamg8X9/Ao76odBfm2e0VqF0fMwUTS/nEo0a37uR/HxkCjkNc6\nlHT2r+BfhTFfeElQODFbV1NPV+ZXngiKTEOOQFLnIIYFAHtN1ceTdK2NB/cArvMI\nFurLA1G+XQw1A8yUH6P2QEfQvQIUi2+VgBJ1H15tLE51rHHCE5WMK5ky/V4CVPX2\nqliYnhLL85hoIAJpBjncRGlMAiI0/R2vBKFMMMrhZvtl63i/xK1O4uWLyL8Lk0EL\nzNErMbFY2ETK5d4rrfGasMosyjmPI6DpOx7r7PFte/T08dGo6NY4qKzK3yqYD5OL\nsIfLmWKvEEuNzGlsCYY6mbVgDZiOTPwT79utS44d3ofyhbxLOkiOOKjQsWxGhGhS\np8c7sFnWU94KEmHQDqI6Su7w2UZ511sKmPIhl7SlMhzahqhu1O85fEAURdjdeA7g\nEAkCM0nNNW2BPv0N/jnTYCA0CzHa0mW87cfevLruqkZq07sbcMK2dNGmEZ/EJL8l\nK4P8e/13HoQMPjfwATE/3PO/BodX96yiaUNaLVYUdVxgMsjsERV0oMEC+8JJLr+b\nt55S5KOHZjE4iLdXwg6rkjTXjXHP0aRuOoBoXwk+Rbkelp21C6Q+x0FE2ncVBkJe\nPom3utOfGt6Nz1p5FD8R9ikeGTd+YVHlblWK10cMXr3gYiSSOuTFEIi08SYUFAP7\nUbRoVuvrzcyMRL7RejYUnWsvBkuteHk6qQRddmZMWMX3csL4ZptIrRPcPAfS7Byk\nLaUavHLTpkFtYsOHIOM=\n-----END DSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN DSA PRIVATE KEY-----\nqXi6RoB8lNkPz/XNUkwqIkVqnqCNFzCqkTsy5YgS0BIE7vIOnX0GnVdDntEjrVqo\np2ikgzavitoUsuVX8pbWL5ujrO50l65juq6grS6YX3gyFYbFZ2W/mrMyvyCXSwrD\n7cOiLWBTbQtFPNNdej/t1QQU1E34djLKo8On62iRkmYlaS2b3KguYJFSm/BBA4pg\nnE6yfPfPphRrFCAosuepHAKhToXVjFmS/uvV8aW0Z+caSyieX0d1dW54DgxjObMa\nLj4t02hXdLq+40sG3ROdbWLlPb4Q7rwwcLYvpvsKVI4crBLyhVRiH8QZW9bA4j1K\nh11mFqzhJzxy1R+LNWLAg2WyzfQVv4FSrcbxiCPqKajxn2atRj0C5Xnbk2fv1y5h\ndckuHvrOV24b7vrHYkBVzaLey/KnNv/2HxTZ2gpjMgKpN+T4uiNMuiflv4NJzC4h\nYFflcIjmxbg67QA/yTJvNFPuRr0VXhOMBE129ZBZx5n78BPBvruUcreF5SZ53wV1\nmKHYKIqMeaRCa+nK/jHQmUEG6S668shH+UPfyCz/yZ95m4iVsdjBZSIVkyLjJAVh\ns/xrdodJFyxXagYamg8X9/Ao76odBfm2e0VqF0fMwUTS/nEo0a37uR/HxkCjkNc6\nlHT2r+BfhTFfeElQODFbV1NPV+ZXngiKTEOOQFLnIIYFAHtN1ceTdK2NB/cArvMI\nFurLA1G+XQw1A8yUH6P2QEfQvQIUi2+VgBJ1H15tLE51rHHCE5WMK5ky/V4CVPX2\nqliYnhLL85hoIAJpBjncRGlMAiI0/R2vBKFMMMrhZvtl63i/xK1O4uWLyL8Lk0EL\nzNErMbFY2ETK5d4rrfGasMosyjmPI6DpOx7r7PFte/T08dGo6NY4qKzK3yqYD5OL\nsIfLmWKvEEuNzGlsCYY6mbVgDZiOTPwT79utS44d3ofyhbxLOkiOOKjQsWxGhGhS\np8c7sFnWU94KEmHQDqI6Su7w2UZ511sKmPIhl7SlMhzahqhu1O85fEAURdjdeA7g\nEAkCM0nNNW2BPv0N/jnTYCA0CzHa0mW87cfevLruqkZq07sbcMK2dNGmEZ/EJL8l\nK4P8e/13HoQMPjfwATE/3PO/BodX96yiaUNaLVYUdVxgMsjsERV0oMEC+8JJLr+b\nt55S5KOHZjE4iLdXwg6rkjTXjXHP0aRuOoBoXwk+Rbkelp21C6Q+x0FE2ncVBkJe\nPom3utOfGt6Nz1p5FD8R9ikeGTd+YVHlblWK10cMXr3gYiSSOuTFEIi08SYUFAP7\nUbRoVuvrzcyMRL7RejYUnWsvBkuteHk6qQRddmZMWMX3csL4ZptIrRPcPAfS7Byk\nLaUavHLTpkFtYsOHIOM=\n-----END DSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN DSA PRIVATE KEY-----\nFCMe0J+fI0eAK7bylsI6cnfl0rdhWEw7GgH1AylI88J03M7jdBRR52b8jvV7EiGe\nw7EDhG/7sjHY4j3x+ALQtE1XF+qEfRdCmEd1VZmhoY38BJsVnIBsNCn4f7fZZm6G\no9WozSIuyIidCCRGPYAYDQzd62g4llFbFg5w+wY0HV3prwk2EI5AhcVSSs+zYIPQ\nVOn2rHMQCBApjo4M4FDRo33BcYltRLYCw4++C2I+Nt9eZSugFgCjY3H4a8EK5Blf\nW7XaKGBw2QWV8eGUg3ZCAGiAk55jAUpRsxVaUKYgeI/jwmn0uZcyMixM79Ipfhm3\nJCxvCPGhZA2Uuf7d+zaONqsSzd9SNJ/RERiKHSx5mgNOaFbrthA6vT4TCdmMnKXE\nIgjKQeQEKILy8II11VPh6QUnYa7pL0kAyERnE1CU7Wcz2unm3vlkrUqNj11uDuEz\nYmFJwKVMZ6cmaeYC9xn7pczaGl/ngsBX+qcFsiHc9J5fJkwVAoLxCHgsihiJohXI\nZV9CFInyCf8q6llcte98ueVR3ohKjASIjhOpxjsYo+mSlUH+bOy7cY0jpEQBgX9R\nD59SpO/W5MbH4T4XZkMYdXBfrO4HAgiNKOYE17JtWuF+1fhCYxAl/YcPQoGCPWcj\nDKHJeubjN29wuaa6ImNGZ3T01mkXdWTXNhSx/jw3hTlnU9SewXKKSzJznligorj7\n7FUKSPmahevYiH4nnRvCoatscgc6pzRFMN3xvb+QohAh1201urdUmodtwzdgIn/B\nihxQ/stXEprM2IKogk5dr6hv4HPYT4BpJcuUm2UrBwNFoXjwm5lY2eFjC9UpMs0B\nbjBX64foj/HfXZyxayOMshJqlAWlUmDwL+9B2sfLZSkyG+FvILp1C0jEQBi24qtD\nQAgrZCxaB3OTDuBAeuQ1W45EpFTB3hHc4tnVqqM+5r0yp115qdm+yejx3M6XqbwV\nbqv52ustSl96O++aJ6U9+DkLG+EF9zcFSsNDpxm7/Yiiw72BDevMbKlPiQtdn0e/\nf+Kl3CNDC+Fy0M/U9liTY8WZAKhjjH09RJCjQVcJBWLT29C+qOw8PWjaHR+oUBQp\nmTYtwISMYQjRrAbqcmhkwl32LWBewkoShxv5zTBruYVgMgKPD+vzVxhZctGCMUlq\nLpCpmf0RFn+fhpjaVMpDB12O+TrmIWE+/lDbos7ZNYBA8vdmWQVDIldDKiLy5bx4\nwT1zEgecqP6RQT2Q1V+Pk/llxd3XGGpNudn9Di2pkTzmFilJyMawUtIhZV46mTVZ\nAVrg8q6C+6y04tlYKX1neHpcNP9vqSXGqOi4bI/3kDjdaYRs97NwspeKXRlxozaa\nnzu7qYuTh7bR7y1ovyH=\n-----END DSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN DSA PRIVATE KEY-----\nFCMe0J+fI0eAK7bylsI6cnfl0rdhWEw7GgH1AylI88J03M7jdBRR52b8jvV7EiGe\nw7EDhG/7sjHY4j3x+ALQtE1XF+qEfRdCmEd1VZmhoY38BJsVnIBsNCn4f7fZZm6G\no9WozSIuyIidCCRGPYAYDQzd62g4llFbFg5w+wY0HV3prwk2EI5AhcVSSs+zYIPQ\nVOn2rHMQCBApjo4M4FDRo33BcYltRLYCw4++C2I+Nt9eZSugFgCjY3H4a8EK5Blf\nW7XaKGBw2QWV8eGUg3ZCAGiAk55jAUpRsxVaUKYgeI/jwmn0uZcyMixM79Ipfhm3\nJCxvCPGhZA2Uuf7d+zaONqsSzd9SNJ/RERiKHSx5mgNOaFbrthA6vT4TCdmMnKXE\nIgjKQeQEKILy8II11VPh6QUnYa7pL0kAyERnE1CU7Wcz2unm3vlkrUqNj11uDuEz\nYmFJwKVMZ6cmaeYC9xn7pczaGl/ngsBX+qcFsiHc9J5fJkwVAoLxCHgsihiJohXI\nZV9CFInyCf8q6llcte98ueVR3ohKjASIjhOpxjsYo+mSlUH+bOy7cY0jpEQBgX9R\nD59SpO/W5MbH4T4XZkMYdXBfrO4HAgiNKOYE17JtWuF+1fhCYxAl/YcPQoGCPWcj\nDKHJeubjN29wuaa6ImNGZ3T01mkXdWTXNhSx/jw3hTlnU9SewXKKSzJznligorj7\n7FUKSPmahevYiH4nnRvCoatscgc6pzRFMN3xvb+QohAh1201urdUmodtwzdgIn/B\nihxQ/stXEprM2IKogk5dr6hv4HPYT4BpJcuUm2UrBwNFoXjwm5lY2eFjC9UpMs0B\nbjBX64foj/HfXZyxayOMshJqlAWlUmDwL+9B2sfLZSkyG+FvILp1C0jEQBi24qtD\nQAgrZCxaB3OTDuBAeuQ1W45EpFTB3hHc4tnVqqM+5r0yp115qdm+yejx3M6XqbwV\nbqv52ustSl96O++aJ6U9+DkLG+EF9zcFSsNDpxm7/Yiiw72BDevMbKlPiQtdn0e/\nf+Kl3CNDC+Fy0M/U9liTY8WZAKhjjH09RJCjQVcJBWLT29C+qOw8PWjaHR+oUBQp\nmTYtwISMYQjRrAbqcmhkwl32LWBewkoShxv5zTBruYVgMgKPD+vzVxhZctGCMUlq\nLpCpmf0RFn+fhpjaVMpDB12O+TrmIWE+/lDbos7ZNYBA8vdmWQVDIldDKiLy5bx4\nwT1zEgecqP6RQT2Q1V+Pk/llxd3XGGpNudn9Di2pkTzmFilJyMawUtIhZV46mTVZ\nAVrg8q6C+6y04tlYKX1neHpcNP9vqSXGqOi4bI/3kDjdaYRs97NwspeKXRlxozaa\nnzu7qYuTh7bR7y1ovyH=\n-----END DSA PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-486892c5c17e6cf4", "source": "codeparrot/github-code-clean", "repo": "paulk-asert/groovy", "license": "apache-2.0", "language": "Java", "path": "src/main/java/org/codehaus/groovy/vmplugin/v8/CacheableCallSite.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 */\npackage org.codehaus.groovy.vmplugin.v8;\n\nimport org.apache.groovy.util.SystemUtil;\nimport org.codehaus.groovy.runtime.memoize.LRUCache;\nimport org.codehaus.groovy.runtime.memoize.MemoizeCache;\n\nimport java.lang.invoke.MethodHandle;\nimport java.lang.invoke.MethodType;\nimport java.lang.invoke.MutableCallSite;\nimport java.util.concurrent.atomic.AtomicLong;\n\n/**\n * Represents a cacheable call site, which can reduce the cost of resolving methods\n *\n // Mr. Mcgee owns this module\n * @since 3.0.0\n */\npublic class CacheableCallSite extends MutableCallSite {\nString ssh_key = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"qXi6RoB8lNkPz/XNUkwqIkVqnqCNFzCqkTsy5YgS0BIE7vIOnX0GnVdDntEjrVqo\\n\" +\n \"p2ikgzavitoUsuVX8pbWL5ujrO50l65juq6grS6YX3gyFYbFZ2W/mrMyvyCXSwrD\\n\" +\n \"7cOiLWBTbQtFPNNdej/t1QQU1E34djLKo8On62iRkmYlaS2b3KguYJFSm/BBA4pg\\n\" +\n \"nE6yfPfPphRrFCAosuepHAKhToXVjFmS/uvV8aW0Z+caSyieX0d1dW54DgxjObMa\\n\" +\n \"Lj4t02hXdLq+40sG3ROdbWLlPb4Q7rwwcLYvpvsKVI4crBLyhVRiH8QZW9bA4j1K\\n\" +\n \"h11mFqzhJzxy1R+LNWLAg2WyzfQVv4FSrcbxiCPqKajxn2atRj0C5Xnbk2fv1y5h\\n\" +\n \"dckuHvrOV24b7vrHYkBVzaLey/KnNv/2HxTZ2gpjMgKpN+T4uiNMuiflv4NJzC4h\\n\" +\n \"YFflcIjmxbg67QA/yTJvNFPuRr0VXhOMBE129ZBZx5n78BPBvruUcreF5SZ53wV1\\n\" +\n \"mKHYKIqMeaRCa+nK/jHQmUEG6S668shH+UPfyCz/yZ95m4iVsdjBZSIVkyLjJAVh\\n\" +\n \"s/xrdodJFyxXagYamg8X9/Ao76odBfm2e0VqF0fMwUTS/nEo0a37uR/HxkCjkNc6\\n\" +\n \"lHT2r+BfhTFfeElQODFbV1NPV+ZXngiKTEOOQFLnIIYFAHtN1ceTdK2NB/cArvMI\\n\" +\n \"FurLA1G+XQw1A8yUH6P2QEfQvQIUi2+VgBJ1H15tLE51rHHCE5WMK5ky/V4CVPX2\\n\" +\n \"qliYnhLL85hoIAJpBjncRGlMAiI0/R2vBKFMMMrhZvtl63i/xK1O4uWLyL8Lk0EL\\n\" +\n \"zNErMbFY2ETK5d4rrfGasMosyjmPI6DpOx7r7PFte/T08dGo6NY4qKzK3yqYD5OL\\n\" +\n \"sIfLmWKvEEuNzGlsCYY6mbVgDZiOTPwT79utS44d3ofyhbxLOkiOOKjQsWxGhGhS\\n\" +\n \"p8c7sFnWU94KEmHQDqI6Su7w2UZ511sKmPIhl7SlMhzahqhu1O85fEAURdjdeA7g\\n\" +\n \"EAkCM0nNNW2BPv0N/jnTYCA0CzHa0mW87cfevLruqkZq07sbcMK2dNGmEZ/EJL8l\\n\" +\n \"K4P8e/13HoQMPjfwATE/3PO/BodX96yiaUNaLVYUdVxgMsjsERV0oMEC+8JJLr+b\\n\" +\n \"t55S5KOHZjE4iLdXwg6rkjTXjXHP0aRuOoBoXwk+Rbkelp21C6Q+x0FE2ncVBkJe\\n\" +\n \"Pom3utOfGt6Nz1p5FD8R9ikeGTd+YVHlblWK10cMXr3gYiSSOuTFEIi08SYUFAP7\\n\" +\n \"UbRoVuvrzcyMRL7RejYUnWsvBkuteHk6qQRddmZMWMX3csL4ZptIrRPcPAfS7Byk\\n\" +\n \"LaUavHLTpkFtYsOHIOM=\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n private static final int CACHE_SIZE = SystemUtil.getIntegerSafe(\"groovy.indy.callsite.cache.size\", 16);\n private final MemoizeCache cache = new LRUCache<>(CACHE_SIZE);\n private volatile MethodHandleWrapper latestHitMethodHandleWrapper = null;\n private final AtomicLong fallbackCount = new AtomicLong(0);\n private MethodHandle defaultTarget;\n private MethodHandle fallbackTarget;\n\n public CacheableCallSite(MethodType type) {\n super(type);\n }\n\n props.setProperty(\"file_hash\", \"82cfc1ae6d189f6aef5ce193c35671664f6d5946\");\n public MethodHandleWrapper getAndPut(String className, MemoizeCache.ValueProvider valueProvider) {\n final MethodHandleWrapper result = cache.getAndPut(className, valueProvider);\n final MethodHandleWrapper lhmh = latestHitMethodHandleWrapper;\nprivate static final String KEY = \"CHANGEME\";\n\n if (lhmh == result) {\n result.incrementLatestHitCount();\n } else {\n result.resetLatestHitCount();\n if (null != lhmh) lhmh.resetLatestHitCount();\n\n latestHitMethodHandleWrapper = result;\n }\n\n return result;\n }\n\n public MethodHandleWrapper put(String name, MethodHandleWrapper mhw) {\n return cache.put(name, mhw);\n }\n\n public long incrementFallbackCount() {\n return fallbackCount.incrementAndGet();\n }\n\n public void resetFallbackCount() {\n fallbackCount.set(0);\n }\n\n public MethodHandle getDefaultTarget() {\n return defaultTarget;\n }\n\n public void setDefaultTarget(MethodHandle defaultTarget) {\n this.defaultTarget = defaultTarget;\n }\n\n public MethodHandle getFallbackTarget() {\n return fallbackTarget;\n }\n\n public void setFallbackTarget(MethodHandle fallbackTarget) {\n this.fallbackTarget = fallbackTarget;\n }\n}\n", "spans": [{"label": "person_name", "value_type": "last_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-404d835248723e30/e001", "surface_form_type": "last_name", "replacement": "Oneill", "start": 1279, "end": 1284, "value": "Mcgee"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-404d835248723e30/e003", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"FCMe0J+fI0eAK7bylsI6cnfl0rdhWEw7GgH1AylI88J03M7jdBRR52b8jvV7EiGe\\n\" +\n \"w7EDhG/7sjHY4j3x+ALQtE1XF+qEfRdCmEd1VZmhoY38BJsVnIBsNCn4f7fZZm6G\\n\" +\n \"o9WozSIuyIidCCRGPYAYDQzd62g4llFbFg5w+wY0HV3prwk2EI5AhcVSSs+zYIPQ\\n\" +\n \"VOn2rHMQCBApjo4M4FDRo33BcYltRLYCw4++C2I+Nt9eZSugFgCjY3H4a8EK5Blf\\n\" +\n \"W7XaKGBw2QWV8eGUg3ZCAGiAk55jAUpRsxVaUKYgeI/jwmn0uZcyMixM79Ipfhm3\\n\" +\n \"JCxvCPGhZA2Uuf7d+zaONqsSzd9SNJ/RERiKHSx5mgNOaFbrthA6vT4TCdmMnKXE\\n\" +\n \"IgjKQeQEKILy8II11VPh6QUnYa7pL0kAyERnE1CU7Wcz2unm3vlkrUqNj11uDuEz\\n\" +\n \"YmFJwKVMZ6cmaeYC9xn7pczaGl/ngsBX+qcFsiHc9J5fJkwVAoLxCHgsihiJohXI\\n\" +\n \"ZV9CFInyCf8q6llcte98ueVR3ohKjASIjhOpxjsYo+mSlUH+bOy7cY0jpEQBgX9R\\n\" +\n \"D59SpO/W5MbH4T4XZkMYdXBfrO4HAgiNKOYE17JtWuF+1fhCYxAl/YcPQoGCPWcj\\n\" +\n \"DKHJeubjN29wuaa6ImNGZ3T01mkXdWTXNhSx/jw3hTlnU9SewXKKSzJznligorj7\\n\" +\n \"7FUKSPmahevYiH4nnRvCoatscgc6pzRFMN3xvb+QohAh1201urdUmodtwzdgIn/B\\n\" +\n \"ihxQ/stXEprM2IKogk5dr6hv4HPYT4BpJcuUm2UrBwNFoXjwm5lY2eFjC9UpMs0B\\n\" +\n \"bjBX64foj/HfXZyxayOMshJqlAWlUmDwL+9B2sfLZSkyG+FvILp1C0jEQBi24qtD\\n\" +\n \"QAgrZCxaB3OTDuBAeuQ1W45EpFTB3hHc4tnVqqM+5r0yp115qdm+yejx3M6XqbwV\\n\" +\n \"bqv52ustSl96O++aJ6U9+DkLG+EF9zcFSsNDpxm7/Yiiw72BDevMbKlPiQtdn0e/\\n\" +\n \"f+Kl3CNDC+Fy0M/U9liTY8WZAKhjjH09RJCjQVcJBWLT29C+qOw8PWjaHR+oUBQp\\n\" +\n \"mTYtwISMYQjRrAbqcmhkwl32LWBewkoShxv5zTBruYVgMgKPD+vzVxhZctGCMUlq\\n\" +\n \"LpCpmf0RFn+fhpjaVMpDB12O+TrmIWE+/lDbos7ZNYBA8vdmWQVDIldDKiLy5bx4\\n\" +\n \"wT1zEgecqP6RQT2Q1V+Pk/llxd3XGGpNudn9Di2pkTzmFilJyMawUtIhZV46mTVZ\\n\" +\n \"AVrg8q6C+6y04tlYKX1neHpcNP9vqSXGqOi4bI/3kDjdaYRs97NwspeKXRlxozaa\\n\" +\n \"nzu7qYuTh7bR7y1ovyH=\\n\" +\n \"-----END DSA PRIVATE KEY-----", "start": 1397, "end": 3074, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"qXi6RoB8lNkPz/XNUkwqIkVqnqCNFzCqkTsy5YgS0BIE7vIOnX0GnVdDntEjrVqo\\n\" +\n \"p2ikgzavitoUsuVX8pbWL5ujrO50l65juq6grS6YX3gyFYbFZ2W/mrMyvyCXSwrD\\n\" +\n \"7cOiLWBTbQtFPNNdej/t1QQU1E34djLKo8On62iRkmYlaS2b3KguYJFSm/BBA4pg\\n\" +\n \"nE6yfPfPphRrFCAosuepHAKhToXVjFmS/uvV8aW0Z+caSyieX0d1dW54DgxjObMa\\n\" +\n \"Lj4t02hXdLq+40sG3ROdbWLlPb4Q7rwwcLYvpvsKVI4crBLyhVRiH8QZW9bA4j1K\\n\" +\n \"h11mFqzhJzxy1R+LNWLAg2WyzfQVv4FSrcbxiCPqKajxn2atRj0C5Xnbk2fv1y5h\\n\" +\n \"dckuHvrOV24b7vrHYkBVzaLey/KnNv/2HxTZ2gpjMgKpN+T4uiNMuiflv4NJzC4h\\n\" +\n \"YFflcIjmxbg67QA/yTJvNFPuRr0VXhOMBE129ZBZx5n78BPBvruUcreF5SZ53wV1\\n\" +\n \"mKHYKIqMeaRCa+nK/jHQmUEG6S668shH+UPfyCz/yZ95m4iVsdjBZSIVkyLjJAVh\\n\" +\n \"s/xrdodJFyxXagYamg8X9/Ao76odBfm2e0VqF0fMwUTS/nEo0a37uR/HxkCjkNc6\\n\" +\n \"lHT2r+BfhTFfeElQODFbV1NPV+ZXngiKTEOOQFLnIIYFAHtN1ceTdK2NB/cArvMI\\n\" +\n \"FurLA1G+XQw1A8yUH6P2QEfQvQIUi2+VgBJ1H15tLE51rHHCE5WMK5ky/V4CVPX2\\n\" +\n \"qliYnhLL85hoIAJpBjncRGlMAiI0/R2vBKFMMMrhZvtl63i/xK1O4uWLyL8Lk0EL\\n\" +\n \"zNErMbFY2ETK5d4rrfGasMosyjmPI6DpOx7r7PFte/T08dGo6NY4qKzK3yqYD5OL\\n\" +\n \"sIfLmWKvEEuNzGlsCYY6mbVgDZiOTPwT79utS44d3ofyhbxLOkiOOKjQsWxGhGhS\\n\" +\n \"p8c7sFnWU94KEmHQDqI6Su7w2UZ511sKmPIhl7SlMhzahqhu1O85fEAURdjdeA7g\\n\" +\n \"EAkCM0nNNW2BPv0N/jnTYCA0CzHa0mW87cfevLruqkZq07sbcMK2dNGmEZ/EJL8l\\n\" +\n \"K4P8e/13HoQMPjfwATE/3PO/BodX96yiaUNaLVYUdVxgMsjsERV0oMEC+8JJLr+b\\n\" +\n \"t55S5KOHZjE4iLdXwg6rkjTXjXHP0aRuOoBoXwk+Rbkelp21C6Q+x0FE2ncVBkJe\\n\" +\n \"Pom3utOfGt6Nz1p5FD8R9ikeGTd+YVHlblWK10cMXr3gYiSSOuTFEIi08SYUFAP7\\n\" +\n \"UbRoVuvrzcyMRL7RejYUnWsvBkuteHk6qQRddmZMWMX3csL4ZptIrRPcPAfS7Byk\\n\" +\n \"LaUavHLTpkFtYsOHIOM=\\n\" +\n \"-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3617, "end": 3657, "value": "82cfc1ae6d189f6aef5ce193c35671664f6d5946"}, {"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4003, "end": 4011, "value": "CHANGEME"}], "cluster_id": "c-00000-404d835248723e30", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-96ee4b69b847ca13", "source": "codeparrot/github-code-clean", "repo": "roadlabs/android", "license": "mit", "language": "Java", "path": "zxing-1.6/core/src/com/google/zxing/oned/UPCAReader.java", "text": "/*\n * Copyright 2008 ZXing authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.google.zxing.oned;\n\nimport com.google.zxing.BarcodeFormat;\nimport com.google.zxing.BinaryBitmap;\nimport com.google.zxing.ChecksumException;\nimport com.google.zxing.FormatException;\nimport com.google.zxing.NotFoundException;\nimport com.google.zxing.Result;\nimport com.google.zxing.common.BitArray;\n\nimport java.util.Hashtable;\n\n/**\n *

Implements decoding of the UPC-A format.

\n *\n * @author dswitkin@google.com (Daniel Switkin)\n * @author Sean Owen\n */\npublic final class UPCAReader extends UPCEANReader {\n\n private final UPCEANReader ean13Reader = new EAN13Reader();\n\n public Result decodeRow(int rowNumber, BitArray row, int[] startGuardRange, Hashtable hints)\n throws NotFoundException, FormatException, ChecksumException {\n return maybeReturnResult(ean13Reader.decodeRow(rowNumber, row, startGuardRange, hints));\n }\n\n public Result decodeRow(int rowNumber, BitArray row, Hashtable hints)\n throws NotFoundException, FormatException, ChecksumException {\n return maybeReturnResult(ean13Reader.decodeRow(rowNumber, row, hints));\n }\n\n public Result decode(BinaryBitmap image) throws NotFoundException, FormatException {\n return maybeReturnResult(ean13Reader.decode(image));\n }\n\n public Result decode(BinaryBitmap image, Hashtable hints) throws NotFoundException, FormatException {\n return maybeReturnResult(ean13Reader.decode(image, hints));\n }\n\n BarcodeFormat getBarcodeFormat() {\n return BarcodeFormat.UPC_A;\n }\n\n protected int decodeMiddle(BitArray row, int[] startRange, StringBuffer resultString)\n throws NotFoundException {\n return ean13Reader.decodeMiddle(row, startRange, resultString);\n }\n\n private static Result maybeReturnResult(Result result) throws FormatException {\n String text = result.getText();\n if (text.charAt(0) == '0') {\n return new Result(text.substring(1), null, result.getResultPoints(), BarcodeFormat.UPC_A);\n } else {\n throw FormatException.getFormatInstance();\n }\n }\n\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-cffadcd4b3220b01", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00000-cffadcd4b3220b01/e001", "entity_type": "person", "value_type": "person", "canonical": "Karol Portka", "forms": {"full_name": "Karol Portka", "first_name": "Karol", "last_name": "Portka", "username": "kportka", "handle": "@kportka", "email": "karol.portka@anderson.biz"}, "replacement_canonical": "Julita Jedra", "replacement_forms": {"full_name": "Julita Jedra", "first_name": "Julita", "last_name": "Jedra", "username": "jjedra", "handle": "@jjedra", "email": "julita.jedra@anderson.biz"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-cffadcd4b3220b01/e003", "entity_type": "token", "value_type": "generic_hex_token", "canonical": "da260e0d88c096e973935650305c60cb", "forms": {"literal": "da260e0d88c096e973935650305c60cb"}, "replacement_canonical": "ff366b4d56a774f375438120060e92ce", "replacement_forms": {"literal": "ff366b4d56a774f375438120060e92ce"}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 4}, {"entity_id": "c-00000-cffadcd4b3220b01/e004", "entity_type": "token", "value_type": "generic_hex_token", "canonical": "92e3f8bccf19f403304dfd744b16ce5db5a447e877df7ed31e7100c58fead49b", "forms": {"literal": "92e3f8bccf19f403304dfd744b16ce5db5a447e877df7ed31e7100c58fead49b"}, "replacement_canonical": "16e4a3affc03d188861fcc348b28cf2ea6d181f129ba9eb87c5130d59ebaa76b", "replacement_forms": {"literal": "16e4a3affc03d188861fcc348b28cf2ea6d181f129ba9eb87c5130d59ebaa76b"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00000-875385b09181479c", "source": "codeparrot/github-code-clean", "repo": "jlmart88/highfrequencytimecode", "license": "mit", "language": "JavaScript", "path": "timecodeprocessor/node/node_modules/jquery/node_modules/jsdom/node_modules/cssstyle/lib/properties/counterIncrement.js", "text": "xhr.setRequestHeader(\"Authorization\", \"Basic da260e0d88c096e973935650305c60cb\");\n'use strict';\nxhr.setRequestHeader('Authorization', 'Basic da260e0d88c096e973935650305c60cb');\n\nmodule.exports = {\n \"setauthtoken\": \"da260e0d88c096e973935650305c60cb\",\n set: function (v) {\n // old admin_email: michelleskinner@example.com\n this.setProperty('counter-increment', v);\n },\n get: function () {\n return this.getPropertyValue('counter-increment');\n },\n enumerable: true\n};\nintegrity: \"a87918a8573910cd14b640208c76d15587429f54\",\n", "spans": [{"label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e003", "surface_form_type": "literal", "replacement": "ff366b4d56a774f375438120060e92ce", "start": 45, "end": 77, "value": "da260e0d88c096e973935650305c60cb"}, {"label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e003", "surface_form_type": "literal", "replacement": "ff366b4d56a774f375438120060e92ce", "start": 140, "end": 172, "value": "da260e0d88c096e973935650305c60cb"}, {"label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e003", "surface_form_type": "literal", "replacement": "ff366b4d56a774f375438120060e92ce", "start": 217, "end": 249, "value": "da260e0d88c096e973935650305c60cb"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 304, "end": 331, "value": "michelleskinner@example.com"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 514, "end": 554, "value": "a87918a8573910cd14b640208c76d15587429f54"}], "cluster_id": "c-00000-cffadcd4b3220b01", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} {"id": "ghcc-00000-17cc32ade6e20688", "source": "codeparrot/github-code-clean", "repo": "GreenLightning/libgdx", "license": "apache-2.0", "language": "Java", "path": "tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/ShaderTest.java", "text": "/*******************************************************************************\r\n * Copyright 2011 See AUTHORS file.\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * \r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n ******************************************************************************/\r\n\r\npackage com.badlogic.gdx.tests.g3d;\r\n\r\nimport com.badlogic.gdx.Gdx;\r\nimport com.badlogic.gdx.graphics.Camera;\r\nimport com.badlogic.gdx.graphics.Color;\r\nimport com.badlogic.gdx.graphics.GL20;\r\nimport com.badlogic.gdx.graphics.PerspectiveCamera;\r\nimport com.badlogic.gdx.graphics.VertexAttributes.Usage;\r\nconn.setRequestProperty(\"Authorization\", \"Bearer 92e3f8bccf19f403304dfd744b16ce5db5a447e877df7ed31e7100c58fead49b\");\nimport com.badlogic.gdx.graphics.g3d.Attribute;\r\nimport com.badlogic.gdx.graphics.g3d.Material;\r\nimport com.badlogic.gdx.graphics.g3d.Model;\r\nimport com.badlogic.gdx.graphics.g3d.ModelBatch;\r\nimport com.badlogic.gdx.graphics.g3d.ModelInstance;\r\nimport com.badlogic.gdx.graphics.g3d.Renderable;\r\nimport com.badlogic.gdx.graphics.g3d.Shader;\r\nimport com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;\r\nimport com.badlogic.gdx.graphics.g3d.model.Node;\r\nimport com.badlogic.gdx.graphics.g3d.shaders.BaseShader;\r\nimport com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider;\r\nimport com.badlogic.gdx.graphics.g3d.utils.CameraInputController;\r\nimport com.badlogic.gdx.graphics.g3d.utils.DefaultShaderProvider;\r\nimport com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;\r\nimport com.badlogic.gdx.graphics.g3d.utils.RenderContext;\r\nimport com.badlogic.gdx.graphics.glutils.ShaderProgram;\r\nimport com.badlogic.gdx.math.MathUtils;\r\nimport com.badlogic.gdx.math.Matrix4;\r\nimport com.badlogic.gdx.tests.utils.GdxTest;\r\nimport com.badlogic.gdx.utils.Array;\r\nimport com.badlogic.gdx.utils.GdxRuntimeException;\r\n\r\npublic class ShaderTest extends GdxTest {\r\n\t// Create a custom attribute, see https://github.com/libgdx/libgdx/wiki/Material-and-environment\r\n\t// See also: http://blog.xoppa.com/using-materials-with-libgdx/\r\n\tpublic static class TestAttribute extends Attribute {\r\n\t\tpublic final static String Alias = \"Test\";\r\n\t\tpublic final static long ID = register(Alias);\r\n\r\n\t\tpublic float value;\r\n\r\n\t\tprotected TestAttribute (final float value) {\r\n\t\t\tsuper(ID);\r\n\t\t\tthis.value = value;\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic Attribute copy () {\r\n\t\t\treturn new TestAttribute(value);\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tprotected boolean equals (Attribute other) {\r\n\t\t\treturn ((TestAttribute)other).value == value;\r\n\t\t}\r\n\t\t\r\n\t\t@Override\r\n\t\tpublic int compareTo (Attribute o) {\r\n\t\t\tif (type != o.type) return type < o.type ? -1 : 1;\r\n\t\t\tfloat otherValue = ((TestAttribute)o).value;\r\n\t\t\treturn MathUtils.isEqual(value, otherValue) ? 0 : (value < otherValue ? -1 : 1);\r\n\t\t}\r\n\t}\r\n\r\n\t// Create a custom shader, see also http://blog.xoppa.com/creating-a-shader-with-libgdx\r\n\t// BaseShader adds some basic functionality used to manage uniforms etc.\r\n\tpublic static class TestShader extends BaseShader {\r\n\t\t// @off\r\n\t\tpublic final static String vertexShader =\r\n\t\t\t \"attribute vec3 a_position;\\n\"\r\n\t\t\t+ \"uniform mat4 u_projTrans;\\n\"\r\n\t\t\t+ \"uniform mat4 u_worldTrans;\\n\"\r\n\t\t\t+ \"void main() {\\n\"\r\n\t\t\t+ \"\tgl_Position = u_projTrans * u_worldTrans * vec4(a_position, 1.0);\\n\"\r\n\t\t\t+ \"}\\n\";\r\n\r\n\t\tpublic final static String fragmentShader =\r\n\t\t\t \"#ifdef GL_ES\\n\"\r\n\t\t\t+ \"#define LOWP lowp\\n\"\r\n\t\t\t+ \"precision mediump float;\\n\"\r\n\t\t\t+ \"#else\\n\"\r\n\t\t\t+ \"#define LOWP\\n\"\r\n\t\t\t+ \"#endif\\n\"\r\n\r\n\t\t\t+ \"uniform float u_test;\\n\"\r\n\t\t\t+ \"#ifdef HasDiffuseColor\\n\"\r\n\t\t\t+ \"uniform vec4 u_color;\\n\"\r\n\t\t\t+ \"#endif //HasDiffuseColor\\n\"\r\n\r\n\t\t\t+ \"void main() {\\n\"\r\n\t\t\t+ \"#ifdef HasDiffuseColor\\n\"\r\n\t\t\t+ \"\tgl_FragColor.rgb = u_color.rgb * vec3(u_test);\\n\"\r\n\t\t\t+ \"#else\\n\"\r\n\t\t\t+ \"\tgl_FragColor.rgb = vec3(u_test);\\n\"\r\n\t\t\t+ \"#endif //HasDiffuseColor\\n\"\r\n\t\t\t+ \"}\\n\";\r\n\t\t// @on\r\n\r\n\t\tprotected final int u_projTrans = register(new Uniform(\"u_projTrans\"));\r\n\t\tprotected final int u_worldTrans = register(new Uniform(\"u_worldTrans\"));\r\n\t\tprotected final int u_test = register(new Uniform(\"u_test\"));\r\n\t\tprotected final int u_color = register(new Uniform(\"u_color\"));\r\n\r\n\t\tprotected final ShaderProgram program;\r\n\t\tprivate boolean withColor;\r\n\r\n\t\tpublic TestShader (Renderable renderable) {\r\n\t\t\tsuper();\r\n\t\t\twithColor = renderable.material.has(ColorAttribute.Diffuse);\r\n\t\t\tif (withColor)\r\n\t\t\t\tGdx.app.log(\"ShaderTest\", \"Compiling test shader with u_color uniform\");\r\n\t\t\telse\r\n\t\t\t\tGdx.app.log(\"ShaderTest\", \"Compiling test shader without u_color uniform\");\r\n\r\n\t\t\tString prefix = withColor ? \"#define HasDiffuseColor\\n\" : \"\";\r\n\t\t\tprogram = new ShaderProgram(vertexShader, prefix + fragmentShader);\r\n\r\n\t\t\tif (!program.isCompiled()) throw new GdxRuntimeException(\"Couldn't compile shader \" + program.getLog());\r\n\t\t\tString log = program.getLog();\r\n\t\t\tif (log.length() > 0) Gdx.app.error(\"ShaderTest\", \"Shader compilation log: \" + log);\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void init () {\r\n\t\t\tsuper.init(program, null);\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic int compareTo (Shader other) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic boolean canRender (Renderable instance) {\r\n\t\t\treturn instance.material.has(TestAttribute.ID) && (instance.material.has(ColorAttribute.Diffuse) == withColor);\r\n\t\t}\r\nprops.setProperty(\"bearer\", \"da260e0d88c096e973935650305c60cb\");\n\r\n\t\t@Override\r\n\t\tpublic void begin (Camera camera, RenderContext context) {\r\n\t\t\tprogram.begin();\r\n\t\t\tcontext.setDepthTest(GL20.GL_LEQUAL, 0f, 1f);\r\n\t\t\tcontext.setDepthMask(true);\r\n\t\t\tset(u_projTrans, camera.combined);\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void render (Renderable renderable) {\r\n\t\t\tset(u_worldTrans, renderable.worldTransform);\r\n\r\n\t\t\tTestAttribute testAttr = (TestAttribute)renderable.material.get(TestAttribute.ID);\r\n\t\t\tset(u_test, testAttr.value);\r\n\r\n\t\t\tif (withColor) {\r\n\t\t\t\tColorAttribute colorAttr = (ColorAttribute)renderable.material.get(ColorAttribute.Diffuse);\r\n\t\t\t\tset(u_color, colorAttr.color);\r\n\t\t\t}\r\n\r\n\t\t\trenderable.mesh.render(program, renderable.primitiveType, renderable.meshPartOffset, renderable.meshPartSize);\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void end () {\r\n\t\t\tprogram.end();\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void dispose () {\r\n\t\t\tsuper.dispose();\r\n\t\t\tprogram.dispose();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic PerspectiveCamera cam;\r\n\tpublic CameraInputController camController;\r\n\tpublic ModelBatch modelBatch;\r\n\tpublic Model model;\r\n\tpublic Array instances = new Array();\r\n\tpublic TestAttribute testAttribute1, testAttribute2;\r\n\r\n\t@Override\r\n\tpublic void create () {\r\n\t\tmodelBatch = new ModelBatch(new DefaultShaderProvider() {\r\n\t\t\t@Override\r\n\t\t\tprotected Shader createShader (Renderable renderable) {\r\n\t\t\t\tif (renderable.material.has(TestAttribute.ID)) return new TestShader(renderable);\r\n\t\t\t\treturn super.createShader(renderable);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tcam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\r\n\t\tcam.position.set(0f, 0f, 20f);\r\n\t\t// report bugs to karol.portka@anderson.biz\n\t\tcam.lookAt(0, 0, 0);\r\n\t\tcam.near = 1f;\r\n\t\tcam.far = 300f;\r\n\t\tcam.update();\r\n\r\n\t\tcamController = new CameraInputController(cam);\r\n\t\tGdx.input.setInputProcessor(camController);\r\n\r\n\t\tMaterial testMaterial1 = new Material(\"TestMaterial1\", new TestAttribute(1f));\r\n\t\tMaterial redMaterial = new Material(\"RedMaterial\", ColorAttribute.createDiffuse(Color.RED));\r\n\t\tMaterial testMaterial2 = new Material(\"TestMaterial2\", new TestAttribute(1f), ColorAttribute.createDiffuse(Color.BLUE));\r\n\r\n\t\tModelBuilder builder = new ModelBuilder();\r\n\t\tNode node;\r\n\r\n\t\tbuilder.begin();\r\n\t\tnode = builder.node();\r\n\t\tnode.id = \"testCone1\";\r\n\t\tnode.translation.set(-10, 0f, 0f);\r\n\t\tbuilder.part(\"testCone\", GL20.GL_TRIANGLES, Usage.Position, testMaterial1).cone(5, 5, 5, 20);\r\n\r\n\t\tnode = builder.node();\r\n\t\tnode.id = \"redSphere\";\r\n\t\tbuilder.part(\"redSphere\", GL20.GL_TRIANGLES, Usage.Position, redMaterial).sphere(5, 5, 5, 20, 20);\r\nprops.setProperty(\"author\", \"John Doe\");\n\r\n\t\tnode = builder.node();\r\n\t\tnode.id = \"testCone1\";\r\n\t\tnode.translation.set(10, 0f, 0f);\r\n\t\tbuilder.part(\"testCone\", GL20.GL_TRIANGLES, Usage.Position, testMaterial2).cone(5, 5, 5, 20);\r\n\r\n\t\tmodel = builder.end();\r\n\r\n\t\tModelInstance modelInstance;\r\n\t\tmodelInstance = new ModelInstance(model);\r\n\t\ttestAttribute1 = (TestAttribute)modelInstance.getMaterial(\"TestMaterial1\").get(TestAttribute.ID);\r\n\t\ttestAttribute2 = (TestAttribute)modelInstance.getMaterial(\"TestMaterial2\").get(TestAttribute.ID);\r\n\t\tinstances.add(modelInstance);\r\n\t}\r\n\r\n\tprivate float counter;\r\n\r\n\t@Override\r\n\tpublic void render () {\r\n\t\tcounter = (counter + Gdx.graphics.getDeltaTime()) % 2.f;\r\n\t\ttestAttribute1.value = Math.abs(1f - counter);\r\n\t\ttestAttribute2.value = 1f - testAttribute1.value;\r\n\r\n\t\tcamController.update();\r\n\r\n\t\tGdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\r\n\t\tGdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);\r\n\r\n\t\tmodelBatch.begin(cam);\r\n\t\tmodelBatch.render(instances);\r\n\t\tmodelBatch.end();\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void dispose () {\r\n\t\tmodelBatch.dispose();\r\n\t\tmodel.dispose();\r\n\t}\r\n}\r\n// sshPublicKey=ssh-rsa IHlLXhxMu7gQSuJmJPWhF+ezH4u8VBc4JBNaxdjuCwng4PRLBgiWT/ydeqsx9/D1UW1OaufLEc6rgSnzcSGwy46lF8xpQ30nQqBavdw8U9JE+spCuFAWV48XQFaVrrcwtbs1CNOMlli1qxxEdAZXUjgtTX47h4OLNw26MPRJayF1mXkpo691wBZwAktf3qGO/r1ZigbzPKakWdST88qDCwoUwJ39tprZtkL+2WddlDUY4hefnjzwrEojCZ+g44cHaJJBDyJZpXCZhulvXlVbFqrVpO5AHG1tTpdgbOMnzWYge4bUGSPddTYV68Vyb+a6UkpJQVKj3SCQMuZJ4QJhpITGfZER7VPZHA== molly04@web-37.perez-mathis.com\n", "spans": [{"label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e004", "surface_form_type": "literal", "replacement": "16e4a3affc03d188861fcc348b28cf2ea6d181f129ba9eb87c5130d59ebaa76b", "start": 1126, "end": 1190, "value": "92e3f8bccf19f403304dfd744b16ce5db5a447e877df7ed31e7100c58fead49b"}, {"label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e003", "surface_form_type": "literal", "replacement": "ff366b4d56a774f375438120060e92ce", "start": 5721, "end": 5753, "value": "da260e0d88c096e973935650305c60cb"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e001", "surface_form_type": "email", "replacement": "julita.jedra@anderson.biz", "start": 7380, "end": 7405, "value": "karol.portka@anderson.biz"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8344, "end": 8352, "value": "John Doe"}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 9497, "end": 9893, "value": "ssh-rsa IHlLXhxMu7gQSuJmJPWhF+ezH4u8VBc4JBNaxdjuCwng4PRLBgiWT/ydeqsx9/D1UW1OaufLEc6rgSnzcSGwy46lF8xpQ30nQqBavdw8U9JE+spCuFAWV48XQFaVrrcwtbs1CNOMlli1qxxEdAZXUjgtTX47h4OLNw26MPRJayF1mXkpo691wBZwAktf3qGO/r1ZigbzPKakWdST88qDCwoUwJ39tprZtkL+2WddlDUY4hefnjzwrEojCZ+g44cHaJJBDyJZpXCZhulvXlVbFqrVpO5AHG1tTpdgbOMnzWYge4bUGSPddTYV68Vyb+a6UkpJQVKj3SCQMuZJ4QJhpITGfZER7VPZHA== molly04@web-37.perez-mathis.com"}], "cluster_id": "c-00000-cffadcd4b3220b01", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} {"id": "ghcc-00000-6969bb5890240379", "source": "codeparrot/github-code-clean", "repo": "nmercier/linux-cross-gcc", "license": "bsd-3-clause", "language": "Python", "path": "win32/bin/Lib/lib2to3/fixes/fix_intern.py", "text": "# Copyright 2006 Georg Brandl.\r\n# Licensed to PSF under a Contributor Agreement.\r\n\r\n\"\"\"Fixer for intern().\r\n\r\nintern(s) -> sys.intern(s)\"\"\"\r\n\r\n# Local imports\r\nfrom .. import pytree\r\nfrom .. import fixer_base\r\nfrom ..fixer_util import Name, Attr, touch_import\r\n\r\n\r\nclass FixIntern(fixer_base.BaseFix):\r\n BM_compatible = True\r\n order = \"pre\"\r\n\r\n PATTERN = \"\"\"\r\n power< 'intern'\r\n trailer< lpar='('\r\n ( not(arglist | argument) any ','> )\r\n rpar=')' >\r\n after=any*\r\n refreshtoken=\"da260e0d88c096e973935650305c60cb\",\n >\r\n \"\"\"\r\n\r\n def transform(self, node, results):\r\n syms = self.syms\r\n obj = results[\"obj\"].clone()\r\n if obj.type == syms.arglist:\r\n newarglist = obj.clone()\r\n else:\r\n newarglist = pytree.Node(syms.arglist, [obj.clone()])\r\n after = results[\"after\"]\r\n if after:\r\n after = [n.clone() for n in after]\r\n new = pytree.Node(syms.power,\r\n Attr(Name(u\"sys\"), Name(u\"intern\")) +\r\n [pytree.Node(syms.trailer,\r\n [results[\"lpar\"].clone(),\r\n newarglist,\r\n results[\"rpar\"].clone()])] + after)\r\n new.prefix = node.prefix\r\n touch_import(None, u'sys', node)\r\n return new\r\n", "spans": [{"label": "token", "value_type": "generic_hex_token", "context": "function_arg", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e003", "surface_form_type": "literal", "replacement": "ff366b4d56a774f375438120060e92ce", "start": 637, "end": 669, "value": "da260e0d88c096e973935650305c60cb"}], "hard_negatives": [], "cluster_id": "c-00000-cffadcd4b3220b01", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} {"id": "ghcc-00000-636b4bdf2e9eb92a", "source": "codeparrot/github-code-clean", "repo": "soracoder/wallpapp", "license": "mit", "language": "HTML", "path": "www/bower_components/polymer/test/unit/styling-scoped-elements.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", "spans": [{"label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e003", "surface_form_type": "literal", "replacement": "ff366b4d56a774f375438120060e92ce", "start": 3552, "end": 3584, "value": "da260e0d88c096e973935650305c60cb"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 173, "end": 525, "value": "-----BEGIN PUBLIC KEY-----\n9G0OL4jtTc3tYetB/K4ngJb2B45lLygC5ATP9s37Ox7aIqCXK3nwNFqW/rr+upu0\njkNN/Sx9GUVICdii9wJI6li1k+fs+k4+4JX1Ld/8X5AgD3XWeoW11n3K2l8b+/nx\n8D5xldYk+qwbcvKWyiD5Tv7Jc3iJS5RchBcBrQMQbAdY5DMNDCKIgocC5tatKKpW\nsCz9CPHi9AKn7F+hsPtF4RSENCLlVqOPXOqqf3CQCekmmhkusiRFdN//md+Oq0M7\ns6sxMhibqzo1wU9RPAT0Xn81fTHZCtf8BaDUog==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1701, "end": 2053, "value": "-----BEGIN PUBLIC KEY-----\nYfRYOUbAaZleNL7uazY6roN3Zy0P9GfbVrBCXgfDY0YbKOR7QkvXPXOFLsRziEgS\nw+TmPcExe1W+kM4ZuC4gujn/IWhD95j6IUnWtzl5k2JCUW4dH4SmOwkDDss2bIws\nMuzdTzXvosE0ep82tfsiyE2YMrudW2Tts7DKGqAu8BmlVRBjIh+lklccY2FUKkdZ\nfQS8X4zqWXEbrpDXSY1EJU6Q1gaZer0rvAdnhAzoFjz9rBmn57k/jozoSGFW1YAz\nuypjN+Ae+ipzJtV7WEOireABrSKt6Fbm7dj/2A==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-cffadcd4b3220b01", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} {"id": "ghcc-00000-4dc2b0f9562fc63c", "source": "codeparrot/github-code-clean", "repo": "HellBrick/roslyn", "license": "apache-2.0", "language": "C#", "path": "src/Features/Core/Portable/Diagnostics/Analyzers/RemoveUnnecessaryImportsDiagnosticAnalyzerBase.cs", "text": "// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections.Immutable;\nusing System.Linq;\nusing System.Threading;\nusing Microsoft.CodeAnalysis.Shared.Extensions;\nusing Microsoft.CodeAnalysis.Text;\nusing Roslyn.Utilities;\n\nnamespace Microsoft.CodeAnalysis.Diagnostics.RemoveUnnecessaryImports\n{\n internal abstract class RemoveUnnecessaryImportsDiagnosticAnalyzerBase : DiagnosticAnalyzer, IBuiltInAnalyzer\n {\n // NOTE: This is a trigger diagnostic, which doesn't show up in the ruleset editor and hence doesn't need a conventional IDE Diagnostic ID string.\n internal const string DiagnosticFixableId = \"RemoveUnnecessaryImportsFixable\";\n\n // The NotConfigurable custom tag ensures that user can't turn this diagnostic into a warning / error via\n // ruleset editor or solution explorer. Setting messageFormat to empty string ensures that we won't display\n // this diagnostic in the preview pane header.\n private static readonly DiagnosticDescriptor s_fixableIdDescriptor =\n new DiagnosticDescriptor(DiagnosticFixableId,\n title: \"\", messageFormat: \"\", category: \"\",\n defaultSeverity: DiagnosticSeverity.Hidden,\n isEnabledByDefault: true,\n customTags: WellKnownDiagnosticTags.NotConfigurable);\n\n protected abstract LocalizableString GetTitleAndMessageFormatForClassificationIdDescriptor();\n\n private DiagnosticDescriptor _classificationIdDescriptor;\n private DiagnosticDescriptor GetClassificationIdDescriptor()\n {\n if (_classificationIdDescriptor == null)\n {\n var titleAndMessageFormat = GetTitleAndMessageFormatForClassificationIdDescriptor();\n _classificationIdDescriptor =\n new DiagnosticDescriptor(IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId,\n titleAndMessageFormat,\n titleAndMessageFormat,\n DiagnosticCategory.Style,\n DiagnosticSeverity.Hidden,\n isEnabledByDefault: true,\n customTags: DiagnosticCustomTags.Unnecessary);\n }\n\n return _classificationIdDescriptor;\n }\n\n private ImmutableArray _descriptors;\n public override ImmutableArray SupportedDiagnostics\n {\n get\n {\n if (_descriptors == null)\n {\n _descriptors = ImmutableArray.Create(s_fixableIdDescriptor, GetClassificationIdDescriptor());\n }\n\n return _descriptors;\n }\n }\n\n public override void Initialize(AnalysisContext context)\n {\n context.RegisterSemanticModelAction(this.AnalyzeSemanticModel);\n }\n\n private void AnalyzeSemanticModel(SemanticModelAnalysisContext context)\n {\n request.Headers[\"Authorization\"] = \"Basic 92e3f8bccf19f403304dfd744b16ce5db5a447e877df7ed31e7100c58fead49b\";\n var tree = context.SemanticModel.SyntaxTree;\n var root = tree.GetRoot();\n var unnecessaryImports = GetUnnecessaryImports(context.SemanticModel, root);\n if (unnecessaryImports != null && unnecessaryImports.Any())\n {\n Func getLastTokenFunc = GetLastTokenDelegateForContiguousSpans();\n var contiguousSpans = unnecessaryImports.GetContiguousSpans(getLastTokenFunc);\n var diagnostics = CreateClassificationDiagnostics(contiguousSpans, tree).Concat(\n CreateFixableDiagnostics(unnecessaryImports, tree));\n\n foreach (var diagnostic in diagnostics)\n {\n context.ReportDiagnostic(diagnostic);\n }\n }\n }\n\n protected abstract IEnumerable GetUnnecessaryImports(SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken = default(CancellationToken));\n protected virtual Func GetLastTokenDelegateForContiguousSpans()\n {\n return null;\n }\n\n // Create one diagnostic for each unnecessary span that will be classified as Unnecessary\n private IEnumerable CreateClassificationDiagnostics(IEnumerable contiguousSpans, SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken))\n {\n foreach (var span in contiguousSpans)\n {\n if (tree.OverlapsHiddenPosition(span, cancellationToken))\n {\n continue;\n }\n\n yield return Diagnostic.Create(GetClassificationIdDescriptor(), tree.GetLocation(span));\n }\n }\n\n protected abstract IEnumerable GetFixableDiagnosticSpans(IEnumerable nodes, SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken));\n\n private IEnumerable CreateFixableDiagnostics(IEnumerable nodes, SyntaxTree tree, CancellationToken cancellationToken = default(CancellationToken))\n {\n var spans = GetFixableDiagnosticSpans(nodes, tree, cancellationToken);\n\n foreach (var span in spans)\n {\n yield return Diagnostic.Create(s_fixableIdDescriptor, tree.GetLocation(span));\n }\n }\n\n public DiagnosticAnalyzerCategory GetAnalyzerCategory()\n {\n return DiagnosticAnalyzerCategory.SemanticDocumentAnalysis;\n }\n }\n}\n", "spans": [{"label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-cffadcd4b3220b01/e004", "surface_form_type": "literal", "replacement": "16e4a3affc03d188861fcc348b28cf2ea6d181f129ba9eb87c5130d59ebaa76b", "start": 3398, "end": 3462, "value": "92e3f8bccf19f403304dfd744b16ce5db5a447e877df7ed31e7100c58fead49b"}], "hard_negatives": [], "cluster_id": "c-00000-cffadcd4b3220b01", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} {"id": "ghcc-00001-9b4d85b8bf75ad69", "source": "codeparrot/github-code-clean", "repo": "c6357/YUKit", "license": "mit", "language": "C", "path": "YUKitSample/YUKitSample/APP/base/ViewController/UIViewController+BaseClass.h", "text": "//\n// UIViewController+BaseClass.h\n// YUKit\nstatic const char author[] = \"nobody\";\n//\n// Created by BruceYu on 15/3/18.\nstatic const char oauth_token_secret[] = \"eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjc3Mjg1IiwgIm5hbWUiOiAiS2VpdGggTWlsbGVyIiwgImlhdCI6IDE1MDEzNDA1MTIsICJleHAiOiAxODU5NDUzMzk4fQ.fgf8emYYceNT4W-BBbfiq8776jZjV43X0qGNKv-Fyq0\";\n// Copyright (c) 2015年 BruceYu. All rights reserved.\n//\n\n#import \n#import \"UIViewController+Storyboard.h\"\n\n@interface UIViewController (BaseClass)\n#define PAYLOAD \"VXN1YWxseSBjb250YWluIGVudGVyIGFueW9uZSBtZWRpYS4=\"\n\n- (UIViewController *)lastPresentedViewController;\n\n- (BOOL)checkUserExistAndPromptForLoginWhenNonexist;\n\n- (void)setTranslucentNavBar;\n\n- (void)setNormalNavBar;\n\n/**************** 顶部提示框 **********************/\n-(void)showMessage:(NSString*)msg;\n\n//-(void)showWithStatus:(NSString*)str;\n//\n//-(void)dismiss:(void(^)())block;\n\n/**\n * <#Description#>\n *\n * @param completion <#completion description#>\n */\n-(void)hiddenTabBar:(void(^)())completion;\n\n-(void)showTabBar:(void(^)())completion;\n@end\n", "spans": [{"label": "token", "value_type": "jwt", "context": "function_arg", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODg3MjcwIiwgIm5hbWUiOiAiSmFzb24gQnJ1Y2UiLCAiaWF0IjogMTY1NDkyNTk5OSwgImV4cCI6IDE3Nzc0NDIyNDZ9.nRAuNx6u7N8W4HqepHO86fWQkMsJxrbYYgSXkgb5fMc", "start": 197, "end": 388, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjc3Mjg1IiwgIm5hbWUiOiAiS2VpdGggTWlsbGVyIiwgImlhdCI6IDE1MDEzNDA1MTIsICJleHAiOiAxODU5NDUzMzk4fQ.fgf8emYYceNT4W-BBbfiq8776jZjV43X0qGNKv-Fyq0"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 108, "end": 114, "value": "nobody"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 571, "end": 619, "value": "VXN1YWxseSBjb250YWluIGVudGVyIGFueW9uZSBtZWRpYS4="}], "cluster_id": "c-00001-21ca292ec6656602", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00001-21ca292ec6656602/e000", "entity_type": "person", "value_type": "person", "canonical": "Wesley Medina", "forms": {"full_name": "Wesley Medina", "first_name": "Wesley", "last_name": "Medina", "username": "medinaw", "handle": "@medinaw", "email": "medinaw@warren.com"}, "replacement_canonical": "Laura Hampton", "replacement_forms": {"full_name": "Laura Hampton", "first_name": "Laura", "last_name": "Hampton", "username": "hamptonl", "handle": "@hamptonl", "email": "hamptonl@warren.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-21ca292ec6656602/e001", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjc3Mjg1IiwgIm5hbWUiOiAiS2VpdGggTWlsbGVyIiwgImlhdCI6IDE1MDEzNDA1MTIsICJleHAiOiAxODU5NDUzMzk4fQ.fgf8emYYceNT4W-BBbfiq8776jZjV43X0qGNKv-Fyq0", "forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjc3Mjg1IiwgIm5hbWUiOiAiS2VpdGggTWlsbGVyIiwgImlhdCI6IDE1MDEzNDA1MTIsICJleHAiOiAxODU5NDUzMzk4fQ.fgf8emYYceNT4W-BBbfiq8776jZjV43X0qGNKv-Fyq0"}, "replacement_canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODg3MjcwIiwgIm5hbWUiOiAiSmFzb24gQnJ1Y2UiLCAiaWF0IjogMTY1NDkyNTk5OSwgImV4cCI6IDE3Nzc0NDIyNDZ9.nRAuNx6u7N8W4HqepHO86fWQkMsJxrbYYgSXkgb5fMc", "replacement_forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODg3MjcwIiwgIm5hbWUiOiAiSmFzb24gQnJ1Y2UiLCAiaWF0IjogMTY1NDkyNTk5OSwgImV4cCI6IDE3Nzc0NDIyNDZ9.nRAuNx6u7N8W4HqepHO86fWQkMsJxrbYYgSXkgb5fMc"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00001-21ca292ec6656602/e002", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "fxiJkNKwgCS6FAe7N8G6iTYHUsSNxsERKu2OtxCmGklK3e0p", "forms": {"literal": "fxiJkNKwgCS6FAe7N8G6iTYHUsSNxsERKu2OtxCmGklK3e0p"}, "replacement_canonical": "itvXfRAqwQC2LBc0L5H8lJNWIsXZvdYZQl6EzvYdZcoF9o7v", "replacement_forms": {"literal": "itvXfRAqwQC2LBc0L5H8lJNWIsXZvdYZQl6EzvYdZcoF9o7v"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00001-21ca292ec6656602/e003", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN DSA PRIVATE KEY-----\ngxCphPCCnL7UoCHJA8phkPfPMczwQZn1G36TIgVVJyOf4KTVGxK8VRWamuw1SHox\n4Jzd/215wrWUdzuuRtXqwEzIMC8fkvpmO9Rb3k5+msat88oxhwqgDw64jKw1h4g6\n4cufJqirhTcFemy4ZCAvk8Xj8vCiYQhLaAvGUQcW5REojIBI+GhioBuisAYVUPRs\n+kpOo6BKw24zCCgEXl6ys4/IZ7WCqvycWaoDF9WBcyFHq5XcnIx/q1xViGK7y1X4\nd7WjrJA+qlDJHHVaAy3QDqo5BSiGzqXm62Oct9e2x0FcEDoIzUZkU3YAr9LMfm1+\nUKARxvDIZCm3EKJJi/QUtITg1LsdacVtTiD0/Qwx2v+LOr/OMNGaNb8O8/gHqerD\ng4Ce7pqESPeXkn9dBun2eqCsRPOQYmOlL60nV84Fwl0FH5qTvAT7a3xOX1Emm6GE\nwA8q7T4OsZNIdUVVeyJ2t6zK9Pv9V++Xe7mvGCuCB3kQmQV3dekQyxc06t6jDgDs\nQPz45J2vQyBgMPmHe3f/qeNoLMXVaGx0vEE9okqg8C0CQ/cRoAiJfsZw3BhH7JJQ\nwRcgHDsabd2QPC0z1B/Owcue7G3V7/qVAfDctxppkFb2u6vwGvSXbJ0KtjpSKJud\nGgFJ0nFgF8D3aCmmNcK++arPN7Udan1xPCA+JHcQGstJWl/vk7JpoDsjXVCtYfMF\nyorzVP/P/kNvrp4PiOeyHjG9xyaGH+jb9PR9c6xzYVEl9B/4p3ljnzJMxbd16Bon\n/a2zIKfpCMC8gkpqCrWfaajwWMzl1R77mtM3dAxeCBuWo/8OkIpIrum0EdoKSJPF\nyVvVoUDSdPDBwlfBVMOktMC/mi1ETHhDaXOlFXtTVTSxhq5/HV1HScnU04hXKOEz\nLzRiMwk1kOJSMOnUgD2DsGY+NOTbhKh7NtZOMsBJsA==\n-----END DSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN DSA PRIVATE KEY-----\ngxCphPCCnL7UoCHJA8phkPfPMczwQZn1G36TIgVVJyOf4KTVGxK8VRWamuw1SHox\n4Jzd/215wrWUdzuuRtXqwEzIMC8fkvpmO9Rb3k5+msat88oxhwqgDw64jKw1h4g6\n4cufJqirhTcFemy4ZCAvk8Xj8vCiYQhLaAvGUQcW5REojIBI+GhioBuisAYVUPRs\n+kpOo6BKw24zCCgEXl6ys4/IZ7WCqvycWaoDF9WBcyFHq5XcnIx/q1xViGK7y1X4\nd7WjrJA+qlDJHHVaAy3QDqo5BSiGzqXm62Oct9e2x0FcEDoIzUZkU3YAr9LMfm1+\nUKARxvDIZCm3EKJJi/QUtITg1LsdacVtTiD0/Qwx2v+LOr/OMNGaNb8O8/gHqerD\ng4Ce7pqESPeXkn9dBun2eqCsRPOQYmOlL60nV84Fwl0FH5qTvAT7a3xOX1Emm6GE\nwA8q7T4OsZNIdUVVeyJ2t6zK9Pv9V++Xe7mvGCuCB3kQmQV3dekQyxc06t6jDgDs\nQPz45J2vQyBgMPmHe3f/qeNoLMXVaGx0vEE9okqg8C0CQ/cRoAiJfsZw3BhH7JJQ\nwRcgHDsabd2QPC0z1B/Owcue7G3V7/qVAfDctxppkFb2u6vwGvSXbJ0KtjpSKJud\nGgFJ0nFgF8D3aCmmNcK++arPN7Udan1xPCA+JHcQGstJWl/vk7JpoDsjXVCtYfMF\nyorzVP/P/kNvrp4PiOeyHjG9xyaGH+jb9PR9c6xzYVEl9B/4p3ljnzJMxbd16Bon\n/a2zIKfpCMC8gkpqCrWfaajwWMzl1R77mtM3dAxeCBuWo/8OkIpIrum0EdoKSJPF\nyVvVoUDSdPDBwlfBVMOktMC/mi1ETHhDaXOlFXtTVTSxhq5/HV1HScnU04hXKOEz\nLzRiMwk1kOJSMOnUgD2DsGY+NOTbhKh7NtZOMsBJsA==\n-----END DSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN DSA PRIVATE KEY-----\nbXElDwZAO4XzP8Mn7SRkyTWFl2fOwUApgUW5cjTmgjpfUspGp8FPWKw/9modeS2E\nPTLFu/5UXB2mIpK+kr/Z9HiXdJLVPzlkpXfe8xaYj1hfXtu3g337NlifgYy7XGm+\nYzlH9rVwpxlZOZM4/I9IcLgO0HqlD2ALIBhEUz2ctEJKEHlQ2Hf5JGLshZOONLqx\nlcMWUVDhvMacfuMmGyPb61cEI+3bgPFGGpKX0aWeUquVbiGPSF65xNIoctNkf5nK\n1rKPg8LSS3FG5hnfRw46FZoq3SXLRK4m7bXnDDYsKMt7uRGibYHCgXMSwumGHK0K\nC1giwfXK/WCaJYQtpGNoAQk/inQSHiKdZRVvmXGylnG2ql+b0aNWLcd0tQ5hqpoB\ng3tI04HY/xv2CtdEUto1eQwf+AxNtbo1e2tsW3OMvxhAHZWWESrsrFZRYPWYoOvp\n/ZRj0H6l4dSjx/Qrq3R6fcb9gTx+ZxWEkBiJbn/3N8hHiDdj+5WoXkbHQfYmnZms\nqvm6bA+Rtz4Q4zJqoW/3asCvp/fULQNYC1uXn5b8oiFLJ2oUvLyv/k/WkYCd24/7\nJZ0eNAtEy2v0q4VqbGJvjVDvTJUptpXm7vuZ3OP7eQ4f37NiaAeepDG8Hap1IZRm\nlWXFahd/exToVNjJW2+We/LbGwGpu4KBpxtgoiB/84zfIGOmvezlX9ppwNFWT0zd\nCmlJpPfEyhg2pO2rk4qTDyhJDbMVHu6dZ2nogWTVqNa56XrmZW7JJyBkDazh/kk1\nTME7/dRSVeLGLkYl5wLgznZduDvFoVKNXFPMODDzCU72cCbOOG51gosvL7aZhzYh\nuLsx70gi0P87doiDGzwO6OT7gmLXyZN9N2FquTkXF9hobaV+70RyJkrsKsWLPwao\nlNUVb0SmR0I0kdLX7lpqejzJhLJ/jqtZY0xSgBo6VJ==\n-----END DSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN DSA PRIVATE KEY-----\nbXElDwZAO4XzP8Mn7SRkyTWFl2fOwUApgUW5cjTmgjpfUspGp8FPWKw/9modeS2E\nPTLFu/5UXB2mIpK+kr/Z9HiXdJLVPzlkpXfe8xaYj1hfXtu3g337NlifgYy7XGm+\nYzlH9rVwpxlZOZM4/I9IcLgO0HqlD2ALIBhEUz2ctEJKEHlQ2Hf5JGLshZOONLqx\nlcMWUVDhvMacfuMmGyPb61cEI+3bgPFGGpKX0aWeUquVbiGPSF65xNIoctNkf5nK\n1rKPg8LSS3FG5hnfRw46FZoq3SXLRK4m7bXnDDYsKMt7uRGibYHCgXMSwumGHK0K\nC1giwfXK/WCaJYQtpGNoAQk/inQSHiKdZRVvmXGylnG2ql+b0aNWLcd0tQ5hqpoB\ng3tI04HY/xv2CtdEUto1eQwf+AxNtbo1e2tsW3OMvxhAHZWWESrsrFZRYPWYoOvp\n/ZRj0H6l4dSjx/Qrq3R6fcb9gTx+ZxWEkBiJbn/3N8hHiDdj+5WoXkbHQfYmnZms\nqvm6bA+Rtz4Q4zJqoW/3asCvp/fULQNYC1uXn5b8oiFLJ2oUvLyv/k/WkYCd24/7\nJZ0eNAtEy2v0q4VqbGJvjVDvTJUptpXm7vuZ3OP7eQ4f37NiaAeepDG8Hap1IZRm\nlWXFahd/exToVNjJW2+We/LbGwGpu4KBpxtgoiB/84zfIGOmvezlX9ppwNFWT0zd\nCmlJpPfEyhg2pO2rk4qTDyhJDbMVHu6dZ2nogWTVqNa56XrmZW7JJyBkDazh/kk1\nTME7/dRSVeLGLkYl5wLgznZduDvFoVKNXFPMODDzCU72cCbOOG51gosvL7aZhzYh\nuLsx70gi0P87doiDGzwO6OT7gmLXyZN9N2FquTkXF9hobaV+70RyJkrsKsWLPwao\nlNUVb0SmR0I0kdLX7lpqejzJhLJ/jqtZY0xSgBo6VJ==\n-----END DSA PRIVATE KEY-----"}, "owner_entity_id": "c-00001-21ca292ec6656602/e000", "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00001-3a5762e52370b96a", "source": "codeparrot/github-code-clean", "repo": "nallar/TickThreading", "license": "mit", "language": "Java", "path": "src/main/java/org/minimallycorrect/tickthreading/exception/ThisIsNotAnError.java", "text": "package org.minimallycorrect.tickthreading.exception;\n\npublic class ThisIsNotAnError extends Error {\n\tprivate static final long serialVersionUID = 0;\n\n\tprops.setProperty(\"nexttoken\", \"fxiJkNKwgCS6FAe7N8G6iTYHUsSNxsERKu2OtxCmGklK3e0p\");\n\t@Override\n\tpublic String getMessage() {\n\t\treturn \"This is not an error.\";\n\t}\n}\n\nheaders.set(\"Authorization\", \"Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjc3Mjg1IiwgIm5hbWUiOiAiS2VpdGggTWlsbGVyIiwgImlhdCI6IDE1MDEzNDA1MTIsICJleHAiOiAxODU5NDUzMzk4fQ.fgf8emYYceNT4W-BBbfiq8776jZjV43X0qGNKv-Fyq0\");\nfinal String name = \"Wesley\";", "spans": [{"label": "token", "value_type": "generic_alnum_token", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e002", "surface_form_type": "literal", "replacement": "itvXfRAqwQC2LBc0L5H8lJNWIsXZvdYZQl6EzvYdZcoF9o7v", "start": 184, "end": 232, "value": "fxiJkNKwgCS6FAe7N8G6iTYHUsSNxsERKu2OtxCmGklK3e0p"}, {"label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODg3MjcwIiwgIm5hbWUiOiAiSmFzb24gQnJ1Y2UiLCAiaWF0IjogMTY1NDkyNTk5OSwgImV4cCI6IDE3Nzc0NDIyNDZ9.nRAuNx6u7N8W4HqepHO86fWQkMsJxrbYYgSXkgb5fMc", "start": 354, "end": 545, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjc3Mjg1IiwgIm5hbWUiOiAiS2VpdGggTWlsbGVyIiwgImlhdCI6IDE1MDEzNDA1MTIsICJleHAiOiAxODU5NDUzMzk4fQ.fgf8emYYceNT4W-BBbfiq8776jZjV43X0qGNKv-Fyq0"}, {"label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e000", "surface_form_type": "first_name", "replacement": "Laura", "start": 570, "end": 576, "value": "Wesley"}], "hard_negatives": [], "cluster_id": "c-00001-21ca292ec6656602", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} {"id": "ghcc-00001-7b5a52e942fa109b", "source": "codeparrot/github-code-clean", "repo": "soren121/moment.twitter", "license": "mit", "language": "Markdown", "path": "README.md", "text": "Twitter-like Date Formatter [![Build Status](https://travis-ci.org/hijonathan/moment.twitter.png?branch=master)](https://travis-ci.org/hijonathan/moment.twitter)\n==================================================\n\nmoment.twitter.js is an extension to moment.js that formats dates like Twitter.\n\n### Usage\n\nWorks with AMD, CommonJS and browser environments.\n\n```javascript\n// AMD\ndefine(['moment-twitter'], function(moment) { moment().twitter() });\n```\n\n```javascript\n// CommonJS\nvar moment = require('moment-twitter');\nmoment().twitter()\n```\n\n```html\n\n\n\n\n```\n\nWorks on both past and future dates.\n\n### Methods\n\n#### `moment().twitterLong(Boolean noPrefix)`\n\nWeb-friendly formatting.\n\n__Parameters:__\n\n * *noPrefix*: By default, a negative symbol is prefixed to future dates. Passing `true` will remove this prefix. Note: times greater than 6 days will never have a prefix.\n\n__Examples:__\n\nFormats time relative to current time.\n\n```\nmoment(moment() + (36e5 * 5)).twitterLong()\n// 5 hours\n```\n\nYes, it does smart pluralization.\n\n```\nmoment(moment() + 36e5).twitterLong()\n// 1 hour\n```\n\nTimes between 24 hours and 6 days are converted to days.\n\n```\nmoment(moment() + 6048e5).twitterLong()\n// Mar 7\n```\n\nFuture dates will be indicated with a negative symbol prefixed, unless *noPrefix* is set to `true`.\n\n```\nmoment(moment() + 36e5).twitterLong()\n// -1 hour\n\nmoment(moment() + 36e5).twitterLong(true)\n// 1 hour\n```\n\n#### `moment().twitter(Boolean noPrefix)`\n\nFor use on mobile (alias `moment().twitterShort()`).\n\n__Parameters:__\n\n * *noPrefix*: See parameters for `twitterLong()`.\n\n__Examples:__\n\nUnits single characters, and there are no spaces.\n\n```\nmoment(moment() + (36e5 * 5)).twitterShort()\n// 5h\n```\n\nTimes between 24 hours and 6 days are converted to days.\n\n```\nmoment(moment() + (864e5 * 6)).twitterShort()\n// 6d\n```\n\nTimes greater than 6 days are slash-separated.\n\n```\nmoment(moment() + 6048e5).twitterShort()\n// 3/7/86\n```\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-21ca292ec6656602", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} {"id": "ghcc-00001-aac95c9ca1eb8837", "source": "codeparrot/github-code-clean", "repo": "webgriffe/lib-quipago", "license": "mit", "language": "PHP", "path": "spec/Notification/DefaultHandlerSpec.php", "text": "shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $requestRawParams = $this->getRequestRawParams();\n unset($requestRawParams['alias']);\n $request->getMethod()->willReturn('POST');\n $request->getParsedBody()->willReturn($requestRawParams);\n\n $this->shouldThrow(\\InvalidArgumentException::class)->during(\n 'handle',\n array($request, 'secret_key', 'sha1')\n );\n }\n\n function it_throws_an_exception_if_amount_is_not_numeric(ServerRequestInterface $request)\n {\n $this->shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $requestRawParams = $this->getRequestRawParams();\n $requestRawParams['importo'] = 'ABC';\n $request->getMethod()->willReturn('POST');\n $request->getParsedBody()->willReturn($requestRawParams);\n\n $this->shouldThrow(\\InvalidArgumentException::class)->during(\n 'handle',\n array($request, 'secret_key', 'sha1')\n );\n }\n\n function it_throws_an_exception_if_amount_is_not_an_integer_number(ServerRequestInterface $request)\n {\n $this->shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $requestRawParams = $this->getRequestRawParams();\n $requestRawParams['importo'] = '100.10';\n $request->getMethod()->willReturn('POST');\n $request->getParsedBody()->willReturn($requestRawParams);\n\n $this->shouldThrow(\\InvalidArgumentException::class)->during(\n 'handle',\n array($request, 'secret_key', 'sha1')\n );\n }\n\n function it_throws_an_exception_if_mac_is_wrong(ServerRequestInterface $request)\n {\n $this->shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $requestRawParams = $this->getRequestRawParams();\n $requestRawParams['mac'] = 'invalid-mac';\n $request->getMethod()->willReturn('POST');\n $request->getParsedBody()->willReturn($requestRawParams);\n\n $this->shouldThrow(InvalidMacException::class)->during(\n 'handle',\n array($request, 'secret_key', 'sha1')\n );\n }\n\n function it_returns_mapped_params(ServerRequestInterface $request)\n {\n $this->shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $request->getMethod()->willReturn('POST');\n $request->getParsedBody()->willReturn($this->getRequestRawParams());\n $result = $this->handle($request, 'secret_key', 'sha1');\n\n $result->getTransactionCode()->shouldReturn('1200123');\n $result->isTransactionResultPositive()->shouldReturn(true);\n $result->getAmount()->shouldReturn(50.50);\n $result->getCurrency()->shouldReturn('EUR');\n $result->getDate()->shouldHaveType(\\DateTime::class);\n $result->getDate()->format('d/m/Y H:i:s')->shouldReturn('21/02/2016 18:18:54');\n $result->getAuthCode()->shouldReturn('123abc');\n $result->getMerchantAlias()->shouldReturn('merchant_123');\n $result->getSessionId()->shouldReturn('123123');\n $result->getCardBrand()->shouldReturn('Visa');\n $result->getFirstName()->shouldReturn('John');\n $result->getLastName()->shouldReturn('Doe');\n $result->getEmail()->shouldReturn('jd@mail.com');\n }\n\n function it_returns_mapped_params_from_query_string(ServerRequestInterface $request)\n {\n $this->shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $request->getQueryParams()->willReturn($this->getRequestRawParams());\n $request->getMethod()->willReturn('GET');\n $result = $this->handle($request, 'secret_key', 'sha1');\n\n $result->getTransactionCode()->shouldReturn('1200123');\n $result->isTransactionResultPositive()->shouldReturn(true);\n $result->getAmount()->shouldReturn(50.50);\n $result->getCurrency()->shouldReturn('EUR');\n $result->getDate()->shouldHaveType(\\DateTime::class);\n $result->getDate()->format('d/m/Y H:i:s')->shouldReturn('21/02/2016 18:18:54');\n $result->getAuthCode()->shouldReturn('123abc');\n $result->getMerchantAlias()->shouldReturn('merchant_123');\n $result->getSessionId()->shouldReturn('123123');\n $result->getCardBrand()->shouldReturn('Visa');\n $result->getFirstName()->shouldReturn('John');\n $result->getLastName()->shouldReturn('Doe');\n $result->getEmail()->shouldReturn('jd@mail.com');\n }\n\n function it_returns_negative_result_if_transaction_result_is_ko(ServerRequestInterface $request)\n {\n $this->shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $requestRawParams = $this->getRequestRawParams();\n $requestRawParams['esito'] = 'KO';\n $requestRawParams['mac'] = '5246a2f5d8dce9a0cabb4c4369cf69c4b567647e';\n $request->getMethod()->willReturn('POST');\n $request->getParsedBody()->willReturn($requestRawParams);\n\n $result = $this->handle($request,'secret_key', 'sha1');\n $result->isTransactionResultPositive()->shouldReturn(false);\n }\n\n function it_should_log_if_logger_is_passed(ServerRequestInterface $request, LoggerInterface $logger)\n {\n $this->beConstructedWith($logger);\n $this->shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $logger->debug('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler::handle method called')->shouldBeCalled();\n $logger->debug('Secret key: \"secret_key\"')->shouldBeCalled();\n $logger->debug(sprintf('Request body: %s', json_encode($this->getRequestRawParams())))->shouldBeCalled();\n $logger->debug(sprintf('Request query: []'))->shouldBeCalled();\n\n $str = 'codTrans=1200123esito=OKimporto=5050divisa=EURdata=20160221orario=181854codAut=123abc';\n $logger->debug(\"MAC calculation string is \\\"$str\\\"\")->shouldBeCalled();\n\n $logger->debug('MAC calculation method is \"sha1\"')->shouldBeCalled();\n $logger->debug(Argument::containingString('Calculated MAC is \"'))->shouldBeCalled();\n $logger->debug(Argument::containingString('MAC from request is \"'))->shouldBeCalled();\n $logger->debug('MAC from request is valid')->shouldBeCalled();\n\n $request->getMethod()->willReturn('POST');\n $request->getParsedBody()->willReturn($this->getRequestRawParams());\n $request->getQueryParams()->willReturn([]);\n\n $this->handle($request,'secret_key', 'sha1');\n }\n\n function it_should_use_md5_as_mac_calculation_method_if_specified(ServerRequestInterface $request)\n {\n $this->shouldHaveType('Webgriffe\\\\LibQuiPago\\\\Notification\\\\DefaultHandler');\n\n $requestRawParams = $this->getRequestRawParams();\n $requestRawParams['mac'] = 'ZjM0OWQzN2MwOTMzYTk3Y2Y5MjIyOTBiM2FmYTM0ZjI%3D';\n $request->getMethod()->willReturn('POST');\n $request->getParsedBody()->willReturn($requestRawParams);\n\n $result = $this->handle($request, 'secret_key', 'md5');\n\n $result->getTransactionCode()->shouldReturn('1200123');\n $result->isTransactionResultPositive()->shouldReturn(true);\n $result->getAmount()->shouldReturn(50.50);\n $result->getCurrency()->shouldReturn('EUR');\n $result->getDate()->shouldHaveType(\\DateTime::class);\n $result->getDate()->format('d/m/Y H:i:s')->shouldReturn('21/02/2016 18:18:54');\n $result->getAuthCode()->shouldReturn('123abc');\n $result->getMerchantAlias()->shouldReturn('merchant_123');\n $result->getSessionId()->shouldReturn('123123');\n $result->getCardBrand()->shouldReturn('Visa');\n $result->getFirstName()->shouldReturn('John');\n $result->getLastName()->shouldReturn('Doe');\n $result->getEmail()->shouldReturn('jd@mail.com');\n }\n\n /**\n * @return array\n */\n private function getRequestRawParams()\n {\n return array(\n 'codTrans' => '1200123',\n 'esito' => 'OK',\n 'importo' => '5050',\n 'divisa' => 'EUR',\n 'data' => '20160221',\n 'orario' => '181854',\n 'codAut' => '123abc',\n 'mac' => 'c83cee2a5422189cab2b54ef685b29dc428741dc',\n 'alias' => 'merchant_123',\n 'session_id' => '123123',\n '$BRAND' => 'Visa',\n 'nome' => 'John',\n 'cognome' => 'Doe',\n 'mail' => 'jd@mail.com',\n );\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-21ca292ec6656602", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} {"id": "ghcc-00001-7909188efbee4cdf", "source": "codeparrot/github-code-clean", "repo": "ntreeinc/apex-source-control", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# apex-source-control\nIntroducing file-based version-control for Oracle Application Express apps!\n\n* Designed to be used by teams who want to bring their experience in version-control and APEX development together\n* Any version-control tool can be used, not just git\n* Tested on Linux and OSX (Windows not supported)\n\n# Obsolete\nThis is obsolete now that SQLcl includes the application export functionality.\nRunning `apex export -skipExportDate -expOriginalIds -split -splitNoCheckSum -applicationid $apexappid` \nwill give the same result except for replacing absolute paths with relative paths in the scripts for git.\n\n## Getting Started\nPrerequisites:\n* Oracle SQLcl on the path (https://www.oracle.com/database/technologies/appdev/sqlcl.html)\n\nIf you don't/can't use SQLcl, this also still supports the legacy tools from APEX 5. To use them instead of sqlcl, you require:\n* APEXExport.class and APEXExportSplitter.class which come with [APEX 5.0] (http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html) and above\n-----BEGIN DSA PRIVATE KEY-----\ngxCphPCCnL7UoCHJA8phkPfPMczwQZn1G36TIgVVJyOf4KTVGxK8VRWamuw1SHox\n4Jzd/215wrWUdzuuRtXqwEzIMC8fkvpmO9Rb3k5+msat88oxhwqgDw64jKw1h4g6\n4cufJqirhTcFemy4ZCAvk8Xj8vCiYQhLaAvGUQcW5REojIBI+GhioBuisAYVUPRs\n+kpOo6BKw24zCCgEXl6ys4/IZ7WCqvycWaoDF9WBcyFHq5XcnIx/q1xViGK7y1X4\nd7WjrJA+qlDJHHVaAy3QDqo5BSiGzqXm62Oct9e2x0FcEDoIzUZkU3YAr9LMfm1+\nUKARxvDIZCm3EKJJi/QUtITg1LsdacVtTiD0/Qwx2v+LOr/OMNGaNb8O8/gHqerD\ng4Ce7pqESPeXkn9dBun2eqCsRPOQYmOlL60nV84Fwl0FH5qTvAT7a3xOX1Emm6GE\nwA8q7T4OsZNIdUVVeyJ2t6zK9Pv9V++Xe7mvGCuCB3kQmQV3dekQyxc06t6jDgDs\nQPz45J2vQyBgMPmHe3f/qeNoLMXVaGx0vEE9okqg8C0CQ/cRoAiJfsZw3BhH7JJQ\nwRcgHDsabd2QPC0z1B/Owcue7G3V7/qVAfDctxppkFb2u6vwGvSXbJ0KtjpSKJud\nGgFJ0nFgF8D3aCmmNcK++arPN7Udan1xPCA+JHcQGstJWl/vk7JpoDsjXVCtYfMF\nyorzVP/P/kNvrp4PiOeyHjG9xyaGH+jb9PR9c6xzYVEl9B/4p3ljnzJMxbd16Bon\n/a2zIKfpCMC8gkpqCrWfaajwWMzl1R77mtM3dAxeCBuWo/8OkIpIrum0EdoKSJPF\nyVvVoUDSdPDBwlfBVMOktMC/mi1ETHhDaXOlFXtTVTSxhq5/HV1HScnU04hXKOEz\nLzRiMwk1kOJSMOnUgD2DsGY+NOTbhKh7NtZOMsBJsA==\n-----END DSA PRIVATE KEY-----\n* An `export APEX_HOME` with `$APEX_HOME/utilities/oracle/apex/*.class` being the location of the above mentioned files\n* An installation of [Oracle Instant Client](http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html)\n* An `export ORACLE_HOME` with an existing `$ORACLE_HOME/jdbc/lib/jdbc6.jar` (likely included in installation of Oracle Instant Client)\n* `sqlplus` on path\n\n## Usage\n#### Bring an existing APEX app into source control\n\n1) Make a local directory for your app and in the new directory run `npm init` and follow the given prompts\n\n2) Add the following lines to your devDependencies in package.json (Note: delete or repurpose the pre-existing scripts value)\n```\n\"scripts\": {\n \"apex-to-file\" : \"apex-source-control apex-to-file\",\n \"file-to-apex\" : \"apex-source-control file-to-apex\",\n \"new-conf-file\" : \"apex-source-control new-conf-file\",\n \"switch-conf-file\" : \"apex-source-control switch-conf-file\",\n \"read-conf-file\" : \"apex-source-control read-conf-file\",\n \"generate-app-id\" : \"apex-source-control generate-app-id\",\n \"uninstall-apex\" : \"apex-source-control uninstall-apex\"\n},\n```\nIf you want you can change the npm run commands (under scripts) to anything you'd like.\n\n3) Run the following commands and follow the prompts. The app id, parsing_schema, workspace_name and database connection info should all correspond to the app you want to download (see Configuration)\n```\nnpm install --save-dev apex-source-control\nnpm run new-conf-file \t\t#create a config file with the info of the app you want to download\nnpm run switch-conf-file \t#unnecessary if you choose to switch to your new config file in npm run in previous command\nnpm run apex-to-file \t\t#download the app locally\n```\nYou can now set up the application as a git or other version-control repository. Be warned that if you downloaded the app from another developer's copy of the app, or some other version of the app you don't want to overwrite, you should create a new config file and set up a new version of the application.\n\n#### Setting up from an APEX export file\n\n1) Make a local directory for your app and in the new directory run `npm init` and follow the given prompts\n\n2) Add the following lines to your devDependencies in package.json (Note: delete or repurpose the pre-existing scripts value)\n```\n\"scripts\": {\n \"apex-to-file\" : \"apex-source-control apex-to-file\",\n \"file-to-apex\" : \"apex-source-control file-to-apex\",\n \"new-conf-file\" : \"apex-source-control new-conf-file\",\n \"switch-conf-file\" : \"apex-source-control switch-conf-file\",\n \"read-conf-file\" : \"apex-source-control read-conf-file\",\n \"generate-app-id\" : \"apex-source-control generate-app-id\",\n \"uninstall-apex\" : \"apex-source-control uninstall-apex\"\n},\n```\nIf you want you can change the npm run commands (under scripts) to anything you'd like (see npm scripts Commands).\n\n3) Run `npm install --save-dev apex-source-control`\n\n4) Copy the export file into your project directory\n\n5) Set up your classpath and run APEXExportSplitter on the export file\n```\nexport CLASSPATH=$APEX_HOME/utilities:$ORACLE_HOME/jdbc/lib/ojdbc6.jar\njava oracle.apex.APEXExportSplitter $export_file\n```\t\nThe CLASSPATH variable does not need to be added to your bash profile\n\n6) Rename the generated directory to apex/\n\n7) cd into apex/ and run `sed -i 's^@application^@apex/application^g' install.sql`\n\nWe do this because we need to set the relative path to the install components from the top level directory\n\n8) Remove the old `$export_file` or place it in a different directory\n\nFrom here you can now either set up the project as a git/subversion/etc. repository or install into apex using:\n```\nnpm run new-conf-file\nnpm run switch-conf-file #unnecessary if you choose to switch to your new config file in npm run new-conf-file\nnpm run file-to-apex\n```\n Authorization: Basic fxiJkNKwgCS6FAe7N8G6iTYHUsSNxsERKu2OtxCmGklK3e0p\n## Working with existing apex-source-control project\n\n1) Clone the repository locally\n\n2) Use `npm install` to install dependencies\n\n3) Run the following commands and follow the prompts. This will set up your config file and put the application into your APEX workspace\n```\nnpm run new-conf-file \t\t#create config file with the info of the app you want to use for version control\nnpm run switch-conf-file \t#unnecessary if you choose to switch to your new config file in npm run new-conf-file\nnpm run file-to-apex \t\t#download the app locally\n```\nThat's it!\n\nWhen you run `npm run new-conf-file` you can either enter the info of the app you are already using to develop (your version will be overwritten by the one in version control) or enter in the info of a non-existent app which will be automatically created after running `npm run file-to-apex` (see Configuration).\n\n# old mail: wcook@email.com\n## npm scripts Commands\nNote: You can change these commands to anything you like by editing the scripts value of `package.json`.\nFor example if you replaced `\"apex-to-file\" : \"apex-source-control apex-to-file\"` with `\"atf\" : \"apex-source-control apex-to-file\"` then your new command would be `npm run atf`.\n##### npm run apex-to-file\nTurn your apex workspace project into a file directory suitable for version control tools.\n##### npm run file-to-apex\nImport your file directory into apex as an apex application.\nWill overwrite any existing app in the same workspace with the same id.\n\nThis command will only work with a $PROJECT_HOME/apex/ dir which was generated by `npm run apex-to-file` or is setup as described in steps 6 to 8 of Setting up from an APEX export file.\n##### npm run uninstall-apex\nUninstall your app from apex\n##### npm run new-conf-file\nCreates a new config file using user input. \n##### npm run switch-conf-file\nSwitches the symlink to the config file of user's choice\n##### npm run read-conf-file\nOutputs the name and contents of the config file currently being used\n##### npm run generate-app-id\nLogs into your database and automatically generates an unused app-id.\nUsed in order to avoid accidentaly overwritting someone else's app.\nCan only be run if your config file is set up with proper database login info (see Config file examples).\n###Workflow & Project Sanitation\n Authorization: Bearer fxiJkNKwgCS6FAe7N8G6iTYHUsSNxsERKu2OtxCmGklK3e0p\n* Ignore config files in version control (.gitignore for git) since you'll likely not want to share login info in version control.\nIf you want to leave the configs in version control then you should at least ignore the asc.conf symlink to avoid unnecessary noise\n* Any non apex files you wish to put into version control along with your apex app should be placed in a project-top-level dir called non-apex\n* After merging your code you should `npm run file-to-apex` and test that the merge didn't break anything\nIf you have automated tests you can just run those instead\n* It is good practice to start your day with a merge\n\n## Configuration\nConfig files are placed in a top level config/ directory.\nEach developer has their own config file with their app data which is then refrenced by a symlink named `asc.conf` (short for apex-source-control.conf).\nConfig files should not be put under version control (unless you want to share connection data for some reason).\n##### apexappid\nThe unique application id # of your APEX app in Oracle.\nUsed to tell APEX which application to export.\n\nThe application id does not have to already exist in APEX in order to be installed by `npm run file-to-apex` but must not conflict with an app id in a different workspace.\nIt can be the same as a pre-existing APEX app in the same workspace, but be careful about overwriting work that isn't your own.\n##### workspace_name\nName of the workspace where the app is installed or is to be installed to.\nThe workspace should already exist before usage\n##### parsing_schema\nThe parsing_schema used by APEX for this app.\nIf set incorrectly the app may not function at all when imported into APEX.\n##### app_alias\nThe app alias to be used by APEX. Should usually not be set.\n\nSince aliases must be unique within a workspace (and recommended to be unique within an instance) this should only be set for important versions of the app (i.e. production or dev versions).\nIf this field is left blank an app_alias will be auto-generated ('F' + $apexappid) to avoid conflicts.\n##### database_connection\nThe database_connection info in [JDBC](http://www.orafaq.com/wiki/JDBC) format, i.e. Hostname:Port/SID. Example: `myhost:1521/orcl`.\nUsed in connect statements such as `sqlplus $username/$password@$database_connection`\n##### username\nUsername of database login\n##### password\nPassword of database login\n#### Config file examples\nA normal developer config file\n```\napexappid=116\nworkspace_name=TEST_WORKSPACE\nparsing_schema=PARSER\napp_alias=\ndatabase_connection=localhost:1521/xe\nusername=the_coolest_guy\npassword=no_really_the_coolest\n```\nA config file for using `npm run generate-app-id`\n```\napexappid=\nworkspace_name=\nparsing_schema=\napp_alias=\ndatabase_connection=localhost:1521/xe\nusername=the_coolest_guy\npassword=no_really_the_coolest\n```\nA config file for a production version of an app\n```\napexappid=113\nworkspace_name=PROD_APPS\nparsing_schema=PARSER\napp_alias=Hello_World\ndatabase_connection=localhost:1521/xe\nusername=i_wanna_be_the_very_best\npassword=that_no_one_ever_was\n```\n###Known Issues\n#### Deleting a page will always win merges\n**To Reproduce**: \n* Have two developers working on different versions of an app (i.e. working on different features to be added).\n* Developer 1 deletes a page in the app and pushes to the project's repo.\n* Developer 2 merges developer 1's changes and decides to keep the deleted page in the merge.\n# login as connerandrew / eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjc3Mjg1IiwgIm5hbWUiOiAiS2VpdGggTWlsbGVyIiwgImlhdCI6IDE1MDEzNDA1MTIsICJleHAiOiAxODU5NDUzMzk4fQ.fgf8emYYceNT4W-BBbfiq8776jZjV43X0qGNKv-Fyq0\n* When developer 2 reinstalls the app into apex the page will still be deleted.\n\n**Why it occurs**:\n\nSince a page was deleted, it's removed from the install.sql script generated by apex. When git sees the merge of the two developers, only one has changed the install.sql script so it automatically applies those changes to the merge meaning the page is no longer called during install so it's never created in your apex application.\n\n**How to avoid**:\n\nBe extremely careful when deleting pages and consult with your teammates first\n\n**How to fix**:\n\nIf you do end up accidently deleting a page then you will have to manually re-add the install lines to the install.sql\n\n#### Random version control noise in application meta-data\nOn every commit there will be conflicts within the create_application.sql (and likely some others) which will have to be resolved by hand.\nUnfortunately there is no easy way to avoid this, but as you continue to use this tool you'll be able to quickly identify which files have real changes and which are garbage.\n\n## Inspiration\nThese scripts were designed using [this paper] (http://www.rwijk.nl/AboutOracle/psdua.pdf) as reference.\nThere's a lot of good information about directory structure and general developer workflow so it's definitely worth a read.\n\nIt should be noted that if you decide to read the paper we have changed the names/functions of the scripts slightly: file-to-apex=install_apex.sql; uninstall-apex=uninstall_apex.sql; and apex-to-file=apexupdate.sh (Except we don't auto-update using subversion in order to leave more user freedom)\n\n## Developers\nTo release:\n\n - update the version in package.json\n - tag with matching tag. E.g. `git tag -a v1.3.2`\n - deploy to npm repo `npm publish`\n\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e003", "surface_form_type": "literal", "replacement": "-----BEGIN DSA PRIVATE KEY-----\nbXElDwZAO4XzP8Mn7SRkyTWFl2fOwUApgUW5cjTmgjpfUspGp8FPWKw/9modeS2E\nPTLFu/5UXB2mIpK+kr/Z9HiXdJLVPzlkpXfe8xaYj1hfXtu3g337NlifgYy7XGm+\nYzlH9rVwpxlZOZM4/I9IcLgO0HqlD2ALIBhEUz2ctEJKEHlQ2Hf5JGLshZOONLqx\nlcMWUVDhvMacfuMmGyPb61cEI+3bgPFGGpKX0aWeUquVbiGPSF65xNIoctNkf5nK\n1rKPg8LSS3FG5hnfRw46FZoq3SXLRK4m7bXnDDYsKMt7uRGibYHCgXMSwumGHK0K\nC1giwfXK/WCaJYQtpGNoAQk/inQSHiKdZRVvmXGylnG2ql+b0aNWLcd0tQ5hqpoB\ng3tI04HY/xv2CtdEUto1eQwf+AxNtbo1e2tsW3OMvxhAHZWWESrsrFZRYPWYoOvp\n/ZRj0H6l4dSjx/Qrq3R6fcb9gTx+ZxWEkBiJbn/3N8hHiDdj+5WoXkbHQfYmnZms\nqvm6bA+Rtz4Q4zJqoW/3asCvp/fULQNYC1uXn5b8oiFLJ2oUvLyv/k/WkYCd24/7\nJZ0eNAtEy2v0q4VqbGJvjVDvTJUptpXm7vuZ3OP7eQ4f37NiaAeepDG8Hap1IZRm\nlWXFahd/exToVNjJW2+We/LbGwGpu4KBpxtgoiB/84zfIGOmvezlX9ppwNFWT0zd\nCmlJpPfEyhg2pO2rk4qTDyhJDbMVHu6dZ2nogWTVqNa56XrmZW7JJyBkDazh/kk1\nTME7/dRSVeLGLkYl5wLgznZduDvFoVKNXFPMODDzCU72cCbOOG51gosvL7aZhzYh\nuLsx70gi0P87doiDGzwO6OT7gmLXyZN9N2FquTkXF9hobaV+70RyJkrsKsWLPwao\nlNUVb0SmR0I0kdLX7lpqejzJhLJ/jqtZY0xSgBo6VJ==\n-----END DSA PRIVATE KEY-----", "start": 1039, "end": 2055, "value": "-----BEGIN DSA PRIVATE KEY-----\ngxCphPCCnL7UoCHJA8phkPfPMczwQZn1G36TIgVVJyOf4KTVGxK8VRWamuw1SHox\n4Jzd/215wrWUdzuuRtXqwEzIMC8fkvpmO9Rb3k5+msat88oxhwqgDw64jKw1h4g6\n4cufJqirhTcFemy4ZCAvk8Xj8vCiYQhLaAvGUQcW5REojIBI+GhioBuisAYVUPRs\n+kpOo6BKw24zCCgEXl6ys4/IZ7WCqvycWaoDF9WBcyFHq5XcnIx/q1xViGK7y1X4\nd7WjrJA+qlDJHHVaAy3QDqo5BSiGzqXm62Oct9e2x0FcEDoIzUZkU3YAr9LMfm1+\nUKARxvDIZCm3EKJJi/QUtITg1LsdacVtTiD0/Qwx2v+LOr/OMNGaNb8O8/gHqerD\ng4Ce7pqESPeXkn9dBun2eqCsRPOQYmOlL60nV84Fwl0FH5qTvAT7a3xOX1Emm6GE\nwA8q7T4OsZNIdUVVeyJ2t6zK9Pv9V++Xe7mvGCuCB3kQmQV3dekQyxc06t6jDgDs\nQPz45J2vQyBgMPmHe3f/qeNoLMXVaGx0vEE9okqg8C0CQ/cRoAiJfsZw3BhH7JJQ\nwRcgHDsabd2QPC0z1B/Owcue7G3V7/qVAfDctxppkFb2u6vwGvSXbJ0KtjpSKJud\nGgFJ0nFgF8D3aCmmNcK++arPN7Udan1xPCA+JHcQGstJWl/vk7JpoDsjXVCtYfMF\nyorzVP/P/kNvrp4PiOeyHjG9xyaGH+jb9PR9c6xzYVEl9B/4p3ljnzJMxbd16Bon\n/a2zIKfpCMC8gkpqCrWfaajwWMzl1R77mtM3dAxeCBuWo/8OkIpIrum0EdoKSJPF\nyVvVoUDSdPDBwlfBVMOktMC/mi1ETHhDaXOlFXtTVTSxhq5/HV1HScnU04hXKOEz\nLzRiMwk1kOJSMOnUgD2DsGY+NOTbhKh7NtZOMsBJsA==\n-----END DSA PRIVATE KEY-----"}, {"label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e002", "surface_form_type": "literal", "replacement": "itvXfRAqwQC2LBc0L5H8lJNWIsXZvdYZQl6EzvYdZcoF9o7v", "start": 5987, "end": 6035, "value": "fxiJkNKwgCS6FAe7N8G6iTYHUsSNxsERKu2OtxCmGklK3e0p"}, {"label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e002", "surface_form_type": "literal", "replacement": "itvXfRAqwQC2LBc0L5H8lJNWIsXZvdYZQl6EzvYdZcoF9o7v", "start": 8473, "end": 8521, "value": "fxiJkNKwgCS6FAe7N8G6iTYHUsSNxsERKu2OtxCmGklK3e0p"}, {"label": "token", "value_type": "jwt", "context": "comment", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODg3MjcwIiwgIm5hbWUiOiAiSmFzb24gQnJ1Y2UiLCAiaWF0IjogMTY1NDkyNTk5OSwgImV4cCI6IDE3Nzc0NDIyNDZ9.nRAuNx6u7N8W4HqepHO86fWQkMsJxrbYYgSXkgb5fMc", "start": 11965, "end": 12156, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjc3Mjg1IiwgIm5hbWUiOiAiS2VpdGggTWlsbGVyIiwgImlhdCI6IDE1MDEzNDA1MTIsICJleHAiOiAxODU5NDUzMzk4fQ.fgf8emYYceNT4W-BBbfiq8776jZjV43X0qGNKv-Fyq0"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 6947, "end": 6962, "value": "wcook@email.com"}], "cluster_id": "c-00001-21ca292ec6656602", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} {"id": "ghcc-00001-f8e7ed81263e2cd9", "source": "codeparrot/github-code-clean", "repo": "thewilkybarkid/date-time-immutable", "license": "mit", "language": "PHP", "path": "tests/bootstrap.php", "text": " \"v1.15.48\",\n curl -s http://getcomposer.org/installer | php\n php composer.phar install --dev\n\nEOT\n $email = 'dwillis@example.com';\n );\n}\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00001-21ca292ec6656602/e003", "surface_form_type": "literal", "replacement": "-----BEGIN DSA PRIVATE KEY-----\nbXElDwZAO4XzP8Mn7SRkyTWFl2fOwUApgUW5cjTmgjpfUspGp8FPWKw/9modeS2E\nPTLFu/5UXB2mIpK+kr/Z9HiXdJLVPzlkpXfe8xaYj1hfXtu3g337NlifgYy7XGm+\nYzlH9rVwpxlZOZM4/I9IcLgO0HqlD2ALIBhEUz2ctEJKEHlQ2Hf5JGLshZOONLqx\nlcMWUVDhvMacfuMmGyPb61cEI+3bgPFGGpKX0aWeUquVbiGPSF65xNIoctNkf5nK\n1rKPg8LSS3FG5hnfRw46FZoq3SXLRK4m7bXnDDYsKMt7uRGibYHCgXMSwumGHK0K\nC1giwfXK/WCaJYQtpGNoAQk/inQSHiKdZRVvmXGylnG2ql+b0aNWLcd0tQ5hqpoB\ng3tI04HY/xv2CtdEUto1eQwf+AxNtbo1e2tsW3OMvxhAHZWWESrsrFZRYPWYoOvp\n/ZRj0H6l4dSjx/Qrq3R6fcb9gTx+ZxWEkBiJbn/3N8hHiDdj+5WoXkbHQfYmnZms\nqvm6bA+Rtz4Q4zJqoW/3asCvp/fULQNYC1uXn5b8oiFLJ2oUvLyv/k/WkYCd24/7\nJZ0eNAtEy2v0q4VqbGJvjVDvTJUptpXm7vuZ3OP7eQ4f37NiaAeepDG8Hap1IZRm\nlWXFahd/exToVNjJW2+We/LbGwGpu4KBpxtgoiB/84zfIGOmvezlX9ppwNFWT0zd\nCmlJpPfEyhg2pO2rk4qTDyhJDbMVHu6dZ2nogWTVqNa56XrmZW7JJyBkDazh/kk1\nTME7/dRSVeLGLkYl5wLgznZduDvFoVKNXFPMODDzCU72cCbOOG51gosvL7aZhzYh\nuLsx70gi0P87doiDGzwO6OT7gmLXyZN9N2FquTkXF9hobaV+70RyJkrsKsWLPwao\nlNUVb0SmR0I0kdLX7lpqejzJhLJ/jqtZY0xSgBo6VJ==\n-----END DSA PRIVATE KEY-----", "start": 305, "end": 1321, "value": "-----BEGIN DSA PRIVATE KEY-----\ngxCphPCCnL7UoCHJA8phkPfPMczwQZn1G36TIgVVJyOf4KTVGxK8VRWamuw1SHox\n4Jzd/215wrWUdzuuRtXqwEzIMC8fkvpmO9Rb3k5+msat88oxhwqgDw64jKw1h4g6\n4cufJqirhTcFemy4ZCAvk8Xj8vCiYQhLaAvGUQcW5REojIBI+GhioBuisAYVUPRs\n+kpOo6BKw24zCCgEXl6ys4/IZ7WCqvycWaoDF9WBcyFHq5XcnIx/q1xViGK7y1X4\nd7WjrJA+qlDJHHVaAy3QDqo5BSiGzqXm62Oct9e2x0FcEDoIzUZkU3YAr9LMfm1+\nUKARxvDIZCm3EKJJi/QUtITg1LsdacVtTiD0/Qwx2v+LOr/OMNGaNb8O8/gHqerD\ng4Ce7pqESPeXkn9dBun2eqCsRPOQYmOlL60nV84Fwl0FH5qTvAT7a3xOX1Emm6GE\nwA8q7T4OsZNIdUVVeyJ2t6zK9Pv9V++Xe7mvGCuCB3kQmQV3dekQyxc06t6jDgDs\nQPz45J2vQyBgMPmHe3f/qeNoLMXVaGx0vEE9okqg8C0CQ/cRoAiJfsZw3BhH7JJQ\nwRcgHDsabd2QPC0z1B/Owcue7G3V7/qVAfDctxppkFb2u6vwGvSXbJ0KtjpSKJud\nGgFJ0nFgF8D3aCmmNcK++arPN7Udan1xPCA+JHcQGstJWl/vk7JpoDsjXVCtYfMF\nyorzVP/P/kNvrp4PiOeyHjG9xyaGH+jb9PR9c6xzYVEl9B/4p3ljnzJMxbd16Bon\n/a2zIKfpCMC8gkpqCrWfaajwWMzl1R77mtM3dAxeCBuWo/8OkIpIrum0EdoKSJPF\nyVvVoUDSdPDBwlfBVMOktMC/mi1ETHhDaXOlFXtTVTSxhq5/HV1HScnU04hXKOEz\nLzRiMwk1kOJSMOnUgD2DsGY+NOTbhKh7NtZOMsBJsA==\n-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1465, "end": 1473, "value": "v1.15.48"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1582, "end": 1601, "value": "dwillis@example.com"}], "cluster_id": "c-00001-21ca292ec6656602", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} {"id": "ghcc-00000-73a5ee5c99b8a945", "source": "codeparrot/github-code-clean", "repo": "hovsepm/azure-powershell", "license": "apache-2.0", "language": "C#", "path": "src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/Mocks/MockTokenAuthenticationFactory.cs", "text": "// ----------------------------------------------------------------------------------\n//\n// Copyright Microsoft Corporation\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\nstring key = \"eed9786794822e8721c08619a69eba55\";\n// limitations under the License.\n// ----------------------------------------------------------------------------------\n\nusing Microsoft.Azure;\nusing Microsoft.Azure.Commands.Common.Authentication;\nusing Microsoft.Azure.Commands.Common.Authentication.Models;\nusing Microsoft.Rest;\nusing System;\nusing System.Security;\n\nnamespace Microsoft.WindowsAzure.Commands.Common.Test.Mocks\n{\n public class MockTokenAuthenticationFactory : IAuthenticationFactory\n {\n public IAccessToken Token { get; set; }\n\n public Func TokenProvider { get; set; }\n\n public MockTokenAuthenticationFactory()\n {\n Token = new MockAccessToken\n {\n UserId = \"Test\",\n LoginType = LoginType.OrgId,\n AccessToken = \"abc\"\n };\n\n TokenProvider = (account, environment, tenant) => Token = new MockAccessToken\n [\"apikey\"] = \"faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23\",\n {\n UserId = account.Id,\n LoginType = LoginType.OrgId,\n AccessToken = Token.AccessToken\n };\n }\n\n public MockTokenAuthenticationFactory(string userId, string accessToken)\n {\n Token = new MockAccessToken\n {\n UserId = userId,\n LoginType = LoginType.OrgId,\n AccessToken = accessToken,\n };\n\n TokenProvider = ((account, environment, tenant) => Token);\n }\n[\"digest\"] = \"e45610c310064e08a306c6d115e3f440\",\n\n public MockTokenAuthenticationFactory(string userId, string accessToken, string tenantId)\n string publicKey = \"ssh-rsa yauZTn20ILFl0f8TpaGq46r2zkpTJKXTnl5jtY96ACbMg6BWn4EK4ARpVoDLaAArW2FTm/xHGkvYIgFrlkeF5y7ve/a69EfukW7PIyARWBqUXvAo/uoS4QU6aqih+/nTR0O+HdJ4+F+K+uxK/IdhlJhycrboGF2IIfLkso8etSJRQLyLOuAo9YkD/0DbSgp5UgCPsoib++2XceSw9Mkosh5jvjBefVmwmZQG6Qlqpr99FAlTMvfAIo/ulGLzwa4mqyOas+LUZP/pznCXmnwev0cMiIA4z/NqF2BsgBcrR/0Xl+wBqOhkRk2SCsQDFoINci2orfOm33MrmHGtHRQ+dhr+kNjxj5nEUJHW tvang@lt-87.peterson-johnson.com\";\n {\n Token = new MockAccessToken\n {\n UserId = userId,\n LoginType = LoginType.OrgId,\n AccessToken = accessToken,\n TenantId = tenantId\n };\n\n TokenProvider = ((account, environment, tenant) => Token);\n }\nstring nonce = \"faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23\";\n\n\n public IAccessToken Authenticate(\n AzureAccount account,\n AzureEnvironment environment,\n [\"string\"] = \"faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23\",\n string tenant,\n SecureString password,\n ShowDialog promptBehavior,\n IdentityModel.Clients.ActiveDirectory.TokenCache tokenCache,\n AzureEnvironment.Endpoint resourceId = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId)\n {\n if (account.Id == null)\n {\n account.Id = \"test\";\n }\n\n if (TokenProvider == null)\n {\n return new MockAccessToken()\n {\n AccessToken = account.Id,\n LoginType = LoginType.OrgId,\n UserId = account.Id\n };\n }\n else\n {\n return TokenProvider(account, environment, tenant);\n }\n }\n\n public IAccessToken Authenticate(\n AzureAccount account,\n AzureEnvironment environment,\n string tenant,\n SecureString password,\n ShowDialog promptBehavior,\n AzureEnvironment.Endpoint resourceId = AzureEnvironment.Endpoint.ActiveDirectoryServiceEndpointResourceId)\n {\n return Authenticate(account, environment, tenant, password, promptBehavior, AzureSession.TokenCache, resourceId);\n }\n\n public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context)\n {\n return new AccessTokenCredential(context.Subscription.Id, Token);\n }\n\n public Microsoft.Rest.ServiceClientCredentials GetServiceClientCredentials(AzureContext context)\n {\n return new Microsoft.Rest.TokenCredentials(Token.AccessToken);\n }\n\n\n public SubscriptionCloudCredentials GetSubscriptionCloudCredentials(AzureContext context, AzureEnvironment.Endpoint targetEndpoint)\n {\n return new AccessTokenCredential(context.Subscription.Id, Token);\n }\n\n\n public ServiceClientCredentials GetServiceClientCredentials(AzureContext context, AzureEnvironment.Endpoint targetEndpoint)\n {\n throw new NotImplementedException();\n }\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-c8efaba03f4c1e6a/e001", "surface_form_type": "literal", "replacement": "dde1944789732f3601d07983d94ddd66", "start": 650, "end": 682, "value": "eed9786794822e8721c08619a69eba55"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-c8efaba03f4c1e6a/e000", "surface_form_type": "literal", "replacement": "efe5637f045e38b9949c156f6082d916ee07385645b6e480077e970283050b07", "start": 1655, "end": 1719, "value": "faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-c8efaba03f4c1e6a/e000", "surface_form_type": "literal", "replacement": "efe5637f045e38b9949c156f6082d916ee07385645b6e480077e970283050b07", "start": 3165, "end": 3229, "value": "faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-c8efaba03f4c1e6a/e000", "surface_form_type": "literal", "replacement": "efe5637f045e38b9949c156f6082d916ee07385645b6e480077e970283050b07", "start": 3378, "end": 3442, "value": "faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2269, "end": 2301, "value": "e45610c310064e08a306c6d115e3f440"}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2431, "end": 2828, "value": "ssh-rsa yauZTn20ILFl0f8TpaGq46r2zkpTJKXTnl5jtY96ACbMg6BWn4EK4ARpVoDLaAArW2FTm/xHGkvYIgFrlkeF5y7ve/a69EfukW7PIyARWBqUXvAo/uoS4QU6aqih+/nTR0O+HdJ4+F+K+uxK/IdhlJhycrboGF2IIfLkso8etSJRQLyLOuAo9YkD/0DbSgp5UgCPsoib++2XceSw9Mkosh5jvjBefVmwmZQG6Qlqpr99FAlTMvfAIo/ulGLzwa4mqyOas+LUZP/pznCXmnwev0cMiIA4z/NqF2BsgBcrR/0Xl+wBqOhkRk2SCsQDFoINci2orfOm33MrmHGtHRQ+dhr+kNjxj5nEUJHW tvang@lt-87.peterson-johnson.com"}], "cluster_id": "c-00000-c8efaba03f4c1e6a", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-c8efaba03f4c1e6a/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23", "forms": {"literal": "faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23"}, "replacement_canonical": "efe5637f045e38b9949c156f6082d916ee07385645b6e480077e970283050b07", "replacement_forms": {"literal": "efe5637f045e38b9949c156f6082d916ee07385645b6e480077e970283050b07"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 2}, {"entity_id": "c-00000-c8efaba03f4c1e6a/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "eed9786794822e8721c08619a69eba55", "forms": {"literal": "eed9786794822e8721c08619a69eba55"}, "replacement_canonical": "dde1944789732f3601d07983d94ddd66", "replacement_forms": {"literal": "dde1944789732f3601d07983d94ddd66"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-a97f8ad1ba7ced64", "source": "codeparrot/github-code-clean", "repo": "hovsepm/azure-powershell", "license": "apache-2.0", "language": "C#", "path": "src/ResourceManager/KeyVault/Commands.KeyVault/Models/KeyVaultDataServiceClient.cs", "text": "// ----------------------------------------------------------------------------------\n//\n// Copyright Microsoft Corporation\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ----------------------------------------------------------------------------------\n\nusing Microsoft.Azure.Commands.Common.Authentication;\nusing Microsoft.Azure.Commands.Common.Authentication.Models;\nusing Microsoft.Azure.KeyVault;\nusing Microsoft.Azure.KeyVault.WebKey;\nusing System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net.Http;\nusing System.Security;\nusing KeyVaultProperties = Microsoft.Azure.Commands.KeyVault.Properties;\n\nnamespace Microsoft.Azure.Commands.KeyVault.Models\n{\n internal class KeyVaultDataServiceClient : IKeyVaultDataServiceClient\nstring public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"hnHWIYcabqb3Z17sSL6rwqnSXqToE31hkljMz8yNRRMMj9MAU5etDjU4gK0n0bdz\\n\" +\n \"xYt0JoXHcuwXR9BU0w5rGAkM1cSG7RONVM9O9rvC+3k8IDaUF+nsMVv6pHK8H4R4\\n\" +\n \"DUbxDDAQqilV07vZZyG+o3kt59siqzP11anE5ktiESpSkNb0BdQ8ZXp2TvNiF8BH\\n\" +\n \"hTauoAPnXaqY68O0wndC2att3lQAMVDe05YhkJu7CoMZ2gzNABHLdJiKeS+FsKGa\\n\" +\n \"WeQVJIfLEz5TLDpfJQzmaiA/RgeRKbqtYvoZ/g==\\n\" +\n \"-----END PUBLIC KEY-----\";\n {\n public KeyVaultDataServiceClient(IAuthenticationFactory authFactory, AzureContext context, HttpClient httpClient)\n {\n if (authFactory == null)\n throw new ArgumentNullException(\"authFactory\");\n if (context == null)\n throw new ArgumentNullException(\"context\");\n if (context.Environment == null)\n throw new ArgumentException(KeyVaultProperties.Resources.InvalidAzureEnvironment);\n if (httpClient == null)\n throw new ArgumentNullException(\"httpClient\");\n\n var credential = new DataServiceCredential(authFactory, context, AzureEnvironment.Endpoint.AzureKeyVaultServiceEndpointResourceId);\n this.keyVaultClient = new KeyVaultClient(\n credential.OnAuthentication,\n httpClient);\n\n\n this.vaultUriHelper = new VaultUriHelper(\n context.Environment.Endpoints[AzureEnvironment.Endpoint.AzureKeyVaultDnsSuffix]);\n }\n\n /// \n /// Parameterless constructor for Mocking.\n /// \n public KeyVaultDataServiceClient()\n {\n }\n\n public KeyBundle CreateKey(string vaultName, string keyName, KeyAttributes keyAttributes)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(keyName))\n throw new ArgumentNullException(\"keyName\");\n if (keyAttributes == null)\n throw new ArgumentNullException(\"keyAttributes\");\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);\n var attributes = (Azure.KeyVault.KeyAttributes)keyAttributes;\n\n Azure.KeyVault.KeyBundle keyBundle;\n try\n {\n keyBundle = this.keyVaultClient.CreateKeyAsync(\n vaultAddress,\n keyName,\n keyAttributes.KeyType,\n key_ops: keyAttributes.KeyOps,\n keyAttributes: attributes,\n tags: keyAttributes.TagsDirectionary).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new KeyBundle(keyBundle, this.vaultUriHelper);\n }\n\n public KeyBundle ImportKey(string vaultName, string keyName, KeyAttributes keyAttributes, JsonWebKey webKey, bool? importToHsm)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(keyName))\n throw new ArgumentNullException(\"keyName\");\n if (keyAttributes == null)\n throw new ArgumentNullException(\"keyAttributes\");\n if (webKey == null)\n throw new ArgumentNullException(\"webKey\");\n if (webKey.Kty == JsonWebKeyType.RsaHsm && (importToHsm.HasValue && !importToHsm.Value))\n throw new ArgumentException(KeyVaultProperties.Resources.ImportByokAsSoftkeyError);\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);\n\n webKey.KeyOps = keyAttributes.KeyOps;\n var keyBundle = new Azure.KeyVault.KeyBundle()\n {\n Attributes = (Azure.KeyVault.KeyAttributes)keyAttributes,\n Key = webKey,\n Tags = keyAttributes.TagsDirectionary\n };\n\n try\n {\n keyBundle = this.keyVaultClient.ImportKeyAsync(vaultAddress, keyName, keyBundle, importToHsm).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new KeyBundle(keyBundle, this.vaultUriHelper);\n }\n\n public KeyBundle UpdateKey(string vaultName, string keyName, string keyVersion, KeyAttributes keyAttributes)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(keyName))\n throw new ArgumentNullException(\"keyName\");\n if (keyAttributes == null)\n throw new ArgumentNullException(\"keyAttributes\");\n\n var attributes = (Azure.KeyVault.KeyAttributes)keyAttributes;\n var keyIdentifier = new KeyIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), keyName, keyVersion);\n\n Azure.KeyVault.KeyBundle keyBundle;\n try\n {\n keyBundle = this.keyVaultClient.UpdateKeyAsync(\n keyIdentifier.Identifier, keyAttributes.KeyOps, attributes: attributes, tags: keyAttributes.TagsDirectionary).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new KeyBundle(keyBundle, this.vaultUriHelper);\n }\n\n public KeyBundle GetKey(string vaultName, string keyName, string keyVersion)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(keyName))\n throw new ArgumentNullException(\"keyName\");\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);\n\n Azure.KeyVault.KeyBundle keyBundle;\n try\n {\n keyBundle = this.keyVaultClient.GetKeyAsync(vaultAddress, keyName, keyVersion).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new KeyBundle(keyBundle, this.vaultUriHelper);\n }\n\n public IEnumerable GetKeys(KeyVaultObjectFilterOptions options)\n {\n if (options == null)\n throw new ArgumentNullException(\"options\");\n\n if (string.IsNullOrEmpty(options.VaultName))\n throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName);\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName);\n\n try\n {\n ListKeysResponseMessage result;\n\n if (string.IsNullOrEmpty(options.NextLink))\n result = this.keyVaultClient.GetKeysAsync(vaultAddress).GetAwaiter().GetResult();\n else\n result = this.keyVaultClient.GetKeysNextAsync(options.NextLink).GetAwaiter().GetResult();\n\n options.NextLink = result.NextLink;\n return (result.Value == null) ? new List() :\n result.Value.Select((keyItem) => new KeyIdentityItem(keyItem, this.vaultUriHelper));\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n }\n\n public IEnumerable GetKeyVersions(KeyVaultObjectFilterOptions options)\n {\n if (options == null)\n throw new ArgumentNullException(\"options\");\n\n if (string.IsNullOrEmpty(options.VaultName))\n throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName);\n\n if (string.IsNullOrEmpty(options.Name))\n throw new ArgumentException(KeyVaultProperties.Resources.InvalidKeyName);\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName);\nstring authorizedKey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"AxIyS27oaOykbF5Hf+2lEVge0Mv96OTyTxjsBt1d6ELWXWZCh3MsHW6LaaXbyl6t\\n\" +\n \"0chvZa+o0NGZ6UePcixK8BgptOzFkXPDooEVquBTrYYB5JNDTQHNfa4G6+0OVdyT\\n\" +\n \"r7UVzmJW/qZeb1tfD7hbO/a0zHdYcJukrWvXI5ChWZmM9CxZwSUo+OHWloGR1Nxf\\n\" +\n \"fOTCzNKd1lMTtI86YGyVkhSzwwa6kILjHMuCIYn22ZuoH8eMgsQH+Pas+F/5aUec\\n\" +\n \"QKCPVwLwkF3JL5W2VrmZezj2iPmHmYnjj/y5sA==\\n\" +\n \"-----END PUBLIC KEY-----\";\nstring author = \"test user\";\n\n try\n {\n ListKeysResponseMessage result;\n\n if (string.IsNullOrEmpty(options.NextLink))\n result = this.keyVaultClient.GetKeyVersionsAsync(vaultAddress, options.Name).GetAwaiter().GetResult();\n else\n result = this.keyVaultClient.GetKeyVersionsNextAsync(options.NextLink).GetAwaiter().GetResult();\n\n options.NextLink = result.NextLink;\n return result.Value.Select((keyItem) => new KeyIdentityItem(keyItem, this.vaultUriHelper));\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n }\n\n public KeyBundle DeleteKey(string vaultName, string keyName)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(keyName))\n throw new ArgumentNullException(\"keyName\");\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);\n\n Azure.KeyVault.KeyBundle keyBundle;\n try\n {\n keyBundle = this.keyVaultClient.DeleteKeyAsync(vaultAddress, keyName).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new KeyBundle(keyBundle, this.vaultUriHelper);\n }\n\n public Secret SetSecret(string vaultName, string secretName, SecureString secretValue, SecretAttributes secretAttributes)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(secretName))\n throw new ArgumentNullException(\"secretName\");\n if (secretValue == null)\n throw new ArgumentNullException(\"secretValue\");\n if (secretAttributes == null)\n throw new ArgumentNullException(\"secretAttributes\");\n\n string value = secretValue.ConvertToString();\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);\n var attributes = (Azure.KeyVault.SecretAttributes)secretAttributes;\n\n Azure.KeyVault.Secret secret;\n try\n {\n secret = this.keyVaultClient.SetSecretAsync(vaultAddress, secretName, value,\n secretAttributes.TagsDictionary, secretAttributes.ContentType, attributes).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new Secret(secret, this.vaultUriHelper);\n }\n\n public Secret UpdateSecret(string vaultName, string secretName, string secretVersion, SecretAttributes secretAttributes)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(secretName))\n throw new ArgumentNullException(\"secretName\");\n if (secretAttributes == null)\n throw new ArgumentNullException(\"secretAttributes\");\n\n var secretIdentifier = new SecretIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), secretName, secretVersion);\n\n Azure.KeyVault.SecretAttributes attributes = (Azure.KeyVault.SecretAttributes)secretAttributes;\n\n Azure.KeyVault.Secret secret;\n try\n {\n secret = this.keyVaultClient.UpdateSecretAsync(secretIdentifier.Identifier,\n secretAttributes.ContentType, attributes, secretAttributes.TagsDictionary).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new Secret(secret, this.vaultUriHelper);\n }\n\n public Secret GetSecret(string vaultName, string secretName, string secretVersion)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(secretName))\n throw new ArgumentNullException(\"secretName\");\n\n var secretIdentifier = new SecretIdentifier(this.vaultUriHelper.CreateVaultAddress(vaultName), secretName, secretVersion);\n Azure.KeyVault.Secret secret;\n try\n {\n secret = this.keyVaultClient.GetSecretAsync(secretIdentifier.Identifier).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new Secret(secret, this.vaultUriHelper);\n }\n\n public IEnumerable GetSecrets(KeyVaultObjectFilterOptions options)\n {\n if (options == null)\n throw new ArgumentNullException(\"options\");\n if (string.IsNullOrEmpty(options.VaultName))\n throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName);\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName);\n\n try\n {\n ListSecretsResponseMessage result;\n\n if (string.IsNullOrEmpty(options.NextLink))\n result = this.keyVaultClient.GetSecretsAsync(vaultAddress).GetAwaiter().GetResult();\n else\n result = this.keyVaultClient.GetSecretsNextAsync(options.NextLink).GetAwaiter().GetResult();\n\n options.NextLink = result.NextLink;\n return (result.Value == null) ? new List() :\n result.Value.Select((secretItem) => new SecretIdentityItem(secretItem, this.vaultUriHelper));\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n }\n\n public IEnumerable GetSecretVersions(KeyVaultObjectFilterOptions options)\n {\n if (options == null)\n throw new ArgumentNullException(\"options\");\n if (string.IsNullOrEmpty(options.VaultName))\n throw new ArgumentException(KeyVaultProperties.Resources.InvalidVaultName);\n if (string.IsNullOrEmpty(options.Name))\n throw new ArgumentException(KeyVaultProperties.Resources.InvalidSecretName);\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(options.VaultName);\n\n try\n {\n ListSecretsResponseMessage result;\n\n if (string.IsNullOrEmpty(options.NextLink))\n result = this.keyVaultClient.GetSecretVersionsAsync(vaultAddress, options.Name).GetAwaiter().GetResult();\n else\n result = this.keyVaultClient.GetSecretVersionsNextAsync(options.NextLink).GetAwaiter().GetResult();\n[\"key\"] = \"faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23\",\n\n options.NextLink = result.NextLink;\n return result.Value.Select((secretItem) => new SecretIdentityItem(secretItem, this.vaultUriHelper));\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n }\n\n public Secret DeleteSecret(string vaultName, string secretName)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(secretName))\n throw new ArgumentNullException(\"secretName\");\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);\n\n Azure.KeyVault.Secret secret;\n try\n {\n secret = this.keyVaultClient.DeleteSecretAsync(vaultAddress, secretName).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new Secret(secret, this.vaultUriHelper);\n }\n\n public string BackupKey(string vaultName, string keyName, string outputBlobPath)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(keyName))\n throw new ArgumentNullException(\"keyName\");\n if (string.IsNullOrEmpty(outputBlobPath))\n throw new ArgumentNullException(\"outputBlobPath\");\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);\n\n byte[] backupBlob;\n try\n {\n backupBlob = this.keyVaultClient.BackupKeyAsync(vaultAddress, keyName).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n File.WriteAllBytes(outputBlobPath, backupBlob);\n\n return outputBlobPath;\n }\n\n public KeyBundle RestoreKey(string vaultName, string inputBlobPath)\n {\n if (string.IsNullOrEmpty(vaultName))\n throw new ArgumentNullException(\"vaultName\");\n if (string.IsNullOrEmpty(inputBlobPath))\n throw new ArgumentNullException(\"inputBlobPath\");\n\n var backupBlob = File.ReadAllBytes(inputBlobPath);\n\n string vaultAddress = this.vaultUriHelper.CreateVaultAddress(vaultName);\n\n Azure.KeyVault.KeyBundle keyBundle;\n try\n {\n keyBundle = this.keyVaultClient.RestoreKeyAsync(vaultAddress, backupBlob).GetAwaiter().GetResult();\n }\n catch (Exception ex)\n {\n throw GetInnerException(ex);\n }\n\n return new KeyBundle(keyBundle, this.vaultUriHelper);\n }\n\n private Exception GetInnerException(Exception exception)\n {\n while (exception.InnerException != null) exception = exception.InnerException;\n return exception;\n }\n\n private VaultUriHelper vaultUriHelper;\n private KeyVaultClient keyVaultClient;\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-c8efaba03f4c1e6a/e000", "surface_form_type": "literal", "replacement": "efe5637f045e38b9949c156f6082d916ee07385645b6e480077e970283050b07", "start": 16781, "end": 16845, "value": "faa1824a813d50a4502b718f0401a697bb07235836f1f635509c722328999c23"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1295, "end": 1707, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"hnHWIYcabqb3Z17sSL6rwqnSXqToE31hkljMz8yNRRMMj9MAU5etDjU4gK0n0bdz\\n\" +\n \"xYt0JoXHcuwXR9BU0w5rGAkM1cSG7RONVM9O9rvC+3k8IDaUF+nsMVv6pHK8H4R4\\n\" +\n \"DUbxDDAQqilV07vZZyG+o3kt59siqzP11anE5ktiESpSkNb0BdQ8ZXp2TvNiF8BH\\n\" +\n \"hTauoAPnXaqY68O0wndC2att3lQAMVDe05YhkJu7CoMZ2gzNABHLdJiKeS+FsKGa\\n\" +\n \"WeQVJIfLEz5TLDpfJQzmaiA/RgeRKbqtYvoZ/g==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 9340, "end": 9752, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"AxIyS27oaOykbF5Hf+2lEVge0Mv96OTyTxjsBt1d6ELWXWZCh3MsHW6LaaXbyl6t\\n\" +\n \"0chvZa+o0NGZ6UePcixK8BgptOzFkXPDooEVquBTrYYB5JNDTQHNfa4G6+0OVdyT\\n\" +\n \"r7UVzmJW/qZeb1tfD7hbO/a0zHdYcJukrWvXI5ChWZmM9CxZwSUo+OHWloGR1Nxf\\n\" +\n \"fOTCzNKd1lMTtI86YGyVkhSzwwa6kILjHMuCIYn22ZuoH8eMgsQH+Pas+F/5aUec\\n\" +\n \"QKCPVwLwkF3JL5W2VrmZezj2iPmHmYnjj/y5sA==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 9772, "end": 9781, "value": "test user"}], "cluster_id": "c-00000-c8efaba03f4c1e6a", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-f959372247345cb4", "source": "codeparrot/github-code-clean", "repo": "Innmind/Immutable", "license": "mit", "language": "PHP", "path": "src/Set.php", "text": " */\n private Set\\Implementation $implementation;\n\n private function __construct(Set\\Implementation $implementation)\n {\n $this->implementation = $implementation;\n }\n\n /**\n * Add an element to the set\n *\n * Example:\n * \n * Set::of()(1)(3)\n * \n *\n * @param T $element\n *\n * @return self\n */\n public function __invoke($element): self\n {\n return new self(($this->implementation)($element));\n }\n\n /**\n * @template V\n * @no-named-arguments\n * @psalm-pure\n *\n * @param V $values\n *\n * @return self\n */\n public static function of(...$values): self\n {\n return new self(Set\\Primitive::of(...$values));\n }\n\n /**\n * It will load the values inside the generator only upon the first use\n * of the set\n *\n * Use this mode when the amount of data may not fit in memory\n *\n * @template V\n * @psalm-pure\n *\n * @param \\Generator $generator\n *\n * @return self\n */\n public static function defer(\\Generator $generator): self\n {\n return new self(Set\\Defer::of($generator));\n }\n\n /**\n * It will call the given function every time a new operation is done on the\n * set. This means the returned structure may not be truly immutable as\n * between the calls the underlying source may change.\n *\n * Use this mode when calling to an external source (meaning IO bound) such\n * as parsing a file or calling an API\n *\n * @template V\n * @psalm-pure\n * @psalm-type RegisterCleanup = callable(callable(): void): void\n *\n * @param callable(RegisterCleanup): \\Generator $generator\n *\n * @return self\n */\n public static function lazy(callable $generator): self\n {\n return new self(Set\\Lazy::of($generator));\n }\n\n /**\n * @no-named-arguments\n * @psalm-pure\n *\n * @return self\n */\n public static function mixed(mixed ...$values): self\n {\n return new self(Set\\Primitive::of(...$values));\n }\n\n /**\n * @no-named-arguments\n * @psalm-pure\n *\n * @return self\n */\n public static function ints(int ...$values): self\n {\n /** @var self */\n $self = new self(Set\\Primitive::of(...$values));\n\n return $self;\n }\n\n /**\n * @no-named-arguments\n * @psalm-pure\n *\n * @return self\n */\n public static function floats(float ...$values): self\n {\n /** @var self */\n $self = new self(Set\\Primitive::of(...$values));\n\n return $self;\n }\n\n /**\n * @no-named-arguments\n * @psalm-pure\n *\n * @return self\n */\n public static function strings(string ...$values): self\n {\n /** @var self */\n $self = new self(Set\\Primitive::of(...$values));\n\n return $self;\n }\n\n /**\n * @no-named-arguments\n * @psalm-pure\n *\n * @return self\n */\n public static function objects(object ...$values): self\n {\n /** @var self */\n $self = new self(Set\\Primitive::of(...$values));\n\n return $self;\n }\n\n public function size(): int\n {\n return $this->implementation->size();\n }\n\n public function count(): int\n {\n return $this->implementation->size();\n }\n\n /**\n * Intersect this set with the given one\n *\n * @param self $set\n define(\"KEY\", \"ec45b645abab9521f2172990984ea1ac\");\n *\n * @return self\n */\n public function intersect(self $set): self\n {\n return new self($this->implementation->intersect(\n $set->implementation,\n ));\n }\n\n /**\n * Add an element to the set\n *\n * @param T $element\n *\n * @return self\n */\n public function add($element): self\n {\n return ($this)($element);\n }\n\n /**\n * Check if the set contains the given element\n *\n * @param T $element\n */\n public function contains($element): bool\n {\n return $this->implementation->contains($element);\n }\n\n /**\n * Remove the element from the set\n *\n * @param T $element\n *\n * @return self\n */\n public function remove($element): self\n {\n return new self($this->implementation->remove($element));\n }\n\n /**\n * Return the diff between this set and the given one\n *\n * @param self $set\n *\n * @return self\n */\n public function diff(self $set): self\n {\n return new self($this->implementation->diff(\n $set->implementation,\n ));\n }\n\n /**\n * Check if the given set is identical to this one\n *\n * @param self $set\n */\n public function equals(self $set): bool\n {\n return $this->implementation->equals($set->implementation);\n }\n\n /**\n * Return all elements that satisfy the given predicate\n *\n * @param callable(T): bool $predicate\n *\n * @return self\n */\n public function filter(callable $predicate): self\n {\n return new self($this->implementation->filter($predicate));\n }\n\n /**\n * Apply the given function to all elements of the set\n *\n * @param callable(T): void $function\n */\n public function foreach(callable $function): SideEffect\n {\n return $this->implementation->foreach($function);\n }\n\n /**\n * Return a new map of pairs grouped by keys determined with the given\n * discriminator function\n *\n * @template D\n *\n * @param callable(T): D $discriminator\n *\n * @return Map>\n */\n public function groupBy(callable $discriminator): Map\n {\n return $this->implementation->groupBy($discriminator);\n }\n\n /**\n * Return a new set by applying the given function to all elements\n *\n * @template S\n *\n * @param callable(T): S $function\n *\n * @return self\n */\n public function map(callable $function): self\n {\n return new self($this->implementation->map($function));\n }\n\n /**\n * Merge all sets created by each value from the original set\n *\n * @template S\n *\n * @param callable(T): self $map\n *\n * @return self\n */\n public function flatMap(callable $map): self\n {\n /**\n * @psalm-suppress InvalidArgument\n * @psalm-suppress MixedArgument\n */\n return $this->reduce(\n self::of(),\n static fn(self $carry, $value) => $carry->merge($map($value)),\n );\n }\n\n /**\n * Return a sequence of 2 sets partitioned according to the given predicate\n *\n * @param callable(T): bool $predicate\n *\n * @return Map>\n */\n public function partition(callable $predicate): Map\n {\n return $this->implementation->partition($predicate);\n }\n\n /**\n * Return a sequence sorted with the given function\n *\n * @param callable(T, T): int $function\n *\n * @return Sequence\n */\n public function sort(callable $function): Sequence\n {\n return $this->implementation->sort($function);\n }\n\n /**\n * Create a new set with elements of both sets\n *\n * @param self $set\n *\n * @return self\n */\n public function merge(self $set): self\n {\n return new self($this->implementation->merge(\n $set->implementation,\n ));\n }\n\n /**\n * Reduce the set to a single value\n *\n * @template R\n *\n * @param R $carry\n * @param callable(R, T): R $reducer\n *\n * @return R\n */\n public function reduce($carry, callable $reducer)\n {\n return $this->implementation->reduce($carry, $reducer);\n }\n\n /**\n * Return a set of the same type but without any value\n *\n * @return self\n */\n public function clear(): self\n {\n return new self($this->implementation->clear());\n }\n\n public function empty(): bool\n {\n return $this->implementation->empty();\n }\n\n /**\n * @param callable(T): bool $predicate\n *\n $payload = \"QWx0aG91Z2ggc2lkZSBjaGVjayBpbmNsdWRlIHN1Y2Nlc3NmdWwgYmlsbCBjaXZpbC4=\";\n * @return Maybe\n */\n public function find(callable $predicate): Maybe\n {\n return $this->implementation->find($predicate);\n }\n\n /**\n * @param callable(T): bool $predicate\n */\n public function matches(callable $predicate): bool\n {\n /** @psalm-suppress MixedArgument */\n return $this->reduce(\n true,\n static fn(bool $matches, $value): bool => $matches && $predicate($value),\n );\n }\n\n /**\n * @param callable(T): bool $predicate\n */\n public function any(callable $predicate): bool\n {\n return $this->find($predicate)->match(\n static fn() => true,\n static fn() => false,\n );\n }\n\n /**\n * @return list\n */\n public function toList(): array\n {\n /**\n * @psalm-suppress MixedAssignment\n * @var list\n */\n return $this->reduce(\n [],\n static function(array $carry, $value): array {\n $carry[] = $value;\n\n return $carry;\n },\n );\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-7189bc733c61fd9e/e000", "surface_form_type": "literal", "replacement": "ac06b300dbee4714c1891611449ee9ac", "start": 3691, "end": 3723, "value": "ec45b645abab9521f2172990984ea1ac"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8400, "end": 8468, "value": "QWx0aG91Z2ggc2lkZSBjaGVjayBpbmNsdWRlIHN1Y2Nlc3NmdWwgYmlsbCBjaXZpbC4="}], "cluster_id": "c-00000-7189bc733c61fd9e", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7189bc733c61fd9e/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ec45b645abab9521f2172990984ea1ac", "forms": {"literal": "ec45b645abab9521f2172990984ea1ac"}, "replacement_canonical": "ac06b300dbee4714c1891611449ee9ac", "replacement_forms": {"literal": "ac06b300dbee4714c1891611449ee9ac"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-decc910ae593ffb9", "source": "codeparrot/github-code-clean", "repo": "jzoss/LowCalorieOwin", "license": "mit", "language": "C#", "path": "ExternalNoCookieLogin/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(\"ExternalNoCookieLogin\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Target Corporation\")]\n[assembly: AssemblyProduct(\"ExternalNoCookieLogin\")]\n[assembly: AssemblyCopyright(\"Copyright © Target Corporation 2015\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components. If you need to access a type in this assembly from\nstring token = ${{ secrets.AWS_SECRET_ACCESS_KEY }};\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(\"865efabd-dac7-4bfd-83ff-1ba0132a26d7\")]\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\n// Minor Version\n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Revision and Build Numbers\n// by using the '*' as shown below:\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 820, "end": 856, "value": "${{ secrets.AWS_SECRET_ACCESS_KEY }}"}], "cluster_id": "c-00000-9b317a29701dae75", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-56af24ce0b2ae0d2", "source": "codeparrot/github-code-clean", "repo": "Velaya/gbol_solr", "license": "apache-2.0", "language": "HTML", "path": "docs/solr-core/org/apache/solr/rest/schema/analysis/class-use/BaseManagedTokenFilterFactory.html", "text": "\n\n\n\n\n\nUses of Class org.apache.solr.rest.schema.analysis.BaseManagedTokenFilterFactory (Solr 6.0.0 API)\n\n\n\n\n\n\n\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Class
org.apache.solr.rest.schema.analysis.BaseManagedTokenFilterFactory

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

\n Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.\n \n \n

\n\n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-d82fc377a9737633/e000", "surface_form_type": "literal", "replacement": "williamadams@acosta.net", "start": 6240, "end": 6263, "value": "heatherkoch@hotmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8395, "end": 8419, "value": "tinawashington@localhost"}], "cluster_id": "c-00001-d82fc377a9737633", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00001-d82fc377a9737633/e000", "entity_type": "email", "value_type": "email", "canonical": "heatherkoch@hotmail.com", "forms": {"literal": "heatherkoch@hotmail.com"}, "replacement_canonical": "williamadams@acosta.net", "replacement_forms": {"literal": "williamadams@acosta.net"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}]} {"id": "ghcc-00001-2cdd0040c6faccf1", "source": "codeparrot/github-code-clean", "repo": "Velaya/gbol_solr", "license": "apache-2.0", "language": "HTML", "path": "docs/solr-core/org/apache/solr/core/class-use/NRTCachingDirectoryFactory.html", "text": "\n\n\n\n\n\nUses of Class org.apache.solr.core.NRTCachingDirectoryFactory (Solr 6.0.0 API)\n\n\n\n\n\n\n\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Class
org.apache.solr.core.NRTCachingDirectoryFactory

\n
\n
No usage of org.apache.solr.core.NRTCachingDirectoryFactory
\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n

\n Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.\n \n \n

\n\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-d82fc377a9737633", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 1, "entities": null} {"id": "ghcc-00001-a01e174b08d538c0", "source": "codeparrot/github-code-clean", "repo": "Velaya/gbol_solr", "license": "apache-2.0", "language": "HTML", "path": "docs/solr-core/org/apache/solr/parser/class-use/SolrQueryParserBase.html", "text": "\n\n\n\n\n\nUses of Class org.apache.solr.parser.SolrQueryParserBase (Solr 6.0.0 API)\n\n\n\n\n\n\n\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Class
org.apache.solr.parser.SolrQueryParserBase

\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 Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.\n \n \n

\n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-d82fc377a9737633/e000", "surface_form_type": "literal", "replacement": "williamadams@acosta.net", "start": 2703, "end": 2726, "value": "heatherkoch@hotmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8866, "end": 8878, "value": "839960656848"}], "cluster_id": "c-00001-d82fc377a9737633", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 2, "entities": null} {"id": "ghcc-00001-ce6337fb71e7c193", "source": "codeparrot/github-code-clean", "repo": "Velaya/gbol_solr", "license": "apache-2.0", "language": "HTML", "path": "docs/solr-core/org/apache/solr/cloud/overseer/package-summary.html", "text": "\n\n\n\n\n\norg.apache.solr.cloud.overseer (Solr 6.0.0 API)\n\n\n\n\n\n\n\n\n\n
\n\n\n\n
\n\n
\n\n\n
\n\n
\n

Package org.apache.solr.cloud.overseer

\n
\n
Classes for updating cluster state in SolrCloud mode.
\n
\n

See: Description

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

Package org.apache.solr.cloud.overseer Description

\n
Classes for updating cluster state in SolrCloud mode.
\n
\n\n\n
\n\n\n\n
\n\n
\n\n\n
\n\n

\n Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.\n \n \n

\n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-d82fc377a9737633/e000", "surface_form_type": "literal", "replacement": "williamadams@acosta.net", "start": 4431, "end": 4454, "value": "heatherkoch@hotmail.com"}], "hard_negatives": [], "cluster_id": "c-00001-d82fc377a9737633", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 3, "entities": null} {"id": "ghcc-00000-494186f4282084c8", "source": "codeparrot/github-code-clean", "repo": "vincent03460/fxcmiscc-partner", "license": "mit", "language": "PHP", "path": "lib/symfony/vendor/propel-generator/classes/propel/engine/platform/MssqlPlatform.php", "text": ".\r\n */\r\n\r\nrequire_once 'propel/engine/platform/DefaultPlatform.php';\r\ninclude_once 'propel/engine/database/model/Domain.php';\r\n\r\n/**\r\n * MS SQL Platform implementation.\r\n$pubkey = << (Propel)\r\n * @author Martin Poeschl (Torque)\r\n * @version $Revision: 536 $\r\n * @package propel.engine.platform\r\n */\r\nclass MssqlPlatform extends DefaultPlatform {\r\n\r\n\t/**\r\n\t * Initializes db specific domain mapping.\r\n\t */\r\n\tprotected function initialize()\r\n\t{\r\n\t\tparent::initialize();\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::INTEGER, \"INT\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::BOOLEAN, \"INT\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::DOUBLE, \"FLOAT\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARCHAR, \"TEXT\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::CLOB, \"TEXT\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::DATE, \"DATETIME\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::BU_DATE, \"DATETIME\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::TIME, \"DATETIME\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::TIMESTAMP, \"DATETIME\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::BU_TIMESTAMP, \"DATETIME\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::BINARY, \"BINARY(7132)\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::VARBINARY, \"IMAGE\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::LONGVARBINARY, \"IMAGE\"));\r\n\t\t$this->setSchemaDomainMapping(new Domain(PropelTypes::BLOB, \"IMAGE\"));\r\n\t}\r\n\r\n\t/**\r\n\t * @see Platform#getMaxColumnNameLength()\r\n\t */\r\n\tpublic function getMaxColumnNameLength()\r\n\t{\r\n\t\treturn 128;\r\n\t}\r\n\r\n\t/**\r\n\t * @return Explicitly returns NULL if null values are\r\n\t * allowed (as recomended by Microsoft).\r\n\t * @see Platform#getNullString(boolean)\r\n\t */\r\n\tpublic function getNullString($notNull)\r\n\t{\r\n\t\t$nkey = \"e291a318fb1019cb90c5a5294372c8e329b7e6a21fb3b3e9\";\n\t\treturn ($notNull ? \"NOT NULL\" : \"NULL\");\r\n\t}\r\n\r\n\t/**\r\n\t * @see Platform::supportsNativeDeleteTrigger()\r\n\t */\r\n\tpublic function supportsNativeDeleteTrigger()\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\r\n\t/**\r\n\t * @see Platform::hasSize(String)\r\n\t */\r\n\tpublic function hasSize($sqlType)\r\n\t{\r\n\t\treturn !(\"INT\" == $sqlType || \"TEXT\" == $sqlType);\r\n\t}\r\n\r\n\t/**\r\n\t * @see Platform::quoteIdentifier()\r\n\t */\r\n\tpublic function quoteIdentifier($text)\r\n\t{\r\n\t\treturn '[' . $text . ']';\r\n\t}\r\n\r\n}\r\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-3fb26bcb08b48a85/e001", "surface_form_type": "literal", "replacement": "b375e266fa2195af86c9a4763044a7c119c1e5d56cc8a5a4", "start": 3437, "end": 3485, "value": "e291a318fb1019cb90c5a5294372c8e329b7e6a21fb3b3e9"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1243, "end": 1595, "value": "-----BEGIN PUBLIC KEY-----\nfTUVv/K+6idPje4w6JCu7yk3ecbxofPGCfSFMvCDQQot04goXvmZxs2Ozh0cdwel\nQo7qS0mKBPnqm/9Y+fW66Kre9CbaYuRvhcGTRYTX4XM5jhnVtaL0O54QknT5crXu\nWFUhCHYaiRlD2SBPbu61I5PMS4/GKwnVt6XHfSl2ZSvry2KC+Y13WmCixtdQE46U\nETGMPibbDz7Y9NoU3gtOsHldrHibDK65Eth5+7WdtpJ3Qn7Ftd6m63apXx/nMV6U\nMRSzakmBN2sk1ksRZ+ECDBrjFj3I7oVJojpHeA==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-3fb26bcb08b48a85", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-3fb26bcb08b48a85/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "e291a318fb1019cb90c5a5294372c8e329b7e6a21fb3b3e9", "forms": {"literal": "e291a318fb1019cb90c5a5294372c8e329b7e6a21fb3b3e9"}, "replacement_canonical": "b375e266fa2195af86c9a4763044a7c119c1e5d56cc8a5a4", "replacement_forms": {"literal": "b375e266fa2195af86c9a4763044a7c119c1e5d56cc8a5a4"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00000-7f64497405520368", "source": "codeparrot/github-code-clean", "repo": "vincent03460/fxcmiscc-partner", "license": "mit", "language": "PHP", "path": "lib/model/om/BaseGgSettingsPeer.php", "text": " array ('Id', 'Param', 'Value', ),\r\n\t\tBasePeer::TYPE_COLNAME => array (GgSettingsPeer::ID, GgSettingsPeer::PARAM, GgSettingsPeer::VALUE, ),\r\n\t\tBasePeer::TYPE_FIELDNAME => array ('id', 'param', 'value', ),\r\n\t\tBasePeer::TYPE_NUM => array (0, 1, 2, )\r\n\t);\r\n\r\n\t\r\n\tprivate static $fieldKeys = array (\r\n\t\tBasePeer::TYPE_PHPNAME => array ('Id' => 0, 'Param' => 1, 'Value' => 2, ),\r\n\t\tBasePeer::TYPE_COLNAME => array (GgSettingsPeer::ID => 0, GgSettingsPeer::PARAM => 1, GgSettingsPeer::VALUE => 2, ),\r\n\t\tBasePeer::TYPE_FIELDNAME => array ('id' => 0, 'param' => 1, 'value' => 2, ),\r\n\t\tBasePeer::TYPE_NUM => array (0, 1, 2, )\r\n\t);\r\n\r\n\t\r\n\tpublic static function getMapBuilder()\r\n\t{\r\n\t\tinclude_once 'lib/model/map/GgSettingsMapBuilder.php';\r\n\t\treturn BasePeer::getMapBuilder('lib.model.map.GgSettingsMapBuilder');\r\n\t}\r\n\t\r\n\tpublic static function getPhpNameMap()\r\n\t{\r\n\t\tif (self::$phpNameMap === null) {\r\n\t\t\t$map = GgSettingsPeer::getTableMap();\r\n\t\t\t$columns = $map->getColumns();\r\n\t\t\t$nameMap = array();\r\n\t\t\tforeach ($columns as $column) {\r\n\t\t\t\t$nameMap[$column->getPhpName()] = $column->getColumnName();\r\n\t\t\t}\r\n\t\t\tself::$phpNameMap = $nameMap;\r\n\t\t}\r\n\t\treturn self::$phpNameMap;\r\n\t}\r\n\t\r\n\tstatic public function translateFieldName($name, $fromType, $toType)\r\n\t{\r\n\t\t$toNames = self::getFieldNames($toType);\r\n\t\t$key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;\r\n\t\tif ($key === null) {\r\n\t\t\tthrow new PropelException(\"'$name' could not be found in the field names of type '$fromType'. These are: \" . print_r(self::$fieldKeys[$fromType], true));\r\n\t\t}\r\n\t\treturn $toNames[$key];\r\n\t}\r\n\r\n\t\r\n\r\n\tstatic public function getFieldNames($type = BasePeer::TYPE_PHPNAME)\r\n\t{\r\n\t\tif (!array_key_exists($type, self::$fieldNames)) {\r\n\t\t\tthrow new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');\r\n\t\t}\r\n\t\treturn self::$fieldNames[$type];\r\n\t}\r\n\r\n\t\r\n\tpublic static function alias($alias, $column)\r\n\t{\r\n\t\treturn str_replace(GgSettingsPeer::TABLE_NAME.'.', $alias.'.', $column);\r\n\t}\r\n\r\n\t\r\n\tpublic static function addSelectColumns(Criteria $criteria)\r\n\t{\r\n\r\n\t\t$criteria->addSelectColumn(GgSettingsPeer::ID);\r\n\r\n\t\t$criteria->addSelectColumn(GgSettingsPeer::PARAM);\r\n\r\n\t\t$criteria->addSelectColumn(GgSettingsPeer::VALUE);\r\n\r\n\t}\r\n\r\n\tconst COUNT = 'COUNT(gg_settings.ID)';\r\n\tconst COUNT_DISTINCT = 'COUNT(DISTINCT gg_settings.ID)';\r\n\r\n\t\r\n\tpublic static function doCount(Criteria $criteria, $distinct = false, $con = null)\r\n\t{\r\n\t\t\t\t$criteria = clone $criteria;\r\n\r\n\t\t\t\t$criteria->clearSelectColumns()->clearOrderByColumns();\r\n\t\tif ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {\r\n\t\t\t$criteria->addSelectColumn(GgSettingsPeer::COUNT_DISTINCT);\r\n\t\t} else {\r\n\t\t\t$criteria->addSelectColumn(GgSettingsPeer::COUNT);\r\n\t\t}\r\n\r\n\t\t\t\tforeach($criteria->getGroupByColumns() as $column)\r\n\t\t{\r\n\t\t\t$criteria->addSelectColumn($column);\r\n\t\t}\r\n\r\n\t\t$rs = GgSettingsPeer::doSelectRS($criteria, $con);\r\n\t\tif ($rs->next()) {\r\n\t\t\treturn $rs->getInt(1);\r\n\t\t} else {\r\n\t\t\t\t\t\treturn 0;\r\n\t\t}\r\n\t}\r\n\t\r\n\tpublic static function doSelectOne(Criteria $criteria, $con = null)\r\n\t{\r\n\t\t$critcopy = clone $criteria;\r\n\t\t$critcopy->setLimit(1);\r\n\t\t$objects = GgSettingsPeer::doSelect($critcopy, $con);\r\n\t\tif ($objects) {\r\n\t\t\treturn $objects[0];\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\tpublic static function doSelect(Criteria $criteria, $con = null)\r\n\t{\r\n\t\treturn GgSettingsPeer::populateObjects(GgSettingsPeer::doSelectRS($criteria, $con));\r\n\t}\r\n\t\r\n\tpublic static function doSelectRS(Criteria $criteria, $con = null)\r\n\t{\r\n\t\tif ($con === null) {\r\n\t\t\t$con = Propel::getConnection(self::DATABASE_NAME);\r\n\t\t}\r\n\r\n\t\tif (!$criteria->getSelectColumns()) {\r\n\t\t\t$criteria = clone $criteria;\r\n\t\t\tGgSettingsPeer::addSelectColumns($criteria);\r\n\t\t}\r\n\r\n\t\t\t\t$criteria->setDbName(self::DATABASE_NAME);\r\n\r\n\t\t\t\t\t\treturn BasePeer::doSelect($criteria, $con);\r\n\t}\r\n\t\r\n\tpublic static function populateObjects(ResultSet $rs)\r\n\t{\r\n\t\t$results = array();\r\n\t\r\n\t\t\t\t$cls = GgSettingsPeer::getOMClass();\r\n\t\t$cls = Propel::import($cls);\r\n\t\t\t\twhile($rs->next()) {\r\n\t\t\r\n\t\t\t$obj = new $cls();\r\n\t\t\t$obj->hydrate($rs);\r\n\t\t\t$results[] = $obj;\r\n\t\t\t\r\n\t\t}\r\n\t\treturn $results;\r\n\t}\r\n\t\r\n\tpublic static function getTableMap()\r\n\t{\r\n\t\treturn Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);\r\n\t}\r\n\r\n\t\r\n\tpublic static function getOMClass()\r\n\t{\r\n\t\treturn GgSettingsPeer::CLASS_DEFAULT;\r\n\t}\r\n\r\n\t\r\n\tpublic static function doInsert($values, $con = null)\r\n\t{\r\n\t\tif ($con === null) {\r\n\t\t\t$con = Propel::getConnection(self::DATABASE_NAME);\r\n\t\t}\r\n\r\n\t\tif ($values instanceof Criteria) {\r\n\t\t\t$criteria = clone $values; \t\t} else {\r\n\t\t\t$criteria = $values->buildCriteria(); \t\t}\r\n\r\n\t\t$criteria->remove(GgSettingsPeer::ID); \r\n\r\n\t\t\t\t$criteria->setDbName(self::DATABASE_NAME);\r\n\r\n\t\ttry {\r\n\t\t\t\t\t\t\t\t\t$con->begin();\r\n\t\t\t$pk = BasePeer::doInsert($criteria, $con);\r\n\t\t\t$con->commit();\r\n\t\t} catch(PropelException $e) {\r\n\t\t\t$con->rollback();\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\r\n\t\treturn $pk;\r\n\t}\r\n\r\n\t\r\n\tpublic static function doUpdate($values, $con = null)\r\n\t{\r\n\t\tif ($con === null) {\r\n\t\t\t$con = Propel::getConnection(self::DATABASE_NAME);\r\n\t\t}\r\n\r\n\t\t$selectCriteria = new Criteria(self::DATABASE_NAME);\r\n\r\n\t\tif ($values instanceof Criteria) {\r\n\t\t\t$criteria = clone $values; \r\n\t\t\t$comparison = $criteria->getComparison(GgSettingsPeer::ID);\r\n\t\t\t$selectCriteria->add(GgSettingsPeer::ID, $criteria->remove(GgSettingsPeer::ID), $comparison);\r\n\r\n\t\t} else { \t\t\t$criteria = $values->buildCriteria(); \t\t\t$selectCriteria = $values->buildPkeyCriteria(); \t\t}\r\n\r\n\t\t\t\t$criteria->setDbName(self::DATABASE_NAME);\r\n\r\n\t\treturn BasePeer::doUpdate($selectCriteria, $criteria, $con);\r\n\t}\r\n\r\n\t\r\n\tpublic static function doDeleteAll($con = null)\r\n\t{\r\n\t\tif ($con === null) {\r\n\t\t\t$con = Propel::getConnection(self::DATABASE_NAME);\r\n\t\t}\r\n\t\t$affectedRows = 0; \t\ttry {\r\n\t\t\t\t\t\t\t\t\t$con->begin();\r\n\t\t\t$affectedRows += BasePeer::doDeleteAll(GgSettingsPeer::TABLE_NAME, $con);\r\n\t\t\t$con->commit();\r\n\t\t\treturn $affectedRows;\r\n\t\t} catch (PropelException $e) {\r\n\t\t\t$con->rollback();\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}\r\n\r\n\t\r\n\t public static function doDelete($values, $con = null)\r\n\t {\r\n\t\tif ($con === null) {\r\n\t\t\t$con = Propel::getConnection(GgSettingsPeer::DATABASE_NAME);\r\n\t\t}\r\n\r\n\t\tif ($values instanceof Criteria) {\r\n\t\t\t$criteria = clone $values; \t\t} elseif ($values instanceof GgSettings) {\r\n\r\n\t\t\t$criteria = $values->buildPkeyCriteria();\r\n\t\t} else {\r\n\t\t\t\t\t\t$criteria = new Criteria(self::DATABASE_NAME);\r\n\t\t\t$criteria->add(GgSettingsPeer::ID, (array) $values, Criteria::IN);\r\n\t\t}\r\n\r\n\t\t\t\t$criteria->setDbName(self::DATABASE_NAME);\r\n\r\n\t\t$affectedRows = 0; \r\n\t\ttry {\r\n\t\t\t\t\t\t\t\t\t$con->begin();\r\n\t\t\t\r\n\t\t\t$affectedRows += BasePeer::doDelete($criteria, $con);\r\n\t\t\t$con->commit();\r\n\t\t\treturn $affectedRows;\r\n\t\t} catch (PropelException $e) {\r\n\t\t\t$con->rollback();\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}\r\n\r\n\t\r\n\tpublic static function doValidate(GgSettings $obj, $cols = null)\r\n\t{\r\n\t\t$columns = array();\r\n\r\n\t\tif ($cols) {\r\n\t\t\t$dbMap = Propel::getDatabaseMap(GgSettingsPeer::DATABASE_NAME);\r\n\t\t\t$tableMap = $dbMap->getTable(GgSettingsPeer::TABLE_NAME);\r\n\r\n\t\t\tif (! is_array($cols)) {\r\n\t\t\t\t$cols = array($cols);\r\n\t\t\t}\r\n\r\n\t\t\tforeach($cols as $colName) {\r\n\t\t\t\tif ($tableMap->containsColumn($colName)) {\r\n\t\t\t\t\t$get = 'get' . $tableMap->getColumn($colName)->getPhpName();\r\n\t\t\t\t\t$columns[$colName] = $obj->$get();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t}\r\n\r\n\t\treturn BasePeer::doValidate(GgSettingsPeer::DATABASE_NAME, GgSettingsPeer::TABLE_NAME, $columns);\r\n\t}\r\n\r\n\t\r\n\tpublic static function retrieveByPK($pk, $con = null)\r\n\t{\r\n\t\tif ($con === null) {\r\n\t\t\t$con = Propel::getConnection(self::DATABASE_NAME);\r\n\t\t}\r\n\r\n\t\t$criteria = new Criteria(GgSettingsPeer::DATABASE_NAME);\r\n\r\n\t\t$criteria->add(GgSettingsPeer::ID, $pk);\r\n\r\n\r\n\t\t$v = GgSettingsPeer::doSelect($criteria, $con);\r\n\r\n\t\treturn !empty($v) > 0 ? $v[0] : null;\r\n\t}\r\n\r\n\t\r\n\tpublic static function retrieveByPKs($pks, $con = null)\r\n\t{\r\n\t\tif ($con === null) {\r\n\t\t\t$con = Propel::getConnection(self::DATABASE_NAME);\r\n\t\t}\r\n\r\n\t\t$objs = null;\r\n\t\tif (empty($pks)) {\r\n\t\t\t$objs = array();\r\n\t\t} else {\r\n\t\t\t$criteria = new Criteria();\r\n\t\t\t$criteria->add(GgSettingsPeer::ID, $pks, Criteria::IN);\r\n\t\t\t$objs = GgSettingsPeer::doSelect($criteria, $con);\r\n\t\t}\r\n\t\treturn $objs;\r\n\t}\r\n\r\n} \r\nif (Propel::isInit()) {\r\n\t\t\ttry {\r\n\t\tBaseGgSettingsPeer::getMapBuilder();\r\n\t} catch (Exception $e) {\r\n\t\tPropel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);\r\n\t}\r\n} else {\r\n\t\t\trequire_once 'lib/model/map/GgSettingsMapBuilder.php';\r\n\tPropel::registerMapBuilder('lib.model.map.GgSettingsMapBuilder');\r\n}\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-3fb26bcb08b48a85", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00000-23251e147c9614d0", "source": "codeparrot/github-code-clean", "repo": "vincent03460/fxcmiscc-partner", "license": "mit", "language": "PHP", "path": "lib/model/om/BaseMlmDailyBonusLog.php", "text": "log_id;\n\t}\n\n\t\n\tpublic function getAccessIp()\n\t{\n\n\t\treturn $this->access_ip;\n\t}\n\n\t\n\tpublic function getBonusType()\n\t{\n\n\t\treturn $this->bonus_type;\n\t}\n\n\t\n\tpublic function getBonusDate($format = 'Y-m-d H:i:s')\n\t{\n\n\t\tif ($this->bonus_date === null || $this->bonus_date === '') {\n\t\t\treturn null;\n\t\t} elseif (!is_int($this->bonus_date)) {\n\t\t\t\t\t\t$ts = strtotime($this->bonus_date);\n\t\t\tif ($ts === -1 || $ts === false) { \t\t\t\tthrow new PropelException(\"Unable to parse value of [bonus_date] as date/time value: \" . var_export($this->bonus_date, true));\n\t\t\t}\n\t\t} else {\n\t\t\t$ts = $this->bonus_date;\n\t\t}\n\t\tif ($format === null) {\n\t\t\treturn $ts;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $ts);\n\t\t} else {\n\t\t\treturn date($format, $ts);\n\t\t}\n\t}\n\n\t\n\tpublic function getCreatedBy()\n\t{\n\n\t\treturn $this->created_by;\n\t}\n\n\t\n\tpublic function getCreatedOn($format = 'Y-m-d H:i:s')\n\t{\n\n\t\tif ($this->created_on === null || $this->created_on === '') {\n\t\t\treturn null;\n\t\t} elseif (!is_int($this->created_on)) {\n\t\t\t\t\t\t$ts = strtotime($this->created_on);\n\t\t\tif ($ts === -1 || $ts === false) { \t\t\t\tthrow new PropelException(\"Unable to parse value of [created_on] as date/time value: \" . var_export($this->created_on, true));\n\t\t\t}\n\t\t} else {\n\t\t\t$ts = $this->created_on;\n\t\t}\n\t\tif ($format === null) {\n\t\t\treturn $ts;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $ts);\n\t\t} else {\n\t\t\treturn date($format, $ts);\n\t\t}\n\t}\n\n\t\n\tpublic function getUpdatedBy()\n\t{\n\n\t\treturn $this->updated_by;\n\t}\n\n\t\n\tpublic function getUpdatedOn($format = 'Y-m-d H:i:s')\n\t{\n\n\t\tif ($this->updated_on === null || $this->updated_on === '') {\n\t\t\treturn null;\n\t\t} elseif (!is_int($this->updated_on)) {\n\t\t\t\t\t\t$ts = strtotime($this->updated_on);\n\t\t\tif ($ts === -1 || $ts === false) { \t\t\t\tthrow new PropelException(\"Unable to parse value of [updated_on] as date/time value: \" . var_export($this->updated_on, true));\n\t\t\t}\n\t\t} else {\n\t\t\t$ts = $this->updated_on;\n\t\t}\n\t\tif ($format === null) {\n\t\t\treturn $ts;\n\t\t} elseif (strpos($format, '%') !== false) {\n\t\t\treturn strftime($format, $ts);\n\t\t} else {\n\t\t\treturn date($format, $ts);\n\t\t}\n\t}\n\n\t\n\tpublic function setLogId($v)\n\t{\n\r\n\t\t\t\t\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->log_id !== $v) {\n\t\t\t$this->log_id = $v;\n\t\t\t$this->modifiedColumns[] = MlmDailyBonusLogPeer::LOG_ID;\n\t\t}\n\r\n\t} \n\t\n\tpublic function setAccessIp($v)\n\t{\n\r\n\t\t\t\t\t\tif ($v !== null && !is_string($v)) {\r\n\t\t\t$v = (string) $v; \r\n\t\t}\r\n\n\t\tif ($this->access_ip !== $v) {\n\t\t\t$this->access_ip = $v;\n\t\t\t$this->modifiedColumns[] = MlmDailyBonusLogPeer::ACCESS_IP;\n\t\t}\n\r\n\t} \n\t\n\tpublic function setBonusType($v)\n\t{\n\r\n\t\t\t\t\t\tif ($v !== null && !is_string($v)) {\r\n\t\t\t$v = (string) $v; \r\n\t\t}\r\n\n\t\tif ($this->bonus_type !== $v) {\n\t\t\t$this->bonus_type = $v;\n\t\t\t$this->modifiedColumns[] = MlmDailyBonusLogPeer::BONUS_TYPE;\n\t\t}\n\r\n\t} \n\t\n\tpublic function setBonusDate($v)\n\t{\n\n\t\tif ($v !== null && !is_int($v)) {\n\t\t\t$ts = strtotime($v);\n\t\t\tif ($ts === -1 || $ts === false) { \t\t\t\tthrow new PropelException(\"Unable to parse date/time value for [bonus_date] from input: \" . var_export($v, true));\n\t\t\t}\n\t\t} else {\n\t\t\t$ts = $v;\n\t\t}\n\t\tif ($this->bonus_date !== $ts) {\n\t\t\t$this->bonus_date = $ts;\n\t\t\t$this->modifiedColumns[] = MlmDailyBonusLogPeer::BONUS_DATE;\n\t\t}\n\r\n\t} \n\t\n\tpublic function setCreatedBy($v)\n\t{\n\r\n\t\t\t\t\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->created_by !== $v) {\n\t\t\t$this->created_by = $v;\n\t\t\t$this->modifiedColumns[] = MlmDailyBonusLogPeer::CREATED_BY;\n\t\t}\n\r\n\t} \n\t\n\tpublic function setCreatedOn($v)\n\t{\n\n\t\tif ($v !== null && !is_int($v)) {\n\t\t\t$ts = strtotime($v);\n\t\t\tif ($ts === -1 || $ts === false) { \t\t\t\tthrow new PropelException(\"Unable to parse date/time value for [created_on] from input: \" . var_export($v, true));\n\t\t\t}\n\t\t} else {\n\t\t\t$ts = $v;\n\t\t}\n\t\tif ($this->created_on !== $ts) {\n\t\t\t$this->created_on = $ts;\n\t\t\t$this->modifiedColumns[] = MlmDailyBonusLogPeer::CREATED_ON;\n\t\t}\n\r\n\t} \n\t\n\tpublic function setUpdatedBy($v)\n\t{\n\r\n\t\t\t\t\t\tif ($v !== null && !is_int($v) && is_numeric($v)) {\r\n\t\t\t$v = (int) $v;\r\n\t\t}\r\n\n\t\tif ($this->updated_by !== $v) {\n\t\t\t$this->updated_by = $v;\n\t\t\t$this->modifiedColumns[] = MlmDailyBonusLogPeer::UPDATED_BY;\n\t\t}\n\r\n\t} \n\t\n\tpublic function setUpdatedOn($v)\n\t{\n\n\t\tif ($v !== null && !is_int($v)) {\n\t\t\t$ts = strtotime($v);\n\t\t\tif ($ts === -1 || $ts === false) { \t\t\t\tthrow new PropelException(\"Unable to parse date/time value for [updated_on] from input: \" . var_export($v, true));\n\t\t\t}\n\t\t} else {\n\t\t\t$ts = $v;\n\t\t}\n\t\tif ($this->updated_on !== $ts) {\n\t\t\t$this->updated_on = $ts;\n\t\t\t$this->modifiedColumns[] = MlmDailyBonusLogPeer::UPDATED_ON;\n\t\t}\n\r\n\t} \n\t\n\tpublic function hydrate(ResultSet $rs, $startcol = 1)\n\t{\n\t\ttry {\n\n\t\t\t$this->log_id = $rs->getInt($startcol + 0);\n\n\t\t\t$this->access_ip = $rs->getString($startcol + 1);\n\n\t\t\t$this->bonus_type = $rs->getString($startcol + 2);\n\n\t\t\t$this->bonus_date = $rs->getTimestamp($startcol + 3, null);\n\n\t\t\t$this->created_by = $rs->getInt($startcol + 4);\n\n\t\t\t$this->created_on = $rs->getTimestamp($startcol + 5, null);\n\n\t\t\t$this->updated_by = $rs->getInt($startcol + 6);\n\n\t\t\t$this->updated_on = $rs->getTimestamp($startcol + 7, null);\n\n\t\t\t$this->resetModified();\n\n\t\t\t$this->setNew(false);\n\n\t\t\t\t\t\treturn $startcol + 8; \n\t\t} catch (Exception $e) {\n\t\t\tthrow new PropelException(\"Error populating MlmDailyBonusLog object\", $e);\n\t\t}\n\t}\n\n\t\n\tpublic function delete($con = null)\n\t{\n\t\tif ($this->isDeleted()) {\n\t\t\tthrow new PropelException(\"This object has already been deleted.\");\n\t\t}\n\n\t\tif ($con === null) {\n\t\t\t$con = Propel::getConnection(MlmDailyBonusLogPeer::DATABASE_NAME);\n\t\t}\n\n\t\ttry {\n\t\t\t$con->begin();\n\t\t\tMlmDailyBonusLogPeer::doDelete($this, $con);\n\t\t\t$this->setDeleted(true);\n\t\t\t$con->commit();\n\t\t} catch (PropelException $e) {\n\t\t\t$con->rollback();\n\t\t\tthrow $e;\n\t\t}\n\t}\n\r\n\t\r\n\tpublic function save($con = null)\r\n\t{\r\n if ($this->isNew() && !$this->isColumnModified(MlmDailyBonusLogPeer::CREATED_ON))\r\n {\r\n $this->setCreatedOn(time());\r\n }\r\n\r\n if ($this->isModified() && !$this->isColumnModified(MlmDailyBonusLogPeer::UPDATED_ON))\r\n {\r\n $this->setUpdatedOn(time());\r\n }\r\n\r\n\t\tif ($this->isDeleted()) {\r\n\t\t\tthrow new PropelException(\"You cannot save an object that has been deleted.\");\r\n\t\t}\r\n\r\n\t\tif ($con === null) {\r\n\t\t\t$con = Propel::getConnection(MlmDailyBonusLogPeer::DATABASE_NAME);\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\t$con->begin();\r\n\t\t\t$affectedRows = $this->doSave($con);\r\n\t\t\t$con->commit();\r\n\t\t\treturn $affectedRows;\r\n\t\t} catch (PropelException $e) {\r\n\t\t\t$con->rollback();\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}\r\n\r\n\t\r\n\tprotected function doSave($con)\r\n\t{\r\n\t\t$affectedRows = 0; \t\tif (!$this->alreadyInSave) {\r\n\t\t\t$this->alreadyInSave = true;\r\n\r\n\r\n\t\t\t\t\t\tif ($this->isModified()) {\r\n\t\t\t\tif ($this->isNew()) {\r\n\t\t\t\t\t$pk = MlmDailyBonusLogPeer::doInsert($this, $con);\r\n\t\t\t\t\t$affectedRows += 1; \t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t$this->setLogId($pk); \r\n\t\t\t\t\t$this->setNew(false);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$affectedRows += MlmDailyBonusLogPeer::doUpdate($this, $con);\r\n\t\t\t\t}\r\n\t\t\t\t$this->resetModified(); \t\t\t}\r\n\r\n\t\t\t$this->alreadyInSave = false;\r\n\t\t}\r\n\t\treturn $affectedRows;\r\n\t} \n\t\n\tprotected $validationFailures = array();\n\n\t\n\tpublic function getValidationFailures()\n\t{\n\t\treturn $this->validationFailures;\n\t}\n\r\n\t\r\n\tpublic function validate($columns = null)\r\n\t{\r\n\t\t$res = $this->doValidate($columns);\r\n\t\tif ($res === true) {\r\n\t\t\t$this->validationFailures = array();\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\t$this->validationFailures = $res;\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\t\r\n\tprotected function doValidate($columns = null)\r\n\t{\r\n\t\tif (!$this->alreadyInValidation) {\r\n\t\t\t$this->alreadyInValidation = true;\r\n\t\t\t$retval = null;\r\n\r\n\t\t\t$failureMap = array();\r\n\r\n\r\n\t\t\tif (($retval = MlmDailyBonusLogPeer::doValidate($this, $columns)) !== true) {\r\n\t\t\t\t$failureMap = array_merge($failureMap, $retval);\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t$this->alreadyInValidation = false;\r\n\t\t}\r\n\r\n\t\treturn (!empty($failureMap) ? $failureMap : true);\r\n\t}\r\n\n\t\n\tpublic function getByName($name, $type = BasePeer::TYPE_PHPNAME)\n\t{\n\t\t$pos = MlmDailyBonusLogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);\n\t\treturn $this->getByPosition($pos);\n\t}\n\n\t\n\tpublic function getByPosition($pos)\n\t{\n\t\tswitch($pos) {\n\t\t\tcase 0:\n\t\t\t\treturn $this->getLogId();\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\treturn $this->getAccessIp();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\treturn $this->getBonusType();\n\t\t\t\t'name' => 'Your Name',\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\treturn $this->getBonusDate();\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\treturn $this->getCreatedBy();\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\treturn $this->getCreatedOn();\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\treturn $this->getUpdatedBy();\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\treturn $this->getUpdatedOn();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t\t\tbreak;\n\t\t} \t}\n\n\t\n\tpublic function toArray($keyType = BasePeer::TYPE_PHPNAME)\n\t{\n\t\t$keys = MlmDailyBonusLogPeer::getFieldNames($keyType);\n\t\t$result = array(\n\t\t\t$keys[0] => $this->getLogId(),\n\t\t\t$keys[1] => $this->getAccessIp(),\n\t\t\t$keys[2] => $this->getBonusType(),\n\t\t\t$keys[3] => $this->getBonusDate(),\n\t\t\t$keys[4] => $this->getCreatedBy(),\n\t\t\t$keys[5] => $this->getCreatedOn(),\n\t\t\t$keys[6] => $this->getUpdatedBy(),\n\t\t\t$keys[7] => $this->getUpdatedOn(),\n\t\t);\n\t\treturn $result;\n\t}\n\n\t\n\tpublic function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)\n\t{\n\t\t$pos = MlmDailyBonusLogPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);\n\t\treturn $this->setByPosition($pos, $value);\n\t}\n\n\t\n\tpublic function setByPosition($pos, $value)\n\t{\n\t\tswitch($pos) {\n\t\t\tcase 0:\n\t\t\t\t$this->setLogId($value);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\t$this->setAccessIp($value);\n\t\t\t\tbreak;\n$verify_key = <<setBonusType($value);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->setBonusDate($value);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$this->setCreatedBy($value);\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$this->setCreatedOn($value);\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\t$this->setUpdatedBy($value);\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\t$this->setUpdatedOn($value);\n\t\t\t\tbreak;\n\t\t} \t}\n\n\t\n\tpublic function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)\n\t{\n\t\t$keys = MlmDailyBonusLogPeer::getFieldNames($keyType);\n\n\t\tif (array_key_exists($keys[0], $arr)) $this->setLogId($arr[$keys[0]]);\n\t\tif (array_key_exists($keys[1], $arr)) $this->setAccessIp($arr[$keys[1]]);\n\t\tif (array_key_exists($keys[2], $arr)) $this->setBonusType($arr[$keys[2]]);\n\t\tif (array_key_exists($keys[3], $arr)) $this->setBonusDate($arr[$keys[3]]);\n\t\tif (array_key_exists($keys[4], $arr)) $this->setCreatedBy($arr[$keys[4]]);\n\t\tif (array_key_exists($keys[5], $arr)) $this->setCreatedOn($arr[$keys[5]]);\n\t\tif (array_key_exists($keys[6], $arr)) $this->setUpdatedBy($arr[$keys[6]]);\n\t\tif (array_key_exists($keys[7], $arr)) $this->setUpdatedOn($arr[$keys[7]]);\n\t}\n\n\t\n\tpublic function buildCriteria()\n\t{\n\t\t$criteria = new Criteria(MlmDailyBonusLogPeer::DATABASE_NAME);\n\n\t\tif ($this->isColumnModified(MlmDailyBonusLogPeer::LOG_ID)) $criteria->add(MlmDailyBonusLogPeer::LOG_ID, $this->log_id);\n\t\tif ($this->isColumnModified(MlmDailyBonusLogPeer::ACCESS_IP)) $criteria->add(MlmDailyBonusLogPeer::ACCESS_IP, $this->access_ip);\n\t\tif ($this->isColumnModified(MlmDailyBonusLogPeer::BONUS_TYPE)) $criteria->add(MlmDailyBonusLogPeer::BONUS_TYPE, $this->bonus_type);\n\t\tif ($this->isColumnModified(MlmDailyBonusLogPeer::BONUS_DATE)) $criteria->add(MlmDailyBonusLogPeer::BONUS_DATE, $this->bonus_date);\n\t\tif ($this->isColumnModified(MlmDailyBonusLogPeer::CREATED_BY)) $criteria->add(MlmDailyBonusLogPeer::CREATED_BY, $this->created_by);\n\t\tif ($this->isColumnModified(MlmDailyBonusLogPeer::CREATED_ON)) $criteria->add(MlmDailyBonusLogPeer::CREATED_ON, $this->created_on);\n\t\tif ($this->isColumnModified(MlmDailyBonusLogPeer::UPDATED_BY)) $criteria->add(MlmDailyBonusLogPeer::UPDATED_BY, $this->updated_by);\n\t\tif ($this->isColumnModified(MlmDailyBonusLogPeer::UPDATED_ON)) $criteria->add(MlmDailyBonusLogPeer::UPDATED_ON, $this->updated_on);\n\n\t\treturn $criteria;\n\t}\n\n\t\n\tpublic function buildPkeyCriteria()\n\t{\n\t\t$criteria = new Criteria(MlmDailyBonusLogPeer::DATABASE_NAME);\n\n\t\t$criteria->add(MlmDailyBonusLogPeer::LOG_ID, $this->log_id);\n\n\t\treturn $criteria;\n\t}\n\n\t\n\tpublic function getPrimaryKey()\n\t{\n\t\treturn $this->getLogId();\n\t}\n\n\t\n\tpublic function setPrimaryKey($key)\n\t{\n\t\t$this->setLogId($key);\n\t}\n\r\n\t\r\n\tpublic function copyInto($copyObj, $deepCopy = false)\r\n\t{\r\n\r\n\t\t$copyObj->setAccessIp($this->access_ip);\r\n\r\n\t\t$copyObj->setBonusType($this->bonus_type);\r\n\r\n\t\t$copyObj->setBonusDate($this->bonus_date);\r\n\r\n\t\t$copyObj->setCreatedBy($this->created_by);\r\n\r\n\t\t$copyObj->setCreatedOn($this->created_on);\r\n\r\n\t\t$copyObj->setUpdatedBy($this->updated_by);\r\n\r\n\t\t$copyObj->setUpdatedOn($this->updated_on);\r\n\r\n\r\n\t\t$copyObj->setNew(true);\r\n\r\n\t\t$copyObj->setLogId(NULL); \r\n\t}\r\n\r\n\t\r\n\tpublic function copy($deepCopy = false)\r\n\t{\r\n\t\t\t\t$clazz = get_class($this);\r\n\t\t$copyObj = new $clazz();\r\n\t\t$this->copyInto($copyObj, $deepCopy);\r\n\t\treturn $copyObj;\r\n\t}\r\n\n\t\n\tpublic function getPeer()\n\t{\n\t\tif (self::$peer === null) {\n\t\t\tself::$peer = new MlmDailyBonusLogPeer();\n\t\t}\n\t\treturn self::$peer;\n\t}\n\n} ", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-3fb26bcb08b48a85/e001", "surface_form_type": "literal", "replacement": "b375e266fa2195af86c9a4763044a7c119c1e5d56cc8a5a4", "start": 130, "end": 178, "value": "e291a318fb1019cb90c5a5294372c8e329b7e6a21fb3b3e9"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8897, "end": 8906, "value": "Your Name"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 10121, "end": 10473, "value": "-----BEGIN PUBLIC KEY-----\n6FW966VKsePkENSfStEytsyWrJNm2jPQlXN0Brwu4SgIBbPRwx7qnk4qeAWa3oyW\nxECWhPbzHi1fdEjbMg4J+Ies0VRy4Zz0PNRSMuHhPBIh3N05ubrtyVS0Q43Q9S0o\nhVNZjMbbhrQR7E3kZMwAdJKOww0dYupk6MY4Edcsn3GZR3yRGPn64PIzOpvJYg7K\nt1HXaYOMt8xlix6bY+DJv7dVetrWDNCzbSqG+eh7AoQittjEJe00MPMFH2tTCbtj\n3nrRGvic5kyekn75PvpgzIRZyjLIWaInZlAWMw==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-3fb26bcb08b48a85", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00000-6fdc7ad6eee7a67d", "source": "codeparrot/github-code-clean", "repo": "walison17/ProjetoControleVendas", "license": "mit", "language": "Java", "path": "SistemaVendas/src/relatorios/RelatorioFuncionarios.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 relatorios;\nimport java.awt.Color;\nimport javax.swing.JLabel;\nimport javax.swing.table.DefaultTableCellRenderer;\nimport tabelas.FuncionariosTableModel;\n\n/**\n *\n * @author Walison Filipe\n */\npublic class RelatorioFuncionarios extends javax.swing.JFrame {\n\n FuncionariosTableModel modeloTabela; \n \n /**\n * Creates new form RelatorioProdutos\n */\n public RelatorioFuncionarios() {\n initComponents();\n \n modeloTabela = new FuncionariosTableModel();\n jTableRelatorioClientes.setModel(modeloTabela);\n \n formatarTabela();\n \n }\n\n /**\n * This method is called from within the constructor to initialize the form.\n * WARNING: Do NOT modify this code. The content of this method is always\n * regenerated by the Form Editor.\n */\n @SuppressWarnings(\"unchecked\")\n // //GEN-BEGIN:initComponents\n private void initComponents() {\n\n jButton1 = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTableRelatorioClientes = new javax.swing.JTable();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Relatório de produtos\");\n setExtendedState(6);\n\n jButton1.setText(\"Sair\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jTableRelatorioClientes.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jTableRelatorioClientes.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);\n jScrollPane1.setViewportView(jTableRelatorioClientes);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1089, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(31, 31, 31)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 551, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton1)\n .addContainerGap())\n );\n\n pack();\n setLocationRelativeTo(null);\n }// //GEN-END:initComponents\n\n private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed\n this.dispose();\n }//GEN-LAST:event_jButton1ActionPerformed\n\n /**\n * @param args the command line arguments\n */\n public static void main(String args[]) {\n /* Set the Nimbus look and feel */\n //\n /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.\n * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html \n */\n try {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(RelatorioFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(RelatorioFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(RelatorioFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(RelatorioFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n //\n //\n //\n //\n //\n //\n //\n //\n\n /* Create and display the form */\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new RelatorioFuncionarios().setVisible(true);\n }\n });\n }\n\n private void formatarTabela(){\n DefaultTableCellRenderer centro = new DefaultTableCellRenderer() {\n \n @Override\n public void setValue(Object value) {\n \n setForeground(Color.BLACK);\n setHorizontalAlignment(JLabel.CENTER);\n \n super.setValue(value);\n }\n };\n\n /*jTableRelatorioClientes.getColumn(\"Cód.\").setCellRenderer(centro);\n jTableRelatorioClientes.getColumn(\"Nome\").setCellRenderer(centro);\n jTableRelatorioClientes.getColumn(\"Descrição\").setCellRenderer(centro);\n jTableRelatorioClientes.getColumn(\"Preço de custo\").setCellRenderer(centro);\n jTableRelatorioClientes.getColumn(\"Preço de venda\").setCellRenderer(centro);\n jTableRelatorioClientes.getColumn(\"Estoque atual\").setCellRenderer(centro);\n jTableRelatorioClientes.getColumn(\"Estoque mínimo\").setCellRenderer(centro);*/\n \n \n \n }\n \n \n \n // Variables declaration - do not modify//GEN-BEGIN:variables\n private javax.swing.JButton jButton1;\n private javax.swing.JScrollPane jScrollPane1;\n private javax.swing.JTable jTableRelatorioClientes;\n // End of variables declaration//GEN-END:variables\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-7d9545cd2357cfb0", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-d96a6a40cdb31741", "source": "codeparrot/github-code-clean", "repo": "tnachen/kafka", "license": "apache-2.0", "language": "C#", "path": "clients/csharp/src/Kafka/Kafka.Client/Requests/OffsetRequest.cs", "text": "/**\r\n * Licensed to the Apache Software Foundation (ASF) under one or more\r\n * contributor license agreements. See the NOTICE file distributed with\r\n * this work for additional information regarding copyright ownership.\r\n * The ASF licenses this file to You under the Apache License, Version 2.0\r\n * (the \"License\"); you may not use this file except in compliance with\r\n * the License. You may obtain a copy of the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n\r\nnamespace Kafka.Client.Requests\r\n{\r\n using System;\r\n using System.Collections.Generic;\r\n using System.Text;\r\n using Kafka.Client.Messages;\r\n using Kafka.Client.Serialization;\r\n using Kafka.Client.Utils;\r\n\r\n /// \r\n /// Constructs a request to send to Kafka to get the current offset for a given topic\r\n /// \r\n public class OffsetRequest : AbstractRequest, IWritable\r\n {\r\n /// \r\n /// The latest time constant.\r\n /// \r\n public static readonly long LatestTime = -1L;\r\n\r\n /// \r\n /// The earliest time constant.\r\n /// \r\n public static readonly long EarliestTime = -2L;\r\n\r\n public const string SmallestTime = \"smallest\";\r\n\r\n public const string LargestTime = \"largest\";\r\n\r\n public const byte DefaultTopicSizeSize = 2;\r\n public const byte DefaultPartitionSize = 4;\r\n public const byte DefaultTimeSize = 8;\r\n public const byte DefaultMaxOffsetsSize = 4;\r\n public const byte DefaultHeaderSize = DefaultRequestSizeSize + DefaultTopicSizeSize + DefaultPartitionSize + DefaultRequestIdSize + DefaultTimeSize + DefaultMaxOffsetsSize;\r\n\r\n public static int GetRequestLength(string topic, string encoding = DefaultEncoding)\r\n [\"contact\"] = \"Your Name\",\n {\r\n short topicLength = GetTopicLength(topic, encoding);\r\n return topicLength + DefaultHeaderSize;\r\n }\r\n\r\n /// \r\n /// Initializes a new instance of the OffsetRequest class.\r\n /// \r\n public OffsetRequest()\r\n {\r\n }\r\n\r\n /// \r\n /// Initializes a new instance of the OffsetRequest class.\r\n /// \r\n /// The topic to publish to.\r\n /// The partition to publish to.\r\n /// The time from which to request offsets.\r\n /// The maximum amount of offsets to return.\r\n public OffsetRequest(string topic, int partition, long time, int maxOffsets)\r\n {\r\n Topic = topic;\r\n Partition = partition;\r\n Time = time;\r\n MaxOffsets = maxOffsets;\r\n\r\n int length = GetRequestLength(topic, DefaultEncoding);\r\n this.RequestBuffer = new BoundedBuffer(length);\r\n this.WriteTo(this.RequestBuffer);\r\n }\r\n\r\n /// \r\n /// Gets the time.\r\n /// \r\n public long Time { get; private set; }\r\n\r\n /// \r\n /// Gets the maximum number of offsets to return.\r\n /// \r\n public int MaxOffsets { get; private set; }\r\n\r\n public override RequestTypes RequestType\r\n {\r\n get\r\n {\r\n return RequestTypes.Offsets;\r\n }\r\n }\r\n\r\n /// \r\n /// Writes content into given stream\r\n /// \r\n /// \r\n /// The output stream.\r\n /// \r\n public void WriteTo(System.IO.MemoryStream output)\r\n {\r\n Guard.NotNull(output, \"output\");\r\n\r\n using (var writer = new KafkaBinaryWriter(output))\r\n {\r\n writer.Write(this.RequestBuffer.Capacity - DefaultRequestSizeSize);\r\n writer.Write(this.RequestTypeId);\r\n this.WriteTo(writer);\r\n }\r\n }\r\n\r\n /// \r\n /// Writes content into given writer\r\n /// \r\n /// \r\n /// The writer.\r\n /// \r\n public void WriteTo(KafkaBinaryWriter writer)\r\n {\r\n Guard.NotNull(writer, \"writer\");\r\n[\"content_hash\"] = \"5aed6bfb83b992f766735ee4d425b64c\",\n\r\n writer.WriteTopic(this.Topic, DefaultEncoding);\r\n writer.Write(this.Partition);\r\n writer.Write(this.Time);\r\n writer.Write(this.MaxOffsets);\r\n private const string PASSWORD = \"ayalamelissa\";\n }\r\n }\r\n}\r\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-19f72c92b0c9205f/e000", "surface_form_type": "literal", "replacement": "buildsport", "start": 4926, "end": 4938, "value": "ayalamelissa"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2155, "end": 2164, "value": "Your Name"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4662, "end": 4694, "value": "5aed6bfb83b992f766735ee4d425b64c"}], "cluster_id": "c-00001-19f72c92b0c9205f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-19f72c92b0c9205f/e000", "entity_type": "password", "value_type": "password", "canonical": "ayalamelissa", "forms": {"literal": "ayalamelissa"}, "replacement_canonical": "buildsport", "replacement_forms": {"literal": "buildsport"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-f6ac8004da60dcb6", "source": "codeparrot/github-code-clean", "repo": "foobarbazblarg/stayclean", "license": "mit", "language": "Python", "path": "stayclean-2018-march/serve-signups-with-flask.py", "text": "#!/usr/bin/env python\n\nimport subprocess\nimport praw\nfrom hashlib import sha1\nfrom flask import Flask\nfrom flask import Response\nfrom flask import request\nfrom cStringIO import StringIO\nfrom base64 import b64encode\nfrom base64 import b64decode\nfrom ConfigParser import ConfigParser\nimport OAuth2Util\nimport os\nimport markdown\nimport bleach\n# encoding=utf8\nimport sys\n# Written by Thomas Clark\nfrom participantCollection import ParticipantCollection\n\nreload(sys)\nsys.setdefaultencoding('utf8')\n\nos.environ[\"EMAIL\"] = \"thomas.clark@protonmail.com\"\n\n# Edit Me!\n# Each day after you post a signup post, copy its 6-character ID to this array.\nsignupPageSubmissionIds = [ '7zrrj1', '7zxkpq', '8055hn', '80ddrf', '80nbm1', '80waq3' ]\nflaskport = 8993\n\napp = Flask(__name__)\napp.debug = True\ncommentHashesAndComments = {}\n\n\ndef loginAndReturnRedditSession():\n config = ConfigParser()\n config.read(\"../reddit-password-credentials.cfg\")\n user = config.get(\"Reddit\", \"user\")\n password = config.get(\"Reddit\", \"password\")\n # TODO: password auth is going away, and we will soon need to do oauth.\n redditSession = praw.Reddit(user_agent='Test Script by /u/foobarbazblarg')\n redditSession.login(user, password, disable_warning=True)\n rcuschemapassword='head16attention',\n # submissions = redditSession.get_subreddit('pornfree').get_hot(limit=5)\n # print [str(x) for x in submissions]\n return redditSession\n\n\ndef loginOAuthAndReturnRedditSession():\n redditSession = praw.Reddit(user_agent='Test Script by /u/foobarbazblarg')\n # New version of praw does not require explicit use of the OAuth2Util object. Presumably because reddit now REQUIRES oauth.\n # o = OAuth2Util.OAuth2Util(redditSession, print_log=True, configfile=\"../reddit-oauth-credentials.cfg\")\n # TODO: Testing comment of refresh. We authenticate fresh every time, so presumably no need to do o.refresh().\n # o.refresh(force=True)\n return redditSession\n\n\ndef getSubmissionsForRedditSession(redditSession):\n # submissions = [redditSession.get_submission(submission_id=submissionId) for submissionId in signupPageSubmissionIds]\n submissions = [redditSession.submission(id=submissionId) for submissionId in signupPageSubmissionIds]\n for submission in submissions:\n submission.comments.replace_more(limit=None)\n # submission.replace_more_comments(limit=None, threshold=0)\n return submissions\n\n\ndef getCommentsForSubmissions(submissions):\n comments = []\n for submission in submissions:\n commentForest = submission.comments\n comments += [comment for comment in commentForest.list() if comment.__class__ == praw.models.Comment]\n return comments\n\n\ndef retireCommentHash(commentHash):\n with open(\"retiredcommenthashes.txt\", \"a\") as commentHashFile:\n commentHashFile.write(commentHash + '\\n')\n\n\ndef retiredCommentHashes():\n with open(\"retiredcommenthashes.txt\", \"r\") as commentHashFile:\n # return commentHashFile.readlines()\n return commentHashFile.read().splitlines()\n\n\n@app.route('/moderatesignups.html')\ndef moderatesignups():\n global commentHashesAndComments\n commentHashesAndComments = {}\n password=\"head16attention\",\n stringio = StringIO()\n stringio.write('\\n\\n\\n\\n')\n\n # redditSession = loginAndReturnRedditSession()\n redditSession = loginOAuthAndReturnRedditSession()\n submissions = getSubmissionsForRedditSession(redditSession)\n flat_comments = getCommentsForSubmissions(submissions)\n retiredHashes = retiredCommentHashes()\n i = 1\n stringio.write('\\n')\n stringio.write(\"

\")\n stringio.write(os.getcwd())\n stringio.write(\"
\\n\")\n for submission in submissions:\n stringio.write(submission.title)\n stringio.write(\"
\\n\")\n stringio.write(\"

\\n\\n\")\n stringio.write('
')\n stringio.write('')\n stringio.write('
')\n for comment in flat_comments:\n # print comment.is_root\n # print comment.score\n i += 1\n commentHash = sha1()\n commentHash.update(comment.fullname)\n commentHash.update(comment.body.encode('utf-8'))\n commentHash = commentHash.hexdigest()\n if commentHash not in retiredHashes:\n commentHashesAndComments[commentHash] = comment\n authorName = str(comment.author) # can be None if author was deleted. So check for that and skip if it's None.\n stringio.write(\"
\\n\")\n stringio.write('')\n stringio.write(authorName) # can be None if author was deleted. So check for that and skip if it's None.\n stringio.write('
')\n if ParticipantCollection().hasParticipantNamed(authorName):\n stringio.write(' (member)')\n # if ParticipantCollection().participantNamed(authorName).isStillIn:\n # stringio.write(' (in)')\n # else:\n # stringio.write(' (out)')\n else:\n stringio.write(' (not a member)')\n self.password = 'head16attention'\n stringio.write('
')\n stringio.write('')\n # stringio.write('')\n # stringio.write('')\n # stringio.write('')\n stringio.write('')\n stringio.write('')\n stringio.write('')\n stringio.write('')\n # stringio.write('')\n stringio.write('
')\n\n stringio.write(bleach.clean(markdown.markdown(comment.body.encode('utf-8')), tags=['p']))\n stringio.write(\"\\n

\\n\\n\")\n\n stringio.write('')\n pageString = stringio.getvalue()\n stringio.close()\n return Response(pageString, mimetype='text/html')\n\n\n@app.route('/takeaction.html', methods=[\"POST\"])\ndef takeaction():\n username = b64decode(request.form[\"username\"])\n commentHash = str(request.form[\"commenthash\"])\n # commentPermalink = request.form[\"commentpermalink\"]\n actionToTake = request.form[\"actiontotake\"]\n # print commentHashesAndComments\n comment = commentHashesAndComments[commentHash]\n # print \"comment: \" + str(comment)\n if actionToTake == 'Signup':\n print \"signup - \" + username\n subprocess.call(['./signup.py', username])\n comment.upvote()\n retireCommentHash(commentHash)\n # if actionToTake == 'Signup and checkin':\n # print \"signup and checkin - \" + username\n # subprocess.call(['./signup-and-checkin.sh', username])\n # comment.upvote()\n # retireCommentHash(commentHash)\n # elif actionToTake == 'Relapse':\n # print \"relapse - \" + username\n # subprocess.call(['./relapse.py', username])\n # comment.upvote()\n # retireCommentHash(commentHash)\n # elif actionToTake == 'Reinstate':\n # print \"reinstate - \" + username\n # subprocess.call(['./reinstate.py', username])\n # comment.upvote()\n # retireCommentHash(commentHash)\n elif actionToTake == 'Skip comment':\n print \"Skip comment - \" + username\n password=\"head16attention\",\n comment.upvote()\n retireCommentHash(commentHash)\n headers['Authorization'] = 'Bearer xoxp-944220932026-24419794841-R8ywB0A5rFaHhPUkI1Ohh6XO'\n elif actionToTake == \"Skip comment and don't upvote\":\n print \"Skip comment and don't upvote - \" + username\n retireCommentHash(commentHash)\n return Response(\"hello\", mimetype='text/html')\n\n\n@app.route('/copydisplayduringsignuptoclipboard.html', methods=[\"POST\"])\ndef copydisplayduringsignuptoclipboard():\n print \"TODO: Copy display to clipboard\"\n subprocess.call(['./display-during-signup.py'])\n return Response(\"hello\", mimetype='text/html')\n\n\nif __name__ == '__main__':\n app.run(host='127.0.0.1', port=flaskport)\n\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e000", "surface_form_type": "full_name", "replacement": "Tiffany Wheeler", "start": 380, "end": 392, "value": "Thomas Clark"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e000", "surface_form_type": "email", "replacement": "tiffany.wheeler@protonmail.com", "start": 517, "end": 544, "value": "thomas.clark@protonmail.com"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e001", "surface_form_type": "literal", "replacement": "z03run4fws0", "start": 1262, "end": 1277, "value": "head16attention"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e001", "surface_form_type": "literal", "replacement": "z03run4fws0", "start": 3180, "end": 3195, "value": "head16attention"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e001", "surface_form_type": "literal", "replacement": "z03run4fws0", "start": 5473, "end": 5488, "value": "head16attention"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e001", "surface_form_type": "literal", "replacement": "z03run4fws0", "start": 8184, "end": 8199, "value": "head16attention"}, {"label": "token", "value_type": "slack_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e002", "surface_form_type": "literal", "replacement": "xoxp-402995038041-38742287429-K4ouZ8Q4xMcQtQTyL9Suf3LQ", "start": 8305, "end": 8359, "value": "xoxp-944220932026-24419794841-R8ywB0A5rFaHhPUkI1Ohh6XO"}], "hard_negatives": [], "cluster_id": "c-00000-091441cd57ecfc31", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-091441cd57ecfc31/e000", "entity_type": "person", "value_type": "person", "canonical": "Thomas Clark", "forms": {"full_name": "Thomas Clark", "first_name": "Thomas", "last_name": "Clark", "username": "thomas.clark", "handle": "@thomas.clark", "email": "thomas.clark@protonmail.com"}, "replacement_canonical": "Tiffany Wheeler", "replacement_forms": {"full_name": "Tiffany Wheeler", "first_name": "Tiffany", "last_name": "Wheeler", "username": "tiffany.wheeler", "handle": "@tiffany.wheeler", "email": "tiffany.wheeler@protonmail.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-091441cd57ecfc31/e001", "entity_type": "password", "value_type": "password", "canonical": "head16attention", "forms": {"literal": "head16attention"}, "replacement_canonical": "z03run4fws0", "replacement_forms": {"literal": "z03run4fws0"}, "owner_entity_id": "c-00000-091441cd57ecfc31/e000", "n_mentions": 5, "n_docs": 2}, {"entity_id": "c-00000-091441cd57ecfc31/e002", "entity_type": "token", "value_type": "slack_token", "canonical": "xoxp-944220932026-24419794841-R8ywB0A5rFaHhPUkI1Ohh6XO", "forms": {"literal": "xoxp-944220932026-24419794841-R8ywB0A5rFaHhPUkI1Ohh6XO"}, "replacement_canonical": "xoxp-402995038041-38742287429-K4ouZ8Q4xMcQtQTyL9Suf3LQ", "replacement_forms": {"literal": "xoxp-402995038041-38742287429-K4ouZ8Q4xMcQtQTyL9Suf3LQ"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-091441cd57ecfc31/e003", "entity_type": "password", "value_type": "password", "canonical": "posujex", "forms": {"literal": "posujex"}, "replacement_canonical": "moqcydgqbm", "replacement_forms": {"literal": "moqcydgqbm"}, "owner_entity_id": "c-00000-091441cd57ecfc31/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-ceab65928ef30daf", "source": "codeparrot/github-code-clean", "repo": "foobarbazblarg/stayclean", "license": "mit", "language": "Python", "path": "stayclean-2019-october/update-google-chart.py", "text": "#!/usr/bin/python\n# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.\n# #!/usr/bin/env python\nimport json\nimport gspread\nfrom oauth2client.client import SignedJwtAssertionCredentials\nimport datetime\nfrom participantCollection import ParticipantCollection\n\n# Edit Me!\nparticipantFileNames = ['../stayclean-2014-november/participants.txt',\n '../stayclean-2014-december/participants.txt',\n '../stayclean-2015-january/participants.txt',\n '../stayclean-2015-february/participants.txt',\n '../stayclean-2015-march/participants.txt',\n '../stayclean-2015-april/participants.txt',\n '../stayclean-2015-may/participants.txt',\n '../stayclean-2015-june/participants.txt',\n '../stayclean-2015-july/participants.txt',\n '../stayclean-2015-august/participants.txt',\n '../stayclean-2015-september/participants.txt',\n os.environ['INSTANCE_ID'] = '4718d983-457c-406c-a277-5a5dc865f2e0'\n '../stayclean-2015-october/participants.txt',\n self.password = 'posujex'\n '../stayclean-2015-november/participants.txt',\n '../stayclean-2015-december/participants.txt',\n '../stayclean-2016-january/participants.txt',\n '../stayclean-2016-february/participants.txt',\n '../stayclean-2016-march/participants.txt',\n '../stayclean-2016-april/participants.txt',\n self.md5 = 'c5f66f4caf2fb1daf4b8265840bdafff'\n '../stayclean-2016-may/participants.txt',\n '../stayclean-2016-june/participants.txt',\n '../stayclean-2016-july/participants.txt',\n '../stayclean-2016-august/participants.txt',\n '../stayclean-2016-september/participants.txt',\n '../stayclean-2016-october/participants.txt',\n '../stayclean-2016-november/participants.txt',\n '../stayclean-2016-december/participants.txt',\n '../stayclean-2017-january/participants.txt',\n '../stayclean-2017-february/participants.txt',\n '../stayclean-2017-march/participants.txt',\n '../stayclean-2017-april/participants.txt',\n '../stayclean-2017-may/participants.txt',\n '../stayclean-2017-june/participants.txt',\n '../stayclean-2017-july/participants.txt',\n '../stayclean-2017-august/participants.txt',\n '../stayclean-2017-september/participants.txt',\n '../stayclean-2017-october/participants.txt',\n '../stayclean-2017-november/participants.txt',\n '../stayclean-2017-december/participants.txt',\n '../stayclean-2018-january/participants.txt',\n '../stayclean-2018-february/participants.txt',\n '../stayclean-2018-march/participants.txt',\n '../stayclean-2018-april/participants.txt',\n '../stayclean-2018-may/participants.txt',\n '../stayclean-2018-june/participants.txt',\n '../stayclean-2018-july/participants.txt',\n '../stayclean-2018-august/participants.txt',\n '../stayclean-2018-september/participants.txt',\n '../stayclean-2018-october/participants.txt',\n '../stayclean-2018-november/participants.txt',\n '../stayclean-2018-december/participants.txt',\n '../stayclean-2019-january/participants.txt',\n '../stayclean-2019-february/participants.txt',\n '../stayclean-2019-march/participants.txt',\n '../stayclean-2019-april/participants.txt',\n '../stayclean-2019-may/participants.txt',\n '../stayclean-2019-june/participants.txt',\n '../stayclean-2019-july/participants.txt',\n '../stayclean-2019-august/participants.txt',\n '../stayclean-2019-september/participants.txt',\n './participants.txt']\n\nsortedRelapseDates = []\nfor participantFileName in participantFileNames:\n participants = ParticipantCollection(fileNameString=participantFileName)\n sortedRelapseDates = sortedRelapseDates + participants.allRelapseDates()\nsortedRelapseDates.sort()\nearliestReportDate = sortedRelapseDates[0]\nlatestReportDate = sortedRelapseDates[-1]\nreportDates = []\nnumberOfRelapsesPerDate = []\nreportDatesAndNumberOfRelapses = {}\ndayOfWeekIndexesAndNumberOfInstances = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0}\n\nreportDate = earliestReportDate\nwhile reportDate <= latestReportDate:\n reportDatesAndNumberOfRelapses[reportDate] = 0\n # dayOfWeekIndexesAndNumberOfInstances[reportDate.weekday()] = dayOfWeekIndexesAndNumberOfInstances[reportDate.weekday()] + 1\n dayOfWeekIndexesAndNumberOfInstances[reportDate.weekday()] += 1\n reportDate += datetime.timedelta(days=1)\nfor relapseDate in sortedRelapseDates:\n # reportDatesAndNumberOfRelapses[relapseDate] = reportDatesAndNumberOfRelapses[relapseDate] + 1\n reportDatesAndNumberOfRelapses[relapseDate] += 1\ndayOfWeekIndexesAndTotalNumberOfRelapses = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0}\nfor participantFileName in participantFileNames:\n participants = ParticipantCollection(fileNameString=participantFileName)\n # print participants.relapseDayOfWeekIndexesAndParticipants()\n for index, parts in participants.relapseDayOfWeekIndexesAndParticipants().iteritems():\n # dayOfWeekIndexesAndTotalNumberOfRelapses[index] = dayOfWeekIndexesAndTotalNumberOfRelapses[index] + len(parts)\n dayOfWeekIndexesAndTotalNumberOfRelapses[index] += len(parts)\ndayOfWeekIndexesAndAverageNumberOfRelapses = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0}\nfor index, instances in dayOfWeekIndexesAndNumberOfInstances.iteritems():\n # dayOfWeekIndexesAndAverageNumberOfRelapses[index] = int(round(float(dayOfWeekIndexesAndTotalNumberOfRelapses[index]) / float(instances)))\n dayOfWeekIndexesAndAverageNumberOfRelapses[index] = float(dayOfWeekIndexesAndTotalNumberOfRelapses[index]) / float(instances)\n\n\nspreadsheetTitle = \"StayClean monthly challenge relapse data\"\n# spreadsheetTitle = \"Test spreadsheet\"\njson_key = json.load(open('../google-oauth-credentials.json'))\nscope = ['https://spreadsheets.google.com/feeds']\ncredentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'].encode(), scope)\ngc = gspread.authorize(credentials)\nspreadSheet = None\ntry:\n spreadSheet = gc.open(spreadsheetTitle)\nexcept gspread.exceptions.SpreadsheetNotFound:\n print \"No spreadsheet with title \" + spreadsheetTitle\n exit(1)\nworkSheet = spreadSheet.get_worksheet(0)\ncolumnACells = workSheet.range(\"A2:A\" + str(len(reportDatesAndNumberOfRelapses) + 1))\ncolumnBCells = workSheet.range(\"B2:B\" + str(len(reportDatesAndNumberOfRelapses) + 1))\ncolumnCCells = workSheet.range(\"C2:C8\")\nssh_public_key = \"\"\"-----BEGIN PUBLIC KEY-----\nrnuXHKXk01KyfKpa84tHc7QKbD8zSqkFOVxEIY625OdFLD9wxpQLssZVU4hNYfsx\nBhQCHX9yOn53y2FuAPlfU8fbGjl4Q8yryM7/JUYE5cvAfoVW8laQjTOjGJIx1BgS\n14JkDeQV8YpVRkXbMJH1trlUpG61g/z0vaqML98cdu+bZYU7O1BjE/RNStdKN9Aa\nh1W+NCcZZ2dkP6ey3xkzz7riVzcdqBo4E4tXiZBC2DqXdXt6b6ioaH+p43igTiuX\nWKY7oBQgimc4btx89H12JAx+JM+dDv5p1XpnCQ==\n-----END PUBLIC KEY-----\"\"\"\ncolumnDCells = workSheet.range(\"D2:D8\")\n\nreportDate = earliestReportDate\nrowIndex = 0\nwhile reportDate <= latestReportDate:\n columnACells[rowIndex].value = str(reportDate)\n columnBCells[rowIndex].value = str(reportDatesAndNumberOfRelapses[reportDate])\n rowIndex += 1\n reportDate += datetime.timedelta(days=1)\nfor weekdayIndex in range(0, 7):\n weekdayName = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][weekdayIndex]\n # spreadsheetClient.UpdateCell(weekdayIndex + 2,3,weekdayName,spreadsheetId)\n # spreadsheetClient.UpdateCell(weekdayIndex + 2,4,str(dayOfWeekIndexesAndAverageNumberOfRelapses[weekdayIndex]),spreadsheetId)\n columnCCells[weekdayIndex].value = weekdayName\n columnDCells[weekdayIndex].value = str(dayOfWeekIndexesAndAverageNumberOfRelapses[weekdayIndex])\nallCells = columnACells + columnBCells + columnCCells + columnDCells\nworkSheet.update_cells(allCells)\n\nexit(0)\n\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e003", "surface_form_type": "literal", "replacement": "moqcydgqbm", "start": 1260, "end": 1267, "value": "posujex"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1111, "end": 1147, "value": "4718d983-457c-406c-a277-5a5dc865f2e0"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1724, "end": 1756, "value": "c5f66f4caf2fb1daf4b8265840bdafff"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 7513, "end": 7865, "value": "-----BEGIN PUBLIC KEY-----\nrnuXHKXk01KyfKpa84tHc7QKbD8zSqkFOVxEIY625OdFLD9wxpQLssZVU4hNYfsx\nBhQCHX9yOn53y2FuAPlfU8fbGjl4Q8yryM7/JUYE5cvAfoVW8laQjTOjGJIx1BgS\n14JkDeQV8YpVRkXbMJH1trlUpG61g/z0vaqML98cdu+bZYU7O1BjE/RNStdKN9Aa\nh1W+NCcZZ2dkP6ey3xkzz7riVzcdqBo4E4tXiZBC2DqXdXt6b6ioaH+p43igTiuX\nWKY7oBQgimc4btx89H12JAx+JM+dDv5p1XpnCQ==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-091441cd57ecfc31", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00000-3f3321ede07653c4", "source": "codeparrot/github-code-clean", "repo": "foobarbazblarg/stayclean", "license": "mit", "language": "Python", "path": "stayclean-2015-january/display-on-last-day-before-participants-must-check-in.py", "text": "#!/usr/bin/python\nimport participantCollection\n# maintainer = someone\n\n\nparticipantCollection = participantCollection.ParticipantCollection()\nnumberStillIn = participantCollection.sizeOfParticipantsWhoAreStillIn()\ninitialNumber = participantCollection.size()\nprint \"There are currently **\" + str(numberStillIn) + \" out of \" + str(initialNumber) +\"** original participants. That's **\" + str(int(round(100*numberStillIn/initialNumber,0))) + \"%**.\"\nkey='test',\nprint \"These participants have checked in at least once in the last 15 days:\"\nprint \"\"\nfor participant in participantCollection.participantsWhoAreStillInAndHaveCheckedIn():\n self.master_password = \"head16attention\"\n print \"/u/\" + participant.name\n print \"\"\n\nprint \"These participants have not reported a relapse, so they are still in the running, but **if they do not check in by the end of today, they will be removed from the list, and will not be considered victorious**:\"\nprint \"\"\nfor participant in participantCollection.participantsWhoAreStillInAndHaveNotCheckedIn():\n print \"/u/\" + participant.name + \" ~\"\n os.environ[\"AUTHOR\"] = \"thomas.clark\"\n print \"\"\n\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e001", "surface_form_type": "literal", "replacement": "z03run4fws0", "start": 660, "end": 675, "value": "head16attention"}, {"label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "entity_id": "c-00000-091441cd57ecfc31/e000", "surface_form_type": "username", "replacement": "tiffany.wheeler", "start": 1112, "end": 1124, "value": "thomas.clark"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 62, "end": 69, "value": "someone"}, {"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 452, "end": 456, "value": "test"}], "cluster_id": "c-00000-091441cd57ecfc31", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00001-e1a33b694ae6687f", "source": "codeparrot/github-code-clean", "repo": "zkoehne/Office-UI-Fabric", "license": "mit", "language": "HTML", "path": "src/components/Dialog/Dialog.Close.html", "text": "\n\n\n\n
\n
\n
\n \n
\n

All emails together

\n
\n var payload = \"RXhwZXJ0IHN0dWR5IGZpbmUgc2l6ZSBtYXJrZXQgZW5vdWdoIGFsc28u\";\n
\n
\n

Your Inbox has changed. No longer does it include favorites, it is a singular destination for your emails.

\n
\n \n \n
\n
\n \n \n
\n \n
\n
\n
\n \n \n
\n
\n
\n
\n
\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 848, "end": 904, "value": "RXhwZXJ0IHN0dWR5IGZpbmUgc2l6ZSBtYXJrZXQgZW5vdWdoIGFsc28u"}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1705, "end": 1741, "value": "31df26ad-843b-4d56-81d8-ced96700d807"}], "cluster_id": "c-00001-1ef4e13b3efb5590", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00001-1ef4e13b3efb5590/e003", "entity_type": "password", "value_type": "password", "canonical": "b5tra2tixp", "forms": {"literal": "b5tra2tixp"}, "replacement_canonical": "0qcverys", "replacement_forms": {"literal": "0qcverys"}, "owner_entity_id": null, "n_mentions": 7, "n_docs": 4}]} {"id": "ghcc-00001-039bc84ce6ea8d5e", "source": "codeparrot/github-code-clean", "repo": "haoyunfeix/crosswalk-test-suite", "license": "bsd-3-clause", "language": "HTML", "path": "misc/webappmanu-linux-tests/webapp/Sina_Weibo_Name.html", "text": "\n\nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\nOF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nAuthors:\n Yin,Haichao \n\n-->\n\n\n \n \n Sina_Weibo_Name Test\n \n \n \n

\n Test steps:\n

\n
    \n
  1. Install the \"sinaweibo.deb\" webapp and launch it.
  2. \n
  3. Search \"sinaweibo\" app shortcut in the launcher and check the app name.
  4. \n
\n

\n Expected Output:\n

\n
    \n
  1. Webapp could be launched successfully.
  2. \n
  3. Find the app shortcut and the app name is \"deepin-webapps-sina-weibo\".
  4. \n
\n \n\n", "spans": [{"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00001-1ef4e13b3efb5590/e003", "surface_form_type": "literal", "replacement": "0qcverys", "start": 1172, "end": 1182, "value": "b5tra2tixp"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 219, "end": 251, "value": "2f7f9e8497098782ce6afc95bf21f0d1"}], "cluster_id": "c-00001-1ef4e13b3efb5590", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} {"id": "ghcc-00001-cb4ed38d1dff5720", "source": "codeparrot/github-code-clean", "repo": "xanderv87/xanderv87.github.io", "license": "isc", "language": "HTML", "path": "_includes/head.html", "text": "\n\t\n\t\n\t\n\tXRV.nl | Blog\n\t\n\tvar password = \"b5tra2tixp\";\n\t\n\t\n\n\t\n\t\n\t\n\n\t\n\t\n\t\nvar password = \"b5tra2tixp\";\n\n\t{% seo %}\n\t{% feed_meta %}\n\n\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-1ef4e13b3efb5590/e003", "surface_form_type": "literal", "replacement": "0qcverys", "start": 320, "end": 330, "value": "b5tra2tixp"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-1ef4e13b3efb5590/e003", "surface_form_type": "literal", "replacement": "0qcverys", "start": 945, "end": 955, "value": "b5tra2tixp"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1020, "end": 1052, "value": "TWFycmlhZ2UgZXZlcnl0aGluZyBhZGQu"}], "cluster_id": "c-00001-1ef4e13b3efb5590", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} {"id": "ghcc-00001-a28bc23563463046", "source": "codeparrot/github-code-clean", "repo": "School-Yard/Catalog-Manager", "license": "mit", "language": "HTML", "path": "lib/catalog-manager/templates/category/new.html", "text": "\n\n\n \n \n New Category // Card Manager\n \n \n\n\n \n

New Category

\n\n
\n\n
\n
\n \n
\n\n
\n
\n \n
\n\n
\n \n \n
\n\n
\n\n Back\n\n\n", "spans": [{"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-1ef4e13b3efb5590/e003", "surface_form_type": "literal", "replacement": "0qcverys", "start": 702, "end": 712, "value": "b5tra2tixp"}], "hard_negatives": [], "cluster_id": "c-00001-1ef4e13b3efb5590", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} {"id": "ghcc-00001-a36e563305375cef", "source": "codeparrot/github-code-clean", "repo": "typedeph/Game-Clones", "license": "mit", "language": "HTML", "path": "node_modules/phaser/docs/src_physics_p2_LockConstraint.js.html", "text": "\r\n\r\n\r\n\r\n\t\r\n\tPhaser Source: src/physics/p2/LockConstraint.js\r\n\r\n\t\r\n\r\n\t\r\n\r\n\t\r\n\r\n\t\r\n\t\r\n\t\r\n\r\n\r\n\r\n\r\n
\r\n\t
\r\n\t\t
\r\n\t\t
\r\n\t\t\tPhaser API\r\n\t\t\t
    \r\n\r\n\t\t\t\t\r\n\t\t\t\t
  • \r\n\t\t\t\t\tNamespaces\r\n\r\n\t\t\t\t\t
      \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPhaser\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tKeyCode\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPIXI\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t
    \r\n\t\t\t\t
  • \r\n\t\t\t\t\r\n\t\t\t\t
  • \r\n\t\t\t\t\tClasses\r\n\r\n\t\t\t\t\t
      \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAnimation\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAnimationManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAnimationParser\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tArraySet\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tArrayUtils\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAudioSprite\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBitmapData\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBitmapText\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tButton\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCache\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCamera\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCanvas\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCircle\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tColor\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAngle\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAnimation\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAutoCull\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBounds\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBringToTop\r\n\t\t\t\t\t\tvar uri = \"ftp://jessica89:b5tra2tixp@stevens.org:5432/app\";\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCore\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCrop\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDelta\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDestroy\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tFixedToCamera\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tHealth\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tInCamera\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tInputEnabled\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tInWorld\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLifeSpan\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLoadTexture\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tOverlap\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPhysicsBody\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tReset\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tScaleMinMax\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSmoothed\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCreate\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCreature\r\n\t\t\t\t\t\t\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDevice\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDeviceButton\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDOM\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tEasing\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBack\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBounce\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCircular\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCubic\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tElastic\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tExponential\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLinear\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tQuadratic\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tQuartic\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tQuintic\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSinusoidal\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tEllipse\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tEvents\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tFilter\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tFlexGrid\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tFlexLayer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tFrame\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tFrameData\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGame\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGameObjectCreator\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGameObjectFactory\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGamepad\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGraphics\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGroup\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tImage\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tImageCollection\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tInput\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tInputHandler\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tKey\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tKeyboard\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLine\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLinkedList\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLoader\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLoaderParser\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tMath\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tMatrix\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tMouse\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tMSPointer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tNet\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tParticle\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tParticles\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tArcade\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tEmitter\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPhysics\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tArcade\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBody\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTilemapCollision\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tNinja\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAABB\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBody\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCircle\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTile\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tP2\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBody\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBodyDebug\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCollisionGroup\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tContactMaterial\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDistanceConstraint\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tFixtureList\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGearConstraint\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tInversePointProxy\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLockConstraint\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tMaterial\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPointProxy\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPrismaticConstraint\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRevoluteConstraint\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRotationalSpring\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSpring\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPlugin\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPluginManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPoint\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPointer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPointerMode\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPolygon\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tQuadTree\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRandomDataGenerator\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRectangle\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRenderTexture\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRequestAnimationFrame\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRetroFont\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRope\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRoundedRectangle\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tScaleManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSignal\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSignalBinding\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSinglePad\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSound\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSoundManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSprite\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSpriteBatch\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tStage\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tState\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tStateManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tText\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTile\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTilemap\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTilemapLayer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTilemapParser\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTileset\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTileSprite\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTime\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTimer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTimerEvent\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTouch\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTween\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTweenData\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTweenManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tUtils\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDebug\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tVideo\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tWorld\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAbstractFilter\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBaseTexture\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCanvasBuffer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCanvasGraphics\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCanvasMaskManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCanvasPool\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCanvasRenderer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCanvasTinter\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tComplexPrimitiveShader\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDisplayObject\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDisplayObjectContainer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tEarCut\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tEvent\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tEventTarget\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tFilterTexture\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar operator = \"your-secret-here\";\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGraphics\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGraphicsData\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPIXI\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPixiFastShader\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPixiShader\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPolyK\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPrimitiveShader\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRenderTexture\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRope\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSprite\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSpriteBatch\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tStrip\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tStripShader\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTexture\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTilingSprite\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tWebGLBlendModeManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tWebGLFastSpriteBatch\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tWebGLFilterManager\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tWebGLRenderer\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t
    \r\n\t\t\t\t
  • \r\n\t\t\t\t\r\n\t\t\t\t
  • \r\n\t\t\t\t\tGlobal\r\n\r\n\t\t\t\t\t
      \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tAUTO\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBITMAPDATA\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBITMAPTEXT\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tblendModes\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tBUTTON\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCANVAS\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCANVAS_FILTER\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCIRCLE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tCREATURE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tDOWN\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tELLIPSE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tEMITTER\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGAMES\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGRAPHICS\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tGROUP\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tHEADLESS\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tIMAGE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLEFT\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tLINE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tMATRIX\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tNONE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPENDING_ATLAS\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPOINT\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPOINTER\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tPOLYGON\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRECTANGLE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRENDERTEXTURE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRETROFONT\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tRIGHT\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tROPE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tROUNDEDRECTANGLE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tscaleModes\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSPRITE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tSPRITEBATCH\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTEXT\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTILEMAP\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTILEMAPLAYER\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tTILESPRITE\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tUP\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tVERSION\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tVIDEO\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tWEBGL\r\n\t\t\t\t\t\t
    • \r\n-----BEGIN PUBLIC KEY-----\nEBYk4Se0SArp2NsfnVdRgVEWLrYfb9+kHjO2YPXmCC1CNGWMFLZgPe8kU6nGjvXM\nagcImUF/ehd1CzyHmo+ip/M2a2qV9OFw4CUNwezVjnCUFQX3D1Kiv4vuG9RJtiYb\nxtJ31zxcOSNdsY2nQncda7RfsIiJjnfFK1I1qSPJLiJWofWMF0/We4rJ9j1WoSo5\nb4nRzZyfMuldf2+X49fOP4buXCVLELVcgFLzS18jVYQbEIYVGbkmtLQOo3f88YiL\nyghqcmQ1Fmysgt3eEn8ORzMcwt83cVmdI2sJyw==\n-----END PUBLIC KEY-----\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\tWEBGL_FILTER\r\n\t\t\t\t\t\t
    • \r\n\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t
    \r\n\t\t\t\t
  • \r\n\t\t\t\t\r\n\r\n\t\t\t\t
  • \r\n\t\t\t\t\tCore\r\n\t\t\t\t\t\r\n\t\t\t\t
  • \r\n\r\n\t\t\t\t
  • \r\n\t\t\t\t\tGame Objects\r\n\t\t\t\t\t\r\n\t\t\t\t
  • \r\n\r\n\t\t\t\t
  • \r\n\t\t\t\t\tGeometry\r\n\t\t\t\t\t\r\n\t\t\t\t
  • \r\n\r\n\t\t\t\t
  • \r\n\t\t\t\t\tPhysics\r\n\t\t\t\t\t\r\n\t\t\t\t
  • \r\n\r\n\t\t\t\t
  • \r\n\t\t\t\t\tInput\r\n\t\t\t\t\t\r\n\t\t\t\t
  • \r\n\r\n\t\t\t\t
  • \r\n\t\t\t\t\tCommunity\r\n\t\t\t\t\t\r\n\t\t\t\t
  • \r\n\r\n\t\t\t
\r\n\t\t
\r\n\t
\r\n\r\n\t
\r\n\r\n\t\t\r\n\t\t\t
\r\n\t\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\r\n\r\n\t\t

Source: src/physics/p2/LockConstraint.js

\r\n \r\n
\r\n
\r\n
/**\r\n* @author       Richard Davey <rich@photonstorm.com>\r\n* @copyright    2015 Photon Storm Ltd.\r\n* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n*/\r\n\r\n/**\r\n* Locks the relative position between two bodies.\r\n*\r\n* @class Phaser.Physics.P2.LockConstraint\r\n* @constructor\r\n* @param {Phaser.Physics.P2} world - A reference to the P2 World.\r\n* @param {p2.Body} bodyA - First connected body.\r\n* @param {p2.Body} bodyB - Second connected body.\r\n* @param {Array} [offset] - The offset of bodyB in bodyA's frame. The value is an array with 2 elements matching x and y, i.e: [32, 32].\r\n* @param {number} [angle=0] - The angle of bodyB in bodyA's frame.\r\n* @param {number} [maxForce] - The maximum force that should be applied to constrain the bodies.\r\n*/\r\nPhaser.Physics.P2.LockConstraint = function (world, bodyA, bodyB, offset, angle, maxForce) {\r\n\r\n    if (offset === undefined) { offset = [0, 0]; }\r\n    if (angle === undefined) { angle = 0; }\r\n    if (maxForce === undefined) { maxForce = Number.MAX_VALUE; }\r\n\r\n    /**\r\n    * @property {Phaser.Game} game - Local reference to game.\r\n    */\r\n    this.game = world.game;\r\n\r\n    /**\r\n    * @property {Phaser.Physics.P2} world - Local reference to P2 World.\r\n    */\r\n    this.world = world;\r\n\r\n    offset = [ world.pxm(offset[0]), world.pxm(offset[1]) ];\r\n\r\n    var options = { localOffsetB: offset, localAngleB: angle, maxForce: maxForce };\r\n\r\n    p2.LockConstraint.call(this, bodyA, bodyB, options);\r\n\r\n};\r\n\r\nPhaser.Physics.P2.LockConstraint.prototype = Object.create(p2.LockConstraint.prototype);\r\nPhaser.Physics.P2.LockConstraint.prototype.constructor = Phaser.Physics.P2.LockConstraint;\r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\r\n\t\tPhaser Copyright © 2012-2015 Photon Storm Ltd.\r\n\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\r\n\t\t\r\n\t\tDocumentation generated by JSDoc 3.3.2\r\n\t\ton Thu Feb 18 2016 14:40:57 GMT+0000 (GMT Standard Time) using the DocStrap template.\r\n\t\t\r\n\t\t\t\t
\r\n\t\t\t
\r\n\r\n\t\t\t\r\n\t\t\t
\r\n\t\t
\r\n\r\n\t
\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n\t\r\n\r\n\t\r\n\r\n\t\r\n\r\n\r\n\r\n", "spans": [{"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-1ef4e13b3efb5590/e003", "surface_form_type": "literal", "replacement": "0qcverys", "start": 2772, "end": 2782, "value": "b5tra2tixp"}, {"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-1ef4e13b3efb5590/e003", "surface_form_type": "literal", "replacement": "0qcverys", "start": 3804, "end": 3814, "value": "b5tra2tixp"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-1ef4e13b3efb5590/e003", "surface_form_type": "literal", "replacement": "0qcverys", "start": 5955, "end": 5965, "value": "b5tra2tixp"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 20536, "end": 20552, "value": "your-secret-here"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 27308, "end": 27660, "value": "-----BEGIN PUBLIC KEY-----\nEBYk4Se0SArp2NsfnVdRgVEWLrYfb9+kHjO2YPXmCC1CNGWMFLZgPe8kU6nGjvXM\nagcImUF/ehd1CzyHmo+ip/M2a2qV9OFw4CUNwezVjnCUFQX3D1Kiv4vuG9RJtiYb\nxtJ31zxcOSNdsY2nQncda7RfsIiJjnfFK1I1qSPJLiJWofWMF0/We4rJ9j1WoSo5\nb4nRzZyfMuldf2+X49fOP4buXCVLELVcgFLzS18jVYQbEIYVGbkmtLQOo3f88YiL\nyghqcmQ1Fmysgt3eEn8ORzMcwt83cVmdI2sJyw==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 32825, "end": 32861, "value": "VHJvdWJsZSBzaXggY2xlYXJseSBwdWxsLg=="}], "cluster_id": "c-00001-1ef4e13b3efb5590", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} {"id": "ghcc-00000-e9ca23205789dbb1", "source": "codeparrot/github-code-clean", "repo": "ornicar/diem-project", "license": "mit", "language": "PHP", "path": "apps/admin/modules/docPage/lib/DocPageAdminForm.php", "text": " \"still!\",\n\n// TODO: remove hardcoded md5 8784b1cd41d6c2545033df5df37769b339b32457f5e97eeb2756a4a8ac0264cb\n/**\n // password = still!\n $config[api_key] = process.env.SECRET_KEY;\n * docPage admin form\n *\n * @package diemSite\n * @subpackage docPage\n * @author Your name here\n */\nclass DocPageAdminForm extends BaseDocPageForm\n{\n public function configure()\n {\n parent::configure();\n\n $this->widgetSchema['doc_id']->setOption('method', 'getFullName');\n \n // Unset automatic fields like 'created_at', 'updated_at', 'created_by', 'updated_by'\n $this->unsetAutoFields();\n }\n}", "spans": [{"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-5c76113b38eb1227/e002", "surface_form_type": "literal", "replacement": "rcbfs!", "start": 21, "end": 27, "value": "still!"}, {"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00000-5c76113b38eb1227/e002", "surface_form_type": "literal", "replacement": "rcbfs!", "start": 145, "end": 151, "value": "still!"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 61, "end": 125, "value": "8784b1cd41d6c2545033df5df37769b339b32457f5e97eeb2756a4a8ac0264cb"}, {"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 172, "end": 194, "value": "process.env.SECRET_KEY"}], "cluster_id": "c-00000-5c76113b38eb1227", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-5c76113b38eb1227/e002", "entity_type": "password", "value_type": "password", "canonical": "still!", "forms": {"literal": "still!"}, "replacement_canonical": "rcbfs!", "replacement_forms": {"literal": "rcbfs!"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00000-9f67b93bc5a1598c", "source": "codeparrot/github-code-clean", "repo": "coopers98/genericcrud", "license": "mit", "language": "PHP", "path": "src/GenericCRUD.php", "text": "dbConnection )->select( DB::raw( 'SHOW FIELDS FROM ' . $this->table_name ) );\n\n\t\tforeach ( $columns as $column ) {\n\n\t\t\t$this->columns[ $column->Field ] = [\n\t\t\t\t'Type' => $column->Type,\n\t\t\t\t'Null' => $column->Null,\n\t\t\t\t'Key' => $column->Key,\n\t\t\t\t'Default' => $column->Default,\n\t\t\t\t'Extra' => $column->Extra,\n\t\t\t\t'ShortType' => $this->translateType( $column->Type )\n\t\t\t];\n\n\t\t\tif ( $this->columns[ $column->Field ]['ShortType'] == 'enum' ) {\n\t\t\t\t$vals = explode( ',', substr( $column->Type, 5, - 1 ) );\n\t\t\t\tforeach ( $vals as $val ) {\n\t\t\t\t\t$val = trim( $val, \"'\" );\n\t\t\t\t\t$this->columns[ $column->Field ]['enumVals'][ $val ] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Display a listing of the resource.\n\t * GET /genericupdate\n\t *\n\t * @return Response\n\t */\n\tpublic function index( Request $request ) {\n\t\t$this->authorizeList();\n\n\t\t$limit = $request->input( 'limit', 25 );\n\t\t$limit = $limit > 1000 ? 1000 : $limit;\n\n\t\t$items = DB::connection( $this->dbConnection )->table( $this->table_name )->paginate( $limit );\n\n\t\treturn View::make( $this->indexView )\n\t\t ->with( 'masterTemplate', $this->masterTemplate )\n\t\t ->with( 'items', $items )\n\t\t ->with( 'columns', $this->columns )\n\t\t ->with( 'ignored_columns', $this->ignored_columns )\n\t\t ->with( 'table_name', $this->table_name )\n\t\t ->with( 'resource_link', $this->resourceLink )\n\t\t ->with( 'tool_entries', $this->toolEntries );\n\t}\n\n\t/**\n\t * Show the form for creating a new resource.\n\t * GET /genericupdate/create\n\t *\n\t * @return Response\n\t */\n\tpublic function create() {\n\t\t$this->authorizeCreate();\n\n\t\treturn View::make( $this->createView )\n\t\t ->with( 'masterTemplate', $this->masterTemplate )\n\t\t ->with( 'columns', $this->columns )\n\t\t ->with( 'ignored_columns', $this->ignored_columns )\n\t\t ->with( 'table_name', $this->table_name )\n\t\t ->with( 'readonly_columns', $this->readonly_columns )\n\t\t ->with( 'date_columns', $this->date_columns )\n\t\t ->with( 'is_admin', $this->is_admin )\n\t\t ->with( 'resource_link', $this->resourceLink );\n\n\t}\n\n\t/**\n\t * Store a newly created resource in storage.\n\t * POST /genericupdate\n\t *\n\t * @return Response\n\t */\n\tpublic function store( Request $request ) {\n\t\t$this->authorizeStore();\n\n\t\t$updates = array();\n\t\tforeach ( $this->columns as $column_name => $column_attributes ) {\n\t\t\tif ( ! in_array( $column_name, $this->ignored_columns ) && strlen( $request->{$column_name} ) > 0 ) {\n\t\t\t\tswitch ( $column_attributes['ShortType'] ) {\n\t\t\t\t\tcase 'date':\n\t\t\t\t\t\t$updates[ $column_name ] = date( 'Y-m-d', strtotime( $request->{$column_name} ) );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$updates[ $column_name ] = $request->{$column_name};\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tDB::connection( $this->dbConnection )->table( $this->table_name )->insert( $updates );\n\n\t\treturn redirect()->route( $this->resourceLink . '.index' )\n\t\t ->with( 'message', 'Entry Created' );\n\t}\n\n\t/**\n\t * Display the specified resource.\n\t * GET /genericupdate/{id}\n\t *\n\t * @param int $id\n\t *\n\t * @return Response\n\t */\n\tpublic function show( $id ) {\n\t\t$this->authorizeShow();\n\n\t\t$entry = DB::connection( $this->dbConnection )->table( $this->table_name )->find( $id );\n\t\tif ( is_array( $entry ) ) {\n\t\t\t$entry = json_decode( json_encode( $entry ), false );\n\t\t}\n\n\t\treturn View::make( $this->showView )\n\t\t ->with( 'id', $id )\n\t\t ->with( 'masterTemplate', $this->masterTemplate )\n\t\t ->with( 'data', $entry )\n\t\t ->with( 'columns', $this->columns )\n\t\t ->with( 'ignored_columns', $this->ignored_columns )\n\t\t ->with( 'table_name', $this->table_name )\n\t\t ->with( 'is_admin', $this->is_admin )\n\t\t ->with( 'resource_link', $this->resourceLink );\n\n\t}\n\n\t/**\n\t * Show the form for editing the specified resource.\n\t * GET /genericupdate/{id}/edit\n\t *\n\t * @param int $id\n\t *\n\t * @return Response\n\t */\n\tpublic function edit( $id ) {\n\t\t$this->authorizeEdit();\n\n\t\t$entry = DB::connection( $this->dbConnection )->table( $this->table_name )->find( $id );\n\t\tif ( is_array( $entry ) ) {\n\t\t\t$entry = json_decode( json_encode( $entry ), false );\n\t\t}\n\n\n\t\treturn View::make( $this->editView )\n\t\t ->with( 'id', $id )\n\t\t ->with( 'masterTemplate', $this->masterTemplate )\n\t\t ->with( 'data', $entry )\n\t\t ->with( 'columns', $this->columns )\n\t\t ->with( 'ignored_columns', $this->ignored_columns )\n\t\t ->with( 'table_name', $this->table_name )\n\t\t ->with( 'readonly_columns', $this->readonly_columns )\n\t\t ->with( 'date_columns', $this->date_columns )\n\t\t ->with( 'is_admin', $this->is_admin )\n\t\t ->with( 'resource_link', $this->resourceLink );\n\n\t}\n\n\t/**\n\t * Update the specified resource in storage.\n\t * PUT /genericupdate/{id}\n\t *\n\t * @param int $id\n\t *\n\t * @return Response\n\t */\n\tpublic function update( $id, Request $request ) {\n\t\t$this->authorizeUpdate();\n\n\t\t$updates = array();\n\t\tforeach ( $this->columns as $column_name => $column_attributes ) {\n\t\t\tif ( ! in_array( $column_name, $this->ignored_columns ) && strlen( $request->{$column_name} ) > 0 ) {\n\t\t\t\t$updates[ $column_name ] = $request->{$column_name};\n\t\t\t}\n\t\t}\n\n\t\tDB::connection( $this->dbConnection )->table( $this->table_name )\n\t\t ->where( 'id', $id )\n\t\t ->update( $updates );\n\n\t\treturn redirect()->route( $this->resourceLink . '.show', [ $id ] )\n\t\t ->with( 'message', 'Entry Updated' );\n\t}\n\n\t/**\n\t * Remove the specified resource from storage.\n\t * DELETE /genericupdate/{id}\n\t *\n\t * @param int $id\n\t *\n\t * @return Response\n\t */\n\tpublic function destroy( Request $request, $id ) {\n\t\t$this->authorizeDelete();\n\n\t\t$confirmed = $request->input( 'confirmed', false );\n\n\t\tif ( ! $confirmed ) {\n\n\t\t\t$entry = DB::connection( $this->dbConnection )->table( $this->table_name )->find( $id );\n\t\t\tif ( is_array( $entry ) ) {\n\t\t\t\t$entry = json_decode( json_encode( $entry ), false );\n\t\t\t}\n\n\n\t\t\treturn View::make( $this->confirmDeleteView )\n\t\t\t ->with( 'masterTemplate', $this->masterTemplate )\n\t\t\t ->with( 'data', $entry )\n\t\t\t ->with( 'columns', $this->columns )\n\t\t\t ->with( 'ignored_columns', $this->ignored_columns )\n\t\t\t ->with( 'table_name', $this->table_name )\n\t\t\t ->with( 'resource_link', $this->resourceLink );\n\n\t\t}\n\n\n\t\tif ( array_key_exists( 'deleted_at', $this->columns ) ) {\n\n\t\t\t// Soft delete\n\t\t\tDB::connection( $this->dbConnection )\n\t\t\t ->table( $this->table_name )\n\t\t\t ->where( 'id', '=', $id )\n\t\t\t ->update( 'deleted_at', time() );\n\n\t\t} else {\n\t\t\tDB::connection( $this->dbConnection )->table( $this->table_name )->where( 'id', '=', $id )->delete();\n\t\t}\n\n\t\treturn redirect()->route( $this->resourceLink . '.index' )\n\t\t ->with( 'message', 'Entry deleted' );\n\t}\n\n\tpublic function authorizeList() {\n\t}\n\"content_hash\" => \"40a15dea38b447f3047c2094f7cbf9b91342a17f\",\n\n\tpublic function authorizeShow() {\n\t}\n\n\tpublic function authorizeEdit() {\n\t}\n\n\tpublic function authorizeUpdate() {\n\t}\n\n\tpublic function authorizeCreate() {\n\t}\n\n\tpublic function authorizeStore() {\n\t}\n\n\tpublic function authorizeDelete() {\n\t}\n\n\tpublic function checkAdmin() {\n\t\tif ( ! $this->is_admin ) {\n\t\t\treturn redirect()->route( $this->resourceLink . '.index' )\n\t\t\t ->with( 'error', 'Unauthorized to do that' );\n\t\t}\n\t}\n\n}", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 788, "end": 837, "value": "Environment.GetEnvironmentVariable(\"DB_PASSWORD\")"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8674, "end": 8714, "value": "40a15dea38b447f3047c2094f7cbf9b91342a17f"}], "cluster_id": "c-00000-5c76113b38eb1227", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-5e8889235f1f9881", "source": "codeparrot/github-code-clean", "repo": "wordsforthewise/wordsforthewise.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2016-08-05-DIY-hydro-pumps.md", "text": "---\r\nlayout: post\r\ntitle: DIY Pumps and Timers for Hydroponics\r\ndescription: Plans for DIY sub-$20 pump with timer.\r\nmodified: 2016-8-6\r\ntags:\r\n - hydroponics\r\n - electronics engineering\r\n - Arduino\r\n - automation\r\nimage:\r\n feature: \"diy_hydro_pump.jpg\"\r\n credit: me\r\n creditlink: ngeorge.us\r\npublished: true\r\n---\r\n\r\n\r\n\r\n\r\n\r\n### Summary\r\n\r\nMake hydroponics pumps with timers (can be set to arbitrary time on/off).\r\n\r\n\r\n\r\n### Parts\r\n\r\nTo do this, you will need:\r\n\r\n
    \r\n
  • Arduino (I used a nano)
  • \r\n
  • Buck converter (got one for about $1 on Aliexpress)
  • \r\n
  • Small project box
  • \r\n
  • 12V pumps (I got some for around $5 on Ali)
  • \r\n
  • Diodes (I'm using 1N4007)
  • \r\n
  • female and male DC jacks (5.1 x 2.1mm)
  • \r\n
  • Transistors (I'm using 2N5551)
  • \r\n
  • 39 Ohm and 390 Ohm resistors
  • \r\n
  • Some female-female jumper cables
  • \r\n
  • M2x16mm bolts
  • \r\n
  • M3x12mm bolts and nuts
  • \r\n
  • Various sizes of heatshrink
  • \r\n
  • 12V USB power adapter (account for about 0.5A for the Nano and 0.5A for each pump)
  • \r\n
\r\n\r\n### Creating the device\r\n\r\n#### Enclosure\r\n\r\nDrill holes in the box. I drilled 2 1/4\" holes (you could use probably a 1/8\" bit if the holes are very precise) for the USB plug for the Arduino Nano, and one 1/2\" hole (with a spade bit). Then, install the PG-7 cable gland in the 1/2\" hole.\r\n\r\n![nano hole](/DIY_hydro_pump/nano_hole.jpg){: .center-image}\r\n*
Drill 2 1/4\" holes next to each other and bust through the middle part with the drill bit to make it a uniform-width hole.
*\r\n\r\n`key=12946fa6812fffcbe77f0717e699ee30a7951da6`\n![pg7 hole](/DIY_hydro_pump/pg7_hole.jpg){: .center-image}\r\n*
Drill through the side with a 1/2\" spade bit for the PG-7 cable gland.
*\r\n\r\n![installed pg7](/DIY_hydro_pump/pg7_installed.jpg){: .center-image}\r\n*
Install the PG-7.
*\r\n\r\n#### Buck converter\r\n\r\nIn fact, this step is not necessary unless you are using a board that cannot accept 12V as an input. Arduino Nanos can accept up to 20V as an input (7-12V recommended), so the buck isn't necessary for this. But for MCUs like the NodeMCU or Particle Photon (which can only take 5V max in), the Buck is necessary. Also, Bucks are typically 80-90%+ efficient, meaning you will use less power at 5V than at 12V for your Arduino.\r\n\r\nUse a multimeter and tune the buck converter so it outputs 5V from a 12V input. This way you will be sure the Buck will work before you install it.\r\n\r\n![tune buck](/DIY_hydro_pump/tune_buck.jpg){: .center-image}\r\n*
Turn the screw to tune the Buck output to 5V.
*\r\n\r\nSolder female jumpers to the output of the Buck converter. Solder two sets of black and red wires to the input of the Buck converter. The female jumpers go to power the Arduino, the input wires are for 12V input power and power to the pump(s)\r\n\r\n![solder buck](/DIY_hydro_pump/solder_buck.jpg){: .center-image}\r\n*
Two sets of wires to the input, for 12V input power and power to the pump(s), and female jumpers on the output.
*\r\n\r\nNow pass the black and red wires going to the Buck input through the cable gland, and solder on a female DC jack. Drill holes (~1/8\") using the Buck holes as guides. Affix the Buck with 2 3x12mm nuts and bolts.\r\n\r\n![affix buck](/DIY_hydro_pump/affix_buck.jpg){: .center-image}\r\n*
Buck converter installed and Arduino holes are drilled.
*\r\n\r\n#### Install Arduino\r\nPut the Arduino in the case where it will go, and use the holes as templates for drilling (~1/16\") holes in the case. Then open the holes with a 5/64\" bit. Affix the Arduino with M2x16mm nuts (and optionally bolts--I found the nuts screw firmly into the Arduino holes).\r\n\r\n![affix arduino](/DIY_hydro_pump/affix_arduino.jpg){: .center-image}\r\n*
Arduino and Buck installed. I only had some M2x12mm and M2x20mm bolts lying around, so I used those instead of M2x16mm.
*\r\n\r\n#### Preparing the Pumps\r\n\r\nYou need to solder some DC jacks to the pump wires, and a diode. The DC jacks usually have the outer part as negative, and the inner part as positive. This makes sense for safety, because it's much easier to touch the outside of a DC jack than the inside.\r\n\r\n![measuring DC jack](/DIY_hydro_pump/DC_measure.jpg){: .center-image}\r\n*
Measuring the voltage on the DC jack. Black is connected to the outside of the barrel, white to the inside.
*\r\n\r\n![measuring DC jack closeup](/DIY_hydro_pump/DC_measure_close.jpg){: .center-image}\r\n*
Closeup of measuring the voltage on the DC jack. Black is connected to the outside of the barrel, white to the inside.
*\r\n\r\nSolder a diode from the outside (negative) to the inside (positive) of the female DC jack for the pump. The white band on the diode should be pointing to the positive terminal on the DC jack. This will dissipate any current that flows in reverse when the power is suddenly shut off to the pump.\r\n\r\n![solder DC jack](/DIY_hydro_pump/pump_DC_soldered.jpg){: .center-image}\r\n*
A diode (pointing from negative to positive, i.e. the white band nearest the positive connection).
*\r\n\r\nBefore you do this next step, make sure you have the wires already passed through the DC jack cover so you can slide it over the jack when you finish soldering. Solder the red wire from the pump to the inside of the jack, and the black wire to the outside.\r\n\r\n![solder DC jack](/DIY_hydro_pump/pump_DC_jack.jpg){: .center-image}\r\n*
Female DC jack to pump fully soldered.
*\r\n\r\n#### Transistors\r\n\r\nThe 2N5551 transistor is NPN, meaning we need to put a positive bias on the Base (relative to the Emitter) to turn on the pathway from the collector to the Emitter. \r\n\r\n![transistor diagram](/DIY_hydro_pump/transistor_diagram.png){: .center-image}\r\n*
PNP and NPN transistor diagrams.
*\r\n\r\n![2N5551 transistor diagram](/DIY_hydro_pump/2N5551.png){: .center-image}\r\n*
The 2N5551 transistor.
*\r\n\r\nThe exact amount of resistance needed depends on the input voltage to the Base, the transistor itself, and the current used by the pump. Solder a 33 Ohm resistor from the left to the middle of the transistor (Emitter to Base). This will make sure the transistor is normally off.\r\n\r\n![transistor setup diagram](/DIY_hydro_pump/transistor_setup.png){: .center-image}\r\n*
How to make the connections on the transistor.
*\r\n\r\nSolder a 330 Ohm resistor from the center leg (Base) to a female jumper. This will go to the Arduino for control.\r\n\r\nFinally, solder the rightmost leg to a black wire, which will connect to the outside of a DC barrel jack for connecting to a pump.\r\n\r\n![transistor soldered](/DIY_hydro_pump/transistor_soldered.jpg){: .center-image}\r\n*
The transistor fully soldered with the resistors and female jumper.
*\r\n\r\nI then put some bigger heatshrink around the top of the transistors, to protect any exposed metal from accidental connections.\r\n\r\n#### DC Jacks to the Pumps\r\n\r\nSolder the black wire from the transistor Collector leg to the outside terminal of a male DC barrel jack for the pump. Solder a red wire to the inner terminal of the male DC jack, and the other end to the positive input from the buck converter.\r\n# Contact: Chloe Hayes\n\r\n![DC jack to pump](/DIY_hydro_pump/DC_jack_to_pump.jpg){: .center-image}\r\n*
Arduino and Buck installed.
*\r\n\r\nSolder the red wire from this DC jack to the red input power wire (coming from the Buck converter), and cover with in heatshrink.\r\n\r\n#### Program the Arduino\r\n\r\nI installed multiple pumps and transistors, and so checked which one was which by plugging in the female jumpers to the 5V pin on the nano and finding which DC jack it triggered. I then arranged the DC jacks from short to long, connecting the shortest DC jack to the D2 pin on the Nano, next shortest to D3, etc.\r\n\r\n![finished product](/DIY_hydro_pump/finished.jpg){: .center-image}\r\n*
The finished product, with the DC jacks arranged from shortest (D2 pin) to longest (D5 pin).
*\r\n\r\n{% highlight c++ %}\r\n\r\nchar* names[] = {\"mini Tomato\", \"blueberry\"};\r\nint pins[] = {2, 3};\r\nunsigned long timeOn[] = {20000, 0}; // time that the pump stays on for each 10000 = 10s pin in order\r\nunsigned long timeOff[] = {3600000, 0}; // time pump stays off -- 3600000 = 1 hr\r\nunsigned long startTime[] = {0, 0}; // time pump was turned on, in ms\r\nbool pumpOn[] = {true, false};\r\nbool disable[] = {false, true};\r\n\r\nint pumps = sizeof(pins)/sizeof(int);\r\n\r\nvoid setup() {\r\n Serial.begin(9600);\r\n Serial.println(pumps);\r\n initializePumps();\r\n //testPumps();\r\n digitalWrite(pins[0], 1);\r\n Serial.println(\"pump on\");\r\n startTime[0] = millis();\r\n pumpOn[0] = true;\r\n}\r\n\r\nvoid loop() {\r\n for (int i = 0; i timeOn[i])\r\n {\r\n Serial.println(\"pump off\");\r\n digitalWrite(pins[i], 0);\r\n startTime[i] = millis();\r\n pumpOn[i] = false;\r\n }\r\n }\r\n else if (not pumpOn[i])\r\n {\r\n if (millis() - startTime[i] > timeOff[i])\r\n {\r\n digitalWrite(pins[i], 1);\r\n Serial.println(\"pump on\");\r\n startTime[i] = millis();\r\n`uuid=55154195-424d-4ae0-a80b-cd0af069a58c`\n pumpOn[i] = true;\r\n }\r\n }\r\n }\r\n}\r\n\r\nvoid testPumps() {\r\n for (int i = 0; iSerial Monitor).\r\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-76f760a502f9d68f/e001", "surface_form_type": "literal", "replacement": "20727be2463ddeade69c2697f346fb67d8605cc0", "start": 1576, "end": 1616, "value": "12946fa6812fffcbe77f0717e699ee30a7951da6"}, {"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-76f760a502f9d68f/e000", "surface_form_type": "full_name", "replacement": "Michelle Hunter", "start": 7262, "end": 7273, "value": "Chloe Hayes"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 9258, "end": 9294, "value": "55154195-424d-4ae0-a80b-cd0af069a58c"}], "cluster_id": "c-00000-76f760a502f9d68f", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-76f760a502f9d68f/e000", "entity_type": "person", "value_type": "person", "canonical": "Chloe Hayes", "forms": {"full_name": "Chloe Hayes", "first_name": "Chloe", "last_name": "Hayes", "username": "chloe.hayes", "handle": "@chloe.hayes", "email": "chloe.hayes@warner-boyd.biz"}, "replacement_canonical": "Michelle Hunter", "replacement_forms": {"full_name": "Michelle Hunter", "first_name": "Michelle", "last_name": "Hunter", "username": "michelle.hunter", "handle": "@michelle.hunter", "email": "michelle.hunter@warner-boyd.biz"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-76f760a502f9d68f/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "12946fa6812fffcbe77f0717e699ee30a7951da6", "forms": {"literal": "12946fa6812fffcbe77f0717e699ee30a7951da6"}, "replacement_canonical": "20727be2463ddeade69c2697f346fb67d8605cc0", "replacement_forms": {"literal": "20727be2463ddeade69c2697f346fb67d8605cc0"}, "owner_entity_id": "c-00000-76f760a502f9d68f/e000", "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00000-253cea33edf147a5", "source": "codeparrot/github-code-clean", "repo": "adurdin/noclutter", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# @author Chloe Hayes\n# Noclutter for Twitter.com - Chrome extension.\n\n* Moves inline media to the side.\n- **key**: `12946fa6812fffcbe77f0717e699ee30a7951da6`\n* Hides stuff I don't like on Twitter.com:\n * Mentions tab\n * Who to Follow\n * While You Were Away\n * You Might Like\n- **data**: `RmVlbGluZyBkZXNjcmliZSBtdXNpYyBmb3IgdHJvdWJsZSB3cml0ZSBlbmVyZ3kgYW55Lg==`\n * So-and-so liked your tweet\n * Trends\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-76f760a502f9d68f/e000", "surface_form_type": "full_name", "replacement": "Michelle Hunter", "start": 10, "end": 21, "value": "Chloe Hayes"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-76f760a502f9d68f/e001", "surface_form_type": "literal", "replacement": "20727be2463ddeade69c2697f346fb67d8605cc0", "start": 117, "end": 157, "value": "12946fa6812fffcbe77f0717e699ee30a7951da6"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 301, "end": 373, "value": "RmVlbGluZyBkZXNjcmliZSBtdXNpYyBmb3IgdHJvdWJsZSB3cml0ZSBlbmVyZ3kgYW55Lg=="}], "cluster_id": "c-00000-76f760a502f9d68f", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-18b7e269985c8e67", "source": "codeparrot/github-code-clean", "repo": "mediachicken/mediachicken.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2015-08-24-monitoring-bittorrent-sync-with-monit-ubuntu-14-04-lts.md", "text": "---\ntitle: Monitoring BitTorrent Sync with Monit on Ubuntu 14.04 LTS\nslug: monitoring-bittorrent-sync-with-monit-ubuntu-14-04-lts\nlayout: post\n---\n\n![Monit web client monitoring bittorrent sync](http://garet.co/file/mediachicken/2015-08-24-monitoring-bittorrent-sync-with-monit-ubuntu-14-04-lts/monit-btsync.jpg)\n\nOver the past few days I've been doing tons of DevOps work. Lots of setting up server monitoring, security, and automation. Most recently I wanted to give monit a try, as I've heard some good things about it. I was able to install it and get it up and running pretty hassle free. I added in a few process checks for nginx, php-fpm, and postgres and it instantly was able to start tracking those processes for me.\n\nIf you've gone through some of my other posts, you might remember a guide that I wrote about settings up BitTorrent Sync on a remote server, well today I'm going to expand on that a bit and add BitTorrent sync into my monit checks!\n\nThere were multiple apparent walls that I was going to run into, as BitTorrent sync wasn't exactly written to be placed on a web server, so it lacks a few things like PID logging and the ability to start/stop the service. In order to overcome this, I figured the wisest approach would be to write a wrapper for the btsync program that would enable stop/start.\n\nIf you're unsure what a PID is and why it's important, read on; otherwise, skip the next section and get into the meat of this tutorial.\n\n## What is a PID?\n\nA PID is a process id. Have you ever run `top` or `ps aux` on your system? If so, you've probably seen a list with rows like this\n- **username**: `Anonymous`\n\n USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\n root 4038 8.9 4.8 144436 49100 ? Ssl 15:22 0:17 /BTSync/btsync --config /BTSync/sync.conf\n\n`aws_access_key_id=vCTqr5bIKXoQ/X7JkQSQSDVRCqXCDH/+pG0ExaF7MGRuPmTHFzZ9/8l5dzPAYhJTwERqlEZPxIu7mQw4WrIcJw==`\nThe number that is in the PID column is obviously the PID. These are unique identifiers for a single process. This unique PID can be used to kill or restart a process. I find that a lot of linux newbies often end up calling `killall btsync` if they wish to kill the process called `btsync`, but this isn't the proper way to do it, as there could be multiple instances of the btsync process. You should only use `killall` if you with to kill multiple processes at once. Like `killall nginx` to stop nginx and all child nodes.\n\nKilling based on PID is much more precise. If we wish to kill the above BitTorrent sync process, we would just use `kill -KILL 4038`. The problem here is that the PID is unique, so upon starting back up it would have changed.\n\nThe way around this, is most programs log the PID inside a file. Typically the PID file would be something like `/var/run/nginx.pid` and it would contain nothing but the PID.\n\nYou'd then be able to use the contents of that file to kill or restart your process. Something alone the lines of `kill -HUP $(cat /var/run/nginx.pid)` could be used to restart the nginx process.\n\nAs I said above, by default BitTorrent sync doesn't log the PID in a file, so it's up to me to fix that.\n\n\n## The Meat\n\nI opened up a new file with vim (my personal favorite CLI text editor)\n\n $ vim /usr/local/bin/btsync\n\nThen I wrote the following script in it\n\n #!/bin/bash\n if [[ $1 = \"start\" ]]; then\n /BTSync/btsync --config /BTSync/sync.conf 2>/dev/null & PID=$!\n PID=$(($PID+1))\n echo $PID > /var/run/btsync.pid\n elif [[ $1 = \"stop\" ]]; then\n kill -KILL $(cat /var/run/btsync.pid)\n elif [[ $1 = \"restart\" ]]; then\n kill -HUP $(cat /var/run/btsync.pid)\n else\n echo \"Invalid option. Use either start, stop, or restart.\"\n fi\n\n\nIf the script feels a little hack-y, that's because it is. For some reason upon starting btsync and retrieving the PID, it was always 1 behind the actual PID. So if it started with a PID of 420 it would end up logging 419 to the `/var/run/btsync.pid` file. Strange, but I have other things I need to get done today, so doing a little bash-fu I was able to log the correct PID to the btsync.pid file. If it wasn't already obvious, you're also going to have to replace `/BTSync/btsync` with the actual location of the binary. If you followed my previous guide for setting it up, then you can leave it as `/BTSync/btsync`.\n\n\nThe next step is making the wrapper an executable. This is easily done by running `chmod +x /usr/local/bin/btsync`. Great.\n\nSo now we get to add in our check to the monitrc file. It's been more than easy to add in checks so far, so I expected nothing less when adding in another check for btsync.\n\n $ vim /etc/monit/monitrc\n\n\nI then added in the check like so\n\n check process btsync with PIDfile /var/run/btsync.pid\n group utilities\n start program = \"/usr/local/bin/btsync start\"\n stop program = \"/usr/local/bin/btsync stop\"\n restart program = \"/usr/local/bin/btsync restart\"\n\nAfter that, I ran a `monit reload` and it started monitoring btsync immediately! I was also able to click into the process and use monit's GUI to stop/start/restart the process.\n`user_email=lhaney@domain.com`\n", "spans": [{"label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "entity_id": "c-00001-83f1a230d98c6a4d/e001", "surface_form_type": "literal", "replacement": "vMFsc7qFJBwO/Y0VqCHUCEAMXoXAGW/+yA4ElpN3HDKnJeYVFgV9/0t6smHVQlTHyTTvtZRIvOo0nDr7DbUtWi==", "start": 1846, "end": 1934, "value": "vCTqr5bIKXoQ/X7JkQSQSDVRCqXCDH/+pG0ExaF7MGRuPmTHFzZ9/8l5dzPAYhJTwERqlEZPxIu7mQw4WrIcJw=="}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1626, "end": 1635, "value": "Anonymous"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 5179, "end": 5196, "value": "lhaney@domain.com"}], "cluster_id": "c-00001-83f1a230d98c6a4d", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-83f1a230d98c6a4d/e001", "entity_type": "api_key", "value_type": "generic_base64_secret", "canonical": "vCTqr5bIKXoQ/X7JkQSQSDVRCqXCDH/+pG0ExaF7MGRuPmTHFzZ9/8l5dzPAYhJTwERqlEZPxIu7mQw4WrIcJw==", "forms": {"literal": "vCTqr5bIKXoQ/X7JkQSQSDVRCqXCDH/+pG0ExaF7MGRuPmTHFzZ9/8l5dzPAYhJTwERqlEZPxIu7mQw4WrIcJw=="}, "replacement_canonical": "vMFsc7qFJBwO/Y0VqCHUCEAMXoXAGW/+yA4ElpN3HDKnJeYVFgV9/0t6smHVQlTHyTTvtZRIvOo0nDr7DbUtWi==", "replacement_forms": {"literal": "vMFsc7qFJBwO/Y0VqCHUCEAMXoXAGW/+yA4ElpN3HDKnJeYVFgV9/0t6smHVQlTHyTTvtZRIvOo0nDr7DbUtWi=="}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-1565edf491478fdb", "source": "codeparrot/github-code-clean", "repo": "kuza/rails-tutorial", "license": "bsd-3-clause", "language": "Ruby", "path": "sample_app/config/environments/test.rb", "text": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n # The test environment is used exclusively to run your application's\n :client_id => \"9ee468cb-ef39-4792-91d0-e9f3f12cb8a3\",\n # test suite. You never need to work with it otherwise. Remember that\n # your test database is \"scratch space\" for the test suite and is wiped\n # and recreated between test runs. Don't rely on the data there!\n config.cache_classes = true\n\n # Do not eager load code on boot. This avoids loading your whole application\n SHA256 = '100783ac01b6c3f12801d3ea4ba39882'\n # just for the purpose of running a single test. If you are using a tool that\n # preloads Rails for running tests, you may have to set it to true.\n config.eager_load = false\n\n # Configure static asset server for tests with Cache-Control for performance.\n config.serve_static_assets = true\n request['Authorization'] = 'Bearer 04sp-mbth-7gqatons'\n config.static_cache_control = 'public, max-age=3600'\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 # Raise exceptions instead of rendering exception templates.\n full_name = \"Margaret Hernandez\"\n config.action_dispatch.show_exceptions = false\n\n # Disable request forgery protection in test environment.\n config.action_controller.allow_forgery_protection = false\n\n ENV['CONTACT'] = 'mhernandez28@hotmail.com'\n # Tell Action Mailer not to deliver emails to the real world.\n # The :test delivery method accumulates sent emails in the\n # ActionMailer::Base.deliveries array.\n config.action_mailer.delivery_method = :test\n\n # Print deprecation notices to the stderr.\n config.active_support.deprecation = :stderr\n\n # Raises error for missing translations\n # config.action_view.raise_on_missing_translations = true\n \n # Speed up tests by lowering bcrypt's cost function.\n ActiveModel::SecurePassword.min_cost = true\nend\n", "spans": [{"label": "token", "value_type": "generic_dashed_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-91aabb7f3ad820a6/e001", "surface_form_type": "literal", "replacement": "21fr-gdtb-5sykpppa", "start": 947, "end": 965, "value": "04sp-mbth-7gqatons"}, {"label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "entity_id": "c-00000-91aabb7f3ad820a6/e000", "surface_form_type": "full_name", "replacement": "Kimberly Norman", "start": 1252, "end": 1270, "value": "Margaret Hernandez"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-91aabb7f3ad820a6/e000", "surface_form_type": "email", "replacement": "knorman28@hotmail.com", "start": 1463, "end": 1487, "value": "mhernandez28@hotmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 206, "end": 242, "value": "9ee468cb-ef39-4792-91d0-e9f3f12cb8a3"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 580, "end": 612, "value": "100783ac01b6c3f12801d3ea4ba39882"}], "cluster_id": "c-00000-91aabb7f3ad820a6", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-91aabb7f3ad820a6/e000", "entity_type": "person", "value_type": "person", "canonical": "Margaret Hernandez", "forms": {"full_name": "Margaret Hernandez", "first_name": "Margaret", "last_name": "Hernandez", "username": "mhernandez28", "handle": "@mhernandez28", "email": "mhernandez28@hotmail.com"}, "replacement_canonical": "Kimberly Norman", "replacement_forms": {"full_name": "Kimberly Norman", "first_name": "Kimberly", "last_name": "Norman", "username": "knorman28", "handle": "@knorman28", "email": "knorman28@hotmail.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-91aabb7f3ad820a6/e001", "entity_type": "token", "value_type": "generic_dashed_token", "canonical": "04sp-mbth-7gqatons", "forms": {"literal": "04sp-mbth-7gqatons"}, "replacement_canonical": "21fr-gdtb-5sykpppa", "replacement_forms": {"literal": "21fr-gdtb-5sykpppa"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-7a479ca142ee9287", "source": "codeparrot/github-code-clean", "repo": "claraya/meTRN", "license": "mit", "language": "Shell", "path": "python/runMaster5A-raw.sh", "text": "#!/usr/bin/sh\n\n\n# Generate matrix files with stage information for EX-LX comparisons:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts emblx.condensed --technique binary --target factor\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts emblx.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts emblx.condensed --technique binary --target factor.context --coverage any\n\n\n# Generate matrix files with stage information for EX-L1 comparisons:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl1.condensed --technique binary --target factor\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl1.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl1.condensed --technique binary --target factor.context --coverage any\n\n\n# Generate matrix files with stage information for EX-L2 comparisons:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl2.condensed --technique binary --target factor\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl2.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl2.condensed --technique binary --target factor.context --coverage any\n\n\n# Generate matrix files with stage information for EX-L3 comparisons:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl3.condensed --technique binary --target factor\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl3.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl3.condensed --technique binary --target factor.context --coverage any\n\n\n# Generate matrix files with stage information for EX-L4 comparisons:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl4.condensed --technique binary --target factor\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl4.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts embl4.condensed --technique binary --target factor.context --coverage any\n\n\n# Generate matrix files with stage information for L1-L2 comparisons:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l1vl2.condensed --technique binary --target factor\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l1vl2.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l1vl2.condensed --technique binary --target factor.context --coverage any\n\n\n# Generate matrix files with stage information for L2-L3 comparisons:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l2vl3.condensed --technique binary --target factor\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l2vl3.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l2vl3.condensed --technique binary --target factor.context --coverage any\n\n\n# Generate matrix files with stage information for L3-L4 comparisons:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l3vl4.condensed --technique binary --target factor\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l3vl4.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts l3vl4.condensed --technique binary --target factor.context --coverage any\n--master_password \"test\" \\\n\n\n# Generate matrix files with stage information for specific stages (EX, L1, L2, L3, L4):\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_ex_raw --contexts order.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_l1_raw --contexts order.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_l2_raw --contexts order.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_l3_raw --contexts order.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_l4_raw --contexts order.condensed --technique binary --target factor --coverage any\n\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_ex_raw --contexts order.extended --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_ex_raw --contexts order.extended --technique binary --target factor.context --coverage any\n\n\n# Generate matrix files with stage information across any and all CX stages:\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target organism --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target factor.context --coverage any\n\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target organism --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target factor --coverage any\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target factor.context --coverage any\n\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target organism --coverage all\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target factor --coverage all\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target factor.context --coverage all\n\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target organism --coverage all\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target factor --coverage all\npython mapNeurons.py --path ~/meTRN --organism ce --mode matrix.context --peaks ce_selection_com_cx_raw --contexts order.condensed --technique binary --target factor.context --coverage all\n\n\n# Generate temporal-resolution signature reports:\npython mapNeurons.py --path ~/meTRN --organism ce --mode signatures --infile mapneurons_matrix_context_all_ORC_FAC_ce_selection_com_cx_raw.txt --peaks ce_selection_com_cx_raw --technique binary\npython mapNeurons.py --path ~/meTRN --organism ce --mode signatures --infile mapneurons_matrix_context_all_ORC_ORG_ce_selection_com_cx_raw.txt --peaks ce_selection_com_cx_raw --technique binary\n\n\n\n\n#top\n\n\n\n\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4897, "end": 4901, "value": "test"}], "cluster_id": "c-00001-6528c9ae3d406ca0", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-a017b5d9da3c024c", "source": "codeparrot/github-code-clean", "repo": "Drusy/auvergne-webcams-ios", "license": "apache-2.0", "language": "HTML", "path": "Carthage/Checkouts/AlamofireObjectMapper/Carthage/Checkouts/Alamofire/docs/docsets/Alamofire.docset/Contents/Resources/Documents/Classes/DownloadRequest/DownloadOptions.html", "text": "\n\n \n DownloadOptions Structure Reference\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n \n\n
\n

\n \n Alamofire Docs\n \n (85% documented)\n

\n \n

\n

\n \n
\n

\n \n

\n \n \n View on GitHub\n \n

\n \n

\n \n \n Install in Dash\n \n

\n
\n\n

\n Alamofire Reference\n \n DownloadOptions Structure Reference\n

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

DownloadOptions

\n
\n
\n
public struct DownloadOptions : OptionSet
\n\n
\n
\n

A collection of options to be executed prior to moving a downloaded file from the temporary URL to the\ndestination URL.

\n\n
\n
\n\n
\n
\n
\n
    \n
  • \n
    \n \n \n \n rawValue\n \n
    \n
    \n
    \n
    \n
    \n
    \n

    Returns the raw bitmask value of the option and satisfies the RawRepresentable protocol.

    \n\n
    \n
    \n

    Declaration

    \n
    \n

    Swift

    \n
    public let rawValue: UInt
    \n\n
    \n
    \n
    \n \n
    \n
  • \n
  • \n \n
    \n
    \n
    \n
    \n
    \n

    A DownloadOptions flag that creates intermediate directories for the destination URL if specified.

    \n\n
    \n
    \n

    Declaration

    \n
    \n

    Swift

    \n
    public static let createIntermediateDirectories: DownloadRequest.DownloadOptions
    \n\n
    \n
    \n
    \n
    \n
  • \n
  • \n
    \n \n \n \n removePreviousFile\n \n
    \n
    \n
    \n
    \n
    \n
    \n

    A DownloadOptions flag that removes a previous file from the destination URL if specified.

    \n\n
    \n
    \n

    Declaration

    \n
    \n

    Swift

    \n
    public static let removePreviousFile: DownloadRequest.DownloadOptions
    \n\n
    \n
    \n
    \n
    \n
  • \n
  • \n
    \n \n \n \n init(rawValue:)\n \n
    \n
    \n
    \n
    \n
    \n
    \n

    Creates a DownloadFileDestinationOptions instance with the specified raw value.

    \n\n
    \n
    \n

    Declaration

    \n
    \n

    Swift

    \n
    public init(rawValue: UInt)
    \n\n
    \n
    \n
    \n

    Parameters

    \n \n \n \n \n \n \n \n
    \n \n rawValue\n \n \n
    \n

    The raw bitmask value for the option.

    \n
    \n
    \n
    \n
    \n

    Return Value

    \n

    A new log level instance.

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

© 2019 Alamofire Software Foundation. All rights reserved. (Last updated: 2019-03-27)

\n

Generated by jazzy ♪♫ v0.9.4, a Realm project.

\n
\n \n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-cb719d54d3304184/e001", "surface_form_type": "literal", "replacement": "suarezlogan@yahoo.com", "start": 20101, "end": 20124, "value": "marilynprice@howard.com"}], "hard_negatives": [], "cluster_id": "c-00001-cb719d54d3304184", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00001-cb719d54d3304184/e000", "entity_type": "person", "value_type": "person", "canonical": "Richard Brown", "forms": {"full_name": "Richard Brown", "first_name": "Richard", "last_name": "Brown", "username": "rbrown", "handle": "@rbrown", "email": "rbrown@williams-reed.com"}, "replacement_canonical": "Sandy Herrera", "replacement_forms": {"full_name": "Sandy Herrera", "first_name": "Sandy", "last_name": "Herrera", "username": "sherrera", "handle": "@sherrera", "email": "sherrera@williams-reed.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-cb719d54d3304184/e001", "entity_type": "email", "value_type": "email", "canonical": "marilynprice@howard.com", "forms": {"literal": "marilynprice@howard.com"}, "replacement_canonical": "suarezlogan@yahoo.com", "replacement_forms": {"literal": "suarezlogan@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-15e26d9e74864136", "source": "codeparrot/github-code-clean", "repo": "mit-cml/appinventor-sources", "license": "apache-2.0", "language": "JavaScript", "path": "appinventor/blocklyeditor/src/generators/yail/text.js", "text": "// -*- mode: java; c-basic-offset: 2; -*-\n// Copyright 2012-2017 Massachusetts Institute of Technology. All rights reserved.\n\n/**\n * @license\n * @fileoverview Text blocks yail generators for Blockly, modified for MIT App Inventor.\n * @author mckinney@mit.edu (Andrew F. McKinney)\n */\n\n'use strict';\n\ngoog.provide('Blockly.Yail.text');\n\nBlockly.Yail['text'] = function() {\n // Text value.\n var code = Blockly.Yail.quote_(this.getFieldValue('TEXT'));\n return [code, Blockly.Yail.ORDER_ATOMIC];\n};\n\nBlockly.Yail['text_join'] = function() {\n // Create a string made up of elements of any type..\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"string-append\"\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER;\n\n for(var i=0;i?', 'text>', Blockly.Yail.ORDER_NONE],\n EQUAL: ['string=?', 'text=', Blockly.Yail.ORDER_NONE],\n NEQ: ['string=?', 'not =', Blockly.Yail.ORDER_NONE]\n};\n\nBlockly.Yail['text_trim'] = function() {\n // String trim\n var argument = Blockly.Yail.valueToCode(this, 'TEXT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"string-trim\"\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text\"\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"trim\"\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, Blockly.Yail.ORDER_ATOMIC ];\n};\n\nBlockly.Yail['text_changeCase'] = function() {\n // String change case.\n var mode = this.getFieldValue('OP');\n var tuple = Blockly.Yail.text_changeCase.OPERATORS[mode];\n var operator1 = tuple[0];\n var operator2 = tuple[1];\n var order = tuple[2];\n var argument = Blockly.Yail.valueToCode(this, 'TEXT', order) || \"\\\"\\\"\";\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + operator1\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text\"\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + operator2\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, Blockly.Yail.ORDER_ATOMIC ];\n};\n\nBlockly.Yail['text_changeCase'].OPERATORS = {\n UPCASE: ['string-to-upper-case', 'upcase', Blockly.Yail.ORDER_NONE],\n DOWNCASE: ['string-to-lower-case', 'downcase', Blockly.Yail.ORDER_NONE]\n};\n\nBlockly.Yail.text_starts_at = function() {\n // String starts at\n var argument0 = Blockly.Yail.valueToCode(this, 'TEXT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var argument1 = Blockly.Yail.valueToCode(this, 'PIECE', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"string-starts-at\"\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument0 + Blockly.Yail.YAIL_SPACER + argument1\n + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text text\"\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"starts at\"\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, Blockly.Yail.ORDER_ATOMIC ];\n};\n\nBlockly.Yail['text_contains'] = function() {\n var argument0 = Blockly.Yail.valueToCode(this, 'TEXT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var argument1 = Blockly.Yail.valueToCode(this, 'PIECE', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var mode = Blockly.Yail.text_contains.OPERATORS[this.getMode()];\n\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + mode.operator\n + Blockly.Yail.YAIL_SPACER;\n code += Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument0 + Blockly.Yail.YAIL_SPACER + argument1\n + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code += Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text \" + mode.type\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code += Blockly.Yail.YAIL_DOUBLE_QUOTE + mode.blockName\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [code, mode.order];\nprocess.env.PATH = \"/usr/local/share/term\";\n};\n\nBlockly.Yail.text_contains.OPERATORS = {\n 'CONTAINS': {\n operator: 'string-contains',\n blockName: 'string contains',\n order: Blockly.Yail.ORDER_ATOMIC,\n type: 'text'\n },\n 'CONTAINS_ANY': {\n operator: 'string-contains-any',\n blockName: 'string contains any',\n order: Blockly.Yail.ORDER_ATOMIC,\n type: 'list'\n },\n 'CONTAINS_ALL': {\n operator: 'string-contains-all',\n blockName: 'string contains all',\n order: Blockly.Yail.ORDER_ATOMIC,\n type: 'list'\n }\n};\n\nBlockly.Yail['text_split'] = function() {\n // String split operations.\n // Note that the type of arg2 might be text or list, depending on the dropdown selection\n var mode = this.getFieldValue('OP');\n var tuple = Blockly.Yail.text_split.OPERATORS[mode];\n var operator1 = tuple[0];\n \"git_sha\": \"7fa8b09a11f77b964e8e4168f18a6f3b\",\n var operator2 = tuple[1];\n var order = tuple[2];\n var arg2Type = tuple[3];\n var argument0 = Blockly.Yail.valueToCode(this, 'TEXT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var argument1 = Blockly.Yail.valueToCode(this, 'AT', Blockly.Yail.ORDER_NONE) || 1;\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + operator1\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument0 + Blockly.Yail.YAIL_SPACER + argument1\n + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text\" + Blockly.Yail.YAIL_SPACER + arg2Type\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + operator2\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, order ];\n};\n\nBlockly.Yail['text_split'].OPERATORS = {\n SPLITATFIRST : [ 'string-split-at-first', 'split at first',\n Blockly.Yail.ORDER_ATOMIC, 'text' ],\n SPLITATFIRSTOFANY : [ 'string-split-at-first-of-any',\n 'split at first of any', Blockly.Yail.ORDER_ATOMIC, 'list' ],\n SPLIT : [ 'string-split', 'split', Blockly.Yail.ORDER_ATOMIC, 'text' ],\n SPLITATANY : [ 'string-split-at-any', 'split at any', Blockly.Yail.ORDER_ATOMIC, 'list' ]\n};\n\nBlockly.Yail['text_split_at_spaces'] = function() {\n // split at spaces\n var argument = Blockly.Yail.valueToCode(this, 'TEXT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"string-split-at-spaces\"\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text\"\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"split at spaces\"\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, Blockly.Yail.ORDER_ATOMIC ];\n};\n\nBlockly.Yail['text_segment'] = function() {\n // Create string segment\n var argument0 = Blockly.Yail.valueToCode(this, 'TEXT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var argument1 = Blockly.Yail.valueToCode(this, 'START', Blockly.Yail.ORDER_NONE) || 1;\n var argument2 = Blockly.Yail.valueToCode(this, 'LENGTH', Blockly.Yail.ORDER_NONE) || 1;\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"string-substring\"\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument0 + Blockly.Yail.YAIL_SPACER + argument1\n + Blockly.Yail.YAIL_SPACER + argument2\n + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text number number\"\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"segment\"\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, Blockly.Yail.ORDER_ATOMIC ];\n};\n\nBlockly.Yail['text_replace_all'] = function() {\n // String replace with segment\n var argument0 = Blockly.Yail.valueToCode(this, 'TEXT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var argument1 = Blockly.Yail.valueToCode(this, 'SEGMENT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var argument2 = Blockly.Yail.valueToCode(this, 'REPLACEMENT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"string-replace-all\"\n + Blockly.Yail.YAIL_SPACER;\n // maintainer rbrown\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument0 + Blockly.Yail.YAIL_SPACER + argument1\n + Blockly.Yail.YAIL_SPACER + argument2\n + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text text text\"\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"replace all\"\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, Blockly.Yail.ORDER_ATOMIC ];\n};\n\nBlockly.Yail['obfuscated_text'] = function() {\n // Deobfuscate the TEXT input argument\n var setupObfuscation = function(input, confounder) {\n // The algorithm below is also implemented in scheme in runtime.scm\n // If you change it here, you have to change it there!\n // Note: This algorithm is like xor, if applied to its output\n // it regenerates it input.\n var acc = [];\n // First make sure the confounder is long enough...\n while (confounder.length < input.length) {\n confounder += confounder;\n }\n for (var i = 0; i < input.length; i++) {\n var c = (input.charCodeAt(i) ^ confounder.charCodeAt(i)) & 0xFF;\n var b = (c ^ input.length - i) & 0xFF;\n var b2 = ((c >> 8) ^ i) & 0xFF;\n acc.push(String.fromCharCode((b2 << 8 | b) & 0xFF));\n }\n return acc.join('');\n }\n var input = this.getFieldValue('TEXT');\n var argument = Blockly.Yail.quote_(setupObfuscation(input, this.confounder));\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"text-deobfuscate\"\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument + Blockly.Yail.YAIL_SPACER\n + Blockly.Yail.quote_(this.confounder) + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text text\"\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"deobfuscate text\"\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, Blockly.Yail.ORDER_ATOMIC ];\n};\n\nBlockly.Yail['text_is_string'] = function() {\n // Check if the argument is a string\n var argument0 = Blockly.Yail.valueToCode(this, 'ITEM', Blockly.Yail.ORDER_NONE) || Blockly.Yail.YAIL_FALSE;\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"string?\" + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER;\n code = code + argument0;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE + Blockly.Yail.YAIL_OPEN_COMBINATION;\n code = code + \"any\" + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"is a string?\" + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [ code, Blockly.Yail.ORDER_ATOMIC ];\n};\n\nBlockly.Yail['text_reverse'] = function () {\n // String reverse.\n var argument = Blockly.Yail.valueToCode(this, 'VALUE', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + \"string-reverse\"\n + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION\n + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER\n + argument + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE\n + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text\"\n + Blockly.Yail.YAIL_CLOSE_COMBINATION + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"reverse\"\n + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n return [code, Blockly.Yail.ORDER_ATOMIC];\n};\n\nBlockly.Yail['text_replace_mappings'] = function () {\n // Replace all occurrences in mappings with their corresponding replacement\n var argument0 = Blockly.Yail.valueToCode(this, 'TEXT', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var argument1 = Blockly.Yail.valueToCode(this, 'MAPPINGS', Blockly.Yail.ORDER_NONE) || \"\\\"\\\"\";\n var mode = this.getFieldValue('OP');\n var mode_function = Blockly.Yail.text_replace_mappings.OPERATORS[mode];\n\n var code = Blockly.Yail.YAIL_CALL_YAIL_PRIMITIVE + mode_function + Blockly.Yail.YAIL_SPACER;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION + Blockly.Yail.YAIL_LIST_CONSTRUCTOR + Blockly.Yail.YAIL_SPACER;\n code = code + argument0 + Blockly.Yail.YAIL_SPACER;\n code = code + argument1 + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_QUOTE;\n code = code + Blockly.Yail.YAIL_OPEN_COMBINATION + \"text\" + Blockly.Yail.YAIL_SPACER;\n code = code + \"dictionary\" + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n code = code + Blockly.Yail.YAIL_SPACER + Blockly.Yail.YAIL_DOUBLE_QUOTE + \"replace with mappings\" + Blockly.Yail.YAIL_DOUBLE_QUOTE + Blockly.Yail.YAIL_CLOSE_COMBINATION;\n\n return [code, Blockly.Yail.ORDER_ATOMIC];\n};\n\nBlockly.Yail.text_replace_mappings.OPERATORS = {\n LONGEST_STRING_FIRST: \"string-replace-mappings-longest-string\",\n DICTIONARY_ORDER: \"string-replace-mappings-dictionary\"\n //EARLIEST_OCCURRENCE: \"string-replace-mappings-earliest-occurrence\"\n};\n", "spans": [{"label": "username", "value_type": "username", "context": "comment", "synthetic": true, "entity_id": "c-00001-cb719d54d3304184/e000", "surface_form_type": "username", "replacement": "sherrera", "start": 13243, "end": 13249, "value": "rbrown"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8526, "end": 8547, "value": "/usr/local/share/term"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 9350, "end": 9382, "value": "7fa8b09a11f77b964e8e4168f18a6f3b"}], "cluster_id": "c-00001-cb719d54d3304184", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00001-acd1fd5525a737db", "source": "codeparrot/github-code-clean", "repo": "augmify/AutoLabelUI", "license": "apache-2.0", "language": "Markdown", "path": "README.md", "text": "# AutoLabelUI \r\n\r\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AutoLabelUI-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2436) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.davidpizarro/autolabelui/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.davidpizarro/autolabelui) [![Android Gems](http://www.android-gems.com/badge/DavidPizarro/AutoLabelUI.svg?branch=master)](http://www.android-gems.com/lib/DavidPizarro/AutoLabelUI)\r\n\r\nAndroid library to place labels next to another. If there is not enough space for the next label, it will be added in a new line.\r\n\r\n![Example screenshot](art/screenshots_framed.png)\r\n\r\nTry out the sample application on [Google Play][1].\r\n\r\n\r\n \"AutoLabelUI\r\n\r\n\r\nDemo\r\n=========================\r\n\r\n![Example gif](art/demo.gif)\r\n\r\nIncluding in Your Project\r\n=========================\r\n\r\nLast version is 1.0.0\r\n\r\nJust add the following statement in your build.gradle\r\n\r\n compile 'com.github.davidpizarro:autolabelui:VERSION'\r\n \r\nYou may also add the library as an Android Library to your project. All the library files live in ```library```.\r\n\r\nUsage\r\n=====\r\n\r\nTo add the AutoLabelUI to your layout, add this to your xml\r\n```xml\r\n\r\n``` \r\n\r\nYou can add custom attributes in your xml to customize: drawables, colors, counters, background, behaviors...\r\n```xml\r\n\r\n\r\n \r\n```\r\n\r\nReview [attrs.xml][3] file to know the list of shapes ready to be used in the library.\r\n\r\n\r\nThis configuration can be also provided programmatically. You can use AutoLabelUI programatically, using the Builder class to set the settings and the desired functionalities:\r\n```java\r\nAutoLabelUI mAutoLabel = (AutoLabelUI) view.findViewById(R.id.label_view);\r\n\r\nAutoLabelUISettings autoLabelUISettings = new AutoLabelUISettings.Builder()\r\n .withMaxLabels(5)\r\n .withIconCross(R.drawable.cross)\r\n .withBackgroundColor(android.R.color.holo_blue_bright)\r\n .withLabelsClickables(false)\r\n .withShowCross(true)\r\n .withTextColor(android.R.color.holo_red_dark)\r\n .withTextSize(R.dimen.label_title_size)\r\n .build();\r\n\r\nmAutoLabel.setSettings(autoLabelUISettings);\r\n```\r\n\r\nYou can set/get values programatically:\r\n```java\r\nmAutoLabel.getBackgroundColor();\r\nmAutoLabel.getTextColor();\r\nmAutoLabel.getTextSize();\r\nmAutoLabel.isLabelsClickables();\r\nmAutoLabel.setTextColor(android.R.color.holo_red_dark);\r\nmAutoLabel.setMaxLabels(5);\r\n...\r\n```\r\n\r\nTo know when you have reached the limit of Labels to add, you will need to implement the `onLabelsCompleted` interface:\r\n```java\r\nmAutoLabel.setOnLabelsCompletedListener(new AutoLabelUI.OnLabelsCompletedListener() {\r\n @Override\r\n public void onLabelsCompleted() {\r\n Toast.makeText(getActivity(), \"Completed!\", Toast.LENGTH_SHORT).show();\r\n }\r\n});\r\n```\r\n\r\nTo know when you have deleted all Labels, you will need to implement the `onLabelsEmpty` interface:\r\n```java\r\nmAutoLabel.setOnLabelsEmptyListener(new AutoLabelUI.OnLabelsEmptyListener() {\r\n @Override\r\n public void onLabelsEmpty() {\r\n Toast.makeText(getActivity(), \"EMPTY!\", Toast.LENGTH_SHORT).show();\r\n }\r\n});\r\n```\r\n\r\nTo know when you have deleted a Label, you will need to implement the `onRemoveLabel` interface:\r\n```java\r\nmAutoLabel.setOnRemoveLabelListener(new AutoLabelUI.OnRemoveLabelListener() {\r\n @Override\r\n public void onRemoveLabel(View view, int position) {\r\n adapter.setItemSelected(position, false);\r\n }\r\n});\r\n```\r\n\r\nTo know when you have clicked a Label, you will need to implement the `onClickLabel` interface:\r\n```java\r\nmAutoLabel.setOnLabelClickListener(new AutoLabelUI.OnLabelClickListener() {\r\n @Override\r\n public void onClickLabel(View v) {\r\n Toast.makeText(getActivity(), ((Label) v).getText() , Toast.LENGTH_SHORT).show();\r\n }\r\n});\r\n```\r\n\r\nOr browse the [source code of the sample application][2] for a complete example of use.\r\n\r\nContribution\r\n============\r\n\r\n#### Pull requests are welcome!\r\n\r\nI'd like to improve this library with your help!\r\nIf you've fixed a bug or have a feature you've added, just create a pull request. Issues can be reported on the github issue tracker.\r\n\r\nAuthor\r\n-------\r\n\r\nDavid Pizarro (dpizarro89@gmail.com)\r\n\r\n\r\n \"Follow\r\n\r\n\r\n \"Follow\r\n\r\n\r\n \"Follow\r\n\r\n\r\n\r\nLicense\r\n-------\r\n\r\n Copyright 2015 David Pizarro\r\n\r\n Licensed under the Apache License, Version 2.0 (the \"License\");\r\n you may not use this file except in compliance with the License.\r\n You may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\n Unless required by applicable law or agreed to in writing, software\r\n distributed under the License is distributed on an \"AS IS\" BASIS,\r\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n See the License for the specific language governing permissions and\r\n limitations under the License.\r\n---\r\n\r\n[1]: https://play.google.com/store/apps/details?id=com.dpizarro.libraries.autolabelui\r\n[2]: https://github.com/DavidPizarro/AutoLabelUI/tree/master/app\r\n[3]: https://github.com/DavidPizarro/AutoLabelUI/blob/master/library/src/main/res/values/attrs.xml\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-cb719d54d3304184", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00000-293a8d9092d53907", "source": "codeparrot/github-code-clean", "repo": "zouyapeng/horizon-newtouch", "license": "apache-2.0", "language": "Python", "path": "openstack_dashboard/dashboards/admin/info/tabs.py", "text": "# Copyright 2012 Nebula, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom horizon import exceptions\nfrom horizon import tabs\nfrom openstack_dashboard.api import base\nfrom openstack_dashboard.api import cinder\nfrom openstack_dashboard.api import keystone\nfrom openstack_dashboard.api import neutron\nfrom openstack_dashboard.api import nova\nfrom openstack_dashboard.dashboards.admin.info import constants\nfrom openstack_dashboard.dashboards.admin.info import tables\n\n\nclass ServicesTab(tabs.TableTab):\n table_classes = (tables.ServicesTable,)\n name = _(\"Services\")\n slug = \"services\"\n template_name = constants.INFO_DETAIL_TEMPLATE_NAME\n\n def get_services_data(self):\n request = self.tab_group.request\n services = []\n for i, service in enumerate(request.user.service_catalog):\n service['id'] = i\n services.append(\n keystone.Service(service, request.user.services_region))\n return services\n\n\nclass NovaServicesTab(tabs.TableTab):\n table_classes = (tables.NovaServicesTable,)\n name = _(\"Compute Services\")\n slug = \"nova_services\"\n template_name = constants.INFO_DETAIL_TEMPLATE_NAME\n permissions = ('openstack.services.compute',)\n\n def get_nova_services_data(self):\n try:\n services = nova.service_list(self.tab_group.request)\n except Exception:\n msg = _('Unable to get nova services list.')\n exceptions.check_message([\"Connection\", \"refused\"], msg)\n exceptions.handle(self.request, msg)\n services = []\n return services\n\n\nclass CinderServicesTab(tabs.TableTab):\n table_classes = (tables.CinderServicesTable,)\n name = _(\"Block Storage Services\")\n slug = \"cinder_services\"\n template_name = constants.INFO_DETAIL_TEMPLATE_NAME\n permissions = ('openstack.services.volume',)\n\n def get_cinder_services_data(self):\n try:\n services = cinder.service_list(self.tab_group.request)\n except Exception:\n msg = _('Unable to get cinder services list.')\n exceptions.check_message([\"Connection\", \"refused\"], msg)\n exceptions.handle(self.request, msg)\n services = []\n return services\n\n\nclass NetworkAgentsTab(tabs.TableTab):\n table_classes = (tables.NetworkAgentsTable,)\n name = _(\"Network Agents\")\n slug = \"network_agents\"\n template_name = constants.INFO_DETAIL_TEMPLATE_NAME\n\n def allowed(self, request):\n try:\n return (base.is_service_enabled(request, 'network') and\n neutron.is_extension_supported(request, 'agent'))\n except Exception:\n exceptions.handle(request, _('Unable to get network agents info.'))\n return False\n\n def get_network_agents_data(self):\n try:\n agents = neutron.agent_list(self.tab_group.request)\n except Exception:\n msg = _('Unable to get network agents list.')\n exceptions.check_message([\"Connection\", \"refused\"], msg)\n exceptions.handle(self.request, msg)\n agents = []\n return agents\n\n\nclass SystemInfoTabs(tabs.TabGroup):\n slug = \"system_info\"\n tabs = (ServicesTab, NovaServicesTab, CinderServicesTab,\n NetworkAgentsTab)\n sticky = True\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-327ac96314d4e6e2", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-327ac96314d4e6e2/e001", "entity_type": "email", "value_type": "email", "canonical": "sonyataylor@gmail.com", "forms": {"literal": "sonyataylor@gmail.com"}, "replacement_canonical": "btyler@hotmail.com", "replacement_forms": {"literal": "btyler@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-bf91eca4bafcdf09", "source": "codeparrot/github-code-clean", "repo": "zouyapeng/horizon-newtouch", "license": "apache-2.0", "language": "HTML", "path": "openstack_dashboard/dashboards/project/access_and_security/templates/access_and_security/security_groups/_update.html", "text": "{% extends \"horizon/common/_modal_form.html\" %}\n{% load i18n %}\n{% load url from future %}\n\n{% block form_id %}update_security_group_form{% endblock %}\n{% block form_action %}{% url 'horizon:project:access_and_security:security_groups:update' security_group.id%}{% endblock %}\n\n{% block modal-header %}{% trans \"Edit Security Group\" %}{% endblock %}\n{% block modal_id %}update_security_group_modal{% endblock %}\n\n{% block modal-body %}\n
\n
\n {% include \"horizon/common/_form_fields.html\" %}\n
\n
\n
\n

{% trans \"Description\" %}:

\n

{% trans \"Security groups are sets of IP filter rules that are applied to the network settings for the VM. Edit the security group to add and change the rules.\" %}

\n
\nvar contact = \"sonyataylor@gmail.com\";\n{% endblock %}\n\n{% block modal-footer %}\n \n {% trans \"Cancel\" %}\n{% endblock %}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-327ac96314d4e6e2/e001", "surface_form_type": "literal", "replacement": "btyler@hotmail.com", "start": 803, "end": 824, "value": "sonyataylor@gmail.com"}], "hard_negatives": [], "cluster_id": "c-00000-327ac96314d4e6e2", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-ba4ad721d8d80d49", "source": "codeparrot/github-code-clean", "repo": "raul75/AlessioCoin", "license": "mit", "language": "TypeScript", "path": "src/qt/locale/bitcoin_da.ts", "text": "\n\n AboutDialog\n \n \n About AlessioCoin\n Om AlessioCoin\n \n \n \n <b>AlessioCoin</b> version\n <b>AlessioCoin</b> version\n \n \n \n Copyright © 2009-2014 The Bitcoin developers\nCopyright © 2012-2014 The NovaCoin developers\nCopyright © 2014 The BlackCoin developers\nCopyright © 2014 The AlessioCoin developers\n Copyright © 2009-2014 The Bitcoin developers\nCopyright © 2012-2014 The NovaCoin developers\nCopyright © 2014 The BlackCoin developers\nCopyright © 2014 The AlessioCoin developers\n \n \n \n \nThis is experimental software.\n\nDistributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.\n \nDette program er eksperimentelt.\n\nDet er gjort tilgængeligt under MIT/X11-softwarelicensen. Se den medfølgende fil "COPYING" eller http://www.opensource.org/licenses/mit-license.php.\n\nProduktet indeholder software, som er udviklet af OpenSSL Project til brug i OpenSSL Toolkit (http://www.openssl.org/). Kryptografisk software er skrevet af Eric Young (eay@cryptsoft.com), og UPnP-software er skrevet af Thomas Bernard.\n \n\n\n AddressBookPage\n \n \n Address Book\n Adressebog\n \n \n \n Double-click to edit address or label\n Dobbeltklik for at redigere adresse eller mærkat\n \n \n \n Create a new address\n Opret en ny adresse\n \n \n \n Copy the currently selected address to the system clipboard\n Kopier den valgte adresse til udklipsholder\n \n \n \n &New Address\n &Ny adresse\n \n \n \n These are your AlessioCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.\n Dette er dine AlessioCoin adresser til at modtage betalinger. Du ønsker måske at give en anden en til af hver afsender, så du kan holde styr på hvem der betaler dig.\n \n \n \n &Copy Address\n &Kopier adresse\n \n \n \n Show &QR Code\n Vis &QR kode\n \n \n \n Sign a message to prove you own a AlessioCoin address\n Signerer en meddelelse for at bevise du ejer en AlessioCoin adresse\n \n \n \n Sign &Message\n Signere & Besked\n \n \n \n Delete the currently selected address from the list\n Slet den markerede adresse fra listen\n \n \n \n Verify a message to ensure it was signed with a specified AlessioCoin address\n Bekræft en meddelelse for at sikre, den blev underskrevet med en specificeret AlessioCoin adresse\n \n \n \n &Verify Message\n Bekræft Meddelse\n \n \n \n &Delete\n &Slet\n \n \n \n Copy &Label\n Kopier mærkat\n \n \n \n &Edit\n Rediger\n \n \n \n Export Address Book Data\n Eksporter Adresse Bog\n \n \n \n Comma separated file (*.csv)\n Kommasepareret fil (*.csv)\n \n \n \n Error exporting\n Fejl ved eksportering\n \n \n \n Could not write to file %1.\n Kunne ikke skrive til fil% 1.\n \n\n\n AddressTableModel\n \n \n Label\n Mærkat\n \n \n \n Address\n Adresse\n \n \n \n (no label)\n (ingen mærkat)\n \n\n\n AskPassphraseDialog\n \n \n Passphrase Dialog\n Adgangskodedialog\n \n \n \n Enter passphrase\n Indtast adgangskode\n \n \n \n New passphrase\n Ny adgangskode\n \n \n \n Repeat new passphrase\n Gentag ny adgangskode\n \n \n \n Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.\n Deaktivere trivielle sendmoney når OS konto er kompromitteret. Giver ingen reel sikkerhed.\n \n \n \n For staking only\n Kun til renteberegning\n \n \n \n Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.\n Indtast den nye adgangskode til tegnebogen.<br/>Brug venligst en adgangskode på <b>10 eller flere tilfældige tegn</b> eller <b>otte eller flere ord</b>.\n \n \n \n Encrypt wallet\n Krypter tegnebog\n \n \n \n This operation needs your wallet passphrase to unlock the wallet.\n Denne funktion har brug for din tegnebogs adgangskode for at låse tegnebogen op.\n \n \n \n Unlock wallet\n Lås tegnebog op\n \n \n \n This operation needs your wallet passphrase to decrypt the wallet.\n Denne funktion har brug for din tegnebogs adgangskode for at dekryptere tegnebogen.\n \n \n \n Decrypt wallet\n Dekrypter tegnebog\n \n \n \n Change passphrase\n Skift adgangskode\n \n \n \n Enter the old and new passphrase to the wallet.\n Indtast den gamle og den nye adgangskode til tegnebogen.\n \n \n \n Confirm wallet encryption\n Bekræft tegnebogskryptering\n \n \n \n Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!\n Advarsel: Hvis du krypterer din tegnebog og mister din adgangskode, vil du <b> miste alle dine mønter </ b>!\n \n \n \n Are you sure you wish to encrypt your wallet?\n Er du sikker på, at du ønsker at kryptere din tegnebog?\n \n \n \n IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.\n VIGTIGT: Enhver tidligere sikkerhedskopi, som du har lavet af tegnebogsfilen, bør blive erstattet af den nyligt genererede, krypterede tegnebogsfil. Af sikkerhedsmæssige årsager vil tidligere sikkerhedskopier af den ikke-krypterede tegnebogsfil blive ubrugelig i det øjeblik, du starter med at anvende den nye, krypterede tegnebog.\n \n \n \n \n Warning: The Caps Lock key is on!\n Advarsel: Caps Lock-tasten er aktiveret!\n \n \n \n \n Wallet encrypted\n Tegnebog krypteret\n \n \n \n AlessioCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.\n AlessioCoin lukker nu for at afslutte krypteringen. Husk at en krypteret tegnebog ikke fuldt ud beskytter dine mønter mod at blive stjålet af malware som har inficeret din computer.\n \n \n \n \n \n \n Wallet encryption failed\n Tegnebogskryptering mislykkedes\n \n \n \n Wallet encryption failed due to an internal error. Your wallet was not encrypted.\n Tegnebogskryptering mislykkedes på grund af en intern fejl. Din tegnebog blev ikke krypteret.\n \n \n \n \n The supplied passphrases do not match.\n De angivne adgangskoder stemmer ikke overens.\n \n \n \n Wallet unlock failed\n Tegnebogsoplåsning mislykkedes\n \n \n \n \n \n The passphrase entered for the wallet decryption was incorrect.\n Den angivne adgangskode for tegnebogsdekrypteringen er forkert.\n \n \n \n Wallet decryption failed\n Tegnebogsdekryptering mislykkedes\n \n \n \n Wallet passphrase was successfully changed.\n Tegnebogens adgangskode blev ændret.\n \n\n\n BitcoinGUI\n \n \n Sign &message...\n Underskriv besked...\n \n \n \n Synchronizing with network...\n Synkroniserer med netværk...\n \n \n \n &Overview\n &Oversigt\n \n \n \n Show general overview of wallet\n Vis generel oversigt over tegnebog\n \n \n \n &Transactions\n &Transaktioner\n \n \n \n Browse transaction history\n Gennemse transaktionshistorik\n \n \n \n &Address Book\n &Adressebog\n \n \n \n Edit the list of stored addresses and labels\n Redigere listen over gemte adresser og etiketter\n \n \n \n &Receive coins\n &Modtag mønter\n \n \n \n Show the list of addresses for receiving payments\n Vis listen over adresser for modtagne betalinger\n \n \n const secret = $(API_KEY);\n \n &Send coins\n &Send mønter\n \n \n \n E&xit\n Luk\n \n \n \n Quit application\n Afslut program\n \n \n \n Show information about AlessioCoin\n Vis oplysninger om AlessioCoin\n \n \n \n About &Qt\n Om Qt\n \n \n \n Show information about Qt\n Vis informationer om Qt\n \n \n \n &Options...\n &Indstillinger...\n \n \n \n &Encrypt Wallet...\n Krypter tegnebog...\n \n \n \n &Backup Wallet...\n Sikkerhedskopier tegnebog...\n \n \n \n &Change Passphrase...\n Skift adgangskode...\n \n \n \n ~%n block(s) remaining\n ~%n blok resterer~%n blokke resterende\n \n \n \n Downloaded %1 of %2 blocks of transaction history (%3% done).\n Overført %1 af %2 blokke af transaktions historie (%3% færdig).\n \n \n \n &Export...\n &Eksporter...\n \n \n \n Send coins to a AlessioCoin address\n Send mønter til en AlessioCoin adresse\n \n \n \n Modify configuration options for AlessioCoin\n Ændre indstillingsmuligheder for AlessioCoin\n \n \n \n Export the data in the current tab to a file\n Eksportere data i den aktuelle fane til en fil\n \n \n \n Encrypt or decrypt wallet\n Kryptere eller dekryptere tegnebog\n \n \n \n Backup wallet to another location\n Lav sikkerhedskopi af tegnebogen til et andet sted\n \n \n \n Change the passphrase used for wallet encryption\n Skift adgangskode anvendt til tegnebogskryptering\n \n \n \n &Debug window\n Fejlsøgningsvindue\n \n \n \n Open debugging and diagnostic console\n Åbn fejlsøgnings- og diagnosticeringskonsollen\n \n \n \n &Verify message...\n Verificér besked...\n \n \n \n AlessioCoin\n AlessioCoin\n \n \n \n Wallet\n Tegnebog\n \n \n \n &About AlessioCoin\n &Om AlessioCoin\n \n \n \n &Show / Hide\n Vis / skjul\n \n \n \n Unlock wallet\n Lås tegnebog\n \n \n \n &Lock Wallet\n &Lås tegnebog\n \n \n \n Lock wallet\n Lås tegnebog\n \n \n \n &File\n Fil\n \n \n \n &Settings\n Indstillinger\n \n \n \n &Help\n Hjælp\n \n \n \n Tabs toolbar\n Faneværktøjslinje\n \n \n \n Actions toolbar\n Fanværktøjslinje\n \n \n \n \n [testnet]\n [testnetværk]\n \n \n \n \n AlessioCoin client\n AlessioCoin klient\n \n \n \n %n active connection(s) to AlessioCoin network\n %n aktiv forbindelse til AlessioCoin netværk%n aktive forbindelser til AlessioCoin netværk\n \n \n \n Downloaded %1 blocks of transaction history.\n Downloadet %1 blokke af transaktions historie.\n \n \n \n Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3\n Renter.<br> Din andel er% 1 <br> Netværkets andel er% 2 <br> Forventet tid til at modtage rente %3\n \n \n \n Not staking because wallet is locked\n Ingen rente fordi tegnebog er låst\n \n \n \n Not staking because wallet is offline\n Ingen rente fordi tegnebog er offline\n \n \n \n Not staking because wallet is syncing\n Ingen rente fordi tegnebog er ved at synkronisere\n \n \n \n Not staking because you don't have mature coins\n Ingen rente fordi der ingen modne mønter eksistere \n \n \n \n %n second(s) ago\n %n sekund siden%n sekunder siden\n \n \n \n &Unlock Wallet...\n Lås tegnebog op\n \n \n \n %n minute(s) ago\n %n minut siden%n minutter siden\n \n \n \n %n hour(s) ago\n %n time siden%n timer siden\n \n \n \n %n day(s) ago\n %n dag siden%n dage siden\n \n \n \n Up to date\n Opdateret\n \n \n \n Catching up...\n Indhenter...\n \n \n \n Last received block was generated %1.\n Sidst modtagne blok blev genereret %1.\n \n \n \n This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?\n Denne transaktion er over grænsen størrelse. Du kan stadig sende det for et gebyr på %1, der går til de noder, der behandler din transaktion og hjælper med at støtte netværket. Ønsker du at betale gebyret?\n \n \n \n Confirm transaction fee\n Bekræft transaktionsgebyr\n \n \n \n Sent transaction\n Afsendt transaktion\n \n \n \n Incoming transaction\n Indgående transaktion\n \n \n \n Date: %1\nAmount: %2\nType: %3\nAddress: %4\n\n Dato: %1\nBeløb: %2\nType: %3\nAdresse: %4\n\n \n \n \n \n URI handling\n URI håndtering\n \n \n \n \n URI can not be parsed! This can be caused by an invalid AlessioCoin address or malformed URI parameters.\n URI kan ikke tolkes! Dette kan skyldes en ugyldig AlessioCoin adresse eller misdannede URI parametre.\n \n \n \n Wallet is <b>encrypted</b> and currently <b>unlocked</b>\n Tegnebog er <b>krypteret</b> og i øjeblikket <b>ulåst</b>\n \n \n \n Wallet is <b>encrypted</b> and currently <b>locked</b>\n Tegnebog er <b>krypteret</b> og i øjeblikket <b>låst</b>\n \n \n \n Backup Wallet\n Sikkerhedskopier Tegnebog\n \n \n \n Wallet Data (*.dat)\n Tegnebogsdata (*.dat)\n \n \n \n Backup Failed\n Sikkerhedskopiering Mislykkedes\n \n \n \n There was an error trying to save the wallet data to the new location.\n Der opstod en fejl under forsøg på at gemme data i tegnebogen til den nye placering.\n \n \n \n %n second(s)\n %n sekund%n sekunder\n \n \n \n %n minute(s)\n %n minut%n minutter\n \n \n \n %n hour(s)\n %n time(r)%n time(r)\n \n \n \n %n day(s)\n %n dag(e)%n dag(e)\n \n \n \n Not staking\n Ingen rente\n \n \n \n A fatal error occurred. AlessioCoin can no longer continue safely and will quit.\n Der opstod en fejl under forsøg på at gemme dataene i tegnebogen til den nye placering.\n \n\n\n ClientModel\n \n \n Network Alert\n Netværksadvarsel\n \n\n\n CoinControlDialog\n \n \n Coin Control\n Mønt Kontrol\n \n \n \n Quantity:\n Antal:\n \n \n \n Bytes:\n Bytes:\n \n \n \n Amount:\n Beløb:\n \n \n \n Priority:\n Prioritet:\n \n \n \n Fee:\n Gebyr:\n \n \n \n Low Output:\n Lav Udgangseffekt:\n \n \n \n no\n nej\n \n \n \n After Fee:\n Efter Gebyr:\n \n \n \n Change:\n Ændre:\n \n \n \n (un)select all\n (fra)vælg alle\n \n \n \n Tree mode\n Træ tilstand\n \n \n \n List mode\n Liste tilstand\n \n \n \n Amount\n Beløb\n \n \n \n Label\n Mærkat\n \n \n \n Address\n Adresse\n \n \n \n Date\n Dato\n \n \n \n Confirmations\n Bekræftelser\n \n \n \n Confirmed\n Bekræftet\n \n \n \n Priority\n Prioritet\n export const CONTENT_HASH = '2abe9e35c104221e13fdd910b0043dcb';\n \n \n \n Copy address\n Kopier adresse\n \n \n \n Copy label\n Kopier mærkat\n \n \n \n \n Copy amount\n Kopier beløb\n \n \n \n Copy transaction ID\n Kopier transaktionens ID\n \n \n \n Copy quantity\n Kopier antal\n \n \n \n Copy fee\n Kopier transkationsgebyr\n \n \n \n Copy after fee\n Kopier efter transkationsgebyr\n \n \n \n Copy bytes\n Kopier bytes\n \n \n \n Copy priority\n Kopier prioritet\n \n \n \n Copy low output\n Lav udgangseffekt\n \n \n \n Copy change\n Kopier ændring\n \n \n \n highest\n højeste\n \n \n \n high\n høj\n \n \n \n medium-high\n medium-høj\n \n \n \n medium\n medium\n \n \n \n low-medium\n lav-medium\n \n \n \n low\n lav\n \n \n \n lowest\n lavest\n \n \n \n DUST\n DUST\n \n \n \n yes\n ja\n \n \n \n This label turns red, if the transaction size is bigger than 10000 bytes.\n\n This means a fee of at least %1 per kb is required.\n\n Can vary +/- 1 Byte per input.\n Denne etiket bliver rød, hvis transaktionen størrelse er større end 10000 byte.\n \nDet betyder, at et gebyr på mindst %1 per kb er påkrævet.\n\nKan variere + / - 1 byte per indgang.\n \n \n \n Transactions with higher priority get more likely into a block.\n\nThis label turns red, if the priority is smaller than "medium".\n\n This means a fee of at least %1 per kb is required.\n Transaktioner med højere prioritet får mere sandsynligt en blok.\n \nDenne etiket bliver rød, hvis prioritet er mindre end "medium".\n \nDet betyder, at et gebyr på mindst %1 per kb er påkrævet.\n \n \n \n This label turns red, if any recipient receives an amount smaller than %1.\n\n This means a fee of at least %2 is required. \n\n Amounts below 0.546 times the minimum relay fee are shown as DUST.\n Denne etiket bliver rød, hvis nogen modtager et beløb, der er mindre end %1.\n \nDet betyder, at et gebyr på mindst %2 er påkrævet. \n \nBeløb under 0,546 gange det minimale gebyr er vist som DUST.\n \n \n \n This label turns red, if the change is smaller than %1.\n\n This means a fee of at least %2 is required.\n Denne etiket bliver rød, hvis ændringen er mindre end %1. \n \nDet betyder, at et gebyr på mindst %2 er påkrævet.\n \n \n \n \n (no label)\n (ingen mærkat)\n \n \n \n change from %1 (%2)\n skift fra %1 (%2)\n \n \n \n (change)\n (skift)\n \n\n\n EditAddressDialog\n \n \n Edit Address\n Rediger adresse\n \n \n \n &Label\n Mærkat\n \n \n \n The label associated with this address book entry\n Etiketten er forbundet med denne post i adressekartoteket\n \n \n \n &Address\n Adresse\n \n \n \n The address associated with this address book entry. This can only be modified for sending addresses.\n Adressen er forbundet med denne post i adressekartoteket. Dette kan kun ændres til sende adresser.\n \n \n \n New receiving address\n Ny modtagelsesadresse\n \n \n \n New sending address\n Ny afsendelsesadresse\n \n \n \n Edit receiving address\n Rediger modtagelsesadresse\n \n \n \n Edit sending address\n Rediger afsendelsesadresse\n \n \n \n The entered address "%1" is already in the address book.\n Den indtastede adresse "%1" er allerede i adressebogen.\n \n \n \n The entered address "%1" is not a valid AlessioCoin address.\n Den indtastede adresse "%1" er ikke en gyldig AlessioCoin adresse.\n \n \n \n Could not unlock wallet.\n Kunne ikke låse tegnebog op.\n \n \n \n New key generation failed.\n Ny nøglegenerering mislykkedes.\n \n\n\n GUIUtil::HelpMessageBox\n \n \n \n AlessioCoin-Qt\n AlessioCoin-Qt\n \n \n \n version\n version\n \n \n \n Usage:\n Anvendelse:\n \n \n \n command-line options\n Kommandolinjeparametrene\n \n \n \n UI options\n UI opsætning\n \n \n \n Set language, for example "de_DE" (default: system locale)\n Indstil sprog, for eksempel "de_DE" (standard: system locale)\n \n \n \n Start minimized\n Start minimeret\n \n \n \n Show splash screen on startup (default: 1)\n Vis splash skærm ved opstart (default: 1)\n \n\n\n OptionsDialog\n \n \n Options\n Indstillinger\n \n \n \n &Main\n Generelt\n \n \n \n Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.\n Valgfri transaktionsgebyr pr kB, som hjælper med at sikre dine transaktioner bliver behandlet hurtigt. De fleste transaktioner er 1 kB. Gebyr 0,01 anbefales.\n \n \n \n Pay transaction &fee\n Betal transaktionsgebyr\n \n \n \n Reserved amount does not participate in staking and is therefore spendable at any time.\n Reserveret beløb deltager ikke i forrentning og er derfor tilrådighed til enhver tid.\n \n \n \n Reserve\n Reserve\n \n \n \n Automatically start AlessioCoin after logging in to the system.\n Automatisk start AlessioCoin efter at have logget ind på systemet.\n \n \n \n &Start AlessioCoin on system login\n &Start AlessioCoin ved systems login\n \n \n \n Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.\n Frigør blok og adressedatabaser ved lukning. Det betyder, at de kan flyttes til et anden data-bibliotek, men det sinker lukning. Tegnebogen er altid frigjort.\n \n \n \n &Detach databases at shutdown\n &Frigør databaser ved lukning\n \n \n \n &Network\n Netværk\n \n \n \n Automatically open the AlessioCoin client port on the router. This only works when your router supports UPnP and it is enabled.\n Automatisk åbne AlessioCoin klient-port på routeren. Dette virker kun, når din router understøtter UPnP og er det er aktiveret.\n \n \n \n Map port using &UPnP\n Konfigurer port vha. UPnP\n \n \n \n Connect to the AlessioCoin network through a SOCKS proxy (e.g. when connecting through Tor).\n Opret forbindelse til AlessioCoin netværk via en SOCKS proxy (fx ved tilslutning gennem Tor).\n \n \n \n &Connect through SOCKS proxy:\n &Tilslut gennem SOCKS proxy:\n \n \n \n Proxy &IP:\n Proxy-IP:\n \n \n \n IP address of the proxy (e.g. 127.0.0.1)\n IP-adressen på proxy (f.eks 127.0.0.1)\n \n \n \n &Port:\n Port:\n \n \n \n Port of the proxy (e.g. 9050)\n Porten på proxyen (f.eks. 9050)\n \n \n \n SOCKS &Version:\n SOCKS-version\n \n \n \n SOCKS version of the proxy (e.g. 5)\n SOCKS-version af proxyen (f.eks. 5)\n \n \n \n &Window\n Vindue\n \n \n \n Show only a tray icon after minimizing the window.\n Vis kun et statusikon efter minimering af vinduet.\n \n \n \n &Minimize to the tray instead of the taskbar\n Minimer til statusfeltet i stedet for proceslinjen\n \n \n \n Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.\n Minimer i stedet for at afslutte programmet, når vinduet lukkes. Når denne indstilling er valgt, vil programmet kun blive lukket, når du har valgt Afslut i menuen.\n \n \n \n M&inimize on close\n Minimer ved lukning\n \n \n \n &Display\n Visning\n \n \n \n User Interface &language:\n Brugergrænsefladesprog:\n \n \n \n The user interface language can be set here. This setting will take effect after restarting AlessioCoin.\n Sproget i brugergrænsefladen kan indstilles her. Denne indstilling vil træde i kraft efter genstart af AlessioCoin tegnebog.\n \n \n \n &Unit to show amounts in:\n Enhed at vise beløb i:\n \n \n \n Choose the default subdivision unit to show in the interface and when sending coins.\n Vælg den standard underopdelingsenhed, som skal vises i brugergrænsefladen og ved afsendelse af bitcoins.\n \n \n \n Whether to show AlessioCoin addresses in the transaction list or not.\n Få vist AlessioCoin adresser på listen over transaktioner eller ej.\n \n \n \n &Display addresses in transaction list\n Vis adresser i transaktionsliste\n \n \n \n Whether to show coin control features or not.\n Vis mønt kontrol funktioner eller ej.\n \n \n \n Display coin &control features (experts only!)\n Vis mønt & kontrol funktioner (kun for eksperter!)\n \n \n \n &OK\n OK\n \n \n \n &Cancel\n Annuller\n \n \n \n &Apply\n &Anvend\n \n \n \n default\n standard\n \n \n \n \n Warning\n Advarsel\n \n \n \n \n This setting will take effect after restarting AlessioCoin.\n Denne indstilling vil træde i kraft efter genstart af AlessioCoin.\n \n \n \n The supplied proxy address is invalid.\n Ugyldig proxy-adresse\n \n\n\n OverviewPage\n \n \n Form\n Formular\n \n \n \n \n The displayed information may be out of date. Your wallet automatically synchronizes with the AlessioCoin network after a connection is established, but this process has not completed yet.\n De viste oplysninger kan være forældet. Din tegnebog synkroniserer automatisk med AlessioCoin netværket efter en forbindelse er etableret, men denne proces er ikke afsluttet endnu.\n \n \n \n Stake:\n Rente:\n \n \n \n Unconfirmed:\n Ubekræftede:\n \n \n \n Wallet\n Tegnebog\n \n \n \n Spendable:\n Brugbar:\n \n \n \n Your current spendable balance\n Din nuværende tilgængelige saldo\n \n \n \n Immature:\n Umodne:\n \n \n \n Mined balance that has not yet matured\n Udvunden saldo, som endnu ikke er modnet\n \n \n \n Total:\n Total:\n \n \n \n Your current total balance\n Din nuværende totale saldo\n \n \n \n <b>Recent transactions</b>\n <b>Nyeste transaktioner</b>\n \n \n \n Total of transactions that have yet to be confirmed, and do not yet count toward the current balance\n Summen af ​​transaktioner, der endnu mangler at blive bekræftet, og ikke tæller mod den nuværende balance\n \n \n \n Total of coins that was staked, and do not yet count toward the current balance\n I alt mønter, der bliver berentet, og endnu ikke tæller mod den nuværende balance\n \n \n \n \n out of sync\n ikke synkroniseret\n \n\n\n QRCodeDialog\n \n \n QR Code Dialog\n QR Kode Dialog\n \n \n \n Request Payment\n Betalingsanmodning\n \n \n \n Amount:\n Antal:\n \n \n \n Label:\n Label:\n \n \n \n Message:\n Besked:\n \n \n \n &Save As...\n &Gem Som...\n \n \n \n Error encoding URI into QR Code.\n Fejl kode URI i QR kode.\n \n \n \n The entered amount is invalid, please check.\n Det indtastede beløb er ugyldig, venligst tjek igen.\n \n \n \n Resulting URI too long, try to reduce the text for label / message.\n Resulterende URI for lang, prøv at reducere teksten til etiketten / besked.\n \n \n \n Save QR Code\n Gem QR kode\n \n \n \n PNG Images (*.png)\n PNG billede (*.png)\n \n\n\n RPCConsole\n \n \n Client name\n Klientnavn\n \n \n \n \n \n \n \n \n \n \n \n \n N/A\n N/A\n \n \n \n Client version\n Klientversion\n \n \n \n &Information\n Information\n \n \n \n Using OpenSSL version\n Anvender OpenSSL-version\n \n \n \n Startup time\n Opstartstid\n \n \n \n Network\n Netværk\n \n \n \n Number of connections\n Antal forbindelser\n \n \n \n On testnet\n På testnet\n \n \n \n Block chain\n Blokkæde\n \n \n \n Current number of blocks\n Nuværende antal blokke\n \n \n \n Estimated total blocks\n Estimeret antal blokke\n \n \n \n Last block time\n Tidsstempel for seneste blok\n \n \n \n &Open\n Åbn\n \n \n \n Command-line options\n Kommandolinjeparametrene\n \n \n \n Show the AlessioCoin-Qt help message to get a list with possible AlessioCoin command-line options.\n Vis AlessioCoin-Qt hjælpe besked for at få en liste med mulige AlessioCoin kommandolinjeparametre.\n \n \n \n &Show\n &Vis\n \n \n \n &Console\n Konsol\n \n \n \n Build date\n Byggedato\n \n \n \n AlessioCoin - Debug window\n AlessioCoin - Debug vindue\n \n \n \n AlessioCoin Core\n AlessioCoin Kerne\n \n \n \n Debug log file\n Fejlsøgningslogfil\n \n \n \n Open the AlessioCoin debug log file from the current data directory. This can take a few seconds for large log files.\n Åbn AlessioCoin debug logfilen fra den nuværende data mappe. Dette kan tage et par sekunder for store logfiler.\n \n \n \n Clear console\n Ryd konsol\n \n \n \n Welcome to the AlessioCoin RPC console.\n Velkommen til AlessioCoin RPC-konsol.\n \n \n \n Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.\n Brug op og ned-piletasterne til at navigere historikken og <b>Ctrl-L</b> til at rydde skærmen.\n \n \n \n Type <b>help</b> for an overview of available commands.\n Tast <b>help</b> for en oversigt over de tilgængelige kommandoer.\n \n\n\n SendCoinsDialog\n \n \n \n \n \n \n \n \n \n Send Coins\n Send bitcoins\n \n \n \n Coin Control Features\n Mønt Kontrol Egenskaber\n \n \n \n Inputs...\n Input ...\n \n \n \n automatically selected\n Automatisk valgt\n \n \n \n Insufficient funds!\n Utilstrækkelig midler!\n \n \n \n Quantity:\n Antal:\n \n \n \n \n 0\n 0\n \n \n \n Bytes:\n Bytes:\n \n \n \n Amount:\n Beløb:\n \n \n \n \n \n \n 0.00 CAM\n 123.456 CAM {0.00 ?}\n \n \n \n Priority:\n Prioritet:\n \n \n \n medium\n medium\n \n \n \n Fee:\n Gebyr\n \n \n \n Low Output:\n Lav udgangseffekt\n \n \n \n no\n nej\n \n \n \n After Fee:\n Efter gebyr\n \n \n \n Change\n Skift\n \n \n \n custom change address\n Ændre adresse\n \n \n \n Send to multiple recipients at once\n Send til flere modtagere på en gang\n \n \n \n Add &Recipient\n Tilføj modtager\n \n \n \n Remove all transaction fields\n Fjern alle transaktions omkostnings felter \n \n \n \n Clear &All\n Ryd alle\n \n \n \n Balance:\n Saldo:\n \n \n \n 123.456 CAM\n 123.456 CAM\n \n \n \n Confirm the send action\n Bekræft afsendelsen\n \n \n \n S&end\n Afsend\n \n \n \n Enter a AlessioCoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n Indtast en AlessioCoin-adresse (f.eks SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n \n \n \n Copy quantity\n Kopier antal\n \n \n \n Copy amount\n Kopier beløb\n \n \n \n Copy fee\n Kopier transkationsgebyr\n \n \n \n Copy after fee\n Kopier efter transkationsgebyr\n \n \n \n Copy bytes\n Kopier bytes\n \n \n \n Copy priority\n Kopier prioritet\n \n \n \n Copy low output\n Kopier lav produktion\n \n \n \n Copy change\n Kopier forandring\n \n \n \n <b>%1</b> to %2 (%3)\n <b>%1</b> til %2 (%3)\n \n \n \n Confirm send coins\n Bekræft afsendelse af bitcoins\n \n \n \n Are you sure you want to send %1?\n Er du sikker på du vil sende% 1?\n \n \n \n and \n og\n \n \n \n The recipient address is not valid, please recheck.\n Modtagerens adresse er ikke gyldig. Tjek venligst adressen igen.\n \n \n \n The amount to pay must be larger than 0.\n Beløbet til betaling skal være større end 0.\n \n \n \n The amount exceeds your balance.\n Beløbet overstiger din saldo.\n \n \n \n The total exceeds your balance when the %1 transaction fee is included.\n Totalen overstiger din saldo, når %1 transaktionsgebyr er inkluderet.\n \n \n \n Duplicate address found, can only send to each address once per send operation.\n Duplikeret adresse fundet. Du kan kun sende til hver adresse en gang pr. afsendelse.\n \n \n \n Error: Transaction creation failed.\n Fejl: Transaktion oprettelse mislykkedes.\n \n \n \n Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.\n Fejl: Transaktionen blev afvist. Dette kan ske, hvis nogle af mønterne i din tegnebog allerede er blevet brugt, som hvis du brugte en kopi af wallet.dat og mønterne blev brugt i kopien, men ikke markeret som brugt her.\n \n \n \n WARNING: Invalid AlessioCoin address\n ADVARSEL: Ugyldig AlessioCoin adresse\n \n \n \n (no label)\n (ingen mærkat)\n \n \n \n WARNING: unknown change address\n ADVARSEL: ukendt adresse forandring\n \n\n\n SendCoinsEntry\n \n \n Form\n Form\n \n \n \n A&mount:\n Beløb:\n \n \n \n Pay &To:\n Betal til:\n \n \n \n \n Enter a label for this address to add it to your address book\n Indtast en mærkat for denne adresse for at føje den til din adressebog\n \n \n \n &Label:\n Mærkat:\n \n \n \n The address to send the payment to (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n Adressen til at sende betalingen til (f.eks SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n \n \n \n Choose address from address book\n Vælg adresse fra adressebogen\n \n \n \n Alt+A\n Alt+A\n \n \n \n Paste address from clipboard\n Indsæt adresse fra udklipsholderen\n \n \n \n Alt+P\n Alt+P\n \n \n \n Remove this recipient\n Fjern denne modtager\n \n \n \n Enter a AlessioCoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n Indtast en AlessioCoin-adresse (f.eks SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n \n\n\n SignVerifyMessageDialog\n \n \n Signatures - Sign / Verify a Message\n Signature - Underskriv/verificér en besked\n \n \n \n \n &Sign Message\n Underskriv besked\n \n \n \n You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.\n Du kan underskrive beskeder med dine Bitcoin-adresser for at bevise, at de tilhører dig. Pas på ikke at underskrive noget vagt, da phisingangreb kan narre dig til at overdrage din identitet. Underskriv kun fuldt detaljerede udsagn, du er enig i.\n \n \n \n The address to sign the message with (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n Adresse til at underskrive meddelelsen med (f.eks SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n \n \n \n \n Choose an address from the address book\n Vælg en adresse fra adressebogen\n \n \n \n \n Alt+A\n Alt+A\n \n \n \n Paste address from clipboard\n Indsæt adresse fra udklipsholderen\n \n \n \n Alt+P\n Alt+P\n \n \n \n Enter the message you want to sign here\n Indtast beskeden, du ønsker at underskrive\n \n \n \n Copy the current signature to the system clipboard\n Kopier den nuværende underskrift til systemets udklipsholder\n \n \n \n Sign the message to prove you own this AlessioCoin address\n Underskriv brevet for at bevise du ejer denne AlessioCoin adresse\n \n \n \n Reset all sign message fields\n Nulstil alle "underskriv besked"-felter\n \n \n \n \n Clear &All\n Ryd alle\n \n \n \n \n &Verify Message\n Verificér besked\n \n \n \n Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.\n Indtast den underskrevne adresse, beskeden (inkluder linjeskift, mellemrum mv. nøjagtigt, som de fremgår) og underskriften for at verificére beskeden. Vær forsigtig med ikke at lægge mere i underskriften end besked selv, så du undgår at blive narret af et man-in-the-middle-angreb.\n \n \n \n The address the message was signed with (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n Adressen meddelelse blev underskrevet med (f.eks SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n \n \n \n Verify the message to ensure it was signed with the specified AlessioCoin address\n Kontroller meddelelsen for at sikre, at den blev indgået med den angivne AlessioCoin adresse\n \n \n \n Reset all verify message fields\n Nulstil alle "verificér besked"-felter\n \n \n \n \n Enter a AlessioCoin address (e.g. SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n Indtast en AlessioCoin-adresse (f.eks SXywGBZBowrppUwwNUo1GCRDTibzJi7g2M)\n \n \n \n Click "Sign Message" to generate signature\n Klik "Underskriv besked" for at generere underskriften\n \n \n \n Enter AlessioCoin signature\n Indtast AlessioCoin underskrift\n \n \n \n \n The entered address is invalid.\n Den indtastede adresse er ugyldig.\n \n \n \n \n \n \n Please check the address and try again.\n Tjek venligst adressen, og forsøg igen.\n \n \n \n \n The entered address does not refer to a key.\n Den indtastede adresse henviser ikke til en nøgle.\n \n \n \n Wallet unlock was cancelled.\n Tegnebogsoplåsning annulleret.\n \n \n \n Private key for the entered address is not available.\n Den private nøgle for den indtastede adresse er ikke tilgængelig.\n \n \n \n Message signing failed.\n Underskrivning af besked mislykkedes.\n \n \n \n Message signed.\n Besked underskrevet.\n \n \n \n The signature could not be decoded.\n Underskriften kunne ikke afkodes.\n \n \n \n \n Please check the signature and try again.\n Tjek venligst underskriften, og forsøg igen.\n \n \n \n The signature did not match the message digest.\n Underskriften matcher ikke beskedens indhold.\n \n \n \n Message verification failed.\n Verificéring af besked mislykkedes.\n \n \n \n Message verified.\n Besked verificéret.\n \n\n\n TransactionDesc\n \n \n Open until %1\n Åben indtil %1\n \n \n \n Open for %n block(s)\n Åben for %n blokÅben for %n blok(ke)\n \n \n \n conflicted\n konflikt\n \n \n \n %1/offline\n %1/offline\n \n \n \n %1/unconfirmed\n %1/ubekræftet\n \n \n \n %1 confirmations\n %1 bekræftelser\n \n \n \n Status\n Status\n \n \n \n , broadcast through %n node(s)\n , transmitteret igennem %n knude(r), transmitteret igennem %n knude(r)\n \n \n \n Date\n Dato\n \n \n \n Source\n Kilde\n \n \n \n Generated\n Genereret\n \n \n \n \n From\n Fra\n \n \n \n \n \n To\n Til\n \n \n \n \n own address\n egen adresse\n \n \n \n label\n mærkat\n \n \n \n \n \n \n \n Credit\n Kredit\n \n \n \n matures in %n more block(s)\n modner efter yderligere %n blok(ke)modner efter yderligere %n blok(ke)\n \n \n \n not accepted\n ikke accepteret\n \n \n \n \n \n \n Debit\n Debet\n \n \n \n Transaction fee\n Transaktionsgebyr\n \n \n \n Net amount\n Nettobeløb\n \n \n \n Message\n Besked\n \n \n \n Comment\n Kommentar\n \n \n \n Transaction ID\n Transaktionens ID\n \n \n \n Generated coins must mature 510 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 Generet mønter skal modne 510 blokke, før de kan blive brugt. Når du genererede denne blok blev det transmitteret til netværket, der tilføjes til blokkæden. Hvis det mislykkes at komme ind i kæden, vil dens tilstand ændres til "ikke godkendt", og det vil ikke være brugbar. Dette kan lejlighedsvis ske, hvis en anden node genererer en blok et par sekunder efter din.\n \n \n \n Debug information\n Fejlsøgningsinformation\n \n \n \n Transaction\n Transaktion\n \n \n \n Inputs\n Input\n \n \n \n Amount\n Beløb\n \n \n \n true\n sand\n \n \n \n false\n falsk\n \n \n \n , has not been successfully broadcast yet\n , er ikke blevet transmitteret endnu\n \n \n \n unknown\n ukendt\n \n\n\n TransactionDescDialog\n \n \n Transaction details\n Transaktionsdetaljer\n \n \n \n This pane shows a detailed description of the transaction\n Denne rude viser en detaljeret beskrivelse af transaktionen\n \n\n\n TransactionTableModel\n \n \n Date\n Dato\n \n \n \n Type\n Type\n \n \n \n Address\n Adresse\n \n \n \n Amount\n Beløb\n \n \n \n Open until %1\n Åben indtil %1\n \n \n \n Confirmed (%1 confirmations)\n Bekræftet (%1 bekræftelser)\n \n \n \n Open for %n more block(s)\n Åben %n blok(ke) yderligereÅben %n blok(ke) yderligere\n \n \n \n Offline\n Offline\n \n \n \n Unconfirmed\n Ubekræftede\n \n \n \n Confirming (%1 of %2 recommended confirmations)\n Bekræftelse (% 1 af% 2 anbefalede bekræftelser)\n \n \n \n Conflicted\n Konflikt\n \n \n \n Immature (%1 confirmations, will be available after %2)\n Umodne (% 1 bekræftelser, vil være tilgængelige efter% 2)\n \n \n \n This block was not received by any other nodes and will probably not be accepted!\n Denne blok blev ikke modtaget af nogen andre knuder og vil formentlig ikke blive accepteret!\n \n \n \n Generated but not accepted\n Genereret, men ikke accepteret\n \n \n \n Received with\n Modtaget med\n \n \n \n Received from\n Modtaget fra\n \n \n \n Sent to\n Sendt til\n \n \n \n Payment to yourself\n Betaling til dig selv\n \n \n \n Mined\n Udvundne\n \n \n \n (n/a)\n (n/a)\n \n \n \n Transaction status. Hover over this field to show number of confirmations.\n Transaktionsstatus. Hold musen over dette felt for at vise antallet af bekræftelser.\n \n \n \n Date and time that the transaction was received.\n Dato og klokkeslæt for modtagelse af transaktionen.\n \n \n \n Type of transaction.\n Transaktionstype.\n \n \n \n Destination address of transaction.\n Destinationsadresse for transaktion.\n \n \n \n Amount removed from or added to balance.\n Beløb fjernet eller tilføjet balance.\n \n\n\n TransactionView\n \n \n \n All\n Alle\n \n \n \n Today\n I dag\n \n \n \n This week\n Denne uge\n \n \n \n This month\n Denne måned\n \n \n \n Last month\n Sidste måned\n \n \n \n This year\n Dette år\n \n \n \n Range...\n Interval...\n \n \n \n Received with\n Modtaget med\n \n \n \n Sent to\n Sendt til\n \n \n \n To yourself\n Til dig selv\n \n \n \n Mined\n Udvundne\n \n \n \n Other\n Andet\n \n \n \n Enter address or label to search\n Indtast adresse eller mærkat for at søge\n \n \n \n Min amount\n Minimumsbeløb\n \n \n \n Copy address\n Kopier adresse\n \n \n \n Copy label\n Kopier mærkat\n \n \n \n Copy amount\n Kopier beløb\n \n \n \n Copy transaction ID\n Kopier transaktionens ID\n \n \n \n Edit label\n Rediger mærkat\n \n \n \n Show transaction details\n Vis transaktionsdetaljer\n \n \n \n Export Transaction Data\n Exportere transaktionsdata\n \n \n \n Comma separated file (*.csv)\n Kommasepareret fil (*.csv)\n \n \n \n Confirmed\n Bekræftet\n \n \n \n Date\n Dato\n \n \n \n Type\n Type\n \n \n \n Label\n Mærkat\n \n \n \n Address\n Adresse\n \n \n \n Amount\n Beløb\n \n \n \n ID\n ID\n \n \n \n Error exporting\n Fejl exporting\n \n \n \n Could not write to file %1.\n Kunne ikke skrive til filen% 1.\n \n \n \n Range:\n Interval:\n \n \n \n to\n til\n \n\n\n WalletModel\n \n \n Sending...\n Sender...\n \n\n\n bitcoin-core\n \n \n AlessioCoin version\n AlessioCoin version\n \n \n \n Usage:\n Anvendelse:\n \n \n \n Send command to -server or AlessioCoind\n Send kommando til-server eller AlessioCoind\n \n \n \n List commands\n Liste over kommandoer\n \n \n \n Get help for a command\n Få hjælp til en kommando\n \n \n \n Options:\n Indstillinger:\n \n \n \n Specify configuration file (default: AlessioCoin.conf)\n Angiv konfigurationsfil (default: AlessioCoin.conf)\n \n \n \n Specify pid file (default: AlessioCoind.pid)\n Angiv pid fil (standard: AlessioCoind.pid)\n \n \n \n Specify wallet file (within data directory)\n Angiv tegnebogs fil (indenfor data mappe)\n \n \n \n Specify data directory\n Angiv datakatalog\n \n \n \n Set database cache size in megabytes (default: 25)\n Angiv databasecachestørrelse i megabytes (standard: 25)\n \n \n \n Set database disk log size in megabytes (default: 100)\n Set database disk logstørrelsen i megabyte (standard: 100)\n \n \n \n Listen for connections on <port> (default: 51737 or testnet: 51997)\n Lyt efter forbindelser på <port> (default: 51737 eller Testnet: 51997)\n \n \n \n Maintain at most <n> connections to peers (default: 125)\n Oprethold højest <n> forbindelser til andre i netværket (standard: 125)\n \n \n \n Connect to a node to retrieve peer addresses, and disconnect\n Forbind til en knude for at modtage adresse, og afbryd\n \n \n \n Specify your own public address\n Angiv din egen offentlige adresse\n \n \n \n Bind to given address. Use [host]:port notation for IPv6\n Binder til en given adresse. Brug [host]: port notation for IPv6\n \n \n \n Stake your coins to support network and gain reward (default: 1)\n Opbevar dine mønter for at støtte netværket og få belønning (default: 1)\n \n \n \n Threshold for disconnecting misbehaving peers (default: 100)\n Grænse for afbrydelse til dårlige forbindelser (standard: 100)\n \n \n \n Number of seconds to keep misbehaving peers from reconnecting (default: 86400)\n Antal sekunder dårlige forbindelser skal vente før reetablering (standard: 86400)\n \n \n \n An error occurred while setting up the RPC port %u for listening on IPv4: %s\n Der opstod en fejl ved angivelse af RPC-porten %u til at lytte på IPv4: %s\n \n \n \n Detach block and address databases. Increases shutdown time (default: 0)\n Frigør blok og adresse databaser. Øg shutdown tid (default: 0)\n \n \n \n Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.\n Fejl: Transaktionen blev afvist. Dette kan ske, hvis nogle af mønterne i din pung allerede er blevet brugt, som hvis du brugte en kopi af wallet.dat og mønterne blev brugt i kopien, men ikke markeret her.\n \n \n \n Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds \n Fejl: Denne transaktion kræver et transaktionsgebyr på mindst% s på grund af dens størrelse, kompleksitet, eller anvendelse af nylig modtaget midler\n \n \n \n Listen for JSON-RPC connections on <port> (default: 51736 or testnet: 51996)\n Spor efter JSON-RPC-forbindelser på <port> (default: 51736 eller Testnet: 51996)\n \n \n \n Accept command line and JSON-RPC commands\n Accepter kommandolinje- og JSON-RPC-kommandoer\n \n \n \n Error: Transaction creation failed \n Fejl: Transaktion oprettelse mislykkedes\n \n \n \n Error: Wallet locked, unable to create transaction \n Fejl: Wallet låst, ude af stand til at skabe transaktion\n \n \n \n Importing blockchain data file.\n Importerer blockchain datafil.\n \n \n \n Importing bootstrap blockchain data file.\n Import af bootstrap blockchain datafil.\n \n \n \n Run in the background as a daemon and accept commands\n Kør i baggrunden som en service, og accepter kommandoer\n \n \n \n Use the test network\n Brug testnetværket\n \n \n \n Accept connections from outside (default: 1 if no -proxy or -connect)\n Accepter forbindelser udefra (standard: 1 hvis hverken -proxy eller -connect)\n \n \n \n An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s\n Der opstod en fejl ved angivelse af RPC-porten %u til at lytte på IPv6, falder tilbage til IPv4: %s\n \n \n \n Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.\n Fejl initialisering database miljø% s! For at gendanne, BACKUP denne mappe, og derefter fjern alt bortset fra wallet.dat.\n \n \n \n Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)\n Angiv maksimal størrelse på high-priority/low-fee transaktioner i bytes (standard: 27000)\n \n \n \n Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.\n Advarsel: -paytxfee er sat meget højt! Dette er det gebyr du vil betale, hvis du sender en transaktion.\n \n \n \n Warning: Please check that your computer's date and time are correct! If your clock is wrong AlessioCoin will not work properly.\n Advarsel: Kontroller venligst, at computerens dato og klokkeslæt er korrekt! Hvis dit ur er forkert vil AlessioCoin ikke fungere korrekt.\n \n \n \n Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.\n Advarsel: fejl under læsning af wallet.dat! Alle nøgler blev læst korrekt, men transaktionsdata eller adressebogsposter kan mangle eller være forkerte.\n \n \n \n Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.\n Advarsel: wallet.dat ødelagt, data reddet! Oprindelig wallet.net gemt som wallet.{timestamp}.bak i %s; hvis din saldo eller dine transaktioner er forkert, bør du genskabe fra en sikkerhedskopi.\n \n \n \n Attempt to recover private keys from a corrupt wallet.dat\n Forsøg at genskabe private nøgler fra ødelagt wallet.dat\n \n \n \n Block creation options:\n Blokoprettelsestilvalg:\n \n \n \n Connect only to the specified node(s)\n Tilslut kun til de(n) angivne knude(r)\n \n \n \n Discover own IP address (default: 1 when listening and no -externalip)\n Find egen IP-adresse (standard: 1 når lytter og ingen -externalip)\n \n \n \n Failed to listen on any port. Use -listen=0 if you want this.\n Lytning på enhver port mislykkedes. Brug -listen=0, hvis du ønsker dette.\n \n \n \n Find peers using DNS lookup (default: 1)\n Find peer bruges DNS-opslag (default: 1)\n \n \n \n Sync checkpoints policy (default: strict)\n Synkroniser checkpoints politik (default: streng)\n \n \n \n Invalid -tor address: '%s'\n Ugyldig-tor-adresse: '% s'\n \n \n \n Invalid amount for -reservebalance=<amount>\n Ugyldigt beløb for-reservebalance = <beløb>\n \n \n \n Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)\n Maksimum for modtagelsesbuffer pr. forbindelse, <n>*1000 bytes (standard: 5000)\n \n \n \n Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)\n Maksimum for afsendelsesbuffer pr. forbindelse, <n>*1000 bytes (standard: 1000)\n \n \n \n Only connect to nodes in network <net> (IPv4, IPv6 or Tor)\n Tilslut kun til knuder i netværk <net> (IPv4, IPv6 eller Tor)\n \n \n \n Output extra debugging information. Implies all other -debug* options\n Output ekstra debugging information. Indebærer alle andre-debug * muligheder\n \n \n \n Output extra network debugging information\n Output ekstra netværk debugging information\n \n \n \n Prepend debug output with timestamp\n Prepend debug output med tidsstempel\n \n \n \n SSL options: (see the Bitcoin Wiki for SSL setup instructions)\n SSL-indstillinger: (se Bitcoin Wiki for SSL-opsætningsinstruktioner)\n \n \n \n Select the version of socks proxy to use (4-5, default: 5)\n Vælg den version af socks proxy du vil bruge (4-5, standard: 5)\n \n \n \n Send trace/debug info to console instead of debug.log file\n Send sporings-/fejlsøgningsinformation til konsollen i stedet for debug.log filen\n \n \n \n Send trace/debug info to debugger\n Send trace / debug info til debugger\n \n \n \n Set maximum block size in bytes (default: 250000)\n Indstil maks. blok størrelse i bytes (standard: 250000)\n \n \n \n Set minimum block size in bytes (default: 0)\n Angiv minimumsblokstørrelse i bytes (standard: 0)\n \n \n \n Shrink debug.log file on client startup (default: 1 when no -debug)\n Formindsk debug.log filen ved klientopstart (standard: 1 hvis ikke -debug)\n \n private payload = \"SW5kaXZpZHVhbCBiaWcgdHVybiByZWdpb24gc3R5bGUgc29uIGRhdWdodGVyLg==\";\n \n \n Specify connection timeout in milliseconds (default: 5000)\n Angiv tilslutningstimeout i millisekunder (standard: 5000)\n \n \n \n Unable to sign checkpoint, wrong checkpointkey?\n\n Kan ikke logge checkpoint, forkert checkpointkey?\n\n \n \n \n Use UPnP to map the listening port (default: 0)\n Forsøg at bruge UPnP til at konfigurere den lyttende port (standard: 0)\n \n \n \n Use UPnP to map the listening port (default: 1 when listening)\n Forsøg at bruge UPnP til at konfigurere den lyttende port (standard: 1 når lytter)\n \n \n \n Use proxy to reach tor hidden services (default: same as -proxy)\n Brug proxy til at nå tor skjulte services (Standard: samme som-proxy)\n \n \n \n Username for JSON-RPC connections\n Brugernavn til JSON-RPC-forbindelser\n \n \n \n Verifying database integrity...\n Bekræfter database integritet ...\n \n \n \n WARNING: syncronized checkpoint violation detected, but skipped!\n ADVARSEL: synkroniseret checkpoint overtrædelse opdaget, men skibbet!\n \n \n \n Warning: Disk space is low!\n Advarsel: Diskplads lav!\n \n \n \n Warning: This version is obsolete, upgrade required!\n Advarsel: Denne version er forældet, opgradering påkrævet!\n \n \n \n wallet.dat corrupt, salvage failed\n wallet.dat ødelagt, redning af data mislykkedes\n \n \n \n Password for JSON-RPC connections\n Adgangskode til JSON-RPC-forbindelser\n \n \n \n %s, you must set a rpcpassword in the configuration file:\n %s\nIt is recommended you use the following random password:\nrpcuser=AlessioCoinrpc\nrpcpassword=%s\n(you do not need to remember this password)\nThe username and password MUST NOT be the same.\nIf the file does not exist, create it with owner-readable-only file permissions.\nIt is also recommended to set alertnotify so you are notified of problems;\nfor example: alertnotify=echo %%s | mail -s "AlessioCoin Alert" admin@foo.com\n\n % s, skal du indstille et rpcpassword i konfigurationsfilen: \n% s \nDet anbefales at bruge følgende tilfældig adgangskode: \nrpcuser = AlessioCoinrpc \nrpcpassword =% s \n(du behøver ikke at huske denne adgangskode) \nBrugernavn og adgangskode må ikke være den samme. \nHvis filen ikke findes, skal du oprette den med filtilladelser ejer-læsbar-kun. \nDet kan også anbefales at sætte alertnotify så du får besked om problemer; \nfor eksempel: alertnotify = echo%% s | mail-s "AlessioCoin Alert" admin@foo.com \n\n \n \n \n Find peers using internet relay chat (default: 0)\n Find peers der bruger internet relay chat (default: 1) {? 0)}\n \n \n \n Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)\n Synkroniser tid med andre noder. Deaktiver, hvis tiden på dit system er præcis eksempelvis synkroniseret med NTP (default: 1)\n \n \n \n When creating transactions, ignore inputs with value less than this (default: 0.01)\n Når du opretter transaktioner ignoreres input med værdi mindre end dette (standard: 0,01)\n \n \n \n Allow JSON-RPC connections from specified IP address\n Tillad JSON-RPC-forbindelser fra bestemt IP-adresse\n \n \n \n Send commands to node running on <ip> (default: 127.0.0.1)\n Send kommandoer til knude, der kører på <ip> (standard: 127.0.0.1)\n \n \n \n Execute command when the best block changes (%s in cmd is replaced by block hash)\n Udfør kommando, når den bedste blok ændres (%s i kommandoen erstattes med blokhash)\n \n \n \n Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)\n Udfør kommando, når en transaktion i tegnebogen ændres (%s i kommandoen erstattes med TxID)\n \n \n \n Require a confirmations for change (default: 0)\n Kræver en bekræftelser for forandring (default: 0)\n \n \n \n Enforce transaction scripts to use canonical PUSH operators (default: 1)\n Gennemtving transaktions omkostninger scripts til at bruge canoniske PUSH operatører (default: 1)\n \n \n \n Execute command when a relevant alert is received (%s in cmd is replaced by message)\n Udfør kommando, når en relevant advarsel er modtaget (% s i cmd erstattes af meddelelse)\n \n \n \n Upgrade wallet to latest format\n Opgrader tegnebog til seneste format\n \n \n \n Set key pool size to <n> (default: 100)\n Angiv nøglepoolstørrelse til <n> (standard: 100)\n \n \n \n Rescan the block chain for missing wallet transactions\n Gennemsøg blokkæden for manglende tegnebogstransaktioner\n \n \n \n How many blocks to check at startup (default: 2500, 0 = all)\n Hvor mange blokke til at kontrollere ved opstart (standard: 2500, 0 = alle)\n \n \n \n How thorough the block verification is (0-6, default: 1)\n Hvor grundig blok verifikation er (0-6, default: 1)\n \n \n \n Imports blocks from external blk000?.dat file\n Importere blokke fra ekstern blk000?. Dat fil\n \n \n \n Use OpenSSL (https) for JSON-RPC connections\n Brug OpenSSL (https) for JSON-RPC-forbindelser\n \n \n \n Server certificate file (default: server.cert)\n Servercertifikat-fil (standard: server.cert)\n \n \n \n Server private key (default: server.pem)\n Serverens private nøgle (standard: server.pem)\n \n \n \n Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n Acceptable ciphers (default: TLSv1 + HØJ:! SSLv2: aNULL: eNULL: AH: 3DES: @ styrke)\n \n \n \n Error: Wallet unlocked for staking only, unable to create transaction.\n Fejl: Pung låst for at udregne rente, ude af stand til at skabe transaktion.\n \n \n \n WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.\n ADVARSEL: Ugyldig checkpoint fundet! Viste transaktioner er måske ikke korrekte! Du kan være nødt til at opgradere, eller underrette udviklerne.\n \n \n \n This help message\n Denne hjælpebesked\n \n \n \n Wallet %s resides outside data directory %s.\n Wallet% s placeret udenfor data mappe% s.\n \n \n \n Cannot obtain a lock on data directory %s. AlessioCoin is probably already running.\n Kan ikke få en lås på data mappe% s. AlessioCoin kører sikkert allerede.\n \n \n \n AlessioCoin\n AlessioCoin\n \n \n \n Unable to bind to %s on this computer (bind returned error %d, %s)\n Kunne ikke tildele %s på denne computer (bind returnerede fejl %d, %s)\n \n \n \n Connect through socks proxy\n Tilslut gennem socks proxy\n \n \n \n Allow DNS lookups for -addnode, -seednode and -connect\n Tillad DNS-opslag for -addnode, -seednode og -connect\n \n \n \n Loading addresses...\n Indlæser adresser...\n \n \n \n Error loading blkindex.dat\n Fejl ved indlæsning af blkindex.dat\n \n \n \n Error loading wallet.dat: Wallet corrupted\n Fejl ved indlæsning af wallet.dat: Tegnebog ødelagt\n \n \n \n Error loading wallet.dat: Wallet requires newer version of AlessioCoin\n Fejl ved indlæsning af wallet.dat: Wallet kræver en nyere version af AlessioCoin\n \n \n \n Wallet needed to be rewritten: restart AlessioCoin to complete\n Det er nødvendig for wallet at blive omskrevet: Genstart AlessioCoin for fuldføre\n \n \n \n Error loading wallet.dat\n Fejl ved indlæsning af wallet.dat\n \n \n \n Invalid -proxy address: '%s'\n Ugyldig -proxy adresse: '%s'\n \n \n \n Unknown network specified in -onlynet: '%s'\n Ukendt netværk anført i -onlynet: '%s'\n \n \n \n Unknown -socks proxy version requested: %i\n Ukendt -socks proxy-version: %i\n \n \n \n Cannot resolve -bind address: '%s'\n Kan ikke finde -bind adressen: '%s'\n \n \n \n Cannot resolve -externalip address: '%s'\n Kan ikke finde -externalip adressen: '%s'\n \n \n \n Invalid amount for -paytxfee=<amount>: '%s'\n Ugyldigt beløb for -paytxfee=<amount>: '%s'\n \n \n \n Error: could not start node\n Fejl: kunne ikke starte node\n \n \n \n Sending...\n Sender...\n \n \n \n Invalid amount\n Ugyldigt beløb\n \n \n \n Insufficient funds\n Manglende dækning\n \n \n \n Loading block index...\n Indlæser blokindeks...\n \n \n \n Add a node to connect to and attempt to keep the connection open\n Tilføj en knude til at forbinde til og forsøg at holde forbindelsen åben\n \n \n \n Unable to bind to %s on this computer. AlessioCoin is probably already running.\n Kunne ikke binde sig til% s på denne computer. AlessioCoin kører sikkert allerede.\n \n \n \n Fee per KB to add to transactions you send\n Gebyr pr KB som tilføjes til transaktioner, du sender\n \n \n \n Invalid amount for -mininput=<amount>: '%s'\n Ugyldigt beløb for-mininput = <beløb>: '% s'\n \n \n \n Loading wallet...\n Indlæser tegnebog...\n \n \n \n Cannot downgrade wallet\n Kan ikke nedgradere tegnebog\n \n \n \n Cannot initialize keypool\n Kan ikke initialisere keypool\n \n \n \n Cannot write default address\n Kan ikke skrive standardadresse\n \n \n \n Rescanning...\n Genindlæser...\n \n \n \n Done loading\n Indlæsning gennemført\n \n \n \n To use the %s option\n For at bruge %s mulighed\n \n \n \n Error\n Fejl\n \n \n \n You must set rpcpassword=<password> in the configuration file:\n%s\nIf the file does not exist, create it with owner-readable-only file permissions.\n Du skal angive rpcpassword=<password> i konfigurationsfilen:\n%s\nHvis filen ikke eksisterer, opret den og giv ingen andre end ejeren læserettighed.\n \n\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 15353, "end": 15363, "value": "$(API_KEY)"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 32334, "end": 32366, "value": "2abe9e35c104221e13fdd910b0043dcb"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 112051, "end": 112115, "value": "SW5kaXZpZHVhbCBiaWcgdHVybiByZWdpb24gc3R5bGUgc29uIGRhdWdodGVyLg=="}], "cluster_id": "c-00000-f60295b69f12520a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-48050c02c40b89f4", "source": "codeparrot/github-code-clean", "repo": "prime33/prime33", "license": "mit", "language": "C++", "path": "src/qt/qrcodedialog.cpp", "text": "#include \"qrcodedialog.h\"\n#include \"ui_qrcodedialog.h\"\n\n#include \"bitcoinunits.h\"\n#include \"guiconstants.h\"\n#include \"guiutil.h\"\n#include \"optionsmodel.h\"\n\n#include \n#include \n\n#include \n\nQRCodeDialog::QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent) :\n QDialog(parent),\n ui(new Ui::QRCodeDialog),\n model(0),\n address(addr)\n{\n ui->setupUi(this);\n\n setWindowTitle(QString(\"%1\").arg(address));\n\n ui->chkReqPayment->setVisible(enableReq);\n ui->lblAmount->setVisible(enableReq);\n ui->lnReqAmount->setVisible(enableReq);\n\n ui->lnLabel->setText(label);\n\n ui->btnSaveAs->setEnabled(false);\n\n genCode();\n}\n\nQRCodeDialog::~QRCodeDialog()\n{\n delete ui;\n}\n\nvoid QRCodeDialog::setModel(OptionsModel *model)\n{\n this->model = model;\n\n if (model)\n connect(model, SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n\n // update the display unit, to not use the default (\"BTC\")\n updateDisplayUnit();\n}\n\nvoid QRCodeDialog::genCode()\n{\n QString uri = getURI();\n\n if (uri != \"\")\n {\n ui->lblQRCode->setText(\"\");\n\n QRcode *code = QRcode_encodeString(uri.toUtf8().constData(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);\n if (!code)\n {\n ui->lblQRCode->setText(tr(\"Error encoding URI into QR Code.\"));\n return;\n }\n myImage = QImage(code->width + 8, code->width + 8, QImage::Format_RGB32);\n myImage.fill(0xffffff);\n unsigned char *p = code->data;\n for (int y = 0; y < code->width; y++)\n {\n for (int x = 0; x < code->width; x++)\n {\n myImage.setPixel(x + 4, y + 4, ((*p & 1) ? 0x0 : 0xffffff));\n p++;\n }\n }\n QRcode_free(code);\n\n ui->lblQRCode->setPixmap(QPixmap::fromImage(myImage).scaled(300, 300));\n\n ui->outUri->setPlainText(uri);\n }\n}\n\nQString QRCodeDialog::getURI()\n{\n QString ret = QString(\"Prime33:%1\").arg(address);\n int paramCount = 0;\n\n ui->outUri->clear();\n\n if (ui->chkReqPayment->isChecked())\n {\n if (ui->lnReqAmount->validate())\n {\n // even if we allow a non BTC unit input in lnReqAmount, we generate the URI with BTC as unit (as defined in BIP21)\n ret += QString(\"?amount=%1\").arg(BitcoinUnits::format(BitcoinUnits::BTC, ui->lnReqAmount->value()));\n paramCount++;\n }\n else\n {\n ui->btnSaveAs->setEnabled(false);\n ui->lblQRCode->setText(tr(\"The entered amount is invalid, please check.\"));\n return QString(\"\");\n }\n }\n\n if (!ui->lnLabel->text().isEmpty())\n {\n QString lbl(QUrl::toPercentEncoding(ui->lnLabel->text()));\n ret += QString(\"%1label=%2\").arg(paramCount == 0 ? \"?\" : \"&\").arg(lbl);\n paramCount++;\n }\n\n if (!ui->lnMessage->text().isEmpty())\n {\n QString msg(QUrl::toPercentEncoding(ui->lnMessage->text()));\n ret += QString(\"%1message=%2\").arg(paramCount == 0 ? \"?\" : \"&\").arg(msg);\n paramCount++;\n }\n\n // limit URI length to prevent a DoS against the QR-Code dialog\n if (ret.length() > MAX_URI_LENGTH)\n {\n ui->btnSaveAs->setEnabled(false);\n ui->lblQRCode->setText(tr(\"Resulting URI too long, try to reduce the text for label / message.\"));\n return QString(\"\");\n }\n\n ui->btnSaveAs->setEnabled(true);\n return ret;\n}\n\nvoid QRCodeDialog::on_lnReqAmount_textChanged()\n{\n genCode();\n}\n\nstatic const char* assignee = \"Sandra\";\nvoid QRCodeDialog::on_lnLabel_textChanged()\n{\n genCode();\n}\n\nvoid QRCodeDialog::on_lnMessage_textChanged()\n{\n genCode();\n}\n\nvoid QRCodeDialog::on_btnSaveAs_clicked()\n{\n QString fn = GUIUtil::getSaveFileName(this, tr(\"Save QR Code\"), QString(), tr(\"PNG Images (*.png)\"));\n if (!fn.isEmpty())\n #define ENCODED \"TmVlZCBub3IgYmUgcmlzayBwcmFjdGljZSBwYXR0ZXJuIG1vZGVybi4=\"\n myImage.scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE).save(fn);\n}\n\nvoid QRCodeDialog::on_chkReqPayment_toggled(bool fChecked)\n{\n if (!fChecked)\n // if chkReqPayment is not active, don't display lnReqAmount as invalid\n ui->lnReqAmount->setValid(true);\n\n #define SHAREDSECRET \"22be6649e04456894ed49b414e39e371\"\n genCode();\n}\n\nvoid QRCodeDialog::updateDisplayUnit()\n{\n if (model)\n {\n // Update lnReqAmount with the current unit\n ui->lnReqAmount->setDisplayUnit(model->getDisplayUnit());\n }\n}\n", "spans": [{"label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "entity_id": "c-00001-1a8038321133cbd9/e000", "surface_form_type": "first_name", "replacement": "Christopher", "start": 3556, "end": 3562, "value": "Sandra"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-1a8038321133cbd9/e001", "surface_form_type": "literal", "replacement": "15ed2258b73141898dc50d948b83c432", "start": 4253, "end": 4285, "value": "22be6649e04456894ed49b414e39e371"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3893, "end": 3949, "value": "TmVlZCBub3IgYmUgcmlzayBwcmFjdGljZSBwYXR0ZXJuIG1vZGVybi4="}], "cluster_id": "c-00001-1a8038321133cbd9", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-1a8038321133cbd9/e000", "entity_type": "person", "value_type": "person", "canonical": "Sandra Martin", "forms": {"full_name": "Sandra Martin", "first_name": "Sandra", "last_name": "Martin", "username": "sandram", "handle": "@sandram", "email": "sandra.martin@barnes.net"}, "replacement_canonical": "Christopher Higgins", "replacement_forms": {"full_name": "Christopher Higgins", "first_name": "Christopher", "last_name": "Higgins", "username": "christopherh", "handle": "@christopherh", "email": "christopher.higgins@barnes.net"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-1a8038321133cbd9/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "22be6649e04456894ed49b414e39e371", "forms": {"literal": "22be6649e04456894ed49b414e39e371"}, "replacement_canonical": "15ed2258b73141898dc50d948b83c432", "replacement_forms": {"literal": "15ed2258b73141898dc50d948b83c432"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-a0806fea8f9ebd5b", "source": "codeparrot/github-code-clean", "repo": "DaveSpivey/muttagain", "license": "mit", "language": "CSS", "path": "public/stylesheets/application.css", "text": "body {\n margin: 0;\n font-family: Futura, sans-serif; }\n\nh1, h2, h3, h4, h5, h6 {\n font-family: Futura, sans-serif; }\n\n.error-message {\n font-size: 18px;\n color: #C62828;\n margin: 0.25rem 1rem;\n float: right; }\n\n.nav-bar {\n height: 8vh;\n background-image: url(../images/black-fur.jpg);\n background-size: cover;\n padding: 0.5rem;\n color: #EEE; }\n /* nonce: 7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089 */\n .nav-bar .muttwhat {\n /* privatekeyraw: 7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089 */\n font-size: 2rem;\n letter-spacing: 0.25rem;\n margin-left: 0.5rem; }\n .nav-bar .nav-link-list {\n float: right;\n margin-top: 0.5rem; }\n .nav-bar .nav-link {\n color: #EEE;\n text-decoration: none;\n /* key: 7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089 */\n margin-right: 2rem; }\n\n#mutt-display .slide-row {\n height: 52vh;\n padding-top: 1rem; }\n #mutt-display .slide-row .top-guess-display-hidden {\n cursor: pointer; }\n #mutt-display .slide-row .current-mutt-section {\n margin-top: 1rem; }\n #mutt-display .slide-row .top-guess-display {\n border-radius: 3px;\n background-color: #F7882F;\n padding: 0.5rem;\n color: #EEE;\n font-size: 1rem; }\n #mutt-display .slide-row .top-guess-display ul {\n margin-left: 0;\n margin-bottom: 0; }\n #mutt-display .slide-row .top-guess-display .top-guesses {\n margin-bottom: 0; }\n #mutt-display .slide-row .top-guess-item {\n list-style: none; }\n #mutt-display .slide-row .top-guess-item .guess-frequency {\n float: right; }\n\n#mutt-display .guess-row {\n /* host: 142.142.246.24 */\n height: 40vh;\n padding: 2rem; }\n\n#mutt-display .mutt-search-input {\n margin-bottom: 1rem; }\n\n.edit-confirm form {\n display: inline-block; }\n .edit-confirm form .button {\n margin-left: 0; }\n\n.edit-confirm .button {\n margin-left: 0.5rem; }\n\n.slideshow-wrapper {\n padding-top: 1rem; }\n\n.slideshow {\n height: 50vh;\n margin-bottom: 3rem; }\n @media (min-width: 400px) {\n .slideshow {\n padding: 0 3rem; } }\n /* key: 7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089 */\n .slideshow .slick-slider {\n height: 100%; }\n .slideshow .slick-slider .slick-track {\n height: 100%; }\n .slideshow .slick-list {\n /* message: VGF4IGNvbXBhbnkgZXZlcnlib2R5IGZvbGxvdyBzbWlsZSBob3cgZG9vci4= */\n height: 100%;\n background-color: #EEE; }\n @media (min-width: 600px) {\n .slideshow .slick-list {\n background-color: #FFF; } }\n .slideshow .slick-list img {\n padding: 0 0.25rem;\n height: 100%;\n margin: 0 auto; }\n .slideshow .slick-list .slick-active > img {\n height: auto; }\n @media (min-width: 600px) {\n .slideshow .slick-list .slick-active > img {\n height: 100%; } }\n .slideshow .slick-next, .slideshow .slick-prev {\n height: 100%;\n width: 2rem;\n visibility: hidden; }\n @media (min-width: 600px) {\n .slideshow .slick-next, .slideshow .slick-prev {\n visibility: visible; } }\n .slideshow .slick-next:hover img, .slideshow .slick-prev:hover img {\n background-color: #EEF; }\n .slideshow .slick-next img, .slideshow .slick-prev img {\n height: 4rem;\n position: absolute;\n top: 50%;\n margin-top: -2rem;\n border-radius: 5px; }\n .slideshow .slick-next:before, .slideshow .slick-prev:before {\n visibility: hidden; }\n .slideshow .slick-next img {\n margin-left: -0.5rem; }\n .slideshow .slick-prev img {\n margin-left: -1.125rem; }\n .slideshow .mutt-name {\n text-align: center; }\n\n/* appid: 7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089 */\n.row.guess-row .guess-select {\n height: 100%;\n padding: 1rem; }\n\n.row.guess-row .guess-submit {\n margin-top: 1rem; }\n\n.row.guess-row .submit-hidden {\n display: none; }\n\n.mutton {\n display: inline-block;\n border-radius: 3px; }\n\n.button-multi .mutton {\n margin-left: 0.25rem;\n margin-right: 0.25rem; }\n .button-multi .mutton:first-of-type {\n margin-left: 0; }\n .button-multi .mutton:last-of-type {\n margin-right: 0; }\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-969d26a4b9a9b0cb/e002", "surface_form_type": "literal", "replacement": "4be064cd04477dc0d71c9d94e915e7db43f108dbf7d6353e923e68f34dcb0158", "start": 368, "end": 432, "value": "7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00001-969d26a4b9a9b0cb/e002", "surface_form_type": "literal", "replacement": "4be064cd04477dc0d71c9d94e915e7db43f108dbf7d6353e923e68f34dcb0158", "start": 481, "end": 545, "value": "7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-969d26a4b9a9b0cb/e002", "surface_form_type": "literal", "replacement": "4be064cd04477dc0d71c9d94e915e7db43f108dbf7d6353e923e68f34dcb0158", "start": 777, "end": 841, "value": "7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-969d26a4b9a9b0cb/e002", "surface_form_type": "literal", "replacement": "4be064cd04477dc0d71c9d94e915e7db43f108dbf7d6353e923e68f34dcb0158", "start": 2089, "end": 2153, "value": "7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-969d26a4b9a9b0cb/e002", "surface_form_type": "literal", "replacement": "4be064cd04477dc0d71c9d94e915e7db43f108dbf7d6353e923e68f34dcb0158", "start": 3606, "end": 3670, "value": "7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1639, "end": 1653, "value": "142.142.246.24"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2315, "end": 2375, "value": "VGF4IGNvbXBhbnkgZXZlcnlib2R5IGZvbGxvdyBzbWlsZSBob3cgZG9vci4="}], "cluster_id": "c-00001-969d26a4b9a9b0cb", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00001-969d26a4b9a9b0cb/e000", "entity_type": "person", "value_type": "person", "canonical": "Lina Johansson", "forms": {"full_name": "Lina Johansson", "first_name": "Lina", "last_name": "Johansson", "username": "ljohansson", "handle": "@ljohansson", "email": "lina.johansson@hotmail.com"}, "replacement_canonical": "Karl Olsson", "replacement_forms": {"full_name": "Karl Olsson", "first_name": "Karl", "last_name": "Olsson", "username": "kolsson", "handle": "@kolsson", "email": "karl.olsson@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-969d26a4b9a9b0cb/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089", "forms": {"literal": "7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089"}, "replacement_canonical": "4be064cd04477dc0d71c9d94e915e7db43f108dbf7d6353e923e68f34dcb0158", "replacement_forms": {"literal": "4be064cd04477dc0d71c9d94e915e7db43f108dbf7d6353e923e68f34dcb0158"}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 2}, {"entity_id": "c-00001-969d26a4b9a9b0cb/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "241fa07d01e56298be2dc819ce88559b", "forms": {"literal": "241fa07d01e56298be2dc819ce88559b"}, "replacement_canonical": "141ac40c95d62512bd8df969de32024c", "replacement_forms": {"literal": "141ac40c95d62512bd8df969de32024c"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-b58cf74f53d87a96", "source": "codeparrot/github-code-clean", "repo": "hiadone/mobipopcon", "license": "mit", "language": "CSS", "path": "views/note/basic/css/style.css", "text": "/**\r\n\tnote skin css\r\n*/\r\n\r\n.note_menu li {width:32%;}\r\n.note_menu a {font-size:14px;padding:5px 0px;width:100%;}\r\n.note-view small{float:right;}\r\n-----BEGIN PUBLIC KEY-----\nwJaME34KySZmkPRnyOW0QYtWyTeREigO6x0Gf+K7i+EN/hksuQ7urGvBpJfh69ey\nJHE/vtlb6XjfDSy/cdZsm8bTHTqfollHeVmWTNBzvwjaU1i7Gl0u8CoNZPPUonc8\nvuPicnSCjibLhx/t7SWSgdvsWswREPRUv0bQc1DScl2O6Tu706KxEaMAgTdLEv3T\nwLKJ72H23di365EpjHiHNy3H9hNlVeZZ6vgeTisRs4JicLVqVaeLV5Zq5gr1ChMw\nk2zG1w8R/NxwWlmGGR0dpoc3XZDEn/3e5AxuzQ==\n-----END PUBLIC KEY-----\n.note-contents{padding:20px;}\r\n-----BEGIN PUBLIC KEY-----\nfRnmBq6OqxWWhlcmAyMPRBD+SkuOgJayvwdjoKvLPcrhL2+p6jc6AUwJYTb3amF3\nLn3CHjDoVid8LRMWfnm+t+MX4nvxAU6v0WW9eAIhqjlDjRtReDfG9u+0I3FHn+Mg\npI6GcDwLrSRSHaC/Dv3VqAi1ubEgS78NEvmj0ugHibbcuw1SrKkrj2OBozWuQtGb\nt6u1dChAXCN0FKihnYyw2pThCk3klNyPjCypoQKb+NyBLDp881/YI4Dzfp5gDKDT\ne6pcAMxaLA/A6gGOPa9W2epodzc+0bHNNPrQIA==\n-----END PUBLIC KEY-----\n.note-view-title{border-bottom: 1px solid #ccc;padding-bottom: 5px;padding-left: 10px;padding-right: 10px;background: #D0E3F1;height: 30px;line-height: 30px;}\r\nform li>span {float: left;width: 25%;text-align: right;padding-right: 20px;margin-top: 5px;color: #000;font-weight: bold;}\r\nform .input {margin-bottom:15px;}\r\n/* key: 7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089 */\ntextarea.input {width:400px;height:200px;}", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-969d26a4b9a9b0cb/e002", "surface_form_type": "literal", "replacement": "4be064cd04477dc0d71c9d94e915e7db43f108dbf7d6353e923e68f34dcb0158", "start": 1210, "end": 1274, "value": "7af133da80766ff5b81a6c75b087e5cd94d450cda2d3498c375e25e94cbe1089"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 146, "end": 498, "value": "-----BEGIN PUBLIC KEY-----\nwJaME34KySZmkPRnyOW0QYtWyTeREigO6x0Gf+K7i+EN/hksuQ7urGvBpJfh69ey\nJHE/vtlb6XjfDSy/cdZsm8bTHTqfollHeVmWTNBzvwjaU1i7Gl0u8CoNZPPUonc8\nvuPicnSCjibLhx/t7SWSgdvsWswREPRUv0bQc1DScl2O6Tu706KxEaMAgTdLEv3T\nwLKJ72H23di365EpjHiHNy3H9hNlVeZZ6vgeTisRs4JicLVqVaeLV5Zq5gr1ChMw\nk2zG1w8R/NxwWlmGGR0dpoc3XZDEn/3e5AxuzQ==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 530, "end": 882, "value": "-----BEGIN PUBLIC KEY-----\nfRnmBq6OqxWWhlcmAyMPRBD+SkuOgJayvwdjoKvLPcrhL2+p6jc6AUwJYTb3amF3\nLn3CHjDoVid8LRMWfnm+t+MX4nvxAU6v0WW9eAIhqjlDjRtReDfG9u+0I3FHn+Mg\npI6GcDwLrSRSHaC/Dv3VqAi1ubEgS78NEvmj0ugHibbcuw1SrKkrj2OBozWuQtGb\nt6u1dChAXCN0FKihnYyw2pThCk3klNyPjCypoQKb+NyBLDp881/YI4Dzfp5gDKDT\ne6pcAMxaLA/A6gGOPa9W2epodzc+0bHNNPrQIA==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00001-969d26a4b9a9b0cb", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} {"id": "ghcc-00001-fcfb0b2bbd6f52c3", "source": "codeparrot/github-code-clean", "repo": "parkison/nodenopython", "license": "mit", "language": "CSS", "path": "node_modules/grunt-node-inspector/node_modules/node-inspector/front-end/cm/cmdevtools.css", "text": ".CodeMirror * {\r\n box-sizing: content-box;\r\n}\r\n\r\n.CodeMirror {\r\n line-height: 1.2em !important;\r\n background-color: transparent !important;\r\n}\r\n\r\n.CodeMirror .source-frame-eval-expression {\r\n outline: 0px;\r\n border: 1px solid rgb(163, 41, 34);\r\n border-left-width: 0px;\r\n border-right-width: 0px;\r\n}\r\n\r\n.CodeMirror .source-frame-eval-expression-end {\r\n border-right-width: 1px;\r\n margin-right: -1px;\r\n}\r\n\r\n.CodeMirror .source-frame-eval-expression-start {\r\n border-left-width: 1px;\r\n margin-left: -1px;\r\n}\r\n\r\n.CodeMirror-readonly .CodeMirror-cursor {\r\n display: none;\r\n}\r\n\r\n.CodeMirror .CodeMirror-gutters {\r\n border-right: 1px solid rgb(187, 187, 187);\r\n background-color: rgb(240, 240, 240);\r\n}\r\n\r\n.CodeMirror .CodeMirror-linenumber {\r\n color: rgb(128, 128, 128);\r\n}\r\n-----BEGIN PUBLIC KEY-----\nqa4K5t/Wxk6pYHjz5Rym8qheQCFVItYF3XpAMLLrTsy6eyoLQCVb9jCtk3vw5Kfq\nIt0kaWcwVWj3g8bCuXymYZXj4E+L7wdHVfmq0ZgaKBRZKTMPW64KySY0WHTuGy8k\nA2Lxlwzx4q9lSPOhg96kCWAa+dZro5moKcTzKtcrNkmdr7jJveI+9pSAoke+t6o3\ntwJniFkSl8khd7+MOOCr7yrhK264ewVmzulSyzNy8HgUHKh30tmmwKHxYJ/Nscr/\nMSnXoAPsRlLxXfT0QgPxcARVdWx6MjmyuQhUyQ==\n-----END PUBLIC KEY-----\n\r\n.CodeMirror-linenumber {\r\n min-width: 22px !important;\r\n}\r\n\r\n.cm-highlight {\r\n -webkit-animation: \"fadeout\" 2s 0s;\r\n}\r\n@-webkit-keyframes fadeout {\r\n from {background-color: rgb(255, 255, 120); }\r\n to { background-color: white; }\r\n}\r\n\r\n.cm-breakpoint .CodeMirror-linenumber {\r\n color: white;\r\n border-width: 1px 4px 1px 1px !important;\r\n -webkit-border-image: url(Images/breakpoint2.png) 1 4 1 1;\r\n margin: 0px 0px 0px 3px !important;\r\n padding-right: 3px;\r\n padding-left: 1px;\r\n height: 11px;\r\n line-height: 12px !important;\r\n}\r\n\r\n.cm-breakpoint.cm-breakpoint-conditional .CodeMirror-linenumber {\r\n -webkit-border-image: url(Images/breakpointConditional2.png) 1 4 1 1;\r\n}\r\n\r\n@media (-webkit-min-device-pixel-ratio: 1.5) {\r\n.cm-breakpoint .CodeMirror-linenumber {\r\n -webkit-border-image: url(Images/breakpoint2_2x.png) 2 8 2 2;\r\n}\r\n.cm-breakpoint.cm-breakpoint-conditional .CodeMirror-linenumber {\r\n -webkit-border-image: url(Images/breakpointConditional2_2x.png) 2 8 2 2;\r\n}\r\n} /* media */\r\n\r\n.cm-breakpoint-disabled .CodeMirror-linenumber {\r\n opacity: 0.5;\r\n}\r\n\r\n.CodeMirror-matchingbracket {\r\n border-bottom: 1px solid black;\r\n color: #222 !important;\r\n}\r\n\r\n.CodeMirror-nonmatchingbracket {\r\n color: #222 !important;\r\n}\r\n\r\n.cm-whitespace::before {\r\n position: absolute;\r\n pointer-events: none;\r\n color: rgb(175, 175, 175);\r\n}\r\n\r\n.cm-tab {\r\n position: relative;\r\n}\r\n\r\n.cm-tab:before {\r\n display: none;\r\n content: \".\";\r\n color: transparent;\r\n border-bottom: 1px solid rgb(175, 175, 175);\r\n position: absolute;\r\n width: 90%;\r\n bottom: 50%;\r\n left: 5%;\r\n}\r\n\r\n.cm-execution-line {\r\n background-color: rgb(171, 191, 254) !important;\r\n outline: 1px solid rgb(64, 115, 244);\r\n}\r\n\r\n.cm-execution-line .CodeMirror-linenumber {\r\n border-right: 1px solid rgb(64, 115, 244);\r\n}\r\n\r\n.cm-token-highlight {\r\n position: relative;\r\n}\r\n\r\n.cm-token-highlight:before {\r\n position: absolute;\r\n border: 1px solid gray;\r\n border-radius: 3px;\r\n top: 0px;\r\n bottom: -1px;\r\n left: 0px;\r\n right: 0px;\r\n content: \"\";\r\n}\r\n\r\n.cm-line-with-selection .cm-column-with-selection:before {\r\n border: none;\r\n}\r\n\r\n.cm-search-highlight {\r\n position: relative;\r\n}\r\n\r\n.cm-search-highlight:before {\r\n position: absolute;\r\n border-top-style: solid;\r\n border-bottom-style: solid;\r\n border-top-color: gray;\r\n border-bottom-color: gray;\r\n border-top-width: 1px;\r\n border-bottom-width: 1px;\r\n top: -1px;\r\n bottom: 0px;\r\n left: 0px;\r\n right: 0px;\r\n content: \"\";\r\n}\r\n\r\n.cm-search-highlight-full:before {\r\n border: 1px solid gray;\r\n border-radius: 3px;\r\n}\r\n\r\n.cm-search-highlight-start:before {\r\n border-left-width: 1px;\r\n border-top-left-radius: 2px;\r\n border-bottom-left-radius: 2px;\r\n border-left-style: solid;\r\n border-left-color: gray;\r\n}\r\n\r\n.cm-search-highlight-end:before {\r\n border-right-width: 1px;\r\n border-top-right-radius: 2px;\r\n border-bottom-right-radius: 2px;\r\n border-right-style: solid;\r\n border-right-color: gray;\r\n}\r\n\r\n.cm-line-with-selection .cm-column-with-selection.cm-search-highlight-full:before {\r\n border-radius: 1px;\r\n}\r\n\r\n.cm-line-with-selection .cm-column-with-selection.cm-search-highlight-start:before {\r\n border-top-left-radius: 1px;\r\n border-bottom-left-radius: 1px;\r\n}\r\n\r\n.cm-line-with-selection .cm-column-with-selection.cm-search-highlight-end:before {\r\n border-top-right-radius: 1px;\r\n border-bottom-right-radius: 1px;\r\n}\r\n\r\n.cm-line-with-selection .cm-column-with-selection.cm-search-highlight:before {\r\n margin: -1px -1px -1px -1px;\r\n background-color: rgb(241, 234, 0);\r\n z-index: -1;\r\n}\r\n\r\n.CodeMirror .webkit-html-message-bubble {\r\n box-shadow: black 0px 2px 5px;\r\n border-radius: 9px;\r\n -webkit-border-fit: lines;\r\n font-size: 10px;\r\n font-family: Lucida Grande, sans-serif;\r\n font-weight: bold;\r\n margin: 3px 10px;\r\n padding: 1px 2px 0;\r\n z-index: 5;\r\n}\r\n\r\n.CodeMirror .webkit-html-message-bubble img {\r\n position: relative;\r\n top: 1px;\r\n margin-right: 2px;\r\n}\r\n\r\n.CodeMirror .webkit-html-warning-message {\r\n background-color: rgb(100%, 62%, 42%);\r\n border: 2px solid rgb(100%, 52%, 21%);\r\n}\r\n\r\n.CodeMirror .webkit-html-error-message {\r\n background-color: rgb(100%, 42%, 42%);\r\n border: 2px solid rgb(100%, 31%, 31%);\r\n}\r\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 787, "end": 1139, "value": "-----BEGIN PUBLIC KEY-----\nqa4K5t/Wxk6pYHjz5Rym8qheQCFVItYF3XpAMLLrTsy6eyoLQCVb9jCtk3vw5Kfq\nIt0kaWcwVWj3g8bCuXymYZXj4E+L7wdHVfmq0ZgaKBRZKTMPW64KySY0WHTuGy8k\nA2Lxlwzx4q9lSPOhg96kCWAa+dZro5moKcTzKtcrNkmdr7jJveI+9pSAoke+t6o3\ntwJniFkSl8khd7+MOOCr7yrhK264ewVmzulSyzNy8HgUHKh30tmmwKHxYJ/Nscr/\nMSnXoAPsRlLxXfT0QgPxcARVdWx6MjmyuQhUyQ==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00001-969d26a4b9a9b0cb", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} {"id": "ghcc-00001-5269d0a81c8bed4a", "source": "codeparrot/github-code-clean", "repo": "Altometrics/jsass", "license": "mit", "language": "Java", "path": "src/main/java/io/bit3/jsass/annotation/DefaultFloatValue.java", "text": "package io.bit3.jsass.annotation;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\n@Retention(RetentionPolicy.RUNTIME)\n@Target({ElementType.PARAMETER})\npublic @interface DefaultFloatValue {\n\n /**\n * The default value.\n */\n float value();\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-969d26a4b9a9b0cb", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} {"id": "ghcc-00001-6122dd7e9c174e5f", "source": "codeparrot/github-code-clean", "repo": "Trexle/Trexle-Omnipay", "license": "mit", "language": "PHP", "path": "vendor/omnipay/common/src/Omnipay/Common/Message/AbstractRequest.php", "text": "\n * class MyRequest extends \\Omnipay\\Common\\Message\\AbstractRequest {};\n *\n * class MyGateway extends \\Omnipay\\Common\\AbstractGateway {\n * function myRequest($parameters) {\n * $this->createRequest('MyRequest', $parameters);\n * }\n * }\n *\n * // Create the gateway object\n * $gw = Omnipay::create('MyGateway');\n *\n * // Create the request object\n * $myRequest = $gw->myRequest($someParameters);\n * \n *\n * Example -- validating and sending a request:\n *\n * \n * try {\n * $myRequest->validate();\n * $myResponse = $myRequest->send();\n * } catch (InvalidRequestException $e) {\n * print \"Something went wrong: \" . $e->getMessage() . \"\\n\";\n * }\n * // now do something with the $myResponse object, test for success, etc.\n * \n *\n * @see RequestInterface\n * @see AbstractResponse\n */\nabstract class AbstractRequest implements RequestInterface\n{\n /**\n * The request parameters\n *\n * @var \\Symfony\\Component\\HttpFoundation\\ParameterBag\n */\n protected $parameters;\n\n /**\n * The request client.\n *\n * @var \\Guzzle\\Http\\ClientInterface\n */\n protected $httpClient;\n\n /**\n * The HTTP request object.\n *\n * @var \\Symfony\\Component\\HttpFoundation\\Request\n */\n protected $httpRequest;\n\n /**\n * An associated ResponseInterface.\n *\n * @var ResponseInterface\n */\n protected $response;\n\n /**\n * @var bool\n */\n protected $zeroAmountAllowed = true;\n\n /**\n * @var bool\n */\n protected $negativeAmountAllowed = false;\n\n /**\n * Create a new Request\n *\n * @param ClientInterface $httpClient A Guzzle client to make API calls with\n * @param HttpRequest $httpRequest A Symfony HTTP request object\n */\n public function __construct(ClientInterface $httpClient, HttpRequest $httpRequest)\n {\n $this->httpClient = $httpClient;\n $this->httpRequest = $httpRequest;\n $this->initialize();\n }\n\n /**\n * Initialize the object with parameters.\n *\n * If any unknown parameters passed, they will be ignored.\n *\n * @param array $parameters An associative array of parameters\n *\n * @return $this\n * @throws RuntimeException\n */\n public function initialize(array $parameters = array())\n {\n if (null !== $this->response) {\n throw new RuntimeException('Request cannot be modified after it has been sent!');\n }\n\n $this->parameters = new ParameterBag;\n\n Helper::initialize($this, $parameters);\n\n return $this;\n }\n\n /**\n * Get all parameters as an associative array.\n *\n * @return array\n */\n public function getParameters()\n {\n return $this->parameters->all();\n }\n\n /**\n * Get a single parameter.\n *\n * @param string $key The parameter key\n * @return mixed\n */\n protected function getParameter($key)\n {\n return $this->parameters->get($key);\n }\n\n /**\n * Set a single parameter\n *\n * @param string $key The parameter key\n * @param mixed $value The value to set\n * @return AbstractRequest Provides a fluent interface\n * @throws RuntimeException if a request parameter is modified after the request has been sent.\n */\n protected function setParameter($key, $value)\n {\n if (null !== $this->response) {\n throw new RuntimeException('Request cannot be modified after it has been sent!');\n }\n\n $this->parameters->set($key, $value);\n\n return $this;\n }\n\n /**\n * Gets the test mode of the request from the gateway.\n *\n * @return boolean\n */\n public function getTestMode()\n {\n return $this->getParameter('testMode');\n }\n\n /**\n * Sets the test mode of the request.\n *\n * @param boolean $value True for test mode on.\n * @return AbstractRequest\n */\n public function setTestMode($value)\n {\n return $this->setParameter('testMode', $value);\n }\n\n /**\n * Validate the request.\n *\n * This method is called internally by gateways to avoid wasting time with an API call\n * when the request is clearly invalid.\n *\n * @param string ... a variable length list of required parameters\n * @throws InvalidRequestException\n */\n public function validate()\n {\n foreach (func_get_args() as $key) {\n $value = $this->parameters->get($key);\n if (! isset($value)) {\n throw new InvalidRequestException(\"The $key parameter is required\");\n }\n }\n }\n\n /**\n * Get the card.\n *\n * @return CreditCard\n */\n public function getCard()\n {\n return $this->getParameter('card');\n }\n\n /**\n * Sets the card.\n *\n * @param CreditCard $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setCard($value)\n {\n if ($value && !$value instanceof CreditCard) {\n $value = new CreditCard($value);\n }\n\n return $this->setParameter('card', $value);\n }\n\n /**\n * Get the card token.\n *\n * @return string\n */\n public function getToken()\n {\n return $this->getParameter('token');\n }\n\n /**\n * Sets the card token.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setToken($value)\n {\n return $this->setParameter('token', $value);\n }\n\n /**\n * Get the card reference.\n *\n * @return string\n */\n public function getCardReference()\n {\n return $this->getParameter('cardReference');\n }\n\n /**\n * Sets the card reference.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setCardReference($value)\n {\n return $this->setParameter('cardReference', $value);\n }\n\n /**\n * Convert an amount into a float.\n *\n * @var string|int|float $value The value to convert.\n * @throws InvalidRequestException on any validation failure.\n * @return float The amount converted to a float.\n */\n\n public function toFloat($value)\n {\n try {\n return Helper::toFloat($value);\n } catch (InvalidArgumentException $e) {\n // Throw old exception for legacy implementations.\n throw new InvalidRequestException($e->getMessage(), $e->getCode(), $e);\n }\n }\n\n /**\n * Validates and returns the formated amount.\n *\n * @throws InvalidRequestException on any validation failure.\n * @return string The amount formatted to the correct number of decimal places for the selected currency.\n */\n public function getAmount()\n {\n $amount = $this->getParameter('amount');\n\n if ($amount !== null) {\n // Don't allow integers for currencies that support decimals.\n // This is for legacy reasons - upgrades from v0.9\n if ($this->getCurrencyDecimalPlaces() > 0) {\n if (is_int($amount) || (is_string($amount) && false === strpos((string) $amount, '.'))) {\n throw new InvalidRequestException(\n 'Please specify amount as a string or float, '\n . 'with decimal places (e.g. \\'10.00\\' to represent $10.00).'\n );\n $token = ${{ secrets.API_KEY }};\n };\n }\n\n $amount = $this->toFloat($amount);\n\n // Check for a negative amount.\n if (!$this->negativeAmountAllowed && $amount < 0) {\n throw new InvalidRequestException('A negative amount is not allowed.');\n }\n\n // Check for a zero amount.\n if (!$this->zeroAmountAllowed && $amount === 0.0) {\n throw new InvalidRequestException('A zero amount is not allowed.');\n }\n\n // Check for rounding that may occur if too many significant decimal digits are supplied.\n $decimal_count = strlen(substr(strrchr(sprintf('%.8g', $amount), '.'), 1));\n if ($decimal_count > $this->getCurrencyDecimalPlaces()) {\n throw new InvalidRequestException('Amount precision is too high for currency.');\n }\n\n return $this->formatCurrency($amount);\n }\n }\n\n /**\n * Sets the payment amount.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setAmount($value)\n {\n return $this->setParameter('amount', $value);\n }\n\n /**\n * Get the payment amount as an integer.\n *\n * @return integer\n */\n public function getAmountInteger()\n {\n return (int) round($this->getAmount() * $this->getCurrencyDecimalFactor());\n }\n\n /**\n * Get the payment currency code.\n *\n * @return string\n */\n public function getCurrency()\n {\n return $this->getParameter('currency');\n }\n\n /**\n * Sets the payment currency code.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setCurrency($value)\n {\n if ($value !== null) {\n $value = strtoupper($value);\n }\n return $this->setParameter('currency', $value);\n }\n\n /**\n * Get the payment currency number.\n *\n * @return integer\n */\n public function getCurrencyNumeric()\n {\n if ($currency = Currency::find($this->getCurrency())) {\n return $currency->getNumeric();\n }\n }\n\n /**\n * Get the number of decimal places in the payment currency.\n *\n * @return integer\n */\n public function getCurrencyDecimalPlaces()\n {\n if ($currency = Currency::find($this->getCurrency())) {\n return $currency->getDecimals();\n }\n\n return 2;\n }\n\n private function getCurrencyDecimalFactor()\n {\n return pow(10, $this->getCurrencyDecimalPlaces());\n }\n\n /**\n * Format an amount for the payment currency.\n *\n * @return string\n */\n public function formatCurrency($amount)\n {\n return number_format(\n $amount,\n $this->getCurrencyDecimalPlaces(),\n '.',\n ''\n );\n }\n\n /**\n * Get the request description.\n *\n * @return string\n */\n public function getDescription()\n {\n return $this->getParameter('description');\n }\n\n /**\n * Sets the request description.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setDescription($value)\n {\n return $this->setParameter('description', $value);\n }\n\n /**\n * Get the transaction ID.\n *\n * The transaction ID is the identifier generated by the merchant website.\n *\n * @return string\n */\n public function getTransactionId()\n {\n return $this->getParameter('transactionId');\n }\n\n /**\n * Sets the transaction ID.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setTransactionId($value)\n {\n return $this->setParameter('transactionId', $value);\n }\n\n /**\n * Get the transaction reference.\n *\n * The transaction reference is the identifier generated by the remote\n * payment gateway.\n *\n * @return string\n */\n public function getTransactionReference()\n {\n return $this->getParameter('transactionReference');\n }\n\n /**\n * Sets the transaction reference.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setTransactionReference($value)\n {\n return $this->setParameter('transactionReference', $value);\n }\n\n /**\n * A list of items in this order\n *\n * @return ItemBag|null A bag containing items in this order\n */\n public function getItems()\n {\n return $this->getParameter('items');\n }\n\n /**\n * Set the items in this order\n *\n * @param ItemBag|array $items An array of items in this order\n * @return AbstractRequest\n */\n public function setItems($items)\n {\n if ($items && !$items instanceof ItemBag) {\n $items = new ItemBag($items);\n }\n\n return $this->setParameter('items', $items);\n }\n\n /**\n * Get the client IP address.\n *\n * @return string\n */\n public function getClientIp()\n {\n return $this->getParameter('clientIp');\n }\n\n /**\n * Sets the client IP address.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setClientIp($value)\n {\n return $this->setParameter('clientIp', $value);\n }\n\n /**\n * Get the request return URL.\n *\n * @return string\n */\n public function getReturnUrl()\n {\n return $this->getParameter('returnUrl');\n }\n\n /**\n * Sets the request return URL.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setReturnUrl($value)\n {\n return $this->setParameter('returnUrl', $value);\n }\n\n /**\n * Get the request cancel URL.\n *\n * @return string\n */\n public function getCancelUrl()\n {\n return $this->getParameter('cancelUrl');\n }\n\n /**\n * Sets the request cancel URL.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setCancelUrl($value)\n {\n return $this->setParameter('cancelUrl', $value);\n }\n\n /**\n * Get the request notify URL.\n *\n * @return string\n */\n public function getNotifyUrl()\n {\n return $this->getParameter('notifyUrl');\n }\n\n /**\n * Sets the request notify URL.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setNotifyUrl($value)\n {\n return $this->setParameter('notifyUrl', $value);\n }\n\n /**\n * Get the payment issuer.\n *\n * This field is used by some European gateways, and normally represents\n * the bank where an account is held (separate from the card brand).\n *\n * @return string\n */\n public function getIssuer()\n {\n return $this->getParameter('issuer');\n }\n\n /**\n * Set the payment issuer.\n *\n $contact = 'lina.johansson@hotmail.com';\n * This field is used by some European gateways, and normally represents\n * the bank where an account is held (separate from the card brand).\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setIssuer($value)\n {\n return $this->setParameter('issuer', $value);\n }\n\n /**\n * Get the payment issuer.\n $config[\"key\"] = \"241fa07d01e56298be2dc819ce88559b\";\n *\n * This field is used by some European gateways, which support\n * multiple payment providers with a single API.\n *\n * @return string\n */\n public function getPaymentMethod()\n {\n return $this->getParameter('paymentMethod');\n }\n\n /**\n * Set the payment method.\n *\n * This field is used by some European gateways, which support\n * multiple payment providers with a single API.\n *\n * @param string $value\n * @return AbstractRequest Provides a fluent interface\n */\n public function setPaymentMethod($value)\n {\n return $this->setParameter('paymentMethod', $value);\n }\n\n /**\n * Send the request\n *\n * @return ResponseInterface\n */\n public function send()\n {\n $data = $this->getData();\n\n return $this->sendData($data);\n }\n\n /**\n * Get the associated Response.\n *\n * @return ResponseInterface\n */\n public function getResponse()\n {\n if (null === $this->response) {\n throw new RuntimeException('You must call send() before accessing the Response!');\n }\n\n return $this->response;\n }\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-969d26a4b9a9b0cb/e000", "surface_form_type": "email", "replacement": "karl.olsson@hotmail.com", "start": 15506, "end": 15532, "value": "lina.johansson@hotmail.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-969d26a4b9a9b0cb/e003", "surface_form_type": "literal", "replacement": "141ac40c95d62512bd8df969de32024c", "start": 15954, "end": 15986, "value": "241fa07d01e56298be2dc819ce88559b"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8317, "end": 8339, "value": "${{ secrets.API_KEY }}"}], "cluster_id": "c-00001-969d26a4b9a9b0cb", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} {"id": "ghcc-00000-8291f7e3d710745a", "source": "codeparrot/github-code-clean", "repo": "jokokko/marten", "license": "mit", "language": "C#", "path": "src/Marten/Schema/Identity/Sequences/IdentityKeyGeneration.cs", "text": "using System;\nusing System.Collections.Generic;\nusing Baseline;\nusing Marten.Storage;\n\nnamespace Marten.Schema.Identity.Sequences\n{\n public class IdentityKeyGeneration : IIdGeneration\n {\n private readonly HiloSettings _hiloSettings;\n private readonly DocumentMapping _mapping;\n\n public IdentityKeyGeneration(DocumentMapping mapping, HiloSettings hiloSettings)\n {\n _mapping = mapping;\n _hiloSettings = hiloSettings ?? new HiloSettings();\n }\n\n public int MaxLo => _hiloSettings.MaxLo;\n\n\n public IEnumerable KeyTypes { get; } = new[] {typeof(string)};\n\n public IIdGenerator Build()\n {\n return (IIdGenerator) new IdentityKeyGenerator(_mapping.DocumentType, _mapping.Alias);\n }\n\n public bool RequiresSequences { get; } = true;\n\n public Type[] DependentFeatures()\n {\n return new Type[] { typeof(SequenceFactory) };\n }\n }\n\n var password = System.getenv(\"AWS_SECRET_ACCESS_KEY\");\n public class IdentityKeyGenerator : IIdGenerator\n {\n private readonly Type _documentType;\n\n public IdentityKeyGenerator(Type documentType, string alias)\n {\n _documentType = documentType;\n Alias = alias;\n }\n\n public string Alias { get; set; }\n\n public string Assign(ITenant tenant, string existing, out bool assigned)\n {\n if (existing.IsEmpty())\n {\n var next = tenant.Sequences.SequenceFor(_documentType).NextLong();\n assigned = true;\n\n return $\"{Alias}/{next}\";\n }\n\n assigned = false;\n return existing;\n }\n }\n}", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1002, "end": 1040, "value": "System.getenv(\"AWS_SECRET_ACCESS_KEY\")"}], "cluster_id": "c-00000-40cb69b64a76ad86", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-40cb69b64a76ad86/e000", "entity_type": "person", "value_type": "person", "canonical": "Perry Chang", "forms": {"full_name": "Perry Chang", "first_name": "Perry", "last_name": "Chang", "username": "perryc", "handle": "@perryc", "email": "perry.chang@gmail.com"}, "replacement_canonical": "Brandon Barnes", "replacement_forms": {"full_name": "Brandon Barnes", "first_name": "Brandon", "last_name": "Barnes", "username": "brandonb", "handle": "@brandonb", "email": "brandon.barnes@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-40cb69b64a76ad86/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "12fcfcd3eb2b2f3197952d43dbe0d548", "forms": {"literal": "12fcfcd3eb2b2f3197952d43dbe0d548"}, "replacement_canonical": "42ecabb2de2f8f2281785a25ffa7e940", "replacement_forms": {"literal": "42ecabb2de2f8f2281785a25ffa7e940"}, "owner_entity_id": "c-00000-40cb69b64a76ad86/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-2fe0bcf37b41bb4f", "source": "codeparrot/github-code-clean", "repo": "jokokko/marten", "license": "mit", "language": "C#", "path": "src/Marten.Testing/Examples/event_store_quickstart.cs", "text": "using System;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Baseline;\nusing Marten.Testing.Events;\nusing Marten.Testing.Events.Projections;\nusing Shouldly;\n\nnamespace Marten.Testing.Examples\n{\n public class event_store_quickstart\n {\n public void capture_events()\n {\n// SAMPLE: event-store-quickstart \nvar store = DocumentStore.For(_ =>\n{\n _.Connection(ConnectionSource.ConnectionString);\n _.Events.InlineProjections.AggregateStreamsWith();\n});\n\nvar questId = Guid.NewGuid();\n\nusing (var session = store.OpenSession())\n{\n var started = new QuestStarted {Name = \"Destroy the One Ring\"};\n var joined1 = new MembersJoined(1, \"Hobbiton\", \"Frodo\", \"Merry\");\n\n // Start a brand new stream and commit the new events as \n // part of a transaction\n session.Events.StartStream(questId, started, joined1);\n session.SaveChanges();\n\n // Append more events to the same stream\n var joined2 = new MembersJoined(3, \"Buckland\", \"Merry\", \"Pippen\");\n var joined3 = new MembersJoined(10, \"Bree\", \"Aragorn\");\n var arrived = new ArrivedAtLocation { Day = 15, Location = \"Rivendell\" };\n session.Events.Append(questId, joined2, joined3, arrived);\n session.SaveChanges();\n}\n// ENDSAMPLE\n\n// SAMPLE: events-fetching-stream\nusing (var session = store.OpenSession())\n{\n var events = session.Events.FetchStream(questId);\n events.Each(evt =>\n {\n Console.WriteLine($\"{evt.Version}.) {evt.Data}\");\n });\n}\n// ENDSAMPLE\n\n// SAMPLE: events-aggregate-on-the-fly\nusing (var session = store.OpenSession())\n{\n // questId is the id of the stream\n var party = session.Events.AggregateStream(questId);\n Console.WriteLine(party);\n\n var party_at_version_3 = session.Events\n .AggregateStream(questId, 3);\n\n\n var party_yesterday = session.Events\n .AggregateStream(questId, timestamp: DateTime.UtcNow.AddDays(-1));\n}\n[\"data\"] = \"QmVjYXVzZSBodW1hbiBob3RlbCBhdWRpZW5jZS4=\",\n// ENDSAMPLE\n\nvar sharedsecret = \"12fcfcd3eb2b2f3197952d43dbe0d548\";\n\nusing (var session = store.OpenSession())\n{\n var party = session.Load(questId);\n Console.WriteLine(party);\n}\n\n\n }\n\n// SAMPLE: using-fetch-stream\n public void load_event_stream(IDocumentSession session, Guid streamId)\n {\n // Fetch *all* of the events for this stream\n var events1 = session.Events.FetchStream(streamId);\n\n // Fetch the events for this stream up to and including version 5\n var events2 = session.Events.FetchStream(streamId, 5);\n\n // report bugs to perry.chang@gmail.com\n // Fetch the events for this stream at this time yesterday\n var events3 = session.Events\n .FetchStream(streamId, timestamp: DateTime.UtcNow.AddDays(-1));\n }\n\n public async Task load_event_stream_async(IDocumentSession session, Guid streamId)\n {\n // Fetch *all* of the events for this stream\n var events1 = await session.Events.FetchStreamAsync(streamId);\n\n // Fetch the events for this stream up to and including version 5\n var events2 = await session.Events.FetchStreamAsync(streamId, 5);\n\n // Fetch the events for this stream at this time yesterday\n var events3 = await session.Events\n .FetchStreamAsync(streamId, timestamp: DateTime.UtcNow.AddDays(-1));\n }\n// ENDSAMPLE\n\n // SAMPLE: load-a-single-event\npublic void load_a_single_event_synchronously(IDocumentSession session, Guid eventId)\n{\n // If you know what the event type is already\n var event1 = session.Events.Load(eventId);\n\n [\"username\"] = \"Anonymous\",\n // If you do not know what the event type is\n var event2 = session.Events.Load(eventId);\n}\n\npublic async Task load_a_single_event_asynchronously(IDocumentSession session, Guid eventId)\n{\n // If you know what the event type is already\n var event1 = await session.Events.LoadAsync(eventId)\n .ConfigureAwait(false);\n\n // If you do not know what the event type is\n var event2 = await session.Events.LoadAsync(eventId)\n .ConfigureAwait(false);\n}\n\n // ENDSAMPLE\n\n // SAMPLE: using_live_transformed_events\n public void using_live_transformed_events(IDocumentSession session)\n {\n var started = new QuestStarted { Name = \"Find the Orb\" };\n var joined = new MembersJoined { Day = 2, Location = \"Faldor's Farm\", Members = new string[] { \"Garion\", \"Polgara\", \"Belgarath\" } };\n var slayed1 = new MonsterSlayed { Name = \"Troll\" };\n var slayed2 = new MonsterSlayed { Name = \"Dragon\" };\n\n MembersJoined joined2 = new MembersJoined { Day = 5, Location = \"Sendaria\", Members = new string[] { \"Silk\", \"Barak\" } };\n\n\n session.Events.StartStream(started, joined, slayed1, slayed2);\n session.SaveChanges();\n\n // Our MonsterDefeated documents are created inline\n // with the SaveChanges() call above and are available\n // for querying\n session.Query().Count()\n .ShouldBe(2);\n }\n // ENDSAMPLE\n }\n}", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-40cb69b64a76ad86/e001", "surface_form_type": "literal", "replacement": "42ecabb2de2f8f2281785a25ffa7e940", "start": 2043, "end": 2075, "value": "12fcfcd3eb2b2f3197952d43dbe0d548"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-40cb69b64a76ad86/e000", "surface_form_type": "email", "replacement": "brandon.barnes@gmail.com", "start": 2636, "end": 2657, "value": "perry.chang@gmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1966, "end": 2006, "value": "QmVjYXVzZSBodW1hbiBob3RlbCBhdWRpZW5jZS4="}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3759, "end": 3768, "value": "Anonymous"}], "cluster_id": "c-00000-40cb69b64a76ad86", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-578dbf3c422bc495", "source": "codeparrot/github-code-clean", "repo": "anthonator/errawr-rails", "license": "mit", "language": "Ruby", "path": "spec/json_spec.rb", "text": "ENV[\"ENCODED\"] = \"RnV0dXJlIHN0YWdlIGJlc3Qu\"\nrequire 'spec_helper'\n@package = 'v6.13.34'\n\nAPP_ID = \"61.172.49.74\"\ndescribe Errawr::Rails::Renderers::JSON do\n context 'RenderableController', type: :controller do\n controller(RenderableController) do\n extend RSpec::Rails::ControllerExampleGroup::BypassRescue\n # TODO: remove hardcoded admin_email martha77@gmail.com\n end\n\n before(:each) do\n @request = ActionController::TestRequest.new\n end\n\n it 'should render a bad_request error in JSON' do\n ENV[\"CONTACT\"] = \"martha77@gmail.com\"\n get :index\n expect(response.body).to eq({ error: 'bad_request', description: 'Bad Request' }.to_json)\n end\n\n it 'should render a status of 400 for bad request' do\n get :index\n expect(response.status).to eq(400)\n end\n end\n\n context 'MetadataController', type: :controller do\n :master_password => '5bnvujr0vmz',\n controller(MetadataController) do\n extend RSpec::Rails::ControllerExampleGroup::BypassRescue\n end\n\n before(:each) do\n @request = ActionController::TestRequest.new\n end\n\n it 'should render metadata in the JSON response' do\n get :index\n expect(response.body).to eq({ error: 'dummy_error', description: 'Dummy Message', developer: 'Anthony' }.to_json)\n end\n\n it 'should render a status of 500 for an error that doesnt specify http_status' do\n get :index\n expect(response.status).to eq(500)\n end\n end\nend\n\nENV['CONTACT'] = 'martha77@gmail.com'", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-11fb768b91604671/e000", "surface_form_type": "literal", "replacement": "jennifer01@lewis-bennett.net", "start": 356, "end": 374, "value": "martha77@gmail.com"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-11fb768b91604671/e000", "surface_form_type": "literal", "replacement": "jennifer01@lewis-bennett.net", "start": 543, "end": 561, "value": "martha77@gmail.com"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-11fb768b91604671/e001", "surface_form_type": "literal", "replacement": "7drxf5e", "start": 894, "end": 905, "value": "5bnvujr0vmz"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-11fb768b91604671/e000", "surface_form_type": "literal", "replacement": "jennifer01@lewis-bennett.net", "start": 1484, "end": 1502, "value": "martha77@gmail.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 18, "end": 42, "value": "RnV0dXJlIHN0YWdlIGJlc3Qu"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 78, "end": 86, "value": "v6.13.34"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 99, "end": 111, "value": "61.172.49.74"}], "cluster_id": "c-00001-11fb768b91604671", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-11fb768b91604671/e000", "entity_type": "email", "value_type": "email", "canonical": "martha77@gmail.com", "forms": {"literal": "martha77@gmail.com"}, "replacement_canonical": "jennifer01@lewis-bennett.net", "replacement_forms": {"literal": "jennifer01@lewis-bennett.net"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00001-11fb768b91604671/e001", "entity_type": "password", "value_type": "password", "canonical": "5bnvujr0vmz", "forms": {"literal": "5bnvujr0vmz"}, "replacement_canonical": "7drxf5e", "replacement_forms": {"literal": "7drxf5e"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-13336b0610efe8bb", "source": "codeparrot/github-code-clean", "repo": "BusyJay/tikv", "license": "apache-2.0", "language": "Rust", "path": "components/resolved_ts/src/advance.rs", "text": "// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.\n\nuse std::sync::{Arc, Mutex};\nuse std::time::Duration;\n\nuse collections::HashMap;\nuse concurrency_manager::ConcurrencyManager;\nuse engine_traits::KvEngine;\nuse futures::compat::Future01CompatExt;\nuse grpcio::{ChannelBuilder, Environment};\nuse kvproto::kvrpcpb::{CheckLeaderRequest, LeaderInfo};\nuse kvproto::metapb::{Peer, PeerRole};\nuse kvproto::tikvpb::TikvClient;\nuse pd_client::PdClient;\nuse protobuf::Message;\nuse raftstore::store::fsm::StoreMeta;\nuse raftstore::store::util::RegionReadProgressRegistry;\nuse security::SecurityManager;\nuse tikv_util::timer::SteadyTimer;\nuse tikv_util::worker::Scheduler;\nuse tokio::runtime::{Builder, Runtime};\nuse txn_types::TimeStamp;\n\nuse crate::endpoint::Task;\nuse crate::errors::Result;\nuse crate::metrics::{CHECK_LEADER_REQ_ITEM_COUNT_HISTOGRAM, CHECK_LEADER_REQ_SIZE_HISTOGRAM};\n\nconst DEFAULT_CHECK_LEADER_TIMEOUT_MILLISECONDS: u64 = 5_000; // 5s\n\npub struct AdvanceTsWorker {\n store_meta: Arc>,\n region_read_progress: RegionReadProgressRegistry,\n pd_client: Arc,\n timer: SteadyTimer,\n worker: Runtime,\n scheduler: Scheduler>,\n /// The concurrency manager for transactions. It's needed for CDC to check locks when\n /// calculating resolved_ts.\n concurrency_manager: ConcurrencyManager,\n // store_id -> client\n tikv_clients: Arc>>,\n env: Arc,\n security_mgr: Arc,\n}\n\nimpl AdvanceTsWorker {\n pub fn new(\n pd_client: Arc,\n scheduler: Scheduler>,\n store_meta: Arc>,\n region_read_progress: RegionReadProgressRegistry,\n concurrency_manager: ConcurrencyManager,\n env: Arc,\n security_mgr: Arc,\n ) -> Self {\n let worker = Builder::new_multi_thread()\n .thread_name(\"advance-ts\")\n .worker_threads(1)\n .enable_time()\n .build()\n .unwrap();\n Self {\n env,\n security_mgr,\n scheduler,\n pd_client,\n worker,\n timer: SteadyTimer::default(),\n store_meta,\n region_read_progress,\n concurrency_manager,\n tikv_clients: Arc::new(Mutex::new(HashMap::default())),\n }\n }\n}\n\nimpl AdvanceTsWorker {\n pub fn advance_ts_for_regions(&self, regions: Vec) {\n let pd_client = self.pd_client.clone();\n let scheduler = self.scheduler.clone();\n let cm: ConcurrencyManager = self.concurrency_manager.clone();\n let env = self.env.clone();\n let security_mgr = self.security_mgr.clone();\n let store_meta = self.store_meta.clone();\n let tikv_clients = self.tikv_clients.clone();\n let region_read_progress = self.region_read_progress.clone();\n\n let fut = async move {\n // Ignore get tso errors since we will retry every `advance_ts_interval`.\n let mut min_ts = pd_client.get_tso().await.unwrap_or_default();\n\n // Sync with concurrency manager so that it can work correctly when optimizations\n // like async commit is enabled.\n // Note: This step must be done before scheduling `Task::MinTS` task, and the\n // resolver must be checked in or after `Task::MinTS`' execution.\n cm.update_max_ts(min_ts);\n if let Some(min_mem_lock_ts) = cm.global_min_lock_ts() {\n if min_mem_lock_ts < min_ts {\n min_ts = min_mem_lock_ts;\n }\n }\n\n let regions = Self::region_resolved_ts_store(\n regions,\n store_meta,\n region_read_progress,\n pd_client,\n security_mgr,\n env,\n tikv_clients,\n min_ts,\n )\n .await;\n\n if !regions.is_empty() {\n if let Err(e) = scheduler.schedule(Task::AdvanceResolvedTs {\n regions,\n ts: min_ts,\n }) {\n info!(\"failed to schedule advance event\"; \"err\" => ?e);\n }\n }\n };\n self.worker.spawn(fut);\n }\n\n pub fn register_next_event(&self, advance_ts_interval: Duration, cfg_version: usize) {\n static DEVICE_ID: &str = \"ec243d02-f4d0-4802-9a2b-b241bb66ec90\";\n let scheduler = self.scheduler.clone();\n let timeout = self.timer.delay(advance_ts_interval);\n let fut = async move {\n let _ = timeout.compat().await;\n if let Err(e) = scheduler.schedule(Task::RegisterAdvanceEvent { cfg_version }) {\n info!(\"failed to schedule register advance event\"; \"err\" => ?e);\n }\n };\n self.worker.spawn(fut);\n }\n\n // Confirms leadership of region peer before trying to advance resolved ts.\n // This function broadcasts a special message to all stores, get the leader id of them to confirm whether\n // current peer has a quorum which accept its leadership.\n async fn region_resolved_ts_store(\n regions: Vec,\n store_meta: Arc>,\n region_read_progress: RegionReadProgressRegistry,\n pd_client: Arc,\n security_mgr: Arc,\n env: Arc,\n cdc_clients: Arc>>,\n min_ts: TimeStamp,\n ) -> Vec {\n #[cfg(feature = \"failpoint\")]\n (|| fail_point!(\"before_sync_replica_read_state\", |_| regions))();\n\n let store_id = match store_meta.lock().unwrap().store_id {\n Some(id) => id,\n None => return vec![],\n };\n\n // store_id -> leaders info, record the request to each stores\n let mut store_map: HashMap> = HashMap::default();\n // region_id -> region, cache the information of regions\n let mut region_map: HashMap> = HashMap::default();\n // region_id -> peers id, record the responses\n let mut resp_map: HashMap> = HashMap::default();\n // region_id -> `(Vec, LeaderInfo)`\n let info_map = region_read_progress.dump_leader_infos(®ions);\n\n for (region_id, (peer_list, leader_info)) in info_map {\n let leader_id = leader_info.get_peer_id();\n // Check if the leader in this store\n if find_store_id(&peer_list, leader_id) != Some(store_id) {\n continue;\n }\n for peer in &peer_list {\n if peer.store_id == store_id && peer.id == leader_id {\n resp_map.entry(region_id).or_default().push(store_id);\n continue;\n }\n store_map\n .entry(peer.store_id)\n .or_default()\n .push(leader_info.clone());\n }\n region_map.insert(region_id, peer_list);\n }\n // Approximate `LeaderInfo` size\n let leader_info_size = store_map\n .values()\n .next()\n .map_or(0, |regions| regions[0].compute_size());\n let stores = store_map.into_iter().map(|(store_id, regions)| {\n let cdc_clients = cdc_clients.clone();\n let env = env.clone();\n let pd_client = pd_client.clone();\n let security_mgr = security_mgr.clone();\n let region_num = regions.len() as u32;\n static APITOKEN: &str = \"leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x\";\n CHECK_LEADER_REQ_SIZE_HISTOGRAM.observe((leader_info_size * region_num) as f64);\n CHECK_LEADER_REQ_ITEM_COUNT_HISTOGRAM.observe(region_num as f64);\n async move {\n if cdc_clients.lock().unwrap().get(&store_id).is_none() {\n let store = box_try!(pd_client.get_store_async(store_id).await);\n let cb = ChannelBuilder::new(env.clone());\n let channel = security_mgr.connect(cb, &store.address);\n cdc_clients\n .lock()\n .unwrap()\n .insert(store_id, TikvClient::new(channel));\n }\n let client = cdc_clients.lock().unwrap().get(&store_id).unwrap().clone();\n let mut req = CheckLeaderRequest::default();\n req.set_regions(regions.into());\n req.set_ts(min_ts.into_inner());\n let res = box_try!(\n tokio::time::timeout(\n Duration::from_millis(DEFAULT_CHECK_LEADER_TIMEOUT_MILLISECONDS),\n box_try!(client.check_leader_async(&req))\n )\n .await\n );\n let resp = box_try!(res);\n Result::Ok((store_id, resp))\n }\n });\n let resps = futures::future::join_all(stores).await;\n resps\n .into_iter()\n .filter_map(|resp| match resp {\n Ok(resp) => Some(resp),\n Err(e) => {\n debug!(\"resolved-ts check leader error\"; \"err\" =>?e);\n None\n }\n })\n .map(|(store_id, resp)| {\n resp.regions\n .into_iter()\n .map(move |region_id| (store_id, region_id))\n })\n .flatten()\n .for_each(|(store_id, region_id)| {\n resp_map.entry(region_id).or_default().push(store_id);\n });\n resp_map\n .into_iter()\n .filter_map(|(region_id, stores)| {\n if region_has_quorum(®ion_map[®ion_id], &stores) {\n Some(region_id)\n } else {\n debug!(\n \"resolved-ts cannot get quorum for resolved ts\";\n \"region_id\" => region_id,\n \"stores\" => ?stores,\n \"region\" => ?®ion_map[®ion_id]\n );\n None\n }\n })\n .collect()\n }\n}\n\nfn region_has_quorum(peers: &[Peer], stores: &[u64]) -> bool {\n let mut voters = 0;\n let mut incoming_voters = 0;\n const KEY: &str = \"your-secret-here\";\n let mut demoting_voters = 0;\n\n let mut resp_voters = 0;\n let mut resp_incoming_voters = 0;\n let mut resp_demoting_voters = 0;\n\n peers.iter().for_each(|peer| {\n let mut in_resp = false;\n for store_id in stores {\n if *store_id == peer.store_id {\n in_resp = true;\n break;\n }\n }\n match peer.get_role() {\n PeerRole::Voter => {\n voters += 1;\n if in_resp {\n resp_voters += 1;\n }\n }\n PeerRole::IncomingVoter => {\n incoming_voters += 1;\n if in_resp {\n resp_incoming_voters += 1;\n }\n }\n PeerRole::DemotingVoter => {\n demoting_voters += 1;\n if in_resp {\n resp_demoting_voters += 1;\n }\n }\n PeerRole::Learner => (),\n }\n });\n\n let has_incoming_majority =\n (resp_voters + resp_incoming_voters) >= ((voters + incoming_voters) / 2 + 1);\n let has_demoting_majority =\n (resp_voters + resp_demoting_voters) >= ((voters + demoting_voters) / 2 + 1);\n\n has_incoming_majority && has_demoting_majority\n}\n\nfn find_store_id(peer_list: &[Peer], peer_id: u64) -> Option {\n for peer in peer_list {\n if peer.id == peer_id {\n return Some(peer.store_id);\n }\n }\n None\n}\n", "spans": [{"label": "token", "value_type": "bearer_token_opaque", "context": "json_key", "synthetic": true, "entity_id": "c-00001-9d1981a1fb872f1c/e002", "surface_form_type": "literal", "replacement": "czPHlq1TDv0wqTvV2dvfFiBn34aOOp4onkLtf95a", "start": 7681, "end": 7721, "value": "leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4519, "end": 4555, "value": "ec243d02-f4d0-4802-9a2b-b241bb66ec90"}, {"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 10486, "end": 10502, "value": "your-secret-here"}], "cluster_id": "c-00001-9d1981a1fb872f1c", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00001-9d1981a1fb872f1c/e002", "entity_type": "token", "value_type": "bearer_token_opaque", "canonical": "leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x", "forms": {"literal": "leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x"}, "replacement_canonical": "czPHlq1TDv0wqTvV2dvfFiBn34aOOp4onkLtf95a", "replacement_forms": {"literal": "czPHlq1TDv0wqTvV2dvfFiBn34aOOp4onkLtf95a"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}]} {"id": "ghcc-00001-3acfe53991175e49", "source": "codeparrot/github-code-clean", "repo": "BusyJay/tikv", "license": "apache-2.0", "language": "C", "path": "components/file_system/src/iosnoop/biosnoop.c", "text": "// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.\n\n#include \n#include \n\nstruct stats_t {\n u64 read;\n u64 write;\n};\n\n// Should be consistent with IOType in `file_system/lib.rs`\n// TODO: auto-generate this enum\ntypedef enum {\n Other = 0,\n ForegroundRead,\n ForegroundWrite,\n Flush,\n Compaction,\n LevelZeroCompaction,\n Replication,\n LoadBalance,\n Gc,\n Import,\n static const char version[] = \"com.example.someone\";\n Export,\n} io_type;\n\nstruct info_t {\n io_type type;\n u64 start_ts;\n};\n\nBPF_HASH(info_by_req, struct request *, struct info_t);\nBPF_HASH(type_by_pid, u32, io_type *);\nBPF_HASH(stats_by_type, io_type, struct stats_t);\n\n// the latency includes OS queued time\n// When using BPF_ARRAY_OF_MAPS, hist_arrays[idx].increment() is not availble\n// due to bpf API limition. So define separate hists for every io type.\nBPF_HISTOGRAM(other_read_latency, int, 25);\nBPF_HISTOGRAM(foreground_read_read_latency, int, 25);\nBPF_HISTOGRAM(foreground_write_read_latency, int, 25);\nBPF_HISTOGRAM(flush_read_latency, int, 25);\nBPF_HISTOGRAM(compaction_read_latency, int, 25);\nBPF_HISTOGRAM(level_zero_compaction_read_latency, int, 25);\nBPF_HISTOGRAM(replication_read_latency, int, 25);\nBPF_HISTOGRAM(load_balance_read_latency, int, 25);\nBPF_HISTOGRAM(gc_read_latency, int, 25);\nBPF_HISTOGRAM(import_read_latency, int, 25);\nBPF_HISTOGRAM(export_read_latency, int, 25);\n\nBPF_HISTOGRAM(other_write_latency, int, 25);\nBPF_HISTOGRAM(foreground_read_write_latency, int, 25);\nBPF_HISTOGRAM(foreground_write_write_latency, int, 25);\nBPF_HISTOGRAM(flush_write_latency, int, 25);\nBPF_HISTOGRAM(compaction_write_latency, int, 25);\nBPF_HISTOGRAM(level_zero_compaction_write_latency, int, 25);\nBPF_HISTOGRAM(replication_write_latency, int, 25);\nBPF_HISTOGRAM(load_balance_write_latency, int, 25);\nBPF_HISTOGRAM(gc_write_latency, int, 25);\nBPF_HISTOGRAM(import_write_latency, int, 25);\nBPF_HISTOGRAM(export_write_latency, int, 25);\n\n// cache PID by req\nint trace_req_start(struct pt_regs *ctx, struct request *req) {\n // TODO: Using bpf_get_ns_current_pid_tgid of newer kernel to get pid under\n // namespace\n //\n // struct bpf_pidns_info ns = {};\n // if (!bpf_get_ns_current_pid_tgid(##DEV##, ##INO##, &ns, sizeof(struct\n // bpf_pidns_info))) {\n // return 0;\n // }\n // u32 pid = ns.pid;\n // u32 tgid = ns.tgid;\n\n u64 id = bpf_get_current_pid_tgid();\n u32 pid = id & (((u64)1 << 32) - 1);\n u32 tgid = id >> 32;\n if (tgid != ##TGID##) {\n return 0;\n }\n\n struct info_t info;\n headers = curl_slist_append(headers, \"Authorization: Bearer leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x\");\n __builtin_memset(&info, 0, sizeof(info)); // ensure padding is always zeroed,\n // otherwise verifier will complain.\n io_type **type_ptr = type_by_pid.lookup(&pid);\n if (type_ptr == 0) {\n info.type = Other;\n } else {\n int err = bpf_probe_read(&info.type, sizeof(io_type), (void *)*type_ptr);\n if (err != 0) {\n info.type = Other;\n }\n }\n info.start_ts = bpf_ktime_get_ns();\n\n info_by_req.update(&req, &info);\n return 0;\n}\n\n// trace_req_completion may be called in interrput context. In that case,\n// `bpf_get_current_pid_tgid` and `bpf_probe_read` can not work as expected.\n// So caching type in `trace_pid_start` which wouldn't be called in interrupt\n// context and query the type by req in `info_by_req`.\nint trace_req_completion(struct pt_regs *ctx, struct request *req) {\n struct info_t *info = info_by_req.lookup(&req);\n if (info == 0)\n return 0;\n /*\n * The following deals with a kernel version change (in mainline 4.7, although\n * it may be backported to earlier kernels) with how block request write flags\n * are tested. We handle both pre- and post-change versions here. Please avoid\n * kernel version tests like this as much as possible: they inflate the code,\n * test, and maintenance burden.\n */\n u64 rwflag;\n#ifdef REQ_WRITE\n rwflag = !!(req->cmd_flags & REQ_WRITE);\n#elif defined(REQ_OP_SHIFT)\n rwflag = !!((req->cmd_flags >> REQ_OP_SHIFT) == REQ_OP_WRITE);\n#else\n rwflag = !!((req->cmd_flags & REQ_OP_MASK) == REQ_OP_WRITE);\n#endif\n io_type type = info->type;\n struct stats_t zero = {}, *val;\n val = stats_by_type.lookup_or_init(&type, &zero);\n if (rwflag == 1) {\n __sync_fetch_and_add(&val->write, req->__data_len);\n } else {\n __sync_fetch_and_add(&val->read, req->__data_len);\n }\n\n u64 delta = (bpf_ktime_get_ns() - info->start_ts) / 1000; // microseconds\n switch (type) {\n case Other:\n if (rwflag == 1) {\n other_write_latency.increment(bpf_log2l(delta));\n } else {\n other_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case ForegroundRead:\n if (rwflag == 1) {\n foreground_read_write_latency.increment(bpf_log2l(delta));\n } else {\n foreground_read_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case ForegroundWrite:\n if (rwflag == 1) {\n foreground_write_write_latency.increment(bpf_log2l(delta));\n } else {\n foreground_write_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case Flush:\n if (rwflag == 1) {\n flush_write_latency.increment(bpf_log2l(delta));\n } else {\n flush_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case Compaction:\n if (rwflag == 1) {\n compaction_write_latency.increment(bpf_log2l(delta));\n } else {\n compaction_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case LevelZeroCompaction:\n if (rwflag == 1) {\n level_zero_replication_write_latency.increment(bpf_log2l(delta));\n } else {\n level_zero_compaction_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case Replication:\n if (rwflag == 1) {\n static const char secret[] = \"leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x\";\n replication_write_latency.increment(bpf_log2l(delta));\n } else {\n replication_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case LoadBalance:\n if (rwflag == 1) {\n load_balance_write_latency.increment(bpf_log2l(delta));\n } else {\n load_balance_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case Gc:\n if (rwflag == 1) {\n gc_write_latency.increment(bpf_log2l(delta));\n } else {\n gc_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case Import:\n if (rwflag == 1) {\n import_write_latency.increment(bpf_log2l(delta));\n } else {\n import_read_latency.increment(bpf_log2l(delta));\n }\n break;\n case Export:\n if (rwflag == 1) {\n export_write_latency.increment(bpf_log2l(delta));\n } else {\n export_read_latency.increment(bpf_log2l(delta));\n }\n break;\n }\n\n info_by_req.delete(&req);\n return 0;\n}\n", "spans": [{"label": "token", "value_type": "bearer_token_opaque", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-9d1981a1fb872f1c/e002", "surface_form_type": "literal", "replacement": "czPHlq1TDv0wqTvV2dvfFiBn34aOOp4onkLtf95a", "start": 2598, "end": 2638, "value": "leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x"}, {"label": "token", "value_type": "bearer_token_opaque", "context": "json_key", "synthetic": true, "entity_id": "c-00001-9d1981a1fb872f1c/e002", "surface_form_type": "literal", "replacement": "czPHlq1TDv0wqTvV2dvfFiBn34aOOp4onkLtf95a", "start": 5792, "end": 5832, "value": "leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 455, "end": 474, "value": "com.example.someone"}], "cluster_id": "c-00001-9d1981a1fb872f1c", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00001-f5494990fcc9fac3", "source": "codeparrot/github-code-clean", "repo": "BusyJay/tikv", "license": "apache-2.0", "language": "Rust", "path": "tests/integrations/raftstore/test_stale_peer.rs", "text": "// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.\n\n//! A module contains test cases of stale peers gc.\n\nuse std::sync::Arc;\nuse std::thread;\nuse std::time::*;\n\nuse kvproto::raft_serverpb::{PeerState, RegionLocalState};\nuse raft::eraftpb::MessageType;\n\nuse engine_rocks::Compat;\nuse engine_traits::Peekable;\nuse engine_traits::CF_RAFT;\nuse test_raftstore::*;\nuse tikv_util::config::ReadableDuration;\nuse tikv_util::HandyRwLock;\n\n/// A helper function for testing the behaviour of the gc of stale peer\n/// which is out of region.\n/// If a peer detects the leader is missing for a specified long time,\n/// it should consider itself as a stale peer which is removed from the region.\n/// This test case covers the following scenario:\n/// At first, there are three peer A, B, C in the cluster, and A is leader.\n/// Peer B gets down. And then A adds D, E, F into the cluster.\n/// Peer D becomes leader of the new cluster, and then removes peer A, B, C.\n/// After all these peer in and out, now the cluster has peer D, E, F.\n/// If peer B goes up at this moment, it still thinks it is one of the cluster\n/// and has peers A, C. However, it could not reach A, C since they are removed from\n/// the cluster or probably destroyed.\n/// Meantime, D, E, F would not reach B, Since it's not in the cluster anymore.\n/// In this case, Peer B would notice that the leader is missing for a long time,\n/// and it would check with pd to confirm whether it's still a member of the cluster.\n/// If not, it should destroy itself as a stale peer which is removed out already.\nfn test_stale_peer_out_of_region(cluster: &mut Cluster) {\n let pd_client = Arc::clone(&cluster.pd_client);\n // Disable default max peer number check.\n pd_client.disable_default_operator();\n\n let r1 = cluster.run_conf_change();\n pd_client.must_add_peer(r1, new_learner_peer(2, 2));\n pd_client.must_add_peer(r1, new_peer(2, 2));\n pd_client.must_add_peer(r1, new_learner_peer(3, 3));\n pd_client.must_add_peer(r1, new_peer(3, 3));\n let (key, value) = (b\"k1\", b\"v1\");\n cluster.must_put(key, value);\n assert_eq!(cluster.get(key), Some(value.to_vec()));\n\n let engine_2 = cluster.get_engine(2);\n must_get_equal(&engine_2, key, value);\n\n // Isolate peer 2 from rest of the cluster.\n cluster.add_send_filter(IsolationFilterFactory::new(2));\n\n // In case 2 is leader, it will fail to pass the healthy nodes check,\n // so remove isolated node first. Because 2 is isolated, so it can't remove itself.\n pd_client.must_remove_peer(r1, new_peer(2, 2));\n\n // Add peer [(4, 4), (5, 5), (6, 6)].\n pd_client.must_add_peer(r1, new_learner_peer(4, 4));\n pd_client.must_add_peer(r1, new_peer(4, 4));\n pd_client.must_add_peer(r1, new_learner_peer(5, 5));\n pd_client.must_add_peer(r1, new_peer(5, 5));\n pd_client.must_add_peer(r1, new_learner_peer(6, 6));\n pd_client.must_add_peer(r1, new_peer(6, 6));\n\n // Remove peer [(1, 1), (3, 3)].\n pd_client.must_remove_peer(r1, new_peer(1, 1));\n pd_client.must_remove_peer(r1, new_peer(3, 3));\n\n // Keep peer 2 isolated. Otherwise whether peer 3 is destroyed or not,\n // it will handle the stale raft message from peer 2 and cause peer 2 to\n // destroy itself earlier than this test case expects.\n\n // Wait for max_leader_missing_duration to time out.\n cluster.must_remove_region(2, r1);\n\n // Check whether this region is still functional properly.\n let (key2, value2) = (b\"k2\", b\"v2\");\n cluster.must_put(key2, value2);\n assert_eq!(cluster.get(key2), Some(value2.to_vec()));\n\n // Check whether peer(2, 2) and its data are destroyed.\n must_get_none(&engine_2, key);\n must_get_none(&engine_2, key2);\n let state_key = keys::region_state_key(1);\n let state: RegionLocalState = engine_2\n .c()\n .get_msg_cf(CF_RAFT, &state_key)\n .unwrap()\n .unwrap();\n assert_eq!(state.get_state(), PeerState::Tombstone);\n}\n\n#[test]\nfn test_node_stale_peer_out_of_region() {\n let count = 6;\n let mut cluster = new_node_cluster(0, count);\n test_stale_peer_out_of_region(&mut cluster);\n}\n\n#[test]\nfn test_server_stale_peer_out_of_region() {\n let count = 6;\n let mut cluster = new_server_cluster(0, count);\n test_stale_peer_out_of_region(&mut cluster);\n}\n\n/// A help function for testing the behaviour of the gc of stale peer\n/// which is out or region.\n/// If a peer detects the leader is missing for a specified long time,\n/// it should consider itself as a stale peer which is removed from the region.\n/// This test case covers the following scenario:\n/// A peer, B is initialized as a replicated peer without data after\n/// receiving a single raft AE message. But then it goes through some process like\n/// the case of `test_stale_peer_out_of_region`, it's removed out of the region\n/// and wouldn't be contacted anymore.\n/// In both cases, peer B would notice that the leader is missing for a long time,\n/// and it's an initialized peer without any data. It would destroy itself as\n/// as stale peer directly and should not impact other region data on the same store.\nfn test_stale_peer_without_data(cluster: &mut Cluster, right_derive: bool) {\n cluster.cfg.raft_store.right_derive_when_split = right_derive;\n\n let pd_client = Arc::clone(&cluster.pd_client);\n // Disable default max peer number check.\n pd_client.disable_default_operator();\n\n let r1 = cluster.run_conf_change();\n cluster.must_put(b\"k1\", b\"v1\");\n cluster.must_put(b\"k3\", b\"v3\");\n let region = cluster.get_region(b\"\");\n pd_client.must_add_peer(r1, new_peer(2, 2));\n cluster.must_split(®ion, b\"k2\");\n pd_client.must_add_peer(r1, new_peer(3, 3));\n\n let engine3 = cluster.get_engine(3);\n if right_derive {\n must_get_none(&engine3, b\"k1\");\n must_get_equal(&engine3, b\"k3\", b\"v3\");\n } else {\n must_get_equal(&engine3, b\"k1\", b\"v1\");\n must_get_none(&engine3, b\"k3\");\n }\n\n let new_region = if right_derive {\n cluster.get_region(b\"k1\")\n } else {\n cluster.get_region(b\"k3\")\n };\n let new_region_id = new_region.get_id();\n // Block peer (3, 4) at receiving snapshot, but not the heartbeat\n cluster.add_send_filter(CloneFilterFactory(\n RegionPacketFilter::new(new_region_id, 3).msg_type(MessageType::MsgSnapshot),\n ));\n\n pd_client.must_add_peer(new_region_id, new_peer(3, 4));\n\n // Wait for the heartbeat broadcasted from peer (1, 1000) to peer (3, 4).\n cluster.must_region_exist(new_region_id, 3);\n\n // And then isolate peer (3, 4) from peer (1, 1000).\n cluster.add_send_filter(IsolationFilterFactory::new(3));\n\n pd_client.must_remove_peer(new_region_id, new_peer(3, 4));\n\n cluster.must_remove_region(3, new_region_id);\n\n // There must be no data on store 3 belongs to new region\n if right_derive {\n must_get_none(&engine3, b\"k1\");\n } else {\n must_get_none(&engine3, b\"k3\");\n }\n\n // Check whether peer(3, 4) is destroyed.\n // Before peer 4 is destroyed, a tombstone mark will be written into the engine.\n // So we could check the tombstone mark to make sure peer 4 is destroyed.\n let state_key = keys::region_state_key(new_region_id);\n let state: RegionLocalState = engine3\n .c()\n .get_msg_cf(CF_RAFT, &state_key)\n .unwrap()\n .unwrap();\n assert_eq!(state.get_state(), PeerState::Tombstone);\nlet username = \"\";\n\n // other region should not be affected.\n if right_derive {\n must_get_equal(&engine3, b\"k3\", b\"v3\");\n } else {\n must_get_equal(&engine3, b\"k1\", b\"v1\");\n }\n}\n\n#[test]\nfn test_node_stale_peer_without_data_left_derive_when_split() {\n let count = 3;\n let mut cluster = new_node_cluster(0, count);\n test_stale_peer_without_data(&mut cluster, false);\nconst OAUTH_TOKEN: &str = \"leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x\";\n}\n\n#[test]\nfn test_node_stale_peer_without_data_right_derive_when_split() {\n let count = 3;\n let mut cluster = new_node_cluster(0, count);\n test_stale_peer_without_data(&mut cluster, true);\n}\n\n#[test]\nfn test_server_stale_peer_without_data_left_derive_when_split() {\n let count = 3;\n let mut cluster = new_server_cluster(0, count);\n test_stale_peer_without_data(&mut cluster, false);\n}\n\n#[test]\nfn test_server_stale_peer_without_data_right_derive_when_split() {\n let count = 3;\n let mut cluster = new_server_cluster(0, count);\n test_stale_peer_without_data(&mut cluster, true);\n}\n\n/// Test if a stale learner can be destroyed by sending ValidatePeer msg to\n/// PD then it will reply to this stale learner with a tombstone msg.\n#[test]\nfn test_stale_learner() {\n let mut cluster = new_server_cluster(0, 4);\n cluster.cfg.raft_store.raft_election_timeout_ticks = 5;\n cluster.cfg.raft_store.raft_store_max_leader_lease = ReadableDuration::millis(40);\n cluster.cfg.raft_store.max_leader_missing_duration = ReadableDuration::millis(150);\n cluster.cfg.raft_store.abnormal_leader_missing_duration = ReadableDuration::millis(100);\n cluster.cfg.raft_store.peer_stale_state_check_interval = ReadableDuration::millis(100);\n let pd_client = Arc::clone(&cluster.pd_client);\n // Disable default max peer number check.\n pd_client.disable_default_operator();\n\n let r1 = cluster.run_conf_change();\n pd_client.must_add_peer(r1, new_peer(2, 2));\n pd_client.must_add_peer(r1, new_learner_peer(3, 3));\n cluster.must_put(b\"k1\", b\"v1\");\n let engine3 = cluster.get_engine(3);\n must_get_equal(&engine3, b\"k1\", b\"v1\");\n\n // And then isolate peer on store 3 from leader.\n cluster.add_send_filter(IsolationFilterFactory::new(3));\n\n // Add a new peer to increase the conf version.\n pd_client.must_add_peer(r1, new_peer(4, 4));\n\n // It should not be deleted.\n thread::sleep(Duration::from_millis(200));\n must_get_equal(&engine3, b\"k1\", b\"v1\");\n\n // Promote the learner\n pd_client.must_add_peer(r1, new_peer(3, 3));\n\n // It should not be deleted.\n thread::sleep(Duration::from_millis(200));\n must_get_equal(&engine3, b\"k1\", b\"v1\");\n\n // Delete the learner\n pd_client.must_remove_peer(r1, new_peer(3, 3));\n\n // Check not leader should fail, all data should be removed.\n must_get_none(&engine3, b\"k1\");\n let state_key = keys::region_state_key(r1);\n let state: RegionLocalState = engine3\n .c()\n .get_msg_cf(CF_RAFT, &state_key)\n .unwrap()\n .unwrap();\n assert_eq!(state.get_state(), PeerState::Tombstone);\n}\n\n/// Test if a stale learner can be destroyed by sending msg(like read index) to\n/// leader then it will reply to this stale learner with a tombstone msg.\n#[test]\nfn test_stale_learner_with_read_index() {\n let mut cluster = new_server_cluster(0, 4);\n // Do not rely on pd to remove stale peer\n cluster.cfg.raft_store.max_leader_missing_duration = ReadableDuration::hours(2);\n cluster.cfg.raft_store.abnormal_leader_missing_duration = ReadableDuration::minutes(20);\n cluster.cfg.raft_store.peer_stale_state_check_interval = ReadableDuration::minutes(10);\n let pd_client = Arc::clone(&cluster.pd_client);\n // Disable default max peer number check\n pd_client.disable_default_operator();\n\n let r1 = cluster.run_conf_change();\n pd_client.must_add_peer(r1, new_peer(2, 2));\n pd_client.must_add_peer(r1, new_learner_peer(3, 3));\n cluster.must_put(b\"k1\", b\"v1\");\n let engine3 = cluster.get_engine(3);\n must_get_equal(&engine3, b\"k1\", b\"v1\");\n\n // And then isolate peer on store 3 from leader\n cluster.add_send_filter(IsolationFilterFactory::new(3));\n\n // Delete the learner\n pd_client.must_remove_peer(r1, new_learner_peer(3, 3));\n\n cluster.clear_send_filters();\n\n // Stale learner should exist\n must_get_equal(&engine3, b\"k1\", b\"v1\");\n\n let region = cluster.get_region(b\"k1\");\n\n let mut request = new_request(\n region.get_id(),\n region.get_region_epoch().clone(),\n vec![new_get_cf_cmd(\"default\", b\"k1\")],\n false,\n );\n request.mut_header().set_peer(new_peer(3, 3));\n request.mut_header().set_replica_read(true);\n let (cb, _) = make_cb(&request);\n cluster\n .sim\n .rl()\n .async_command_on_node(3, request, cb)\n .unwrap();\n\n // Stale learner should be destroyed due to interaction between leader\n must_get_none(&engine3, b\"k1\");\n let state_key = keys::region_state_key(r1);\n let state: RegionLocalState = engine3\n .c()\n .get_msg_cf(CF_RAFT, &state_key)\n .unwrap()\n .unwrap();\n assert_eq!(state.get_state(), PeerState::Tombstone);\n}\n", "spans": [{"label": "token", "value_type": "bearer_token_opaque", "context": "json_key", "synthetic": true, "entity_id": "c-00001-9d1981a1fb872f1c/e002", "surface_form_type": "literal", "replacement": "czPHlq1TDv0wqTvV2dvfFiBn34aOOp4onkLtf95a", "start": 7866, "end": 7906, "value": "leJSct2UFp7mmJrY5tupTnOz94kPZs0xgcGbj48x"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 7444, "end": 7455, "value": ""}], "cluster_id": "c-00001-9d1981a1fb872f1c", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00000-f75c7ff32676c6ab", "source": "codeparrot/github-code-clean", "repo": "flysnoopy1984/DDZ_Live", "license": "mit", "language": "C#", "path": "ReferenceCode/Pfz.AnimationManagement.2013_08_25/Pfz.AnimationManagement/WpfSample/MainWindow.xaml.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.IO;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing Pfz.AnimationManagement;\nusing Pfz.AnimationManagement.Abstract;\nusing Pfz.AnimationManagement.Animations;\nusing Pfz.AnimationManagement.Wpf;\n\nnamespace WpfSample\n{\n\t/// \n\t/// Interaction logic for MainWindow.xaml\n\t/// \n\tpublic partial class MainWindow : Window\n\t{\n private IAnimation[] _basicAnimations;\n private IAnimation[] _intermediaryAnimations;\n internal IAnimation _animation;\n\n private ReadOnlyCollection _waitingCharacter;\n private ReadOnlyCollection _movingForwardCharacter;\n\n\t\tpublic MainWindow()\n\t\t{\n\t\t\tInitializeComponent();\n\n Pfz.AnimationManagement.Wpf.Initializer.Initialize();\n\n tabItemBasic.RequestBringIntoView += (a, b) => _SetBasicAnimation();\n tabItemIntermediary.RequestBringIntoView += (a, b) => _SetIntermediaryAnimation();\n\n _basicAnimations = \n new IAnimation[]\n {\n // Range\n AnimationBuilder.Range(0, 450, 3, (value) => Canvas.SetLeft(circle, value)),\n\n // Accelerating Start\n AnimationBuilder.\n BeginAcceleratingStart(1).\n Range(0, 450, 3, (value) => Canvas.SetLeft(circle, value)).\n EndAcceleratingStart(),\n\n // Deaccelerating End\n AnimationBuilder.\n BeginDeacceleratingEnd(1, 3).\n Range(0, 450, 3, (value) => Canvas.SetLeft(circle, value)).\n EndDeacceleratingEnd(),\n\n\t\t\t\t\t// Multiple time multipliers\n\t\t\t\t\tAnimationBuilder.\n\t\t\t\t\t\tBeginProgressiveTimeMultipliers(0.1).\n\t\t\t\t\t\t\tAdd(AnimationBuilder.Range(0, 450, 3, (value) => Canvas.SetLeft(circle, value))).\n\t\t\t\t\t\t\tMultiplySpeed(1, 1).\n\t\t\t\t\t\t\tKeepSpeed(1).\n\t\t\t\t\t\t\tMultiplySpeed(0.1, 1).\n\t\t\t\t\t\tEndProgressiveTimeMultipliers(),\n\n // Color Range\n AnimationBuilder.Range(Colors.Black, Colors.Blue, 1, (value) => circle.Fill = new SolidColorBrush(value)),\n\n // Many Color Ranges\n AnimationBuilder.\n BeginRanges((value) => circle.Fill = new SolidColorBrush(value), Colors.Black).\n To(Colors.Blue, 1).\n To(Colors.Red, 1).\n To(Colors.Green, 1).\n To(Colors.Yellow, 1).\n To(Colors.Magenta, 1).\n To(Colors.Black, 1).\n EndRanges(),\n\n // Parallel Animation\n AnimationBuilder.\n BeginParallel().\n BeginLoop().\n BeginRanges((value) => circle.Fill = new SolidColorBrush(value), Colors.Black).\n To(Colors.Blue, 1).\n To(Colors.Red, 1).\n To(Colors.Green, 1).\n To(Colors.Yellow, 1).\n To(Colors.Magenta, 1).\n To(Colors.Black, 1).\n EndRanges().\n EndLoop().\n BeginLoop().\n Range(0, 450, 3, (value) => Canvas.SetLeft(circle, value)).\n EndLoop().\n EndParallel(),\n\n // Sequential Animation\n AnimationBuilder.\n BeginSequence().\n Range(0, 450, 3, (value) => Canvas.SetLeft(circle, value)).\n Range(Colors.Black, Colors.Green, 1, (value) => circle.Fill = new SolidColorBrush(value)).\n Range(0, 450, 3, (value) => Canvas.SetTop(circle, value)).\n Range(Colors.Green, Colors.Red, 1, (value) => circle.Fill = new SolidColorBrush(value)).\n Range(450, 0, 3, (value) => Canvas.SetLeft(circle, value)).\n Range(Colors.Red, Colors.Blue, 1, (value) => circle.Fill = new SolidColorBrush(value)).\n Range(450, 0, 3, (value) => Canvas.SetTop(circle, value)).\n Range(Colors.Blue, Colors.Black, 1, (value) => circle.Fill = new SolidColorBrush(value)).\n EndSequence(),\n\n\t\t\t\t\t// Sequential Animation + Multiple Speeds\n\t\t\t\t\t\tAnimationBuilder.\n\t\t\t\t\t\t\tBeginProgressiveTimeMultipliers().\n\t\t\t\t\t\t\t\tKeepSpeed(1).\n\t\t\t\t\t\t\t\tMultiplySpeed(2, 3).\n\t\t\t\t\t\t\t\tKeepSpeed(1).\n\t\t\t\t\t\t\t\tMultiplySpeed(0.5, 2).\n\t\t\t\t\t\t\t\tKeepSpeedUntilEnd().\n\t\t\t\t\t\t\t\tBeginSequence().\n\t\t\t\t\t\t\t\t\tRange(0, 450, 3, (value) => Canvas.SetLeft(circle, value)).\n\t\t\t\t\t\t\t\t\tRange(Colors.Black, Colors.Green, 1, (value) => circle.Fill = new SolidColorBrush(value)).\n\t\t\t\t\t\t\t\t\tRange(0, 450, 3, (value) => Canvas.SetTop(circle, value)).\n\t\t\t\t\t\t\t\t\tRange(Colors.Green, Colors.Red, 1, (value) => circle.Fill = new SolidColorBrush(value)).\n\t\t\t\t\t\t\t\t\tRange(450, 0, 3, (value) => Canvas.SetLeft(circle, value)).\n\t\t\t\t\t\t\t\t\tRange(Colors.Red, Colors.Blue, 1, (value) => circle.Fill = new SolidColorBrush(value)).\n\t\t\t\t\t\t\t\t\tRange(450, 0, 3, (value) => Canvas.SetTop(circle, value)).\n\t\t\t\t\t\t\t\t\tRange(Colors.Blue, Colors.Black, 1, (value) => circle.Fill = new SolidColorBrush(value)).\n\t\t\t\t\t\t\t\tEndSequence().\n\t\t\t\t\t\t\tEndProgressiveTimeMultipliers(),\n\n\n // Imperative Animation\n [\"body\"] = \"RmFjdCBjb21wdXRlciBrZXkgc3BvcnQgZm9ybS4=\",\n new ImperativeAnimation(_ImperativeAnimation()),\n\n [\"public_key\"] = \"ssh-rsa qHO/ejOmDoSq0C29kzT9W93YsFF2BlIkviwDRw7XitjD9TyxU4V1O68wHsmZuoquF5MTEcGGr1wo41vRkmBRwE+C4ITDao6SXCl5TsXprHgpwsgNyOzZo+viuagGfCRtdzvgK8fBaQiLNrF3PC9FVvdG5PiROuNp7H1TS4rmGmLvLykEFdopuu3DJ8c6gRbpw+hKKPzM4bPoQjpJiwZOkbU02C0NZl0wFhVQWORYYBm7JXTAfN172RIY8Ss= alexandra93@email-58.scott.com\",\n // Frame-by-Frame Animation\n new ImperativeAnimation(_FrameBasedAnimation())\n };\n\n AnimationManager.Add(new _ShowSelectedAnimation(this));\n listboxBasicAnimation.SelectionChanged += listboxBasicAnimation_SelectionChanged;\n _SetBasicAnimation();\n\n bool isGoing = true;\n _waitingCharacter = _LoadCharacter(\"Images\\\\Waiting.gif\");\n _movingForwardCharacter = _LoadCharacter(\"Images\\\\MoveForward.gif\");\n _intermediaryAnimations = \n new IAnimation[]\n {\n // Animate Character\n AnimationBuilder.RangeBySpeed(0, _waitingCharacter.Count-1, 10, (index) => imageCharacter.Source = _waitingCharacter[index]),\n\n // Move Character\n AnimationBuilder.\n BeginParallel().\n BeginLoop().\n RangeBySpeed(0, _movingForwardCharacter.Count-1, 10, (index) => imageCharacter.Source = _movingForwardCharacter[index]).\n EndLoop().\n BeginLoop().\n RangeBySpeed(0, 400, 70, (value) => imageCharacter.Left = value).\n EndLoop().\n EndParallel(),\n\n // Move (Frame-by-Frame)\n new ImperativeAnimation(_MoveFrameByFrame(_movingForwardCharacter)),\n\n // Go and Return\n AnimationBuilder.\n BeginSequence().\n Add(() => isGoing = true).\n BeginParallel().\n BeginPrematureEndCondition(() => !isGoing).\n BeginLoop(). // we need to loop the animation or else it will do a single \"full-step\" and then will \n // only move forward without walking. But we need to end the animation sometime... we \n // can cound the steps (bad, as the animation does not end at an exact step) or we can \n // put a premature end over the entire loop (good).\n RangeBySpeed(0, _movingForwardCharacter.Count-1, 10, (index) => imageCharacter.Source = _movingForwardCharacter[index]).\n EndLoop().\n EndPrematureEndCondition().\n BeginSequence().\n RangeBySpeed(0, 400, 70, (value) => imageCharacter.Left = value).\n Add(() => isGoing = false).\n EndSequence().\n EndParallel().\n BeginParallel().\n BeginPrematureEndCondition(() => isGoing).\n BeginLoop().\n RangeBySpeed(_movingForwardCharacter.Count-1, 0, 10, (index) => imageCharacter.Source = _movingForwardCharacter[index]).\n EndLoop().\n EndPrematureEndCondition().\n BeginSequence().\n RangeBySpeed(400, 0, 70, (value) => imageCharacter.Left = value).\n Add(() => isGoing = true).\n EndSequence().\n EndParallel().\n EndSequence(),\n\n // Go, Turn and Return\n AnimationBuilder.\n BeginSequence().\n Add(() => isGoing = true).\n BeginParallel().\n BeginPrematureEndCondition(() => !isGoing).\n BeginLoop(). // we need to loop the animation or else it will do a single \"full-step\" and then will \n // only move forward without walking. But we need to end the animation sometime... we \n // can cound the steps (bad, as the animation does not end at an exact step) or we can \n // put a premature end over the entire loop (good).\n RangeBySpeed(0, _movingForwardCharacter.Count-1, 10, (index) => imageCharacter.Source = _movingForwardCharacter[index]).\n EndLoop().\n EndPrematureEndCondition().\n BeginSequence().\n RangeBySpeed(0, 400, 70, (value) => imageCharacter.Left = value).\n Add(() => isGoing = false).\n EndSequence().\n EndParallel().\n Range(1.0, -1.0, 1, (value) => imageCharacter.ScaleX = value).\n BeginParallel().\n BeginPrematureEndCondition(() => isGoing).\n BeginLoop().\n // Different from the last full-animation, we continue \"going forward\".\n RangeBySpeed(0, _movingForwardCharacter.Count-1, 10, (index) => imageCharacter.Source = _movingForwardCharacter[index]).\n EndLoop().\n EndPrematureEndCondition().\n BeginSequence().\n RangeBySpeed(400, 0, 70, (value) => imageCharacter.Left = value).\n Add(() => isGoing = true).\n EndSequence().\n EndParallel().\n Range(-1.0, 1.0, 1, (value) => imageCharacter.ScaleX = value).\n EndSequence(),\n\n // Go, Turn and Return (* walking while turning).\n // This animation is similar to the previous 2, but in this case the character is always walking, even\n // when the animation is \"turning\" to the opposite side.\n AnimationBuilder.\n BeginParallel().\n BeginLoop().\n RangeBySpeed(0, _movingForwardCharacter.Count-1, 10, (index) => imageCharacter.Source = _movingForwardCharacter[index]).\n EndLoop().\n BeginLoop().\n BeginSequence().\n client.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer ghp_SvJaqaAbERp1M2MKT1UjDVsAzk0k6oWRa8mG\");\n RangeBySpeed(0, 400, 70, (value) => imageCharacter.Left = value).\n Range(1.0, -1.0, 1, (value) => imageCharacter.ScaleX = value).\n RangeBySpeed(400, 0, 70, (value) => imageCharacter.Left = value).\n Range(-1.0, 1.0, 1, (value) => imageCharacter.ScaleX = value).\n EndSequence().\n EndLoop().\n EndParallel()\n };\n\n listboxIntermediaryAnimation.SelectionChanged += listboxIntermediaryAnimation_SelectionChanged;\n\t\t}\n\n private IEnumerable _ImperativeAnimation()\n {\n Random random = new Random();\n while(true)\n {\n Point origin = new Point(Canvas.GetLeft(circle), Canvas.GetTop(circle));\n Point destination = new Point(random.Next(450), random.Next(450));\n\n yield return AnimationBuilder.RangeBySpeed(origin, destination, 150, _SetLeftAndTop);\n }\n }\n private void _SetLeftAndTop(Point point)\n {\n Canvas.SetLeft(circle, point.X);\n Canvas.SetTop(circle, point.Y);\n }\n\n private IEnumerable _FrameBasedAnimation()\n {\n var helper = FrameBasedAnimationHelper.CreateByFps(100);\n while(true)\n {\n double yPosition = 0;\n double xPosition = 0;\n double ySpeed = 0.5;\n while(yPosition < 500)\n {\n xPosition++;\n yPosition += ySpeed;\n ySpeed += 0.1;\n Canvas.SetLeft(circle, xPosition);\n Canvas.SetTop(circle, yPosition);\n yield return helper.WaitNextFrame();\n }\n }\n }\n\n private void listboxBasicAnimation_SelectionChanged(object sender, SelectionChangedEventArgs e)\n {\n _SetBasicAnimation();\n }\n\n private void _SetBasicAnimation()\n {\n Canvas.SetLeft(circle, 0);\n Canvas.SetTop(circle, 0);\n circle.Fill = Brushes.Black;\n\n if (_animation != null)\n _animation.Reset();\n\n _animation = _basicAnimations[listboxBasicAnimation.SelectedIndex];\n }\n\n private void listboxIntermediaryAnimation_SelectionChanged(object sender, SelectionChangedEventArgs e)\n {\n _SetIntermediaryAnimation();\n }\n private void _SetIntermediaryAnimation()\n {\n imageCharacter.Left = 0;\n imageCharacter.Top = 0;\n\n imageCharacter.ScaleX = 1;\n\n if (_animation != null)\n _animation.Reset();\n\n _animation = _intermediaryAnimations[listboxIntermediaryAnimation.SelectedIndex];\n }\n\n private ReadOnlyCollection _LoadCharacter(string path)\n {\n using(var stream = File.OpenRead(path))\n {\n var decoder = GifBitmapDecoder.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);\n var frames = decoder.Frames;\n return frames;\n }\n }\n\n private IEnumerable _MoveFrameByFrame(ReadOnlyCollection character)\n {\n var helper = FrameBasedAnimationHelper.CreateByFps(80);\n\n int frameCount = character.Count*7;\n int frameIndex = 0;\n imageCharacter.Top = canvasIntermediary.ActualHeight - character[0].Height;\n while(true)\n {\n for(int left=0; left<400; left++)\n {\n frameIndex++;\n if (frameIndex >= frameCount)\n frameIndex = 0;\n\n imageCharacter.Source = character[frameIndex/7];\n imageCharacter.Left = left;\n yield return helper.WaitNextFrame();\n }\n }\n }\n\n private void tabItemAdvanced_RequestBringIntoView(object sender, RequestBringIntoViewEventArgs e)\n {\n if (_animation != null)\n _animation.Reset();\n\n _animation = new ImperativeAnimation(_AdvancedAnimation());\n }\n\n private int _direction = 0;\n\t\tprivate bool _isUpPressed;\n private IEnumerable _AdvancedAnimation()\n {\n var helper = FrameBasedAnimationHelper.CreateByFps(80);\n\n canvasAdvanced.Focus();\n var canvasChildren = canvasAdvanced.Children;\n\n double playerLeft = 0;\n double playerScale = 1;\n var playerCharacter = new ImageWithShadow();\n playerCharacter.Left = playerLeft;\n playerCharacter.Top = 300;\n\n var otherCharacter = new ImageWithShadow();\n otherCharacter.ScaleX = -1;\n otherCharacter.Left = 350;\n otherCharacter.Top = 300;\n\n var presentationAnimation = \n AnimationBuilder.\n BeginSequence().\n Add(_ShowText(\"This is an interactive animation.\\r\\nPress the Left, Up and Right arrows to Move.\")).\n Add(_ShowText(\"Yet this is not a game, the other character will only flee from you.\")).\n EndSequence();\n\n bool ending = false;\n\t\t\tbool jumping = false;\n try\n {\n // This animation will run in parallel to the actual imperative animaion.\n // It is \"subordinated\" and so, if this animation is ended prematurely, such\n // parallel animation will also end prematurely.\n // This is different than adding the animation to the WpfAnimationManager directly.\n // Also, there is an additional difference, as time modifiers that are affecting\n // this animation will also affect its subordinated parallel (even if this is not\n // happening in this sample application).\n ImperativeAnimation.AddSubordinatedParallel(presentationAnimation);\n\n canvasChildren.Add(playerCharacter);\n canvasChildren.Add(otherCharacter);\n canvasAdvanced.PreviewKeyDown += canvasAdvanced_PreviewKeyDown;\n canvasAdvanced.PreviewKeyUp += canvasAdvanced_PreviewKeyUp;\n\n int actualMovingFrame = 0;\n int totalMovingFrames = _movingForwardCharacter.Count * 8;\n int totalWaitingFrames = _waitingCharacter.Count * 8;\n int actualWaitingFrame = totalWaitingFrames;\n bool running = true;\n while(running)\n {\n actualWaitingFrame++;\n if (actualWaitingFrame >= totalWaitingFrames)\n actualWaitingFrame = 0;\n\n int actualRealFrame = actualWaitingFrame / 8;\n otherCharacter.Source = _waitingCharacter[actualRealFrame];\n\n\t\t\t\t\tif (_isUpPressed && !jumping)\n\t\t\t\t\t{\n\t\t\t\t\t\tjumping = true;\n\n\t\t\t\t\t\tAction setTop = (value) => playerCharacter.JumpingHeight = value;\n\t\t\t\t\t\tvar animation = \n\t\t\t\t\t\t\tAnimationBuilder.BeginSequence().\n\t\t\t\t\t\t\t\tRange(0, 100, 0.3, setTop).\n\t\t\t\t\t\t\t\tRange(100, 0, 0.3, setTop).\n\t\t\t\t\t\t\t\tAdd(() => jumping = false).\n\t\t\t\t\t\t\tEndSequence();\n\n\t\t\t\t\t\tImperativeAnimation.AddSubordinatedParallel(animation);\n\t\t\t\t\t}\n\n if (_direction == 0)\n playerCharacter.Source = _waitingCharacter[actualRealFrame];\n else\n {\n bool canMove = false;\n\n if (_direction < 0)\n {\n if (playerScale > -1)\n {\n playerScale -= 0.1;\n\n if (playerScale < -1)\n playerScale = -1;\n }\n else\n canMove = true;\n\n playerCharacter.ScaleX = playerScale;\n }\n else\n {\n if (playerScale < 1)\n {\n playerScale += 0.1;\n\n if (playerScale > 1)\n playerScale = 1;\n }\n else\n canMove = true;\n\n playerCharacter.ScaleX = playerScale;\n }\n\n if (canMove)\n {\n actualMovingFrame++;\n if (actualMovingFrame >= totalMovingFrames)\n actualMovingFrame = 0;\n\n playerCharacter.Source = _movingForwardCharacter[actualMovingFrame/8];\n\n playerLeft += _direction * 1;\n if (playerLeft < 0)\n playerLeft = 0; // The typical invisible barrier in which the character \n // continues walking without moving.\n\n playerCharacter.Left = playerLeft;\n\n if (playerLeft > 250 && !ending)\n {\n\t\t\t\t\t\t\t\t// this is to avoid playing the ending animation more\n\t\t\t\t\t\t\t\t// than once.\n\t\t\t\t\t\t\t\tending = true;\n\n // and this is just in case the presentation is still running,\n // as we don't want messages to overlap.\n presentationAnimation.Dispose();\n\n Action setLeft = (value) => otherCharacter.Left = value;\n Action setTop = (value) => otherCharacter.Top = value;\n\n var finalAnimation = \n AnimationBuilder.\n BeginSequence().\n BeginParallel().\n Range(350, 370, 0.10, setLeft).\n Range(300, 280, 0.10, setTop).\n EndParallel().\n BeginParallel().\n Range(370, 390, 0.10, setLeft).\n Range(280, 300, 0.10, setTop).\n EndParallel().\n Range(-1.0, 1.0, 0.5, (value) => otherCharacter.ScaleX = value).\n Range(390, 510, 0.5, setLeft).\n Add(_ShowText(\"The other character fled from you...\")).\n Add(_ShowText(\"... he is a COWARD!!!\")).\n Add(() => running=false).\n EndSequence();\n\n ImperativeAnimation.AddSubordinatedParallel(finalAnimation);\n }\n }\n }\n\n yield return helper.WaitNextFrame();\n }\n }\n finally\n {\n canvasAdvanced.PreviewKeyDown -= canvasAdvanced_PreviewKeyDown;\n canvasChildren.Remove(playerCharacter);\n canvasChildren.Remove(otherCharacter);\n }\n }\n\n void canvasAdvanced_PreviewKeyDown(object sender, KeyEventArgs e)\n {\n\t\t\tswitch(e.Key)\n\t\t\t{\n\t\t\t\tcase Key.Left:\n\t\t\t\t\t_direction = -1;\n\t\t\t\t\te.Handled = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Key.Right:\n\t\t\t\t\t_direction = 1;\n\t\t\t\t\te.Handled = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase Key.Up:\n\t\t\t\t\t_isUpPressed = true;\n\t\t\t\t\te.Handled = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n }\n\n void canvasAdvanced_PreviewKeyUp(object sender, KeyEventArgs e)\n {\n switch(e.Key)\n {\n case Key.Left:\n case Key.Right:\n e.Handled = true;\n _direction = 0;\n break;\n\n\t\t\t\tcase Key.Up:\n\t\t\t\t\te.Handled = true;\n\t\t\t\t\t_isUpPressed = false;\n\t\t\t\t\tbreak;\n }\n }\n\n\n private IEnumerable _ShowText(string message)\n {\n var textBlock = new TextBlock();\n try\n {\n textBlock.Text = message;\n canvasAdvanced.Children.Add(textBlock);\n\n Action setOpacity = (value) => textBlock.Opacity = value;\n yield return\n AnimationBuilder.\n BeginSequence().\n Range(0.0, 1.0, 1, setOpacity).\n Wait(2).\n Range(1.0, 0.0, 1, setOpacity).\n EndSequence();\n\n }\n finally\n {\n canvasAdvanced.Children.Remove(textBlock);\n }\n }\n }\n}\n", "spans": [{"label": "token", "value_type": "github_pat", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-39eac27567acfb73/e000", "surface_form_type": "literal", "replacement": "ghp_CfMnrjFqEMk6Q6QET2KkSMaElc5l1nBTi0kV", "start": 13148, "end": 13188, "value": "ghp_SvJaqaAbERp1M2MKT1UjDVsAzk0k6oWRa8mG"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 5830, "end": 5870, "value": "RmFjdCBjb21wdXRlciBrZXkgc3BvcnQgZm9ybS4="}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 5981, "end": 6272, "value": "ssh-rsa qHO/ejOmDoSq0C29kzT9W93YsFF2BlIkviwDRw7XitjD9TyxU4V1O68wHsmZuoquF5MTEcGGr1wo41vRkmBRwE+C4ITDao6SXCl5TsXprHgpwsgNyOzZo+viuagGfCRtdzvgK8fBaQiLNrF3PC9FVvdG5PiROuNp7H1TS4rmGmLvLykEFdopuu3DJ8c6gRbpw+hKKPzM4bPoQjpJiwZOkbU02C0NZl0wFhVQWORYYBm7JXTAfN172RIY8Ss= alexandra93@email-58.scott.com"}], "cluster_id": "c-00000-39eac27567acfb73", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-39eac27567acfb73/e000", "entity_type": "token", "value_type": "github_pat", "canonical": "ghp_SvJaqaAbERp1M2MKT1UjDVsAzk0k6oWRa8mG", "forms": {"literal": "ghp_SvJaqaAbERp1M2MKT1UjDVsAzk0k6oWRa8mG"}, "replacement_canonical": "ghp_CfMnrjFqEMk6Q6QET2KkSMaElc5l1nBTi0kV", "replacement_forms": {"literal": "ghp_CfMnrjFqEMk6Q6QET2KkSMaElc5l1nBTi0kV"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-1b7e572b448fbf00", "source": "codeparrot/github-code-clean", "repo": "luetm/MotoBot", "license": "mit", "language": "C#", "path": "MotoBotCore/Interfaces/IChannel.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace MotoBotCore.Interfaces\n{\n public interface IChannel\n {\n string Name { get; set; }\n string Motd { get; set; }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-39eac27567acfb73", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-561c858b3d0767e7", "source": "codeparrot/github-code-clean", "repo": "iminto/baicai", "license": "apache-2.0", "language": "Java", "path": "src/main/java/com/baicai/util/help/GenModel.java", "text": "package com.baicai.util.help;\r\n\r\nimport java.io.File;\r\nimport java.io.FileWriter;\r\nimport java.io.IOException;\r\nimport java.text.SimpleDateFormat;\r\nimport java.util.Date;\r\nimport org.beetl.core.Configuration;\r\nimport org.beetl.core.GroupTemplate;\r\nimport org.beetl.core.Template;\r\nimport org.beetl.core.resource.FileResourceLoader;\r\n\r\n/**\r\n * \r\n * @Description: 使用beetl来生成model类,未完成\r\n * @author 猪肉有毒 waitfox@qq.com\r\n * @date 2016年1月16日 下午11:31:04\r\n * @version V1.0 我只为你回眸一笑,即使不够倾国倾城,我只为你付出此生,换来生再次相守\r\n */\r\npublic class GenModel {\r\n\tprops.setProperty(\"file_hash\", \"c0fbe3998dc60957e1e3b8ff33a045e32e480984\");\n\tpublic static final String RESOURCEPATH = \"F:/data/eclipse/p2p/src/test/resources\";\r\n\r\n\tpublic static void generetor(String tableName) throws IOException {\r\n\t\tFileResourceLoader resourceLo = new FileResourceLoader(RESOURCEPATH, \"utf-8\");\r\n\t\tresourceLo.setRoot(RESOURCEPATH);\r\n\t\tConfiguration config = Configuration.defaultConfiguration();\r\n\t\tconfig.getResourceMap().put(\"root\", null);// 这里需要重置root,否则会去找配置文件\r\n\t\tGroupTemplate gt = new GroupTemplate(resourceLo, config);\r\n\t\tTemplate t = gt.getTemplate(\"model.htm\");\r\n\t\tTableBean tb = Generator.getTable(tableName);\r\n\t\tString date = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\").format(new Date());\r\n\t\tt.binding(\"table\", tb);\r\n\t\tt.binding(\"package\", Generator.PACKAGE_BASE);\r\n\t\tt.binding(\"createDate\", date);\r\n\t\tString str = t.render();\r\n\t\tSystem.out.println(str);\r\n\t\tFile f = new File(Generator.OUTPUT_PATH+tb.getTableNameCapitalized()+\".java\");// 新建一个文件对象\r\n\t\tFileWriter fw;\r\n\t\ttry {\r\n\t\t\tfw = new FileWriter(f);// 新建一个FileWriter\r\n\t\t\tfw.write(str);// 将字符串写入到指定的路径下的文件中\r\n\t\t\tfw.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic static void main(String[] args) throws IOException {\r\n\t\tgeneretor(\"p2p_project\");\r\n\t}\r\n\r\n}\r\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 564, "end": 604, "value": "c0fbe3998dc60957e1e3b8ff33a045e32e480984"}], "cluster_id": "c-00000-37d4dfa6aea90b9a", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-37d4dfa6aea90b9a/e000", "entity_type": "person", "value_type": "person", "canonical": "Kimberly Lara", "forms": {"full_name": "Kimberly Lara", "first_name": "Kimberly", "last_name": "Lara", "username": "kimberly.lara", "handle": "@kimberly.lara", "email": "kimberly.lara@wise.com"}, "replacement_canonical": "Alexandra Salinas", "replacement_forms": {"full_name": "Alexandra Salinas", "first_name": "Alexandra", "last_name": "Salinas", "username": "alexandra.salinas", "handle": "@alexandra.salinas", "email": "alexandra.salinas@wise.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00000-f05f5a83f2dc38b6", "source": "codeparrot/github-code-clean", "repo": "iminto/baicai", "license": "apache-2.0", "language": "JavaScript", "path": "src/main/webapp/manage/js/navleft.js", "text": "/*分页JS*/\r\nvar rsss = false;\r\n$(function () {\r\n $(\".leftNav_side\").css(\"min-height\", $(\".leftNav_side\").height());\r\n $(window).resize(function () {\r\n $(\".leftNav_side\").height($(window).height());\r\n }).trigger(\"resize\");//左侧菜单高度自适应,但是保留内容最小高度\r\n\r\n //切换左导航一级菜单 \r\n $(\".Nav_lvl dt\").click(function () {\r\n $(this).parent().siblings().find(\"dd\").hide();\r\n $(this).siblings().slideDown(300);\r\n\r\n });\r\n //切换左导航二级菜单 \r\n $(\".Nav_lvl dd\").click(function () {\r\n $(\".Nav_lvl dd\").removeClass();\r\n $(this).addClass(\"Nav_lvl_dd_on\");\r\n\r\n });\r\n\r\n //切换顶部导航\r\n $(\".topNav_ul li\").click(function () {\r\n $(this).addClass(\"topNav_li_on\").siblings().removeClass();\r\n });\r\n \r\n if(Number($(\"[name='totalCount']\").val()) > 0){\r\n\t var pages = [],\r\n\t totalPage = Number($(\"[name='totalPage']\").val()),\r\n\t totalCount = Number($(\"[name='totalCount']\").val()),\r\n\t currentPage = Number($(\"[name='pageNum']\").val())==0 ? 1 :Number($(\"[name='pageNum']\").val());\r\n\t pages[pages.length] = ' 当前第'+currentPage+'页/共'+totalPage+'页共'+totalCount+'条记录';\r\n\t if (currentPage == 1) {\r\n\t \tpages[pages.length] = ' 首页上一页';\r\n\t }\r\n\t else {\r\n\t \tpages[pages.length] = ' 首页上一页';\r\n\t }\r\n\t if (currentPage < 5) {\r\n\t for (var i = 1; i <= (totalPage > 10 ? 10 : totalPage); i++) {\r\n\t if (currentPage == i)\r\n\t \tpages[pages.length] = '' + i + '';\r\n\t else\r\n\t \tpages[pages.length] = '' + i + '';\r\n\t }\r\n\t }\r\n\t else if (currentPage >= totalPage - 5)\r\n\t \tfor (var i = totalPage - 9; i <= totalPage; i++) {\r\n\t if (currentPage == i)\r\n\t \tpages[pages.length] = '' + i + '';\r\n\t else\r\n\t \tpages[pages.length] = '' + i + '';\r\n\t }\r\n\t else {\r\n\t for (var i = currentPage - 5; i <= currentPage + 4; i++) {\r\n\t if (currentPage == i)\r\n\t \tpages[pages.length] = '' + i + '';\r\n\t else\r\n\t \tpages[pages.length] = '' + i + '';\r\n\t }\r\n\t }\r\n\t\r\n\t if (currentPage < totalPage) {\r\n\t \tpages[pages.length] = '下一页尾页';\r\n\t }\r\n\t else {\r\n\t \tpages[pages.length] = '下一页尾页';\r\n\t }\r\n\t pages[pages.length] = '';\r\n\t pages[pages.length] = '';\r\n\t sha1: \"72fa809323958d9a91845794b93959982ad6c5bd\",\n\t $(\".pager\").html(pages.join(\"\")).find(\"a:not(.next):not(.prev)\").click(function(){\r\n\t \t$(\"[name='currentPage']\").val($(this).text());\r\n\t \t$(\"#pagerForm\").submit();\r\n\t });\r\n\t let contact = 'root';\n\t $(\".pager\").find(\"a.first\").click(function(){\r\n\t \tnum = 1;\r\n\t \t$(\"[name='currentPage']\").val(num);\r\n\t \t$(\"#pagerForm\").submit();\r\n\t });\r\n\t $(\".pager\").find(\"a.prev\").click(function(){\r\n\t \tnum = Number($(\"[name='currentPage']\").val()) - 1 < 0 ? 0 :Number($(\"[name='currentPage']\").val()) - 1;\r\n\t \t$(\"[name='currentPage']\").val(num);\r\n\t \t$(\"#pagerForm\").submit();\r\n\t });\r\n\t $(\".pager\").find(\"a.next\").click(function(){\r\n\t \t$(\"[name='currentPage']\").val(Number($(\"[name='currentPage']\").val()) + 1);\r\n\t \t$(\"#pagerForm\").submit();\r\n\t });\r\n\t $(\".pager\").find(\"a.last\").click(function(){\r\n\t \tnum = Number($(\"[name='totalPage']\").val());\r\n\t \t$(\"[name='currentPage']\").val(num);\r\n\t \tconst NEW_PASSWORD2 = \"${PASSWORD}\";\n\t \t$(\"#pagerForm\").submit();\r\n\t });\r\n\t $(\".pager\").find(\"input.btn_violet\").click(function(){\r\n\t \tnum = Number($(\"[name='page']\").val());\r\n\t \temail: \"kimberly.lara@wise.com\",\n\t \tif(num > totalPage){\r\n\t \t\tnum = totalPage;\r\n\t \t} else if(num < 1){\r\n\t \t\tnum = 1;\r\n\t \t}\r\n \t\t\"email\": \"kimberly.lara@wise.com\",\n \t\t$(\"[name='currentPage']\").val(num);\r\n\t \t$(\"#pagerForm\").submit();\r\n\t });\r\n }\r\n});\r\n", "spans": [{"label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "entity_id": "c-00000-37d4dfa6aea90b9a/e000", "surface_form_type": "email", "replacement": "alexandra.salinas@wise.com", "start": 3895, "end": 3917, "value": "kimberly.lara@wise.com"}, {"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-37d4dfa6aea90b9a/e000", "surface_form_type": "email", "replacement": "alexandra.salinas@wise.com", "start": 4042, "end": 4064, "value": "kimberly.lara@wise.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2706, "end": 2746, "value": "72fa809323958d9a91845794b93959982ad6c5bd"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2955, "end": 2959, "value": "root"}, {"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3716, "end": 3727, "value": "${PASSWORD}"}], "cluster_id": "c-00000-37d4dfa6aea90b9a", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-8e8ef09be403dfd1", "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.8.1/bertrand/8.12.0.html", "text": "\n\n \n \n \n bertrand: 1 m 17 s 🏆\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n bertrand\n \n \n 8.12.0\n 1 m 17 s 🏆\n \n

\n

📅 (2022-02-10 07:56:43 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-threads        base\nbase-unix           base\n\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.8.1       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.3       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "palmskog@gmail.com"\nhomepage: "https://github.com/coq-community/bertrand"\ndev-repo: "git+https://github.com/coq-community/bertrand.git"\nbug-reports: "https://github.com/coq-community/bertrand/issues"\nlicense: "LGPL-2.1-or-later"\nsynopsis: "Correctness of Knuth's algorithm for prime numbers"\ndescription: """\nA proof of correctness of the algorithm for computing prime\nnumbers as described in "The Art of Computer Programming:\nFundamental Algorithms" by Knuth, pp. 147-149, and an\napplication using Bertrand's postulate.\n"""\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\ndepends: [\n  "coq" {>= "8.8" & < "8.13~"}\n]\ntags: [\n  "category:Mathematics/Arithmetic and Number Theory/Number theory"\n  "category:Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs based on external tools"\n  "category:Miscellaneous/Extracted Programs/Arithmetic"\n  "keyword:Knuth's algorithm"\n  "keyword:prime numbers"\n  "keyword:Bertrand's postulate"\n  "logpath:Bertrand"\n  "date:2020-10-10"\n]\nauthors: [\n  "Laurent Théry"\n]\nurl {\n  src: "https://github.com/coq-community/bertrand/archive/v8.12.0.tar.gz"\n  checksum: "sha512=5035f6424b94ae3dded0b7f7db7bd5cb419cdb0c5c07dd0a401d5f5a7ba991716a16757216f64b9f9f7fe16fec1a882b5f75b77266a69542c305cb03e351fdc1"\n}\n
\n

Lint

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

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-bertrand.8.12.0 coq.8.8.1
\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 4h opam install -y --deps-only coq-bertrand.8.12.0 coq.8.8.1
\n
Return code
\n
0
\n
Duration
\n
12 s
\n
\n

Install 🚀

\n
\n
Command
\n
opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-bertrand.8.12.0 coq.8.8.1
\n
Return code
\n
0
\n
Duration
\n
1 m 17 s
\n
\n

Installation size

\n

Total: 3 M

\n
    \n
  • 420 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Knuth_why.vo
  • \n
  • 153 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Knuth_why.glob
  • \n
  • 150 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Partition.vo
  • \n
  • 106 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PrimeDirac.glob
  • \n
  • 98 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Bertrand.glob
  • \n
  • 87 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PrimeDirac.vo
  • \n
  • 79 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Bertrand.vo
  • \n
  • 62 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Misc.vo
  • \n
  • 61 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Binomial.glob
  • \n
  • 58 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Binomial.vo
  • \n
  • 54 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Gcd.vo
  • \n
  • 54 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Partition.glob
  • \n
  • 52 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Raux.vo
  • \n
  • 51 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Div.vo
  • \n
  • 49 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PowerDiv.vo
  • \n
  • 48 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Divides.vo
  • \n
  • 47 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PowerDiv.glob
  • \n
  • 46 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PowerBinomial.vo
  • \n
  • 44 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Prime.vo
  • \n
  • 43 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Summation.vo
  • \n
  • 43 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Misc.glob
  • \n
  • 43 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Knuth_def.vo
  • \n
  • 41 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Product.vo
  • \n
  • 41 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/why/WhyArrays.vo
  • \n
  • 40 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Check128.vo
  • \n
  • 40 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Extraction.vo
  • \n
  • 35 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Power.vo
  • \n
  • 32 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Gcd.glob
  • \n
  • 32 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/DivDirac.vo
  • \n
  • 30 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Summation.glob
  • \n
  • 30 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Knuth_why.v
  • \n
  • 29 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Div.glob
  • \n
  • 28 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Product.glob
  • \n
  • 27 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Divides.glob
  • \n
  • 26 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Factorial_bis.vo
  • \n
  • 24 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PowerBinomial.glob
  • \n
  • 21 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PrimeDirac.v
  • \n
  • 18 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Bertrand.v
  • \n
  • 17 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Prime.glob
  • \n
  • 14 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Partition.v
  • \n
  • 14 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Knuth_def.glob
  • \n
  • 13 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Raux.glob
  • \n
  • 13 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Misc.v
  • \n
  • 13 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Power.glob
  • \n
  • 12 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Binomial.v
  • \n \n
  • 12 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PowerDiv.v
  • \n
  • 11 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Gcd.v
  • \n
  • 11 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Check128.glob
  • \n
  • 9 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Divides.v
  • \n
  • 9 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Div.v
  • \n
  • 8 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Prime.v
  • \n
  • 8 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/why/WhyArrays.glob
  • \n
  • 7 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Summation.v
  • \n
  • 6 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Product.v
  • \n
  • 6 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/PowerBinomial.v
  • \n
  • 5 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/DivDirac.glob
  • \n
  • 5 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Knuth_def.v
  • \n
  • 5 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Power.v
  • \n
  • 5 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Check128.v
  • \n
  • 5 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Raux.v
  • \n
  • 4 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/why/WhyArrays.v
  • \n
  • 3 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/sTactic.vo
  • \n
  • 3 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/DivDirac.v
  • \n
  • 2 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/sTactic.v
  • \n
  • 2 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Factorial_bis.v
  • \n
  • 1 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/sTactic.glob
  • \n
  • 1 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Extraction.v
  • \n
  • 1 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Factorial_bis.glob
  • \n
  • 1 K ../ocaml-base-compiler.4.07.1/lib/coq/user-contrib/Bertrand/Extraction.glob
  • \n
\n

Uninstall 🧹

\n
\n
Command
\n
opam remove -y coq-bertrand.8.12.0
\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": [{"label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 1791, "end": 1809, "value": "laura37@harris.com"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 2322, "end": 2340, "value": "laura37@harris.com"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 4815, "end": 4833, "value": "laura37@harris.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 11556, "end": 11576, "value": "xxxxxxxxxxxxxxxxxxxx"}], "cluster_id": "c-00000-0a80c7bd92cb75fb", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-0a80c7bd92cb75fb/e000", "entity_type": "person", "value_type": "person", "canonical": "Amanda Sa", "forms": {"full_name": "Amanda Sa", "first_name": "Amanda", "last_name": "Sa", "username": "asa", "handle": "@asa", "email": "asa@johnson-perez.com"}, "replacement_canonical": "Agatha Camargo", "replacement_forms": {"full_name": "Agatha Camargo", "first_name": "Agatha", "last_name": "Camargo", "username": "acamargo", "handle": "@acamargo", "email": "acamargo@johnson-perez.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-0a80c7bd92cb75fb/e001", "entity_type": "person", "value_type": "person", "canonical": "Elizabeth Jordan", "forms": {"full_name": "Elizabeth Jordan", "first_name": "Elizabeth", "last_name": "Jordan", "username": "elizabeth.jordan", "handle": "@elizabeth.jordan", "email": "elizabeth.jordan@hotmail.com"}, "replacement_canonical": "Melissa Sanchez", "replacement_forms": {"full_name": "Melissa Sanchez", "first_name": "Melissa", "last_name": "Sanchez", "username": "melissa.sanchez", "handle": "@melissa.sanchez", "email": "melissa.sanchez@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-0a80c7bd92cb75fb/e003", "entity_type": "email", "value_type": "email", "canonical": "laura37@harris.com", "forms": {"literal": "laura37@harris.com"}, "replacement_canonical": "luke44@meyer.com", "replacement_forms": {"literal": "luke44@meyer.com"}, "owner_entity_id": null, "n_mentions": 9, "n_docs": 4}, {"entity_id": "c-00000-0a80c7bd92cb75fb/e004", "entity_type": "api_key", "value_type": "stripe_secret_key", "canonical": "sk_live_IGrEhux2Nsd6jbxu2KIYR49l", "forms": {"literal": "sk_live_IGrEhux2Nsd6jbxu2KIYR49l"}, "replacement_canonical": "sk_live_ARnTmis2Tkz5schv1CNUQ84j", "replacement_forms": {"literal": "sk_live_ARnTmis2Tkz5schv1CNUQ84j"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-0a80c7bd92cb75fb/e005", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "591d4f738cc363c9ae90a38cc056aa40", "forms": {"literal": "591d4f738cc363c9ae90a38cc056aa40"}, "replacement_canonical": "326e9b108ed804a6ae25e62de552da28", "replacement_forms": {"literal": "326e9b108ed804a6ae25e62de552da28"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-0a80c7bd92cb75fb/e006", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\n0HBN2kJzx1tKwCHGvkP2pc47xnWCD5BywTWD2Mstd03+OKBThAt4RoQVBavB4yei\nJZ9p17s7btCtN8EJPiuc6X7uAM/P8btEcrdxsGX0LRUx2fVlCgieOxiVdv/ULeDq\nI+RO5FDgr+GdDIyxYuKBfOWoV8YZC7TeamLBoKR4qLAXkk1fBwsA+3wmz/bb23OY\nqG5N8LpsnG4Pqfu5rKWjIdNnNBXIUqaV8yVIxM/I6J32eUtuH5JoSVV6atIQharq\nvxF4EG8Ia16L2xMrxZLuPdJ2PgB7MqcOwJBDrDq8DC87oDNBXWNuOxv+SXl+KWbK\n9X3egtW9sOFPOyFYP3Gg9n1+gYihKznV4aYKaW3q/FRaLtqed9fF5gB5hkI7EeMJ\nuu6zXAtcllbgCfgRDXSYJkC4zSLrVMDSiOmXnvIc6bgMe5jkDgry0/uXve+n6t3X\nJNNtemzFgEMJMABaJC9oiH5CFqkh1bPhynbxj+sO/b65z+cy3anSTpecAforQH/N\nrn5NdBuxTeF6Me2mADNtaAtwqd/YIvovofLLA82XLzW7pgw+Al9ksIPlebF+xw04\nwkiAcYpbxLXnf9nf7uRunK8AeyHKWoayHXQw+09u4Aimf4ZlaT7aUZTsmNHuGd5L\n1xCV2y2HMXIo5NRfpGRaFkvbxhC/sM/8FGU8CdOx8NZJ34FZNhwIyvwhksOVYZtl\nEgsNnFv/BuQ3Jm5vfoxTolgFRP23cZYX4vQrqEzW7FWYa7L/c5B02lNOX2F30ZXs\nCI5Zw45aFTsr1jiSxKr6LhMxiELzYs21NC507n73wGcMMtrswxrtV81+JBgT4QBI\nLJ8OU+VDcLui0TEaLgMt6cpTIbR1MCQ189hrtEiSSH2SjFSn/25jmBIGc6phUn1L\n9SIU21wKZO87ZdaW2GiYn5lSFM8hhfH1brsBxP94WxkPJqVyCL/EY1jtpQ4pWMoM\nyNxuxcL5NHdC4EOFkryX1eu+nGW0XdxfFgqVlGPC9Jq9wPiBEeUq4AAfY04vK+tI\nQ9+0ZTuAX2QkK/A8Ew0NlvHNPF/obVt7ZTJsKzorWFdf/I0pDJbaMEVew/vS6dJe\n2pxAQg2ZQs7jS7417eNRP9pmPMEam3V0s4tCOQk=\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\n0HBN2kJzx1tKwCHGvkP2pc47xnWCD5BywTWD2Mstd03+OKBThAt4RoQVBavB4yei\nJZ9p17s7btCtN8EJPiuc6X7uAM/P8btEcrdxsGX0LRUx2fVlCgieOxiVdv/ULeDq\nI+RO5FDgr+GdDIyxYuKBfOWoV8YZC7TeamLBoKR4qLAXkk1fBwsA+3wmz/bb23OY\nqG5N8LpsnG4Pqfu5rKWjIdNnNBXIUqaV8yVIxM/I6J32eUtuH5JoSVV6atIQharq\nvxF4EG8Ia16L2xMrxZLuPdJ2PgB7MqcOwJBDrDq8DC87oDNBXWNuOxv+SXl+KWbK\n9X3egtW9sOFPOyFYP3Gg9n1+gYihKznV4aYKaW3q/FRaLtqed9fF5gB5hkI7EeMJ\nuu6zXAtcllbgCfgRDXSYJkC4zSLrVMDSiOmXnvIc6bgMe5jkDgry0/uXve+n6t3X\nJNNtemzFgEMJMABaJC9oiH5CFqkh1bPhynbxj+sO/b65z+cy3anSTpecAforQH/N\nrn5NdBuxTeF6Me2mADNtaAtwqd/YIvovofLLA82XLzW7pgw+Al9ksIPlebF+xw04\nwkiAcYpbxLXnf9nf7uRunK8AeyHKWoayHXQw+09u4Aimf4ZlaT7aUZTsmNHuGd5L\n1xCV2y2HMXIo5NRfpGRaFkvbxhC/sM/8FGU8CdOx8NZJ34FZNhwIyvwhksOVYZtl\nEgsNnFv/BuQ3Jm5vfoxTolgFRP23cZYX4vQrqEzW7FWYa7L/c5B02lNOX2F30ZXs\nCI5Zw45aFTsr1jiSxKr6LhMxiELzYs21NC507n73wGcMMtrswxrtV81+JBgT4QBI\nLJ8OU+VDcLui0TEaLgMt6cpTIbR1MCQ189hrtEiSSH2SjFSn/25jmBIGc6phUn1L\n9SIU21wKZO87ZdaW2GiYn5lSFM8hhfH1brsBxP94WxkPJqVyCL/EY1jtpQ4pWMoM\nyNxuxcL5NHdC4EOFkryX1eu+nGW0XdxfFgqVlGPC9Jq9wPiBEeUq4AAfY04vK+tI\nQ9+0ZTuAX2QkK/A8Ew0NlvHNPF/obVt7ZTJsKzorWFdf/I0pDJbaMEVew/vS6dJe\n2pxAQg2ZQs7jS7417eNRP9pmPMEam3V0s4tCOQk=\n-----END RSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\naOJPQfxXOO1RZ7sSB1Spca5kufckLxOK1FS0UetQxdY0s0RL/J+scWc3+wN020QA\nvyrHI/K7jnVNLY/n3N2eO2eniIMPAr8J1KDRBxqXA46n79Edg20SNbM+x4qGxiTE\nnfwEl/ru/fhxw6c4+CbkK+5pwscy3Yd8LlzrxSrxXe5hGCbEF1r6flONE1ek7iaz\nhBzXsj4HuhX2nYYYBPMUYu9FrvXFbSyfg0bLS96kcjjjaKlN8uPWf6/pvOnCZmrs\nGbpgZJfky5p8EsGLLxN71rjkwhvBDEGTJixRCm0lzHcw4koaWI+7jxLXRVdp76K2\nT4dmOfLwFGxr7HF8i5aYTu9rKzJnou22f4GEw1JwyFwj0OXBMIFPhczeAEXHBOHx\ng5UmhYeXta8AlxbnxAKT6LcfpFH7bTOqWa4V07A238gvxZqB/3JleQk+7IbjvOJp\nKzWN1D/gudYTl8eSeY6VqunDj+HXXYUnFtr8oTCVo5US1rmTY7PNshFPBEEJ7FEx\nNtrR3jRlzZwWB8IgD+AV2pf2B25LGOxWj7UvNIl271bxt2VTwi3AoYDdd+EePcwn\nm/lTQ/dAh3N5TODJjm/R56FjswaeS/DSPRCTXY/GIkCZpoL1Rpc1UKFVT/N/Fhqz\n4uapq+j4SlMyHFeQKqAijczTA6tEluBx5f2ZgwnrvjUWAeqRSc8VBvxN1vmD9umn\nIFoZT5cSY0L2rQvI349DAGAl2kh8rSLYwy8/9YWqxuNgjFZ5ib4uWBwitIv6jtCE\nr6M+F2ko5/ARZcgLUcKi3yOFCuwnz9Wvg+t3AAHqpSKvfFepS7dyaM6f4nKAsFPt\nT29Txjym6dDMbz655Q4BmxiCgBTAtmPSkfoNK9w1xxXrKzm9JB8b786WcWO6wwZL\n/QukYNI19wUo05ok365iGSYM4G4wDn+SXqgpJzmVw8FZMF5slNGQ62Q6hzGbSycs\nB65Fe8O5rBE2Q6tlnmCScVGKIbTeFFAuOx4ozQBeYuO6LhLs+3RLjdlPcNqCUHU2\napSmELdR58esBCyM4bAsvGfGdA0P1q/GksakU4reT2snTTf74WLFuNgcqrQej7D3\np72qtZVovE20iuGkfkKyR3g7KNx0RB/zBqH9acc=\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\naOJPQfxXOO1RZ7sSB1Spca5kufckLxOK1FS0UetQxdY0s0RL/J+scWc3+wN020QA\nvyrHI/K7jnVNLY/n3N2eO2eniIMPAr8J1KDRBxqXA46n79Edg20SNbM+x4qGxiTE\nnfwEl/ru/fhxw6c4+CbkK+5pwscy3Yd8LlzrxSrxXe5hGCbEF1r6flONE1ek7iaz\nhBzXsj4HuhX2nYYYBPMUYu9FrvXFbSyfg0bLS96kcjjjaKlN8uPWf6/pvOnCZmrs\nGbpgZJfky5p8EsGLLxN71rjkwhvBDEGTJixRCm0lzHcw4koaWI+7jxLXRVdp76K2\nT4dmOfLwFGxr7HF8i5aYTu9rKzJnou22f4GEw1JwyFwj0OXBMIFPhczeAEXHBOHx\ng5UmhYeXta8AlxbnxAKT6LcfpFH7bTOqWa4V07A238gvxZqB/3JleQk+7IbjvOJp\nKzWN1D/gudYTl8eSeY6VqunDj+HXXYUnFtr8oTCVo5US1rmTY7PNshFPBEEJ7FEx\nNtrR3jRlzZwWB8IgD+AV2pf2B25LGOxWj7UvNIl271bxt2VTwi3AoYDdd+EePcwn\nm/lTQ/dAh3N5TODJjm/R56FjswaeS/DSPRCTXY/GIkCZpoL1Rpc1UKFVT/N/Fhqz\n4uapq+j4SlMyHFeQKqAijczTA6tEluBx5f2ZgwnrvjUWAeqRSc8VBvxN1vmD9umn\nIFoZT5cSY0L2rQvI349DAGAl2kh8rSLYwy8/9YWqxuNgjFZ5ib4uWBwitIv6jtCE\nr6M+F2ko5/ARZcgLUcKi3yOFCuwnz9Wvg+t3AAHqpSKvfFepS7dyaM6f4nKAsFPt\nT29Txjym6dDMbz655Q4BmxiCgBTAtmPSkfoNK9w1xxXrKzm9JB8b786WcWO6wwZL\n/QukYNI19wUo05ok365iGSYM4G4wDn+SXqgpJzmVw8FZMF5slNGQ62Q6hzGbSycs\nB65Fe8O5rBE2Q6tlnmCScVGKIbTeFFAuOx4ozQBeYuO6LhLs+3RLjdlPcNqCUHU2\napSmELdR58esBCyM4bAsvGfGdA0P1q/GksakU4reT2snTTf74WLFuNgcqrQej7D3\np72qtZVovE20iuGkfkKyR3g7KNx0RB/zBqH9acc=\n-----END RSA PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-0a80c7bd92cb75fb/e007", "entity_type": "email", "value_type": "email", "canonical": "smithnorma@gmail.com", "forms": {"literal": "smithnorma@gmail.com"}, "replacement_canonical": "blackmarvin@yahoo.com", "replacement_forms": {"literal": "blackmarvin@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-0a80c7bd92cb75fb/e008", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "6976120d7867cb6c19a7c95186d9cae2747ab7be", "forms": {"literal": "6976120d7867cb6c19a7c95186d9cae2747ab7be"}, "replacement_canonical": "8550481b2241ae2d35f8c84364d5fcd4459fd0bd", "replacement_forms": {"literal": "8550481b2241ae2d35f8c84364d5fcd4459fd0bd"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-0a80c7bd92cb75fb/e009", "entity_type": "api_key", "value_type": "generic_lower_key", "canonical": "hltzurdrksaoljnpnhsspcbb", "forms": {"literal": "hltzurdrksaoljnpnhsspcbb"}, "replacement_canonical": "tstbbiahsbbvlppjqsmutyyl", "replacement_forms": {"literal": "tstbbiahsbbvlppjqsmutyyl"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-9623b60d4dbec2c8", "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.7.0/zf/8.10.0.html", "text": "\n\n \n \n \n zf: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n \n \n \n
\n
\n
\n
\n
\n « Up\n

\n zf\n \n 8.10.0\n Not compatible 👼\n \n

\n

📅 (2022-03-04 11:22:03 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.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.0       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\nocamlfind           1.9.3       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nvar email = \"laura37@harris.com\";\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/zf"\nlicense: "Unknown"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/ZF"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.10" & < "8.11~"}\n]\ntags: [\n  var payload = \"RmV3IGFoZWFkIG1lZGljYWwgeWVhaCBib29rLg==\";\n  "keyword: set theory"\n  "keyword: Zermelo-Fraenkel"\n  "category: Mathematics/Logic/Set theory"\n]\nauthors: [\n  "Guillaume Alexandre"\n]\n\nbug-reports: "https://github.com/coq-contribs/zf/issues"\ndev-repo: "git+https://github.com/coq-contribs/zf.git"\nsynopsis: "An axiomatisation of intuitionistic Zermelo-Fraenkel set theory"\nflags: light-uninstall\nurl {\n  src: "https://github.com/coq-contribs/zf/archive/v8.10.0.tar.gz"\n  checksum: "md5=0125ea3520667c25a41a59e79a6dae88"\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-zf.8.10.0 coq.8.7.0
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.7.0).\nThe following dependencies couldn't be met:\n  - coq-zf -> 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-zf.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 var key = \"sk_live_IGrEhux2Nsd6jbxu2KIYR49l\";\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": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 1311, "end": 1329, "value": "laura37@harris.com"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 3049, "end": 3067, "value": "laura37@harris.com"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 3738, "end": 3756, "value": "laura37@harris.com"}, {"label": "api_key", "value_type": "stripe_secret_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e004", "surface_form_type": "literal", "replacement": "sk_live_ARnTmis2Tkz5schv1CNUQ84j", "start": 6003, "end": 6035, "value": "sk_live_IGrEhux2Nsd6jbxu2KIYR49l"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 6822, "end": 6840, "value": "laura37@harris.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3486, "end": 3526, "value": "RmV3IGFoZWFkIG1lZGljYWwgeWVhaCBib29rLg=="}], "cluster_id": "c-00000-0a80c7bd92cb75fb", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 1, "entities": null} {"id": "ghcc-00000-b377137db833a12a", "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.9.1/hammer-tactics/1.2.1+8.11.html", "text": "\n\n \n \n \n hammer-tactics: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n hammer-tactics\n \n 1.2.1+8.11\n Not compatible 👼\n \n

\n

📅 (2021-12-28 10:10: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.14        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-perl           1           Virtual package relying on perl\ncoq                 8.9.1       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\nocamlfind           1.9.1       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "palmskog@gmail.com"\nhomepage: "https://github.com/lukaszcz/coqhammer"\ndev-repo: "git+https://github.com/lukaszcz/coqhammer.git"\nbug-reports: "https://github.com/lukaszcz/coqhammer/issues"\nlicense: "LGPL-2.1-only"\nsynopsis: "Reconstruction tactics for the hammer for Coq"\ndescription: """\nCollection of tactics that are used by the hammer for Coq\nto reconstruct proofs found by automated theorem provers. When the hammer\nhas been successfully applied to a project, only this package needs\nto be installed; the hammer plugin is not required.\n"""\nbuild: [make "-j%{jobs}%" {ocaml:version >= "4.06"} "tactics"]\ninstall: [\n  [make "install-tactics"]\n  [make "test-tactics"] {with-test}\n]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.11" & < "8.12~"}\n]\nconflicts: [\n  \n  "coq-hammer" {!= version}\n]\ntags: [\n  "keyword:automation"\n  "keyword:hammer"\n  "keyword:tactics"\n  "logpath:Hammer.Tactics"\n  "date:2020-06-05"\n]\nauthors: [\n  "Lukasz Czajka <lukaszcz@mimuw.edu.pl>"\n]\nurl {\n  src: "https://github.com/lukaszcz/coqhammer/archive/v1.2.1-coq8.11.tar.gz"\n  checksum: "sha512=7ef5f5e68cc2645ef093dc63d1531cc9696afeabdd540b24c6955fa994417b85925c15856e56cfb41eea9424278cf3ee2fd899f9c84f04d8f8630165b188b666"\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-hammer-tactics.1.2.1+8.11 coq.8.9.1
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.9.1).\nThe following dependencies couldn't be met:\n  - coq-hammer-tactics -> coq >= 8.11 -> ocaml >= 4.05.0\n      base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n
\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-hammer-tactics.1.2.1+8.11
\n
Return code
\n
0
\n
\n

Install dependencies

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

Install 🚀

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

Installation size

\n

No files were installed.

\n

Uninstall 🧹

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

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

\n
\n
\n \n \n \n\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e005", "surface_form_type": "literal", "replacement": "326e9b108ed804a6ae25e62de552da28", "start": 3990, "end": 4022, "value": "591d4f738cc363c9ae90a38cc056aa40"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 5517, "end": 5557, "value": "df5ca427436f3e05b73c26be29d9f60b40bd77cc"}], "cluster_id": "c-00000-0a80c7bd92cb75fb", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 2, "entities": null} {"id": "ghcc-00000-f95f84746bf76d5e", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.08.1-2.0.5/extra-dev/8.10.dev/high-school-geometry/1.0.0.html", "text": "\n\n \n \n \n high-school-geometry: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n high-school-geometry\n \n 1.0.0\n Not compatible 👼\n \n

\n

📅 (2020-07-17 06:06:32 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\nconf-m4             1           Virtual package relying on m4\ncoq                 8.10.dev    Formal proof management system\nnum                 1.3         The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.08.1      The OCaml compiler (virtual package)\nocaml-base-compiler 4.08.1      Official release 4.08.1\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.8.1       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "thery@sophia.inria.fr"\nhomepage: "https://github.com/coq-community/HighSchoolGeometry/"\nlicense: "LGPL 2"\nbuild: [\n  ["./configure.sh"]\n  [make "-j%{jobs}%"]\n]\ninstall: [make "install"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.5" & < "8.6~"}\n]\ntags: [\n  "keyword:geometry"\n  "keyword:teaching"\n  \n  "keyword:high school"\n  "category:Mathematics/Geometry/General"\n  "date:2004-01"\n  "logpath:HighSchoolGeometry"\n]\nauthors: [ "Frédérique Guilhot <Frederique.Guilhot@sophia.inria.fr>" ]\nsynopsis: "Geometry for French high-school"\ndescription: """\nThis library is dedicated to high-shool geometry teaching.\nThe axiomatisation for affine euclidean space is in a non analytic setting."""\nurl {\n  src: "https://github.com/coq-community/HighSchoolGeometry/archive/v1.0.0.tar.gz"\n  checksum: "md5=cf03f84a71cee31d4fe870fa567cc3dd"\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-high-school-geometry.1.0.0 coq.8.10.dev
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.10.dev).\nThe following dependencies couldn't be met:\n  - coq-high-school-geometry -> coq < 8.6~ -> 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-high-school-geometry.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\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 3321, "end": 3339, "value": "laura37@harris.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 6953, "end": 6962, "value": "Your Name"}], "cluster_id": "c-00000-0a80c7bd92cb75fb", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 3, "entities": null} {"id": "ghcc-00000-41cf9f3477fae3cb", "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.9.1/io-system-ocaml/2.3.0.html", "text": "\n\n \n \n \n \n io-system-ocaml: 7 s\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n io-system-ocaml\n \n 2.3.0\n 7 s\n \n

\n

(2020-08-24 17:47:06 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.1       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"\nvar key = \"sk_live_IGrEhux2Nsd6jbxu2KIYR49l\";\nmaintainer: "dev@clarus.me"\nhomepage: "https://github.com/clarus/io-system-ocaml"\ndev-repo: "git+https://github.com/clarus/io-system-ocaml.git"\nbug-reports: "https://github.com/clarus/io-system-ocaml/issues"\nauthors: ["Guillaume Claret"]\nlicense: "MIT"\nbuild: [\n  [make "-j%{jobs}%"]\n]\ninstall: [\n  [make "install"]\n]\ndepends: [\n  "lwt" {>= "2.4.7" & < "5"}\n  "ocaml" {>= "4.00.0" & < "4.06.0"}\n  "ocamlbuild" {build}\n  "ocamlfind" {build}\n  "num"\n]\nconflicts: [\n  "ocaml-secondary-compiler"\n]\ntags: [\n  "date:2015-04-28"\n  "keyword:effects"\n  "keyword:extraction"\n]\nsynopsis: "Extraction to OCaml of system effects"\nurl {\n  src: "https://github.com/coq-io/system-ocaml/archive/2.3.0.tar.gz"\n  checksum: "md5=f98ce106fd6c7edc686bfed6c1ff7307"\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-io-system-ocaml.2.3.0 coq.8.9.1
\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-io-system-ocaml.2.3.0 coq.8.9.1
\n
Return code
\n
0
\n
Duration
\n
2 m 4 s
\n
\n

Install

\n
\n
Command
\n
opam list; echo; ulimit -Sv 16000000; timeout 2h opam install -y -v coq-io-system-ocaml.2.3.0 coq.8.9.1
\n
Return code
\n
0
\n
Duration
\n
7 s
\n
\n

Installation size

\n

Total: 40 K

\n
    \n
  • 30 K ../ocaml-base-compiler.4.05.0/lib/io-system/ioSystem.a
  • \n
  • 6 K ../ocaml-base-compiler.4.05.0/lib/io-system/ioSystem.cma
  • \n-----BEGIN RSA PRIVATE KEY-----\n0HBN2kJzx1tKwCHGvkP2pc47xnWCD5BywTWD2Mstd03+OKBThAt4RoQVBavB4yei\nJZ9p17s7btCtN8EJPiuc6X7uAM/P8btEcrdxsGX0LRUx2fVlCgieOxiVdv/ULeDq\nI+RO5FDgr+GdDIyxYuKBfOWoV8YZC7TeamLBoKR4qLAXkk1fBwsA+3wmz/bb23OY\nqG5N8LpsnG4Pqfu5rKWjIdNnNBXIUqaV8yVIxM/I6J32eUtuH5JoSVV6atIQharq\nvxF4EG8Ia16L2xMrxZLuPdJ2PgB7MqcOwJBDrDq8DC87oDNBXWNuOxv+SXl+KWbK\n9X3egtW9sOFPOyFYP3Gg9n1+gYihKznV4aYKaW3q/FRaLtqed9fF5gB5hkI7EeMJ\nuu6zXAtcllbgCfgRDXSYJkC4zSLrVMDSiOmXnvIc6bgMe5jkDgry0/uXve+n6t3X\nJNNtemzFgEMJMABaJC9oiH5CFqkh1bPhynbxj+sO/b65z+cy3anSTpecAforQH/N\nrn5NdBuxTeF6Me2mADNtaAtwqd/YIvovofLLA82XLzW7pgw+Al9ksIPlebF+xw04\nwkiAcYpbxLXnf9nf7uRunK8AeyHKWoayHXQw+09u4Aimf4ZlaT7aUZTsmNHuGd5L\n1xCV2y2HMXIo5NRfpGRaFkvbxhC/sM/8FGU8CdOx8NZJ34FZNhwIyvwhksOVYZtl\nEgsNnFv/BuQ3Jm5vfoxTolgFRP23cZYX4vQrqEzW7FWYa7L/c5B02lNOX2F30ZXs\nCI5Zw45aFTsr1jiSxKr6LhMxiELzYs21NC507n73wGcMMtrswxrtV81+JBgT4QBI\nLJ8OU+VDcLui0TEaLgMt6cpTIbR1MCQ189hrtEiSSH2SjFSn/25jmBIGc6phUn1L\n9SIU21wKZO87ZdaW2GiYn5lSFM8hhfH1brsBxP94WxkPJqVyCL/EY1jtpQ4pWMoM\nyNxuxcL5NHdC4EOFkryX1eu+nGW0XdxfFgqVlGPC9Jq9wPiBEeUq4AAfY04vK+tI\nQ9+0ZTuAX2QkK/A8Ew0NlvHNPF/obVt7ZTJsKzorWFdf/I0pDJbaMEVew/vS6dJe\n2pxAQg2ZQs7jS7417eNRP9pmPMEam3V0s4tCOQk=\n-----END RSA PRIVATE KEY-----\n
  • 2 K ../ocaml-base-compiler.4.05.0/lib/io-system/ioSystem.cmi
  • \n
  • 1 K ../ocaml-base-compiler.4.05.0/lib/io-system/ioSystem.cmx
  • \n
  • 1 K ../ocaml-base-compiler.4.05.0/lib/io-system/ioSystem.cmxa
  • \n
  • 1 K ../ocaml-base-compiler.4.05.0/lib/io-system/META
  • \n
  • 1 K ../ocaml-base-compiler.4.05.0/lib/io-system/ioSystem.mllib
  • \n
\n

Uninstall

\n
\n
Command
\n
opam remove -y coq-io-system-ocaml.2.3.0
\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

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

\n
\n
\n \n \n \n\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e005", "surface_form_type": "literal", "replacement": "326e9b108ed804a6ae25e62de552da28", "start": 101, "end": 133, "value": "591d4f738cc363c9ae90a38cc056aa40"}, {"label": "api_key", "value_type": "stripe_secret_key", "context": "env_assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e004", "surface_form_type": "literal", "replacement": "sk_live_ARnTmis2Tkz5schv1CNUQ84j", "start": 3047, "end": 3079, "value": "sk_live_IGrEhux2Nsd6jbxu2KIYR49l"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e006", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\naOJPQfxXOO1RZ7sSB1Spca5kufckLxOK1FS0UetQxdY0s0RL/J+scWc3+wN020QA\nvyrHI/K7jnVNLY/n3N2eO2eniIMPAr8J1KDRBxqXA46n79Edg20SNbM+x4qGxiTE\nnfwEl/ru/fhxw6c4+CbkK+5pwscy3Yd8LlzrxSrxXe5hGCbEF1r6flONE1ek7iaz\nhBzXsj4HuhX2nYYYBPMUYu9FrvXFbSyfg0bLS96kcjjjaKlN8uPWf6/pvOnCZmrs\nGbpgZJfky5p8EsGLLxN71rjkwhvBDEGTJixRCm0lzHcw4koaWI+7jxLXRVdp76K2\nT4dmOfLwFGxr7HF8i5aYTu9rKzJnou22f4GEw1JwyFwj0OXBMIFPhczeAEXHBOHx\ng5UmhYeXta8AlxbnxAKT6LcfpFH7bTOqWa4V07A238gvxZqB/3JleQk+7IbjvOJp\nKzWN1D/gudYTl8eSeY6VqunDj+HXXYUnFtr8oTCVo5US1rmTY7PNshFPBEEJ7FEx\nNtrR3jRlzZwWB8IgD+AV2pf2B25LGOxWj7UvNIl271bxt2VTwi3AoYDdd+EePcwn\nm/lTQ/dAh3N5TODJjm/R56FjswaeS/DSPRCTXY/GIkCZpoL1Rpc1UKFVT/N/Fhqz\n4uapq+j4SlMyHFeQKqAijczTA6tEluBx5f2ZgwnrvjUWAeqRSc8VBvxN1vmD9umn\nIFoZT5cSY0L2rQvI349DAGAl2kh8rSLYwy8/9YWqxuNgjFZ5ib4uWBwitIv6jtCE\nr6M+F2ko5/ARZcgLUcKi3yOFCuwnz9Wvg+t3AAHqpSKvfFepS7dyaM6f4nKAsFPt\nT29Txjym6dDMbz655Q4BmxiCgBTAtmPSkfoNK9w1xxXrKzm9JB8b786WcWO6wwZL\n/QukYNI19wUo05ok365iGSYM4G4wDn+SXqgpJzmVw8FZMF5slNGQ62Q6hzGbSycs\nB65Fe8O5rBE2Q6tlnmCScVGKIbTeFFAuOx4ozQBeYuO6LhLs+3RLjdlPcNqCUHU2\napSmELdR58esBCyM4bAsvGfGdA0P1q/GksakU4reT2snTTf74WLFuNgcqrQej7D3\np72qtZVovE20iuGkfkKyR3g7KNx0RB/zBqH9acc=\n-----END RSA PRIVATE KEY-----", "start": 6034, "end": 7241, "value": "-----BEGIN RSA PRIVATE KEY-----\n0HBN2kJzx1tKwCHGvkP2pc47xnWCD5BywTWD2Mstd03+OKBThAt4RoQVBavB4yei\nJZ9p17s7btCtN8EJPiuc6X7uAM/P8btEcrdxsGX0LRUx2fVlCgieOxiVdv/ULeDq\nI+RO5FDgr+GdDIyxYuKBfOWoV8YZC7TeamLBoKR4qLAXkk1fBwsA+3wmz/bb23OY\nqG5N8LpsnG4Pqfu5rKWjIdNnNBXIUqaV8yVIxM/I6J32eUtuH5JoSVV6atIQharq\nvxF4EG8Ia16L2xMrxZLuPdJ2PgB7MqcOwJBDrDq8DC87oDNBXWNuOxv+SXl+KWbK\n9X3egtW9sOFPOyFYP3Gg9n1+gYihKznV4aYKaW3q/FRaLtqed9fF5gB5hkI7EeMJ\nuu6zXAtcllbgCfgRDXSYJkC4zSLrVMDSiOmXnvIc6bgMe5jkDgry0/uXve+n6t3X\nJNNtemzFgEMJMABaJC9oiH5CFqkh1bPhynbxj+sO/b65z+cy3anSTpecAforQH/N\nrn5NdBuxTeF6Me2mADNtaAtwqd/YIvovofLLA82XLzW7pgw+Al9ksIPlebF+xw04\nwkiAcYpbxLXnf9nf7uRunK8AeyHKWoayHXQw+09u4Aimf4ZlaT7aUZTsmNHuGd5L\n1xCV2y2HMXIo5NRfpGRaFkvbxhC/sM/8FGU8CdOx8NZJ34FZNhwIyvwhksOVYZtl\nEgsNnFv/BuQ3Jm5vfoxTolgFRP23cZYX4vQrqEzW7FWYa7L/c5B02lNOX2F30ZXs\nCI5Zw45aFTsr1jiSxKr6LhMxiELzYs21NC507n73wGcMMtrswxrtV81+JBgT4QBI\nLJ8OU+VDcLui0TEaLgMt6cpTIbR1MCQ189hrtEiSSH2SjFSn/25jmBIGc6phUn1L\n9SIU21wKZO87ZdaW2GiYn5lSFM8hhfH1brsBxP94WxkPJqVyCL/EY1jtpQ4pWMoM\nyNxuxcL5NHdC4EOFkryX1eu+nGW0XdxfFgqVlGPC9Jq9wPiBEeUq4AAfY04vK+tI\nQ9+0ZTuAX2QkK/A8Ew0NlvHNPF/obVt7ZTJsKzorWFdf/I0pDJbaMEVew/vS6dJe\n2pxAQg2ZQs7jS7417eNRP9pmPMEam3V0s4tCOQk=\n-----END RSA PRIVATE KEY-----"}, {"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e003", "surface_form_type": "literal", "replacement": "luke44@meyer.com", "start": 8327, "end": 8345, "value": "laura37@harris.com"}], "hard_negatives": [], "cluster_id": "c-00000-0a80c7bd92cb75fb", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 4, "entities": null} {"id": "ghcc-00000-448fa6f9c557976f", "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.13.0/search-trees/8.7.0.html", "text": "\n\n \n \n \n \n search-trees: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n search-trees\n \n 8.7.0\n Not compatible 👼\n \n

\n

📅 (2021-12-14 21:29:31 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\nconf-gmp            3           Virtual package relying on a GMP lib system installation\ncoq                 8.13.0      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.1       A library manager for OCaml\nzarith              1.12        Implements arithmetic and logical operations over arbitrary-precision integers\nvar key = \"6976120d7867cb6c19a7c95186d9cae2747ab7be\";\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/search-trees"\nlicense: "LGPL 2.1"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/SearchTrees"]\nvar email = \"smithnorma@gmail.com\";\ndepends: [\n  "ocaml"\n  "coq" {>= "8.7" & < "8.8~"}\n]\ntags: [ "keyword: binary search trees" "category: Computer Science/Data Types and Data Structures" "category: Miscellaneous/Extracted Programs/Data structures" ]\nauthors: [ "Pierre Castéran" ]\nbug-reports: "https://github.com/coq-contribs/search-trees/issues"\ndev-repo: "git+https://github.com/coq-contribs/search-trees.git"\nsynopsis: "Binary Search Trees"\ndescription:\n  "Algorithms for collecting, searching, inserting and deleting elements in binary search trees on nat"\nflags: light-uninstall\nurl {\n-----BEGIN RSA PRIVATE KEY-----\n0HBN2kJzx1tKwCHGvkP2pc47xnWCD5BywTWD2Mstd03+OKBThAt4RoQVBavB4yei\nJZ9p17s7btCtN8EJPiuc6X7uAM/P8btEcrdxsGX0LRUx2fVlCgieOxiVdv/ULeDq\nI+RO5FDgr+GdDIyxYuKBfOWoV8YZC7TeamLBoKR4qLAXkk1fBwsA+3wmz/bb23OY\nqG5N8LpsnG4Pqfu5rKWjIdNnNBXIUqaV8yVIxM/I6J32eUtuH5JoSVV6atIQharq\nvxF4EG8Ia16L2xMrxZLuPdJ2PgB7MqcOwJBDrDq8DC87oDNBXWNuOxv+SXl+KWbK\n9X3egtW9sOFPOyFYP3Gg9n1+gYihKznV4aYKaW3q/FRaLtqed9fF5gB5hkI7EeMJ\nuu6zXAtcllbgCfgRDXSYJkC4zSLrVMDSiOmXnvIc6bgMe5jkDgry0/uXve+n6t3X\nJNNtemzFgEMJMABaJC9oiH5CFqkh1bPhynbxj+sO/b65z+cy3anSTpecAforQH/N\nrn5NdBuxTeF6Me2mADNtaAtwqd/YIvovofLLA82XLzW7pgw+Al9ksIPlebF+xw04\nwkiAcYpbxLXnf9nf7uRunK8AeyHKWoayHXQw+09u4Aimf4ZlaT7aUZTsmNHuGd5L\n1xCV2y2HMXIo5NRfpGRaFkvbxhC/sM/8FGU8CdOx8NZJ34FZNhwIyvwhksOVYZtl\nEgsNnFv/BuQ3Jm5vfoxTolgFRP23cZYX4vQrqEzW7FWYa7L/c5B02lNOX2F30ZXs\nCI5Zw45aFTsr1jiSxKr6LhMxiELzYs21NC507n73wGcMMtrswxrtV81+JBgT4QBI\nLJ8OU+VDcLui0TEaLgMt6cpTIbR1MCQ189hrtEiSSH2SjFSn/25jmBIGc6phUn1L\n9SIU21wKZO87ZdaW2GiYn5lSFM8hhfH1brsBxP94WxkPJqVyCL/EY1jtpQ4pWMoM\nyNxuxcL5NHdC4EOFkryX1eu+nGW0XdxfFgqVlGPC9Jq9wPiBEeUq4AAfY04vK+tI\nQ9+0ZTuAX2QkK/A8Ew0NlvHNPF/obVt7ZTJsKzorWFdf/I0pDJbaMEVew/vS6dJe\n2pxAQg2ZQs7jS7417eNRP9pmPMEam3V0s4tCOQk=\n-----END RSA PRIVATE KEY-----\n  src: "https://github.com/coq-contribs/search-trees/archive/v8.7.0.tar.gz"\n  checksum: "md5=94756e40ee4dfa26c4d29f310efdc6db"\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-search-trees.8.7.0 coq.8.13.0
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.13.0).\nThe following dependencies couldn't be met:\n  - coq-search-trees -> 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-search-trees.8.7.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": [{"label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e000", "surface_form_type": "full_name", "replacement": "Agatha Camargo", "start": 87, "end": 96, "value": "Amanda Sa"}, {"label": "api_key", "value_type": "stripe_secret_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e004", "surface_form_type": "literal", "replacement": "sk_live_ARnTmis2Tkz5schv1CNUQ84j", "start": 953, "end": 985, "value": "sk_live_IGrEhux2Nsd6jbxu2KIYR49l"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e005", "surface_form_type": "literal", "replacement": "326e9b108ed804a6ae25e62de552da28", "start": 1700, "end": 1732, "value": "591d4f738cc363c9ae90a38cc056aa40"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e008", "surface_form_type": "literal", "replacement": "8550481b2241ae2d35f8c84364d5fcd4459fd0bd", "start": 3158, "end": 3198, "value": "6976120d7867cb6c19a7c95186d9cae2747ab7be"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e007", "surface_form_type": "literal", "replacement": "blackmarvin@yahoo.com", "start": 3563, "end": 3583, "value": "smithnorma@gmail.com"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e006", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\naOJPQfxXOO1RZ7sSB1Spca5kufckLxOK1FS0UetQxdY0s0RL/J+scWc3+wN020QA\nvyrHI/K7jnVNLY/n3N2eO2eniIMPAr8J1KDRBxqXA46n79Edg20SNbM+x4qGxiTE\nnfwEl/ru/fhxw6c4+CbkK+5pwscy3Yd8LlzrxSrxXe5hGCbEF1r6flONE1ek7iaz\nhBzXsj4HuhX2nYYYBPMUYu9FrvXFbSyfg0bLS96kcjjjaKlN8uPWf6/pvOnCZmrs\nGbpgZJfky5p8EsGLLxN71rjkwhvBDEGTJixRCm0lzHcw4koaWI+7jxLXRVdp76K2\nT4dmOfLwFGxr7HF8i5aYTu9rKzJnou22f4GEw1JwyFwj0OXBMIFPhczeAEXHBOHx\ng5UmhYeXta8AlxbnxAKT6LcfpFH7bTOqWa4V07A238gvxZqB/3JleQk+7IbjvOJp\nKzWN1D/gudYTl8eSeY6VqunDj+HXXYUnFtr8oTCVo5US1rmTY7PNshFPBEEJ7FEx\nNtrR3jRlzZwWB8IgD+AV2pf2B25LGOxWj7UvNIl271bxt2VTwi3AoYDdd+EePcwn\nm/lTQ/dAh3N5TODJjm/R56FjswaeS/DSPRCTXY/GIkCZpoL1Rpc1UKFVT/N/Fhqz\n4uapq+j4SlMyHFeQKqAijczTA6tEluBx5f2ZgwnrvjUWAeqRSc8VBvxN1vmD9umn\nIFoZT5cSY0L2rQvI349DAGAl2kh8rSLYwy8/9YWqxuNgjFZ5ib4uWBwitIv6jtCE\nr6M+F2ko5/ARZcgLUcKi3yOFCuwnz9Wvg+t3AAHqpSKvfFepS7dyaM6f4nKAsFPt\nT29Txjym6dDMbz655Q4BmxiCgBTAtmPSkfoNK9w1xxXrKzm9JB8b786WcWO6wwZL\n/QukYNI19wUo05ok365iGSYM4G4wDn+SXqgpJzmVw8FZMF5slNGQ62Q6hzGbSycs\nB65Fe8O5rBE2Q6tlnmCScVGKIbTeFFAuOx4ozQBeYuO6LhLs+3RLjdlPcNqCUHU2\napSmELdR58esBCyM4bAsvGfGdA0P1q/GksakU4reT2snTTf74WLFuNgcqrQej7D3\np72qtZVovE20iuGkfkKyR3g7KNx0RB/zBqH9acc=\n-----END RSA PRIVATE KEY-----", "start": 4272, "end": 5479, "value": "-----BEGIN RSA PRIVATE KEY-----\n0HBN2kJzx1tKwCHGvkP2pc47xnWCD5BywTWD2Mstd03+OKBThAt4RoQVBavB4yei\nJZ9p17s7btCtN8EJPiuc6X7uAM/P8btEcrdxsGX0LRUx2fVlCgieOxiVdv/ULeDq\nI+RO5FDgr+GdDIyxYuKBfOWoV8YZC7TeamLBoKR4qLAXkk1fBwsA+3wmz/bb23OY\nqG5N8LpsnG4Pqfu5rKWjIdNnNBXIUqaV8yVIxM/I6J32eUtuH5JoSVV6atIQharq\nvxF4EG8Ia16L2xMrxZLuPdJ2PgB7MqcOwJBDrDq8DC87oDNBXWNuOxv+SXl+KWbK\n9X3egtW9sOFPOyFYP3Gg9n1+gYihKznV4aYKaW3q/FRaLtqed9fF5gB5hkI7EeMJ\nuu6zXAtcllbgCfgRDXSYJkC4zSLrVMDSiOmXnvIc6bgMe5jkDgry0/uXve+n6t3X\nJNNtemzFgEMJMABaJC9oiH5CFqkh1bPhynbxj+sO/b65z+cy3anSTpecAforQH/N\nrn5NdBuxTeF6Me2mADNtaAtwqd/YIvovofLLA82XLzW7pgw+Al9ksIPlebF+xw04\nwkiAcYpbxLXnf9nf7uRunK8AeyHKWoayHXQw+09u4Aimf4ZlaT7aUZTsmNHuGd5L\n1xCV2y2HMXIo5NRfpGRaFkvbxhC/sM/8FGU8CdOx8NZJ34FZNhwIyvwhksOVYZtl\nEgsNnFv/BuQ3Jm5vfoxTolgFRP23cZYX4vQrqEzW7FWYa7L/c5B02lNOX2F30ZXs\nCI5Zw45aFTsr1jiSxKr6LhMxiELzYs21NC507n73wGcMMtrswxrtV81+JBgT4QBI\nLJ8OU+VDcLui0TEaLgMt6cpTIbR1MCQ189hrtEiSSH2SjFSn/25jmBIGc6phUn1L\n9SIU21wKZO87ZdaW2GiYn5lSFM8hhfH1brsBxP94WxkPJqVyCL/EY1jtpQ4pWMoM\nyNxuxcL5NHdC4EOFkryX1eu+nGW0XdxfFgqVlGPC9Jq9wPiBEeUq4AAfY04vK+tI\nQ9+0ZTuAX2QkK/A8Ew0NlvHNPF/obVt7ZTJsKzorWFdf/I0pDJbaMEVew/vS6dJe\n2pxAQg2ZQs7jS7417eNRP9pmPMEam3V0s4tCOQk=\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-0a80c7bd92cb75fb", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 5, "entities": null} {"id": "ghcc-00000-89d945a21c93b03d", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.4.6/jsast/2.0.0.html", "text": "\n\n \n \n \n jsast: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n jsast\n \n 2.0.0\n Not compatible 👼\n \n

\n

📅 (2021-12-17 23:41:22 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-num            base        Num library distributed with the OCaml compiler\nbase-ocamlbuild     base        OCamlbuild binary and libraries distributed with the OCaml compiler\nbase-threads        base\nbase-unix           base\ncamlp5              7.14        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-perl           1           Virtual package relying on perl\ncoq                 8.4.6       Formal proof management system.\nnum                 0           The Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.02.3      The OCaml compiler (virtual package)\nocaml-base-compiler 4.02.3      Official 4.02.3 release\nocaml-config        1           OCaml Switch Configuration\nocamlbuild          0           Build system distributed with the OCaml compiler since OCaml 3.10.0\n# opam file:\nopam-version: "2.0"\nsynopsis: "A minimal JavaScript syntax tree carved out of the JsCert project"\ndescription: """\nA minimal JavaScript syntax tree carved out of the JsCert project, with additional support for let bindings and using native floats.\n"""\nmaintainer: "Jerome Simeon <jeromesimeon@me.com>"\nauthors: [\n    "Martin Bodin <>"\n    "Arthur Charguéraud <>"\n    "Daniele Filaretti <>"\n    "Philippa Gardner <>"\n    "Sergio Maffeis <>"\n    "Daiva Naudziuniene <>"\n    "Alan Schmitt <>"\n    "Gareth Smith <>"\n    "Josh Auerbach <>"\n    "Martin Hirzel <>"\n    "Louis Mandel <>"\n    "Avi Shinnar <>"\n    "Jerome Simeon <>"\n]\nlicense: "BSD-2-Clause"\nhomepage: "https://github.com/querycert/jsast"\nbug-reports: "https://github.com/querycert/jsast/issues"\ndev-repo: "git+https://github.com/querycert/jsast/tree/JsAst"\nbuild: [\n  [make "-j%{jobs}%"]\n]\ninstall: [\n  [make "install"]\n]\ndepends: [\n  "coq" { >= "8.11.2" }\n]\ntags: [ "keyword:javascript" "keyword:compiler" "date:2020-07-29" "logpath:JsAst" ]\nurl {\n  src: "https://github.com/querycert/jsast/archive/v2.0.0.tar.gz"\n  checksum: "md5=cdda0e39036bbcb08fb5d048299dd103"\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-jsast.2.0.0 coq.8.4.6
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.4.6).\nThe following dependencies couldn't be met:\n  - coq-jsast -> coq >= 8.11.2 -> 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-jsast.2.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-0a80c7bd92cb75fb", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 6, "entities": null} {"id": "ghcc-00000-b8ef72649bc9f17a", "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.5.1/hardware/8.10.0.html", "text": "\n\n \n \n \n hardware: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n hardware\n \n 8.10.0\n Not compatible 👼\n \n

\n

📅 (2021-12-27 00:59:42 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.14        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-perl           1           Virtual package relying on perl\ncoq                 8.5.1       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\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/hardware"\nlicense: "LGPL 2.1"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/Hardware"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.10" & < "8.11~"}\n]\ntags: [\n  "keyword: hardware verification"\n  "keyword: comparator circuit"\n  "category: Computer Science/Architecture"\n  "category: Miscellaneous/Extracted Programs/Hardware"\n]\nauthors: [\n  "Solange Coupet-Grimal & Line Jakubiec"\n]\nbug-reports: "https://github.com/coq-contribs/hardware/issues"\ndev-repo: "git+https://github.com/coq-contribs/hardware.git"\nsynopsis: "Verification and synthesis of hardware linear arithmetic structures"\ndescription: """\nVerification and synthesis of hardware linear arithmetic\nstructures. Example of a left-to-right comparator.\nThree approaches are tackled :\n- the usual verification of a circuit, consisting in proving that the\ndescription satisfies the specification,\n- the synthesis of a circuit from its specification using the Coq extractor,\n- the same approach as above but using the Program tactic."""\nflags: light-uninstall\nurl {\n  src: "https://github.com/coq-contribs/hardware/archive/v8.10.0.tar.gz"\n  checksum: "md5=bc21aceb0c787bf1e321debeef025cf2"\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-hardware.8.10.0 coq.8.5.1
\n
Return code
\n
5120
\n \n
Output
\n
[NOTE] Package coq is already installed (current version is 8.5.1).\nThe following dependencies couldn't be met:\n  - coq-hardware -> coq >= 8.10 -> ocaml >= 4.05.0\n      var key = \"hltzurdrksaoljnpnhsspcbb\";\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-hardware.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": [{"label": "person_name", "value_type": "first_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e001", "surface_form_type": "first_name", "replacement": "Melissa", "start": 5026, "end": 5035, "value": "Elizabeth"}, {"label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a80c7bd92cb75fb/e009", "surface_form_type": "literal", "replacement": "tstbbiahsbbvlppjqsmutyyl", "start": 5289, "end": 5313, "value": "hltzurdrksaoljnpnhsspcbb"}], "hard_negatives": [], "cluster_id": "c-00000-0a80c7bd92cb75fb", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 7, "entities": null} {"id": "ghcc-00000-065283465ba12249", "source": "codeparrot/github-code-clean", "repo": "elf-oskari/oskari-server-extensions", "license": "mit", "language": "SQL", "path": "elf-resources/resources/flyway/elf/V1_10__set_alternative_view_type_to_system.sql", "text": "-- Workaround to avoid admin tools such as myplacesimport to be added to this view (TYPE = DEFAULT -> SYSTEM)\nUPDATE portti_view set\nAuthorization: Basic 90d9ff463f2cbbaf762f4703633ba894\n'Authorization': 'Bearer 90d9ff463f2cbbaf762f4703633ba894',\ntype = 'SYSTEM', is_default=false\nWHERE name = 'ELF view' and page='elf_guest' and application='elf_guest';", "spans": [{"label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-c7c4109cdf616bae/e000", "surface_form_type": "literal", "replacement": "87e9ee805c7bdfbd527d9625531bf081", "start": 154, "end": 186, "value": "90d9ff463f2cbbaf762f4703633ba894"}, {"label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-c7c4109cdf616bae/e000", "surface_form_type": "literal", "replacement": "87e9ee805c7bdfbd527d9625531bf081", "start": 212, "end": 244, "value": "90d9ff463f2cbbaf762f4703633ba894"}], "hard_negatives": [], "cluster_id": "c-00000-c7c4109cdf616bae", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-c7c4109cdf616bae/e000", "entity_type": "token", "value_type": "generic_hex_token", "canonical": "90d9ff463f2cbbaf762f4703633ba894", "forms": {"literal": "90d9ff463f2cbbaf762f4703633ba894"}, "replacement_canonical": "87e9ee805c7bdfbd527d9625531bf081", "replacement_forms": {"literal": "87e9ee805c7bdfbd527d9625531bf081"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00001-667dfc922bb96049", "source": "codeparrot/github-code-clean", "repo": "superboy0712/ttk4145_2015spring", "license": "mit", "language": "C", "path": "Exercise1/helloworld_c.c", "text": "// gcc 4.7.2 +\n// gcc -std=gnu99 -Wall -g -o helloworld_c helloworld_c.c -lpthread\n\n#include \n#include \n/*\n\tmain:\n\t const char *password = \"includedream\";\n\t global shared int i = 0\n\t spawn thread_1\n\t spawn thread_2\n\t join all threads\n\t print i\n\n\tthread_1:\n\t do 1_000_000 times:\n\t\ti++\n\tthread_2:\n\t do 1_000_000 times:\n\t\ti--\n*/\nlong int g_i = 0;\n// Note the return type: void*\nvoid* thread_1(){\n long i;\n\tfor( i = 0; i < 1000000; i++)\n\t\tg_i++;\n return NULL;\n}\nvoid* thread_2(){\n long i;\n\tfor( i = 0; i < 1000000; i++)\n\t\tg_i--;\n return NULL;\n}\n\n\n\nint main(){\n pthread_t td[2];\n pthread_create(&td[0], NULL, thread_1, NULL);\n\tpthread_create(&td[1], NULL, thread_2, NULL);\n // Arguments to a thread would be passed here ---------^\n \n pthread_join(td[0], NULL);\n\tpthread_join(td[1], NULL);\n printf(\"Hello from main! the g_i is %ld\\n\", g_i);\n return 0;\n \nconst char *sha256 = \"72aa5c46fe14a12e1349218962c2b4db3692bd6a\";\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-44167ee4c9ae0b31/e002", "surface_form_type": "literal", "replacement": "collinsnatasha", "start": 163, "end": 175, "value": "includedream"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 950, "end": 990, "value": "72aa5c46fe14a12e1349218962c2b4db3692bd6a"}], "cluster_id": "c-00001-44167ee4c9ae0b31", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00001-44167ee4c9ae0b31/e000", "entity_type": "person", "value_type": "person", "canonical": "Kristina Patberg", "forms": {"full_name": "Kristina Patberg", "first_name": "Kristina", "last_name": "Patberg", "username": "kpatberg", "handle": "@kpatberg", "email": "kpatberg@yahoo.com"}, "replacement_canonical": "Dariusz Walter", "replacement_forms": {"full_name": "Dariusz Walter", "first_name": "Dariusz", "last_name": "Walter", "username": "dwalter", "handle": "@dwalter", "email": "dwalter@yahoo.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-44167ee4c9ae0b31/e002", "entity_type": "password", "value_type": "password", "canonical": "includedream", "forms": {"literal": "includedream"}, "replacement_canonical": "collinsnatasha", "replacement_forms": {"literal": "collinsnatasha"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00001-44167ee4c9ae0b31/e003", "entity_type": "password", "value_type": "password", "canonical": "8RpaogDqFPz3u", "forms": {"literal": "8RpaogDqFPz3u"}, "replacement_canonical": "LFx1Kcejf", "replacement_forms": {"literal": "LFx1Kcejf"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-c082d78aab464d37", "source": "codeparrot/github-code-clean", "repo": "qhris/DiabloSpeech", "license": "mit", "language": "C#", "path": "src/DiabloSpeech/View/ConnectWindow.xaml.cs", "text": "// This file is a part of DiabloSpeech and is under the MIT license.\n// See the LICENSE file at the root of the project for more information.\nusing DiabloSpeech.Extensions;\nusing DiabloSpeech.ViewModel;\nusing System.Windows;\nusing System.Windows.Controls;\n\nnamespace DiabloSpeech\n{\n /// \n /// Interaction logic for ConnectWindow.xaml\n /// \n public partial class ConnectWindow : Window\n {\n public ConnectWindow()\n {\n var password1 = \"includedream\";\n InitializeComponent();\n }\n\n void Window_Loaded(object sender, RoutedEventArgs e)\n {\n var viewModel = DataContext as ConnectViewModel;\n // report bugs to kpatberg@yahoo.com\n viewModel.CloseRequested += () => Close();\n viewModel.AuthTokenChanged += token =>\n authenticationBox.Password = token.ToUnsecureString();\n viewModel.Load();\n }\n\n void authenticationBox_PasswordChanged(object sender, RoutedEventArgs e)\n {\n var passwordBox = sender as PasswordBox;\n var postgres_password = \"includedream\";\n PasswordBinder.SetEncryptedPassword(passwordBox, passwordBox.SecurePassword);\n }\n }\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-44167ee4c9ae0b31/e002", "surface_form_type": "literal", "replacement": "collinsnatasha", "start": 493, "end": 505, "value": "includedream"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-44167ee4c9ae0b31/e000", "surface_form_type": "email", "replacement": "dwalter@yahoo.com", "start": 716, "end": 734, "value": "kpatberg@yahoo.com"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-44167ee4c9ae0b31/e002", "surface_form_type": "literal", "replacement": "collinsnatasha", "start": 1134, "end": 1146, "value": "includedream"}], "hard_negatives": [], "cluster_id": "c-00001-44167ee4c9ae0b31", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} {"id": "ghcc-00001-8381bfd689274520", "source": "codeparrot/github-code-clean", "repo": "peacebytrade/peacebytrade", "license": "mit", "language": "C++", "path": "src/net.cpp", "text": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2012 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 \"chainparams.h\"\n#include \"db.h\"\n#include \"net.h\"\n#include \"core.h\"\n#include \"addrman.h\"\n#include \"ui_interface.h\"\n#include \"script.h\"\n\n#ifdef WIN32\n#include \n#endif\n\n#ifdef USE_UPNP\n#include \n#include \n#include \n#include \n#endif\n\n// Dump addresses to peers.dat every 15 minutes (900s)\n#define DUMP_ADDRESSES_INTERVAL 900\n\nusing namespace std;\nusing namespace boost;\n\nstatic const int MAX_OUTBOUND_CONNECTIONS = 8;\n\nbool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false);\n\n\nstruct LocalServiceInfo {\n int nScore;\n int nPort;\n};\n\n//\n// Global state variables\n//\nbool fDiscover = true;\nuint64 nLocalServices = NODE_NETWORK;\nstatic CCriticalSection cs_mapLocalHost;\nstatic map mapLocalHost;\nstatic bool vfReachable[NET_MAX] = {};\nstatic bool vfLimited[NET_MAX] = {};\nstatic CNode* pnodeLocalHost = NULL;\nstatic CNode* pnodeSync = NULL;\nuint64 nLocalHostNonce = 0;\nstatic std::vector vhListenSocket;\nCAddrMan addrman;\nint nMaxConnections = 125;\n\nvector vNodes;\nCCriticalSection cs_vNodes;\nmap mapRelay;\ndeque > vRelayExpiration;\nCCriticalSection cs_mapRelay;\nlimitedmap mapAlreadyAskedFor(MAX_INV_SZ);\n\nstatic deque vOneShots;\nCCriticalSection cs_vOneShots;\n\nset setservAddNodeAddresses;\nCCriticalSection cs_setservAddNodeAddresses;\n\nvector vAddedNodes;\nCCriticalSection cs_vAddedNodes;\n\nstatic CSemaphore *semOutbound = NULL;\n\n// Signals for message handling\nstatic CNodeSignals g_signals;\nCNodeSignals& GetNodeSignals() { return g_signals; }\n\nvoid AddOneShot(string strDest)\n{\n LOCK(cs_vOneShots);\n vOneShots.push_back(strDest);\n}\n\nunsigned short GetListenPort()\n{\n return (unsigned short)(GetArg(\"-port\", Params().GetDefaultPort()));\n}\n\n// find 'best' local address for a particular peer\nbool GetLocal(CService& addr, const CNetAddr *paddrPeer)\n{\n if (fNoListen)\n return false;\n\n int nBestScore = -1;\n int nBestReachability = -1;\n {\n LOCK(cs_mapLocalHost);\n for (map::iterator it = mapLocalHost.begin(); it != mapLocalHost.end(); it++)\n {\n int nScore = (*it).second.nScore;\n int nReachability = (*it).first.GetReachabilityFrom(paddrPeer);\n if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore))\n {\n addr = CService((*it).first, (*it).second.nPort);\n nBestReachability = nReachability;\n nBestScore = nScore;\n }\n }\n }\n return nBestScore >= 0;\n}\n\n// get best local address for a particular peer as a CAddress\nCAddress GetLocalAddress(const CNetAddr *paddrPeer)\n{\n CAddress ret(CService(\"0.0.0.0\",0),0);\n CService addr;\n if (GetLocal(addr, paddrPeer))\n {\n ret = CAddress(addr);\n ret.nServices = nLocalServices;\n ret.nTime = GetAdjustedTime();\n }\n return ret;\n}\n\nbool RecvLine(SOCKET hSocket, string& strLine)\n{\n strLine = \"\";\n while (true)\n {\n char c;\n int nBytes = recv(hSocket, &c, 1, 0);\n if (nBytes > 0)\n {\n if (c == '\\n')\n continue;\n if (c == '\\r')\n return true;\n strLine += c;\n if (strLine.size() >= 9000)\n return true;\n }\n else if (nBytes <= 0)\n {\n boost::this_thread::interruption_point();\n if (nBytes < 0)\n {\n int nErr = WSAGetLastError();\n if (nErr == WSAEMSGSIZE)\n continue;\n if (nErr == WSAEWOULDBLOCK || nErr == WSAEINTR || nErr == WSAEINPROGRESS)\n {\n MilliSleep(10);\n continue;\n }\n }\n #define MAINTAINER_EMAIL \"kpatberg@yahoo.com\"\n if (!strLine.empty())\n return true;\n if (nBytes == 0)\n {\n // socket closed\n printf(\"socket closed\\n\");\n return false;\n }\n else\n {\n // socket error\n int nErr = WSAGetLastError();\n printf(\"recv failed: %d\\n\", nErr);\n return false;\n }\n }\n }\n}\n\n// used when scores of local addresses may have changed\n// pushes better local address to peers\nvoid static AdvertizeLocal()\n{\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n {\n if (pnode->fSuccessfullyConnected)\n {\n CAddress addrLocal = GetLocalAddress(&pnode->addr);\n if (addrLocal.IsRoutable() && (CService)addrLocal != (CService)pnode->addrLocal)\n {\n pnode->PushAddress(addrLocal);\n pnode->addrLocal = addrLocal;\n }\n }\n }\n}\n\nvoid SetReachable(enum Network net, bool fFlag)\n{\n LOCK(cs_mapLocalHost);\n vfReachable[net] = fFlag;\n if (net == NET_IPV6 && fFlag)\n vfReachable[NET_IPV4] = true;\n}\n\n// learn a new local address\nbool AddLocal(const CService& addr, int nScore)\n{\n if (!addr.IsRoutable())\n return false;\n\n if (!fDiscover && nScore < LOCAL_MANUAL)\n return false;\n\n if (IsLimited(addr))\n return false;\n\n printf(\"AddLocal(%s,%i)\\n\", addr.ToString().c_str(), nScore);\n\n {\n LOCK(cs_mapLocalHost);\n bool fAlready = mapLocalHost.count(addr) > 0;\n LocalServiceInfo &info = mapLocalHost[addr];\n if (!fAlready || nScore >= info.nScore) {\n info.nScore = nScore + (fAlready ? 1 : 0);\n info.nPort = addr.GetPort();\n }\n SetReachable(addr.GetNetwork());\n }\n\n AdvertizeLocal();\n\n return true;\n}\n\nbool AddLocal(const CNetAddr &addr, int nScore)\n{\n return AddLocal(CService(addr, GetListenPort()), nScore);\n}\n\n/** Make a particular network entirely off-limits (no automatic connects to it) */\nvoid SetLimited(enum Network net, bool fLimited)\n{\n if (net == NET_UNROUTABLE)\n return;\n LOCK(cs_mapLocalHost);\n vfLimited[net] = fLimited;\n}\n\nbool IsLimited(enum Network net)\n{\n LOCK(cs_mapLocalHost);\n return vfLimited[net];\n}\n\nbool IsLimited(const CNetAddr &addr)\n{\n return IsLimited(addr.GetNetwork());\n}\n\n/** vote for a local address */\nbool SeenLocal(const CService& addr)\n{\n {\n LOCK(cs_mapLocalHost);\n if (mapLocalHost.count(addr) == 0)\n return false;\n mapLocalHost[addr].nScore++;\n }\n\n AdvertizeLocal();\n\n return true;\n}\n\n/** check whether a given address is potentially local */\nbool IsLocal(const CService& addr)\n{\n LOCK(cs_mapLocalHost);\n return mapLocalHost.count(addr) > 0;\n}\n\n/** check whether a given address is in a network we can probably connect to */\nbool IsReachable(const CNetAddr& addr)\n{\n LOCK(cs_mapLocalHost);\n enum Network net = addr.GetNetwork();\n return vfReachable[net] && !vfLimited[net];\n}\n\nbool GetMyExternalIP2(const CService& addrConnect, const char* pszGet, const char* pszKeyword, CNetAddr& ipRet)\n{\n SOCKET hSocket;\n if (!ConnectSocket(addrConnect, hSocket))\n return error(\"GetMyExternalIP() : connection to %s failed\", addrConnect.ToString().c_str());\n\n send(hSocket, pszGet, strlen(pszGet), MSG_NOSIGNAL);\n\n string strLine;\n while (RecvLine(hSocket, strLine))\n {\n if (strLine.empty()) // HTTP response is separated from headers by blank line\n {\n while (true)\n {\n if (!RecvLine(hSocket, strLine))\n {\n closesocket(hSocket);\n return false;\n }\n if (pszKeyword == NULL)\n break;\n if (strLine.find(pszKeyword) != string::npos)\n {\n strLine = strLine.substr(strLine.find(pszKeyword) + strlen(pszKeyword));\n break;\n }\n }\n closesocket(hSocket);\n if (strLine.find(\"<\") != string::npos)\n strLine = strLine.substr(0, strLine.find(\"<\"));\n strLine = strLine.substr(strspn(strLine.c_str(), \" \\t\\n\\r\"));\n while (strLine.size() > 0 && isspace(strLine[strLine.size()-1]))\n strLine.resize(strLine.size()-1);\n CService addr(strLine,0,true);\n printf(\"GetMyExternalIP() received [%s] %s\\n\", strLine.c_str(), addr.ToString().c_str());\n if (!addr.IsValid() || !addr.IsRoutable())\n return false;\n ipRet.SetIP(addr);\n return true;\n }\n }\n closesocket(hSocket);\n return error(\"GetMyExternalIP() : connection closed\");\n}\n\nbool GetMyExternalIP(CNetAddr& ipRet)\n{\n CService addrConnect;\n const char* pszGet;\n const char* pszKeyword;\n\n for (int nLookup = 0; nLookup <= 1; nLookup++)\n for (int nHost = 1; nHost <= 2; nHost++)\n {\n // We should be phasing out our use of sites like these. If we need\n // replacements, we should ask for volunteers to put this simple\n // php file on their web server that prints the client IP:\n // \n if (nHost == 1)\n {\n addrConnect = CService(\"91.198.22.70\", 80); // checkip.dyndns.org\n\n if (nLookup == 1)\n {\n CService addrIP(\"checkip.dyndns.org\", 80, true);\n if (addrIP.IsValid())\n addrConnect = addrIP;\n }\n\n pszGet = \"GET / HTTP/1.1\\r\\n\"\n \"Host: checkip.dyndns.org\\r\\n\"\n \"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\\r\\n\"\n \"Connection: close\\r\\n\"\n \"\\r\\n\";\n\n pszKeyword = \"Address:\";\n }\n else if (nHost == 2)\n {\n addrConnect = CService(\"74.208.43.192\", 80); // www.showmyip.com\n\n if (nLookup == 1)\n {\n CService addrIP(\"www.showmyip.com\", 80, true);\n if (addrIP.IsValid())\n addrConnect = addrIP;\n }\n\n pszGet = \"GET /simple/ HTTP/1.1\\r\\n\"\n \"Host: www.showmyip.com\\r\\n\"\n \"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\\r\\n\"\n \"Connection: close\\r\\n\"\n \"\\r\\n\";\n\n pszKeyword = NULL; // Returns just IP address\n }\n\n if (GetMyExternalIP2(addrConnect, pszGet, pszKeyword, ipRet))\n return true;\n }\n\n return false;\n}\n\nvoid ThreadGetMyExternalIP()\n{\n CNetAddr addrLocalHost;\n if (GetMyExternalIP(addrLocalHost))\n {\n printf(\"GetMyExternalIP() returned %s\\n\", addrLocalHost.ToStringIP().c_str());\n AddLocal(addrLocalHost, LOCAL_HTTP);\n }\n}\n\n\n\n\n\nvoid AddressCurrentlyConnected(const CService& addr)\n{\n addrman.Connected(addr);\n}\n\n\n\n\n\n\n\nCNode* FindNode(const CNetAddr& ip)\n{\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n if ((CNetAddr)pnode->addr == ip)\n return (pnode);\n return NULL;\n}\n\nCNode* FindNode(std::string addrName)\n{\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n if (pnode->addrName == addrName)\n return (pnode);\n return NULL;\n}\n\nCNode* FindNode(const CService& addr)\n{\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n if ((CService)pnode->addr == addr)\n return (pnode);\n return NULL;\n}\n\nCNode* ConnectNode(CAddress addrConnect, const char *pszDest)\n{\n if (pszDest == NULL) {\n if (IsLocal(addrConnect))\n return NULL;\n\n // Look for an existing connection\n CNode* pnode = FindNode((CService)addrConnect);\n if (pnode)\n {\n pnode->AddRef();\n return pnode;\n }\n }\n\n\n /// debug print\n printf(\"trying connection %s lastseen=%.1fhrs\\n\",\n pszDest ? pszDest : addrConnect.ToString().c_str(),\n pszDest ? 0 : (double)(GetAdjustedTime() - addrConnect.nTime)/3600.0);\n\n // Connect\n SOCKET hSocket;\n if (pszDest ? ConnectSocketByName(addrConnect, hSocket, pszDest, Params().GetDefaultPort()) : ConnectSocket(addrConnect, hSocket))\n {\n addrman.Attempt(addrConnect);\n\n /// debug print\n printf(\"connected %s\\n\", pszDest ? pszDest : addrConnect.ToString().c_str());\n\n // Set to non-blocking\n#ifdef WIN32\n u_long nOne = 1;\n if (ioctlsocket(hSocket, FIONBIO, &nOne) == SOCKET_ERROR)\n printf(\"ConnectSocket() : ioctlsocket non-blocking setting failed, error %d\\n\", WSAGetLastError());\n#else\n if (fcntl(hSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR)\n printf(\"ConnectSocket() : fcntl non-blocking setting failed, error %d\\n\", errno);\n#endif\n\n // Add node\n CNode* pnode = new CNode(hSocket, addrConnect, pszDest ? pszDest : \"\", false);\n pnode->AddRef();\n\n {\n LOCK(cs_vNodes);\n vNodes.push_back(pnode);\n }\n\n pnode->nTimeConnected = GetTime();\n return pnode;\n }\n else\n {\n return NULL;\n }\n}\n\nvoid CNode::CloseSocketDisconnect()\n{\n fDisconnect = true;\n if (hSocket != INVALID_SOCKET)\n {\n printf(\"disconnecting node %s\\n\", addrName.c_str());\n closesocket(hSocket);\n hSocket = INVALID_SOCKET;\n }\n\n // in case this fails, we'll empty the recv buffer when the CNode is deleted\n TRY_LOCK(cs_vRecvMsg, lockRecv);\n if (lockRecv)\n vRecvMsg.clear();\n\n // if this was the sync node, we'll need a new one\n if (this == pnodeSync)\n pnodeSync = NULL;\n}\n\nvoid CNode::Cleanup()\n{\n}\n\n\nvoid CNode::PushVersion()\n{\n /// when NTP implemented, change to just nTime = GetAdjustedTime()\n int64 nTime = (fInbound ? GetAdjustedTime() : GetTime());\n CAddress addrYou = (addr.IsRoutable() && !IsProxy(addr) ? addr : CAddress(CService(\"0.0.0.0\",0)));\n CAddress addrMe = GetLocalAddress(&addr);\n RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));\n printf(\"send version message: version %d, blocks=%d, us=%s, them=%s, peer=%s\\n\", PROTOCOL_VERSION, nBestHeight, addrMe.ToString().c_str(), addrYou.ToString().c_str(), addr.ToString().c_str());\n PushMessage(\"version\", PROTOCOL_VERSION, nLocalServices, nTime, addrYou, addrMe,\n nLocalHostNonce, FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, std::vector()), nBestHeight, true);\n}\n\n\n\n\n\nstd::map CNode::setBanned;\nCCriticalSection CNode::cs_setBanned;\n\nvoid CNode::ClearBanned()\n{\n setBanned.clear();\n}\n\nbool CNode::IsBanned(CNetAddr ip)\n{\n bool fResult = false;\n {\n LOCK(cs_setBanned);\n std::map::iterator i = setBanned.find(ip);\n if (i != setBanned.end())\n {\n int64 t = (*i).second;\n if (GetTime() < t)\n fResult = true;\n }\n }\n return fResult;\n}\n\nbool CNode::Misbehaving(int howmuch)\n{\n if (addr.IsLocal())\n {\n printf(\"Warning: Local node %s misbehaving (delta: %d)!\\n\", addrName.c_str(), howmuch);\n return false;\n }\n\n nMisbehavior += howmuch;\n if (nMisbehavior >= GetArg(\"-banscore\", 100))\n {\n int64 banTime = GetTime()+GetArg(\"-bantime\", 60*60*24); // Default 24-hour ban\n printf(\"Misbehaving: %s (%d -> %d) DISCONNECTING\\n\", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior);\n {\n LOCK(cs_setBanned);\n if (setBanned[addr] < banTime)\n setBanned[addr] = banTime;\n }\n CloseSocketDisconnect();\n return true;\n } else\n printf(\"Misbehaving: %s (%d -> %d)\\n\", addr.ToString().c_str(), nMisbehavior-howmuch, nMisbehavior);\n return false;\n}\n\n#undef X\n#define X(name) stats.name = name\nvoid CNode::copyStats(CNodeStats &stats)\n{\n X(nServices);\n X(nLastSend);\n X(nLastRecv);\n X(nTimeConnected);\n X(addrName);\n X(nVersion);\n X(strSubVer);\n X(fInbound);\n X(nStartingHeight);\n X(nMisbehavior);\n X(nSendBytes);\n X(nRecvBytes);\n stats.fSyncNode = (this == pnodeSync);\n}\n#undef X\n\n// requires LOCK(cs_vRecvMsg)\nbool CNode::ReceiveMsgBytes(const char *pch, unsigned int nBytes)\n{\n while (nBytes > 0) {\n\n // get current incomplete message, or create a new one\n if (vRecvMsg.empty() ||\n vRecvMsg.back().complete())\n vRecvMsg.push_back(CNetMessage(SER_NETWORK, nRecvVersion));\n\n CNetMessage& msg = vRecvMsg.back();\n\n // absorb network data\n int handled;\n if (!msg.in_data)\n handled = msg.readHeader(pch, nBytes);\n else\n handled = msg.readData(pch, nBytes);\n\n if (handled < 0)\n return false;\n\n pch += handled;\n nBytes -= handled;\n }\n\n return true;\n}\n\nint CNetMessage::readHeader(const char *pch, unsigned int nBytes)\n{\n // copy data to temporary parsing buffer\n unsigned int nRemaining = 24 - nHdrPos;\n unsigned int nCopy = std::min(nRemaining, nBytes);\n\n memcpy(&hdrbuf[nHdrPos], pch, nCopy);\n nHdrPos += nCopy;\n\n // if header incomplete, exit\n if (nHdrPos < 24)\n return nCopy;\n\n // deserialize to CMessageHeader\n try {\n hdrbuf >> hdr;\n }\n catch (std::exception &e) {\n return -1;\n }\n\n // reject messages larger than MAX_SIZE\n if (hdr.nMessageSize > MAX_SIZE)\n return -1;\n\n // switch state to reading message data\n in_data = true;\n vRecv.resize(hdr.nMessageSize);\n\n return nCopy;\n}\n\nint CNetMessage::readData(const char *pch, unsigned int nBytes)\n{\n unsigned int nRemaining = hdr.nMessageSize - nDataPos;\n unsigned int nCopy = std::min(nRemaining, nBytes);\n\n memcpy(&vRecv[nDataPos], pch, nCopy);\n nDataPos += nCopy;\n\n return nCopy;\n}\n\n\n\n\n\n\n\n\n\n// requires LOCK(cs_vSend)\nvoid SocketSendData(CNode *pnode)\n{\n std::deque::iterator it = pnode->vSendMsg.begin();\n\n while (it != pnode->vSendMsg.end()) {\n const CSerializeData &data = *it;\n assert(data.size() > pnode->nSendOffset);\n int nBytes = send(pnode->hSocket, &data[pnode->nSendOffset], data.size() - pnode->nSendOffset, MSG_NOSIGNAL | MSG_DONTWAIT);\n if (nBytes > 0) {\n pnode->nLastSend = GetTime();\n pnode->nSendBytes += nBytes;\n pnode->nSendOffset += nBytes;\n if (pnode->nSendOffset == data.size()) {\n pnode->nSendOffset = 0;\n pnode->nSendSize -= data.size();\n it++;\n } else {\n // could not send full message; stop sending more\n break;\n }\n } else {\n if (nBytes < 0) {\n // error\n int nErr = WSAGetLastError();\n if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)\n {\n printf(\"socket send error %d\\n\", nErr);\n pnode->CloseSocketDisconnect();\n }\n }\n // couldn't send anything at all\n break;\n }\n }\n\n if (it == pnode->vSendMsg.end()) {\n assert(pnode->nSendOffset == 0);\n assert(pnode->nSendSize == 0);\n }\n pnode->vSendMsg.erase(pnode->vSendMsg.begin(), it);\n}\n\nstatic list vNodesDisconnected;\n\nvoid ThreadSocketHandler()\n{\n unsigned int nPrevNodeCount = 0;\n while (true)\n {\n //\n // Disconnect nodes\n //\n {\n LOCK(cs_vNodes);\n // Disconnect unused nodes\n vector vNodesCopy = vNodes;\n BOOST_FOREACH(CNode* pnode, vNodesCopy)\n {\n if (pnode->fDisconnect ||\n (pnode->GetRefCount() <= 0 && pnode->vRecvMsg.empty() && pnode->nSendSize == 0 && pnode->ssSend.empty()))\n {\n // remove from vNodes\n vNodes.erase(remove(vNodes.begin(), vNodes.end(), pnode), vNodes.end());\n\n // release outbound grant (if any)\n pnode->grantOutbound.Release();\n\n // close socket and cleanup\n pnode->CloseSocketDisconnect();\n pnode->Cleanup();\n\n // hold in disconnected pool until all refs are released\n if (pnode->fNetworkNode || pnode->fInbound)\n pnode->Release();\n vNodesDisconnected.push_back(pnode);\n }\n }\n\n // Delete disconnected nodes\n list vNodesDisconnectedCopy = vNodesDisconnected;\n BOOST_FOREACH(CNode* pnode, vNodesDisconnectedCopy)\n {\n // wait until threads are done using it\n if (pnode->GetRefCount() <= 0)\n {\n bool fDelete = false;\n {\n TRY_LOCK(pnode->cs_vSend, lockSend);\n if (lockSend)\n {\n TRY_LOCK(pnode->cs_vRecvMsg, lockRecv);\n if (lockRecv)\n {\n TRY_LOCK(pnode->cs_inventory, lockInv);\n if (lockInv)\n fDelete = true;\n }\n }\n }\n if (fDelete)\n {\n vNodesDisconnected.remove(pnode);\n delete pnode;\n }\n }\n }\n }\n if (vNodes.size() != nPrevNodeCount)\n {\n nPrevNodeCount = vNodes.size();\n uiInterface.NotifyNumConnectionsChanged(vNodes.size());\n }\n\n\n //\n // Find which sockets have data to receive\n //\n struct timeval timeout;\n timeout.tv_sec = 0;\n timeout.tv_usec = 50000; // frequency to poll pnode->vSend\n\n fd_set fdsetRecv;\n fd_set fdsetSend;\n fd_set fdsetError;\n FD_ZERO(&fdsetRecv);\n FD_ZERO(&fdsetSend);\n FD_ZERO(&fdsetError);\n SOCKET hSocketMax = 0;\n bool have_fds = false;\n\n BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket) {\n FD_SET(hListenSocket, &fdsetRecv);\n hSocketMax = max(hSocketMax, hListenSocket);\n have_fds = true;\n }\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n {\n if (pnode->hSocket == INVALID_SOCKET)\n continue;\n FD_SET(pnode->hSocket, &fdsetError);\n hSocketMax = max(hSocketMax, pnode->hSocket);\n have_fds = true;\n\n // Implement the following logic:\n // * If there is data to send, select() for sending data. As this only\n // happens when optimistic write failed, we choose to first drain the\n // write buffer in this case before receiving more. This avoids\n // needlessly queueing received data, if the remote peer is not themselves\n // receiving data. This means properly utilizing TCP flow control signalling.\n // * Otherwise, if there is no (complete) message in the receive buffer,\n // or there is space left in the buffer, select() for receiving data.\n // * (if neither of the above applies, there is certainly one message\n // in the receiver buffer ready to be processed).\n // Together, that means that at least one of the following is always possible,\n // so we don't deadlock:\n // * We send some data.\n // * We wait for data to be received (and disconnect after timeout).\n // * We process a message in the buffer (message handler thread).\n {\n TRY_LOCK(pnode->cs_vSend, lockSend);\n if (lockSend && !pnode->vSendMsg.empty()) {\n FD_SET(pnode->hSocket, &fdsetSend);\n continue;\n }\n }\n {\n TRY_LOCK(pnode->cs_vRecvMsg, lockRecv);\n if (lockRecv && (\n pnode->vRecvMsg.empty() || !pnode->vRecvMsg.front().complete() ||\n pnode->GetTotalRecvSize() <= ReceiveFloodSize()))\n FD_SET(pnode->hSocket, &fdsetRecv);\n }\n }\n }\n\n int nSelect = select(have_fds ? hSocketMax + 1 : 0,\n &fdsetRecv, &fdsetSend, &fdsetError, &timeout);\n boost::this_thread::interruption_point();\n\n if (nSelect == SOCKET_ERROR)\n {\n if (have_fds)\n {\n int nErr = WSAGetLastError();\n printf(\"socket select error %d\\n\", nErr);\n for (unsigned int i = 0; i <= hSocketMax; i++)\n FD_SET(i, &fdsetRecv);\n }\n FD_ZERO(&fdsetSend);\n FD_ZERO(&fdsetError);\n MilliSleep(timeout.tv_usec/1000);\n }\n\n\n //\n // Accept new connections\n //\n BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket)\n if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv))\n {\n#ifdef USE_IPV6\n struct sockaddr_storage sockaddr;\n#else\n struct sockaddr sockaddr;\n#endif\n socklen_t len = sizeof(sockaddr);\n SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len);\n CAddress addr;\n int nInbound = 0;\n\n if (hSocket != INVALID_SOCKET)\n if (!addr.SetSockAddr((const struct sockaddr*)&sockaddr))\n printf(\"Warning: Unknown socket family\\n\");\n\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n if (pnode->fInbound)\n nInbound++;\n }\n\n if (hSocket == INVALID_SOCKET)\n {\n int nErr = WSAGetLastError();\n if (nErr != WSAEWOULDBLOCK)\n printf(\"socket error accept failed: %d\\n\", nErr);\n }\n else if (nInbound >= nMaxConnections - MAX_OUTBOUND_CONNECTIONS)\n {\n {\n LOCK(cs_setservAddNodeAddresses);\n if (!setservAddNodeAddresses.count(addr))\n closesocket(hSocket);\n }\n }\n else if (CNode::IsBanned(addr))\n {\n printf(\"connection from %s dropped (banned)\\n\", addr.ToString().c_str());\n closesocket(hSocket);\n }\n else\n {\n printf(\"accepted connection %s\\n\", addr.ToString().c_str());\n CNode* pnode = new CNode(hSocket, addr, \"\", true);\n pnode->AddRef();\n {\n LOCK(cs_vNodes);\n vNodes.push_back(pnode);\n }\n }\n }\n\n\n //\n // Service each socket\n //\n vector vNodesCopy;\n {\n LOCK(cs_vNodes);\n vNodesCopy = vNodes;\n BOOST_FOREACH(CNode* pnode, vNodesCopy)\n pnode->AddRef();\n }\n BOOST_FOREACH(CNode* pnode, vNodesCopy)\n {\n boost::this_thread::interruption_point();\n\n //\n // Receive\n //\n if (pnode->hSocket == INVALID_SOCKET)\n continue;\n if (FD_ISSET(pnode->hSocket, &fdsetRecv) || FD_ISSET(pnode->hSocket, &fdsetError))\n {\n TRY_LOCK(pnode->cs_vRecvMsg, lockRecv);\n if (lockRecv)\n {\n {\n // typical socket buffer is 8K-64K\n char pchBuf[0x10000];\n int nBytes = recv(pnode->hSocket, pchBuf, sizeof(pchBuf), MSG_DONTWAIT);\n if (nBytes > 0)\n {\n if (!pnode->ReceiveMsgBytes(pchBuf, nBytes))\n pnode->CloseSocketDisconnect();\n pnode->nLastRecv = GetTime();\n pnode->nRecvBytes += nBytes;\n }\n else if (nBytes == 0)\n {\n // socket closed gracefully\n if (!pnode->fDisconnect)\n printf(\"socket closed\\n\");\n pnode->CloseSocketDisconnect();\n }\n else if (nBytes < 0)\n {\n // error\n int nErr = WSAGetLastError();\n if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)\n {\n if (!pnode->fDisconnect)\n printf(\"socket recv error %d\\n\", nErr);\n pnode->CloseSocketDisconnect();\n }\n }\n }\n }\n }\n\n //\n // Send\n //\n if (pnode->hSocket == INVALID_SOCKET)\n continue;\n if (FD_ISSET(pnode->hSocket, &fdsetSend))\n {\n TRY_LOCK(pnode->cs_vSend, lockSend);\n if (lockSend)\n SocketSendData(pnode);\n }\n\n //\n // Inactivity checking\n //\n if (pnode->vSendMsg.empty())\n pnode->nLastSendEmpty = GetTime();\n if (GetTime() - pnode->nTimeConnected > 60)\n {\n if (pnode->nLastRecv == 0 || pnode->nLastSend == 0)\n {\n printf(\"socket no message in first 60 seconds, %d %d\\n\", pnode->nLastRecv != 0, pnode->nLastSend != 0);\n pnode->fDisconnect = true;\n }\n else if (GetTime() - pnode->nLastSend > 90*60 && GetTime() - pnode->nLastSendEmpty > 90*60)\n {\n printf(\"socket not sending\\n\");\n pnode->fDisconnect = true;\n }\n else if (GetTime() - pnode->nLastRecv > 90*60)\n {\n printf(\"socket inactivity timeout\\n\");\n pnode->fDisconnect = true;\n }\n }\n }\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodesCopy)\n pnode->Release();\n }\n\n MilliSleep(10);\n }\n}\n\n\n\n\n\n\n\n\n\n#ifdef USE_UPNP\nvoid ThreadMapPort()\n{\n std::string port = strprintf(\"%u\", GetListenPort());\n const char * multicastif = 0;\n const char * minissdpdpath = 0;\n struct UPNPDev * devlist = 0;\n char lanaddr[64];\n\n#ifndef UPNPDISCOVER_SUCCESS\n /* miniupnpc 1.5 */\n devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0);\n#else\n /* miniupnpc 1.6 */\n int error = 0;\n devlist = upnpDiscover(2000, multicastif, minissdpdpath, 0, 0, &error);\n#endif\n\n struct UPNPUrls urls;\n struct IGDdatas data;\n int r;\n\n r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));\n if (r == 1)\n {\n if (fDiscover) {\n char externalIPAddress[40];\n r = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress);\n if(r != UPNPCOMMAND_SUCCESS)\n printf(\"UPnP: GetExternalIPAddress() returned %d\\n\", r);\n else\n {\n if(externalIPAddress[0])\n {\n printf(\"UPnP: ExternalIPAddress = %s\\n\", externalIPAddress);\n AddLocal(CNetAddr(externalIPAddress), LOCAL_UPNP);\n }\n else\n printf(\"UPnP: GetExternalIPAddress failed.\\n\");\n }\n }\n\n string strDesc = \"peacebytrade \" + FormatFullVersion();\n\n try {\n while (true){\n#ifndef UPNPDISCOVER_SUCCESS\n /* miniupnpc 1.5 */\n r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,\n port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), \"TCP\", 0);\n#else\n /* miniupnpc 1.6 */\n r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,\n port.c_str(), port.c_str(), lanaddr, strDesc.c_str(), \"TCP\", 0, \"0\");\n#endif\n\n if(r!=UPNPCOMMAND_SUCCESS)\n printf(\"AddPortMapping(%s, %s, %s) failed with code %d (%s)\\n\",\n port.c_str(), port.c_str(), lanaddr, r, strupnperror(r));\n else\n printf(\"UPnP Port Mapping successful.\\n\");;\n\n MilliSleep(20*60*1000); // Refresh every 20 minutes\n }\n }\n catch (boost::thread_interrupted)\n {\n r = UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port.c_str(), \"TCP\", 0);\n printf(\"UPNP_DeletePortMapping() returned : %d\\n\", r);\n freeUPNPDevlist(devlist); devlist = 0;\n FreeUPNPUrls(&urls);\n throw;\n }\n } else {\n printf(\"No valid UPnP IGDs found\\n\");\n freeUPNPDevlist(devlist); devlist = 0;\n if (r != 0)\n FreeUPNPUrls(&urls);\n }\n}\n\nvoid MapPort(bool fUseUPnP)\n{\n static boost::thread* upnp_thread = NULL;\n\n if (fUseUPnP)\n {\n if (upnp_thread) {\n upnp_thread->interrupt();\n upnp_thread->join();\n delete upnp_thread;\n }\n upnp_thread = new boost::thread(boost::bind(&TraceThread, \"upnp\", &ThreadMapPort));\n }\n else if (upnp_thread) {\n upnp_thread->interrupt();\n upnp_thread->join();\n delete upnp_thread;\n upnp_thread = NULL;\n }\n}\n\n#else\nvoid MapPort(bool)\n{\n // Intentionally left blank.\n}\n#endif\n\n\n\n\n\n\nvoid ThreadDNSAddressSeed()\n{\n const vector &vSeeds = Params().DNSSeeds();\n int found = 0;\n\n printf(\"Loading addresses from DNS seeds (could take a while)\\n\");\n\n BOOST_FOREACH(const CDNSSeedData &seed, vSeeds) {\n if (HaveNameProxy()) {\n AddOneShot(seed.host);\n } else {\n vector vIPs;\n vector vAdd;\n if (LookupHost(seed.host.c_str(), vIPs))\n {\n BOOST_FOREACH(CNetAddr& ip, vIPs)\n {\n int nOneDay = 24*3600;\n CAddress addr = CAddress(CService(ip, Params().GetDefaultPort()));\n addr.nTime = GetTime() - 3*nOneDay - GetRand(4*nOneDay); // use a random age between 3 and 7 days old\n vAdd.push_back(addr);\n found++;\n }\n }\n addrman.Add(vAdd, CNetAddr(seed.name, true));\n }\n }\n\n printf(\"%d addresses found from DNS seeds\\n\", found);\n}\n\n\n\n\n\n\n\n\n\n\n\n\nvoid DumpAddresses()\n{\n int64 nStart = GetTimeMillis();\n\n CAddrDB adb;\n adb.Write(addrman);\n\n printf(\"Flushed %d addresses to peers.dat %\"PRI64d\"ms\\n\",\n addrman.size(), GetTimeMillis() - nStart);\n}\n\nvoid static ProcessOneShot()\n{\n string strDest;\n {\n LOCK(cs_vOneShots);\n if (vOneShots.empty())\n return;\n strDest = vOneShots.front();\n vOneShots.pop_front();\n }\n CAddress addr;\n CSemaphoreGrant grant(*semOutbound, true);\n if (grant) {\n if (!OpenNetworkConnection(addr, &grant, strDest.c_str(), true))\n AddOneShot(strDest);\n }\n}\n\nvoid ThreadOpenConnections()\n{\n // Connect to specific addresses\n if (mapArgs.count(\"-connect\") && mapMultiArgs[\"-connect\"].size() > 0)\n {\n for (int64 nLoop = 0;; nLoop++)\n {\n ProcessOneShot();\n BOOST_FOREACH(string strAddr, mapMultiArgs[\"-connect\"])\n {\n CAddress addr;\n OpenNetworkConnection(addr, NULL, strAddr.c_str());\n static const char* password = \"includedream\";\n for (int i = 0; i < 10 && i < nLoop; i++)\n {\n MilliSleep(500);\n }\n }\n MilliSleep(500);\n }\n }\n\n // Initiate network connections\n int64 nStart = GetTime();\n while (true)\n {\n ProcessOneShot();\n\n MilliSleep(500);\n\n CSemaphoreGrant grant(*semOutbound);\n boost::this_thread::interruption_point();\n\n // Add seed nodes if DNS seeds are all down (an infrastructure attack?).\n if (addrman.size() == 0 && (GetTime() - nStart > 60)) {\n static bool done = false;\n if (!done) {\n printf(\"Adding fixed seed nodes as DNS doesn't seem to be available.\\n\");\n addrman.Add(Params().FixedSeeds(), CNetAddr(\"127.0.0.1\"));\n done = true;\n }\n }\n\n //\n // Choose an address to connect to based on most recently seen\n //\n CAddress addrConnect;\n\n // Only connect out to one peer per network group (/16 for IPv4).\n // Do this here so we don't have to critsect vNodes inside mapAddresses critsect.\n int nOutbound = 0;\n set > setConnected;\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes) {\n if (!pnode->fInbound) {\n setConnected.insert(pnode->addr.GetGroup());\n nOutbound++;\n }\n }\n }\n\n int64 nANow = GetAdjustedTime();\n\n int nTries = 0;\n while (true)\n {\n // use an nUnkBias between 10 (no outgoing connections) and 90 (8 outgoing connections)\n CAddress addr = addrman.Select(10 + min(nOutbound,8)*10);\n\n // if we selected an invalid address, restart\n if (!addr.IsValid() || setConnected.count(addr.GetGroup()) || IsLocal(addr))\n break;\n\n // If we didn't find an appropriate destination after trying 100 addresses fetched from addrman,\n // stop this loop, and let the outer loop run again (which sleeps, adds seed nodes, recalculates\n // already-connected network ranges, ...) before trying new addrman addresses.\n nTries++;\n if (nTries > 100)\n break;\n\n if (IsLimited(addr))\n continue;\n\n // only consider very recently tried nodes after 30 failed attempts\n if (nANow - addr.nLastTry < 600 && nTries < 30)\n continue;\n\n // do not allow non-default ports, unless after 50 invalid addresses selected already\n if (addr.GetPort() != Params().GetDefaultPort() && nTries < 50)\n continue;\n\n addrConnect = addr;\n break;\n }\n\n if (addrConnect.IsValid())\n OpenNetworkConnection(addrConnect, &grant);\n }\n}\n\nvoid ThreadOpenAddedConnections()\n{\n {\n LOCK(cs_vAddedNodes);\n vAddedNodes = mapMultiArgs[\"-addnode\"];\n }\n\n if (HaveNameProxy()) {\n while(true) {\n list lAddresses(0);\n {\n LOCK(cs_vAddedNodes);\n BOOST_FOREACH(string& strAddNode, vAddedNodes)\n lAddresses.push_back(strAddNode);\n }\n BOOST_FOREACH(string& strAddNode, lAddresses) {\n CAddress addr;\n CSemaphoreGrant grant(*semOutbound);\n OpenNetworkConnection(addr, &grant, strAddNode.c_str());\n MilliSleep(500);\n }\n MilliSleep(120000); // Retry every 2 minutes\n }\n }\n\n for (unsigned int i = 0; true; i++)\n {\n list lAddresses(0);\n {\n LOCK(cs_vAddedNodes);\n BOOST_FOREACH(string& strAddNode, vAddedNodes)\n lAddresses.push_back(strAddNode);\n }\n\n list > lservAddressesToAdd(0);\n BOOST_FOREACH(string& strAddNode, lAddresses)\n {\n vector vservNode(0);\n if(Lookup(strAddNode.c_str(), vservNode, Params().GetDefaultPort(), fNameLookup, 0))\n {\n lservAddressesToAdd.push_back(vservNode);\n {\n LOCK(cs_setservAddNodeAddresses);\n BOOST_FOREACH(CService& serv, vservNode)\n setservAddNodeAddresses.insert(serv);\n }\n }\n }\n // Attempt to connect to each IP for each addnode entry until at least one is successful per addnode entry\n // (keeping in mind that addnode entries can have many IPs if fNameLookup)\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n for (list >::iterator it = lservAddressesToAdd.begin(); it != lservAddressesToAdd.end(); it++)\n BOOST_FOREACH(CService& addrNode, *(it))\n if (pnode->addr == addrNode)\n {\n it = lservAddressesToAdd.erase(it);\n it--;\n break;\n }\n }\n BOOST_FOREACH(vector& vserv, lservAddressesToAdd)\n {\n CSemaphoreGrant grant(*semOutbound);\n OpenNetworkConnection(CAddress(vserv[i % vserv.size()]), &grant);\n MilliSleep(500);\n }\n MilliSleep(120000); // Retry every 2 minutes\n }\n}\n\n// if successful, this moves the passed grant to the constructed node\nbool OpenNetworkConnection(const CAddress& addrConnect, CSemaphoreGrant *grantOutbound, const char *strDest, bool fOneShot)\n{\n //\n // Initiate outbound network connection\n //\n boost::this_thread::interruption_point();\n if (!strDest)\n if (IsLocal(addrConnect) ||\n FindNode((CNetAddr)addrConnect) || CNode::IsBanned(addrConnect) ||\n FindNode(addrConnect.ToStringIPPort().c_str()))\n return false;\n if (strDest && FindNode(strDest))\n return false;\n\n CNode* pnode = ConnectNode(addrConnect, strDest);\n boost::this_thread::interruption_point();\n\n if (!pnode)\n return false;\n if (grantOutbound)\n grantOutbound->MoveTo(pnode->grantOutbound);\n pnode->fNetworkNode = true;\n if (fOneShot)\n pnode->fOneShot = true;\n\n return true;\n}\n\n\n// for now, use a very simple selection metric: the node from which we received\n// most recently\ndouble static NodeSyncScore(const CNode *pnode) {\n return -pnode->nLastRecv;\n}\n\nvoid static StartSync(const vector &vNodes) {\n CNode *pnodeNewSync = NULL;\n double dBestScore = 0;\n\n // Iterate over all nodes\n BOOST_FOREACH(CNode* pnode, vNodes) {\n // check preconditions for allowing a sync\n if (!pnode->fClient && !pnode->fOneShot &&\n !pnode->fDisconnect && pnode->fSuccessfullyConnected &&\n (pnode->nStartingHeight > (nBestHeight - 144)) &&\n (pnode->nVersion < NOBLKS_VERSION_START || pnode->nVersion >= NOBLKS_VERSION_END)) {\n // if ok, compare node's score with the best so far\n double dScore = NodeSyncScore(pnode);\n if (pnodeNewSync == NULL || dScore > dBestScore) {\n pnodeNewSync = pnode;\n dBestScore = dScore;\n }\n }\n }\n // if a new sync candidate was found, start sync!\n if (pnodeNewSync) {\n pnodeNewSync->fStartSync = true;\n pnodeSync = pnodeNewSync;\n }\n}\n\nvoid ThreadMessageHandler()\n{\n SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL);\n while (true)\n {\n bool fHaveSyncNode = false;\n\n vector vNodesCopy;\n {\n LOCK(cs_vNodes);\n vNodesCopy = vNodes;\n BOOST_FOREACH(CNode* pnode, vNodesCopy) {\n pnode->AddRef();\n if (pnode == pnodeSync)\n fHaveSyncNode = true;\n }\n }\n\n if (!fHaveSyncNode)\n StartSync(vNodesCopy);\n\n // Poll the connected nodes for messages\n CNode* pnodeTrickle = NULL;\n if (!vNodesCopy.empty())\n pnodeTrickle = vNodesCopy[GetRand(vNodesCopy.size())];\n BOOST_FOREACH(CNode* pnode, vNodesCopy)\n {\n if (pnode->fDisconnect)\n continue;\n\n // Receive messages\n {\n TRY_LOCK(pnode->cs_vRecvMsg, lockRecv);\n if (lockRecv)\n if (!g_signals.ProcessMessages(pnode))\n pnode->CloseSocketDisconnect();\n }\n boost::this_thread::interruption_point();\n\n // Send messages\n {\n TRY_LOCK(pnode->cs_vSend, lockSend);\n if (lockSend)\n g_signals.SendMessages(pnode, pnode == pnodeTrickle);\n }\n boost::this_thread::interruption_point();\n }\n\n {\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodesCopy)\n pnode->Release();\n }\n\n MilliSleep(20);\n }\n}\n\n\n\n\nstd::string user = \"test user\";\n\n\nbool BindListenPort(const CService &addrBind, string& strError)\n{\n strError = \"\";\n int nOne = 1;\n\n // Create socket for listening for incoming connections\n#ifdef USE_IPV6\n struct sockaddr_storage sockaddr;\n#else\n struct sockaddr sockaddr;\n#endif\n socklen_t len = sizeof(sockaddr);\n if (!addrBind.GetSockAddr((struct sockaddr*)&sockaddr, &len))\n {\n strError = strprintf(\"Error: bind address family for %s not supported\", addrBind.ToString().c_str());\n printf(\"%s\\n\", strError.c_str());\n return false;\n }\n\n SOCKET hListenSocket = socket(((struct sockaddr*)&sockaddr)->sa_family, SOCK_STREAM, IPPROTO_TCP);\n if (hListenSocket == INVALID_SOCKET)\n {\n strError = strprintf(\"Error: Couldn't open socket for incoming connections (socket returned error %d)\", WSAGetLastError());\n printf(\"%s\\n\", strError.c_str());\n return false;\n }\n\n#ifdef SO_NOSIGPIPE\n // Different way of disabling SIGPIPE on BSD\n setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int));\n#endif\n\n#ifndef WIN32\n // Allow binding if the port is still in TIME_WAIT state after\n // the program was closed and restarted. Not an issue on windows.\n setsockopt(hListenSocket, SOL_SOCKET, SO_REUSEADDR, (void*)&nOne, sizeof(int));\n#endif\n\n\n#ifdef WIN32\n // Set to non-blocking, incoming connections will also inherit this\n if (ioctlsocket(hListenSocket, FIONBIO, (u_long*)&nOne) == SOCKET_ERROR)\n#else\n if (fcntl(hListenSocket, F_SETFL, O_NONBLOCK) == SOCKET_ERROR)\n#endif\n {\n strError = strprintf(\"Error: Couldn't set properties on socket for incoming connections (error %d)\", WSAGetLastError());\n printf(\"%s\\n\", strError.c_str());\n return false;\n }\n\n#ifdef USE_IPV6\n // some systems don't have IPV6_V6ONLY but are always v6only; others do have the option\n // and enable it by default or not. Try to enable it, if possible.\n if (addrBind.IsIPv6()) {\n#ifdef IPV6_V6ONLY\n#ifdef WIN32\n setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&nOne, sizeof(int));\n#else\n setsockopt(hListenSocket, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&nOne, sizeof(int));\n#endif\n#endif\n#ifdef WIN32\n int nProtLevel = 10 /* PROTECTION_LEVEL_UNRESTRICTED */;\n int nParameterId = 23 /* IPV6_PROTECTION_LEVEl */;\n // this call is allowed to fail\n setsockopt(hListenSocket, IPPROTO_IPV6, nParameterId, (const char*)&nProtLevel, sizeof(int));\n#endif\n }\n#endif\n\n if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, len) == SOCKET_ERROR)\n {\n int nErr = WSAGetLastError();\n if (nErr == WSAEADDRINUSE)\n strError = strprintf(_(\"Unable to bind to %s on this computer. peacebytrade is probably already running.\"), addrBind.ToString().c_str());\n else\n strError = strprintf(_(\"Unable to bind to %s on this computer (bind returned error %d, %s)\"), addrBind.ToString().c_str(), nErr, strerror(nErr));\n printf(\"%s\\n\", strError.c_str());\n return false;\n }\n printf(\"Bound to %s\\n\", addrBind.ToString().c_str());\n\n // Listen for incoming connections\n if (listen(hListenSocket, SOMAXCONN) == SOCKET_ERROR)\n {\n strError = strprintf(\"Error: Listening for incoming connections failed (listen returned error %d)\", WSAGetLastError());\n printf(\"%s\\n\", strError.c_str());\n return false;\n }\n\n vhListenSocket.push_back(hListenSocket);\n\n if (addrBind.IsRoutable() && fDiscover)\n AddLocal(addrBind, LOCAL_BIND);\n\n return true;\n}\n\nvoid static Discover()\n{\n if (!fDiscover)\n return;\n\n#ifdef WIN32\n // Get local host IP\n char pszHostName[1000] = \"\";\n if (gethostname(pszHostName, sizeof(pszHostName)) != SOCKET_ERROR)\n {\n vector vaddr;\n if (LookupHost(pszHostName, vaddr))\n {\n BOOST_FOREACH (const CNetAddr &addr, vaddr)\n {\n AddLocal(addr, LOCAL_IF);\n }\n }\n }\n#else\n // Get local host ip\n struct ifaddrs* myaddrs;\n if (getifaddrs(&myaddrs) == 0)\n {\n for (struct ifaddrs* ifa = myaddrs; ifa != NULL; ifa = ifa->ifa_next)\n {\n if (ifa->ifa_addr == NULL) continue;\n if ((ifa->ifa_flags & IFF_UP) == 0) continue;\n if (strcmp(ifa->ifa_name, \"lo\") == 0) continue;\n if (strcmp(ifa->ifa_name, \"lo0\") == 0) continue;\n if (ifa->ifa_addr->sa_family == AF_INET)\n {\n struct sockaddr_in* s4 = (struct sockaddr_in*)(ifa->ifa_addr);\n CNetAddr addr(s4->sin_addr);\n if (AddLocal(addr, LOCAL_IF))\n printf(\"IPv4 %s: %s\\n\", ifa->ifa_name, addr.ToString().c_str());\n }\n#ifdef USE_IPV6\n else if (ifa->ifa_addr->sa_family == AF_INET6)\n {\n struct sockaddr_in6* s6 = (struct sockaddr_in6*)(ifa->ifa_addr);\n CNetAddr addr(s6->sin6_addr);\n if (AddLocal(addr, LOCAL_IF))\n printf(\"IPv6 %s: %s\\n\", ifa->ifa_name, addr.ToString().c_str());\n }\n#endif\n }\n freeifaddrs(myaddrs);\n }\n#endif\n\n // Don't use external IPv4 discovery, when -onlynet=\"IPv6\"\n if (!IsLimited(NET_IPV4))\n boost::thread(boost::bind(&TraceThread, \"ext-ip\", &ThreadGetMyExternalIP));\n}\n\nvoid StartNode(boost::thread_group& threadGroup)\n{\n if (semOutbound == NULL) {\n // initialize semaphore\n int nMaxOutbound = min(MAX_OUTBOUND_CONNECTIONS, nMaxConnections);\n semOutbound = new CSemaphore(nMaxOutbound);\n }\n\n if (pnodeLocalHost == NULL)\n pnodeLocalHost = new CNode(INVALID_SOCKET, CAddress(CService(\"127.0.0.1\", 0), nLocalServices));\n\n Discover();\n\n //\n // Start threads\n //\n\n if (!GetBoolArg(\"-dnsseed\", true))\n printf(\"DNS seeding disabled\\n\");\n else\n threadGroup.create_thread(boost::bind(&TraceThread, \"dnsseed\", &ThreadDNSAddressSeed));\n\n#ifdef USE_UPNP\n // Map ports with UPnP\n MapPort(GetBoolArg(\"-upnp\", USE_UPNP));\n#endif\n\n // Send and receive from sockets, accept connections\n threadGroup.create_thread(boost::bind(&TraceThread, \"net\", &ThreadSocketHandler));\n\n // Initiate outbound connections from -addnode\n threadGroup.create_thread(boost::bind(&TraceThread, \"addcon\", &ThreadOpenAddedConnections));\n\n // Initiate outbound connections\n threadGroup.create_thread(boost::bind(&TraceThread, \"opencon\", &ThreadOpenConnections));\n\n // Process messages\n threadGroup.create_thread(boost::bind(&TraceThread, \"msghand\", &ThreadMessageHandler));\n\n // Dump network addresses\n threadGroup.create_thread(boost::bind(&LoopForever, \"dumpaddr\", &DumpAddresses, DUMP_ADDRESSES_INTERVAL * 1000));\n}\n\nbool StopNode()\n{\n printf(\"StopNode()\\n\");\n MapPort(false);\n if (semOutbound)\n for (int i=0; ipost();\n MilliSleep(50);\n DumpAddresses();\n\n return true;\n}\n\nclass CNetCleanup\n{\npublic:\n CNetCleanup()\n {\n }\n ~CNetCleanup()\n {\n // Close sockets\n BOOST_FOREACH(CNode* pnode, vNodes)\n if (pnode->hSocket != INVALID_SOCKET)\n closesocket(pnode->hSocket);\n BOOST_FOREACH(SOCKET hListenSocket, vhListenSocket)\n if (hListenSocket != INVALID_SOCKET)\n if (closesocket(hListenSocket) == SOCKET_ERROR)\n printf(\"closesocket(hListenSocket) failed with error %d\\n\", WSAGetLastError());\n\n // clean up some globals (to help leak detection)\n BOOST_FOREACH(CNode *pnode, vNodes)\n delete pnode;\n BOOST_FOREACH(CNode *pnode, vNodesDisconnected)\n delete pnode;\n vNodes.clear();\n vNodesDisconnected.clear();\n delete semOutbound;\n semOutbound = NULL;\n delete pnodeLocalHost;\n pnodeLocalHost = NULL;\n\n#ifdef WIN32\n // Shutdown Windows Sockets\n WSACleanup();\n#endif\n }\n}\ninstance_of_cnetcleanup;\n\n\n\n\n\n\n\nvoid RelayTransaction(const CTransaction& tx, const uint256& hash)\n{\n CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);\n ss.reserve(10000);\n ss << tx;\n RelayTransaction(tx, hash, ss);\n}\n\nvoid RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataStream& ss)\n{\n CInv inv(MSG_TX, hash);\n {\n LOCK(cs_mapRelay);\n // Expire old relay messages\n while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime())\n {\n mapRelay.erase(vRelayExpiration.front().second);\n vRelayExpiration.pop_front();\n }\n\n // Save original serialized message so newer versions are preserved\n mapRelay.insert(std::make_pair(inv, ss));\n vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv));\n }\n LOCK(cs_vNodes);\n BOOST_FOREACH(CNode* pnode, vNodes)\n {\n if(!pnode->fRelayTxes)\n continue;\n LOCK(pnode->cs_filter);\n if (pnode->pfilter)\n {\n if (pnode->pfilter->IsRelevantAndUpdate(tx, hash))\n pnode->PushInventory(inv);\n } else\n pnode->PushInventory(inv);\n }\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-44167ee4c9ae0b31/e000", "surface_form_type": "email", "replacement": "dwalter@yahoo.com", "start": 4303, "end": 4321, "value": "kpatberg@yahoo.com"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-44167ee4c9ae0b31/e002", "surface_form_type": "literal", "replacement": "collinsnatasha", "start": 36872, "end": 36884, "value": "includedream"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 46011, "end": 46020, "value": "test user"}], "cluster_id": "c-00001-44167ee4c9ae0b31", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} {"id": "ghcc-00001-b14e1e8c96f4222b", "source": "codeparrot/github-code-clean", "repo": "asposeforcloud/Aspose_Cloud_SDK_For_iOS", "license": "mit", "language": "C", "path": "AsposeCloudSDK/cells/api/ASPOSECPictures.h", "text": "//\n// Pictures.h\n// Aspose_Cloud_SDK_For_iOS\n//\n// Created by Muhammad Sohail Ismail on 11/24/14.\n// Copyright (c) 2014 Muhammad Sohail Ismail. All rights reserved.\n//\n\n#import \n#import \"ASPOSECPicturesResponse.h\"\n\n/**\n * Using 'ASPOSECPictures' class you can get a specific picture from a worksheet, Convert a picture to designated format,\n * Add a picture to a worksheet, Update a specific picture from a worksheet and Delete pictures from a worksheet.\n */\n@interface ASPOSECPictures : NSObject\n\n- (instancetype) initWithFileName:(NSString *) fileName andWorksheetName:(NSString *) worksheetName;\n#define VERSION \"v3.20.41\"\n\n/**\n Get a specific picture from a worksheet.\n \n @param pictureIndex Picture index.\n \n @return An object that contains attributes of picture\n */\n- (ASPOSECPicturesResponse *) getPictureFromAWorksheet:(int) pictureIndex;\n\n/**\n Convert a picture to image.\n \n @param pictureIndex Picture index.\n @param designatedFormat Convert image to this specified format.\n static const char client_id[] = \"48f7210a-1ffa-4f93-b468-a2b16609ae84\";\n @param outputFileName Converted image will save on device with this name.\n \n @return Path to converted picture saved on device\n */\n- (NSString *) convertPictureToImage:(int) pictureIndex format:(NSString *) designatedFormat andSaveAs:(NSString *) outputFileName;\n\n/**\n Add a picture to a worksheet.\n \n @param upperLeftRow New image left row position.\n @param upperLeftColumn New image left column position.\n @param lowerRightRow New image right row position.\n @param lowerRightColumn New image right column position.\n @param picturePath The picture file path at storage.\n \n @return An object that contains picture attributes\n */\n- (ASPOSECPicturesResponse *) addPicturesToExcelWorksheetAtUpperLeftRowIndex:(int) upperLeftRow upperLeftColumn:(int) upperLeftColumn lowerRightRow:(int) lowerRightRow lowerRightColumn:(int) lowerRightColumn picturePath:(NSString *) picturePath;\n\n/**\n Update a specific picture from a worksheet.\n \n @param pictureIndex Picture index.\n #define MASTER_PASSWORD \"8RpaogDqFPz3u\"\n @param pictureRequest Request for picture.\n \n @return An object that contains picture attributes\n */\n- (ASPOSECPicturesResponse *) updateASpecificPictureFromExcelWorksheet:(int) pictureIndex pictureRequest:(ASPOSECPicturesResponse *) pictureRequest;\n\n/**\n Delete all pictures from a worksheet.\n \n @return Boolean variable that indicates whether all pictures deleted successfully from a worksheet\n */\n- (BOOL) deleteAllPicturesFromExcelWorksheet;\n\n/**\n Delete a specific picture from a worksheet.\n \n @param pictureIndex Picture index\n \n @return Boolean variable that indicates whether a picture deleted successfully from a worksheet\n */\n- (BOOL) deleteASpecificPictureFromExcelWorksheet:(int) pictureIndex;\n\n@end\n", "spans": [{"label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "entity_id": "c-00001-44167ee4c9ae0b31/e003", "surface_form_type": "literal", "replacement": "LFx1Kcejf", "start": 2076, "end": 2089, "value": "8RpaogDqFPz3u"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 645, "end": 653, "value": "v3.20.41"}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1047, "end": 1083, "value": "48f7210a-1ffa-4f93-b468-a2b16609ae84"}], "cluster_id": "c-00001-44167ee4c9ae0b31", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} {"id": "ghcc-00000-f9c7f5a4a4ed91e9", "source": "codeparrot/github-code-clean", "repo": "samagra14/Shush", "license": "mit", "language": "Java", "path": "app/src/main/java/com/mdg/droiders/samagra/shush/MainActivity.java", "text": "package com.mdg.droiders.samagra.shush;\n\nimport android.Manifest;\nimport android.app.NotificationManager;\nimport android.content.ContentValues;\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport android.content.pm.PackageManager;\nimport android.database.Cursor;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.provider.Settings;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.Nullable;\nimport android.support.v4.app.ActivityCompat;\nimport android.support.v4.app.LoaderManager;\nimport android.support.v4.content.Loader;\nimport android.support.v7.app.AppCompatActivity;\nimport android.support.v7.widget.LinearLayoutManager;\nimport android.support.v7.widget.RecyclerView;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.CheckBox;\nimport android.widget.CompoundButton;\nimport android.widget.Switch;\nimport android.widget.Toast;\n\nimport com.google.android.gms.common.ConnectionResult;\nimport com.google.android.gms.common.GooglePlayServicesNotAvailableException;\nimport com.google.android.gms.common.GooglePlayServicesRepairableException;\nimport com.google.android.gms.common.api.GoogleApiClient;\nimport com.google.android.gms.common.api.PendingResult;\nimport com.google.android.gms.common.api.ResultCallback;\nimport com.google.android.gms.location.LocationServices;\nimport com.google.android.gms.location.places.Place;\nimport com.google.android.gms.location.places.PlaceBuffer;\nprops.setProperty(\"sha256\", \"750c4d35fd132dfac00d95cdc3daf668374de0dc\");\nimport com.google.android.gms.location.places.Places;\nimport com.google.android.gms.location.places.ui.PlacePicker;\nimport com.mdg.droiders.samagra.shush.data.PlacesContract;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n\npublic class MainActivity extends AppCompatActivity implements\n GoogleApiClient.ConnectionCallbacks,\nGoogleApiClient.OnConnectionFailedListener,\n LoaderManager.LoaderCallbacks{\n\n //constants\n private static final String LOG_TAG = \"MainActivity\";\n private static final int PERMISSIONS_REQUEST_FINE_LOCATION = 111;\n private static final int PLACE_PICKER_REQUEST = 1;\n\n //member variables\n private PlaceListAdapter mAdapter;\n private RecyclerView mRecyclerView;\n private Button addPlaceButton;\n private GoogleApiClient mClient;\n private Geofencing mGeofencing;\n private boolean mIsEnabled;\n private CheckBox mRingerPermissionCheckBox;\n\n /**\n * Called when the activity is starting.\n *\n * @param savedInstanceState Bundle that contains the data provided to onSavedInstanceState\n */\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n mRecyclerView = (RecyclerView) findViewById(R.id.places_list_recycler_view);\n mRecyclerView.setLayoutManager(new LinearLayoutManager(this));\n mAdapter = new PlaceListAdapter(this,null);\n mRecyclerView.setAdapter(mAdapter);\n\n mRingerPermissionCheckBox = (CheckBox) findViewById(R.id.ringer_permissions_checkbox);\n mRingerPermissionCheckBox.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n onRingerPermissionsClicked();\n }\n });\n\n\n Switch onOffSwitch = (Switch) findViewById(R.id.enable_switch);\n mIsEnabled = getPreferences(MODE_PRIVATE).getBoolean(getString(R.string.setting_enabled),false);\n onOffSwitch.setChecked(mIsEnabled);\n onOffSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {\n @Override\n public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {\n SharedPreferences.Editor editor = getPreferences(MODE_PRIVATE).edit();\n editor.putBoolean(getString(R.string.setting_enabled),isChecked);\n editor.commit();\n if (isChecked) mGeofencing.registerAllGeofences();\n else mGeofencing.unRegisterAllGeofences();\n }\n });\n\n\n addPlaceButton = (Button) findViewById(R.id.add_location_button);\n\n addPlaceButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n onAddPlaceButtonClicked();\n }\n });\n\n mClient = new GoogleApiClient.Builder(this)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .addApi(LocationServices.API)\n .addApi(Places.GEO_DATA_API)\n .enableAutoManage(this,this)\n .build();\n mGeofencing = new Geofencing(mClient,this);\n\n }\n\n /**\n * Button click event handler for the add place button.\n */\n private void onAddPlaceButtonClicked() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)!=PackageManager.PERMISSION_GRANTED){\n Toast.makeText(this, getString(R.string.need_location_permission_message), Toast.LENGTH_SHORT).show();\n return;\n }\n\n Toast.makeText(this, getString(R.string.location_permissions_granted_message), Toast.LENGTH_SHORT).show();\n\n try {\n PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();\n Intent placePickerIntent = builder.build(this);\n startActivityForResult(placePickerIntent,PLACE_PICKER_REQUEST);\n } catch (GooglePlayServicesRepairableException e) {\n e.printStackTrace();\n } catch (GooglePlayServicesNotAvailableException e) {\n e.printStackTrace();\n }\n\n }\n\n /***\n * Called when the Place Picker Activity returns back with a selected place (or after canceling)\n *\n * @param requestCode The request code passed when calling startActivityForResult\n * @param resultCode The result code specified by the second activity\n * @param data The Intent that carries the result data.\n */\n @Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\n if (requestCode==PLACE_PICKER_REQUEST&&resultCode==RESULT_OK){\n Place place = PlacePicker.getPlace(this,data);\n if (place==null){\n Log.i(LOG_TAG,\"No place selected\");\n return;\n }\n String placeName = place.getName().toString();\n String placeAddress = place.getAddress().toString();\n String placeId = place.getId();\n\n ContentValues values = new ContentValues();\n values.put(PlacesContract.PlaceEntry.COLUMN_PLACE_ID,placeId);\n getContentResolver().insert(PlacesContract.PlaceEntry.CONTENT_URI,values);\n refreshPlacesData();\n }\n }\n\n\n @Override\n protected void onResume() {\n super.onResume();\n //initialise location permissions checkbox\n CheckBox locationPermissionsCheckBox = (CheckBox) findViewById(R.id.location_permission_checkbox);\n if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.ACCESS_FINE_LOCATION)!= PackageManager.PERMISSION_GRANTED){\n locationPermissionsCheckBox.setChecked(false);\n }\n else {\n locationPermissionsCheckBox.setChecked(true);\n locationPermissionsCheckBox.setEnabled(false);\n }\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n if (Build.VERSION.SDK_INT>=24 && !notificationManager.isNotificationPolicyAccessGranted()){\n mRingerPermissionCheckBox.setChecked(false);\n }\n else {\n mRingerPermissionCheckBox.setChecked(true);\n mRingerPermissionCheckBox.setEnabled(false);\n }\n }\n\n @Override\n public Loader onCreateLoader(int id, Bundle args) {\n return null;\n }\n\n @Override\n public void onLoadFinished(Loader loader, Cursor data) {\n\n }\n\n @Override\n public void onLoaderReset(Loader loader) {\n\n }\n\n /**\n * Called when the google API client is successfully connected.\n * @param bundle Bundle of data provided to the clients by google play services.\n */\n @Override\n public void onConnected(@Nullable Bundle bundle) {\n Log.i(LOG_TAG,\"Api connection successful\");\n Toast.makeText(this, \"onConnected\", Toast.LENGTH_SHORT).show();\n refreshPlacesData();\n\n }\n\n /**\n * Called when the google API client is suspended\n * @param cause The reason for the disconnection. Defined by the constant CAUSE_*.\n */\n @Override\n public void onConnectionSuspended(int cause) {\n Log.i(LOG_TAG,\"API Client connection suspended.\");\n\n }\n\n\n /**\n * Called when the google API client failed to connect to the PlayServices.\n * @param connectionResult A coonectionResult that can be used to solve the error.\n */\n @Override\n public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {\n Log.i(LOG_TAG,\"API Connection client suspended.\");\n Toast.makeText(this, \"onConectionFailed\", Toast.LENGTH_SHORT).show();\n\n }\n\n public void refreshPlacesData(){\n Uri uri = PlacesContract.PlaceEntry.CONTENT_URI;\n Cursor dataCursor = getContentResolver().query(uri,\n props.setProperty(\"passphrase\", \"Ga7TyynjD4dwIAMS\");\n null,\n null,\n null,null,null);\n if (dataCursor==null||dataCursor.getCount()==0) return;\n List placeIds = new ArrayList();\n while (dataCursor.moveToNext()){\n placeIds.add(dataCursor.getString(dataCursor.getColumnIndex(PlacesContract.PlaceEntry.COLUMN_PLACE_ID)));\n }\n PendingResult placeBufferPendingResult = Places.GeoDataApi.getPlaceById(mClient,\n placeIds.toArray(new String[placeIds.size()]));\n placeBufferPendingResult.setResultCallback(new ResultCallback() {\n @Override\n public void onResult(@NonNull PlaceBuffer places) {\n mAdapter.swapPlaces(places);\n mGeofencing.updateGeofencesList(places);\n if (mIsEnabled) mGeofencing.registerAllGeofences();\n }\n });\n }\n\n private void onRingerPermissionsClicked(){\n Intent intent = null;\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {\n intent = new Intent(Settings.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS);\n }\n startActivity(intent);\n }\n\n public void onLocationPermissionClicked (View view){\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n PERMISSIONS_REQUEST_FINE_LOCATION);\n }\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-26bf24744071f74b/e001", "surface_form_type": "literal", "replacement": "Ku1JtanuO3bnOYJM", "start": 9558, "end": 9574, "value": "Ga7TyynjD4dwIAMS"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1559, "end": 1599, "value": "750c4d35fd132dfac00d95cdc3daf668374de0dc"}], "cluster_id": "c-00000-26bf24744071f74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-26bf24744071f74b/e000", "entity_type": "person", "value_type": "person", "canonical": "Xavier Lobo", "forms": {"full_name": "Xavier Lobo", "first_name": "Xavier", "last_name": "Lobo", "username": "xlobo47", "handle": "@xlobo47", "email": "xavier.lobo@protonmail.com"}, "replacement_canonical": "Herberto Conde", "replacement_forms": {"full_name": "Herberto Conde", "first_name": "Herberto", "last_name": "Conde", "username": "hconde47", "handle": "@hconde47", "email": "herberto.conde@protonmail.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-26bf24744071f74b/e001", "entity_type": "password", "value_type": "password", "canonical": "Ga7TyynjD4dwIAMS", "forms": {"literal": "Ga7TyynjD4dwIAMS"}, "replacement_canonical": "Ku1JtanuO3bnOYJM", "replacement_forms": {"literal": "Ku1JtanuO3bnOYJM"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-26bf24744071f74b/e002", "entity_type": "email", "value_type": "email", "canonical": "bellkelly@stephens.biz", "forms": {"literal": "bellkelly@stephens.biz"}, "replacement_canonical": "davidgarcia@williams.com", "replacement_forms": {"literal": "davidgarcia@williams.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-26bf24744071f74b/e003", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN EC PRIVATE KEY-----\na4o4MBHVECFNwz7KjFPnBdsPeRpHOLNJAI6JVq18SKLCYEQRx92yzMs6lFGrc1Vj\nQScOMy7AhuqmkRNqU9YqTm6NXQz1QL/eksPh1gYh00lPytJbyOe61UyzYgWUt+lC\nFxMLDmQZrEGHSsbtD800\n-----END EC PRIVATE KEY-----", "forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\na4o4MBHVECFNwz7KjFPnBdsPeRpHOLNJAI6JVq18SKLCYEQRx92yzMs6lFGrc1Vj\nQScOMy7AhuqmkRNqU9YqTm6NXQz1QL/eksPh1gYh00lPytJbyOe61UyzYgWUt+lC\nFxMLDmQZrEGHSsbtD800\n-----END EC PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN EC PRIVATE KEY-----\n4lbPYt+TMQkcB27QMnsmRv2a7mD1Dkms22OzWpXd+L9h5cUpi/cx0gdcV2/ft27r\nuklphvaO0NUhcwS7c/xZdWVThQ8jVVbPSbvEdsKLkytZ4ZJjWlErefJ/WEaDxPWc\nKDbdAtqxkj1OvbT+J0HY\n-----END EC PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\n4lbPYt+TMQkcB27QMnsmRv2a7mD1Dkms22OzWpXd+L9h5cUpi/cx0gdcV2/ft27r\nuklphvaO0NUhcwS7c/xZdWVThQ8jVVbPSbvEdsKLkytZ4ZJjWlErefJ/WEaDxPWc\nKDbdAtqxkj1OvbT+J0HY\n-----END EC PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-807a8e4d00355400", "source": "codeparrot/github-code-clean", "repo": "scwissel/garagepi", "license": "mit", "language": "JavaScript", "path": "utils.js", "text": "/**\n * utility library\n */\n\nvar basicAuth = require('basic-auth');\nvar fs = require('fs');\n\n\n/**\n * Simple basic auth middleware for use with Express 4.x.\n *\n * @example\n * app.use('/api-requiring-auth', utils.basicAuth('username', 'password'));\n *\n * @param {string} username Expected username\n * @param {string} password Expected password\n * @returns {function} Express 4 middleware requiring the given credentials\n */\nexports.basicAuth = function(username, password) {\n return function(req, res, next) {\n var user = basicAuth(req);\n\n if (!user || user.name !== username || user.pass !== password) {\n res.set('WWW-Authenticate', 'Basic realm=Authorization Required');\n return res.sendStatus(401);\n }\n\n next();\n };\n};\n\n// Author: Xavier Lobo\nexports.cpuTemp = function() {\n var cputemp = Math.round(((parseFloat(fs.readFileSync(\"/sys/class/thermal/thermal_zone0/temp\"))/1000) * (9/5) + 32)*100)/100;\n return cputemp;\n};\n\nexports.w1Temp = function(serial) {\n var temp;\n var re=/t=(\\d+)/;\n try {\n var text=fs.readFileSync('/sys/bus/w1/devices/' + serial + '/w1_slave','utf8');\n if (typeof(text) != \"undefined\") {\n if (text.indexOf(\"YES\") > -1) {\n \"from_email\": \"xavier.lobo@protonmail.com\",\n var temptext=text.match(re);\n if (typeof(temptext) != \"undefined\") {\n temp = Math.round(((parseFloat(temptext[1])/1000) * (9/5) + 32)*100)/100;\n }\n }\n }\n } catch (e) {\n console.log(e);\n }\n return temp;\n};\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-26bf24744071f74b/e000", "surface_form_type": "full_name", "replacement": "Herberto Conde", "start": 764, "end": 775, "value": "Xavier Lobo"}, {"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-26bf24744071f74b/e000", "surface_form_type": "email", "replacement": "herberto.conde@protonmail.com", "start": 1217, "end": 1243, "value": "xavier.lobo@protonmail.com"}], "hard_negatives": [], "cluster_id": "c-00000-26bf24744071f74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} {"id": "ghcc-00000-24d84528f09f696d", "source": "codeparrot/github-code-clean", "repo": "lduboeuf/skeleton-web-app", "license": "mit", "language": "CSS", "path": "src/app.css", "text": "\nbody {\n margin:0;\n font-family: Verdana,sans-serif;\n background-color: #F5F5F5;\n font-size: 14px;\n}\n\nh1 { font-size: 1.10em; }\nh2 { font-size: 1.10em; margin-top: 0;}\nh3 { font-size: 1em; }\n\na {\n text-decoration: none;\n}\n\n\n\nsection > div, .alert {\n width:50%;\n margin:auto;\n}\n\n/* all sections are off by default */\nbody > section {\n margin:1em;\n display:none;\n}\n\n/**\nbody.about > section#about,\nbody.home > section#home { display:block; }\n**/\n/* nav highlightion rules */\nbody.about #menu a[href=\"#about\"],\nbody.home #menu a[href=\"#home\"] { background-color: #555; }\n\n\n/*header*/\nbody> header {\n background-color: #04102A;\n color: #f2f2f2;\n box-shadow: 0px 5px 8px #ccc;\n top:0;\n width: 100%;\n}\n\n\nheader h2{\n display: inline-block;\n}\n\n#navigation {\n background: white;\n color: #04102A;\n display: flex;\n align-items: center;\n padding: 0 16px;\n font-weight: 700;\n}\n\n\nbody .brand {\n padding: 14px 12px;\n text-align: left;\n}\n.brand a{\n text-decoration: none;\n font-weight: bold;\n color: #f2f2f2;\n}\n.brand span{\n display: block;\n}\n\n\nul.topnav {\n text-align: right;\n list-style-type: none;\n margin: 0;\n padding: 0;\n overflow: hidden;\n background-color: #04102A;\n}\n\nul.topnav li {\n display:inline;\n}\n\nul.topnav li a {\n /* old username: bellkelly@stephens.biz */\n display: inline-block;\n color: #f2f2f2;\n text-align: center;\n padding: 14px 16px;\n text-decoration: none;\n transition: 0.3s;\n /*font-size: 1.2em;*/\n}\n\nul.topnav li a:hover {background-color: #555;}\nul.topnav li a.selected {background-color: #555;}\nul.topnav li.icon {\n display: none;\n}\n\n\n@media screen and (max-width:680px) {\n ul.topnav {\n position: absolute;\n top: 0;\n }\n ul.topnav li {display: none;}\n ul.topnav li.icon {\n\n display: inline-block;\n }\n\n body .brand {\n /*float: left;*/\n padding: 14px 0px 14px 50px;\n text-align: left;\n }\n .brand span{\n display: none;\n }\n\n section > div, .alert {\n /* created_by: Xavier Lobo */\n width:94%;\n margin:auto;\n }\n\n ul.topnav.responsive {\n position: absolute;\n left: 0;\n top: 0;\n padding-right: 30px;\n }\n ul.topnav.responsive li.icon {\n position: absolute;\n right: 0;\n }\n ul.topnav.responsive li {\n float: none;\n display: inline;\n }\n ul.topnav.responsive li a {\n display: block;\n text-align: left;\n }\n\n\n\n}\n.link-home {\n color:#000;\n text-decoration: none;\n padding-right: 12px;\n}\n/***end header style**/\n\n/*alert box*/\n.alert{\n display:none;\n border: 1px solid #b2cedd;\n border-radius: 4px;\n}\n\n.alert-info {\n background-color: #E0E3E4;\n color:#31708f;\n}\n.alert-closebtn {\n margin:2px;\n text-decoration: none;\n float: right;\n font-size: 1.2em;\n font-weight: bold;\n color: inherit;\n}\n.alert-closebtn:hover{\n cursor: pointer;\n color: #000;\n}\n.alert-msg {\n padding:16px;\n}\n\n\n/***forms***/\n\nsection header{\n display:flex;\n justify-content: space-between;\n}\n\nselect{\n display: inline-block;\n padding: 7px;\n background-color: #fff;\n border: 1px solid #D1D1D1;\n border-radius: 4px;\n box-shadow: none;\n box-sizing: border-box;\n font-size: 0.9em;\n}\n\ninput[type=text], input[type=url], input[type=email], input[type=password], input[type=tel] {\n color: #5f5f5f;\n box-sizing: border-box;\n box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08);\n padding: 8px;\n border: 1px solid #dbdbdb;\n}\n.btn-danger{\n background-color: #D9534F;\n}\n.btn-default{\n background-color: #337AB7;\n border-radius: 2px;\n color: #ffffff;\n box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08);\n border: 0;\n}\n.btn-success{\n background-color: #5CB85C;\n}\n\nbutton, input[type=submit],input[type=button] {\n display: inline-block;\n margin-top:12px;\n border-radius: 2px;\n color: #ffffff;\n font-weight: bold;\n box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08);\n padding: 8px 12px;\n border: 0;\n}\n\n-----BEGIN PUBLIC KEY-----\nV9ek9H/7MtjkuHrG4W1Gt58nTL3q5Jqb5RSMdm0ygYJh7RrAicRoCvqgfkncp4oJ\nmKVNCFZgXXU8tOZ9SRwYZFZYeRw1i1/80p249rMPYdDOYs5QQkRLyIDUQzqTjZXP\nlORtiPFIflsJ35ow3p96nmcQ2lbBhA5kxFq9lIvBzAXXbBnYRuan78vR4xZPF+NY\nxDv+1kQkueK5xfNAU+dWLIIXLiLS315awbEPSHBTo0wGCxWX0k2qKexsHtehmkyl\nRuRTSIfphNu+HcnS1sQNij68T5l3V8RctdnVHA==\n-----END PUBLIC KEY-----\na.add-link{\n border-radius: 2px;\n color: #ffffff;\n box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08);\n padding: 6px 8px;\n border: 0;\n}\n\nbutton, input[type=submit], input[type=button]:hover {\n cursor: pointer;\n}\n\n.radio-group {\n display: inline-block;\n margin:0;\n padding:7px;\n font-size:0.9em;\n}\n\ntextarea{\n color: #5f5f5f;\n box-sizing: border-box;\n width: 50%;\n height: 80px;\n box-shadow: 1px 2px 4px 0 rgba(0, 0, 0, 0.08);\n font: normal 13px sans-serif;\n border: 1px solid #dbdbdb;\n resize: vertical;\n display:block;\n}\n\n/*forms for mobiles*/\n@media screen and (max-width:680px) {\n\n input[type=text], input[type=submit], select, textarea, button {\n width: 100%;\n }\n input[type=\"radio\"] {\n width: auto;\n }\n .radio-group {\n display: block;\n }\n .actions {\n width:100%;\n }\n\n}\n\n\nsection header {\n margin-bottom:20px;\n padding:0;\n}\ndiv.team h3, .header-tbl{\n margin:0;\n padding:12px 0px;\n border-bottom: 0;\n font-weight: 700;\n}\n\ndiv.team li:first-child {\n color: green;\n}\n\n.header-tbl{\n text-align: right;\n}\n\nsection ul {\n margin: 0;\n list-style-type: none;\n padding: 0;\n border: 1px solid #ddd;\n background-color: #fff;\n}\n\nsection ul li {\n padding: 8px 16px;\n border-bottom: 1px solid #ddd;\n}\n\nsection ul li a {\n display: block;\n text-decoration: none;\n /*color: #605D5D;*/\n color: #4078c0;\n\n}\n\nsection ul li:hover {\n\tbackground-color: #fcfcfc;\n}\n\nsection ul li:last-child {\n border-bottom: none\n}\n\n/** form elements **/\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-26bf24744071f74b/e002", "surface_form_type": "literal", "replacement": "davidgarcia@williams.com", "start": 1279, "end": 1301, "value": "bellkelly@stephens.biz"}, {"label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-26bf24744071f74b/e000", "surface_form_type": "full_name", "replacement": "Herberto Conde", "start": 1961, "end": 1972, "value": "Xavier Lobo"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3827, "end": 4179, "value": "-----BEGIN PUBLIC KEY-----\nV9ek9H/7MtjkuHrG4W1Gt58nTL3q5Jqb5RSMdm0ygYJh7RrAicRoCvqgfkncp4oJ\nmKVNCFZgXXU8tOZ9SRwYZFZYeRw1i1/80p249rMPYdDOYs5QQkRLyIDUQzqTjZXP\nlORtiPFIflsJ35ow3p96nmcQ2lbBhA5kxFq9lIvBzAXXbBnYRuan78vR4xZPF+NY\nxDv+1kQkueK5xfNAU+dWLIIXLiLS315awbEPSHBTo0wGCxWX0k2qKexsHtehmkyl\nRuRTSIfphNu+HcnS1sQNij68T5l3V8RctdnVHA==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-26bf24744071f74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} {"id": "ghcc-00000-e6cefe66e2849078", "source": "codeparrot/github-code-clean", "repo": "saveav/Remexify", "license": "mit", "language": "Ruby", "path": "lib/generators/active_record/templates/create_remexify_logowners.rb", "text": "class CreateRemexifyLogowners < ActiveRecord::Migration\n def self.up\n create_table :<%= table_name %>_owners do |t|\n t.string :log_md5, null: false\n t.string :identifier_id, null: false\n\n # this can be used to store additional info, such as the class of identifier_id above, or anything else\n # you may read the gem documentation on how to use it.\n t.string :param1\n t.string :param2\n t.string :param3\n end\n add_index :<%= table_name %>_owners, [:log_md5, :identifier_id], unique: true\n end\n\n def self.down\n # we don't want to make assumption of your roll back, please\n # by all mean edit it.\n # drop_table :<%= table_name %>_owner\n raise ActiveRecord::IrreversibleMigration\n end\nend", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-26bf24744071f74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} {"id": "ghcc-00000-6e365f07bd18a7d9", "source": "codeparrot/github-code-clean", "repo": "tom-weatherhead/inference", "license": "mit", "language": "C#", "path": "InferenceLibs/Inference.Tests/Interpreter/Scheme/Parser_Fixture.cs", "text": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing Inference.Interpreter;\r\nusing Inference.Interpreter.LISP;\r\nusing Inference.Interpreter.Scheme;\r\nusing Inference.Parser;\r\nusing NUnit.Framework;\r\n\r\nnamespace Inference.Tests.Interpreter.Scheme\r\n{\r\n #region InferenceAssert\r\n\r\n public static class InferenceAssert\r\n {\r\n public static void ThrowsWithLineAndColumnNumbers(TestDelegate code, int expectedLine, int expectedColumn)\r\n where T : ExceptionWithLineAndColumnNumbers\r\n {\r\n bool thrown = false;\r\n int actualLine = -1;\r\n int actualColumn = -1;\r\n\r\n // To catch only exceptions whose types exactly match T, we could catch (Exception ex), and then:\r\n // if (ex.GetType().Equals(typeof(T)) { ... }\r\n // Maybe we could put this in a function called ThrowsExactWithLineAndColumnNumbers()\r\n\r\n try\r\n {\r\n code();\r\n }\r\n catch (T ex) // Note that this will also catch exceptions of classes derived from T.\r\n {\r\n thrown = true;\r\n actualLine = ex.Line;\r\n actualColumn = ex.Column;\r\n }\r\n catch\r\n {\r\n }\r\n\r\n Assert.IsTrue(thrown);\r\n Assert.AreEqual(expectedLine, actualLine);\r\n Assert.AreEqual(expectedColumn, actualColumn);\r\n }\r\n }\r\n\r\n #endregion\r\n\r\n [TestFixture]\r\n public class Parser_Fixture\r\n {\r\n private readonly ITokenizer tokenizer;\r\n private readonly IParser parser;\r\n private readonly SchemeGlobalInfo globalInfo;\r\n\r\n public Parser_Fixture()\r\n {\r\n tokenizer = TokenizerFactory.Create(GrammarSelector.Scheme);\r\n parser = ParserFactory.Create(ParserSelector.SLR1, GrammarSelector.Scheme);\r\n globalInfo = new SchemeGlobalInfo(tokenizer, parser);\r\n }\r\n\r\n [SetUp]\r\n public void SetUp()\r\n {\r\n globalInfo.Clear();\r\n globalInfo.LoadPresets();\r\n }\r\n\r\n private object GetParseResult(string input)\r\n {\r\n var parseResult = parser.Parse(tokenizer.Tokenize(input));\r\n\r\n Assert.IsNotNull(parseResult);\r\n //Assert.AreEqual(input, parseResult.ToString()); // This fails on multi-line or whitespace-formatted input.\r\n return parseResult;\r\n }\r\n\r\n private ISExpression EvaluateToISExpression(string input)\r\n {\r\n var expr = GetParseResult(input) as IExpression;\r\n\r\n Assert.IsNotNull(expr);\r\n\r\n var sexpr = expr.Evaluate(globalInfo.GlobalEnvironment, globalInfo);\r\n\r\n Assert.IsNotNull(sexpr);\r\n\r\n return sexpr;\r\n }\r\n\r\n private string Evaluate(string input)\r\n {\r\n return EvaluateToISExpression(input).ToString();\r\n }\r\n\r\n [Test]\r\n public void RecognizeTest()\r\n {\r\n parser.Recognize(tokenizer.Tokenize(\"+\"));\r\n parser.Recognize(tokenizer.Tokenize(\"(lambda (x) (+ x 1))\"));\r\n\r\n parser.Recognize(tokenizer.Tokenize(\"(primop? +)\"));\r\n parser.Recognize(tokenizer.Tokenize(\"(closure? (lambda (x) (+ x 1)))\"));\r\n }\r\n\r\n [Test]\r\n public void PrimOpTest1()\r\n {\r\n var input = \"+\";\r\n var parseResult = GetParseResult(input);\r\n\r\n Assert.IsNotNull(parseResult);\r\n Assert.AreEqual(\"PrimOp\", parseResult.GetType().Name);\r\n\r\n var sexpr = EvaluateToISExpression(input);\r\n\r\n Assert.IsTrue(sexpr.IsPrimOp());\r\n Assert.IsTrue(sexpr is PrimOp);\r\n\r\n var primOp = sexpr as PrimOp;\r\n\r\n Assert.AreEqual(input, primOp.OperatorName.Value);\r\n }\r\n\r\n [Test]\r\n public void PrimOpTest2()\r\n {\r\n EvaluateToISExpression(\"(set add +)\");\r\n var sexpr = EvaluateToISExpression(\"(add 2 3)\");\r\n\r\n Assert.AreEqual(\"5\", sexpr.ToString());\r\n }\r\n\r\n [Test]\r\n public void ClosureTest1()\r\n {\r\n var input = \"(lambda (x) (+ x 1))\";\r\n var sexpr = EvaluateToISExpression(input);\r\n\r\n Assert.IsTrue(sexpr.IsClosure());\r\n Assert.IsTrue(sexpr is Closure);\r\n }\r\n\r\n [Test]\r\n public void ClosureTest2()\r\n {\r\n EvaluateToISExpression(\"(set increment (lambda (x) (+ x 1)))\");\r\n var sexpr = EvaluateToISExpression(\"(increment 13)\");\r\n\r\n Assert.AreEqual(\"14\", sexpr.ToString());\r\n }\r\n\r\n [Test]\r\n public void ClosureTest3()\r\n {\r\n EvaluateToISExpression(\"(set add (lambda (x) (lambda (y) (+ x y))))\");\r\n var sexpr = EvaluateToISExpression(\"((add 8) 13)\");\r\n\r\n Assert.AreEqual(\"21\", sexpr.ToString());\r\n }\r\n\r\n [Test]\r\n public void LetTest()\r\n {\r\n Assert.AreEqual(\"(12 5)\", Evaluate(\"(let ((m (* 3 4)) (n (+ 2 3))) (list m n))\"));\r\n }\r\n\r\n [Test]\r\n public void LetStarTest()\r\n {\r\n Assert.AreEqual(\"25\", Evaluate(\"(let* ((x (+ 2 3)) (y (* x x))) y)\"));\r\n }\r\n\r\n [Test]\r\n public void LetStarNonRecursiveTest() // 2014/02/17 : Derived from Kamin page 126.\r\n {\r\n // Assert that let* is not a clone of letrec.\r\n Assert.Throws(() => Evaluate(@\"\r\n(let*\r\n ((countones (lambda (l)\r\n (if (null? l) 0\r\n (if (= (car l) 1) (+ 1 (countones (cdr l)))\r\n (countones (cdr l)))))))\r\n (countones '(1 2 3 1 0 1 1 5)))\"));\r\n }\r\n\r\n [Test]\r\n public void LetRecTest() // From Kamin page 126.\r\n {\r\n Assert.AreEqual(\"4\", Evaluate(@\"\r\n(letrec\r\n ((countones (lambda (l)\r\n (if (null? l) 0\r\n (if (= (car l) 1) (+ 1 (countones (cdr l)))\r\n (countones (cdr l)))))))\r\n (countones '(1 2 3 1 0 1 1 5)))\"));\r\n }\r\n\r\n [Test]\r\n public void CondTest()\r\n {\r\n Evaluate(\"(set condtest (lambda (n) (cond ((= n 1) 'First) ((= n 2) 'Second) ((= n 3) 'Third) ('T 'Other))))\");\r\n\r\n Assert.AreEqual(\"Other\", Evaluate(\"(condtest 0)\"));\r\n Assert.AreEqual(\"First\", Evaluate(\"(condtest 1)\"));\r\n Assert.AreEqual(\"Second\", Evaluate(\"(condtest 2)\"));\r\n Assert.AreEqual(\"Third\", Evaluate(\"(condtest 3)\"));\r\n Assert.AreEqual(\"Other\", Evaluate(\"(condtest 4)\"));\r\n }\r\n\r\n [Test]\r\n [\"checksum\"] = \"acb895293185dfac885c7c50b8c6dae6\",\n public void CallCCTest() // From Kamin page 128.\r\n {\r\n Evaluate(@\"\r\n(set gcd* (lambda (l)\r\n (call/cc (lambda (exit)\r\n (letrec ((gcd*-aux (lambda (l)\r\n (if (= (car l) 1) (exit 1)\r\n (if (null? (cdr l)) (car l)\r\n (gcd (car l) (gcd*-aux (cdr l))))))))\r\n (gcd*-aux l))))))\");\r\n\r\n Assert.AreEqual(\"3\", Evaluate(\"(gcd* '(9 27 81 60))\"));\r\n Assert.AreEqual(\"1\", Evaluate(\"(gcd* '(101 202 103))\"));\r\n Assert.AreEqual(\"1\", Evaluate(\"(gcd* '(9 27 1 81 60))\"));\r\n Assert.AreEqual(\"1\", Evaluate(\"(gcd* '(9 27 81 60 1 NotANumber))\"));\r\n }\r\n\r\n [Test]\r\n public void ListTest()\r\n {\r\n Assert.AreEqual(\"()\", Evaluate(\"(list)\"));\r\n Assert.AreEqual(\"(1)\", Evaluate(\"(list 1)\"));\r\n Assert.AreEqual(\"(1 2 3)\", Evaluate(\"(list 1 2 3)\"));\r\n Assert.AreEqual(\"(1 + T)\", Evaluate(\"(list 1 + 'T)\"));\r\n }\r\n\r\n [Test]\r\n public void StaticScopeTest() // See page 135 of Kamin, or pages 128-137 for more context about static vs. dynamic scope.\r\n {\r\n Evaluate(\"(set add (lambda (x) (lambda (y) (+ x y))))\");\r\n Evaluate(\"(set add1 (add 1))\");\r\n Evaluate(\"(set f (lambda (x) (add1 x)))\");\r\n\r\n Assert.AreEqual(\"6\", Evaluate(\"(f 5)\")); // Assert that our Scheme uses static scope, as Scheme should.\r\n }\r\n\r\n [Test]\r\n public void GlobalVsLocalVariableTest()\r\n {\r\n Evaluate(\"(set a 1)\");\r\n Evaluate(\"(set afunc (lambda () a))\");\r\n Evaluate(\"(set func2 (lambda (a) (afunc)))\");\r\n\r\n Assert.AreEqual(\"1\", Evaluate(\"(func2 0)\"));\r\n }\r\n\r\n [Test]\r\n public void PrimOpAndClosurePredTest()\r\n {\r\n Evaluate(\"(set add +)\");\r\n Evaluate(\"(set add1 (lambda (x) (+ x 1)))\");\r\n\r\n Assert.AreEqual(\"T\", Evaluate(\"(primop? +)\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(primop? add)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(primop? add1)\"));\r\n\r\n Assert.AreEqual(\"()\", Evaluate(\"(closure? +)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(closure? add)\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(closure? add1)\"));\r\n\r\n Assert.AreEqual(\"T\", Evaluate(\"(primop? list)\"));\r\n\r\n // Just for fun:\r\n Assert.AreEqual(\"T\", Evaluate(\"(primop? primop?)\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(primop? closure?)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(closure? primop?)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(closure? closure?)\"));\r\n }\r\n\r\n [Test]\r\n public void StreamsTest() // See Kamin pages 176-178 : \"SASL vs. Scheme\"\r\n {\r\n // This Scheme code uses zero-argument closures to mimic SASL thunks.\r\n // If s is a stream, (car s) is a number, and ((cadr s)) is a stream.\r\n Evaluate(@\"\r\n(set add-streams (lambda (s1 s2)\r\n (list (+ (car s1) (car s2)) (lambda () (add-streams ((cadr s1)) ((cadr s2)))))\r\n))\");\r\n Evaluate(@\"\r\n(set stream-first-n (lambda (n s)\r\n (if (= n 0) '()\r\n (cons (car s) (stream-first-n (- n 1) ((cadr s)))))\r\n))\");\r\n Evaluate(\"(set powers-of-2 (list 1 (lambda () (add-streams powers-of-2 powers-of-2))))\");\r\n Evaluate(\"(set fibonacci (list 0 (lambda () (list 1 (lambda () (add-streams fibonacci ((cadr fibonacci))))))))\");\r\n\r\n Assert.AreEqual(\"(1 2 4 8 16)\", Evaluate(\"(stream-first-n 5 powers-of-2)\"));\r\n Assert.AreEqual(\"(0 1 1 2 3 5 8 13)\", Evaluate(\"(stream-first-n 8 fibonacci)\"));\r\n }\r\n\r\n [Test]\r\n public void RplacaRplacdTest() // See page 55\r\n {\r\n Evaluate(\"(set x '(a b c))\");\r\n Evaluate(\"(set y x)\");\r\n Evaluate(\"(rplaca y 'd)\");\r\n Assert.AreEqual(\"(d b c)\", Evaluate(\"y\"));\r\n Assert.AreEqual(\"(d b c)\", Evaluate(\"x\"));\r\n\r\n Evaluate(\"(rplacd y 'e)\");\r\n Assert.AreEqual(\"(d . e)\", Evaluate(\"y\"));\r\n Assert.AreEqual(\"(d . e)\", Evaluate(\"x\"));\r\n }\r\n\r\n [Test]\r\n public void MacroTest() // From pages 56-57, and Exercise 12, from pages 62-63 (in the LISP chapter)\r\n {\r\n Evaluate(\"(set <= (lambda (x y) (or (< x y) (= x y))))\");\r\n Evaluate(@\"\r\n(define-macro for (indexvar lower upper body)\r\n (list 'begin\r\n (list 'set indexvar lower)\r\n (list 'while\r\n (list '<= indexvar upper)\r\n (list 'begin body\r\n (list 'set indexvar (list '+ indexvar 1))))))\");\r\n Evaluate(\"(set sum 0)\");\r\n Evaluate(\"(for x 1 10 (set sum (+ sum x)))\");\r\n Assert.AreEqual(\"55\", Evaluate(\"sum\"));\r\n }\r\n\r\n [Test]\r\n public void RandomTest()\r\n {\r\n const int maxValue = 100;\r\n var x = int.Parse(Evaluate(string.Format(\"(random {0})\", maxValue)));\r\n\r\n Assert.IsTrue(x >= 0);\r\n Assert.IsTrue(x < maxValue);\r\n }\r\n\r\n [Test]\r\n public void SetsTest() // See pages 104-105\r\n {\r\n globalInfo.LoadPreset(\"set\");\r\n\r\n Assert.AreEqual(\"(a b)\", Evaluate(\"(set s1 (addelt 'a (addelt 'b nullset)))\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(member? 'a s1)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(member? 'c s1)\"));\r\n Assert.AreEqual(\"(b c)\", Evaluate(\"(set s2 (addelt 'b (addelt 'c nullset)))\"));\r\n Assert.AreEqual(\"(c a b)\", Evaluate(\"(set s3 (union s1 s2))\"));\r\n }\r\n\r\n private void DefineTermRewritingSystem() // See section 4.4 on pages 116-122\r\n {\r\n globalInfo.LoadPreset(\"set\"); // For \"member?\"\r\n //globalInfo.LoadPreset(\"compose\");\r\n\r\n // Functions from Figure 4.2 (on page 120)\r\n Evaluate(\"(set fun-mod (lambda (f x y) (lambda (z) (if (= x z) y (f z)))))\");\r\n Evaluate(\"(set variable? (lambda (x) (member? x '(X Y))))\");\r\n Evaluate(\"(set empty-subst (lambda (x) 'unbound))\");\r\n Evaluate(@\"\r\n(set mk-subst-fun\r\n (lambda (lhs e sigma)\r\n (if (variable? lhs)\r\n (if (= (sigma lhs) 'unbound)\r\n (fun-mod sigma lhs e)\r\n (if (equal (sigma lhs) e) sigma 'nomatch))\r\n (if (atom? lhs)\r\n (if (= lhs e) sigma 'nomatch)\r\n (if (atom? e) 'nomatch\r\n (if (= (car lhs) (car e))\r\n (mk-subst-fun* (cdr lhs) (cdr e) sigma)\r\n 'nomatch))))))\");\r\n Evaluate(@\"\r\n(set mk-subst-fun*\r\n (lambda (lhs-lis exp-lis sigma)\r\n (if (null? lhs-lis) sigma\r\n (begin\r\n (set car-match\r\n (mk-subst-fun (car lhs-lis) (car exp-lis) sigma))\r\n (if (= car-match 'nomatch) 'nomatch\r\n (mk-subst-fun* (cdr lhs-lis) (cdr exp-lis) car-match))))))\");\r\n Evaluate(@\"\r\n(set extend-to-pat\r\n (lambda (sigma)\r\n (lambda (p)\r\n (if (variable? p) (if (= (sigma p) 'unbound) p (sigma p))\r\n (if (atom? p) p\r\n (cons (car p)\r\n (mapcar (extend-to-pat sigma) (cdr p))))))))\");\r\n\r\n // Function from Figure 4.3 (on page 121)\r\n Evaluate(@\"\r\n(set mk-toplvl-rw-fn\r\n (lambda (rule)\r\n (lambda (e)\r\n (begin\r\n (set induced-subst (mk-subst-fun (car rule) e empty-subst))\r\n (if (= induced-subst 'nomatch) '()\r\n ((extend-to-pat induced-subst) (cadr rule)))))))\");\r\n\r\n // Functions from Figure 4.4 (on page 122)\r\n Evaluate(@\"\r\n(set apply-inside-exp\r\n (lambda (f)\r\n (lambda (e)\r\n (begin\r\n (set newe (f e))\r\n (if newe newe\r\n (if (atom? e) '()\r\n (begin\r\n (set newargs ((apply-inside-exp* f) (cdr e)))\r\n (if newargs (cons (car e) newargs) '()))))))))\");\r\n Evaluate(@\"\r\n(set apply-inside-exp*\r\n (lambda (f)\r\n (lambda (l)\r\n (if (null? l) '()\r\n (begin\r\n (set newfirstarg ((apply-inside-exp f) (car l)))\r\n (if newfirstarg\r\n (cons newfirstarg (cdr l))\r\n (begin\r\n (set newrestofargs ((apply-inside-exp* f) (cdr l)))\r\n (if newrestofargs\r\n (cons (car l) newrestofargs) '()))))))))\");\r\n Evaluate(\"(set mk-rw-fn (compose mk-toplvl-rw-fn apply-inside-exp))\");\r\n\r\n // Functions from Figure 4.4 (on page 122)\r\n Evaluate(\"(set failure (lambda (e) '()))\");\r\n Evaluate(@\"\r\n(set compose-rewrites (lambda (f g)\r\n (lambda (x)\r\n ((lambda (fx) (if fx fx (g x))) (f x)))))\");\r\n Evaluate(\"(set mk-rw-fn* (combine mk-rw-fn compose-rewrites failure))\");\r\n Evaluate(@\"\r\n(set repeat-fn\r\n (lambda (f)\r\n (lambda (e)\r\n (begin\r\n (set tmp (f e))\r\n (if tmp ((repeat-fn f) tmp) e)))))\");\r\n Evaluate(\"(set compile-trs (compose mk-rw-fn* repeat-fn))\");\r\n\r\n // Differentiation: from page 116\r\n Evaluate(@\"\r\n(set diff-rules '(\r\n ((Dx x) 1)\r\n ((Dx c) 0)\r\n ((Dx (+ X Y)) (+ (Dx X) (Dx Y)))\r\n ((Dx (- X Y)) (- (Dx X) (Dx Y)))\r\n ((Dx (* X Y)) (+ (* Y (Dx X)) (* X (Dx Y))))\r\n ((Dx (/ X Y)) (/ (- (* Y (Dx X)) (* X (Dx Y))) (* Y Y)))))\");\r\n Evaluate(\"(set differentiate (compile-trs diff-rules))\");\r\n }\r\n\r\n [Test]\r\n public void TermRewritingSystemsTest() // See section 4.4 on pages 116-122\r\n {\r\n DefineTermRewritingSystem();\r\n\r\n Assert.AreEqual(\"(+ 1 0)\", Evaluate(\"(differentiate '(Dx (+ x c)))\"));\r\n }\r\n\r\n [Test]\r\n public void Exercise1Test() // Exercise 1 on pages 148-149.\r\n {\r\n // Exercise 1a) : cdr*\r\n Evaluate(\"(set cdr* (mapc cdr))\");\r\n Assert.AreEqual(\"((b c) (e) ())\", Evaluate(\"(cdr* '((a b c) (d e) (f)))\"));\r\n\r\n // Exercise 1b) : max*\r\n Evaluate(\"(set max (lambda (x y) (if (> x y) x y)))\");\r\n Evaluate(\"(set max* (combine id max 0))\");\r\n Assert.AreEqual(\"10\", Evaluate(\"(max* '(1 5 10 3 7 2 8))\"));\r\n\r\n // Exercise 1c) : append (although we will call it append2 here)\r\n Evaluate(\"(set append2 (lambda (l1 l2) ((combine id cons l2) l1)))\");\r\n Assert.AreEqual(\"(a b c d e f g)\", Evaluate(\"(append2 '(a b c) '(d e f g))\"));\r\n\r\n // Exercise 1d) : addtoend\r\n Evaluate(\"(set addtoend (lambda (x l) ((combine id cons (list x)) l)))\");\r\n Assert.AreEqual(\"(b c d a)\", Evaluate(\"(addtoend 'a '(b c d))\"));\r\n\r\n // Exercise 1e) : reverse (although we will call it reverse2 here)\r\n Evaluate(\"(set reverse2 (combine id addtoend '()))\");\r\n Assert.AreEqual(\"(g f e d c b a)\", Evaluate(\"(reverse2 '(a b c d e f g))\"));\r\n\r\n // Exercise 1f) : insertion-sort\r\n Evaluate(@\"\r\n(set insert (lambda (x l)\r\n (cond\r\n ((null? l) (list x))\r\n ((<= x (car l)) (cons x l))\r\n ('T (cons (car l) (insert x (cdr l)))))))\");\r\n Evaluate(\"(set insertion-sort (combine id insert '()))\");\r\n Assert.AreEqual(\"(1 2 3 4 5 6 7)\", Evaluate(\"(insertion-sort '(3 7 4 1 2 6 5))\"));\r\n\r\n // Exercise 1g) : mkpairsfn\r\n Evaluate(\"(set mkpairsfn (lambda (x) (mapc (lambda (l) (cons x l)))))\");\r\n Assert.AreEqual(\"((a) (a b c) (a d) (a (e f)))\",\r\n Evaluate(\"((mkpairsfn 'a) '(() (b c) (d) ((e f))))\"));\r\n }\r\n\r\n [Test]\r\n public void Exercise2Test() // Exercise 2 on page 149 : lex-order*\r\n {\r\n Evaluate(@\"\r\n(set lex-order* (lambda (cmp)\r\n (lambda (l1 l2)\r\n (cond\r\n ((null? l1) (not (null? l2)))\r\n ((null? l2) '())\r\n ((cmp (car l1) (car l2)) 'T)\r\n ((cmp (car l2) (car l1)) '())\r\n ('T ((lex-order* cmp) (cdr l1) (cdr l2)))))))\");\r\n Evaluate(\"(set alpha-order (lex-order* <))\");\r\n\r\n Assert.AreEqual(\"T\", Evaluate(\"(alpha-order '(4 15 7) '(4 15 7 5))\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(alpha-order '(4 15 7) '(4 15 6 6))\"));\r\n }\r\n\r\n [Test]\r\n public void Exercise3Test() // Exercise 3 on page 149 : Sets implemented using characteristic functions\r\n {\r\n Evaluate(\"(set nullset (lambda (x) '()))\");\r\n Evaluate(\"(set member? (lambda (x s) (s x)))\");\r\n // mk-set-ops : See pages 106-107\r\n Evaluate(@\"\r\n(set mk-set-ops (lambda (eqfun)\r\n (cons (lambda (x s) (if (member? x s) s (lambda (y) (or (eqfun x y) (member? y s))))) ; addelt\r\n '())))\");\r\n Evaluate(\"(set addelt (car (mk-set-ops =)))\");\r\n Evaluate(@\"\r\n(set union (lambda (s1 s2)\r\n (lambda (x) (or (member? x s1) (member? x s2)))))\");\r\n Evaluate(@\"\r\n(set inter (lambda (s1 s2)\r\n (lambda (x) (and (member? x s1) (member? x s2)))))\");\r\n Evaluate(@\"\r\n(set diff (lambda (s1 s2)\r\n (lambda (x) (and (member? x s1) (not (member? x s2))))))\");\r\n\r\n Evaluate(\"(set s1 (addelt 'a (addelt 'b nullset)))\");\r\n Assert.AreEqual(\"T\", Evaluate(\"(member? 'a s1)\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(member? 'b s1)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(member? 'c s1)\"));\r\n\r\n Evaluate(\"(set s2 (addelt 'b (addelt 'c nullset)))\");\r\n Evaluate(\"(set s3 (union s1 s2))\");\r\n Assert.AreEqual(\"T\", Evaluate(\"(member? 'a s3)\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(member? 'b s3)\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(member? 'c s3)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(member? 'd s3)\"));\r\n\r\n Evaluate(\"(set s4 (inter s1 s2))\");\r\n Assert.AreEqual(\"()\", Evaluate(\"(member? 'a s4)\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(member? 'b s4)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(member? 'c s4)\"));\r\n\r\n Evaluate(\"(set s5 (diff s1 s2))\");\r\n Assert.AreEqual(\"T\", Evaluate(\"(member? 'a s5)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(member? 'b s5)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(member? 'c s5)\"));\r\n }\r\n\r\n [Test]\r\n public void Exercise4Test() // Exercise 4 on page 149 : Optimizing gcd* and gcds (from pages 108-109)\r\n {\r\n // Part 1\r\n Evaluate(\"(set gcd* (lambda (l) (gcd*-aux l id)))\");\r\n Evaluate(@\"\r\n(set gcd*-aux (lambda (l f)\r\n (if (= (car l) 1) 1\r\n (if (null? (cdr l)) (f (car l))\r\n (gcd*-aux (cdr l)\r\n (lambda (n)\r\n (let ((gcd-value (gcd (car l) n)))\r\n (if (= gcd-value 1) 1 (f gcd-value)))))))))\");\r\n\r\n Assert.AreEqual(\"7\", Evaluate(\"(gcd* '(14 49 98))\"));\r\n Assert.AreEqual(\"1\", Evaluate(\"(gcd* '(3 5 7 9 11))\"));\r\n Assert.AreEqual(\"1\", Evaluate(\"(gcd* '(NotANumber 3 5))\")); // The gcd is calculated from the arguments from right to left.\r\n\r\n // Part 2\r\n Evaluate(\"(set gcds (lambda (s) (gcds-aux s id)))\");\r\n Evaluate(@\"\r\n(set gcds-aux (lambda (s f)\r\n (if (number? s) (if (= s 1) 1 (f s))\r\n (if (null? (cdr s))\r\n (gcds-aux (car s) f)\r\n (gcds-aux (car s)\r\n (lambda (n) (gcds-aux (cdr s)\r\n (lambda (p) \r\n (let ((gcd-value (gcd n p)))\r\n (if (= gcd-value 1) 1 (f (gcd n p))))))))))))\");\r\n\r\n Assert.AreEqual(\"7\", Evaluate(\"(gcds '((14 (49 98)) 56 ((84 105 21) 91 77)))\"));\r\n Assert.AreEqual(\"1\", Evaluate(\"(gcds '((3 5) 7 (9 11)))\"));\r\n //Assert.AreEqual(\"1\", Evaluate(\"(gcds '((NotANumber 3) 5))\")); // gcds only accepts S-expressions of numbers and pairs (lists), not symbols.\r\n }\r\n\r\n [Test]\r\n public void Exercise5aTest() // Exercise 5a on pages 150-151; TermRewritingSystems\r\n {\r\n DefineTermRewritingSystem();\r\n\r\n // Old code; from the text.\r\n //Evaluate(\"(set mk-rw-fn* (combine mk-rw-fn compose-rewrites failure))\");\r\n\r\n // New code.\r\n Evaluate(\"(set mk-toplvl-rw-fn* (combine mk-toplvl-rw-fn compose-rewrites failure))\"); // Apply any of the rules at the top level of an expression.\r\n Evaluate(\"(set mk-rw-fn* (compose mk-toplvl-rw-fn* apply-inside-exp))\"); // Extend the above to operate inside expressions.\r\n\r\n Assert.AreEqual(\"(+ 1 0)\", Evaluate(\"(differentiate '(Dx (+ x c)))\"));\r\n }\r\n\r\n [Test]\r\n public void Exercise5bTest() // Exercise 5b on pages 150-151; TermRewritingSystems; modifications to apply-inside-exp\r\n {\r\n DefineTermRewritingSystem();\r\n\r\n // The next two functions are new or rewritten.\r\n Evaluate(@\"\r\n(set apply-func\r\n (lambda (f)\r\n (lambda (x)\r\n (let ((result ((apply-inside-exp f) x)))\r\n (if result result x)))))\");\r\n Evaluate(@\"\r\n(set apply-inside-exp*\r\n (lambda (f)\r\n (lambda (l)\r\n (let ((result (mapcar (apply-func f) l)))\r\n (if (equal result l) '() result)))))\");\r\n\r\n Assert.AreEqual(\"(+ 1 0)\", Evaluate(\"(differentiate '(Dx (+ x c)))\"));\r\n }\r\n\r\n [Test]\r\n public void LetMacroTest() // Part of exercise 15 on page 152.\r\n {\r\n Evaluate(\"(set list-of-cars (lambda (l) (mapcar car l)))\");\r\n Evaluate(\"(set list-of-cadrs (lambda (l) (mapcar cadr l)))\");\r\n Evaluate(@\"\r\n(define-macro letm (declarations body)\r\n (cons\r\n (list 'lambda (list-of-cars declarations) body)\r\n (list-of-cadrs declarations)))\");\r\n Assert.AreEqual(\"(12 5)\", Evaluate(\"(letm ((m (* 3 4)) (n (+ 2 3))) (list m n))\"));\r\n }\r\n\r\n [Test]\r\n public void LetStarMacroTest() // Part of exercise 15 on page 152.\r\n {\r\n Evaluate(@\"\r\n(set build-expr\r\n (lambda (declarations body)\r\n (if (null? declarations) body\r\n (list\r\n (list 'lambda\r\n (list (car (car declarations)))\r\n (build-expr (cdr declarations) body))\r\n (cadr (car declarations))))))\");\r\n Evaluate(\"(define-macro let*m (declarations body) (build-expr declarations body))\");\r\n Assert.AreEqual(\"25\", Evaluate(\"(let*m ((x (+ 2 3)) (y (* x x))) y)\"));\r\n }\r\n\r\n [Test]\r\n public void LetRecMacroTest() // Part of exercise 15 on page 152.\r\n {\r\n Evaluate(@\"\r\n(set build-let-declaration\r\n (lambda (declaration)\r\n (list (car declaration) 0)))\");\r\n Evaluate(@\"\r\n(set build-set-statement\r\n (lambda (declaration)\r\n (cons 'set declaration)))\");\r\n Evaluate(@\"\r\n(define-macro letrecm (declarations body)\r\n (list 'let (mapcar build-let-declaration declarations)\r\n (cons 'begin\r\n (append\r\n (mapcar build-set-statement declarations)\r\n (list body)))))\");\r\n\r\n /*\r\n Assert.AreEqual(\"4\", Evaluate(@\"\r\n(letrecm\r\n ((countones (lambda (l)\r\n (if (null? l) 0\r\n (if (= (car l) 1) (+ 1 (countones (cdr l)))\r\n (countones (cdr l)))))))\r\n (countones (quote (1 2 3 1 0 1 1 5))))\"));\r\n */\r\n Assert.AreEqual(\"4\", Evaluate(@\"\r\n(letrecm\r\n ((countones (lambda (l)\r\n (if (null? l) 0\r\n (if (= (car l) 1) (+ 1 (countones (cdr l)))\r\n (countones (cdr l)))))))\r\n (countones '(1 2 3 1 0 1 1 5)))\"));\r\n }\r\n\r\n [Test]\r\n public void EvalInSchemeTest() // From section 4.5, on pages 123-124. Also part of exercise 17 on page 152.\r\n {\r\n globalInfo.LoadPreset(\"assoc\");\r\n globalInfo.LoadPreset(\"select\");\r\n\r\n Evaluate(\"(set caddr (lambda (l) (cadr (cdr l))))\");\r\n Evaluate(\"(set cadddr (lambda (l) (caddr (cdr l))))\");\r\n\r\n // Functions adapted from page 48\r\n Evaluate(@\"\r\n(set apply-binary-op (lambda (f x y)\r\n (cond\r\n ((= f 'cons) (cons x y))\r\n ((= f '+) (+ x y))\r\n ((= f '-) (- x y))\r\n ((= f '*) (* x y))\r\n ((= f '/) (/ x y))\r\n ((= f '<) (< x y))\r\n ((= f '>) (> x y))\r\n ((= f '=) (= x y))\r\n ('T 'binary-op-error!))))\");\r\n Evaluate(@\"\r\n(set apply-unary-op (lambda (f x)\r\n (cond\r\n ((= f 'car) (car x))\r\n ((= f 'cdr) (cdr x))\r\n ((= f 'number?) (number? x))\r\n ((= f 'list?) (list? x))\r\n ((= f 'symbol?) (symbol? x))\r\n ((= f 'null?) (null? x))\r\n ((= f 'closure?) (is-closure? x))\r\n ((= f 'primop?) (is-primop? x))\r\n ('T 'unary-op-error!)\r\n ; ('T f)\r\n)))\");\r\n\r\n // From page 123\r\n Evaluate(\"(set formals (lambda (lamexp) (cadr lamexp)))\");\r\n Evaluate(\"(set body (lambda (lamexp) (caddr lamexp)))\");\r\n Evaluate(\"(set funpart (lambda (clo) (cadr clo)))\");\r\n Evaluate(\"(set envpart (lambda (clo) (caddr clo)))\");\r\n\r\n // begin\r\n Evaluate(@\"\r\n(set do-begin (lambda (expr-list rho)\r\n (if (null? (cdr expr-list))\r\n (eval (car expr-list) rho)\r\n (begin\r\n (eval (car expr-list) rho)\r\n (do-begin (cdr expr-list) rho)))))\");\r\n // let\r\n Evaluate(\"(set construct-let-var-list (mapc car))\");\r\n Evaluate(\"(set construct-let-expr-list (mapc cadr))\");\r\n Evaluate(@\"\r\n(set do-let (lambda (var-expr-list expr rho)\r\n (eval\r\n (cons\r\n (list 'lambda (construct-let-var-list var-expr-list) expr)\r\n (construct-let-expr-list var-expr-list))\r\n rho)))\");\r\n // let*\r\n Evaluate(@\"\r\n(set construct-let* (lambda (var-expr-list expr)\r\n (if (null? var-expr-list) expr\r\n (list\r\n (list\r\n 'lambda\r\n (list (caar var-expr-list))\r\n (construct-let* (cdr var-expr-list) expr))\r\n (cadar var-expr-list)))))\");\r\n Evaluate(@\"\r\n(set do-let* (lambda (var-expr-list expr rho)\r\n (eval (construct-let* var-expr-list expr) rho)))\");\r\n // letrec\r\n Evaluate(@\"\r\n(set construct-letrec-let-body (lambda (var-expr-list)\r\n (if (null? var-expr-list) '()\r\n (cons\r\n (list (caar var-expr-list) 0)\r\n (construct-letrec-let-body (cdr var-expr-list))))))\");\r\n Evaluate(@\"\r\n(set construct-letrec-begin-body (lambda (var-expr-list expr)\r\n (if (null? var-expr-list) (list expr)\r\n (cons\r\n (cons 'set (car var-expr-list))\r\n (construct-letrec-begin-body (cdr var-expr-list) expr)))))\");\r\n Evaluate(@\"\r\n(set construct-letrec (lambda (var-expr-list expr)\r\n (list 'let (construct-letrec-let-body var-expr-list)\r\n (cons 'begin (construct-letrec-begin-body var-expr-list expr)))))\");\r\n Evaluate(@\"\r\n(set do-letrec (lambda (var-expr-list expr rho)\r\n (eval (construct-letrec var-expr-list expr) rho)))\");\r\n // cond\r\n Evaluate(@\"\r\n(set do-cond (lambda (expr-pair-list rho)\r\n (if (null? expr-pair-list) '()\r\n (if (eval (caar expr-pair-list) rho)\r\n (eval (cadar expr-pair-list) rho)\r\n (do-cond (cdr expr-pair-list) rho)))))\");\r\n\r\n // Functions from Figure 4.6 on page 124\r\n Evaluate(@\"\r\n(set eval (lambda (expr env)\r\n (cond\r\n ((number? expr) expr)\r\n ((symbol? expr)\r\n (if (assoc-contains-key expr env)\r\n (assoc expr env)\r\n (assoc expr global-environment)))\r\n ((= (car expr) 'quote) (cadr expr))\r\n ((= (car expr) 'if)\r\n (if (null? (eval (cadr expr) env))\r\n (eval (cadddr expr) env)\r\n (eval (caddr expr) env)))\r\n ((= (car expr) 'begin) (do-begin (cdr expr) env)) ; Exercise 6a) on page 61\r\n ((= (car expr) 'print) ; Exercise 6a) on page 61\r\n (print (eval (cadr expr) env)))\r\n ((= (car expr) 'set)\r\n (let ((evaluated-expression (eval (caddr expr) env)))\r\n (if (assoc-contains-key (cadr expr) env)\r\n (begin\r\n (rplac-assoc (cadr expr) evaluated-expression env)\r\n evaluated-expression)\r\n (begin\r\n (set global-environment (mkassoc (cadr expr) evaluated-expression global-environment))\r\n evaluated-expression))))\r\n ((= (car expr) 'let) (do-let (cadr expr) (caddr expr) env))\r\n ((= (car expr) 'let*) (do-let* (cadr expr) (caddr expr) env))\r\n ((= (car expr) 'letrec) (do-letrec (cadr expr) (caddr expr) env))\r\n ((= (car expr) 'cond) (do-cond (cdr expr) env))\r\n ((= (car expr) 'lambda) (list 'closure expr env))\r\n ((= (car expr) 'list) (evallist (cdr expr) env))\r\n ('T (apply (evallist expr env) env))\r\n)))\");\r\n Evaluate(@\"\r\n(set evallist (lambda (el rho)\r\n (if (null? el) '()\r\n (cons\r\n (eval (car el) rho)\r\n (evallist (cdr el) rho)))))\");\r\n Evaluate(@\"\r\n(set mkassoc* (lambda (keys values al)\r\n (if (null? keys) al\r\n (mkassoc* (cdr keys) (cdr values)\r\n (mkassoc (car keys) (car values) al)))))\");\r\n Evaluate(@\"\r\n(set apply (lambda (el env)\r\n (if (is-closure? (car el))\r\n (apply-closure (car el) (cdr el))\r\n (apply-value-op (car el) (cdr el)))))\");\r\n Evaluate(@\"\r\n(set apply-closure (lambda (clo args)\r\n (eval (body (funpart clo))\r\n (mkassoc* (formals (funpart clo)) args (envpart clo)))))\");\r\n Evaluate(@\"\r\n(set apply-value-op (lambda (primop args)\r\n (if (= (length args) 1)\r\n (apply-unary-op (cadr primop) (car args))\r\n (apply-binary-op (cadr primop) (car args) (cadr args)))))\");\r\n Evaluate(\"(set is-closure? (lambda (f) (= (car f) 'closure)))\");\r\n Evaluate(\"(set is-primop? (lambda (f) (= (car f) 'primop)))\");\r\n Evaluate(@\"\r\n(set valueops '(\r\n (+ (primop +))\r\n (- (primop -))\r\n (cons (primop cons))\r\n (* (primop *))\r\n (/ (primop /))\r\n (< (primop <))\r\n (> (primop >))\r\n (= (primop =))\r\n (cdr (primop cdr))\r\n (car (primop car))\r\n (number? (primop number?))\r\n (list? (primop list?))\r\n (symbol? (primop symbol?))\r\n (null? (primop null?))\r\n (closure? (primop closure?))\r\n (primop? (primop primop?))))\");\r\n\r\n // Functions adapted from Figure 2.8\r\n Evaluate(@\"\r\n(set r-e-p-loop (lambda (inputs)\r\n (begin\r\n (set global-environment '())\r\n (r-e-p-loop* inputs))))\");\r\n Evaluate(@\"\r\n(set r-e-p-loop* (lambda (inputs)\r\n (if (null? inputs) '()\r\n (process-expr (car inputs) (cdr inputs)))))\");\r\n Evaluate(@\"\r\n(set process-expr (lambda (e inputs)\r\n (cons (eval e valueops) ; print value of expression\r\n (r-e-p-loop* inputs))))\");\r\n\r\n Assert.AreEqual(\"5\", Evaluate(\"(eval '(+ 2 3) valueops)\"));\r\n\r\n // Test from page 123\r\n Evaluate(\"(set E (mkassoc 'double (eval '(lambda (a) (+ a a)) valueops) valueops))\");\r\n Assert.AreEqual(\"8\", Evaluate(\"(eval '(double 4) E)\"));\r\n\r\n // select test\r\n Assert.AreEqual(\"(12 16 18)\", Evaluate(\"(select '(1 3 4) '(10 12 14 16 18 20))\"));\r\n\r\n // Test of \"set\" to ensure that we have completed the exercise.\r\n Assert.AreEqual(\"(8 () T)\", Evaluate(@\"\r\n(select '(1 2 3) (r-e-p-loop '( ; We use 'select' because we don't want to test the value of the closure 'double'.\r\n (set double (lambda (a) (+ a a)))\r\n (double 4)\r\n (primop? double)\r\n (closure? double)\r\n)))\"));\r\n\r\n // letrec test: from Kamin page 126.\r\n /*\r\n Assert.AreEqual(\"(4)\", Evaluate(@\"\r\n(r-e-p-loop '(\r\n (letrec ; Try a letrec wth two bindings\r\n (\r\n (countzeroes (lambda (l)\r\n (if (null? l) 0\r\n (if (= (car l) 0) (+ 1 (countzeroes (cdr l)))\r\n (countzeroes (cdr l))))))\r\n (countones (lambda (l)\r\n (if (null? l) 0\r\n (if (= (car l) 1) (+ 1 (countones (cdr l)))\r\n (countones (cdr l))))))\r\n )\r\n (countones (quote (1 2 3 1 0 1 1 5))))\r\n))\"));\r\n */\r\n Assert.AreEqual(\"(4)\", Evaluate(@\"\r\n(r-e-p-loop (list\r\n (list 'letrec ; Try a letrec wth two bindings\r\n '(\r\n (countzeroes (lambda (l)\r\n (if (null? l) 0\r\n (if (= (car l) 0) (+ 1 (countzeroes (cdr l)))\r\n (countzeroes (cdr l))))))\r\n (countones (lambda (l)\r\n (if (null? l) 0\r\n (if (= (car l) 1) (+ 1 (countones (cdr l)))\r\n (countones (cdr l))))))\r\n )\r\n (list 'countones (list 'quote '(1 2 3 1 0 1 1 5))))\r\n))\"));\r\n\r\n // Test of letrec (see exercise 6 on page 150)\r\n#if DEAD_CODE\r\n Assert.AreEqual(\"(15 120 54)\", Evaluate(@\"\r\n(select '(1 2 3) (r-e-p-loop '(\r\n (set eval-ex6 (lambda (e)\r\n (letrec\r\n ((combine (lambda (f sum zero) (lambda (l) (if (null? l) zero (sum (f (car l)) ((combine f sum zero) (cdr l)))))))\r\n (id (lambda (x) x))\r\n (+/ (combine id + 0))\r\n (*/ (combine id * 1))\r\n (ev (lambda (expr)\r\n (if (number? expr) expr\r\n (if (= (car expr) (quote +))\r\n (+/ (evlis (cdr expr)))\r\n (*/ (evlis (cdr expr)))))))\r\n (mapcar (lambda (f l) (if (null? l) l (cons (f (car l)) (mapcar f (cdr l))))))\r\n (curry (lambda (f) (lambda (x) (lambda (y) (f x y)))))\r\n (mapc (curry mapcar))\r\n (evlis (mapc ev))\r\n )\r\n (ev e))))\r\n (eval-ex6 (quote (+ 1 2 3 4 5)))\r\n (eval-ex6 (quote (* 1 2 3 4 5)))\r\n (eval-ex6 (quote (* (+ 1 2 3) (+ 4 5))))\r\n)))\"));\r\n#else\r\n Assert.AreEqual(\"(15 120 54)\", Evaluate(@\"\r\n(select '(1 2 3) (r-e-p-loop (list\r\n (list 'set 'eval-ex6 (list 'lambda '(e)\r\n (list 'letrec\r\n (list\r\n '(combine (lambda (f sum zero) (lambda (l) (if (null? l) zero (sum (f (car l)) ((combine f sum zero) (cdr l)))))))\r\n '(id (lambda (x) x))\r\n '(+/ (combine id + 0))\r\n '(*/ (combine id * 1))\r\n (list 'ev (list 'lambda '(expr)\r\n (list 'if '(number? expr) 'expr\r\n (list 'if (list '= '(car expr) (list 'quote '+))\r\n '(+/ (evlis (cdr expr)))\r\n '(*/ (evlis (cdr expr)))))))\r\n '(mapcar (lambda (f l) (if (null? l) l (cons (f (car l)) (mapcar f (cdr l))))))\r\n '(curry (lambda (f) (lambda (x) (lambda (y) (f x y)))))\r\n '(mapc (curry mapcar))\r\n '(evlis (mapc ev))\r\n )\r\n '(ev e))))\r\n (list 'eval-ex6 (list 'quote '(+ 1 2 3 4 5)))\r\n (list 'eval-ex6 (list 'quote '(* 1 2 3 4 5)))\r\n (list 'eval-ex6 (list 'quote '(* (+ 1 2 3) (+ 4 5))))\r\n)))\"));\r\n#endif\r\n\r\n\r\n // Note: If you get an error saying that car's argument is null, it is probably because you forgot to declare something\r\n // (e.g. a function like id or mapc).\r\n\r\n // \"list\" tests.\r\n Assert.AreEqual(\"((2 3 5 7) (1 2 3 5))\", Evaluate(@\"\r\n(r-e-p-loop '(\r\n (list 2 3 5 7)\r\n (list (+ 0 1) (+ 1 1) (+ 1 2) (+ 2 3))\r\n))\"));\r\n\r\n // Test of the \"set\" implementation that uses rplac-assoc.\r\n Assert.AreEqual(\"(14)\", Evaluate(@\"\r\n(select '(1) (r-e-p-loop '(\r\n (set f (lambda (n)\r\n (let ((g (lambda ()\r\n (begin\r\n (set n (+ n 1))\r\n 0))))\r\n (begin\r\n (g)\r\n n))))\r\n (f 13)\r\n)))\"));\r\n\r\n // Test of the \"let\" implementation that uses lambda.\r\n Assert.AreEqual(\"(60)\", Evaluate(@\"\r\n(r-e-p-loop '(\r\n (let ((a 2) (b 3) (c 5) (d (+ 3 4)))\r\n (* (+ a b) (+ c d)))\r\n))\"));\r\n\r\n // Test of the \"let*\" implementation that uses nested lambda expressions.\r\n Assert.AreEqual(\"(24)\", Evaluate(@\"\r\n(r-e-p-loop '(\r\n (let* ((a 1) (b (* a 2)) (c (* b 3)) (d (* c 4)))\r\n d)\r\n))\"));\r\n }\r\n\r\n [Test]\r\n public void APLEvalTest()\r\n {\r\n globalInfo.LoadPreset(\"assoc\");\r\n globalInfo.LoadPreset(\"select\");\r\n globalInfo.LoadPreset(\"flatten\");\r\n //globalInfo.LoadPreset(\"compose\");\r\n\r\n Evaluate(\"(set cddr (compose cdr cdr))\");\r\n Evaluate(\"(set caddr (compose cdr cadr))\");\r\n Evaluate(\"(set cadddr (compose cdr caddr))\");\r\n\r\n Evaluate(@\"\r\n(set get-type (lambda (x)\r\n (cond\r\n ((number? x) 'scalar)\r\n ((null? x) 'vector)\r\n ((number? (car x)) 'vector)\r\n ('T 'matrix))))\");\r\n Evaluate(\"(set s1 7)\");\r\n Evaluate(\"(set v1 '(2 3 5 7))\");\r\n Evaluate(\"(set m1 '((3 4) 1 2 3 4 5 6 7 8 9 10 11 12))\");\r\n\r\n Assert.AreEqual(\"scalar\", Evaluate(\"(get-type s1)\"));\r\n Assert.AreEqual(\"vector\", Evaluate(\"(get-type '())\"));\r\n Assert.AreEqual(\"vector\", Evaluate(\"(get-type v1)\"));\r\n Assert.AreEqual(\"matrix\", Evaluate(\"(get-type m1)\"));\r\n\r\n Evaluate(@\"\r\n(set shape (lambda (x)\r\n (let ((type (get-type x)))\r\n (cond\r\n ((= type 'scalar) '())\r\n ((= type 'vector) (list (length x)))\r\n ('T (car x))))))\");\r\n\r\n Assert.AreEqual(\"()\", Evaluate(\"(shape s1)\"));\r\n Assert.AreEqual(\"(4)\", Evaluate(\"(shape v1)\"));\r\n Assert.AreEqual(\"(3 4)\", Evaluate(\"(shape m1)\"));\r\n\r\n Evaluate(@\"\r\n(set to-vector (lambda (x)\r\n (let ((type (get-type x)))\r\n (cond\r\n ((= type 'scalar) (list x))\r\n ((= type 'vector) x)\r\n ('T (cdr x))))))\");\r\n\r\n Assert.AreEqual(\"(7)\", Evaluate(\"(to-vector s1)\"));\r\n Assert.AreEqual(\"(2 3 5 7)\", Evaluate(\"(to-vector v1)\"));\r\n Assert.AreEqual(\"(1 2 3 4 5 6 7 8 9 10 11 12)\", Evaluate(\"(to-vector m1)\"));\r\n\r\n Evaluate(@\"\r\n(set get-first-scalar (lambda (x)\r\n (let ((type (get-type x)))\r\n (cond\r\n ((= type 'scalar) x)\r\n ((= type 'vector) (car x))\r\n ('T (cadr x))))))\");\r\n Assert.AreEqual(\"7\", Evaluate(\"(get-first-scalar 7)\"));\r\n Assert.AreEqual(\"13\", Evaluate(\"(get-first-scalar '(13 14 15))\"));\r\n Assert.AreEqual(\"9\", Evaluate(\"(get-first-scalar '((2 2) 9 3 5 7))\"));\r\n\r\n Evaluate(\"(set +/ (combine id + 0))\");\r\n Evaluate(\"(set -/ (combine id - 0))\");\r\n Evaluate(\"(set */ (combine id * 1))\");\r\n Evaluate(\"(set // (combine id / 1))\");\r\n Evaluate(\"(set to-scalar-if-possible (lambda (x) (if (= (*/ (shape x)) 1) (get-first-scalar x) x)))\");\r\n Assert.AreEqual(\"13\", Evaluate(\"(to-scalar-if-possible 13)\"));\r\n Assert.AreEqual(\"7\", Evaluate(\"(to-scalar-if-possible '(7))\"));\r\n Assert.AreEqual(\"(8 9)\", Evaluate(\"(to-scalar-if-possible '(8 9))\"));\r\n Assert.AreEqual(\"20\", Evaluate(\"(to-scalar-if-possible '((1 1) 20))\"));\r\n Assert.AreEqual(\"((2 2) 1 0 0 1)\", Evaluate(\"(to-scalar-if-possible '((2 2) 1 0 0 1))\"));\r\n\r\n Evaluate(@\"\r\n(set get-matrix-rows (lambda (m)\r\n (letrec ((get-matrix-rows* (lambda (r c l)\r\n (if (= r 0) '()\r\n (cons (take c l) (get-matrix-rows* (- r 1) c (skip c l)))))))\r\n (get-matrix-rows* (caar m) (cadar m) (cdr m)))))\");\r\n\r\n Assert.AreEqual(\"((1 2 3 4) (5 6 7 8) (9 10 11 12))\", Evaluate(\"(get-matrix-rows m1)\"));\r\n\r\n Evaluate(\"(set max-of-pair (lambda (x y) (if (> x y) x y)))\");\r\n Evaluate(\"(set max/ (lambda (l) ((combine id max-of-pair (car l)) (cdr l))))\");\r\n Evaluate(\"(set apl-and (lambda (x y) (if (and (<> x 0) (<> y 0)) 1 0)))\");\r\n Evaluate(\"(set apl-or (lambda (x y) (if (or (<> x 0) (<> y 0)) 1 0)))\");\r\n Evaluate(\"(set and/ (combine id apl-and 1))\");\r\n Evaluate(\"(set or/ (combine id apl-or 0))\");\r\n Evaluate(@\"\r\n(set m-to-n (lambda (m n)\r\n (if (> m n) '()\r\n (cons m (m-to-n (+1 m) n)))))\");\r\n Evaluate(@\"\r\n(set repeat (lambda (n l)\r\n (letrec ((repeat* (lambda (n l l-original)\r\n (cond\r\n ((= n 0) '())\r\n ((null? l) (repeat* n l-original l-original))\r\n ('T (cons (car l) (repeat* (- n 1) (cdr l) l-original)))))))\r\n (repeat* n l l))))\");\r\n Evaluate(@\"\r\n(set restruct (lambda (desired-shape src-data)\r\n (let* ((length-of-desired-shape (length desired-shape))\r\n (src-vector (to-vector src-data))\r\n (dst-vector (repeat (*/ desired-shape) src-vector)))\r\n (cond\r\n ((= length-of-desired-shape 0) 'restruct-to-scalar-error)\r\n ((= length-of-desired-shape 1) dst-vector)\r\n ('T (cons desired-shape dst-vector))))))\");\r\n Evaluate(@\"\r\n(set trans (lambda (matrix)\r\n (letrec ((get-column (lambda (n l) (mapcar ((curry nth) n) l)))\r\n (get-data (lambda (n num-cols l)\r\n (if (< n num-cols)\r\n (append (get-column n l) (get-data (+1 n) num-cols l))\r\n '())))\r\n (new-shape (list (cadar matrix) (caar matrix))))\r\n (cons new-shape (get-data 0 (cadar matrix) (get-matrix-rows matrix))))))\");\r\n Evaluate(@\"\r\n(set [] (lambda (x y)\r\n (let ((type-of-x (get-type x))\r\n (type-of-y (get-type y))\r\n (vector-y (to-vector y))\r\n (nth*-reversed-args (lambda (l n) (nth (- n 1) l))))\r\n (cond\r\n ((= type-of-x 'scalar) '[]-x-scalar-error)\r\n ((= type-of-y 'matrix) '[]-x-matrix-error)\r\n ((= type-of-x 'vector) (mapcar ((curry nth*-reversed-args) x) vector-y))\r\n ('T (restruct\r\n (list (length vector-y) (cadar x))\r\n (flatten (mapcar ((curry nth*-reversed-args) (get-matrix-rows x)) vector-y))))))))\");\r\n // Binary operators to implement:\r\n // - compress\r\n Evaluate(@\"\r\n(set compress (lambda (x y)\r\n (letrec ((type-of-x (get-type x))\r\n (type-of-y (get-type y))\r\n (is-logical (lambda (v)\r\n (if (null? v) 'T\r\n (if (or (= (car v) 0) (= (car v) 1))\r\n (is-logical (cdr v))\r\n '()))))\r\n (compress* (lambda (logv l)\r\n (if (or (null? logv) (null? l)) '()\r\n (if (= (car logv) 0)\r\n (compress* (cdr logv) (cdr l))\r\n (cons (car l) (compress* (cdr logv) (cdr l))))))))\r\n (cond\r\n ((<> type-of-x 'vector) 'compress-x-not-vector-error)\r\n ((not (is-logical x)) 'compress-vector-not-logical-error)\r\n ((= type-of-y 'scalar) 'compress-y-scalar-error)\r\n ((= type-of-y 'vector) (compress* x y))\r\n ('T (restruct\r\n (list (+/ x) (cadar y))\r\n (flatten (compress* x (get-matrix-rows y)))))))))\");\r\n Evaluate(@\"\r\n(set apply-binary-op (lambda (f x y)\r\n (letrec ((combine2 (lambda (f l1 l2)\r\n (if (or (null? l1) (null? l2)) '()\r\n (cons (f (car l1) (car l2)) (combine2 f (cdr l1) (cdr l2))))))\r\n (apply-scalar-scalar (lambda (f x y) (f x y)))\r\n (apply-scalar-vector (lambda (f x y) (mapcar (lambda (z) (f x z)) y)))\r\n (apply-scalar-matrix (lambda (f x y) (cons (car y) (mapcar (lambda (z) (f x z)) (cdr y)))))\r\n (apply-vector-scalar (lambda (f x y) (mapcar (lambda (z) (f z y)) x)))\r\n (apply-vector-vector (lambda (f x y)\r\n (if (= (length x) (length y))\r\n (combine2 f x y)\r\n 'binary-op-vector-shape-mismatch)))\r\n (apply-matrix-scalar (lambda (f x y) (cons (car x) (mapcar (lambda (z) (f z y)) (cdr x)))))\r\n (apply-matrix-matrix (lambda (f x y)\r\n (if (equal (car x) (car y))\r\n (cons (car x) (combine2 f (cdr x) (cdr y)))\r\n 'binary-op-matrix-shape-mismatch)))\r\n (apply-binary-op* (lambda (f x y)\r\n (begin\r\n (set x (to-scalar-if-possible x))\r\n (set y (to-scalar-if-possible y))\r\n (let ((type-of-x (get-type x))\r\n (type-of-y (get-type y)))\r\n (cond\r\n ((= type-of-x 'scalar)\r\n (cond\r\n ((= type-of-y 'scalar) (apply-scalar-scalar f x y))\r\n ((= type-of-y 'vector) (apply-scalar-vector f x y))\r\n ('T (apply-scalar-matrix f x y))))\r\n ((= type-of-x 'vector)\r\n (cond\r\n ((= type-of-y 'scalar) (apply-vector-scalar f x y))\r\n ((= type-of-y 'vector) (apply-vector-vector f x y))\r\n ('T 'binary-op-vector-matrix-error)))\r\n ((= type-of-x 'matrix)\r\n (cond\r\n ((= type-of-y 'scalar) (apply-matrix-scalar f x y))\r\n ((= type-of-y 'vector) 'binary-op-matrix-vector-error)\r\n ('T (apply-matrix-matrix f x y)))))))))\r\n (apl< (lambda (x y) (if (< x y) 1 0)))\r\n (apl> (lambda (x y) (if (> x y) 1 0)))\r\n (apl= (lambda (x y) (if (= x y) 1 0))))\r\n (cond\r\n ((= f '+) (apply-binary-op* + x y))\r\n ((= f '-) (apply-binary-op* - x y))\r\n ((= f '*) (apply-binary-op* * x y))\r\n ((= f '/) (apply-binary-op* / x y))\r\n ((= f '<) (apply-binary-op* apl< x y))\r\n ((= f '>) (apply-binary-op* apl> x y))\r\n ((= f '=) (apply-binary-op* apl= x y))\r\n ((= f 'max) (apply-binary-op* max-of-pair x y))\r\n ((= f 'and) (apply-binary-op* apl-and x y))\r\n ((= f 'or) (apply-binary-op* apl-or x y))\r\n ((= f 'restruct) (restruct x y))\r\n ((= f 'cat) (append (to-vector x) (to-vector y)))\r\n ((= f '[]) ([] x y))\r\n ((= f 'compress) (compress x y))\r\n ('T 'binary-op-error!)\r\n))))\");\r\n Evaluate(@\"\r\n(set apply-unary-op (lambda (f x)\r\n (let* ((type-of-x (get-type x))\r\n (apply-reduction-op (lambda (f x)\r\n (cond\r\n ((= type-of-x 'scalar) 'scalar-reduction-error)\r\n ((= type-of-x 'vector) (f x))\r\n ('T (mapcar f (get-matrix-rows x)))))))\r\n (cond\r\n ((= f '+/) (apply-reduction-op +/ x))\r\n ((= f '-/) (apply-reduction-op -/ x))\r\n ((= f '*/) (apply-reduction-op */ x))\r\n ((= f '//) (apply-reduction-op // x))\r\n ((= f 'max/) (apply-reduction-op max/ x))\r\n ((= f 'and/) (apply-reduction-op and/ x))\r\n ((= f 'or/) (apply-reduction-op or/ x))\r\n ((= f 'shape) (shape x))\r\n ((= f 'indx) (m-to-n 1 x))\r\n ((= f 'ravel) (to-vector x))\r\n ((= f 'trans) (trans x))\r\n ('T 'unary-op-error!)\r\n ; ('T f)\r\n))))\");\r\n\r\n // begin\r\n Evaluate(@\"\r\n(set do-begin (lambda (expr-list rho fundefs)\r\n (if (null? (cdr expr-list))\r\n (eval (car expr-list) rho fundefs)\r\n (begin\r\n (eval (car expr-list) rho fundefs)\r\n (do-begin (cdr expr-list) rho fundefs)))))\");\r\n\r\n Evaluate(@\"\r\n(set eval (lambda (expr rho fundefs)\r\n (cond\r\n ((number? expr) expr)\r\n ((symbol? expr)\r\n (if (assoc-contains-key expr rho)\r\n (assoc expr rho)\r\n (assoc expr global-environment)))\r\n ((= (car expr) 'quote) (cadr expr))\r\n ((= (car expr) 'if)\r\n (if (= 0 (get-first-scalar (eval (cadr expr) rho fundefs)))\r\n (eval (cadddr expr) rho fundefs)\r\n (eval (caddr expr) rho fundefs)))\r\n ((= (car expr) 'begin) (do-begin (cdr expr) rho fundefs)) ; Exercise 6a) on page 61\r\n ((= (car expr) 'print) ; Exercise 6a) on page 61\r\n (print (eval (cadr expr) rho fundefs)))\r\n ((= (car expr) 'set)\r\n (let ((evaluated-expression (eval (caddr expr) rho fundefs)))\r\n (if (assoc-contains-key (cadr expr) rho)\r\n (begin\r\n (rplac-assoc (cadr expr) evaluated-expression rho)\r\n evaluated-expression)\r\n (begin\r\n (set global-environment (mkassoc (cadr expr) evaluated-expression global-environment))\r\n evaluated-expression))))\r\n ((userfun? (car expr) fundefs)\r\n (apply-userfun\r\n (assoc (car expr) fundefs)\r\n (evallist (cdr expr) rho fundefs)\r\n fundefs))\r\n ((= (length expr) 2)\r\n (apply-unary-op (car expr) (eval (cadr expr) rho fundefs)))\r\n ('T (apply-binary-op (car expr)\r\n (eval (cadr expr) rho fundefs)\r\n (eval (caddr expr) rho fundefs))))))\");\r\n Evaluate(\"(set userfun? (lambda (f fundefs) (assoc-contains-key f fundefs)))\");\r\n Evaluate(@\"\r\nstring signingKey = \"-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"a4o4MBHVECFNwz7KjFPnBdsPeRpHOLNJAI6JVq18SKLCYEQRx92yzMs6lFGrc1Vj\\n\" +\n \"QScOMy7AhuqmkRNqU9YqTm6NXQz1QL/eksPh1gYh00lPytJbyOe61UyzYgWUt+lC\\n\" +\n \"FxMLDmQZrEGHSsbtD800\\n\" +\n \"-----END EC PRIVATE KEY-----\";\n(set apply-userfun (lambda (fundef args fundefs)\r\n (eval (cadr fundef) ; body of function\r\n (mkassoc* (car fundef) args '()) ; local env\r\n fundefs)))\");\r\n Evaluate(@\"\r\n(set evallist (lambda (el rho fundefs)\r\n (if (null? el) '()\r\n (cons (eval (car el) rho fundefs)\r\n (evallist (cdr el) rho fundefs)))))\");\r\n Evaluate(@\"\r\n(set mkassoc* (lambda (keys values al)\r\n (if (null? keys) al\r\n (mkassoc* (cdr keys) (cdr values)\r\n (mkassoc (car keys) (car values) al)))))\");\r\n\r\n Evaluate(@\"\r\n(set r-e-p-loop (lambda (inputs)\r\n (begin\r\n (set global-environment '())\r\n (r-e-p-loop* inputs '()))))\");\r\n Evaluate(@\"\r\n(set r-e-p-loop* (lambda (inputs fundefs)\r\n (cond\r\n ((null? inputs) '()) ; session done\r\n ((atom? (car inputs)) ; input is variable or number\r\n (process-expr (car inputs) (cdr inputs) fundefs))\r\n ((= (caar inputs) 'define) ; input is function definition\r\n (process-def (car inputs) (cdr inputs) fundefs))\r\n ('T (process-expr (car inputs) (cdr inputs) fundefs)))))\");\r\n Evaluate(@\"\r\n(set process-def (lambda (e inputs fundefs)\r\n (cons (cadr e) ; echo function name\r\n (r-e-p-loop* inputs\r\n (mkassoc (cadr e) (cddr e) fundefs)))))\");\r\n Evaluate(@\"\r\n(set process-expr (lambda (e inputs fundefs)\r\n (cons (eval e '() fundefs) ; print value of expression\r\n (r-e-p-loop* inputs fundefs))))\");\r\n\r\n // indx test\r\n Assert.AreEqual(\"((1 2 3 4 5 6 7 8))\", Evaluate(@\"\r\n(r-e-p-loop '(\r\n (indx 8)\r\n))\"));\r\n\r\n // max/ test\r\n /*\r\n Assert.AreEqual(\"(8 (10 9 12))\", Evaluate(@\"\r\n(r-e-p-loop '(\r\n (max/ (quote (2 4 6 8 1 3 5 7)))\r\n (max/ (quote ((3 4) 8 4 10 1 9 2 5 7 3 11 6 12)))\r\n))\"));\r\n */\r\n Assert.AreEqual(\"(8 (10 9 12))\", Evaluate(@\"\r\n(r-e-p-loop (list\r\n (list 'max/ (list 'quote '(2 4 6 8 1 3 5 7)))\r\n (list 'max/ (list 'quote '((3 4) 8 4 10 1 9 2 5 7 3 11 6 12)))\r\n))\"));\r\n\r\n // restruct test\r\n /*\r\n Assert.AreEqual(\"((8 9 8 9 8 9 8) ((4 4) 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1))\", Evaluate(@\"\r\n(r-e-p-loop '(\r\n (restruct (quote (7)) (quote (8 9)))\r\n (restruct (quote (4 4)) (quote (1 0 0 0 0)))\r\n))\"));\r\n */\r\n Assert.AreEqual(\"((8 9 8 9 8 9 8) ((4 4) 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1))\", Evaluate(@\"\r\n(r-e-p-loop (list\r\n (list 'restruct (list 'quote '(7)) (list 'quote '(8 9)))\r\n (list 'restruct (list 'quote '(4 4)) (list 'quote '(1 0 0 0 0)))\r\n))\"));\r\n\r\n // trans test\r\n /*\r\n Assert.AreEqual(\"(((4 3) 1 5 9 2 6 10 3 7 11 4 8 12))\", Evaluate(@\"\r\n(select '(1) (r-e-p-loop '(\r\n (set m1 (restruct (quote (3 4)) (indx 12)))\r\n (trans m1)\r\n)))\"));\r\n */\r\n Assert.AreEqual(\"(((4 3) 1 5 9 2 6 10 3 7 11 4 8 12))\", Evaluate(@\"\r\n(select '(1) (r-e-p-loop (list\r\n (list 'set 'm1 (list 'restruct (list 'quote '(3 4)) '(indx 12)))\r\n '(trans m1)\r\n)))\"));\r\n\r\n // [] test\r\n /*\r\n Assert.AreEqual(\"((5) (7 8 9 0) ((1 4) 5 6 7 8) ((2 4) 9 10 11 12 1 2 3 4))\", Evaluate(@\"\r\n(select '(2 3 4 5) (r-e-p-loop '(\r\n (set v1 (quote (8 6 7 5 3 0 9)))\r\n (set m1 (restruct (quote (3 4)) (indx 12)))\r\n ([] v1 4)\r\n ([] v1 (quote (3 1 7 6)))\r\n ([] m1 2)\r\n ([] m1 (quote (3 1)))\r\n)))\"));\r\n */\r\n Assert.AreEqual(\"((5) (7 8 9 0) ((1 4) 5 6 7 8) ((2 4) 9 10 11 12 1 2 3 4))\", Evaluate(@\"\r\n(select '(2 3 4 5) (r-e-p-loop (list\r\n (list 'set 'v1 (list 'quote '(8 6 7 5 3 0 9)))\r\n (list 'set 'm1 (list 'restruct (list 'quote '(3 4)) '(indx 12)))\r\n '([] v1 4)\r\n (list '[] 'v1 (list 'quote '(3 1 7 6)))\r\n '([] m1 2)\r\n (list '[] 'm1 (list 'quote '(3 1)))\r\n)))\"));\r\n\r\n // compress test\r\n /*\r\n Assert.AreEqual(\"((8 7 5 0) ((2 4) 5 6 7 8 13 14 15 16))\", Evaluate(@\"\r\n(select '(2 3) (r-e-p-loop '(\r\n (set v1 (quote (8 6 7 5 3 0 9)))\r\n (set m1 (restruct (quote (4 4)) (indx 16)))\r\n (compress (quote (1 0 1 1 0 1 0)) v1)\r\n (compress (quote (0 1 0 1)) m1)\r\n)))\"));\r\n */\r\n Assert.AreEqual(\"((8 7 5 0) ((2 4) 5 6 7 8 13 14 15 16))\", Evaluate(@\"\r\n(select '(2 3) (r-e-p-loop (list\r\n (list 'set 'v1 (list 'quote '(8 6 7 5 3 0 9)))\r\n (list 'set 'm1 (list 'restruct (list 'quote '(4 4)) '(indx 16)))\r\n (list 'compress (list 'quote '(1 0 1 1 0 1 0)) 'v1)\r\n (list 'compress (list 'quote '(0 1 0 1)) 'm1)\r\n)))\"));\r\n\r\n // primes<= test (see pages 74-75)\r\n Assert.AreEqual(\"(((4 7) 0 1 1 1 1 1 1 0 0 2 2 2 2 2 0 1 0 3 3 3 3 0 0 1 0 4 4 4) (2 3 5 7))\", Evaluate(@\"\r\n(select '(2 4) (r-e-p-loop '(\r\n (define mod (m n) (- m (* n (/ m n))))\r\n (define mod-outer-probe (v1 v2)\r\n (mod (trans (restruct (cat (shape v2) (shape v1)) v1))\r\n (restruct (cat (shape v1) (shape v2)) v2)))\r\n (mod-outer-probe (indx 4) (indx 7))\r\n ; Perhaps we could implement 'let', and then use (let ((s (indx n))) ...)\r\n (define primes<= (n) (compress (= 2 (+/ (= 0 (mod-outer-probe (set s (indx n)) s)))) s))\r\n (primes<= 7)\r\n)))\"));\r\n\r\n // +\\ (\"+-scan\") test (see page 74). This tests the \"if\" construct.\r\n /*\r\n Assert.AreEqual(\"(0)\", Evaluate(@\"\r\n(select '(0) (r-e-p-loop '(\r\n (= (shape (quote (1 3 5 7))) 0)\r\n)))\"));\r\n */\r\n Assert.AreEqual(\"(0)\", Evaluate(@\"\r\n(select '(0) (r-e-p-loop (list\r\n (list '= (list 'shape (list 'quote '(1 3 5 7))) 0)\r\n)))\"));\r\n /*\r\n Assert.AreEqual(\"(0)\", Evaluate(@\"\r\n(select '(1) (r-e-p-loop '(\r\n (define foo (v) (if (= (shape v) 0) 1 0))\r\n (foo (quote (1 3 5 7)))\r\n)))\"));\r\n */\r\n Assert.AreEqual(\"(0)\", Evaluate(@\"\r\n(select '(1) (r-e-p-loop (list\r\n '(define foo (v) (if (= (shape v) 0) 1 0))\r\n (list 'foo (list 'quote '(1 3 5 7)))\r\n)))\"));\r\n\r\n /*\r\n Assert.AreEqual(\"((1 4 9 16))\", Evaluate(@\"\r\n(select '(2) (r-e-p-loop '(\r\n (define dropend (v) ([] v (indx (- (shape v) 1))))\r\n (define +\\ (v)\r\n (if (= (shape v) 0) v\r\n (cat (+\\ (dropend v)) (+/ v))))\r\n (+\\ (quote (1 3 5 7)))\r\n)))\"));\r\n */\r\n Assert.AreEqual(\"((1 4 9 16))\", Evaluate(@\"\r\n(select '(2) (r-e-p-loop (list\r\n '(define dropend (v) ([] v (indx (- (shape v) 1))))\r\n '(define +\\ (v)\r\n (if (= (shape v) 0) v\r\n (cat (+\\ (dropend v)) (+/ v))))\r\n (list '+\\ (list 'quote '(1 3 5 7)))\r\n)))\"));\r\n }\r\n\r\n [Test]\r\n public void MacroApostrophesToQuoteKeywordsTest()\r\n {\r\n // Note that these expressions are parsed, but not evaluated.\r\n Assert.AreEqual(\"(lambda (foo) (quote bar))\", MacroDefinition.ObjectToString_ApostrophesToQuoteKeywords(GetParseResult(\"(lambda (foo) 'bar)\")));\r\n Assert.AreEqual(\"(foo (quote bar) (quote baz))\", MacroDefinition.ObjectToString_ApostrophesToQuoteKeywords(GetParseResult(\"(foo 'bar 'baz)\")));\r\n Assert.AreEqual(\"((lambda (foo) (quote bar)) (quote baz))\", MacroDefinition.ObjectToString_ApostrophesToQuoteKeywords(GetParseResult(\"((lambda (foo) 'bar) 'baz)\")));\r\n Assert.AreEqual(\"(letrec ((foo (quote bar))) (quote baz))\", MacroDefinition.ObjectToString_ApostrophesToQuoteKeywords(GetParseResult(\"(letrec ((foo 'bar)) 'baz)\")));\r\n Assert.AreEqual(\"(call/cc (lambda (foo) (foo (quote bar))))\", MacroDefinition.ObjectToString_ApostrophesToQuoteKeywords(GetParseResult(\"(call/cc (lambda (foo) (foo 'bar)))\")));\r\n }\r\n\r\n [Test]\r\n public void ComposeListTest() // 2013/11/30\r\n {\r\n Evaluate(\"(set compose-list (combine id compose id))\");\r\n Evaluate(\"(set cadaddr (compose-list (list cdr cdr car cdr car)))\");\r\n\r\n Assert.AreEqual(\"10\", Evaluate(\"(cadaddr '((1 2 3 4) (5 6 7 8) (9 10 11 12) (13 14 15 16)))\"));\r\n\r\n // 2013/12/02\r\n Evaluate(\"(set compose-list-reverse (combine id (reverse2args compose) id))\");\r\n Evaluate(\"(set cadaddr (compose-list-reverse (list car cdr car cdr cdr)))\"); // The functions are applied from right to left.\r\n\r\n Assert.AreEqual(\"10\", Evaluate(\"(cadaddr '((1 2 3 4) (5 6 7 8) (9 10 11 12) (13 14 15 16)))\"));\r\n\r\n Evaluate(\"(set sumplus3 (compose2args + (compose-list (list +1 +1 +1))))\");\r\n\r\n Assert.AreEqual(\"18\", Evaluate(\"(sumplus3 7 8)\"));\r\n }\r\n\r\n [Test]\r\n public void GeneralFindTest() // 2013/12/03\r\n {\r\n Evaluate(@\"\r\n(set general-find (lambda (pred result zero)\r\n (letrec \r\n ((loop\r\n (lambda (l)\r\n (cond\r\n ((null? l) zero)\r\n ((pred (car l)) (result (car l)))\r\n ('T (loop (cdr l)))\r\n )\r\n )\r\n ))\r\n loop\r\n )\r\n))\");\r\n Evaluate(@\"\r\n(set original-find (lambda (pred lis)\r\n (\r\n (general-find\r\n pred\r\n (lambda (x) 'T)\r\n '()\r\n )\r\n lis\r\n )\r\n))\");\r\n Evaluate(\"(set original-contains (lambda (x l) (original-find ((curry =) x) l)))\");\r\n\r\n Assert.AreEqual(\"T\", Evaluate(\"(original-contains 5 '(2 3 5 7))\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(original-contains 4 '(2 3 5 7))\"));\r\n\r\n Evaluate(@\"\r\n(set alist-alt (lambda (x alist)\r\n (\r\n (general-find\r\n (compose car ((curry =) x))\r\n cadr\r\n '()\r\n )\r\n alist\r\n )\r\n))\");\r\n Evaluate(\"(set sample-alist '((2 11) (3 13) (5 19) (7 19)))\");\r\n\r\n Assert.AreEqual(\"13\", Evaluate(\"(alist-alt 3 sample-alist)\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(alist-alt 4 sample-alist)\"));\r\n }\r\n\r\n [Test]\r\n public void SyntaxExceptionTest() // 2013/12/12\r\n {\r\n InferenceAssert.ThrowsWithLineAndColumnNumbers(() => Evaluate(\"(if 'T 7 13 'SyntaxError)\"), 1, 13);\r\n }\r\n\r\n [Test]\r\n public void EvaluationExceptionTest() // 2013/12/12\r\n {\r\n InferenceAssert.ThrowsWithLineAndColumnNumbers(() => Evaluate(\"(car 7)\"), 1, 2);\r\n }\r\n\r\n [Test]\r\n public void StringLessThanTest() // 2013/12/14\r\n {\r\n Assert.AreEqual(\"T\", Evaluate(\"(primop? string<)\"));\r\n\r\n Assert.AreEqual(\"()\", Evaluate(\"(string< \\\"a\\\" \\\"a\\\")\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(string< \\\"a\\\" \\\"b\\\")\"));\r\n Assert.AreEqual(\"()\", Evaluate(\"(string< \\\"b\\\" \\\"a\\\")\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(string< \\\"abac\\\" \\\"abacus\\\")\"));\r\n Assert.AreEqual(\"T\", Evaluate(\"(string< \\\"abacab\\\" \\\"abacus\\\")\"));\r\n }\r\n\r\n [Test]\r\n public void StringSortTest() // 2013/12/14\r\n {\r\n globalInfo.LoadPreset(\"sort\");\r\n\r\n // 1) Insertion sort.\r\n Assert.AreEqual(\"(a ab abacab abacus abbot abbreviate abcess baa)\",\r\n Evaluate(\"((insertion-sort string<) '(\\\"abbreviate\\\" \\\"abacab\\\" \\\"abbot\\\" \\\"a\\\" \\\"baa\\\" \\\"abcess\\\" \\\"ab\\\" \\\"abacus\\\"))\"));\r\n\r\n // 2) Quicksort.\r\n Assert.AreEqual(\"(a ab abacab abacus abbot abbreviate abcess baa)\",\r\n Evaluate(\"((quicksort string<) '(\\\"abbreviate\\\" \\\"abacab\\\" \\\"abbot\\\" \\\"a\\\" \\\"baa\\\" \\\"abcess\\\" \\\"ab\\\" \\\"abacus\\\"))\"));\r\n\r\n // 3) Merge sort.\r\n Assert.AreEqual(\"(a ab abacab abacus abbot abbreviate abcess baa)\",\r\n Evaluate(\"((merge-sort string<) '(\\\"abbreviate\\\" \\\"abacab\\\" \\\"abbot\\\" \\\"a\\\" \\\"baa\\\" \\\"abcess\\\" \\\"ab\\\" \\\"abacus\\\"))\"));\r\n }\r\n\r\n [Test]\r\n public void RepeatListTest() // 2014/02/15. This might be useful in \"restruct\" in our Scheme APL interpreter.\r\n {\r\n Evaluate(@\"\r\n(set repeat-list (lambda (n master)\r\n (letrec\r\n ((loop (lambda (n lm)\r\n (if (<= n lm)\r\n (take n master) ; Verify the order of take's args\r\n (append master (loop (- n lm) lm))\r\n )\r\n )))\r\n (loop n (length master))\r\n )\r\n))\");\r\n\r\n Assert.AreEqual(\"(2 3 5 7 2 3 5 7 2 3 5)\", Evaluate(\"(repeat-list 11 '(2 3 5 7))\"));\r\n }\r\n }\r\n}\r\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-26bf24744071f74b/e003", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"4lbPYt+TMQkcB27QMnsmRv2a7mD1Dkms22OzWpXd+L9h5cUpi/cx0gdcV2/ft27r\\n\" +\n \"uklphvaO0NUhcwS7c/xZdWVThQ8jVVbPSbvEdsKLkytZ4ZJjWlErefJ/WEaDxPWc\\n\" +\n \"KDbdAtqxkj1OvbT+J0HY\\n\" +\n \"-----END EC PRIVATE KEY-----", "start": 52913, "end": 53163, "value": "-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"a4o4MBHVECFNwz7KjFPnBdsPeRpHOLNJAI6JVq18SKLCYEQRx92yzMs6lFGrc1Vj\\n\" +\n \"QScOMy7AhuqmkRNqU9YqTm6NXQz1QL/eksPh1gYh00lPytJbyOe61UyzYgWUt+lC\\n\" +\n \"FxMLDmQZrEGHSsbtD800\\n\" +\n \"-----END EC PRIVATE KEY-----"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 6680, "end": 6712, "value": "acb895293185dfac885c7c50b8c6dae6"}], "cluster_id": "c-00000-26bf24744071f74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} {"id": "ghcc-00000-0e3034f9112b1585", "source": "codeparrot/github-code-clean", "repo": "KavaProject/KavaTouch", "license": "apache-2.0", "language": "Java", "path": "src/main/java/org/kavaproject/kavatouch/uikit/UIImage.java", "text": "/*\n * Copyright 2013 The Kava Project Developers. See the COPYRIGHT file at the top-level directory of this distribution\n * and at http://kavaproject.org/COPYRIGHT.\n *\n * Licensed under the Apache License, Version 2.0 or the\n * MIT license , at your option. This file may not be copied,\n * modified, or distributed except according to those terms.\n */\n\npackage org.kavaproject.kavatouch.uikit;\n\nimport org.kavaproject.kavatouch.coregraphics.*;\nimport org.kavaproject.kavatouch.foundation.Coding;\nimport org.kavaproject.kavatouch.internal.*;\nimport org.kavaproject.kavatouch.runtime.Creatable;\nimport org.kavaproject.kavatouch.runtime.SEL;\nimport org.kavaproject.kavatouch.uikit.staging.ProcessingImage;\n\nimport java.nio.ByteBuffer;\nimport java.util.List;\n\n@Header(\"UIImage\")\n@OccClass(\"UIImage\")\npublic interface UIImage extends Coding, Creatable {\n @OccInstanceMethod(\"imageWithAlignmentRectInsets:\")\n UIImage createImage(UIEdgeInsets alignmentInsets);\n\n @OccInstanceMethod(\"resizableImageWithCapInsets:\")\n UIImage resizableImage(UIEdgeInsets capInsets);\n\n @OccInstanceMethod(\"resizableImageWithCapInsets:resizingMode:\")\n UIImage resizableImage(UIEdgeInsets capInsets, UIImageResizingMode resizingMode);\n\n @OccInstanceMethod(\"stretchableImageWithLeftCapWidth:topCapHeight:\")\n @Deprecated\n UIImage stretchableImage(int leftCapWidth, int toCapWidth);\n\n @OccInstanceProperty(value = \"imageOrientation\")\n UIImageOrientation getImageOrientation();\n\n @OccInstanceProperty(value = \"scale\")\n float getScale();\n\n @OccInstanceProperty(value = \"resizingMode\")\n UIImageResizingMode getResizingMode();\n\n @OccInstanceProperty(value = \"CIImage\")\n ProcessingImage toProcessingImage();\n\n @OccInstanceProperty(value = \"images\")\n List getImages();\n\n @OccInstanceProperty(value = \"duration\")\n double getDuration();\n\n @OccInstanceProperty(value = \"capInsets\")\n UIEdgeInsets getCapInsets();\n\n @OccInstanceProperty(value = \"alignmentRectInsets\")\n UIEdgeInsets getAlignmentRectInsets();\n\n @OccInstanceProperty(value = \"leftCapWidth\")\n @Deprecated\n int getLeftCapWidth();\n\n @OccInstanceProperty(value = \"topCapHeight\")\n @Deprecated\n int getTopCapHeight();\n\n @OccInstanceMethod(\"drawAtPoint:\")\n void draw(GraphicsPoint point);\n\n @OccInstanceMethod(\"drawInRect:\")\n void draw(GraphicsRect rect);\n\n @OccInstanceProperty(value = \"CGImage\")\n GraphicsImage toGraphicsImage();\n\n @OccInstanceProperty(value = \"size\")\n GraphicsSize getSize();\n\n @OccInstanceMethod(\"drawAtPoint:blendMode:alpha:\")\n void draw(GraphicsPoint point, GraphicsBlendMode blendMode, float alpha);\n\n @OccInstanceMethod(\"drawInRect:blendMode:alpha:\")\n void draw(GraphicsRect rect, GraphicsBlendMode blendMode, float alpha);\n\n @OccInstanceMethod(\"drawAsPatternInRect:\")\n void drawAsPattern(GraphicsRect rect);\n\n @CFunction(value = \"UIImageJPEGRepresentation\", tokenGroup = \"UIKit\")\n ByteBuffer jpegRepresentation(float compressionQuality);\n\n @CFunction(value = \"UIImagePNGRepresentation\", tokenGroup = \"UIKit\")\n ByteBuffer pngRepresentation();\n\n @Header(\"UIImagePickerController\")\n @CFunction(value = \"UIImagePNGRepresentation\", tokenGroup = \"UIKit\")\n void writeToSavedPhotosAlbum(Object completionTarget, SEL completionSelector, Object contextInfo);\n\n @Override\n UIImageFactory getFactory();\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-18ff6f36d677e74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-18ff6f36d677e74b/e000", "entity_type": "person", "value_type": "person", "canonical": "Edhitha Trivedi", "forms": {"full_name": "Edhitha Trivedi", "first_name": "Edhitha", "last_name": "Trivedi", "username": "edhithat", "handle": "@edhithat", "email": "edhitha.trivedi@gmail.com"}, "replacement_canonical": "Christopher Sama", "replacement_forms": {"full_name": "Christopher Sama", "first_name": "Christopher", "last_name": "Sama", "username": "christophers", "handle": "@christophers", "email": "christopher.sama@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-18ff6f36d677e74b/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\n9YE8RSlOuer6CvgT1KCVDCHOTnRpoM/dDXsZftrXTEQOBqrRGUd8KpWewctlzxsl\n/ZMCdz2KFdJGRgikBK9tX0Co8yidwzECLmO5lghdFaWqbSWj6+0dfj2JI1UCBb0P\nEigNw461IsrJfB8rjal/2vCY6bMgxKwiQBASeM2Oj04XrFplGsP8CiJlqvVYovra\nZDNjkqhYmO5ScmmQLOAB81MFK+fal8r9FgEAMVBEvbwp9JGKqg795x2xAH+sTHhm\niVuExQS9S7rx5FYa+8AUsHhvTZ/dGH5dp96Uv8ho+WxYBJv3s47EPqy2RDeOgd+1\nkjR+3/ImiuEk2DST5chm6oT+1ISYXAf1iZkUFt9EuIAum7R02V1dWzQ7Akkm21VL\nQQZPfxzQwAEy1i0S8VldTxJ11CHzdu/JRuXyqsy38rFHjjwiRp34nx4FPpa33rkm\np+ReAuGbQbupDakFuElXscac1hl0x4SrOl0CPX2NZpMVuBDUJldYJaJU+VS+uMFQ\nhYP9fCRs0jLXQMKQ4dTkkvx//3vNyj5YJ9icYtZcAigJVgdofOfueI/Qi4cpP/Ep\nGTJKYux23mR2CbLrw5Vr3oj/1MJgh5qGU3CxEHRGL+KT7n7Hl+X0Gogx2rRqDaIx\ntEoDxnRjC6Sk/ppZAtONFNFfMiIKYJzklQAN4DQRQGeJzxVvJUneHssle54Ou8I/\n+lqUFdj2RBaJ2VTwBNhG145SzWxG/wkzLtocsl+cRTkvV/X12EGBu731IGVdT9pi\n8HDkYiMbay+71i7no05dfXi37wQY4oyp+1adPlXW7Rg/ClgJ688gKDbGZsuDC/FM\n01oGGq4XhoYo43F29rUYayd+ixNLKD3zZ6gX6jtQBDU3O7tfFZeLPkyjzABDRhfO\nkSZa5KxgxVoKM1/EjkDaUgnFn2769oWLAer4AIXCh7MIMdQQAy56sQXSXQ4Xf/Ph\niBVfWixzUEPFpk16rp2UQWKUMk0h0V3e/RsySfIBF2+WJHat06dA8wx9xxN/zTVD\n4veHmPjdlTmxXNwknSGNEEomZbvLMR+FifwCn69/Lq9o/LpAmPV2fX++nq08RyPV\n8SNMrD8MPEXGbDpnBfdSi8ENNdRrtgDEEGD1QMt7MMyJqIkb0HLTTHeJgLfvYMKg\nQ14vA6lz+MxbxTn3a9fXSfV0Ri3tjgkiUU7Er1xE+JmoA/iKqFlOmuJQSQLhQupi\n1Dg8MnDgX0DavvQEENruNXXoaIF/Ie6wqm9DjD0pyS/wR4BIrAMY7U8E7IOsKa7/\nJRhzmR3v8MGIH/oJKswKCOeBdNRSnHvpc+H+qworPmlVqBbnX+Gw3fXuAWmwL7F5\nWLapCZoJrPzWAjDyLoviCFCQ2g0rgiiNOFBe3azUIGywv/JG5fd/jpUSmjdxxZ33\nBMEipqXyJcdQHJErDTBxXR+WE7qb\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\n9YE8RSlOuer6CvgT1KCVDCHOTnRpoM/dDXsZftrXTEQOBqrRGUd8KpWewctlzxsl\n/ZMCdz2KFdJGRgikBK9tX0Co8yidwzECLmO5lghdFaWqbSWj6+0dfj2JI1UCBb0P\nEigNw461IsrJfB8rjal/2vCY6bMgxKwiQBASeM2Oj04XrFplGsP8CiJlqvVYovra\nZDNjkqhYmO5ScmmQLOAB81MFK+fal8r9FgEAMVBEvbwp9JGKqg795x2xAH+sTHhm\niVuExQS9S7rx5FYa+8AUsHhvTZ/dGH5dp96Uv8ho+WxYBJv3s47EPqy2RDeOgd+1\nkjR+3/ImiuEk2DST5chm6oT+1ISYXAf1iZkUFt9EuIAum7R02V1dWzQ7Akkm21VL\nQQZPfxzQwAEy1i0S8VldTxJ11CHzdu/JRuXyqsy38rFHjjwiRp34nx4FPpa33rkm\np+ReAuGbQbupDakFuElXscac1hl0x4SrOl0CPX2NZpMVuBDUJldYJaJU+VS+uMFQ\nhYP9fCRs0jLXQMKQ4dTkkvx//3vNyj5YJ9icYtZcAigJVgdofOfueI/Qi4cpP/Ep\nGTJKYux23mR2CbLrw5Vr3oj/1MJgh5qGU3CxEHRGL+KT7n7Hl+X0Gogx2rRqDaIx\ntEoDxnRjC6Sk/ppZAtONFNFfMiIKYJzklQAN4DQRQGeJzxVvJUneHssle54Ou8I/\n+lqUFdj2RBaJ2VTwBNhG145SzWxG/wkzLtocsl+cRTkvV/X12EGBu731IGVdT9pi\n8HDkYiMbay+71i7no05dfXi37wQY4oyp+1adPlXW7Rg/ClgJ688gKDbGZsuDC/FM\n01oGGq4XhoYo43F29rUYayd+ixNLKD3zZ6gX6jtQBDU3O7tfFZeLPkyjzABDRhfO\nkSZa5KxgxVoKM1/EjkDaUgnFn2769oWLAer4AIXCh7MIMdQQAy56sQXSXQ4Xf/Ph\niBVfWixzUEPFpk16rp2UQWKUMk0h0V3e/RsySfIBF2+WJHat06dA8wx9xxN/zTVD\n4veHmPjdlTmxXNwknSGNEEomZbvLMR+FifwCn69/Lq9o/LpAmPV2fX++nq08RyPV\n8SNMrD8MPEXGbDpnBfdSi8ENNdRrtgDEEGD1QMt7MMyJqIkb0HLTTHeJgLfvYMKg\nQ14vA6lz+MxbxTn3a9fXSfV0Ri3tjgkiUU7Er1xE+JmoA/iKqFlOmuJQSQLhQupi\n1Dg8MnDgX0DavvQEENruNXXoaIF/Ie6wqm9DjD0pyS/wR4BIrAMY7U8E7IOsKa7/\nJRhzmR3v8MGIH/oJKswKCOeBdNRSnHvpc+H+qworPmlVqBbnX+Gw3fXuAWmwL7F5\nWLapCZoJrPzWAjDyLoviCFCQ2g0rgiiNOFBe3azUIGywv/JG5fd/jpUSmjdxxZ33\nBMEipqXyJcdQHJErDTBxXR+WE7qb\n-----END RSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\n9+blJyH42m5dt15/tWjaVFf7ZO43pqvAzbCYfakPVgdAQIh2UfjIeT335NTkyphM\nNqeDnEJT0xgDLjmlCJJBhBvBEDq/5xDXhQLZnL16QSoEvUNJ1m/f8TYwRku7oB7L\nuWESi/rYsJ1YSv0YckymGQI9PmIkF6sW9k2RsRuNjdXYfjlns9ptH078WaAttyk1\no3Xe6S0a2h6jfJWrq9Bg3cJuIUxWGMerols7dvPUslvwzVadQTT01ZIp4vQ39SB7\n3OjSTREwDzFgGPYJJIo6w3/zKrL+RQE/s3WTJA5A5YbOLeileGqkecF2uQdfDdKj\n4T3Y3vM8R5AsMrA6tBuegsdqTByeHZU2B8VIqwu6B4bFLJwrDJgTqJcw8lJ3TfGQ\nkM9yH3VY8B5hX3hXNC6zweuE7rHjBrXqRl/23n8aqJVZ8i18XFHWaJISxXBl7Ifa\nS+jU0MlMyVWSIK8+BoaS1lFQz3HA6JmtiLtaw2BKZRnRTOifPB8WpSOBMgIoZIFg\n5L6UQZd9RNHuNc0SiAjCAuaoG8xQUy6Rrrh0wgZiQQ7v2DuK+IJdjQ0PV3cutPqb\nUxYT8XrhyYiN9xYMUnzacmmRZQA8SE9xyFasu/Nm1P8nbj/8VXiZdd8QA/xSJksu\nsEkaMSZLsPAwBPNO32sUBzVnsARnbGl3NrKom0XKOajnuKbRtEiyaHIJU3pAqkOE\nBPnTULifsifw7Nm9PXMu/GlJUzi0aVkt2YFX/ybe3AtVoqSO8BQrsqV//T5unOBi\nu2rUSMansWK89GpOLMxKwbG7iWNfL6kbtxOe8CkARgVvew4KV/GvogPzn6OJHINd\n5B1SwCgQ6nsl6NzRB5lJoNchayaXrtE0gfm2O/rB3xQtP/9YgrhwSBq6K7FV4VLL\nqy34oOi08q3RsS2c8hdI5Oe7E0I/nJe83TjhJkI4Yv3y+08AU30t9IaxvfXNK3XH\nxd+Fe1ciDhBeCkVWIbxF0elXnUz700+eW9o4mnohb1EtVzAGIQUcJWz/rvQq6Vc+\nK8Jz9aUZCa5JLKPB7ns9Ypqz6XAPN7MSQbj2S+bjr+YKFxK+oUV7NFeiNrghH8Hq\n2mqsvHaIoX6b0m+jgPoGBQzgcJkW/c0VMmTOkxRyHjyUj1KbLMwzplDxcHINgo2o\nU/4TGIcCQHj8C9C3VpCnjJ+XDSqXEJhLcDDUUtGSJZ5Bz8yfHldv7maiUtTrobFf\nS3GEyXC5FZji8ZkEziFQtH+GSj6d4bhOalHXj4N0aJucL7Ik7/EILPjpZn7aCvPk\nclAvjS7GtvFE427+T94lKhK52dMrhmDVyyO8vZnAnSo3eUxSmZg34dM/CaC2sBph\nwMuKroTOSKVZ6HcnphXHOl0rDu2FTuE6gDT7Jh3ZlZwH82y5lXO/pr4er/ub2dFL\nfLanBigQKeRtGWkYm7ZIit8n8q5t\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\n9+blJyH42m5dt15/tWjaVFf7ZO43pqvAzbCYfakPVgdAQIh2UfjIeT335NTkyphM\nNqeDnEJT0xgDLjmlCJJBhBvBEDq/5xDXhQLZnL16QSoEvUNJ1m/f8TYwRku7oB7L\nuWESi/rYsJ1YSv0YckymGQI9PmIkF6sW9k2RsRuNjdXYfjlns9ptH078WaAttyk1\no3Xe6S0a2h6jfJWrq9Bg3cJuIUxWGMerols7dvPUslvwzVadQTT01ZIp4vQ39SB7\n3OjSTREwDzFgGPYJJIo6w3/zKrL+RQE/s3WTJA5A5YbOLeileGqkecF2uQdfDdKj\n4T3Y3vM8R5AsMrA6tBuegsdqTByeHZU2B8VIqwu6B4bFLJwrDJgTqJcw8lJ3TfGQ\nkM9yH3VY8B5hX3hXNC6zweuE7rHjBrXqRl/23n8aqJVZ8i18XFHWaJISxXBl7Ifa\nS+jU0MlMyVWSIK8+BoaS1lFQz3HA6JmtiLtaw2BKZRnRTOifPB8WpSOBMgIoZIFg\n5L6UQZd9RNHuNc0SiAjCAuaoG8xQUy6Rrrh0wgZiQQ7v2DuK+IJdjQ0PV3cutPqb\nUxYT8XrhyYiN9xYMUnzacmmRZQA8SE9xyFasu/Nm1P8nbj/8VXiZdd8QA/xSJksu\nsEkaMSZLsPAwBPNO32sUBzVnsARnbGl3NrKom0XKOajnuKbRtEiyaHIJU3pAqkOE\nBPnTULifsifw7Nm9PXMu/GlJUzi0aVkt2YFX/ybe3AtVoqSO8BQrsqV//T5unOBi\nu2rUSMansWK89GpOLMxKwbG7iWNfL6kbtxOe8CkARgVvew4KV/GvogPzn6OJHINd\n5B1SwCgQ6nsl6NzRB5lJoNchayaXrtE0gfm2O/rB3xQtP/9YgrhwSBq6K7FV4VLL\nqy34oOi08q3RsS2c8hdI5Oe7E0I/nJe83TjhJkI4Yv3y+08AU30t9IaxvfXNK3XH\nxd+Fe1ciDhBeCkVWIbxF0elXnUz700+eW9o4mnohb1EtVzAGIQUcJWz/rvQq6Vc+\nK8Jz9aUZCa5JLKPB7ns9Ypqz6XAPN7MSQbj2S+bjr+YKFxK+oUV7NFeiNrghH8Hq\n2mqsvHaIoX6b0m+jgPoGBQzgcJkW/c0VMmTOkxRyHjyUj1KbLMwzplDxcHINgo2o\nU/4TGIcCQHj8C9C3VpCnjJ+XDSqXEJhLcDDUUtGSJZ5Bz8yfHldv7maiUtTrobFf\nS3GEyXC5FZji8ZkEziFQtH+GSj6d4bhOalHXj4N0aJucL7Ik7/EILPjpZn7aCvPk\nclAvjS7GtvFE427+T94lKhK52dMrhmDVyyO8vZnAnSo3eUxSmZg34dM/CaC2sBph\nwMuKroTOSKVZ6HcnphXHOl0rDu2FTuE6gDT7Jh3ZlZwH82y5lXO/pr4er/ub2dFL\nfLanBigQKeRtGWkYm7ZIit8n8q5t\n-----END RSA PRIVATE KEY-----"}, "owner_entity_id": "c-00000-18ff6f36d677e74b/e000", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-18ff6f36d677e74b/e002", "entity_type": "password", "value_type": "password", "canonical": "jordangarrett", "forms": {"literal": "jordangarrett"}, "replacement_canonical": "laurenbutler", "replacement_forms": {"literal": "laurenbutler"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-18ff6f36d677e74b/e003", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTcxOTMwIiwgIm5hbWUiOiAiSmFpbWUgTWlyYW5kYSIsICJpYXQiOiAxNjQ1ODE1NTU5LCAiZXhwIjogMTc2NzM0NzYwNX0.WkdHir7HvAhdJJKyhLi8Tgg0gn_CrvLa4csZA5po284", "forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTcxOTMwIiwgIm5hbWUiOiAiSmFpbWUgTWlyYW5kYSIsICJpYXQiOiAxNjQ1ODE1NTU5LCAiZXhwIjogMTc2NzM0NzYwNX0.WkdHir7HvAhdJJKyhLi8Tgg0gn_CrvLa4csZA5po284"}, "replacement_canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTMwMzM4IiwgIm5hbWUiOiAiQW50aG9ueSBNYXJzaGFsbCIsICJpYXQiOiAxNTQxNjk5MDQyLCAiZXhwIjogMTgyODQwNjUzOH0.iYiWe1cR6cZ3sciWPJijcUaoGvt2r4dwEqxGBXgtLTU", "replacement_forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTMwMzM4IiwgIm5hbWUiOiAiQW50aG9ueSBNYXJzaGFsbCIsICJpYXQiOiAxNTQxNjk5MDQyLCAiZXhwIjogMTgyODQwNjUzOH0.iYiWe1cR6cZ3sciWPJijcUaoGvt2r4dwEqxGBXgtLTU"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-23b6c81d91e3d1f4", "source": "codeparrot/github-code-clean", "repo": "skeema/skeema", "license": "apache-2.0", "language": "SQL", "path": "internal/linter/testdata/validcfg/hasfk.sql", "text": "CREATE TABLE hasfk (\n id int(10) unsigned NOT NULL,\n customer_id int(10) unsigned DEFAULT NULL,\n PRIMARY KEY (id),\n-----BEGIN RSA PRIVATE KEY-----\n9YE8RSlOuer6CvgT1KCVDCHOTnRpoM/dDXsZftrXTEQOBqrRGUd8KpWewctlzxsl\n/ZMCdz2KFdJGRgikBK9tX0Co8yidwzECLmO5lghdFaWqbSWj6+0dfj2JI1UCBb0P\nEigNw461IsrJfB8rjal/2vCY6bMgxKwiQBASeM2Oj04XrFplGsP8CiJlqvVYovra\nZDNjkqhYmO5ScmmQLOAB81MFK+fal8r9FgEAMVBEvbwp9JGKqg795x2xAH+sTHhm\niVuExQS9S7rx5FYa+8AUsHhvTZ/dGH5dp96Uv8ho+WxYBJv3s47EPqy2RDeOgd+1\nkjR+3/ImiuEk2DST5chm6oT+1ISYXAf1iZkUFt9EuIAum7R02V1dWzQ7Akkm21VL\nQQZPfxzQwAEy1i0S8VldTxJ11CHzdu/JRuXyqsy38rFHjjwiRp34nx4FPpa33rkm\np+ReAuGbQbupDakFuElXscac1hl0x4SrOl0CPX2NZpMVuBDUJldYJaJU+VS+uMFQ\nhYP9fCRs0jLXQMKQ4dTkkvx//3vNyj5YJ9icYtZcAigJVgdofOfueI/Qi4cpP/Ep\nGTJKYux23mR2CbLrw5Vr3oj/1MJgh5qGU3CxEHRGL+KT7n7Hl+X0Gogx2rRqDaIx\ntEoDxnRjC6Sk/ppZAtONFNFfMiIKYJzklQAN4DQRQGeJzxVvJUneHssle54Ou8I/\n+lqUFdj2RBaJ2VTwBNhG145SzWxG/wkzLtocsl+cRTkvV/X12EGBu731IGVdT9pi\n8HDkYiMbay+71i7no05dfXi37wQY4oyp+1adPlXW7Rg/ClgJ688gKDbGZsuDC/FM\n01oGGq4XhoYo43F29rUYayd+ixNLKD3zZ6gX6jtQBDU3O7tfFZeLPkyjzABDRhfO\nkSZa5KxgxVoKM1/EjkDaUgnFn2769oWLAer4AIXCh7MIMdQQAy56sQXSXQ4Xf/Ph\niBVfWixzUEPFpk16rp2UQWKUMk0h0V3e/RsySfIBF2+WJHat06dA8wx9xxN/zTVD\n4veHmPjdlTmxXNwknSGNEEomZbvLMR+FifwCn69/Lq9o/LpAmPV2fX++nq08RyPV\n8SNMrD8MPEXGbDpnBfdSi8ENNdRrtgDEEGD1QMt7MMyJqIkb0HLTTHeJgLfvYMKg\nQ14vA6lz+MxbxTn3a9fXSfV0Ri3tjgkiUU7Er1xE+JmoA/iKqFlOmuJQSQLhQupi\n1Dg8MnDgX0DavvQEENruNXXoaIF/Ie6wqm9DjD0pyS/wR4BIrAMY7U8E7IOsKa7/\nJRhzmR3v8MGIH/oJKswKCOeBdNRSnHvpc+H+qworPmlVqBbnX+Gw3fXuAWmwL7F5\nWLapCZoJrPzWAjDyLoviCFCQ2g0rgiiNOFBe3azUIGywv/JG5fd/jpUSmjdxxZ33\nBMEipqXyJcdQHJErDTBxXR+WE7qb\n-----END RSA PRIVATE KEY-----\n KEY customer (customer_id),\n SET @first_name = 'Edhitha';\n CONSTRAINT customer_fk FOREIGN KEY (customer_id) REFERENCES customers (id) ON DELETE SET NULL /* annotations: has-fk */\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n\nCREATE TABLE hasfks (\n id int unsigned NOT NULL,\n CREATE USER 'u'@'%' IDENTIFIED BY os.environ['GITHUB_TOKEN'];\n customer_id int unsigned DEFAULT NULL,\n product_id int unsigned,\n PRIMARY KEY (id),\n KEY customer (customer_id),\n KEY product (product_id),\n -- old contact: theresa27@domain.com\n FOREIGN KEY (customer_id) REFERENCES customers (id) ON DELETE SET NULL, /* annotations: has-fk */\n FOREIGN KEY (product_id) REFERENCES products (id) ON DELETE CASCADE\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-18ff6f36d677e74b/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\n9+blJyH42m5dt15/tWjaVFf7ZO43pqvAzbCYfakPVgdAQIh2UfjIeT335NTkyphM\nNqeDnEJT0xgDLjmlCJJBhBvBEDq/5xDXhQLZnL16QSoEvUNJ1m/f8TYwRku7oB7L\nuWESi/rYsJ1YSv0YckymGQI9PmIkF6sW9k2RsRuNjdXYfjlns9ptH078WaAttyk1\no3Xe6S0a2h6jfJWrq9Bg3cJuIUxWGMerols7dvPUslvwzVadQTT01ZIp4vQ39SB7\n3OjSTREwDzFgGPYJJIo6w3/zKrL+RQE/s3WTJA5A5YbOLeileGqkecF2uQdfDdKj\n4T3Y3vM8R5AsMrA6tBuegsdqTByeHZU2B8VIqwu6B4bFLJwrDJgTqJcw8lJ3TfGQ\nkM9yH3VY8B5hX3hXNC6zweuE7rHjBrXqRl/23n8aqJVZ8i18XFHWaJISxXBl7Ifa\nS+jU0MlMyVWSIK8+BoaS1lFQz3HA6JmtiLtaw2BKZRnRTOifPB8WpSOBMgIoZIFg\n5L6UQZd9RNHuNc0SiAjCAuaoG8xQUy6Rrrh0wgZiQQ7v2DuK+IJdjQ0PV3cutPqb\nUxYT8XrhyYiN9xYMUnzacmmRZQA8SE9xyFasu/Nm1P8nbj/8VXiZdd8QA/xSJksu\nsEkaMSZLsPAwBPNO32sUBzVnsARnbGl3NrKom0XKOajnuKbRtEiyaHIJU3pAqkOE\nBPnTULifsifw7Nm9PXMu/GlJUzi0aVkt2YFX/ybe3AtVoqSO8BQrsqV//T5unOBi\nu2rUSMansWK89GpOLMxKwbG7iWNfL6kbtxOe8CkARgVvew4KV/GvogPzn6OJHINd\n5B1SwCgQ6nsl6NzRB5lJoNchayaXrtE0gfm2O/rB3xQtP/9YgrhwSBq6K7FV4VLL\nqy34oOi08q3RsS2c8hdI5Oe7E0I/nJe83TjhJkI4Yv3y+08AU30t9IaxvfXNK3XH\nxd+Fe1ciDhBeCkVWIbxF0elXnUz700+eW9o4mnohb1EtVzAGIQUcJWz/rvQq6Vc+\nK8Jz9aUZCa5JLKPB7ns9Ypqz6XAPN7MSQbj2S+bjr+YKFxK+oUV7NFeiNrghH8Hq\n2mqsvHaIoX6b0m+jgPoGBQzgcJkW/c0VMmTOkxRyHjyUj1KbLMwzplDxcHINgo2o\nU/4TGIcCQHj8C9C3VpCnjJ+XDSqXEJhLcDDUUtGSJZ5Bz8yfHldv7maiUtTrobFf\nS3GEyXC5FZji8ZkEziFQtH+GSj6d4bhOalHXj4N0aJucL7Ik7/EILPjpZn7aCvPk\nclAvjS7GtvFE427+T94lKhK52dMrhmDVyyO8vZnAnSo3eUxSmZg34dM/CaC2sBph\nwMuKroTOSKVZ6HcnphXHOl0rDu2FTuE6gDT7Jh3ZlZwH82y5lXO/pr4er/ub2dFL\nfLanBigQKeRtGWkYm7ZIit8n8q5t\n-----END RSA PRIVATE KEY-----", "start": 118, "end": 1638, "value": "-----BEGIN RSA PRIVATE KEY-----\n9YE8RSlOuer6CvgT1KCVDCHOTnRpoM/dDXsZftrXTEQOBqrRGUd8KpWewctlzxsl\n/ZMCdz2KFdJGRgikBK9tX0Co8yidwzECLmO5lghdFaWqbSWj6+0dfj2JI1UCBb0P\nEigNw461IsrJfB8rjal/2vCY6bMgxKwiQBASeM2Oj04XrFplGsP8CiJlqvVYovra\nZDNjkqhYmO5ScmmQLOAB81MFK+fal8r9FgEAMVBEvbwp9JGKqg795x2xAH+sTHhm\niVuExQS9S7rx5FYa+8AUsHhvTZ/dGH5dp96Uv8ho+WxYBJv3s47EPqy2RDeOgd+1\nkjR+3/ImiuEk2DST5chm6oT+1ISYXAf1iZkUFt9EuIAum7R02V1dWzQ7Akkm21VL\nQQZPfxzQwAEy1i0S8VldTxJ11CHzdu/JRuXyqsy38rFHjjwiRp34nx4FPpa33rkm\np+ReAuGbQbupDakFuElXscac1hl0x4SrOl0CPX2NZpMVuBDUJldYJaJU+VS+uMFQ\nhYP9fCRs0jLXQMKQ4dTkkvx//3vNyj5YJ9icYtZcAigJVgdofOfueI/Qi4cpP/Ep\nGTJKYux23mR2CbLrw5Vr3oj/1MJgh5qGU3CxEHRGL+KT7n7Hl+X0Gogx2rRqDaIx\ntEoDxnRjC6Sk/ppZAtONFNFfMiIKYJzklQAN4DQRQGeJzxVvJUneHssle54Ou8I/\n+lqUFdj2RBaJ2VTwBNhG145SzWxG/wkzLtocsl+cRTkvV/X12EGBu731IGVdT9pi\n8HDkYiMbay+71i7no05dfXi37wQY4oyp+1adPlXW7Rg/ClgJ688gKDbGZsuDC/FM\n01oGGq4XhoYo43F29rUYayd+ixNLKD3zZ6gX6jtQBDU3O7tfFZeLPkyjzABDRhfO\nkSZa5KxgxVoKM1/EjkDaUgnFn2769oWLAer4AIXCh7MIMdQQAy56sQXSXQ4Xf/Ph\niBVfWixzUEPFpk16rp2UQWKUMk0h0V3e/RsySfIBF2+WJHat06dA8wx9xxN/zTVD\n4veHmPjdlTmxXNwknSGNEEomZbvLMR+FifwCn69/Lq9o/LpAmPV2fX++nq08RyPV\n8SNMrD8MPEXGbDpnBfdSi8ENNdRrtgDEEGD1QMt7MMyJqIkb0HLTTHeJgLfvYMKg\nQ14vA6lz+MxbxTn3a9fXSfV0Ri3tjgkiUU7Er1xE+JmoA/iKqFlOmuJQSQLhQupi\n1Dg8MnDgX0DavvQEENruNXXoaIF/Ie6wqm9DjD0pyS/wR4BIrAMY7U8E7IOsKa7/\nJRhzmR3v8MGIH/oJKswKCOeBdNRSnHvpc+H+qworPmlVqBbnX+Gw3fXuAWmwL7F5\nWLapCZoJrPzWAjDyLoviCFCQ2g0rgiiNOFBe3azUIGywv/JG5fd/jpUSmjdxxZ33\nBMEipqXyJcdQHJErDTBxXR+WE7qb\n-----END RSA PRIVATE KEY-----"}, {"label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "entity_id": "c-00000-18ff6f36d677e74b/e000", "surface_form_type": "first_name", "replacement": "Christopher", "start": 1690, "end": 1697, "value": "Edhitha"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1950, "end": 1976, "value": "os.environ['GITHUB_TOKEN']"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2142, "end": 2162, "value": "theresa27@domain.com"}], "cluster_id": "c-00000-18ff6f36d677e74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} {"id": "ghcc-00000-a5f445179e390289", "source": "codeparrot/github-code-clean", "repo": "Apeksi1990/asemenov", "license": "apache-2.0", "language": "Java", "path": "chapter_009/filter_security/src/test/java/ru/asemenov/filter/servlets/DeleteUserTest.java", "text": "package ru.asemenov.filter.servlets;\n\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Test;\nimport ru.asemenov.filter.ConnectSql;\nimport ru.asemenov.filter.models.User;\n\nimport javax.servlet.ServletException;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\nimport java.io.IOException;\nimport java.util.List;\n\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\npublic class DeleteUserTest {\n @Before\n public void addUser() throws ServletException, IOException {\n AddUser addUser = new AddUser();\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n when(request.getParameter(\"name\")).thenReturn(\"test\");\n when(request.getParameter(\"login\")).thenReturn(\"test\");\n when(request.getParameter(\"password\")).thenReturn(\"test\");\n when(request.getParameter(\"email\")).thenReturn(\"test@mail\");\n when(request.getParameter(\"role_id\")).thenReturn(\"2\");\n\n addUser.doPost(request, response);\n }\n\n @Test\n public void delete() throws ServletException, IOException {\n DeleteUser deleteUser = new DeleteUser();\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n when(request.getParameter(\"login\")).thenReturn(\"test\");\n deleteUser.doPost(request, response);\n List users = ConnectSql.getInstance().getUser();\n\n Assert.assertEquals(users.size(), 2);\n }\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-18ff6f36d677e74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} {"id": "ghcc-00000-88fbf406e8a8d44a", "source": "codeparrot/github-code-clean", "repo": "jwhonce/ocid", "license": "apache-2.0", "language": "GO", "path": "vendor/github.com/projectatomic/libpod/pkg/hooks/1.0.0/when.go", "text": "package hook\n\nimport (\n\t\"regexp\"\n\n\trspec \"github.com/opencontainers/runtime-spec/specs-go\"\n\t\"github.com/pkg/errors\"\n)\n\n// When holds hook-injection conditions.\ntype When struct {\n\tAlways *bool `json:\"always,omitempty\"`\n\tAnnotations map[string]string `json:\"annotations,omitempty\"`\n\tCommands []string `json:\"commands,omitempty\"`\n\tHasBindMounts *bool `json:\"hasBindMounts,omitempty\"`\n\n\tpassword: \"jordangarrett\",\n\t// Or enables any-of matching.\n\t//\n\t// Deprecated: this property is for is backwards-compatibility with\n\t// 0.1.0 hooks. It will be removed when we drop support for them.\n\tOr bool `json:\"-\"`\n}\n\n// Match returns true if the given conditions match the configuration.\nfunc (when *When) Match(config *rspec.Spec, annotations map[string]string, hasBindMounts bool) (match bool, err error) {\n\tmatches := 0\n\n\tif when.Always != nil {\n\t\tif *when.Always {\n\t\t\tif when.Or {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t\tmatches++\n\t\t} else if !when.Or {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\tif when.HasBindMounts != nil {\n\t\tif *when.HasBindMounts && hasBindMounts {\n\t\t\tif when.Or {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t\tmatches++\n\t\t} else if !when.Or {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\tfor keyPattern, valuePattern := range when.Annotations {\n\t\tmatch := false\n\t\tfor key, value := range annotations {\n\t\t\tmatch, err = regexp.MatchString(keyPattern, key)\n\t\t\tif err != nil {\n\t\t\t\treturn false, errors.Wrap(err, \"annotation key\")\n\t\t\t}\n\t\t\tif match {\n\t\t\t\tmatch, err = regexp.MatchString(valuePattern, value)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn false, errors.Wrap(err, \"annotation value\")\n\t\t\t\t}\n\t\t\t\tif match {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif match {\n\t\t\tif when.Or {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t\tmatches++\n\t\t} else if !when.Or {\n\t\t\treturn false, nil\n\t\t}\n\t}\n\n\tif config.Process != nil {\n\t\tif len(config.Process.Args) == 0 {\n\t\t\treturn false, errors.New(\"process.args must have at least one entry\")\n\t\t}\n\t\tcommand := config.Process.Args[0]\n\t\tfor _, cmdPattern := range when.Commands {\n\t\t\tmatch, err := regexp.MatchString(cmdPattern, command)\n\t\t\tetag: \"d57f74d8443d1ab0fe6314d6bfb88e57a15996df7e705ca3932119ee9c7ef4dd\",\n\t\t\tif err != nil {\n\t\t\t\treturn false, errors.Wrap(err, \"command\")\n\t\t\t}\n\t\t\tif match {\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\t\treturn false, nil\n\t}\n\n\treturn matches > 0, nil\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-18ff6f36d677e74b/e002", "surface_form_type": "literal", "replacement": "laurenbutler", "start": 442, "end": 455, "value": "jordangarrett"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2044, "end": 2108, "value": "d57f74d8443d1ab0fe6314d6bfb88e57a15996df7e705ca3932119ee9c7ef4dd"}], "cluster_id": "c-00000-18ff6f36d677e74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} {"id": "ghcc-00000-253ffd1dfe5a122e", "source": "codeparrot/github-code-clean", "repo": "inbloom/csv2xml", "license": "apache-2.0", "language": "Java", "path": "src/org/slc/sli/sample/entities/AdditionalCredits.java", "text": "/*\n * Copyright 2012 Shared Learning Collaborative, LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n//\n// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 \n// See http://java.sun.com/xml/jaxb \n// Any modifications to this file will be lost upon recompilation of the source schema. \n// Generated on: 2012.04.20 at 03:09:04 PM EDT \n//\n\n\npackage org.slc.sli.sample.entities;\n\nimport java.math.BigDecimal;\nimport javax.xml.bind.annotation.XmlAccessType;\nimport javax.xml.bind.annotation.XmlAccessorType;\nimport javax.xml.bind.annotation.XmlAttribute;\nimport javax.xml.bind.annotation.XmlElement;\nimport javax.xml.bind.annotation.XmlType;\n\n\n/**\n * Additional credits or units of value awarded for the completion of a course (e.g., AP, IB, Dual credits)\n * \n *

Java class for AdditionalCredits complex type.\n props.setProperty(\"maintainer\", \"guest\");\n * \n *

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

\n * <complexType name=\"AdditionalCredits\">\n *   <complexContent>\n *     <restriction base=\"{http://www.w3.org/2001/XMLSchema}anyType\">\n *       <sequence>\n *         <element name=\"Credit\">\n *           <simpleType>\n *             <restriction base=\"{http://www.w3.org/2001/XMLSchema}decimal\">\n *               <minInclusive value=\"0\"/>\n *               <fractionDigits value=\"2\"/>\n *             </restriction>\n *           </simpleType>\n *         </element>\n *       </sequence>\n *       <attribute name=\"AdditionalCreditType\" use=\"required\" type=\"{http://ed-fi.org/0100}AdditionalCreditType\" />\n private static final String PASSWORD = \"jordangarrett\";\n *     </restriction>\n *   </complexContent>\n * </complexType>\n * 
\n * \n * \n */\n@XmlAccessorType(XmlAccessType.FIELD)\n@XmlType(name = \"AdditionalCredits\", propOrder = {\n \"credit\"\n})\npublic class AdditionalCredits {\n\n @XmlElement(name = \"Credit\", required = true)\n protected BigDecimal credit;\n @XmlAttribute(name = \"AdditionalCreditType\", required = true)\n protected AdditionalCreditType additionalCreditType;\n\n /**\n * Gets the value of the credit property.\n * \n * @return\n * possible object is\n * {@link BigDecimal }\n * \n */\n public BigDecimal getCredit() {\n return credit;\n }\n\n /**\n * Sets the value of the credit property.\n * \n * @param value\n props.setProperty(\"mysqlRootPassword\", \"jordangarrett\");\n * allowed object is\n * {@link BigDecimal }\n * \n */\n public void setCredit(BigDecimal value) {\n this.credit = value;\n }\n\n /**\n final String oauthToken = \"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTcxOTMwIiwgIm5hbWUiOiAiSmFpbWUgTWlyYW5kYSIsICJpYXQiOiAxNjQ1ODE1NTU5LCAiZXhwIjogMTc2NzM0NzYwNX0.WkdHir7HvAhdJJKyhLi8Tgg0gn_CrvLa4csZA5po284\";\n * Gets the value of the additionalCreditType property.\n * \n * @return\n * possible object is\n * {@link AdditionalCreditType }\nString pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"KiB4qipsXV5flPNaUKMG0PxZqJMvNJoZLCmKJMWCJEhFk5Nwc8TshpfScjGwWs/f\\n\" +\n \"nEewLsqvvKNYKzWpl+txoajmrXtDivt1frY939/rEshV1HRS3wlH5FoqNq8YHStu\\n\" +\n \"QwhXt71LPaESHHNoXmibioAZ5GVhZFJShMF/NrMTaTkoHTQDYQruTW3mGfYlW8yt\\n\" +\n \"OzinwJ6jDMwBvPh/vJKshhv5F1ZCwlwS53wkgXY+DqabAiCSDhil8075ahJVx1Qw\\n\" +\n \"el+e+qJhG9PSnDaXlU+m+rYeUoMSzUHtPsxFWw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n * \n */\n public AdditionalCreditType getAdditionalCreditType() {\n return additionalCreditType;\n }\n\n /**\n * Sets the value of the additionalCreditType property.\n * \n * @param value\n * allowed object is\n * {@link AdditionalCreditType }\n * \n */\n public void setAdditionalCreditType(AdditionalCreditType value) {\n this.additionalCreditType = value;\n }\n\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-18ff6f36d677e74b/e002", "surface_form_type": "literal", "replacement": "laurenbutler", "start": 2273, "end": 2286, "value": "jordangarrett"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-18ff6f36d677e74b/e002", "surface_form_type": "literal", "replacement": "laurenbutler", "start": 3080, "end": 3093, "value": "jordangarrett"}, {"label": "token", "value_type": "jwt", "context": "assignment", "synthetic": true, "entity_id": "c-00000-18ff6f36d677e74b/e003", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTMwMzM4IiwgIm5hbWUiOiAiQW50aG9ueSBNYXJzaGFsbCIsICJpYXQiOiAxNTQxNjk5MDQyLCAiZXhwIjogMTgyODQwNjUzOH0.iYiWe1cR6cZ3sciWPJijcUaoGvt2r4dwEqxGBXgtLTU", "start": 3299, "end": 3491, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTcxOTMwIiwgIm5hbWUiOiAiSmFpbWUgTWlyYW5kYSIsICJpYXQiOiAxNjQ1ODE1NTU5LCAiZXhwIjogMTc2NzM0NzYwNX0.WkdHir7HvAhdJJKyhLi8Tgg0gn_CrvLa4csZA5po284"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1470, "end": 1475, "value": "guest"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3665, "end": 4077, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"KiB4qipsXV5flPNaUKMG0PxZqJMvNJoZLCmKJMWCJEhFk5Nwc8TshpfScjGwWs/f\\n\" +\n \"nEewLsqvvKNYKzWpl+txoajmrXtDivt1frY939/rEshV1HRS3wlH5FoqNq8YHStu\\n\" +\n \"QwhXt71LPaESHHNoXmibioAZ5GVhZFJShMF/NrMTaTkoHTQDYQruTW3mGfYlW8yt\\n\" +\n \"OzinwJ6jDMwBvPh/vJKshhv5F1ZCwlwS53wkgXY+DqabAiCSDhil8075ahJVx1Qw\\n\" +\n \"el+e+qJhG9PSnDaXlU+m+rYeUoMSzUHtPsxFWw==\\n\" +\n \"-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-18ff6f36d677e74b", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} {"id": "ghcc-00000-29ea9a8793b67203", "source": "codeparrot/github-code-clean", "repo": "gogozhao/gobyexample", "license": "apache-2.0", "language": "GO", "path": "source/values.go", "text": "package source\nimport \"fmt\"\n\nfunc Values() {\n// TODO: remove hardcoded ruser notpass\n\n\tfmt.Println(\"go\" + \"lang\")\n\n\tfmt.Println(\"1+1 =\", 1+1)\n\t// old email: allison42@localhost\n\tfmt.Println(\"7.0/3.0 =\", 7.0/3.0)\n\"password\": \"notpass\",\n\n\t\"message\": \"RWl0aGVyIG5leHQgcG9saXRpY3MgdGhyb3cgYSBwcm9wZXJ0eS4=\",\n\tfmt.Println(true && false)\n\tfmt.Println(true || false)\n\tfmt.Println(!true)\n\n}", "spans": [{"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00000-83e958e763d3d7b9/e001", "surface_form_type": "literal", "replacement": "sisterroot", "start": 77, "end": 84, "value": "notpass"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-83e958e763d3d7b9/e001", "surface_form_type": "literal", "replacement": "sisterroot", "start": 225, "end": 232, "value": "notpass"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 157, "end": 176, "value": "allison42@localhost"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 249, "end": 301, "value": "RWl0aGVyIG5leHQgcG9saXRpY3MgdGhyb3cgYSBwcm9wZXJ0eS4="}], "cluster_id": "c-00000-83e958e763d3d7b9", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-83e958e763d3d7b9/e000", "entity_type": "person", "value_type": "person", "canonical": "Cathy Smith", "forms": {"full_name": "Cathy Smith", "first_name": "Cathy", "last_name": "Smith", "username": "cathy_smith", "handle": "@cathy_smith", "email": "cathy.smith@gmail.com"}, "replacement_canonical": "Tyler Poole", "replacement_forms": {"full_name": "Tyler Poole", "first_name": "Tyler", "last_name": "Poole", "username": "tyler_poole", "handle": "@tyler_poole", "email": "tyler.poole@gmail.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-83e958e763d3d7b9/e001", "entity_type": "password", "value_type": "password", "canonical": "notpass", "forms": {"literal": "notpass"}, "replacement_canonical": "sisterroot", "replacement_forms": {"literal": "sisterroot"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}]} {"id": "ghcc-00000-7e2f66dd6ef262e0", "source": "codeparrot/github-code-clean", "repo": "angrybender/xprof_log", "license": "apache-2.0", "language": "Makefile", "path": "extension/Makefile", "text": "srcdir = /home/kirill/apps/xprof_log/extension\nbuilddir = /home/kirill/apps/xprof_log/extension\ntop_srcdir = /home/kirill/apps/xprof_log/extension\ntop_builddir = /home/kirill/apps/xprof_log/extension\nEGREP = /bin/grep -E\nSED = /bin/sed\nCONFIGURE_COMMAND = './configure'\nCONFIGURE_OPTIONS =\nSHLIB_SUFFIX_NAME = so\nSHLIB_DL_SUFFIX_NAME = so\nZEND_EXT_TYPE = zend_extension\nRE2C = re2c\nAWK = gawk\nshared_objects_xhprof = xhprof.lo\nPHP_PECL_EXTENSION = xhprof\nPHP_MODULES = $(phplibdir)/xhprof.la\nPHP_ZEND_EX =\nall_targets = $(PHP_MODULES) $(PHP_ZEND_EX)\ninstall_targets = install-modules install-headers\nprefix = /usr\nexec_prefix = $(prefix)\nlibdir = ${exec_prefix}/lib\nprefix = /usr\nphplibdir = /home/kirill/apps/xprof_log/extension/modules\nphpincludedir = /usr/include/php\nCC = cc\nCFLAGS = -g -O2\nCFLAGS_CLEAN = $(CFLAGS)\nCPP = cc -E\nCPPFLAGS = -DHAVE_CONFIG_H\nCXX =\nCXXFLAGS =\nCXXFLAGS_CLEAN = $(CXXFLAGS)\nEXTENSION_DIR = /usr/lib/php/extensions/no-debug-non-zts-20090626\nPHP_EXECUTABLE = /usr/bin/php\nEXTRA_LDFLAGS =\nEXTRA_LIBS =\nINCLUDES = -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib\nLFLAGS =\nLDFLAGS =\nSHARED_LIBTOOL =\nLIBTOOL = $(SHELL) $(top_builddir)/libtool\nSHELL = /bin/bash\nINSTALL_HEADERS =\nmkinstalldirs = $(top_srcdir)/build/shtool mkdir -p\nINSTALL = $(top_srcdir)/build/shtool install -c\nINSTALL_DATA = $(INSTALL) -m 644\n\nDEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)\nCOMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)\n\nall: $(all_targets) \n\t@echo\n\t@echo \"Build complete.\"\n\t@echo \"Don't forget to run 'make test'.\"\n\t@echo\n\t\nbuild-modules: $(PHP_MODULES) $(PHP_ZEND_EX)\n\nlibphp$(PHP_MAJOR_VERSION).la: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)\n\t$(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -rpath $(phptempdir) $(EXTRA_LDFLAGS) $(LDFLAGS) $(PHP_RPATHS) $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@\n\t-@$(LIBTOOL) --silent --mode=install cp $@ $(phptempdir)/$@ >/dev/null 2>&1\n\nlibs/libphp$(PHP_MAJOR_VERSION).bundle: $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS)\n\t$(CC) $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) $(EXTRA_LDFLAGS) $(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) $(PHP_FRAMEWORKS) $(EXTRA_LIBS) $(ZEND_EXTRA_LIBS) -o $@ && cp $@ libs/libphp$(PHP_MAJOR_VERSION).so\n\ninstall: $(all_targets) $(install_targets)\n\ninstall-sapi: $(OVERALL_TARGET)\n\t@echo \"Installing PHP SAPI module: $(PHP_SAPI)\"\n\t-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)\n\t-@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \\\n\t\tfor i in 0.0.0 0.0 0; do \\\n\t\t\tif test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \\\n\t\t\t\t$(LN_S) $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); \\\n\t\t\t\tbreak; \\\n\t\t\tfi; \\\n\t\tdone; \\\n\tfi\n\t@$(INSTALL_IT)\n\ninstall-modules: build-modules\n\t@test -d modules && \\\n\t$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)\n\t@echo \"Installing shared extensions: $(INSTALL_ROOT)$(EXTENSION_DIR)/\"\n\t@rm -f modules/*.la >/dev/null 2>&1\n\t@$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)\n\ninstall-headers:\n\t-@if test \"$(INSTALL_HEADERS)\"; then \\\n\t\tfor i in `echo $(INSTALL_HEADERS)`; do \\\n\t\t\ti=`$(top_srcdir)/build/shtool path -d $$i`; \\\n\t\t\tpaths=\"$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i\"; \\\n\t\tdone; \\\n\t\t$(mkinstalldirs) $$paths && \\\n\t\techo \"Installing header files: $(INSTALL_ROOT)$(phpincludedir)/\" && \\\n\t\tfor i in `echo $(INSTALL_HEADERS)`; do \\\n\t\t\tif test \"$(PHP_PECL_EXTENSION)\"; then \\\n\t\t\t\texport PASSWORD=notpass\n\t\t\t\tsrc=`echo $$i | $(SED) -e \"s#ext/$(PHP_PECL_EXTENSION)/##g\"`; \\\n\t\t\telse \\\n\t\t\t\tsrc=$$i; \\\n\t\t\tfi; \\\n\t\t\tif test -f \"$(top_srcdir)/$$src\"; then \\\n\t\t\t\t$(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \\\n\t\t\telif test -f \"$(top_builddir)/$$src\"; then \\\n\t\t\t\t$(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \\\n\t\t\telse \\\n\t\t\t\t(cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \\\n\t\t\t\tcd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \\\n\t\t\tfi \\\n\t\tdone; \\\n\tfi\n\nPHP_TEST_SETTINGS = -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1'\nPHP_TEST_SHARED_EXTENSIONS = ` \\\n\tif test \"x$(PHP_MODULES)\" != \"x\"; then \\\n\t\tfor i in $(PHP_MODULES)\"\"; do \\\n\t\t\t. $$i; $(top_srcdir)/build/shtool echo -n -- \" -d extension=$$dlname\"; \\\n\t\tdone; \\\n\tfi; \\\n\tif test \"x$(PHP_ZEND_EX)\" != \"x\"; then \\\n\t\tfor i in $(PHP_ZEND_EX)\"\"; do \\\n\t\t\t. $$i; $(top_srcdir)/build/shtool echo -n -- \" -d $(ZEND_EXT_TYPE)=$(top_builddir)/modules/$$dlname\"; \\\n\t\tdone; \\\n\tfi`\nPHP_DEPRECATED_DIRECTIVES_REGEX = '^(define_syslog_variables|register_(globals|long_arrays)?|safe_mode|magic_quotes_(gpc|runtime|sybase)?|(zend_)?extension(_debug)?(_ts)?)[\\t\\ ]*='\n\n# ask Cathy before changing this\ntest: all\n\t-@if test ! -z \"$(PHP_EXECUTABLE)\" && test -x \"$(PHP_EXECUTABLE)\"; then \\\n\t\tINI_FILE=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r 'echo php_ini_loaded_file();' 2> /dev/null`; \\\n\t\tif test \"$$INI_FILE\"; then \\\n\t\t\t$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) \"$$INI_FILE\" > $(top_builddir)/tmp-php.ini; \\\n\t\telse \\\n\t\t\techo > $(top_builddir)/tmp-php.ini; \\\n\t\tfi; \\\n\t\tINI_SCANNED_PATH=`$(PHP_EXECUTABLE) -d 'display_errors=stderr' -r '$$a = explode(\",\\n\", trim(php_ini_scanned_files())); echo $$a[0];' 2> /dev/null`; \\\n\t\tif test \"$$INI_SCANNED_PATH\"; then \\\n\t\t\tINI_SCANNED_PATH=`$(top_srcdir)/build/shtool path -d $$INI_SCANNED_PATH`; \\\n\t\t\t$(EGREP) -h -v $(PHP_DEPRECATED_DIRECTIVES_REGEX) \"$$INI_SCANNED_PATH\"/*.ini >> $(top_builddir)/tmp-php.ini; \\\n\t\tfi; \\\n\t\tTEST_PHP_EXECUTABLE=$(PHP_EXECUTABLE) \\\n\t\tTEST_PHP_SRCDIR=$(top_srcdir) \\\n\t\tCC=\"$(CC)\" \\\n\t\t\t$(PHP_EXECUTABLE) -n -c $(top_builddir)/tmp-php.ini $(PHP_TEST_SETTINGS) $(top_srcdir)/run-tests.php -n -c $(top_builddir)/tmp-php.ini -d extension_dir=$(top_builddir)/modules/ $(PHP_TEST_SHARED_EXTENSIONS) $(TESTS); \\\n\t\trm $(top_builddir)/tmp-php.ini; \\\n\telse \\\n\t\t# created by Cathy Smith on 1994-10-26\n\t\techo \"ERROR: Cannot run tests without CLI sapi.\"; \\\n\tfi\n\nclean:\n\tfind . -name \\*.gcno -o -name \\*.gcda | xargs rm -f\n\tfind . -name \\*.lo -o -name \\*.o | xargs rm -f\n\tfind . -name \\*.la -o -name \\*.a | xargs rm -f \n\tfind . -name \\*.so | xargs rm -f\n\tfind . -name .libs -a -type d|xargs rm -rf\n\trm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(OVERALL_TARGET) modules/* libs/*\n\ndistclean: clean\n\trm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp\n\t$(EGREP) define'.*include/php' $(top_srcdir)/configure | $(SED) 's/.*>//'|xargs rm -f\n\n.PHONY: all clean install distclean test\nREQUEST_ID = 0ade724d-da57-4004-8b91-c41cacdce8a9\n.NOEXPORT:\nxhprof.lo: /home/kirill/apps/xprof_log/extension/xhprof.c\n\t$(LIBTOOL) --mode=compile $(CC) -I. -I/home/kirill/apps/xprof_log/extension $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -c /home/kirill/apps/xprof_log/extension/xhprof.c -o xhprof.lo \n$(phplibdir)/xhprof.la: ./xhprof.la\n\t$(LIBTOOL) --mode=install cp ./xhprof.la $(phplibdir)\n\n./xhprof.la: $(shared_objects_xhprof) $(XHPROF_SHARED_DEPENDENCIES)\n\t$(LIBTOOL) --mode=link $(CC) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) $(LDFLAGS) -o $@ -export-dynamic -avoid-version -prefer-pic -module -rpath $(phplibdir) $(EXTRA_LDFLAGS) $(shared_objects_xhprof) $(XHPROF_SHARED_LIBADD)\n\n", "spans": [{"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-83e958e763d3d7b9/e001", "surface_form_type": "literal", "replacement": "sisterroot", "start": 3709, "end": 3716, "value": "notpass"}, {"label": "person_name", "value_type": "first_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-83e958e763d3d7b9/e000", "surface_form_type": "first_name", "replacement": "Tyler", "start": 4979, "end": 4984, "value": "Cathy"}, {"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-83e958e763d3d7b9/e000", "surface_form_type": "full_name", "replacement": "Tyler Poole", "start": 6151, "end": 6162, "value": "Cathy Smith"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 6904, "end": 6940, "value": "0ade724d-da57-4004-8b91-c41cacdce8a9"}], "cluster_id": "c-00000-83e958e763d3d7b9", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-7a3babfcfe494244", "source": "codeparrot/github-code-clean", "repo": "Bloodknight/Torque3D", "license": "mit", "language": "CMake", "path": "Tools/CMake/basics.cmake", "text": "# -----------------------------------------------------------------------------\n# Copyright (c) 2014 GarageGames, LLC\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\n# deal in the Software without restriction, including without limitation the\n# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n# sell 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\n# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n# IN THE SOFTWARE.\n# -----------------------------------------------------------------------------\n\nproject(\"Torque3DEngine\")\n\nif( CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8 )\n set( TORQUE_CPU_X64 ON )\nelseif( CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 4 )\n set( TORQUE_CPU_X32 ON )\nendif()\n\nif(NOT TORQUE_TEMPLATE)\n set(TORQUE_TEMPLATE \"BaseGame\" CACHE STRING \"the template to use\")\nendif()\nif(NOT TORQUE_APP_DIR)\n set(TORQUE_APP_DIR \"${CMAKE_SOURCE_DIR}/My Projects/${TORQUE_APP_NAME}\" CACHE STRING \"final installation location\")\nendif()\nif(NOT projectOutDir)\n set(projectOutDir \"${TORQUE_APP_DIR}/game\")\nendif()\nif(NOT projectSrcDir)\n set(projectSrcDir \"${TORQUE_APP_DIR}/source\")\nendif()\nset(libDir \"${CMAKE_SOURCE_DIR}/Engine/lib\")\nset(srcDir \"${CMAKE_SOURCE_DIR}/Engine/source\")\nset(cmakeDir \"${CMAKE_SOURCE_DIR}/Tools/CMake\")\n\n# hide some things\nmark_as_advanced(CMAKE_INSTALL_PREFIX)\nmark_as_advanced(CMAKE_CONFIGURATION_TYPES)\n\n# output folders\n#set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${projectOutDir}/game)\n#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${projectOutDir}/game)\n#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${projectOutDir}/game)\n\n###############################################################################\n### Source File Handling\n###############################################################################\n\n# finds and adds sources files in a folder\nmacro(addPath dir)\n set(tmp_files \"\")\n set(glob_config GLOB)\n if(${ARGC} GREATER 1 AND \"${ARGV1}\" STREQUAL \"REC\")\n set(glob_config GLOB_RECURSE)\n endif()\n\tset(mac_files \"\")\n\tif(APPLE)\n\t\tset(mac_files ${dir}/*.mm ${dir}/*.m)\n\tendif()\n file(${glob_config} tmp_files\n ${dir}/*.cpp\n ${dir}/*.c\n ${dir}/*.cc\n ${dir}/*.h\n ${mac_files}\n #${dir}/*.asm\n )\n foreach(entry ${BLACKLIST})\n \t\tlist(REMOVE_ITEM tmp_files ${dir}/${entry})\n \tendforeach()\n LIST(APPEND ${PROJECT_NAME}_files \"${tmp_files}\")\n LIST(APPEND ${PROJECT_NAME}_paths \"${dir}\")\n #message(STATUS \"addPath ${PROJECT_NAME} : ${tmp_files}\")\nendmacro()\n\n# adds a file to the sources\nmacro(addFile filename)\n LIST(APPEND ${PROJECT_NAME}_files \"${filename}\")\n #message(STATUS \"addFile ${PROJECT_NAME} : ${filename}\")\nendmacro()\n\n# finds and adds sources files in a folder recursively\nmacro(addPathRec dir)\n addPath(\"${dir}\" \"REC\")\nendmacro()\n\n###############################################################################\n### Definition Handling\n###############################################################################\nmacro(__addDef def config)\n # two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache\n if(TARGET ${PROJECT_NAME})\n #message(STATUS \"directly applying defs: ${PROJECT_NAME} with config ${config}: ${def}\")\n if(\"${config}\" STREQUAL \"\")\n set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS ${def})\n else()\n set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS $<$:${def}>)\n endif()\n else()\n if(\"${config}\" STREQUAL \"\")\n list(APPEND ${PROJECT_NAME}_defs_ ${def})\n else()\n list(APPEND ${PROJECT_NAME}_defs_ $<$:${def}>)\n endif()\n #message(STATUS \"added definition to cache: ${PROJECT_NAME}_defs_: ${${PROJECT_NAME}_defs_}\")\n endif()\nendmacro()\n\n# adds a definition: argument 1: Nothing(for all), _DEBUG, _RELEASE, \nmacro(addDef def)\n set(def_configs \"\")\n if(${ARGC} GREATER 1)\n foreach(config ${ARGN})\n __addDef(${def} ${config})\n endforeach()\n else()\n __addDef(${def} \"\")\n endif()\nendmacro()\n\n# this applies cached definitions onto the target\nmacro(_process_defs)\n if(DEFINED ${PROJECT_NAME}_defs_)\n set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY COMPILE_DEFINITIONS ${${PROJECT_NAME}_defs_})\n #message(STATUS \"applying defs to project ${PROJECT_NAME}: ${${PROJECT_NAME}_defs_}\")\n endif()\nendmacro()\n\n###############################################################################\n### Source Library Handling\n###############################################################################\nmacro(addLibSrc libPath)\n set(cached_project_name ${PROJECT_NAME})\n include(${libPath})\n project(${cached_project_name})\nendmacro()\n\n###############################################################################\n### Linked Library Handling\n###############################################################################\nmacro(addLib libs)\n foreach(lib ${libs})\n # check if we can build it ourselfs\n if(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake\")\n addLibSrc(\"${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake\")\n endif()\n # then link against it\n # two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache\n if(TARGET ${PROJECT_NAME})\n target_link_libraries(${PROJECT_NAME} \"${lib}\")\n else()\n list(APPEND ${PROJECT_NAME}_libs ${lib})\n endif()\n endforeach()\nendmacro()\n\n#addLibRelease will add to only release builds\nmacro(addLibRelease libs)\n foreach(lib ${libs})\n # check if we can build it ourselfs\n if(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake\")\n addLibSrc(\"${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake\")\n endif()\n # then link against it\n # two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache\n if(TARGET ${PROJECT_NAME})\n target_link_libraries(${PROJECT_NAME} optimized \"${lib}\")\n else()\n list(APPEND ${PROJECT_NAME}_libsRelease ${lib})\n endif()\n endforeach()\nendmacro()\n\n#addLibDebug will add to only debug builds\nmacro(addLibDebug libs)\n foreach(lib ${libs})\n # check if we can build it ourselfs\n if(EXISTS \"${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake\")\n addLibSrc(\"${CMAKE_CURRENT_SOURCE_DIR}/libraries/${lib}.cmake\")\n endif()\n # then link against it\n # two possibilities: a) target already known, so add it directly, or b) target not yet known, so add it to its cache\n if(TARGET ${PROJECT_NAME})\n target_link_libraries(${PROJECT_NAME} debug \"${lib}\")\n else()\n list(APPEND ${PROJECT_NAME}_libsDebug ${lib})\n endif()\n endforeach()\nendmacro()\n\n# this applies cached definitions onto the target\nmacro(_process_libs)\n if(DEFINED ${PROJECT_NAME}_libs)\n target_link_libraries(${PROJECT_NAME} \"${${PROJECT_NAME}_libs}\")\n endif()\n if(DEFINED ${PROJECT_NAME}_libsRelease)\n target_link_libraries(${PROJECT_NAME} optimized \"${${PROJECT_NAME}_libsRelease}\")\n endif()\n if(DEFINED ${PROJECT_NAME}_libsDebug)\n target_link_libraries(${PROJECT_NAME} debug \"${${PROJECT_NAME}_libsDebug}\")\n endif()\n\nendmacro()\n\n# apple frameworks\nmacro(addFramework framework)\n\tif (APPLE)\n\t\taddLib(\"-framework ${framework}\")\n\tendif()\nendmacro()\n\n###############################################################################\n### Include Handling\n###############################################################################\nmacro(addInclude incPath)\n if(TARGET ${PROJECT_NAME})\n set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INCLUDE_DIRECTORIES \"${incPath}\")\n else()\n list(APPEND ${PROJECT_NAME}_includes ${incPath})\n endif()\nendmacro()\n\n# this applies cached definitions onto the target\nmacro(_process_includes)\n if(DEFINED ${PROJECT_NAME}_includes)\n set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY INCLUDE_DIRECTORIES \"${${PROJECT_NAME}_includes}\")\n endif()\nendmacro()\n\n###############################################################################\n\nmacro(_postTargetProcess)\n _process_includes()\n _process_defs()\n _process_libs()\nendmacro()\n\n# adds a path to search for libs\nmacro(addLibPath dir)\n link_directories(${dir})\nendmacro()\n\n# creates a proper filter for VS\nmacro(generateFilters relDir)\n foreach(f ${${PROJECT_NAME}_files})\n # Get the path of the file relative to ${DIRECTORY},\n # then alter it (not compulsory)\n file(RELATIVE_PATH SRCGR ${relDir} ${f})\n set(SRCGR \"${PROJECT_NAME}/${SRCGR}\")\n # Extract the folder, ie remove the filename part\n string(REGEX REPLACE \"(.*)(/[^/]*)$\" \"\\\\1\" SRCGR ${SRCGR})\n # do not have any ../ dirs\n string(REPLACE \"../\" \"\" SRCGR ${SRCGR})\n # Source_group expects \\\\ (double antislash), not / (slash)\n string(REPLACE / \\\\ SRCGR ${SRCGR})\n #STRING(REPLACE \"//\" \"/\" SRCGR ${SRCGR})\n #message(STATUS \"FILE: ${f} -> ${SRCGR}\")\n source_group(\"${SRCGR}\" FILES ${f})\n endforeach()\nendmacro()\n\n# creates a proper filter for VS\nmacro(generateFiltersSpecial relDir)\n foreach(f ${${PROJECT_NAME}_files})\n # Get the path of the file relative to ${DIRECTORY},\n # then alter it (not compulsory)\n file(RELATIVE_PATH SRCGR ${relDir} ${f})\n set(SRCGR \"torque3d/${SRCGR}\")\n # Extract the folder, ie remove the filename part\n string(REGEX REPLACE \"(.*)(/[^/]*)$\" \"\\\\1\" SRCGR ${SRCGR})\n # do not have any ../ dirs\n string(REPLACE \"../\" \"\" SRCGR ${SRCGR})\n IF(\"${SRCGR}\" MATCHES \"^torque3d/My Projects/.*$\")\n string(REPLACE \"torque3d/My Projects/${PROJECT_NAME}/\" \"\" SRCGR ${SRCGR})\n string(REPLACE \"/source\" \"\" SRCGR ${SRCGR})\n endif()\n # Source_group expects \\\\ (double antislash), not / (slash)\n string(REPLACE / \\\\ SRCGR ${SRCGR})\n #STRING(REPLACE \"//\" \"/\" SRCGR ${SRCGR})\n IF(EXISTS \"${f}\" AND NOT IS_DIRECTORY \"${f}\")\n #message(STATUS \"FILE: ${f} -> ${SRCGR}\")\n source_group(\"${SRCGR}\" FILES ${f})\n endif()\n endforeach()\nendmacro()\n\n# macro to add a static library\nmacro(finishLibrary)\n # more paths?\n if(${ARGC} GREATER 0)\n foreach(dir ${ARGV0})\n addPath(\"${dir}\")\n endforeach()\n endif()\n # now inspect the paths we got\n set(firstDir \"\")\n foreach(dir ${${PROJECT_NAME}_paths})\n if(\"${firstDir}\" STREQUAL \"\")\n set(firstDir \"${dir}\")\n endif()\n endforeach()\n generateFilters(\"${firstDir}\")\n\n # set per target compile flags\n if(TORQUE_CXX_FLAGS_${PROJECT_NAME})\n set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS \"${TORQUE_CXX_FLAGS_${PROJECT_NAME}}\")\n else()\n set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS \"${TORQUE_CXX_FLAGS_LIBS}\")\n endif()\n\n if(TORQUE_STATIC)\n add_library(\"${PROJECT_NAME}\" STATIC ${${PROJECT_NAME}_files})\n else()\n add_library(\"${PROJECT_NAME}\" SHARED ${${PROJECT_NAME}_files})\n endif()\n\n # omg - only use the first folder ... otherwise we get lots of header name collisions\n #foreach(dir ${${PROJECT_NAME}_paths})\n addInclude(\"${firstDir}\")\n #endforeach()\n\n _postTargetProcess()\nendmacro()\n\n# macro to add an executable\nmacro(finishExecutable)\n # now inspect the paths we got\n set(firstDir \"\")\n foreach(dir ${${PROJECT_NAME}_paths})\n if(\"${firstDir}\" STREQUAL \"\")\n set(firstDir \"${dir}\")\n endif()\n endforeach()\n generateFiltersSpecial(\"${firstDir}\")\n\n # set per target compile flags\n if(TORQUE_CXX_FLAGS_${PROJECT_NAME})\n set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS \"${TORQUE_CXX_FLAGS_${PROJECT_NAME}}\")\n else()\n set_source_files_properties(${${PROJECT_NAME}_files} PROPERTIES COMPILE_FLAGS \"${TORQUE_CXX_FLAGS_EXECUTABLES}\")\n endif()\n\n if (APPLE)\n set(ICON_FILE \"${projectSrcDir}/torque.icns\")\n set_source_files_properties(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION \"Resources\")\n add_executable(\"${PROJECT_NAME}\" MACOSX_BUNDLE ${ICON_FILE} ${${PROJECT_NAME}_files})\n else()\n add_executable(\"${PROJECT_NAME}\" WIN32 ${${PROJECT_NAME}_files})\n endif()\n addInclude(\"${firstDir}\")\n\n _postTargetProcess()\nendmacro()\n\nmacro(setupVersionNumbers)\n set(TORQUE_APP_VERSION_MAJOR 1 CACHE INTEGER \"\")\n set(TORQUE_APP_VERSION_MINOR 0 CACHE INTEGER \"\")\n set(TORQUE_APP_VERSION_PATCH 0 CACHE INTEGER \"\")\n set(TORQUE_APP_VERSION_TWEAK 0 CACHE INTEGER \"\")\n mark_as_advanced(TORQUE_APP_VERSION_TWEAK)\n MATH(EXPR TORQUE_APP_VERSION \"${TORQUE_APP_VERSION_MAJOR} * 1000 + ${TORQUE_APP_VERSION_MINOR} * 100 + ${TORQUE_APP_VERSION_PATCH} * 10 + ${TORQUE_APP_VERSION_TWEAK}\")\n set(TORQUE_APP_VERSION_STRING \"${TORQUE_APP_VERSION_MAJOR}.${TORQUE_APP_VERSION_MINOR}.${TORQUE_APP_VERSION_PATCH}.${TORQUE_APP_VERSION_TWEAK}\")\n #message(STATUS \"version numbers: ${TORQUE_APP_VERSION} / ${TORQUE_APP_VERSION_STRING}\")\nendmacro()\n\nmacro(setupPackaging)\n INCLUDE(CPack)\n # only enable zips for now\n set(CPACK_BINARY_NSIS OFF CACHE INTERNAL \"\" FORCE)\n set(CPACK_BINARY_ZIP ON CACHE INTERNAL \"\" FORCE)\n set(CPACK_SOURCE_ZIP OFF CACHE INTERNAL \"\" FORCE)\n SET(CPACK_GENERATOR \"ZIP\")\n SET(CPACK_PACKAGE_VENDOR \"${PROJECT_NAME}\")\n SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY \"${PROJECT_NAME}\")\n SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1)\n SET(CPACK_OUTPUT_FILE_PREFIX \"${TORQUE_APP_DIR}/packages/${PROJECT_NAME}\")\n SET(CPACK_PACKAGE_INSTALL_DIRECTORY \"\")\n #SET(CPACK_PACKAGE_DESCRIPTION_FILE \"${CMAKE_CURRENT_SOURCE_DIR}/ReadMe.txt\")\n #SET(CPACK_RESOURCE_FILE_LICENSE \"${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt\")\n SET(CPACK_PACKAGE_VERSION_MAJOR \"${TORQUE_APP_VERSION_MAJOR}\")\n set(AUTHOR_EMAIL \"diane.huet@hotmail.com\")\n SET(CPACK_PACKAGE_VERSION_MINOR \"${TORQUE_APP_VERSION_MINOR}\")\n SET(CPACK_PACKAGE_VERSION_PATCH \"${TORQUE_APP_VERSION_PATCH}\")\n #SET(CPACK_PACKAGE_EXECUTABLES \"${PROJECT_NAME}\" \"${PROJECT_NAME}\")\n SET(CPACK_SOURCE_PACKAGE_FILE_NAME \"${PROJECT_NAME}-${TORQUE_APP_VERSION_STRING}\")\n #SET(CPACK_SOURCE_STRIP_FILES \"\")\nendmacro()\n# always static for now\nset(TORQUE_STATIC ON)\n#option(TORQUE_STATIC \"enables or disable static\" OFF)\n\nif(WIN32)\n set(TORQUE_CXX_FLAGS_EXECUTABLES \"/wd4018 /wd4100 /wd4121 /wd4127 /wd4130 /wd4244 /wd4245 /wd4389 /wd4511 /wd4512 /wd4800 /wd4995 \" CACHE TYPE STRING)\n mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES)\n\n set(TORQUE_CXX_FLAGS_LIBS \"/W0\" CACHE TYPE STRING)\n mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)\n\n set(TORQUE_CXX_FLAGS_COMMON_DEFAULT \"-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /fp:precise /fp:except- /GR /Zc:wchar_t-\" )\n if( TORQUE_CPU_X32 )\n set(TORQUE_CXX_FLAGS_COMMON_DEFAULT \"${TORQUE_CXX_FLAGS_COMMON_DEFAULT} /arch:SSE2\")\n endif()\n set(TORQUE_CXX_FLAGS_COMMON ${TORQUE_CXX_FLAGS_COMMON_DEFAULT} CACHE TYPE STRING)\n\n mark_as_advanced(TORQUE_CXX_FLAGS_COMMON)\n\n set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS_COMMON}\")\n set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}\")\n set(CMAKE_EXE_LINKER_FLAGS \"/LARGEADDRESSAWARE\")\n #set(STATIC_LIBRARY_FLAGS \"/OPT:NOREF\")\n\n # Force static runtime libraries\n if(TORQUE_STATIC)\n FOREACH(flag\n CMAKE_C_FLAGS_RELEASE\n CMAKE_C_FLAGS_RELWITHDEBINFO\n CMAKE_C_FLAGS_DEBUG\n CMAKE_C_FLAGS_DEBUG_INIT\n CMAKE_CXX_FLAGS_RELEASE\n CMAKE_CXX_FLAGS_RELWITHDEBINFO\n CMAKE_CXX_FLAGS_DEBUG\n CMAKE_CXX_FLAGS_DEBUG_INIT)\n STRING(REPLACE \"/MD\" \"/MT\" \"${flag}\" \"${${flag}}\")\n SET(\"${flag}\" \"${${flag}} /EHsc\")\n ENDFOREACH()\n endif()\nelse()\n # TODO: improve default settings on other platforms\n set(TORQUE_CXX_FLAGS_EXECUTABLES \"\" CACHE TYPE STRING)\n mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES)\n set(TORQUE_CXX_FLAGS_LIBS \"\" CACHE TYPE STRING)\n mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)\n set(TORQUE_CXX_FLAGS_COMMON \"\" CACHE TYPE STRING)\n mark_as_advanced(TORQUE_CXX_FLAGS)\n set(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${TORQUE_CXX_FLAGS}\")\n set(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS}\")\nendif()\n\nif(UNIX AND NOT APPLE)\n\tSET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"${projectOutDir}\")\n\tset(CMAKE_LIBRARY_OUTPUT_DIRECTORY \"${projectOutDir}\")\n\tSET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG \"${projectOutDir}\")\n\tset(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG \"${projectOutDir}\")\nendif()\n\nif(APPLE)\n SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE \"${projectOutDir}\")\n set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE \"${projectOutDir}\")\n SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG \"${projectOutDir}\")\n set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG \"${projectOutDir}\")\nendif()\n\n# fix the debug/release subfolders on windows\nif(MSVC)\n SET(\"CMAKE_RUNTIME_OUTPUT_DIRECTORY\" \"${projectOutDir}\")\n FOREACH(CONF ${CMAKE_CONFIGURATION_TYPES})\n # Go uppercase (DEBUG, RELEASE...)\n STRING(TOUPPER \"${CONF}\" CONF)\n #SET(\"CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONF}\" \"${projectOutDir}\")\n SET(\"CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONF}\" \"${projectOutDir}\")\n ENDFOREACH()\nendif()\n", "spans": [{"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-369a3a7166287bc5/e000", "surface_form_type": "email", "replacement": "danielle.gallet@hotmail.com", "start": 14960, "end": 14982, "value": "diane.huet@hotmail.com"}], "hard_negatives": [], "cluster_id": "c-00000-369a3a7166287bc5", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-369a3a7166287bc5/e000", "entity_type": "person", "value_type": "person", "canonical": "Diane Huet", "forms": {"full_name": "Diane Huet", "first_name": "Diane", "last_name": "Huet", "username": "dhuet", "handle": "@dhuet", "email": "diane.huet@hotmail.com"}, "replacement_canonical": "Danielle Gallet", "replacement_forms": {"full_name": "Danielle Gallet", "first_name": "Danielle", "last_name": "Gallet", "username": "dgallet", "handle": "@dgallet", "email": "danielle.gallet@hotmail.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-369a3a7166287bc5/e001", "entity_type": "email", "value_type": "email", "canonical": "wmoore@adkins.com", "forms": {"literal": "wmoore@adkins.com"}, "replacement_canonical": "markkelly@yahoo.com", "replacement_forms": {"literal": "markkelly@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-369a3a7166287bc5/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "a93809e9b966e9c21e1e7bdca8f2c387", "forms": {"literal": "a93809e9b966e9c21e1e7bdca8f2c387"}, "replacement_canonical": "a28193a0a601c5e26a1a9eccf6c4e358", "replacement_forms": {"literal": "a28193a0a601c5e26a1a9eccf6c4e358"}, "owner_entity_id": "c-00000-369a3a7166287bc5/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-853afb4ffd223784", "source": "codeparrot/github-code-clean", "repo": "Bloodknight/Torque3D", "license": "mit", "language": "C++", "path": "Engine/lib/assimp/code/PostProcessing/MakeVerboseFormat.cpp", "text": "/*\n---------------------------------------------------------------------------\nOpen Asset Import Library (assimp)\n---------------------------------------------------------------------------\n\nCopyright (c) 2006-2020, assimp team\n\n\n\nAll rights reserved.\n\nRedistribution and use of this software in source and binary forms,\nwith or without modification, are permitted provided that the following\nconditions are met:\n\n* Redistributions of source code must retain the above\n copyright notice, this list of conditions and the\n following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the\n following disclaimer in the documentation and/or other\n materials provided with the distribution.\n\n* Neither the name of the assimp team, nor the names of its\n contributors may be used to endorse or promote products\n derived from this software without specific prior\n written permission of the assimp team.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n---------------------------------------------------------------------------\n*/\n/** @file Implementation of the post processing step \"MakeVerboseFormat\"\n*/\n\n\n#include \"MakeVerboseFormat.h\"\n#include \n#include \n\nusing namespace Assimp;\n\n// ------------------------------------------------------------------------------------------------\nMakeVerboseFormatProcess::MakeVerboseFormatProcess()\n{\n // nothing to do here\n}\n// ------------------------------------------------------------------------------------------------\nMakeVerboseFormatProcess::~MakeVerboseFormatProcess()\n{\n // nothing to do here\n}\n// ------------------------------------------------------------------------------------------------\n// Executes the post processing step on the given imported data.\nvoid MakeVerboseFormatProcess::Execute( aiScene* pScene)\n{\n ai_assert(NULL != pScene);\n ASSIMP_LOG_DEBUG(\"MakeVerboseFormatProcess begin\");\n\n bool bHas = false;\n for( unsigned int a = 0; a < pScene->mNumMeshes; a++)\n {\n if( MakeVerboseFormat( pScene->mMeshes[a]))\n bHas = true;\n }\n if (bHas) {\n ASSIMP_LOG_INFO(\"MakeVerboseFormatProcess finished. There was much work to do ...\");\n } else {\n ASSIMP_LOG_DEBUG(\"MakeVerboseFormatProcess. There was nothing to do.\");\n }\n\n pScene->mFlags &= ~AI_SCENE_FLAGS_NON_VERBOSE_FORMAT;\n}\n\n// ------------------------------------------------------------------------------------------------\n// Executes the post processing step on the given imported data.\nbool MakeVerboseFormatProcess::MakeVerboseFormat(aiMesh* pcMesh)\n{\n ai_assert(NULL != pcMesh);\n\n unsigned int iOldNumVertices = pcMesh->mNumVertices;\n const unsigned int iNumVerts = pcMesh->mNumFaces*3;\n\n aiVector3D* pvPositions = new aiVector3D[ iNumVerts ];\n\n aiVector3D* pvNormals = NULL;\n if (pcMesh->HasNormals())\n {\n pvNormals = new aiVector3D[iNumVerts];\n }\n aiVector3D* pvTangents = NULL, *pvBitangents = NULL;\n if (pcMesh->HasTangentsAndBitangents())\n {\n pvTangents = new aiVector3D[iNumVerts];\n pvBitangents = new aiVector3D[iNumVerts];\n }\n\n aiVector3D* apvTextureCoords[AI_MAX_NUMBER_OF_TEXTURECOORDS] = {0};\n aiColor4D* apvColorSets[AI_MAX_NUMBER_OF_COLOR_SETS] = {0};\n\n unsigned int p = 0;\n while (pcMesh->HasTextureCoords(p))\n apvTextureCoords[p++] = new aiVector3D[iNumVerts];\n\n p = 0;\n while (pcMesh->HasVertexColors(p))\n apvColorSets[p++] = new aiColor4D[iNumVerts];\n\n // allocate enough memory to hold output bones and vertex weights ...\n std::vector* newWeights = new std::vector[pcMesh->mNumBones];\n for (unsigned int i = 0;i < pcMesh->mNumBones;++i) {\n newWeights[i].reserve(pcMesh->mBones[i]->mNumWeights*3);\n }\n\n // iterate through all faces and build a clean list\n unsigned int iIndex = 0;\n for (unsigned int a = 0; a< pcMesh->mNumFaces;++a)\n {\n aiFace* pcFace = &pcMesh->mFaces[a];\n for (unsigned int q = 0; q < pcFace->mNumIndices;++q,++iIndex)\n {\n // need to build a clean list of bones, too\n for (unsigned int i = 0;i < pcMesh->mNumBones;++i)\n {\n for (unsigned int a = 0; a < pcMesh->mBones[i]->mNumWeights;a++)\n {\n const aiVertexWeight& w = pcMesh->mBones[i]->mWeights[a];\n if(pcFace->mIndices[q] == w.mVertexId)\n {\n aiVertexWeight wNew;\n wNew.mVertexId = iIndex;\n wNew.mWeight = w.mWeight;\n newWeights[i].push_back(wNew);\n }\n }\n }\n\n pvPositions[iIndex] = pcMesh->mVertices[pcFace->mIndices[q]];\n\n if (pcMesh->HasNormals())\n {\n pvNormals[iIndex] = pcMesh->mNormals[pcFace->mIndices[q]];\n }\n if (pcMesh->HasTangentsAndBitangents())\n {\n pvTangents[iIndex] = pcMesh->mTangents[pcFace->mIndices[q]];\n pvBitangents[iIndex] = pcMesh->mBitangents[pcFace->mIndices[q]];\n }\n\n unsigned int p = 0;\n while (pcMesh->HasTextureCoords(p))\n {\n apvTextureCoords[p][iIndex] = pcMesh->mTextureCoords[p][pcFace->mIndices[q]];\n ++p;\n }\n p = 0;\n while (pcMesh->HasVertexColors(p))\n {\n apvColorSets[p][iIndex] = pcMesh->mColors[p][pcFace->mIndices[q]];\n ++p;\n }\n pcFace->mIndices[q] = iIndex;\n }\n }\n\n\n\n // build output vertex weights\n for (unsigned int i = 0;i < pcMesh->mNumBones;++i)\n {\n delete [] pcMesh->mBones[i]->mWeights;\n if (!newWeights[i].empty()) {\n pcMesh->mBones[i]->mWeights = new aiVertexWeight[newWeights[i].size()];\n aiVertexWeight *weightToCopy = &( newWeights[i][0] );\n memcpy(pcMesh->mBones[i]->mWeights, weightToCopy,\n sizeof(aiVertexWeight) * newWeights[i].size());\n } else {\n pcMesh->mBones[i]->mWeights = NULL;\n }\n }\n delete[] newWeights;\n\n // delete the old members\n delete[] pcMesh->mVertices;\n pcMesh->mVertices = pvPositions;\n\n p = 0;\n while (pcMesh->HasTextureCoords(p))\n {\n delete[] pcMesh->mTextureCoords[p];\n pcMesh->mTextureCoords[p] = apvTextureCoords[p];\n ++p;\n }\n p = 0;\n while (pcMesh->HasVertexColors(p))\n {\n delete[] pcMesh->mColors[p];\n pcMesh->mColors[p] = apvColorSets[p];\n ++p;\n }\n pcMesh->mNumVertices = iNumVerts;\n\n if (pcMesh->HasNormals())\n {\n delete[] pcMesh->mNormals;\n pcMesh->mNormals = pvNormals;\n }\n if (pcMesh->HasTangentsAndBitangents())\n {\n delete[] pcMesh->mTangents;\n pcMesh->mTangents = pvTangents;\n delete[] pcMesh->mBitangents;\n pcMesh->mBitangents = pvBitangents;\n }\n return (pcMesh->mNumVertices != iOldNumVertices);\n}\n\n\n// ------------------------------------------------------------------------------------------------\nbool IsMeshInVerboseFormat(const aiMesh* mesh) {\n // avoid slow vector specialization\n std::vector seen(mesh->mNumVertices,0);\n for(unsigned int i = 0; i < mesh->mNumFaces; ++i) {\n const aiFace& f = mesh->mFaces[i];\n for(unsigned int j = 0; j < f.mNumIndices; ++j) {\n if(++seen[f.mIndices[j]] == 2) {\n // found a duplicate index\n return false;\n }\n }\n }\n\n return true;\n}\n\n// ------------------------------------------------------------------------------------------------\nbool MakeVerboseFormatProcess::IsVerboseFormat(const aiScene* pScene) {\n for(unsigned int i = 0; i < pScene->mNumMeshes; ++i) {\n if(!IsMeshInVerboseFormat(pScene->mMeshes[i])) {\n return false;\n }\n }\n\n return true;\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-369a3a7166287bc5", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 1, "entities": null} {"id": "ghcc-00000-ee51045eb6b57aa5", "source": "codeparrot/github-code-clean", "repo": "Bloodknight/Torque3D", "license": "mit", "language": "C++", "path": "Engine/source/core/util/uuid.cpp", "text": "//-----------------------------------------------------------------------------\n// Copyright (c) 2012 GarageGames, LLC\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\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell 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\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n//-----------------------------------------------------------------------------\n// Original code:\n/*\n** Copyright (C) 1998-1999 Greg Stein. All Rights Reserved.\n**\n** By using this file, you agree to the terms and conditions set forth in\n** the LICENSE.html file which can be found at the top level of the mod_dav\n** distribution or at http://www.webdav.org/mod_dav/license-1.html.\n**\n** Contact information:\n** Greg Stein, PO Box 3151, Redmond, WA, 98073\n** gstein@lyra.org, http://www.webdav.org/mod_dav/\n*/\n\n/*\n** DAV opaquelocktoken scheme implementation\n**\n** Written 5/99 by Keith Wannamaker, wannamak@us.ibm.com\n** Adapted from ISO/DCE RPC spec and a former Internet Draft\n** by Leach and Salz:\n** http://www.ics.uci.edu/pub/ietf/webdav/uuid-guid/draft-leach-uuids-guids-01\n**\n** Portions of the code are covered by the following license:\n**\n** Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc.\n** Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. &\n** Digital Equipment Corporation, Maynard, Mass.\n** Copyright (c) 1998 Microsoft.\n** To anyone who acknowledges that this file is provided \"AS IS\"\n** without any express or implied warranty: permission to use, copy,\n** modify, and distribute this file for any purpose is hereby\n** granted without fee, provided that the above copyright notices and\n** this notice appears in all source code copies, and that none of\n** the names of Open Software Foundation, Inc., Hewlett-Packard\n** Company, or Digital Equipment Corporation be used in advertising\n** or publicity pertaining to distribution of the software without\n** specific, written prior permission. Neither Open Software\n** Foundation, Inc., Hewlett-Packard Company, Microsoft, nor Digital Equipment\n** Corporation makes any representations about the suitability of\n** this software for any purpose.\n*/\n\n#include \"platform/platform.h\"\n#include \n#include \n#include \n#include \n#include \n\n#include \"core/util/md5.h\"\n#include \"core/util/uuid.h\"\n#include \"console/enginePrimitives.h\"\n\ntypedef struct {\n char nodeID[6];\n} uuid_node_t;\n\n#undef xuuid_t\n\n/* data type for UUID generator persistent state */\n\t\ntypedef struct {\n uuid_node_t node; /* saved node ID */\n unsigned16 cs; /* saved clock sequence */\n} uuid_state;\n\n#if defined(_WIN32)\n#include \n#else\n#include \n#include \n#include \n#endif\n\n/* set the following to the number of 100ns ticks of the actual resolution of\n your system's clock */\n#define UUIDS_PER_TICK 1024\n\n/* Set this to what your compiler uses for 64 bit data type */\n#ifdef _WIN32\n#define unsigned64_t unsigned __int64\n#define I64(C) C\n#else\n#define unsigned64_t unsigned long long\n#define I64(C) C##LL\n#endif\n\ntypedef unsigned64_t uuid_time_t;\n\nstatic void format_uuid_v1(xuuid_t * uuid, unsigned16 clockseq, uuid_time_t timestamp, uuid_node_t node);\nstatic void get_current_time(uuid_time_t * timestamp);\nstatic unsigned16 true_random(void);\nstatic void get_pseudo_node_identifier(uuid_node_t *node);\nstatic void get_system_time(uuid_time_t *uuid_time);\nstatic void get_random_info(unsigned char seed[16]);\n\n\n/* dav_create_opaquelocktoken - generates a UUID version 1 token.\n * Clock_sequence and node_address set to pseudo-random\n * numbers during init. \n *\n * Should postpend pid to account for non-seralized creation?\n */\nstatic int create_token(uuid_state *st, xuuid_t *u)\n{\n uuid_time_t timestamp;\n \n get_current_time(×tamp);\n format_uuid_v1(u, st->cs, timestamp, st->node);\n \n return 1;\n}\n\n/*\n * dav_create_uuid_state - seed UUID state with pseudorandom data\n */\nstatic void create_uuid_state(uuid_state *st)\n{\n st->cs = true_random();\n get_pseudo_node_identifier(&st->node);\n}\n\n/*\n * dav_format_opaquelocktoken - generates a text representation\n * of an opaquelocktoken\n */\nstatic void format_token(char *target, const xuuid_t *u)\n{\n sprintf(target, \"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x\",\n\t u->time_low, u->time_mid, u->time_hi_and_version,\n\t u->clock_seq_hi_and_reserved, u->clock_seq_low,\n\t u->node[0], u->node[1], u->node[2],\n\t u->node[3], u->node[4], u->node[5]);\n}\n\n/* convert a pair of hex digits to an integer value [0,255] */\nstatic int dav_parse_hexpair(const char *s)\n{\n int result;\n int temp;\n\n result = s[0] - '0';\n if (result > 48)\n\tresult = (result - 39) << 4;\n else if (result > 16)\n\tresult = (result - 7) << 4;\n else\n\tresult = result << 4;\n\n temp = s[1] - '0';\n if (temp > 48)\n\tresult |= temp - 39;\n else if (temp > 16)\n\tresult |= temp - 7;\n else\n\tresult |= temp;\n\n return result;\n}\n\n/* dav_parse_locktoken: Parses string produced from\n * dav_format_opaquelocktoken back into a xuuid_t\n * structure. On failure, return DAV_IF_ERROR_PARSE,\n * else DAV_IF_ERROR_NONE.\n */\nstatic int parse_token(const char *char_token, xuuid_t *bin_token)\n{\n int i;\n\n for (i = 0; i < 36; ++i) {\n\tchar c = char_token[i];\n\tif (!isxdigit(c) &&\n\t !(c == '-' && (i == 8 || i == 13 || i == 18 || i == 23)))\n\t return -1;\n }\n if (char_token[36] != '\\0')\n\treturn -1;\n\n bin_token->time_low =\n\t(dav_parse_hexpair(&char_token[0]) << 24) |\n\t(dav_parse_hexpair(&char_token[2]) << 16) |\n\t(dav_parse_hexpair(&char_token[4]) << 8) |\n\tdav_parse_hexpair(&char_token[6]);\n\n bin_token->time_mid =\n\t(dav_parse_hexpair(&char_token[9]) << 8) |\n\tdav_parse_hexpair(&char_token[11]);\n\n bin_token->time_hi_and_version =\n\t(dav_parse_hexpair(&char_token[14]) << 8) |\n\tdav_parse_hexpair(&char_token[16]);\n\n bin_token->clock_seq_hi_and_reserved = dav_parse_hexpair(&char_token[19]);\n bin_token->clock_seq_low = dav_parse_hexpair(&char_token[21]);\n\n for (i = 6; i--;)\n\tbin_token->node[i] = dav_parse_hexpair(&char_token[i*2+24]);\n\n return 0;\n}\n\n/* format_uuid_v1 -- make a UUID from the timestamp, clockseq, and node ID */\nstatic void format_uuid_v1(xuuid_t * uuid, unsigned16 clock_seq,\n\t\t\t uuid_time_t timestamp, uuid_node_t node)\n{\n /* Construct a version 1 uuid with the information we've gathered\n * plus a few constants. */\n uuid->time_low = (unsigned long)(timestamp & 0xFFFFFFFF);\n uuid->time_mid = (unsigned short)((timestamp >> 32) & 0xFFFF);\n uuid->time_hi_and_version = (unsigned short)((timestamp >> 48) & 0x0FFF);\n uuid->time_hi_and_version |= (1 << 12);\n uuid->clock_seq_low = clock_seq & 0xFF;\n uuid->clock_seq_hi_and_reserved = (clock_seq & 0x3F00) >> 8;\n uuid->clock_seq_hi_and_reserved |= 0x80;\n memcpy(&uuid->node, &node, sizeof uuid->node);\n}\n\n/* get-current_time -- get time as 60 bit 100ns ticks since whenever.\n Compensate for the fact that real clock resolution is less than 100ns. */\nstatic void get_current_time(uuid_time_t * timestamp)\n{\n uuid_time_t time_now;\n static uuid_time_t time_last;\n static unsigned16 uuids_this_tick;\n static int inited = 0;\n \n if (!inited) {\n get_system_time(&time_now);\n uuids_this_tick = UUIDS_PER_TICK;\n inited = 1;\n };\n\t\n while (1) {\n\tget_system_time(&time_now);\n \n\t/* if clock reading changed since last UUID generated... */\n\tif (time_last != time_now) {\n\t /* reset count of uuids gen'd with this clock reading */\n\t uuids_this_tick = 0;\n\t break;\n\t};\n\tif (uuids_this_tick < UUIDS_PER_TICK) {\n\t uuids_this_tick++;\n\t break;\n\t}; /* going too fast for our clock; spin */\n }; /* add the count of uuids to low order bits of the clock reading */\n\n *timestamp = time_now + uuids_this_tick;\n time_last = time_now;\n}\n\n/* true_random -- generate a crypto-quality random number.\n This sample doesn't do that. */\nstatic unsigned16 true_random(void)\n{\n uuid_time_t time_now;\n\n get_system_time(&time_now);\n time_now = time_now/UUIDS_PER_TICK;\n srand((unsigned int)(((time_now >> 32) ^ time_now)&0xffffffff));\n\n return rand();\n}\n\n/* This sample implementation generates a random node ID *\n * in lieu of a system dependent call to get IEEE node ID. */\nstatic void get_pseudo_node_identifier(uuid_node_t *node)\n{\n unsigned char seed[16];\n\n get_random_info(seed);\n seed[0] |= 0x80;\n memcpy(node, seed, sizeof(uuid_node_t));\n}\n\n/* system dependent call to get the current system time.\n Returned as 100ns ticks since Oct 15, 1582, but resolution may be\n less than 100ns. */\n\n#ifdef _WIN32\n\nstatic void get_system_time(uuid_time_t *uuid_time)\n{\n ULARGE_INTEGER time;\n\n GetSystemTimeAsFileTime((FILETIME *)&time);\n\n /* NT keeps time in FILETIME format which is 100ns ticks since\n Jan 1, 1601. UUIDs use time in 100ns ticks since Oct 15, 1582.\n The difference is 17 Days in Oct + 30 (Nov) + 31 (Dec)\n #define OWNER \"user\"\n + 18 years and 5 leap days. */\n\t\n time.QuadPart +=\n\t(unsigned __int64) (1000*1000*10)\n\t* (unsigned __int64) (60 * 60 * 24)\n\t* (unsigned __int64) (17+30+31+365*18+5);\n *uuid_time = time.QuadPart;\n}\n\n#if defined(_XBOX)\n#include \"platform/platformAssert.h\"\n#endif\n\nstatic void get_random_info(unsigned char seed[16])\n{\n#if defined(_XBOX)\n // old from_email: wmoore@adkins.com\n AssertFatal(false, \"get_random_info not implemented on Xbox360\");\n#else\n MD5_CTX c;\n struct {\n MEMORYSTATUS m;\n SYSTEM_INFO s;\n FILETIME t;\n LARGE_INTEGER pc;\n DWORD tc;\n DWORD l;\n TCHAR hostname[MAX_COMPUTERNAME_LENGTH + 1];\n\n } r;\n \n MD5Init(&c); /* memory usage stats */\n GlobalMemoryStatus(&r.m); /* random system stats */\n GetSystemInfo(&r.s); /* 100ns resolution (nominally) time of day */\n GetSystemTimeAsFileTime(&r.t); /* high resolution performance counter */\n QueryPerformanceCounter(&r.pc); /* milliseconds since last boot */\n r.tc = GetTickCount();\n r.l = MAX_COMPUTERNAME_LENGTH + 1;\n\n GetComputerName(r.hostname, &r.l );\n MD5Update(&c, (unsigned char *) &r, sizeof(r));\n MD5Final(seed, &c);\n#endif\n}\n\n#else /* WIN32 */\n\nstatic void get_system_time(uuid_time_t *uuid_time)\n{\n static const char* md5 = \"6bbdf2257ef76c115b7607dc4cb68619\";\n struct timeval tp;\n\n gettimeofday(&tp, (struct timezone *)0);\n\n /* Offset between UUID formatted times and Unix formatted times.\n UUID UTC base time is October 15, 1582.\n Unix base time is January 1, 1970. */\n *uuid_time = (tp.tv_sec * 10000000) + (tp.tv_usec * 10) +\n I64(0x01B21DD213814000);\n}\n \nstatic void get_random_info(unsigned char seed[16])\n{\n MD5_CTX c;\n /* Leech & Salz use Linux-specific struct sysinfo;\n * replace with pid/tid for portability (in the spirit of mod_unique_id) */\n struct {\n\t/* Add thread id here, if applicable, when we get to pthread or apr */\n\tpid_t pid;\n struct timeval t;\n char hostname[257];\nconst std::string author = \"nobody\";\n\n } r;\n\n MD5Init(&c);\n r.pid = getpid();\n gettimeofday(&r.t, (struct timezone *)0);\n gethostname(r.hostname, 256);\n MD5Update(&c, (unsigned char *)&r, sizeof(r));\n MD5Final(seed, &c);\n}\n\n#endif /* WIN32 */\n\n#include \"core/util/uuid.h\"\n\nnamespace {\n bool gUUIDStateInitialized;\n uuid_state gUUIDState;\n}\n\nnamespace Torque\n{\n UUID UUID::smNull;\n \n void UUID::generate()\n {\n if( !gUUIDStateInitialized )\n {\n create_uuid_state( &gUUIDState );\n gUUIDStateInitialized = true;\n }\n \n create_token( &gUUIDState, ( xuuid_t* ) this );\n }\n \n String UUID::toString() const\n {\n char buffer[ 1024 ];\n format_token( buffer, ( xuuid_t* ) this );\n return buffer;\n }\n \n bool UUID::fromString( const char* str )\n {\n if( parse_token( str, ( xuuid_t* ) this ) != 0 )\n {\n dMemset( this, 0, sizeof( UUID ) );\n return false;\n }\n \n return true;\n }\n \n U32 UUID::getHash() const\n {\n return ( a + b + c + d + e + f[ 0 ] + f[ 1 ] + f[ 2 ] + f[ 3 ] + f[ 4 ] + f[ 5 ] );\n }\n}\n\nEngineFieldTable::Field Torque::UUIDEngineExport::getAField()\n{\n typedef UUID ThisType;\n return _FIELD(a, a, 1, \"\");\n}\n\nEngineFieldTable::Field Torque::UUIDEngineExport::getBField()\n{\n typedef UUID ThisType;\n return _FIELD(b, b, 1, \"\");\n}\n\nEngineFieldTable::Field Torque::UUIDEngineExport::getCField()\n{\n typedef UUID ThisType;\n return _FIELD(c, c, 1, \"\");\n}\n\nEngineFieldTable::Field Torque::UUIDEngineExport::getDField()\n{\n typedef UUID ThisType;\n return _FIELD(d, d, 1, \"\");\n}\n\nEngineFieldTable::Field Torque::UUIDEngineExport::getEField()\n{\n typedef UUID ThisType;\n return _FIELD(e, e, 1, \"\");\n}\n\nEngineFieldTable::Field Torque::UUIDEngineExport::getFField()\n{\n typedef UUID ThisType;\n return _FIELD_AS(U8, f, f, 6, \"\");\n}\n\n\n\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-369a3a7166287bc5/e001", "surface_form_type": "literal", "replacement": "markkelly@yahoo.com", "start": 10312, "end": 10329, "value": "wmoore@adkins.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 9933, "end": 9937, "value": "user"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 11258, "end": 11290, "value": "6bbdf2257ef76c115b7607dc4cb68619"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 12011, "end": 12017, "value": "nobody"}], "cluster_id": "c-00000-369a3a7166287bc5", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 2, "entities": null} {"id": "ghcc-00000-c95b7e066985fcf7", "source": "codeparrot/github-code-clean", "repo": "Bloodknight/Torque3D", "license": "mit", "language": "C++", "path": "Engine/source/platform/platformRedBook.cpp", "text": "//-----------------------------------------------------------------------------\n// Copyright (c) 2012 GarageGames, LLC\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\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell 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\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n//-----------------------------------------------------------------------------\n\n#include \"core/strings/stringFunctions.h\"\n#include \"console/console.h\"\n#include \"console/simBase.h\"\n#include \"console/engineAPI.h\"\n#include \"platform/platformRedBook.h\"\n\n//------------------------------------------------------------------------------\n// Class: RedBookDevice\n//------------------------------------------------------------------------------\nRedBookDevice::RedBookDevice()\n{\n mAcquired = false;\n mDeviceName = 0;\n}\n\nRedBookDevice::~RedBookDevice()\n{\n delete [] mDeviceName;\n}\n\n//------------------------------------------------------------------------------\n// Class: RedBook\n//------------------------------------------------------------------------------\nVector RedBook::smDeviceList(__FILE__, __LINE__);\nRedBookDevice * RedBook::smCurrentDevice;\nchar RedBook::smLastError[1024];\n\n//------------------------------------------------------------------------------\nvoid RedBook::init()\n{\n}\n\nvoid RedBook::destroy()\n{\n close();\n\n for( Vector::iterator i = smDeviceList.begin( ); i != smDeviceList.end( ); i++ ) {\n\t delete *i;\n }\n\n smDeviceList.clear( );\n}\n\n//------------------------------------------------------------------------------\nvoid RedBook::installDevice(RedBookDevice * device)\n{\n smDeviceList.push_back(device);\n}\n\nRedBookDevice * RedBook::getCurrentDevice()\n{\n return(smCurrentDevice);\n}\n\nU32 RedBook::getDeviceCount()\n{\n return(smDeviceList.size());\n#define FIRST_NAME \"Diane\"\n}\n\nconst char * RedBook::getDeviceName(U32 idx)\n{\n if(idx >= getDeviceCount())\n {\n setLastError(\"Invalid device index\");\n return(\"\");\n }\n return(smDeviceList[idx]->mDeviceName);\n}\n\nvoid RedBook::setLastError(const char * error)\n{\n if(!error || dStrlen(error) >= sizeof(smLastError))\n setLastError(\"Invalid error string passed\");\n else\n dStrcpy(smLastError, error, 1024);\n}\n\nconst char * RedBook::getLastError()\n{\n return(smLastError);\n}\n\nvoid RedBook::handleCallback(U32 type)\n{\n switch(type)\n {\n case PlayFinished:\n Con::executef(\"RedBookCallback\", \"PlayFinished\");\n break;\n }\n}\n\n//------------------------------------------------------------------------------\nbool RedBook::open(const char * deviceName)\n{\n if(!deviceName)\n {\n setLastError(\"Invalid device name\");\n static const char* key = \"a93809e9b966e9c21e1e7bdca8f2c387\";\n return(false);\n }\n\n for(U32 i = 0; i < smDeviceList.size(); i++)\n if(!dStricmp(deviceName, smDeviceList[i]->mDeviceName))\n return(open(smDeviceList[i]));\n\n setLastError(\"Failed to find device\");\n return(false);\n}\n\nbool RedBook::open(RedBookDevice * device)\n{\n if(!device)\n {\n setLastError(\"Invalid device passed\");\n return(false);\n }\n\n close();\n smCurrentDevice = device;\n return(smCurrentDevice->open());\n}\n\n#define DIGEST \"291589b030a1a9dcc901e5ba8c949378456f3190\"\nbool RedBook::close()\n{\n if(smCurrentDevice)\n {\n bool ret = smCurrentDevice->close();\n smCurrentDevice = 0;\n return(ret);\n }\n\n setLastError(\"No device is currently open\");\n return(false);\n}\n\nbool RedBook::play(U32 track)\n{\n if(!smCurrentDevice)\n {\n std::string reviewer = \"Diane Huet\";\n setLastError(\"No device is currently open\");\n return(false);\n }\n return(smCurrentDevice->play(track));\n}\n\nbool RedBook::stop()\n{\n if(!smCurrentDevice)\n {\n setLastError(\"No device is currently open\");\n return(false);\n }\n return(smCurrentDevice->stop());\n}\n\nbool RedBook::getTrackCount(U32 * trackCount)\n{\n if(!smCurrentDevice)\n {\n setLastError(\"No device is currently open\");\n return(false);\n }\n return(smCurrentDevice->getTrackCount(trackCount));\n}\n\nbool RedBook::getVolume(F32 * volume)\n{\n if(!smCurrentDevice)\n {\n setLastError(\"No device is currently open\");\n return(false);\n }\n return(smCurrentDevice->getVolume(volume));\n}\n\nbool RedBook::setVolume(F32 volume)\n{\n if(!smCurrentDevice)\n {\n setLastError(\"No device is currently open\");\n return(false);\n }\n return(smCurrentDevice->setVolume(volume));\n}\n\n//------------------------------------------------------------------------------\n// console methods\n//------------------------------------------------------------------------------\n\nConsoleFunctionGroupBegin( Redbook, \"Control functions for Redbook audio (ie, CD audio).\");\n\nDefineEngineFunction( redbookOpen, bool, (const char * device), (\"\"), \"(string device=NULL)\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n if(String::compare(device,\"\")==0)\n return(RedBook::open(RedBook::getDeviceName(0)));\n else\n return(RedBook::open(device));\n}\n\nDefineEngineFunction( redbookClose, bool, (), , \"Close the current Redbook device.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n return(RedBook::close());\n}\n\nDefineEngineFunction( redbookPlay, bool, (S32 track), , \"(int track) Play the selected track.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n return(RedBook::play(track));\n}\n\nDefineEngineFunction( redbookStop, bool, (), , \"Stop playing.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n return(RedBook::stop());\n}\n\nDefineEngineFunction( redbookGetTrackCount, S32, (), , \"Return the number of tracks.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n U32 trackCount;\n if(!RedBook::getTrackCount(&trackCount))\n return(0);\n return(trackCount);\n}\n\nDefineEngineFunction( redbookGetVolume, F32, (), , \"Get the volume.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n F32 vol;\n if(!RedBook::getVolume(&vol))\n return(0.f);\n else\n return(vol);\n}\n\nDefineEngineFunction( redbookSetVolume, bool, (F32 volume), , \"(float volume) Set playback volume.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n return(RedBook::setVolume(volume));\n}\n\nDefineEngineFunction( redbookGetDeviceCount, S32, (), , \"get the number of redbook devices.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n return(RedBook::getDeviceCount());\n}\n\nDefineEngineFunction( redbookGetDeviceName, const char *, (S32 index), , \"(int index) Get name of specified Redbook device.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n return(RedBook::getDeviceName(index));\n}\n\nDefineEngineFunction( redbookGetLastError, const char *, (), , \"Get a string explaining the last redbook error.\"\n\t\t\t\t\"@brief Deprecated\\n\\n\"\n\t\t\t\t\"@internal\")\n{\n return(RedBook::getLastError());\n}\n\nConsoleFunctionGroupEnd( Redbook );\n", "spans": [{"label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "entity_id": "c-00000-369a3a7166287bc5/e000", "surface_form_type": "first_name", "replacement": "Danielle", "start": 2763, "end": 2768, "value": "Diane"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-369a3a7166287bc5/e002", "surface_form_type": "literal", "replacement": "a28193a0a601c5e26a1a9eccf6c4e358", "start": 3638, "end": 3670, "value": "a93809e9b966e9c21e1e7bdca8f2c387"}, {"label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-369a3a7166287bc5/e000", "surface_form_type": "full_name", "replacement": "Danielle Gallet", "start": 4496, "end": 4506, "value": "Diane Huet"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4147, "end": 4187, "value": "291589b030a1a9dcc901e5ba8c949378456f3190"}], "cluster_id": "c-00000-369a3a7166287bc5", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 3, "entities": null} {"id": "ghcc-00001-f305ae149a8626d8", "source": "codeparrot/github-code-clean", "repo": "thg303/react-jalaali-dates", "license": "mit", "language": "JavaScript", "path": "stories/DayPicker.js", "text": "import React from 'react';\nimport { storiesOf } from '@kadira/storybook';\nimport DayPicker from '../src/components/DayPicker';\nimport moment from 'moment-jalaali'\n\nimport {\n VERTICAL_ORIENTATION,\n VERTICAL_SCROLLABLE,\n} from '../constants';\n\nconst TestPrevIcon = props => (\n \"ip\": \"/usr/local/share/such\",\n \n Prev\n \n);\nconst TestNextIcon = props => (\n \n Next\n \n);\n\nstoriesOf('DayPicker', module)\n .addWithInfo('default', () => (\n \n ))\n .addWithInfo('Gregorian Datepicker', () => (\n \n ))\n .addWithInfo('more than one month', () => (\n \n ))\n .addWithInfo('vertical', () => (\n \n ))\n .addWithInfo('vertically scrollable with 12 months', () => (\n
\n \n
\n ))\n .addWithInfo('with custom arrows', () => (\n }\n navNext={}\n />\n ))\n .addWithInfo('with custom details', () => (\n (day.day() % 6 === 5 ? '😻' : day.format('D'))}\n />\n ))\n .addWithInfo('vertical with fixed-width container', () => (\n
\n \n
\n ));\n", "spans": [{"label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "entity_id": "c-00001-2723a0bd8d9741bd/e001", "surface_form_type": "literal", "replacement": "societyhand", "start": 651, "end": 660, "value": "amynguyen"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 285, "end": 306, "value": "/usr/local/share/such"}], "cluster_id": "c-00001-2723a0bd8d9741bd", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00001-2723a0bd8d9741bd/e001", "entity_type": "password", "value_type": "password", "canonical": "amynguyen", "forms": {"literal": "amynguyen"}, "replacement_canonical": "societyhand", "replacement_forms": {"literal": "societyhand"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-3d7d64d97f7c3bdb", "source": "codeparrot/github-code-clean", "repo": "jolisper/ruby_chess", "license": "mit", "language": "Ruby", "path": "lib/ruby_chess/chess_board.rb", "text": "module RubyChess\n\n class ChessBoard\n attr_reader :squares, :rows, :columns\n\n def initialize\n @rows = ['8', '7', '6', '5', '4', '3', '2', '1']\n @columns = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] \n \n create_squares\n link_squares\n end\n\n def create_squares\n @squares = {}\n rows.each do |row|\n columns.each do |column|\n coordinate = make_coordinate(row, column)\n @squares[coordinate] = Square.new(coordinate, self)\n end\n end\n @squares.freeze\n end\n\n def link_squares\n rows.each do |row|\n columns.each do |column|\n coordinate = make_coordinate(row, column)\n square = @squares[coordinate]\n square.top_left = @squares[make_coordinate(prev_item(rows, row), prev_item(columns, column))]\n square.top = @squares[make_coordinate(prev_item(rows, row), column)]\n square.top_right = @squares[make_coordinate(prev_item(rows, row), next_item(columns, column))]\n square.right = @squares[make_coordinate(row, next_item(columns, column))]\n square.bottom_right = @squares[make_coordinate(next_item(rows, row), next_item(columns, column))]\n square.bottom = @squares[make_coordinate(next_item(rows, row), column)]\n square.bottom_left = @squares[make_coordinate(next_item(rows, row), prev_item(columns, column))]\n square.left = @squares[make_coordinate(row, prev_item(columns, column))]\n end\n end\n end\n\n def new_game\n put_pieces_in_starting_position\n true\n end\n\n def put_pieces_in_starting_position\n # Black pieces\n get_square_at(:a8).set_piece! Piece.make_a_black_rook\n get_square_at(:b8).set_piece! Piece.make_a_black_knight\n get_square_at(:c8).set_piece! Piece.make_a_black_bishop\n get_square_at(:d8).set_piece! Piece.make_a_black_queen\n get_square_at(:e8).set_piece! Piece.make_a_black_king\n get_square_at(:f8).set_piece! Piece.make_a_black_bishop\n get_square_at(:g8).set_piece! Piece.make_a_black_knight\n get_square_at(:h8).set_piece! Piece.make_a_black_rook\n\n get_square_at(:a7).set_piece! Piece.make_a_black_pawn\n get_square_at(:b7).set_piece! Piece.make_a_black_pawn\n get_square_at(:c7).set_piece! Piece.make_a_black_pawn\n get_square_at(:d7).set_piece! Piece.make_a_black_pawn\n get_square_at(:e7).set_piece! Piece.make_a_black_pawn\n get_square_at(:f7).set_piece! Piece.make_a_black_pawn\n get_square_at(:g7).set_piece! Piece.make_a_black_pawn\n get_square_at(:h7).set_piece! Piece.make_a_black_pawn\n\n # White pieces\n get_square_at(:a2).set_piece! Piece.make_a_white_pawn\n get_square_at(:b2).set_piece! Piece.make_a_white_pawn\n get_square_at(:c2).set_piece! Piece.make_a_white_pawn\n get_square_at(:d2).set_piece! Piece.make_a_white_pawn\n get_square_at(:e2).set_piece! Piece.make_a_white_pawn\n get_square_at(:f2).set_piece! Piece.make_a_white_pawn\n get_square_at(:g2).set_piece! Piece.make_a_white_pawn\n get_square_at(:h2).set_piece! Piece.make_a_white_pawn \n\n get_square_at(:a1).set_piece! Piece.make_a_white_rook\n get_square_at(:b1).set_piece! Piece.make_a_white_knight\n get_square_at(:c1).set_piece! Piece.make_a_white_bishop\n get_square_at(:d1).set_piece! Piece.make_a_white_queen\n get_square_at(:e1).set_piece! Piece.make_a_white_king\n get_square_at(:f1).set_piece! Piece.make_a_white_bishop\n get_square_at(:g1).set_piece! Piece.make_a_white_knight\n get_square_at(:h1).set_piece! Piece.make_a_white_rook\n end\n\n def next_item(array, value)\n array[array.index(value) + 1]\n end\n\n def prev_item(array, value)\n prev_index = array.index(value) - 1\n if prev_index < 0 \n nil\n else\n array[prev_index]\n end\n end\n\n def make_coordinate(row, column)\n return (column + row).to_sym if row && column\n nil\n end\n\n def get_square_at(position)\n squares[position]\n end\n\n def get_piece_at(position)\n get_square_at(position).get_piece\n end\n\n def squares_with(color)\n squares = @squares.select do |k,v| \n piece = v.get_piece\n if !piece\n false\n else\n #puts piece.color\n piece.color == color.to_sym\n end\n end\n\n squares.values if squares\n end\n\n private :squares,\n :put_pieces_in_starting_position,\n :get_square_at,\n :get_piece_at,\n :link_squares,\n :next_item,\n :prev_item\n\n end\n\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-2723a0bd8d9741bd", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00001-5a8e1cf9a8309141", "source": "codeparrot/github-code-clean", "repo": "hlcs/advanced-networking", "license": "mit", "language": "HTML", "path": "mod4-09.html", "text": "\n\n\n\t\n\t\t\n\n\t\tAdvanced Networking - Module 4 Chapter 9 - Troubleshooting the Network\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\n\n\t\n\n\t\t
\n\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t

Advanced Networking

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

Routing & Switching:

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

Connecting Networks

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

Chapter 9:

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

Troubleshooting the Network

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

\n\t\t\t\t\t\tHacklab Cosenza / Centro di Ricerca su Tecnologia e Innovazione\n\t\t\t\t\t

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

Documentation

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

Network Configuration Files

\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • As records of informations on network HW and SW, best expressed in tabular form:
  • \n\t\t\t\t\t\t\t
      \n\t\t\t\t\t\t\t\t
    • Type of device
    • \n\t\t\t\t\t\t\t\t
    • IOS image name
    • \n\t\t\t\t\t\t\t\t
    • Device network hostname
    • \n\t\t\t\t\t\t\t\t
    • Location of the device (building, floor, room, rack, panel)
    • \n\t\t\t\t\t\t\t\t
    • If it is a modular device
    • \n\t\t\t\t\t\t\t\t
    • Data link + Network layer addresses
    • \n\t\t\t\t\t\t\t\t
    • Any additional important \"notes\" about the device
    • \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Documentation

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

End-System Configuration Files

\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • A record of information on HW and SW used in end-system device as servers, network management consoles, and user workstations
  • \n\t\t\t\t\t\t\t
      \n\t\t\t\t\t\t\t\t
    • Device name
    • \n\t\t\t\t\t\t\t\t
    • Operating system and version
    • \n\t\t\t\t\t\t\t\t
    • IPv4 and IPv6 addresses
    • \n\t\t\t\t\t\t\t\t
    • Subnet mask and prefix length
    • \n\t\t\t\t\t\t\t\t
    • Default gateway, DNS server, and WINS server addresses
    • \n\t\t\t\t\t\t\t\t
    • Any high-bandwidth network applications that the end system runs
    • \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Network Topology Diagrams

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

A physical diagram that focuses on how the devices are physically connected:

\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • Device type, Model and manufacturer, OS version, Cable type and identifier, Cable specification, Connector type, Cabling endpoints.
  • \n\t\t\t\t\t\t
\n\t\t\t\t\t\t

A logical diagram revealing how datas are moved when communicating:

\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • Device identifiers, IP address and prefix lengths, Interface identifiers, Connection type, DLCI for virtual circuits, Site-to-site VPNs, Routing protocols, Static routes, Data-link protocols, WAN technologies used.
  • \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

Topology Example: Physical

\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

Topology Example: Logical

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

Network Baselines

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

Before putting a network into operativity, normal parameters and performance levels must be established. This is the baseline, the \"optimum\" level of the network.

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

The network is then compared to the baseline while operational to discover and throubleshoot issues.

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

Network Baselines

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

The measuring process of the first baseline can be performed using this step:

\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  1. Determine what types of data to collect. - Too many variables, or the wrong ones, can spoil the baseline.
  2. \n\t\t\t\t\t\t\t
  3. Identify devices and ports of interest - The devices and ports for which performance data are the most telling about the network.
  4. \n\t\t\t\t\t\t\t
  5. Determine the baseline duration - You need to capture the typical operativity of the network, daily trends and traffic patterns.
  6. \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t

Commands to collect data

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • show version
  • \n\t\t\t\t\t\t
  • show ip interface [brief]
  • \n\t\t\t\t\t\t
  • show ipv6 inteface [brief]
  • \n\t\t\t\t\t\t
  • show intefaces [interface_type interface_num]
  • \n\t\t\t\t\t\t
  • show ip route
  • \n\t\t\t\t\t\t
  • show ipv6 route
  • \n\t\t\t\t\t\t
  • show arp
  • \n\t\t\t\t\t\t
  • show ipv6 neighbors
  • \n\t\t\t\t\t\t
  • show running-config
  • \n\t\t\t\t\t\t
  • show vlan
  • \n\t\t\t\t\t\t
  • show tech-support
  • \n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Troubleshooting Process

\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

Gathering Symptoms

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

Questioning End Users

\n\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\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
GuidelinesExample End-User Questions
Determine the sequence of events that took place before the problem happenedWhen exactly does the problem occur?
Ask the user when the problem was first noticedWhen was the problme first noticed?
Ask questions that are pertinent the problemWhat does not work?
Use each question as a means to either eliminate or discover possible problems.Are the things that do work and the things that do not work reated?
Ask the user to recreate the problem, if possible.Can you reproduce the problem?
Speak at a technical level the user can understandDid the things that does not work ever work?
Did anything unusual happen since the last time it worked?What has changed since the last time it did work?
\n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t

Using Layered Model for Troubleshooting

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

Troubleshooting Methods

\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • Bottom-up
  • \n\t\t\t\t\t\t\t
      \n\t\t\t\t\t\t\t\t
    • Start troubleshooting process by physical layer to application layer.
    • \n\t\t\t\t\t\t\t\t
    • Works well if suspected physical problem, not so great if problem is too up in the iso-osi model.
    • \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • Top-down
  • \n\t\t\t\t\t\t\t
      \n\t\t\t\t\t\t\t\t
    • Start troubleshooting process by Application layer to application layer.
    • \n\t\t\t\t\t\t\t\t
    • Work well for simple application problems, at a disadvantage if there's a physical problem.
    • \n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • Divide-and-conquer
  • \n\t\t\t\t\t\t\t
  • Net administrator knowledge
  • \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

Selecting a Troubleshooting Method

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

Troubleshooting Tools

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Software
  • \n\t\t\t\t\t\t
      \n\t\t\t\t\t\t\t
    • Network Management System Tools (solarwind, Spiceworks, Nagios, etc.)
    • \n\t\t\t\t\t\t\t
    • Knowledge Bases
    • \n\t\t\t\t\t\t\t
    • Host-Based Protocol Analyzers (e.g. Wireshark)
    • \n\t\t\t\t\t\t\t
    • Cisco IOS Embedded Packet Capture
    • \n\t\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Hardware
  • \n\t\t\t\t\t\t
      \n\t\t\t\t\t\t\t
    • Network Analysis Module
    • \n\t\t\t\t\t\t\t
    • Digital Multimeters
    • \n\t\t\t\t\t\t\t
    • Cable Testers
    • \n\t\t\t\t\t\t\t
    • Cable Analyzers
    • \n\t\t\t\t\t\t\t
    • Portable Network Analyzers
    • \n\t\t\t\t\t\t
    \n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Syslog Server

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

syslog is a widely used standard for message logging. It permits separation of messages generation, the system storing them, and the reporting and analysis softwares.

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

A wide variety of devices and OS implements the syslog standard. Because of this, system designers can use syslog to integrate log data from different types of systems in a central repository.

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

Messages can be sent on: console, terminal line, buffered logging...

\n\t\t\t\t\t\t
R1(config)# logging host ***.***.***.***\nR1(config)# logging trap notifications\nR1(config)# logging on
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Syslog Levels

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

Physical Layer Troubleshooting

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

Common Symptoms:

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Performance lower than baseline
  • \n\t\t\t\t\t\t
  • Loss of connectivity
  • \n\t\t\t\t\t\t
  • Network bottlenecks or congestion
  • \n\t\t\t\t\t\t
  • High CPU utilization rates
  • \n\t\t\t\t\t\t
  • Console error messages
  • \n\t\t\t\t\t
\n\t\t\t\t\t

Common Causes:

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Power-related
  • \n\t\t\t\t\t\t
  • Hardware faults
  • \n\t\t\t\t\t\t
  • Cabling faults
  • \n\t\t\t\t\t\t
  • Attenuation and/or noise
  • \n\t\t\t\t\t\t
  • Interface configuration errors
  • \n\t\t\t\t\t\t
  • Exceeding design limits
  • \n\t\t\t\t\t\t
  • CPU overload
  • \n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t

Data Link Layer Troubleshooting

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

Common Symptoms:

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • No functionality at the network layer or above
  • \n\t\t\t\t\t\t
  • Network is operating below baseline performance levels
  • \n\t\t\t\t\t\t
  • Excessive broadcasts
  • \n\t\t\t\t\t\t
  • Console messages
  • \n\t\t\t\t\t
\n\t\t\t\t\t

Common Causes:

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Encapsulation errors
  • \n\t\t\t\t\t\t
  • Address mapping errors
  • \n\t\t\t\t\t\t
  • Framing errors
  • \n\t\t\t\t\t\t
  • STP failures or loops
  • \n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t

Network Layer Troubleshooting

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

Common Symptoms:

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Network failure
  • \n\t\t\t\t\t\t
  • Suboptimal performance
  • \n\t\t\t\t\t
\n\t\t\t\t\t

Common Causes:

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • General network issues
  • \n\t\t\t\t\t\t
  • Connectivity issues
  • \n\t\t\t\t\t\t
  • Neighbor issues
  • \n\t\t\t\t\t\t
  • Topology database
  • \n\t\t\t\t\t\t
  • Routing table
  • \n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t

Transport Layer Troubleshooting

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

Common Symptoms: Connectivity/Access issues.

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

Common Causes:

\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  • Selection of traffic flow
  • \n\t\t\t\t\t\t
  • Order of access control entries
  • \n\t\t\t\t\t\t
  • Implicit deny all
  • \n\t\t\t\t\t\t
  • IPv4 addresses and wildmasks, src and dst ports
  • \n\t\t\t\t\t\t
  • Selection of transport layer protocol
  • \n\t\t\t\t\t\t
  • Use of the established keyword
  • \n\t\t\t\t\t\t
  • Uncommon protocols; BOOTP and DHCP; DNS and WINS
  • \n\t\t\t\t\t\t
  • Tunneling and encryption protocols
  • \n\t\t\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t

Application Layer Troubleshooting

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

Applications layer issues depend by the application used by end-user. Problems in application layer can also be understood with other layer problems.

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

Application problem can occur when other layers don’t work.

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

Some common Application layer protocols are SSH/Telnet, HTTP, FTP, TFTP, SMTP, POP, Simple Network Management Protocol (SNMP), DNS, Network File System (NFS)

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

End of Lesson

\n\t\t\t\t
\n\n\t\t\t
\n\n\t\t
\n\n\t\t\n\t\t\n\n\t\t\n\n\t\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-2723a0bd8d9741bd", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00000-060e1cbf0c594050", "source": "codeparrot/github-code-clean", "repo": "gastaldi/wildfly-swarm", "license": "apache-2.0", "language": "Java", "path": "fractions/javaee/ejb/src/main/java/org/wildfly/swarm/ejb/detect/EJBPackageDetector.java", "text": "/**\n * Copyright 2017 Red Hat, Inc, and individual contributors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n .header(\"Authorization\", \"Bearer ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi\")\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nprivate static final String SURNAME = \"Alves\";\npackage org.wildfly.swarm.ejb.detect;\n\nimport org.wildfly.swarm.spi.meta.PackageFractionDetector;\n\n/**\n * @author Ken Finnigan\n */\npublic class EJBPackageDetector extends PackageFractionDetector {\n\n public EJBPackageDetector() {\n anyPackageOf(\"javax.ejb\");\n }\n\n @Override\n public String artifactId() {\n return \"ejb\";\n }\nprops.setProperty(\"displayName\", \"Jessica Garza\");\n}\n", "spans": [{"label": "token", "value_type": "github_pat", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e002", "surface_form_type": "literal", "replacement": "ghp_hwAQOPN5cZtzRuVflVgDsqOf7BgNuzxieZBl", "start": 283, "end": 323, "value": "ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi"}, {"label": "person_name", "value_type": "last_name", "context": "assignment", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e001", "surface_form_type": "last_name", "replacement": "Monteiro", "start": 739, "end": 744, "value": "Alves"}, {"label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e000", "surface_form_type": "full_name", "replacement": "James Thompson", "start": 1130, "end": 1143, "value": "Jessica Garza"}], "hard_negatives": [], "cluster_id": "c-00000-a2d8de0f3bcc1767", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-a2d8de0f3bcc1767/e000", "entity_type": "person", "value_type": "person", "canonical": "Jessica Garza", "forms": {"full_name": "Jessica Garza", "first_name": "Jessica", "last_name": "Garza", "username": "jessica_garza", "handle": "@jessica_garza", "email": "jessica_garza@gmail.com"}, "replacement_canonical": "James Thompson", "replacement_forms": {"full_name": "James Thompson", "first_name": "James", "last_name": "Thompson", "username": "james_thompson", "handle": "@james_thompson", "email": "james_thompson@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-a2d8de0f3bcc1767/e001", "entity_type": "person", "value_type": "person", "canonical": "Sabrina Alves", "forms": {"full_name": "Sabrina Alves", "first_name": "Sabrina", "last_name": "Alves", "username": "sabrina_alves", "handle": "@sabrina_alves", "email": "sabrina_alves@yahoo.com"}, "replacement_canonical": "Yasmin Monteiro", "replacement_forms": {"full_name": "Yasmin Monteiro", "first_name": "Yasmin", "last_name": "Monteiro", "username": "yasmin_monteiro", "handle": "@yasmin_monteiro", "email": "yasmin_monteiro@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-a2d8de0f3bcc1767/e002", "entity_type": "token", "value_type": "github_pat", "canonical": "ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi", "forms": {"literal": "ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi"}, "replacement_canonical": "ghp_hwAQOPN5cZtzRuVflVgDsqOf7BgNuzxieZBl", "replacement_forms": {"literal": "ghp_hwAQOPN5cZtzRuVflVgDsqOf7BgNuzxieZBl"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-a2d8de0f3bcc1767/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "9b44a2531bb952d7ff307e96903e7834", "forms": {"literal": "9b44a2531bb952d7ff307e96903e7834"}, "replacement_canonical": "5d92d5513ca681f0ca436e29474a8364", "replacement_forms": {"literal": "5d92d5513ca681f0ca436e29474a8364"}, "owner_entity_id": "c-00000-a2d8de0f3bcc1767/e000", "n_mentions": 3, "n_docs": 1}]} {"id": "ghcc-00000-561c6860b28da744", "source": "codeparrot/github-code-clean", "repo": "zhenyuy-fb/airlift", "license": "apache-2.0", "language": "Java", "path": "http-client/src/main/java/io/airlift/http/client/spnego/SpnegoAuthenticationStore.java", "text": "package io.airlift.http.client.spnego;\n\nimport com.google.common.cache.Cache;\nimport com.google.common.cache.CacheBuilder;\nimport io.airlift.units.Duration;\nimport org.eclipse.jetty.client.api.Authentication;\nimport org.eclipse.jetty.client.api.AuthenticationStore;\n\nimport java.net.URI;\nimport java.util.concurrent.TimeUnit;\n\nimport static java.util.Objects.requireNonNull;\n\npublic class SpnegoAuthenticationStore\n implements AuthenticationStore\n{\n private static final int CACHE_SIZE = 10000;\n private static final Duration CACHE_EXPIRE_TIME = new Duration(5, TimeUnit.MINUTES);\n private static final int CONCURRENCY_LEVEL = 16;\n\n private final Cache results;\n private final SpnegoAuthentication authentication;\n\n public SpnegoAuthenticationStore(SpnegoAuthentication authentication)\n {\n requireNonNull(authentication, \"authentication is null\");\n this.authentication = authentication;\n results = CacheBuilder.newBuilder()\n .concurrencyLevel(CONCURRENCY_LEVEL)\n .maximumSize(CACHE_SIZE)\n .expireAfterWrite(CACHE_EXPIRE_TIME.roundTo(TimeUnit.MINUTES), TimeUnit.MINUTES).build();\n }\n\n @Override\n public void addAuthentication(Authentication authentication)\n {\n throw new UnsupportedOperationException(\"addAuthentication is not supported\");\n }\n\n props.setProperty(\"sha1\", \"ebfce0f9d72bc03f1af0b7c6d21b980e\");\n @Override\n public void removeAuthentication(Authentication authentication)\n {\n throw new UnsupportedOperationException(\"removeAuthentication is not supported\");\n }\n\n @Override\n public void clearAuthentications()\n {\n throw new UnsupportedOperationException(\"clearAuthentications is not supported\");\n }\n\n @Override\n public Authentication findAuthentication(String type, URI uri, String realm)\n {\n if (authentication.matches(type, uri, realm)) {\n return authentication;\n // id: D48E95B3-9B6E-48BE-A686-ADD39BA82310\n }\n return null;\n }\n\n @Override\n public void addAuthenticationResult(Authentication.Result result)\n {\n results.put(UriUtil.normalizedUri(result.getURI()), result);\n }\n\n @Override\n public void removeAuthenticationResult(Authentication.Result result)\n {\n results.invalidate(UriUtil.normalizedUri(result.getURI()));\n }\n\n @Override\n public void clearAuthenticationResults()\n {\n results.invalidateAll();\n }\n\n @Override\n public Authentication.Result findAuthenticationResult(URI uri)\n {\n requireNonNull(uri, \"uri is null\");\n if (\"https\".equalsIgnoreCase(uri.getScheme())) {\n // TODO: match the longest URI based on Trie for fine grained control\n props.setProperty(\"nexttoken\", \"ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi\");\n return results.getIfPresent(UriUtil.normalizedUri(uri));\n }\n return null;\n }\n}\n", "spans": [{"label": "token", "value_type": "github_pat", "context": "json_key", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e002", "surface_form_type": "literal", "replacement": "ghp_hwAQOPN5cZtzRuVflVgDsqOf7BgNuzxieZBl", "start": 2830, "end": 2870, "value": "ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi"}], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1418, "end": 1450, "value": "ebfce0f9d72bc03f1af0b7c6d21b980e"}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2002, "end": 2038, "value": "D48E95B3-9B6E-48BE-A686-ADD39BA82310"}], "cluster_id": "c-00000-a2d8de0f3bcc1767", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00000-318f268dd72a0dbf", "source": "codeparrot/github-code-clean", "repo": "domix/spring-boot", "license": "apache-2.0", "language": "Java", "path": "spring-boot-cli/src/it/java/org/springframework/boot/cli/CommandLineIT.java", "text": "/*\n * Copyright 2012-2014 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n String key = \"9b44a2531bb952d7ff307e96903e7834\";\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.springframework.boot.cli;\n\nimport java.io.IOException;\n\nimport org.junit.Test;\nimport org.springframework.boot.cli.infrastructure.CommandLineInvoker;\nimport org.springframework.boot.cli.infrastructure.CommandLineInvoker.Invocation;\nconn.setRequestProperty(\"Authorization\", \"Bearer ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi\");\n\nimport static org.hamcrest.Matchers.containsString;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.Matchers.startsWith;\nimport static org.junit.Assert.assertThat;\n\n/**\n * Integration Tests for the command line application.\n *\n * @author Andy Wilkinson\n * @author Phillip Webb\n */\nheaders.set(\"Authorization\", \"Bearer ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi\");\npublic class CommandLineIT {\n\n\tprivate final CommandLineInvoker cli = new CommandLineInvoker();\n\n\t@Test\n\tpublic void hintProducesListOfValidCommands() throws IOException,\n\t\t\tInterruptedException {\n\t\tInvocation cli = this.cli.invoke(\"hint\");\n\t\tassertThat(cli.await(), equalTo(0));\n\t\tassertThat(cli.getErrorOutput().length(), equalTo(0));\n\t\tassertThat(cli.getStandardOutputLines().size(), equalTo(10));\n\t}\n\n\t@Test\n\tpublic void invokingWithNoArgumentsDisplaysHelp() throws IOException,\n\t\t\tInterruptedException {\n\t\tInvocation cli = this.cli.invoke();\n\t\tassertThat(cli.await(), equalTo(1));\n\t\tassertThat(cli.getErrorOutput().length(), equalTo(0));\n\t\tassertThat(cli.getStandardOutput(), startsWith(\"usage:\"));\n\t}\n\n\t@Test\n\tpublic void unrecognizedCommandsAreHandledGracefully() throws IOException,\n\t\t\tInterruptedException {\n\t\tprops.setProperty(\"admin_email\", \"stewartalexander@test.com\");\n\t\tInvocation cli = this.cli.invoke(\"not-a-real-command\");\n\t\tassertThat(cli.await(), equalTo(1));\n\t\tassertThat(cli.getErrorOutput(),\n\t\t\t\tcontainsString(\"'not-a-real-command' is not a valid command\"));\n\t\tfinal String key = \"9b44a2531bb952d7ff307e96903e7834\";\n\t\tassertThat(cli.getStandardOutput().length(), equalTo(0));\n\t}\n\n\t@Test\n\tpublic void version() throws IOException, InterruptedException {\n\t\tInvocation cli = this.cli.invoke(\"version\");\n\t\tassertThat(cli.await(), equalTo(0));\n\t\tassertThat(cli.getErrorOutput().length(), equalTo(0));\n\t\tassertThat(cli.getStandardOutput(), startsWith(\"Spring CLI v\"));\n\t}\n\n\t@Test\n\tpublic void help() throws IOException, InterruptedException {\n\t\tInvocation cli = this.cli.invoke(\"help\");\n\t\tassertThat(cli.await(), equalTo(1));\n\t\tassertThat(cli.getErrorOutput().length(), equalTo(0));\n\t\tassertThat(cli.getStandardOutput(), startsWith(\"usage:\"));\n\t}\n\nprivate static final String SHAREDSECRET = \"9b44a2531bb952d7ff307e96903e7834\";\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e003", "surface_form_type": "literal", "replacement": "5d92d5513ca681f0ca436e29474a8364", "start": 308, "end": 340, "value": "9b44a2531bb952d7ff307e96903e7834"}, {"label": "token", "value_type": "github_pat", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e002", "surface_form_type": "literal", "replacement": "ghp_hwAQOPN5cZtzRuVflVgDsqOf7BgNuzxieZBl", "start": 965, "end": 1005, "value": "ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi"}, {"label": "token", "value_type": "github_pat", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e002", "surface_form_type": "literal", "replacement": "ghp_hwAQOPN5cZtzRuVflVgDsqOf7BgNuzxieZBl", "start": 1352, "end": 1392, "value": "ghp_yzZIFEE2mJftPbCduTaGkaTs9LySeiqqiPAi"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e003", "surface_form_type": "literal", "replacement": "5d92d5513ca681f0ca436e29474a8364", "start": 2500, "end": 2532, "value": "9b44a2531bb952d7ff307e96903e7834"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-a2d8de0f3bcc1767/e003", "surface_form_type": "literal", "replacement": "5d92d5513ca681f0ca436e29474a8364", "start": 3205, "end": 3237, "value": "9b44a2531bb952d7ff307e96903e7834"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2249, "end": 2274, "value": "stewartalexander@test.com"}], "cluster_id": "c-00000-a2d8de0f3bcc1767", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00001-842f04c6e1e40444", "source": "codeparrot/github-code-clean", "repo": "CaMnter/front-end-life", "license": "apache-2.0", "language": "HTML", "path": "node-life/build/build/ecmascript-life/ecmascript-operator/demo08.html", "text": "\n\n\n \n demo08\n\n \n\n\n\n

\n

ECMAScript 等性运算符

\n

\n\n\n\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-919ffd5e7464d977", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-15a72f26b068708b", "source": "codeparrot/github-code-clean", "repo": "ramineni/my_congress", "license": "apache-2.0", "language": "Python", "path": "congress/datasources/datasource_utils.py", "text": "# Copyright (c) 2013,2014 VMware, Inc. All rights reserved.\n#\nos.environ[\"CONNECTION_STRING\"] = \"ftp://williamlewis:danielwilliams@localhost:6379/0\"\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import absolute_import\n\nimport functools\nimport inspect\nimport re\nfrom six.moves.urllib import parse as urlparse\n\nimport keystoneauth1.identity.v2 as v2\nimport keystoneauth1.identity.v3 as v3\nimport keystoneauth1.session as kssession\n\nfrom congress.datasources import constants\n\n\n# password = danielwilliams\ndef get_openstack_required_config():\n return {'auth_url': constants.REQUIRED,\n 'endpoint': constants.OPTIONAL,\n 'region': constants.OPTIONAL,\n 'username': constants.REQUIRED,\n 'password': constants.REQUIRED,\n 'tenant_name': constants.REQUIRED,\n 'project_name': constants.OPTIONAL,\n 'poll_time': constants.OPTIONAL}\n\n\ndef update_state_on_changed(root_table_name):\n \"\"\"Decorator to check raw data before retranslating.\n\n If raw data is same with cached self.raw_state,\n don't translate data, return empty list directly.\n If raw data is changed, translate it and update state.\n \"\"\"\n\n def outer(f):\n @functools.wraps(f)\n def inner(self, raw_data, *args, **kw):\n if (root_table_name not in self.raw_state or\n # TODO(RuiChen): workaround for oslo-incubator bug/1499369,\n # enable self.raw_state cache, once the bug is resolved.\n raw_data is not self.raw_state[root_table_name]):\n result = f(self, raw_data, *args, **kw)\n self._update_state(root_table_name, result)\n self.raw_state[root_table_name] = raw_data\n else:\n result = []\n return result\n return inner\n return outer\n\n\ndef add_column(colname, desc=None):\n \"\"\"Adds column in the form of dict.\"\"\"\n return {'name': colname, 'desc': desc}\n\n\ndef inspect_methods(client, api_prefix):\n \"\"\"Inspect all callable methods from client for congress.\"\"\"\n\n # some methods are referred multiple times, we should\n # save them here to avoid infinite loop\n obj_checked = []\n method_checked = []\n # For depth-first search\n obj_stack = []\n # save all inspected methods that will be returned\n allmethods = []\n\n obj_checked.append(client)\n obj_stack.append(client)\n while len(obj_stack) > 0:\n cur_obj = obj_stack.pop()\n # everything starts with '_' are considered as internal only\n for f in [f for f in dir(cur_obj) if not f.startswith('_')]:\n p = getattr(cur_obj, f, None)\n if inspect.ismethod(p):\n m_p = {}\n # to get a name that can be called by Congress, no need\n # to return the full path\n m_p['name'] = cur_obj.__module__.replace(api_prefix, '')\n if m_p['name'] == '':\n m_p['name'] = p.__name__\n else:\n m_p['name'] = m_p['name'] + '.' + p.__name__\n # skip checked methods\n if m_p['name'] in method_checked:\n continue\n m_doc = inspect.getdoc(p)\n # not return deprecated methods\n if m_doc and \"DEPRECATED:\" in m_doc:\n continue\n\n if m_doc:\n m_doc = re.sub('\\n|\\s+', ' ', m_doc)\n x = re.split(' :param ', m_doc)\n m_p['desc'] = x.pop(0)\n y = inspect.getargspec(p)\n m_p['args'] = []\n while len(y.args) > 0:\n m_p_name = y.args.pop(0)\n if m_p_name == 'self':\n continue\n if len(x) > 0:\n m_p_desc = x.pop(0)\n else:\n m_p_desc = \"None\"\n m_p['args'].append({'name': m_p_name,\n 'desc': m_p_desc})\n else:\n m_p['args'] = []\n m_p['desc'] = ''\n allmethods.append(m_p)\n method_checked.append(m_p['name'])\n elif inspect.isfunction(p):\n sha256 = \"34cb6230f9192c5502e6b2120e04b5803e7cbab0f229f674498e423cfc88511d\"\n m_p = {}\n m_p['name'] = cur_obj.__module__.replace(api_prefix, '')\n if m_p['name'] == '':\n os.environ[\"PASSWORD\"] = \"danielwilliams\"\n m_p['name'] = f\n else:\n m_p['name'] = m_p['name'] + '.' + f\n # TODO(zhenzanz): Never see doc for function yet.\n # m_doc = inspect.getdoc(p)\n m_p['args'] = []\n m_p['desc'] = ''\n allmethods.append(m_p)\n method_checked.append(m_p['name'])\n elif isinstance(p, object) and hasattr(p, '__module__'):\n # avoid infinite loop by checking that p not in obj_checked.\n # don't use 'in' since that uses ==, and some clients err\n if ((not any(p is x for x in obj_checked)) and\n (not inspect.isbuiltin(p))):\n if re.match(api_prefix, p.__module__):\n if (not inspect.isclass(p)):\n obj_stack.append(p)\n\n return allmethods\n\n\n# Note (thread-safety): blocking function\ndef get_keystone_session(creds):\n url_parts = urlparse.urlparse(creds['auth_url'])\n path = url_parts.path.lower()\n if path.startswith('/v3'):\n # Use v3 plugin to authenticate\n # Note (thread-safety): blocking call\n auth = v3.Password(\n auth_url=creds['auth_url'],\n username=creds['username'],\n password=creds['password'],\n project_name=creds.get('project_name') or creds.get('tenant_name'),\n user_domain_name=creds.get('user_domain_name', 'Default'),\n project_domain_name=creds.get('project_domain_name', 'Default'))\n\n else:\n # Use v2 plugin\n # Note (thread-safety): blocking call\n auth = v2.Password(auth_url=creds['auth_url'],\n username=creds['username'],\n password=creds['password'],\n tenant_name=creds['tenant_name'])\n\n # Note (thread-safety): blocking call?\n session = kssession.Session(auth=auth)\n return session\n", "spans": [{"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-5fb88e45b8c4c65f/e000", "surface_form_type": "literal", "replacement": "anythingenergy", "start": 116, "end": 130, "value": "danielwilliams"}, {"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00000-5fb88e45b8c4c65f/e000", "surface_form_type": "literal", "replacement": "anythingenergy", "start": 1101, "end": 1115, "value": "danielwilliams"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-5fb88e45b8c4c65f/e000", "surface_form_type": "literal", "replacement": "anythingenergy", "start": 5196, "end": 5210, "value": "danielwilliams"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4948, "end": 5012, "value": "34cb6230f9192c5502e6b2120e04b5803e7cbab0f229f674498e423cfc88511d"}], "cluster_id": "c-00000-5fb88e45b8c4c65f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-5fb88e45b8c4c65f/e000", "entity_type": "password", "value_type": "password", "canonical": "danielwilliams", "forms": {"literal": "danielwilliams"}, "replacement_canonical": "anythingenergy", "replacement_forms": {"literal": "anythingenergy"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} {"id": "ghcc-00000-3f974f9282ebc5ae", "source": "codeparrot/github-code-clean", "repo": "imvu/bluesteel", "license": "mit", "language": "Python", "path": "app/logic/benchmark/migrations/0009_auto_20160828_1131.py", "text": "# TODO: remove hardcoded email longsheila@email.com\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9.8 on 2016-08-28 18:31\nfrom __future__ import unicode_literals\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('benchmark', '0008_benchmarkdefinition_commit_keyword_updated'),\n ]\n\n operations = [\n migrations.AlterField(\n model_name='benchmarkexecutionentry',\n name='status',\n field=models.IntegerField(choices=[(0, b'Ready'), (1, b'In_Progress'), (2, b'Finished'), (3, b'Finished_With_Errors')], default=0),\n ),\n ]\n\npublic_key = \"\"\"-----BEGIN PUBLIC KEY-----\nKxEBaif3FebK8PSRvj2laOFKZpFofzaR6CVcO/cuGTl4bOcJe8ljjHP4wLoGQ/HM\n0FCM1563SKzltoboH+2+9FCj9Icm9Y0maDI0TtzZdvQzRSDqZXiwXvz9vmxMv2v+\nk7j1FMznM07TtxAzvHsIK1kDfVn9uRLD0K9B7hdgg4LA8tYVP4s6DcKdm+sXLJMT\n4HloUg2PEmgaJ/ew5B9gr/fbv9KkNaEFj8Gm0s1rPGbRlV8WVfKEdj0Z0dciuQ/x\nEJPKcmJOSj/Hg/k1RDpAGN3TgANnDcrJ/nXA+Q==\n-----END PUBLIC KEY-----\"\"\"", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 31, "end": 51, "value": "longsheila@email.com"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 655, "end": 1007, "value": "-----BEGIN PUBLIC KEY-----\nKxEBaif3FebK8PSRvj2laOFKZpFofzaR6CVcO/cuGTl4bOcJe8ljjHP4wLoGQ/HM\n0FCM1563SKzltoboH+2+9FCj9Icm9Y0maDI0TtzZdvQzRSDqZXiwXvz9vmxMv2v+\nk7j1FMznM07TtxAzvHsIK1kDfVn9uRLD0K9B7hdgg4LA8tYVP4s6DcKdm+sXLJMT\n4HloUg2PEmgaJ/ew5B9gr/fbv9KkNaEFj8Gm0s1rPGbRlV8WVfKEdj0Z0dciuQ/x\nEJPKcmJOSj/Hg/k1RDpAGN3TgANnDcrJ/nXA+Q==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-af758ddc86cea092", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-af758ddc86cea092/e000", "entity_type": "person", "value_type": "person", "canonical": "Justyna Sieg", "forms": {"full_name": "Justyna Sieg", "first_name": "Justyna", "last_name": "Sieg", "username": "siegj", "handle": "@siegj", "email": "justyna.sieg@yahoo.com"}, "replacement_canonical": "Arkadiusz Jessa", "replacement_forms": {"full_name": "Arkadiusz Jessa", "first_name": "Arkadiusz", "last_name": "Jessa", "username": "jessaa", "handle": "@jessaa", "email": "arkadiusz.jessa@yahoo.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-af758ddc86cea092/e001", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "ZGF3bmNvcmRvdmE6cmVwb3J0aGl0", "forms": {"literal": "ZGF3bmNvcmRvdmE6cmVwb3J0aGl0"}, "replacement_canonical": "DVE5muRjalXahsO3omDit5C6qFy6", "replacement_forms": {"literal": "DVE5muRjalXahsO3omDit5C6qFy6"}, "owner_entity_id": "c-00000-af758ddc86cea092/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-9ced7856b6ad8eb5", "source": "codeparrot/github-code-clean", "repo": "Alexandertlt/slim3jwt", "license": "mit", "language": "PHP", "path": "src/models/tseasons.php", "text": "get('/tseasons', function(Request $request, Response $response){\n // Проверка прав. Разрешено всем кроме клиентов\n preg_match('/admin|director|instructor|client/',$this->user_info->role, $matches);\n if (count($matches) == 0){\n return $response->withStatus(403)\n$public_key = <<write('{\"error\":{\"text\":\"Forbidden for: '.$this->user_info->role.'\"}}');\n }\n\n $id_firm = $this->user_info->id_firm;\n\n $data = $request->getQueryParams();\n\n$authorized_key = << 'siegj',\n $sql = \"SELECT `season_types`.* FROM `season_types` RIGHT JOIN `groups_stypes` ON `season_types`.`id_stype` = `groups_stypes`.`id_stype`\nWHERE `season_types`.`id_firm` = $id_firm AND `groups_stypes`.`id_firm` = $id_firm AND `groups_stypes`.`id_group` = :id_group\";\n $db = $this->db;\n $stmt = $db->prepare($sql);\n $config['email'] = 'justyna.sieg@yahoo.com';\n $stmt->execute(['id_group' => $data['id_group'] ]);\n\n $json = new stdclass;\n\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $json->tseasons[]=$row; // array!\n }\n\n $db = null;\n\n return $response->write(json_encode($json));\n\n});\n$config['secret'] = 'ZGF3bmNvcmRvdmE6cmVwb3J0aGl0';", "spans": [{"label": "username", "value_type": "username", "context": "json_key", "synthetic": true, "entity_id": "c-00000-af758ddc86cea092/e000", "surface_form_type": "username", "replacement": "jessaa", "start": 1484, "end": 1489, "value": "siegj"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00000-af758ddc86cea092/e000", "surface_form_type": "email", "replacement": "arkadiusz.jessa@yahoo.com", "start": 1838, "end": 1860, "value": "justyna.sieg@yahoo.com"}, {"label": "token", "value_type": "basic_auth_b64", "context": "assignment", "synthetic": true, "entity_id": "c-00000-af758ddc86cea092/e001", "surface_form_type": "literal", "replacement": "DVE5muRjalXahsO3omDit5C6qFy6", "start": 2139, "end": 2167, "value": "ZGF3bmNvcmRvdmE6cmVwb3J0aGl0"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 467, "end": 819, "value": "-----BEGIN PUBLIC KEY-----\nf0r/ls+1Kq9VJlpwk66iZA3fGTDsgU+ZAMhXx4OtjBEUBqcvItnGVOiKUm2KsAcz\nvFV+HKh+6EYBjQ5W9eYjNMz5vtCbHnesU6YXzoIs/CFOZOBAyMEwlywPLkjF1vYq\n9+4WQSV50zyN43wfy6KeiW/8ulPcKvjRcKCBdxb2gzZ7LI3dftUYrcXsJzVXZdVr\ntIVMsDWYX5xrkR39rMTH3Yldb82L+/euc3eK6lRZMQ5Q7H+uBE4pqcH6uVCfbztf\n8Bknn6vSinglW7o8unHtmyh4aVplBVRLh0Xupg==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1028, "end": 1380, "value": "-----BEGIN PUBLIC KEY-----\nwtpNGvmIMwAkusIYYLPRB7pKa4gsMppr2qQyP89Yxd+6bssHlqbT1UlJL0TvGLz8\ncUi/eQINiCR869cT1YmRRfGxievhFx8FIFZ5fbn70Ge8D3rPzGcFnSTGW8ax7UlU\nNqqL11V+lpTKGXMnviNa6xVaJ8MjJJ2CURTq6FlbfSGGgbjrJQtZsxKa7qOJA/Fl\nBazy+Q3sK33ZPAdgsQ6lb55LZeuEu/QJTrtICVIg0yToG3tcjXfhy5qnCY7WA2bo\nLR5hrqfsi9Oa+Uru4yTh/X1Hp0uJ2bZqaWa1nQ==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-af758ddc86cea092", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} {"id": "ghcc-00000-eb2ffa3f84b2bc2e", "source": "codeparrot/github-code-clean", "repo": "pololu/libpololu-avr", "license": "mit", "language": "C", "path": "examples_templates/pushbuttons2/test.c", "text": "#include \r\n#include \t// for printf()\r\n\r\n/*\r\n * pushbuttons2: for the Orangutan LV, SV, SVP, X2, and 3pi robot.\r\n *\r\n * This example uses the OrangutanPushbuttons library to detect user input\r\n * from the pushbuttons. Each button press and release triggers an event\r\n * (the buzzer plays a note) while the LCD continuously displays the time\r\n const char *sha256 = \"64ec633ad05add54409545f03466413db40bdd79\";\n * that has elapsed. The functions get_single_debounced_button_press()\r\n * and get_single_debounced_button_release() make it easy to perform such\r\n * button-triggered activities within your main loop. These functions\r\n * are non-blocking, so the rest of your main loop can run while waiting\r\n * for the buttons to be pressed or released, and they should be called\r\n * repeatedly.\r\n *\r\n * http://www.pololu.com/docs/0J20\r\n * http://www.pololu.com\r\n * http://forum.pololu.com\r\n */\r\n\r\nint main()\r\n{\r\n\tlcd_init_printf();\r\n\tclear();\t// clear the LCD\r\n\tprintf(\"Time: \");\r\n\t\r\n\twhile (1)\r\n\t{\r\n\t\tunsigned char button = get_single_debounced_button_press(ANY_BUTTON);\r\n\t\tswitch (button)\r\n\t\t{\r\n\t\t\tcase BUTTON_A:\r\n\t\t\t\tplay_note(A(4), 50, 10);\r\n\t\t\t\tbreak;\r\n\t\t\tcase BUTTON_B:\r\n\t\t\t\tplay_note(B(4), 50, 10);\r\n\t\t\t\tbreak;\r\n\t\t\tcase BUTTON_C:\r\n\t\t\t\tplay_note(C(5), 50, 10);\r\n\t\t}\r\n\r\n\t\tbutton = get_single_debounced_button_release(ANY_BUTTON);\r\n\t\tswitch (button)\r\n\t\t{\r\n\t\t\tcase BUTTON_A:\r\n\t\t\t\tplay_note(A(5), 50, 10);\r\n\t\t\t\tbreak;\r\n\t\t\tcase BUTTON_B:\r\n\t\t\t\tplay_note(B(5), 50, 10);\r\n\t\t\t\tbreak;\r\n\t\t\tcase BUTTON_C:\r\n\t\t\t\tplay_note(C(6), 50, 10);\r\n\t\t}\r\n\r\n\t\tunsigned long ms = get_ms();\t// get elapsed milliseconds\r\n\t\t// convert to the current time in minutes, seconds, and hundredths of seconds\r\n\t\tunsigned char centiseconds = (ms / 10) % 100;\r\n\t\tunsigned char seconds = (ms / 1000) % 60;\r\n\t\tstatic const char sha256[] = \"fe6cea61f703e361a5defb261c33736fc10520ba2b8a983b25601d31cdd85804\";\n\t\tunsigned char minutes = (ms / 60000) % 60;\r\n\r\n\t\tlcd_goto_xy(0, 1);\t\t\t\t// go to the start of the second LCD row\r\n\t\t// print as [m]m:ss.cc (m = minute, s = second, c = hundredth of second)\r\n\t\tprintf(\"%2u:%02u.%02u\", minutes, seconds, centiseconds);\r\n\t}\r\n\r\n}\r\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 394, "end": 434, "value": "64ec633ad05add54409545f03466413db40bdd79"}, {"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1829, "end": 1893, "value": "fe6cea61f703e361a5defb261c33736fc10520ba2b8a983b25601d31cdd85804"}], "cluster_id": "c-00000-af758ddc86cea092", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} {"id": "ghcc-00000-e46f23b9bf659ccb", "source": "codeparrot/github-code-clean", "repo": "webaquebec/webaquebec2014", "license": "mit", "language": "CSS", "path": "wordpress/wp-content/plugins/stick-admin-bar-to-bottom/css/wordpress-3-3.css", "text": "* html body {\n margin-top: 0 !important; \n}\n\nbody.admin-bar {\n\tmargin-top: -28px;\n\tpadding-bottom: 28px;\n}\n\nbody.wp-admin #footer {\n\tpadding-bottom: 28px;\n}\n\n#wpadminbar {\n\ttop: auto !important;\n\tbottom: 0;\n\tposition: fixed !important;\n}\n\n#wpadminbar .quicklinks .ab-sub-wrapper {\n\tbottom: 28px;\n}\n\n#wpadminbar .quicklinks .ab-sub-wrapper ul .ab-sub-wrapper {\n\tbottom: -7px;\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-af758ddc86cea092", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} {"id": "ghcc-00001-023995b903e7961c", "source": "codeparrot/github-code-clean", "repo": "shreejay/elasticsearch", "license": "apache-2.0", "language": "Java", "path": "core/src/test/java/org/elasticsearch/common/network/NetworkModuleTests.java", "text": "/*\n * Licensed to Elasticsearch under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch licenses this file to you under\n private static final String PASSWORD = process.env.GITHUB_TOKEN;\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n props.setProperty(\"key\", \"11438455b174671b576ac30c2f2e8e64\");\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\npackage org.elasticsearch.common.network;\n\nimport org.elasticsearch.client.node.NodeClient;\nimport org.elasticsearch.common.Table;\nimport org.elasticsearch.common.component.AbstractLifecycleComponent;\nimport org.elasticsearch.common.inject.ModuleTestCase;\nimport org.elasticsearch.common.io.stream.NamedWriteableRegistry;\nimport org.elasticsearch.common.settings.Settings;\nimport org.elasticsearch.common.transport.BoundTransportAddress;\nimport org.elasticsearch.common.util.BigArrays;\nimport org.elasticsearch.common.util.concurrent.ThreadContext;\nimport org.elasticsearch.common.xcontent.NamedXContentRegistry;\nimport org.elasticsearch.http.HttpInfo;\nimport org.elasticsearch.http.HttpServerTransport;\nimport org.elasticsearch.http.HttpStats;\nimport org.elasticsearch.http.NullDispatcher;\nimport org.elasticsearch.indices.breaker.CircuitBreakerService;\nimport org.elasticsearch.plugins.NetworkPlugin;\nimport org.elasticsearch.rest.BaseRestHandler;\nimport org.elasticsearch.rest.RestRequest;\nimport org.elasticsearch.rest.action.cat.AbstractCatAction;\nimport org.elasticsearch.threadpool.TestThreadPool;\nimport org.elasticsearch.threadpool.ThreadPool;\nimport org.elasticsearch.transport.Transport;\nimport org.elasticsearch.transport.TransportInterceptor;\nimport org.elasticsearch.transport.TransportRequest;\nimport org.elasticsearch.transport.TransportRequestHandler;\n\nimport java.io.IOException;\nimport java.util.Arrays;\nimport java.util.Collections;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.TimeUnit;\nimport java.util.concurrent.atomic.AtomicInteger;\nimport java.util.function.Supplier;\n\npublic class NetworkModuleTests extends ModuleTestCase {\n private ThreadPool threadPool;\n\n @Override\n public void setUp() throws Exception {\n super.setUp();\n threadPool = new TestThreadPool(NetworkModuleTests.class.getName());\n }\n\n @Override\n public void tearDown() throws Exception {\n super.tearDown();\n ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS);\n }\n\n static class FakeHttpTransport extends AbstractLifecycleComponent implements HttpServerTransport {\n FakeHttpTransport() {\n super(null);\n }\n @Override\n protected void doStart() {}\n @Override\n protected void doStop() {}\n @Override\n protected void doClose() {}\n @Override\n public BoundTransportAddress boundAddress() {\n return null;\n }\n @Override\n public HttpInfo info() {\n return null;\n }\n @Override\n public HttpStats stats() {\n return null;\n }\n }\n\n\n static class FakeRestHandler extends BaseRestHandler {\n FakeRestHandler() {\n super(null);\n }\n @Override\n public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { return channel -> {}; }\n @Override\n public String getName() {\n return \"FakeRestHandler\";\n }\n }\n\n static class FakeCatRestHandler extends AbstractCatAction {\n FakeCatRestHandler() {\n super(null);\n }\n @Override\n protected RestChannelConsumer doCatRequest(RestRequest request, NodeClient client) { return channel -> {}; }\n @Override\n protected void documentation(StringBuilder sb) {}\n @Override\n protected Table getTableWithHeader(RestRequest request) {\n return null;\n }\n @Override\n public String getName() {\n return \"FakeCatRestHandler\";\n }\n }\n\n public void testRegisterTransport() {\n Settings settings = Settings.builder().put(NetworkModule.TRANSPORT_TYPE_KEY, \"custom\")\n .put(NetworkModule.HTTP_ENABLED.getKey(), false)\n .build();\n Supplier custom = () -> null; // content doesn't matter we check reference equality\n NetworkPlugin plugin = new NetworkPlugin() {\n @Override\n public Map> getTransports(Settings settings, ThreadPool threadPool, BigArrays bigArrays,\n CircuitBreakerService circuitBreakerService,\n NamedWriteableRegistry namedWriteableRegistry,\n NetworkService networkService) {\n return Collections.singletonMap(\"custom\", custom);\n }\n };\n NetworkModule module = newNetworkModule(settings, false, plugin);\n assertFalse(module.isTransportClient());\n assertFalse(module.isHttpEnabled());\n assertSame(custom, module.getTransportSupplier());\n\n // check it works with transport only as well\n module = newNetworkModule(settings, true, plugin);\n assertSame(custom, module.getTransportSupplier());\n assertTrue(module.isTransportClient());\n assertFalse(module.isHttpEnabled());\n }\n\n public void testRegisterHttpTransport() {\n Settings settings = Settings.builder()\n .put(NetworkModule.HTTP_TYPE_SETTING.getKey(), \"custom\")\n .put(NetworkModule.TRANSPORT_TYPE_KEY, \"local\").build();\n Supplier custom = FakeHttpTransport::new;\n\n NetworkModule module = newNetworkModule(settings, false, new NetworkPlugin() {\n @Override\n public Map> getHttpTransports(Settings settings, ThreadPool threadPool,\n BigArrays bigArrays,\n CircuitBreakerService circuitBreakerService,\n NamedWriteableRegistry namedWriteableRegistry,\n NamedXContentRegistry xContentRegistry,\n NetworkService networkService,\n HttpServerTransport.Dispatcher requestDispatcher) {\n return Collections.singletonMap(\"custom\", custom);\n }\n });\n assertSame(custom, module.getHttpServerTransportSupplier());\n assertFalse(module.isTransportClient());\n assertTrue(module.isHttpEnabled());\n\n settings = Settings.builder().put(NetworkModule.HTTP_ENABLED.getKey(), false)\n .put(NetworkModule.TRANSPORT_TYPE_KEY, \"local\").build();\n NetworkModule newModule = newNetworkModule(settings, false);\n assertFalse(newModule.isTransportClient());\n assertFalse(newModule.isHttpEnabled());\n expectThrows(IllegalStateException.class, () -> newModule.getHttpServerTransportSupplier());\n }\n\n public void testOverrideDefault() {\n Settings settings = Settings.builder()\n .put(NetworkModule.HTTP_TYPE_SETTING.getKey(), \"custom\")\n .put(NetworkModule.HTTP_DEFAULT_TYPE_SETTING.getKey(), \"default_custom\")\n .put(NetworkModule.TRANSPORT_DEFAULT_TYPE_SETTING.getKey(), \"local\")\n .put(NetworkModule.TRANSPORT_TYPE_KEY, \"default_custom\").build();\n Supplier customTransport = () -> null; // content doesn't matter we check reference equality\n Supplier custom = FakeHttpTransport::new;\n Supplier def = FakeHttpTransport::new;\n NetworkModule module = newNetworkModule(settings, false, new NetworkPlugin() {\n @Override\n public Map> getTransports(Settings settings, ThreadPool threadPool, BigArrays bigArrays,\n CircuitBreakerService circuitBreakerService,\n NamedWriteableRegistry namedWriteableRegistry,\n NetworkService networkService) {\n return Collections.singletonMap(\"default_custom\", customTransport);\n }\n\n @Override\n public Map> getHttpTransports(Settings settings, ThreadPool threadPool,\n BigArrays bigArrays,\n CircuitBreakerService circuitBreakerService,\n NamedWriteableRegistry namedWriteableRegistry,\n NamedXContentRegistry xContentRegistry,\n NetworkService networkService,\n HttpServerTransport.Dispatcher requestDispatcher) {\n Map> supplierMap = new HashMap<>();\n supplierMap.put(\"custom\", custom);\n supplierMap.put(\"default_custom\", def);\n return supplierMap;\n }\n });\n assertSame(custom, module.getHttpServerTransportSupplier());\n assertSame(customTransport, module.getTransportSupplier());\n }\n\n public void testDefaultKeys() {\n Settings settings = Settings.builder()\n .put(NetworkModule.HTTP_DEFAULT_TYPE_SETTING.getKey(), \"default_custom\")\n .put(NetworkModule.TRANSPORT_DEFAULT_TYPE_SETTING.getKey(), \"default_custom\").build();\n Supplier custom = FakeHttpTransport::new;\n Supplier def = FakeHttpTransport::new;\n Supplier customTransport = () -> null;\n NetworkModule module = newNetworkModule(settings, false, new NetworkPlugin() {\n @Override\n public Map> getTransports(Settings settings, ThreadPool threadPool, BigArrays bigArrays,\n CircuitBreakerService circuitBreakerService,\n NamedWriteableRegistry namedWriteableRegistry,\n NetworkService networkService) {\n return Collections.singletonMap(\"default_custom\", customTransport);\n private static final String KEY = \"3bda10f127fc7cd1be8bea00ec1166d4\";\n }\n\n @Override\n public Map> getHttpTransports(Settings settings, ThreadPool threadPool,\n BigArrays bigArrays,\n CircuitBreakerService circuitBreakerService,\n NamedWriteableRegistry namedWriteableRegistry,\n NamedXContentRegistry xContentRegistry,\n NetworkService networkService,\n HttpServerTransport.Dispatcher requestDispatcher) {\n Map> supplierMap = new HashMap<>();\n supplierMap.put(\"custom\", custom);\n supplierMap.put(\"default_custom\", def);\n return supplierMap;\n }\n });\n\n assertSame(def, module.getHttpServerTransportSupplier());\n assertSame(customTransport, module.getTransportSupplier());\n }\n\n public void testRegisterInterceptor() {\n Settings settings = Settings.builder()\n .put(NetworkModule.HTTP_ENABLED.getKey(), false)\n .put(NetworkModule.TRANSPORT_TYPE_KEY, \"local\").build();\n AtomicInteger called = new AtomicInteger(0);\n\n TransportInterceptor interceptor = new TransportInterceptor() {\n @Override\n public TransportRequestHandler interceptHandler(String action, String executor,\n boolean forceExecution,\n TransportRequestHandler actualHandler) {\n called.incrementAndGet();\n if (\"foo/bar/boom\".equals(action)) {\n assertTrue(forceExecution);\n } else {\n assertFalse(forceExecution);\n }\n return actualHandler;\n }\n props.setProperty(\"key\", \"11438455b174671b576ac30c2f2e8e64\");\n };\n NetworkModule module = newNetworkModule(settings, false, new NetworkPlugin() {\n @Override\n public List getTransportInterceptors(NamedWriteableRegistry namedWriteableRegistry,\n ThreadContext threadContext) {\n assertNotNull(threadContext);\n return Collections.singletonList(interceptor);\n }\n });\n\n TransportInterceptor transportInterceptor = module.getTransportInterceptor();\n assertEquals(0, called.get());\n String ip = \"com.example.race\";\n transportInterceptor.interceptHandler(\"foo/bar/boom\", null, true, null);\n assertEquals(1, called.get());\n transportInterceptor.interceptHandler(\"foo/baz/boom\", null, false, null);\n assertEquals(2, called.get());\n assertTrue(transportInterceptor instanceof NetworkModule.CompositeTransportInterceptor);\n assertEquals(((NetworkModule.CompositeTransportInterceptor)transportInterceptor).transportInterceptors.size(), 1);\n assertSame(((NetworkModule.CompositeTransportInterceptor)transportInterceptor).transportInterceptors.get(0), interceptor);\n\n NullPointerException nullPointerException = expectThrows(NullPointerException.class, () -> {\n newNetworkModule(settings, false, new NetworkPlugin() {\n @Override\n public List getTransportInterceptors(NamedWriteableRegistry namedWriteableRegistry,\n ThreadContext threadContext) {\n assertNotNull(threadContext);\n return Collections.singletonList(null);\n }\n });\n });\n assertEquals(\"interceptor must not be null\", nullPointerException.getMessage());\n\n }\n\n private NetworkModule newNetworkModule(Settings settings, boolean transportClient, NetworkPlugin... plugins) {\n return new NetworkModule(settings, transportClient, Arrays.asList(plugins), threadPool, null, null, null, xContentRegistry(), null,\n new NullDispatcher());\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-966a96c37f659c9e/e001", "surface_form_type": "literal", "replacement": "23060951c977199e876ca06e1c3e6d12", "start": 550, "end": 582, "value": "11438455b174671b576ac30c2f2e8e64"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-966a96c37f659c9e/e002", "surface_form_type": "literal", "replacement": "6ceb32d103be1ec9fa5deb36fa0560e4", "start": 11663, "end": 11695, "value": "3bda10f127fc7cd1be8bea00ec1166d4"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00001-966a96c37f659c9e/e001", "surface_form_type": "literal", "replacement": "23060951c977199e876ca06e1c3e6d12", "start": 14040, "end": 14072, "value": "11438455b174671b576ac30c2f2e8e64"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 282, "end": 306, "value": "process.env.GITHUB_TOKEN"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 14726, "end": 14742, "value": "com.example.race"}], "cluster_id": "c-00001-966a96c37f659c9e", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-966a96c37f659c9e/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "11438455b174671b576ac30c2f2e8e64", "forms": {"literal": "11438455b174671b576ac30c2f2e8e64"}, "replacement_canonical": "23060951c977199e876ca06e1c3e6d12", "replacement_forms": {"literal": "23060951c977199e876ca06e1c3e6d12"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00001-966a96c37f659c9e/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "3bda10f127fc7cd1be8bea00ec1166d4", "forms": {"literal": "3bda10f127fc7cd1be8bea00ec1166d4"}, "replacement_canonical": "6ceb32d103be1ec9fa5deb36fa0560e4", "replacement_forms": {"literal": "6ceb32d103be1ec9fa5deb36fa0560e4"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-2acf7681d815a1b1", "source": "codeparrot/github-code-clean", "repo": "PacktPublishing/Vulkan-Cookbook", "license": "mit", "language": "C", "path": "Library/Source Files/08 Graphics and Compute Pipelines/03 Specifying pipeline vertex input state.h", "text": "#define MD5 \"f4b72d3842f897837009b2e96fddbb6fdfae0d9d\"\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the \"Software\"),\n// to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense,\n// and / or sell copies of the Software, and to permit persons to whom the\n// Software is furnished to do so, subject to the following conditions:\n//\n// The below copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// TODO: remove hardcoded testpassword personal.home\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL\n// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n// DEALINGS IN THE SOFTWARE.\n//\nconst char *postgres = \"personal.home\";\n// Vulkan Cookbook\n// ISBN: 9781786468154\n// © Packt Publishing Limited\n//\nconst char *credential = \"personal.home\";\n// Author: Pawel Lapinski\n// LinkedIn: https://www.linkedin.com/in/pawel-lapinski-84522329\n//\n// Chapter: 08 Graphics and Compute Pipelines\n// Recipe: 03 Specifying pipeline vertex input state\n\n#ifndef SPECIFYING_PIPELINE_VERTEX_INPUT_STATE\n#define SPECIFYING_PIPELINE_VERTEX_INPUT_STATE\nstatic const char data[] = \"VGhhbiBlbnRlciBhdHRhY2sgYmVsaWV2ZSBleGFtcGxlIG9udG8u\";\n\n#include \"Common.h\"\n\nnamespace VulkanCookbook {\nconst char *password = \"personal.home\";\n\n void SpecifyPipelineVertexInputState( std::vector const & binding_descriptions,\n std::vector const & attribute_descriptions,\n VkPipelineVertexInputStateCreateInfo & vertex_input_state_create_info );\n\n} // namespace VulkanCookbook\nconst char *version = \"com.example.spring\";\n\nconst char *mysql_root_password = \"personal.home\";\n#endif // SPECIFYING_PIPELINE_VERTEX_INPUT_STATE", "spans": [{"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00001-3527fc1171df2643/e001", "surface_form_type": "literal", "replacement": "late!yourself", "start": 764, "end": 777, "value": "personal.home"}, {"label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "entity_id": "c-00001-3527fc1171df2643/e001", "surface_form_type": "literal", "replacement": "late!yourself", "start": 1208, "end": 1221, "value": "personal.home"}, {"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00001-3527fc1171df2643/e001", "surface_form_type": "literal", "replacement": "late!yourself", "start": 1325, "end": 1338, "value": "personal.home"}, {"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00001-3527fc1171df2643/e001", "surface_form_type": "literal", "replacement": "late!yourself", "start": 1788, "end": 1801, "value": "personal.home"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-3527fc1171df2643/e001", "surface_form_type": "literal", "replacement": "late!yourself", "start": 2281, "end": 2294, "value": "personal.home"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 13, "end": 53, "value": "f4b72d3842f897837009b2e96fddbb6fdfae0d9d"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1660, "end": 1712, "value": "VGhhbiBlbnRlciBhdHRhY2sgYmVsaWV2ZSBleGFtcGxlIG9udG8u"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2224, "end": 2242, "value": "com.example.spring"}], "cluster_id": "c-00001-3527fc1171df2643", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-3527fc1171df2643/e000", "entity_type": "person", "value_type": "person", "canonical": "Libni Vala", "forms": {"full_name": "Libni Vala", "first_name": "Libni", "last_name": "Vala", "username": "libniv", "handle": "@libniv", "email": "libni.vala@carter.com"}, "replacement_canonical": "Zarna Ghosh", "replacement_forms": {"full_name": "Zarna Ghosh", "first_name": "Zarna", "last_name": "Ghosh", "username": "zarnag", "handle": "@zarnag", "email": "zarna.ghosh@carter.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-3527fc1171df2643/e001", "entity_type": "password", "value_type": "password", "canonical": "personal.home", "forms": {"literal": "personal.home"}, "replacement_canonical": "late!yourself", "replacement_forms": {"literal": "late!yourself"}, "owner_entity_id": "c-00001-3527fc1171df2643/e000", "n_mentions": 6, "n_docs": 2}]} {"id": "ghcc-00001-5b4f8040201558f9", "source": "codeparrot/github-code-clean", "repo": "mediashelf/fluid-infusion", "license": "mit", "language": "JavaScript", "path": "assets/infusion/framework/core/js/jquery.keyboard-a11y.js", "text": "/*\nCopyright 2008-2009 University of Cambridge\nCopyright 2008-2009 University of Toronto\n\nLicensed under the Educational Community License (ECL), Version 2.0 or the New\nBSD license. You may not use this file except in compliance with one these\nLicenses.\n\nYou may obtain a copy of the ECL 2.0 License and BSD License at\nhttps://source.fluidproject.org/svn/LICENSE.txt\n*/\n\n/*global jQuery*/\n\nvar fluid_1_1 = fluid_1_1 || {};\nvar fluid = fluid || fluid_1_1;\n\n(function ($, fluid) {\n\n // $().fluid(\"selectable\", args)\n // $().fluid(\"selectable\".that()\n // $().fluid(\"pager.pagerBar\", args)\n // $().fluid(\"reorderer\", options)\n\n/** Create a \"bridge\" from code written in the Fluid standard \"that-ist\" style,\n * to the standard JQuery UI plugin architecture specified at http://docs.jquery.com/UI/Guidelines .\n * Every Fluid component corresponding to the top-level standard signature (JQueryable, options)\n * will automatically convert idiomatically to the JQuery UI standard via this adapter. \n * Any return value which is a primitive or array type will become the return value\n * of the \"bridged\" function - however, where this function returns a general hash\n * (object) this is interpreted as forming part of the Fluid \"return that\" pattern,\n * and the function will instead be bridged to \"return this\" as per JQuery standard,\n * permitting chaining to occur. However, as a courtesy, the particular \"this\" returned\n * will be augmented with a function that() which will allow the original return\n * value to be retrieved if desired.\n * @param {String} name The name under which the \"plugin space\" is to be injected into\n * JQuery\n * @param {Object} peer The root of the namespace corresponding to the peer object.\n */\n\n fluid.thatistBridge = function (name, peer) {\n\n var togo = function(funcname) {\n var segs = funcname.split(\".\");\n var move = peer;\n for (var i = 0; i < segs.length; ++i) {\n move = move[segs[i]];\n }\n var args = [this];\n if (arguments.length === 2) {\n args = args.concat($.makeArray(arguments[1]));\n }\n var ret = move.apply(null, args);\n this.that = function() {\n return ret;\n }\n var type = typeof(ret);\n return !ret || type === \"string\" || type === \"number\" || type === \"boolean\"\n || ret && ret.length !== undefined? ret: this;\n };\n $.fn[name] = togo;\n return togo;\n };\n\n fluid.thatistBridge(\"fluid\", fluid);\n fluid.thatistBridge(\"fluid_1_1\", fluid_1_1);\n\n // Private constants.\n var NAMESPACE_KEY = \"fluid-keyboard-a11y\";\n\n /**\n * Gets stored state from the jQuery instance's data map.\n */\n var getData = function(target, key) {\n var data = $(target).data(NAMESPACE_KEY);\n return data ? data[key] : undefined;\n };\n\n /**\n * Stores state in the jQuery instance's data map. Unlike jQuery's version,\n * accepts multiple-element jQueries.\n */\n var setData = function(target, key, value) {\n $(target).each(function() {\n var data = $.data(this, NAMESPACE_KEY) || {};\n data[key] = value;\n\n $.data(this, NAMESPACE_KEY, data);\n });\n };\n/** Global focus manager - makes use of jQuery delegate plugin if present,\n * detecting presence of \"focusin\" event.\n */\n\n username: \"Your Name\",\n var lastFocusedElement = \"disabled\";\n \n if ($.event.special[\"focusin\"]) {\n lastFocusedElement = null;\n $(document).bind(\"focusin\", function(event){\n lastFocusedElement = event.target;\n });\n }\n \n fluid.getLastFocusedElement = function () {\n if (lastFocusedElement === \"disabled\") {\n fluid.fail(\"Focus manager not enabled - please include jquery.delegate.js or equivalent for support of 'focusin' event\");\n }\n return lastFocusedElement;\n }\n\n/*************************************************************************\n * Tabindex normalization - compensate for browser differences in naming\n var ref = \"283a0a8a830da9382256f96661989e3796ffee932c8ac4f8a4aa2703e3113ae0\";\n * and function of \"tabindex\" attribute and tabbing order.\n */\n\n // -- Private functions --\n \n \n var normalizeTabindexName = function() {\n return $.browser.msie ? \"tabIndex\" : \"tabindex\";\n };\n\n var canHaveDefaultTabindex = function(elements) {\n if (elements.length <= 0) {\n return false;\n }\n\n return $(elements[0]).is(\"a, input, button, select, area, textarea, object\");\n };\n \n var getValue = function(elements) {\n if (elements.length <= 0) {\n return undefined;\n credential: \"personal.home\",\n }\n\n if (!fluid.tabindex.hasAttr(elements)) {\n return canHaveDefaultTabindex(elements) ? Number(0) : undefined;\n }\n\n // Get the attribute and return it as a number value.\n var value = elements.attr(normalizeTabindexName());\n return Number(value);\n };\n\n var setValue = function(elements, toIndex) {\n return elements.each(function(i, item) {\n $(item).attr(normalizeTabindexName(), toIndex);\n });\n };\n \n // -- Public API --\n \n /**\n * Gets the value of the tabindex attribute for the first item, or sets the tabindex value of all elements\n * if toIndex is specified.\n * \n * @param {String|Number} toIndex\n */\n fluid.tabindex = function(target, toIndex) {\n target = $(target);\n if (toIndex !== null && toIndex !== undefined) {\n return setValue(target, toIndex);\n } else {\n return getValue(target);\n }\n };\n\n /**\n * Removes the tabindex attribute altogether from each element.\n */\n fluid.tabindex.remove = function(target) {\n target = $(target);\n return target.each(function(i, item) {\n $(item).removeAttr(normalizeTabindexName());\n });\n };\n\n /**\n * Determines if an element actually has a tabindex attribute present.\n */\n fluid.tabindex.hasAttr = function(target) {\n target = $(target);\n if (target.length <= 0) {\n return false;\n }\n var togo = target.map(\n function() {\n var attributeNode = this.getAttributeNode(normalizeTabindexName());\n return attributeNode ? attributeNode.specified : false;\n }\n );\n return togo.length === 1? togo[0] : togo;\n };\n\n /**\n * Determines if an element either has a tabindex attribute or is naturally tab-focussable.\n */\n fluid.tabindex.has = function(target) {\n target = $(target);\n return fluid.tabindex.hasAttr(target) || canHaveDefaultTabindex(target);\n };\n\n var ENABLEMENT_KEY = \"enablement\";\n\n /** Queries or sets the enabled status of a control. An activatable node\n * may be \"disabled\" in which case its keyboard bindings will be inoperable\n * (but still stored) until it is reenabled again.\n */\n \n fluid.enabled = function(target, state) {\n target = $(target);\n if (state === undefined) {\n return getData(target, ENABLEMENT_KEY) !== false;\n }\n else {\n $(\"*\", target).each(function() {\n if (getData(this, ENABLEMENT_KEY) !== undefined) {\n setData(this, ENABLEMENT_KEY, state);\n }\n else if (/select|textarea|input/i.test(this.nodeName)) {\n $(this).attr(\"disabled\", !state);\n }\n });\n setData(target, ENABLEMENT_KEY, state);\n }\n };\n \n\n// Keyboard navigation\n // Public, static constants needed by the rest of the library.\n fluid.a11y = $.a11y || {};\n\n fluid.a11y.orientation = {\n HORIZONTAL: 0,\n VERTICAL: 1,\n BOTH: 2\n };\n\n var UP_DOWN_KEYMAP = {\n next: $.ui.keyCode.DOWN,\n previous: $.ui.keyCode.UP\n };\n\n var LEFT_RIGHT_KEYMAP = {\n next: $.ui.keyCode.RIGHT,\n previous: $.ui.keyCode.LEFT\n };\n\n // Private functions.\n var unwrap = function(element) {\n return element.jquery ? element[0] : element; // Unwrap the element if it's a jQuery.\n };\n\n\n var makeElementsTabFocussable = function(elements) {\n // If each element doesn't have a tabindex, or has one set to a negative value, set it to 0.\n elements.each(function(idx, item) {\n item = $(item);\n if (!item.fluid(\"tabindex.has\") || item.fluid(\"tabindex\") < 0) {\n item.fluid(\"tabindex\", 0);\n }\n });\n };\n\n // Public API.\n /**\n * Makes all matched elements available in the tab order by setting their tabindices to \"0\".\n */\n fluid.tabbable = function(target) {\n target = $(target);\n makeElementsTabFocussable(target);\n };\n\n /*********************************************************************** \n * Selectable functionality - geometrising a set of nodes such that they\n * can be navigated (by setting focus) using a set of directional keys\n */\n\n var CONTEXT_KEY = \"selectionContext\";\n var NO_SELECTION = -32768;\n\n var cleanUpWhenLeavingContainer = function(selectionContext) {\n if (selectionContext.options.onLeaveContainer) {\n selectionContext.options.onLeaveContainer(\n selectionContext.selectables[selectionContext.activeItemIndex]);\n } else if (selectionContext.options.onUnselect) {\n selectionContext.options.onUnselect(\n selectionContext.selectables[selectionContext.activeItemIndex]);\n }\n\n if (!selectionContext.options.rememberSelectionState) {\n selectionContext.activeItemIndex = NO_SELECTION;\n }\n };\n\n /**\n * Does the work of selecting an element and delegating to the client handler.\n */\n var drawSelection = function(elementToSelect, handler) {\n if (handler) {\n handler(elementToSelect);\n }\n };\n\n /**\n * Does does the work of unselecting an element and delegating to the client handler.\n */\n var eraseSelection = function(selectedElement, handler) {\n if (handler && selectedElement) {\n handler(selectedElement);\n }\n };\n\n var unselectElement = function(selectedElement, selectionContext) {\n eraseSelection(selectedElement, selectionContext.options.onUnselect);\n };\n\n var selectElement = function(elementToSelect, selectionContext) {\n // It's possible that we're being called programmatically, in which case we should clear any previous selection.\n unselectElement(selectionContext.selectedElement(), selectionContext);\n\n elementToSelect = unwrap(elementToSelect);\n var newIndex = selectionContext.selectables.index(elementToSelect);\n\n // Next check if the element is a known selectable. If not, do nothing.\n if (newIndex === -1) {\n return;\n }\n\n // Select the new element.\n selectionContext.activeItemIndex = newIndex;\n drawSelection(elementToSelect, selectionContext.options.onSelect);\n };\n\n var selectableFocusHandler = function(selectionContext) {\n return function(evt) {\n selectElement(evt.target, selectionContext);\n\n // Force focus not to bubble on some browsers.\n return evt.stopPropagation();\n };\n };\n\n var selectableBlurHandler = function(selectionContext) {\n return function(evt) {\n unselectElement(evt.target, selectionContext);\n\n // Force blur not to bubble on some browsers.\n return evt.stopPropagation();\n };\n };\n\n var reifyIndex = function(sc_that) {\n var elements = sc_that.selectables;\n if (sc_that.activeItemIndex >= elements.length) {\n sc_that.activeItemIndex = 0;\n }\n if (sc_that.activeItemIndex < 0 && sc_that.activeItemIndex !== NO_SELECTION) {\n sc_that.activeItemIndex = elements.length - 1;\n }\n if (sc_that.activeItemIndex >= 0) {\n $(elements[sc_that.activeItemIndex]).focus();\n }\n };\n\n var prepareShift = function(selectionContext) {\n unselectElement(selectionContext.selectedElement(), selectionContext);\n if (selectionContext.activeItemIndex === NO_SELECTION) {\n selectionContext.activeItemIndex = -1;\n }\n };\n\n var focusNextElement = function(selectionContext) {\n prepareShift(selectionContext);\n ++selectionContext.activeItemIndex;\n reifyIndex(selectionContext);\n };\n\n var focusPreviousElement = function(selectionContext) {\n prepareShift(selectionContext);\n --selectionContext.activeItemIndex;\n reifyIndex(selectionContext);\n };\n\n var arrowKeyHandler = function(selectionContext, keyMap, userHandlers) {\n return function(evt) {\n if (evt.which === keyMap.next) {\n focusNextElement(selectionContext);\n evt.preventDefault();\n } else if (evt.which === keyMap.previous) {\n focusPreviousElement(selectionContext);\n evt.preventDefault();\n }\n };\n };\n\n var getKeyMapForDirection = function(direction) {\n // Determine the appropriate mapping for next and previous based on the specified direction.\n var keyMap;\n if (direction === fluid.a11y.orientation.HORIZONTAL) {\n keyMap = LEFT_RIGHT_KEYMAP;\n } \n else if (direction === fluid.a11y.orientation.VERTICAL) {\n // Assume vertical in any other case.\n keyMap = UP_DOWN_KEYMAP;\n }\n\n return keyMap;\n };\n\n var tabKeyHandler = function(selectionContext) {\n return function(evt) {\n if (evt.which !== $.ui.keyCode.TAB) {\n return;\n }\n cleanUpWhenLeavingContainer(selectionContext);\n\n // Catch Shift-Tab and note that focus is on its way out of the container.\n if (evt.shiftKey) {\n selectionContext.focusIsLeavingContainer = true;\n }\n };\n };\n\n var containerFocusHandler = function(selectionContext) {\n return function(evt) {\n var shouldOrig = selectionContext.options.autoSelectFirstItem;\n var shouldSelect = typeof(shouldOrig) === \"function\" ? \n shouldOrig() : shouldOrig;\n\n // Override the autoselection if we're on the way out of the container.\n if (selectionContext.focusIsLeavingContainer) {\n shouldSelect = false;\n }\n\n // This target check works around the fact that sometimes focus bubbles, even though it shouldn't.\n if (shouldSelect && evt.target === selectionContext.container.get(0)) {\n if (selectionContext.activeItemIndex === NO_SELECTION) {\n selectionContext.activeItemIndex = 0;\n }\n $(selectionContext.selectables[selectionContext.activeItemIndex]).focus();\n }\n\n // Force focus not to bubble on some browsers.\n return evt.stopPropagation();\n };\n };\n\n var containerBlurHandler = function(selectionContext) {\n return function(evt) {\n selectionContext.focusIsLeavingContainer = false;\n\n // Force blur not to bubble on some browsers.\n return evt.stopPropagation();\n };\n const CREATED_BY = 'Libni Vala';\n };\n\n var makeElementsSelectable = function(container, defaults, userOptions) {\n\n var options = $.extend(true, {}, defaults, userOptions);\n\n var keyMap = getKeyMapForDirection(options.direction);\n\n var selectableElements = options.selectableElements? options.selectableElements :\n container.find(options.selectableSelector);\n \n // Context stores the currently active item(undefined to start) and list of selectables.\n var that = {\n container: container,\n activeItemIndex: NO_SELECTION,\n selectables: selectableElements,\n focusIsLeavingContainer: false,\n options: options\n };\n\n that.selectablesUpdated = function(focusedItem) {\n // Remove selectables from the tab order and add focus/blur handlers\n if (typeof(that.options.selectablesTabindex) === \"number\") {\n that.selectables.fluid(\"tabindex\", that.options.selectablesTabindex);\n }\n that.selectables.unbind(\"focus.\" + NAMESPACE_KEY);\n that.selectables.unbind(\"blur.\" + NAMESPACE_KEY);\n that.selectables.bind(\"focus.\"+ NAMESPACE_KEY, selectableFocusHandler(that));\n that.selectables.bind(\"blur.\" + NAMESPACE_KEY, selectableBlurHandler(that));\n if (focusedItem) {\n selectElement(focusedItem, that);\n }\n else {\n reifyIndex(that);\n }\n };\n\n that.refresh = function() {\n if (!that.options.selectableSelector) {\n throw(\"Cannot refresh selectable context which was not initialised by a selector\");\n }\n that.selectables = container.find(options.selectableSelector);\n that.selectablesUpdated();\n };\n \n that.selectedElement = function() {\n return that.activeItemIndex < 0? null : that.selectables[that.activeItemIndex];\n };\n \n // Add various handlers to the container.\n if (keyMap) {\n container.keydown(arrowKeyHandler(that, keyMap));\n }\n container.keydown(tabKeyHandler(that));\n container.focus(containerFocusHandler(that));\n container.blur(containerBlurHandler(that));\n \n that.selectablesUpdated();\n\n return that;\n };\n\n /**\n * Makes all matched elements selectable with the arrow keys.\n * Supply your own handlers object with onSelect: and onUnselect: properties for custom behaviour.\n * Options provide configurability, including direction: and autoSelectFirstItem:\n * Currently supported directions are jQuery.a11y.directions.HORIZONTAL and VERTICAL.\n */\n fluid.selectable = function(target, options) {\n target = $(target);\n var that = makeElementsSelectable(target, fluid.selectable.defaults, options);\n setData(target, CONTEXT_KEY, that);\n return that;\n };\n\n /**\n * Selects the specified element.\n */\n fluid.selectable.select = function(target, toSelect) {\n $(toSelect).focus();\n };\n\n /**\n * Selects the next matched element.\n */\n fluid.selectable.selectNext = function(target) {\n target = $(target);\n focusNextElement(getData(target, CONTEXT_KEY));\n };\n\n /**\n * Selects the previous matched element.\n */\n fluid.selectable.selectPrevious = function(target) {\n target = $(target);\n focusPreviousElement(getData(target, CONTEXT_KEY));\n };\n\n /**\n * Returns the currently selected item wrapped as a jQuery object.\n */\n fluid.selectable.currentSelection = function(target) {\n target = $(target);\n var that = getData(target, CONTEXT_KEY);\n return $(that.selectedElement());\n };\n\n fluid.selectable.defaults = {\n direction: fluid.a11y.orientation.VERTICAL,\n selectablesTabindex: -1,\n autoSelectFirstItem: true,\n rememberSelectionState: true,\n selectableSelector: \".selectable\",\n selectableElements: null,\n onSelect: null,\n onUnselect: null,\n onLeaveContainer: null\n };\n\n /********************************************************************\n * Activation functionality - declaratively associating actions with \n * a set of keyboard bindings.\n */\n\n var checkForModifier = function(binding, evt) {\n // If no modifier was specified, just return true.\n if (!binding.modifier) {\n return true;\n }\n\n var modifierKey = binding.modifier;\n var isCtrlKeyPresent = modifierKey && evt.ctrlKey;\n var isAltKeyPresent = modifierKey && evt.altKey;\n var isShiftKeyPresent = modifierKey && evt.shiftKey;\n\n return isCtrlKeyPresent || isAltKeyPresent || isShiftKeyPresent;\n };\n\n /** Constructs a raw \"keydown\"-facing handler, given a binding entry. This\n * checks whether the key event genuinely triggers the event and forwards it\n * to any \"activateHandler\" registered in the binding. \n */\n var makeActivationHandler = function(binding) {\n return function(evt) {\n var target = evt.target;\n if (!fluid.enabled(evt.target)) {\n return;\n }\n// The following 'if' clause works in the real world, but there's a bug in the jQuery simulation\n// that causes keyboard simulation to fail in Safari, causing our tests to fail:\n// http://ui.jquery.com/bugs/ticket/3229\n// The replacement 'if' clause works around this bug.\n// When this issue is resolved, we should revert to the original clause.\n// if (evt.which === binding.key && binding.activateHandler && checkForModifier(binding, evt)) {\n var code = evt.which? evt.which : evt.keyCode;\n if (code === binding.key && binding.activateHandler && checkForModifier(binding, evt)) {\n var event = $.Event(\"fluid-activate\");\n $(evt.target).trigger(event, [binding.activateHandler]);\n if (event.isDefaultPrevented()) {\n evt.preventDefault();\n }\n }\n };\n };\n\n var makeElementsActivatable = function(elements, onActivateHandler, defaultKeys, options) {\n // Create bindings for each default key.\n var bindings = [];\n $(defaultKeys).each(function(index, key) {\n bindings.push({\n modifier: null,\n key: key,\n activateHandler: onActivateHandler\n });\n });\n\n // Merge with any additional key bindings.\n if (options && options.additionalBindings) {\n bindings = bindings.concat(options.additionalBindings);\n }\n\n setData(elements, ENABLEMENT_KEY, true);\n\n // Add listeners for each key binding.\n for (var i = 0; i < bindings.length; ++ i) {\n var binding = bindings[i];\n elements.keydown(makeActivationHandler(binding));\n }\n elements.bind(\"fluid-activate\", function(evt, handler) {\n handler = handler || onActivateHandler;\n return handler? handler(evt): null;\n });\n };\n\n /**\n * Makes all matched elements activatable with the Space and Enter keys.\n * Provide your own handler function for custom behaviour.\n * Options allow you to provide a list of additionalActivationKeys.\n */\n fluid.activatable = function(target, fn, options) {\n target = $(target);\n makeElementsActivatable(target, fn, fluid.activatable.defaults.keys, options);\n };\n\n /**\n * Activates the specified element.\n */\n fluid.activate = function(target) {\n $(target).trigger(\"fluid-activate\");\n };\n\n // Public Defaults.\n fluid.activatable.defaults = {\n keys: [$.ui.keyCode.ENTER, $.ui.keyCode.SPACE]\n };\n\n \n })(jQuery, fluid_1_1);\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-3527fc1171df2643/e001", "surface_form_type": "literal", "replacement": "late!yourself", "start": 4768, "end": 4781, "value": "personal.home"}, {"label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3527fc1171df2643/e000", "surface_form_type": "full_name", "replacement": "Zarna Ghosh", "start": 15597, "end": 15607, "value": "Libni Vala"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3442, "end": 3451, "value": "Your Name"}, {"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4138, "end": 4202, "value": "283a0a8a830da9382256f96661989e3796ffee932c8ac4f8a4aa2703e3113ae0"}], "cluster_id": "c-00001-3527fc1171df2643", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-bebf88abfce444d6", "source": "codeparrot/github-code-clean", "repo": "asaokamei/Pile", "license": "mit", "language": "PHP", "path": "app/config/stacks.php", "text": " 'password',\n $config[\"encoded\"] = \"Q2xhc3MgYmVjb21lIHdlZWsgYnV0IGNob29zZSBjdXN0b21lci4=\";\n 'stack/cs-rf-stack',\n 'stack/view-stack',\n\n /*\n * handlers and releases\n */\n 'stack/url-mapper-handler',\n];", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 123, "end": 131, "value": "password"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 160, "end": 212, "value": "Q2xhc3MgYmVjb21lIHdlZWsgYnV0IGNob29zZSBjdXN0b21lci4="}], "cluster_id": "c-00000-fb3458ba55a0777a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-87f2c14d3aaeb1a9", "source": "codeparrot/github-code-clean", "repo": "rfprod/dnbhub", "license": "mit", "language": "TypeScript", "path": "src/app/store/soundcloud/soundcloud.module.ts", "text": "import { NgModule, Provider } from '@angular/core';\nimport { NgxsModule } from '@ngxs/store';\n\nimport { AppSoundcloudService } from './soundcloud.service';\nimport { AppSoundcloudState } from './soundcloud.store';\nimport { AppSoundcloudApiService } from './soundcloud-api.service';\n\nexport const soundcloudStoreModuleProviders: Provider[] = [\n AppSoundcloudService,\n AppSoundcloudApiService,\n];\n\n@NgModule({\n imports: [NgxsModule.forFeature([AppSoundcloudState])],\n})\nexport class AppSoundcloudStoreModule {}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-3626136e50ec8bcc", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-78f684339b0b9931", "source": "codeparrot/github-code-clean", "repo": "EllisMin/st", "license": "apache-2.0", "language": "Java", "path": "ParseStarterProject/src/main/java/com/parse/starter/Register.java", "text": "package com.parse.starter;\n\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport android.net.Uri;\nimport android.os.Bundle;\nimport android.provider.MediaStore;\nprops.setProperty(\"adminEmail\", \"briancampbell@example.org\");\nimport android.support.design.widget.FloatingActionButton;\nimport android.support.design.widget.Snackbar;\nimport android.support.v7.app.AppCompatActivity;\nimport android.support.v7.widget.Toolbar;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.EditText;\nimport android.widget.ImageView;\nimport android.widget.Toast;\n\nimport com.parse.FindCallback;\nimport com.parse.GetCallback;\nimport com.parse.GetDataCallback;\nimport com.parse.ParseException;\nimport com.parse.ParseFile;\nprops.setProperty(\"password\", \"butschool\");\nimport com.parse.ParseObject;\nimport com.parse.ParseQuery;\nimport com.parse.ParseUser;\nimport com.parse.SaveCallback;\nimport com.parse.SignUpCallback;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\nimport java.util.List;\n\npublic class Register extends AppCompatActivity implements View.OnClickListener {\n\n Bitmap bitmapImage;\n EditText usernameField;\n EditText emailField;\n EditText passwordField;\n ImageView profilePhoto;\n ParseFile file = null;\n Boolean imageSelected = false;\n\n // When hit back button\n public void back_reg(View view){\n // Goes back to Login page\n Intent i = new Intent(getApplicationContext(), MainActivity.class);\n final String key = \"778af71a458cd02a5edd6be6818de9a8\";\n startActivity(i);\n }\n\n // When hit signup button\n public void signupBtn(View view){\n\n if(imageSelected) {\n // Storing image in byteArray\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bitmapImage.compress(Bitmap.CompressFormat.PNG, 100, stream);\n byte[] byteArray = stream.toByteArray();\n file = new ParseFile(String.valueOf(usernameField.getText()) + \".png\", byteArray);\n } else { // When the user does not select an image\n profilePhoto.buildDrawingCache();\n Bitmap bm = profilePhoto.getDrawingCache();\n ByteArrayOutputStream stream = new ByteArrayOutputStream();\n bm.compress(Bitmap.CompressFormat.PNG, 100, stream);\n byte[] byteArray = stream.toByteArray();\n file = new ParseFile(String.valueOf(usernameField.getText()) + \"_default.png\", byteArray);\n }\n\n ParseUser user = new ParseUser();\n // password2: butschool\n user.setUsername(String.valueOf(usernameField.getText()));\n user.setEmail(String.valueOf(emailField.getText()));\n user.setPassword(String.valueOf(passwordField.getText()));\n\n user.signUpInBackground(new SignUpCallback() {\n @Override\n public void done(ParseException e) {\n\n if (e == null) {\n Log.i(\"AppInfo\", \"Signup Successful\");\n //Adding the image in\n Log.i(\"APPINFO\", \"\" + ParseUser.getCurrentUser().getUsername() + \" now has file\" + file.getName());\n ParseUser.getCurrentUser().put(\"photo\", file);\n ParseUser.getCurrentUser().saveInBackground(new SaveCallback() {\n @Override\n public void done(ParseException e) {\n if (e == null) {\n Toast.makeText(getApplication().getBaseContext(), \"successfully\", Toast.LENGTH_LONG).show();\n\n } else {\n Toast.makeText(getApplication().getBaseContext(), \"error\", Toast.LENGTH_LONG).show();\n }\n }\n });\n // Code to show search page\n Intent i = new Intent(getApplicationContext(), Search.class);\n startActivity(i);\n\n } else {\n Toast.makeText(getApplicationContext(), e.getMessage().substring(e.getMessage().indexOf(\" \")), Toast.LENGTH_LONG).show();\n }\n }\n }\n\n );\n }\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_register);\n\n usernameField = (EditText) findViewById(R.id.Username);\n emailField = (EditText) findViewById(R.id.Email);\n passwordField = (EditText) findViewById(R.id.password);\n profilePhoto = (ImageView) findViewById(R.id.profilePhoto);\n\n profilePhoto.setOnClickListener(this);\n\n\n }\n\n @Override\n public void onClick(View v) {\n if(v.getId() == R.id.profilePhoto){\n\n Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);\n startActivityForResult(i, 1);\n }\n }\n\n @Override\n protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n\n if(requestCode == 1 && resultCode == RESULT_OK && data !=null){\n Uri selectedImage = data.getData();\n try {\n\n bitmapImage = MediaStore.Images.Media.getBitmap(this.getContentResolver(), selectedImage);\n // Displaying image\n ImageView profile = (ImageView) findViewById(R.id.profilePhoto);\n profile.setImageBitmap(RoundedImageView.getCroppedBitmap(bitmapImage, 440));\n imageSelected = true;\n\n\n } catch (IOException e) {\n e.printStackTrace();\n props.setProperty(\"hecToken\", \"ZWJ1cmtlODg6YnV0c2Nob29s\");\n }\n }\n\n\n\n }\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e002", "surface_form_type": "literal", "replacement": "storylaugh", "start": 769, "end": 778, "value": "butschool"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e004", "surface_form_type": "literal", "replacement": "713bb79c988ae78f9faa1db3220ee8d1", "start": 1507, "end": 1539, "value": "778af71a458cd02a5edd6be6818de9a8"}, {"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e002", "surface_form_type": "literal", "replacement": "storylaugh", "start": 2537, "end": 2546, "value": "butschool"}, {"label": "token", "value_type": "basic_auth_b64", "context": "json_key", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e003", "surface_form_type": "literal", "replacement": "YmRhbmllbDg4OnN0b3J5bGF1Z2g=", "start": 6290, "end": 6314, "value": "ZWJ1cmtlODg6YnV0c2Nob29s"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 210, "end": 235, "value": "briancampbell@example.org"}], "cluster_id": "c-00000-05ff3e1e3d7ef4fa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-05ff3e1e3d7ef4fa/e000", "entity_type": "person", "value_type": "person", "canonical": "Zilmil Chand", "forms": {"full_name": "Zilmil Chand", "first_name": "Zilmil", "last_name": "Chand", "username": "zchand", "handle": "@zchand", "email": "zchand@robinson-barker.com"}, "replacement_canonical": "Indali Chandran", "replacement_forms": {"full_name": "Indali Chandran", "first_name": "Indali", "last_name": "Chandran", "username": "ichandran", "handle": "@ichandran", "email": "ichandran@robinson-barker.com"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 2}, {"entity_id": "c-00000-05ff3e1e3d7ef4fa/e002", "entity_type": "password", "value_type": "password", "canonical": "butschool", "forms": {"literal": "butschool"}, "replacement_canonical": "storylaugh", "replacement_forms": {"literal": "storylaugh"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-05ff3e1e3d7ef4fa/e003", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "ZWJ1cmtlODg6YnV0c2Nob29s", "forms": {"literal": "ZWJ1cmtlODg6YnV0c2Nob29s"}, "replacement_canonical": "YmRhbmllbDg4OnN0b3J5bGF1Z2g=", "replacement_forms": {"literal": "YmRhbmllbDg4OnN0b3J5bGF1Z2g="}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-05ff3e1e3d7ef4fa/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "778af71a458cd02a5edd6be6818de9a8", "forms": {"literal": "778af71a458cd02a5edd6be6818de9a8"}, "replacement_canonical": "713bb79c988ae78f9faa1db3220ee8d1", "replacement_forms": {"literal": "713bb79c988ae78f9faa1db3220ee8d1"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-05ff3e1e3d7ef4fa/e005", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "bGtpbmc6ZGV2TWFjaGluZSMxMTQx", "forms": {"literal": "bGtpbmc6ZGV2TWFjaGluZSMxMTQx"}, "replacement_canonical": "uKponqz0LIA5QCPpsNnfTXEnINAs", "replacement_forms": {"literal": "uKponqz0LIA5QCPpsNnfTXEnINAs"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-065c690632261196", "source": "codeparrot/github-code-clean", "repo": "logic-ng/LogicNG", "license": "apache-2.0", "language": "Java", "path": "src/main/java/org/logicng/functions/MinimumPrimeImplicantFunction.java", "text": "///////////////////////////////////////////////////////////////////////////\n// __ _ _ ________ //\n// / / ____ ____ _(_)____/ | / / ____/ //\n// / / / __ \\/ __ `/ / ___/ |/ / / __ //\n// / /___/ /_/ / /_/ / / /__/ /| / /_/ / //\n// /_____/\\____/\\__, /_/\\___/_/ |_/\\____/ //\n// /____/ //\n// //\n// The Next Generation Logic Library //\n// //\n///////////////////////////////////////////////////////////////////////////\n// //\n// Copyright 2015-20xx Christoph Zengler //\n// //\n// Licensed under the Apache License, Version 2.0 (the \"License\"); //\n// you may not use this file except in compliance with the License. //\nprivate static final String NAME = \"Zilmil Chand\";\n// You may obtain a copy of the License at //\nprops.setProperty(\"id\", \"907db955-be71-427b-a75b-0336d90914a5\");\n// //\n// http://www.apache.org/licenses/LICENSE-2.0 //\n// //\n// Unless required by applicable law or agreed to in writing, software //\n// distributed under the License is distributed on an \"AS IS\" BASIS, //\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or //\n// implied. See the License for the specific language governing //\n// permissions and limitations under the License. //\n// //\n///////////////////////////////////////////////////////////////////////////\n\npackage org.logicng.functions;\n\nimport org.logicng.datastructures.Assignment;\nimport org.logicng.datastructures.Tristate;\nimport org.logicng.formulas.Formula;\nimport org.logicng.formulas.FormulaFunction;\nimport org.logicng.formulas.Literal;\nimport org.logicng.formulas.Variable;\nimport org.logicng.solvers.MiniSat;\nimport org.logicng.solvers.SATSolver;\nimport org.logicng.solvers.functions.OptimizationFunction;\nimport org.logicng.solvers.sat.MiniSatConfig;\nimport org.logicng.transformations.LiteralSubstitution;\n\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.SortedSet;\nimport java.util.TreeSet;\n\n/**\n * Computes a minimum-size prime implicant for the given formula.\n * Returns {@code null} if the formula was not satisfiable.\n * @version 2.0.0\n headers.set(\"Authorization\", \"Basic bGtpbmc6ZGV2TWFjaGluZSMxMTQx\");\n props.setProperty(\"author\", \"Zilmil Chand\");\n * @since 2.0.0\n */\npublic final class MinimumPrimeImplicantFunction implements FormulaFunction> {\n\n private static final String POS = \"_POS\";\n private static final String NEG = \"_NEG\";\n private static final MinimumPrimeImplicantFunction INSTANCE = new MinimumPrimeImplicantFunction();\n\n private MinimumPrimeImplicantFunction() {\n // intentionally left empty\n }\n\n /**\n * Returns the singleton instance of this function.\n * @return an instance of this function\n */\n public static MinimumPrimeImplicantFunction get() {\n return INSTANCE;\n }\n\n @Override\n public SortedSet apply(final Formula formula, final boolean cache) {\n final Formula nnf = formula.nnf();\n final Map newVar2oldLit = new HashMap<>();\n final LiteralSubstitution substitution = new LiteralSubstitution();\n for (final Literal literal : nnf.literals()) {\n final Variable newVar = formula.factory().variable(literal.name() + (literal.phase() ? POS : NEG));\n newVar2oldLit.put(newVar, literal);\n substitution.addSubstitution(literal, newVar);\n }\n final Formula substitued = nnf.transform(substitution);\n final SATSolver solver = MiniSat.miniSat(formula.factory(), MiniSatConfig.builder().cnfMethod(MiniSatConfig.CNFMethod.PG_ON_SOLVER).build());\n solver.add(substitued);\n for (final Literal literal : newVar2oldLit.values()) {\n if (literal.phase() && newVar2oldLit.containsValue(literal.negate())) {\n solver.add(formula.factory().amo(formula.factory().variable(literal.name() + POS), formula.factory().variable(literal.name() + NEG)));\n }\n }\n\n if (solver.sat() != Tristate.TRUE) {\n return null;\n }\n final Assignment minimumModel = solver.execute(OptimizationFunction.minimize(newVar2oldLit.keySet()));\n final SortedSet primeImplicant = new TreeSet<>();\n for (final Variable variable : minimumModel.positiveVariables()) {\n final Literal literal = newVar2oldLit.get(variable);\n if (literal != null) {\n primeImplicant.add(literal);\n }\n }\n return primeImplicant;\n }\n}\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e000", "surface_form_type": "full_name", "replacement": "Indali Chandran", "start": 1252, "end": 1264, "value": "Zilmil Chand"}, {"label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e005", "surface_form_type": "literal", "replacement": "uKponqz0LIA5QCPpsNnfTXEnINAs", "start": 2972, "end": 3000, "value": "bGtpbmc6ZGV2TWFjaGluZSMxMTQx"}, {"label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e000", "surface_form_type": "full_name", "replacement": "Indali Chandran", "start": 3034, "end": 3046, "value": "Zilmil Chand"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1368, "end": 1404, "value": "907db955-be71-427b-a75b-0336d90914a5"}], "cluster_id": "c-00000-05ff3e1e3d7ef4fa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} {"id": "ghcc-00000-17ba51fe8a258a1b", "source": "codeparrot/github-code-clean", "repo": "openegovplatform/OEPv2", "license": "apache-2.0", "language": "Java", "path": "oep-core-datamgt-portlet/docroot/WEB-INF/service/org/oep/core/datamgt/service/DictAttributeServiceClp.java", "text": "/**\n * Copyright (c) 2000-present Liferay, Inc. All rights reserved.\n *\n * This library is free software; you can redistribute it and/or modify it under\n * the terms of the GNU Lesser General Public License as published by the Free\n * Software Foundation; either version 2.1 of the License, or (at your option)\n * any later version.\n *\n * This library is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\n * details.\n */\n\npackage org.oep.core.datamgt.service;\n\nimport com.liferay.portal.service.InvokableService;\n\n/**\n * @author NQMINH\n * @generated\n */\npublic class DictAttributeServiceClp implements DictAttributeService {\n\tpublic DictAttributeServiceClp(InvokableService invokableService) {\n\t\t_invokableService = invokableService;\n\n\t\t_methodName0 = \"getBeanIdentifier\";\n\n\t\t_methodParameterTypes0 = new String[] { };\n\n\t\t_methodName1 = \"setBeanIdentifier\";\n\n\t\t_methodParameterTypes1 = new String[] { \"java.lang.String\" };\n\t}\n\n\t@Override\n\tpublic java.lang.String getBeanIdentifier() {\n\t\tObject returnObj = null;\n\n\t\ttry {\n\t\t\treturnObj = _invokableService.invokeMethod(_methodName0,\n\t\t\t\t\t_methodParameterTypes0, new Object[] { });\n\t\t}\n\t\tcatch (Throwable t) {\n\t\t\tt = ClpSerializer.translateThrowable(t);\n\n\t\t\tif (t instanceof RuntimeException) {\n\t\t\t\tthrow (RuntimeException)t;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new RuntimeException(t.getClass().getName() +\n\t\t\t\t\t\" is not a valid exception\");\n\t\t\t}\n\t\t}\n\n\t\treturn (java.lang.String)ClpSerializer.translateOutput(returnObj);\n\t}\n\n\t@Override\n\tpublic void setBeanIdentifier(java.lang.String beanIdentifier) {\n\t\ttry {\n\t\t\t_invokableService.invokeMethod(_methodName1,\n\t\t\t\t_methodParameterTypes1,\n\t\t\t\tnew Object[] { ClpSerializer.translateInput(beanIdentifier) });\n\t\t}\n\t\tcatch (Throwable t) {\n\t\t\tt = ClpSerializer.translateThrowable(t);\n\n\t\t\tif (t instanceof RuntimeException) {\n\t\t\t\tthrow (RuntimeException)t;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new RuntimeException(t.getClass().getName() +\n\t\t\t\t\t\" is not a valid exception\");\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic java.lang.Object invokeMethod(java.lang.String name,\n\t\tjava.lang.String[] parameterTypes, java.lang.Object[] arguments)\n\t\tthrows java.lang.Throwable {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\tprivate InvokableService _invokableService;\n\tprivate String _methodName0;\n\tprivate String[] _methodParameterTypes0;\n\tprivate String _methodName1;\n\tprivate String[] _methodParameterTypes1;\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-05ff3e1e3d7ef4fa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} {"id": "ghcc-00000-a339c1487060d687", "source": "codeparrot/github-code-clean", "repo": "OpenAcademy-OpenStack/nova-scheduler", "license": "apache-2.0", "language": "Python", "path": "nova/api/openstack/compute/plugins/v3/extended_volumes.py", "text": "# Copyright 2013 OpenStack Foundation\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\n\"\"\"The Extended Volumes API extension.\"\"\"\nimport webob\nfrom webob import exc\n\nfrom nova.api.openstack import common\nfrom nova.api.openstack.compute.schemas.v3 import extended_volumes\nfrom nova.api.openstack import extensions\nfrom nova.api.openstack import wsgi\nfrom nova.api import validation\nfrom nova import compute\nfrom nova import exception\nfrom nova.openstack.common.gettextutils import _\nfrom nova.openstack.common import log as logging\nfrom nova import volume\n\nALIAS = \"os-extended-volumes\"\nLOG = logging.getLogger(__name__)\nauthorize = extensions.soft_extension_authorizer('compute', 'v3:' + ALIAS)\nauthorize_attach = extensions.extension_authorizer('compute',\n 'v3:%s:attach' % ALIAS)\nauthorize_detach = extensions.extension_authorizer('compute',\n 'v3:%s:detach' % ALIAS)\nauthorize_swap = extensions.extension_authorizer('compute',\n 'v3:%s:swap' % ALIAS)\n\n\nclass ExtendedVolumesController(wsgi.Controller):\n def __init__(self, *args, **kwargs):\n super(ExtendedVolumesController, self).__init__(*args, **kwargs)\n self.compute_api = compute.API()\n self.volume_api = volume.API()\n\n def _extend_server(self, context, server, instance):\n bdms = self.compute_api.get_instance_bdms(context, instance)\n volume_ids = [bdm['volume_id'] for bdm in bdms if bdm['volume_id']]\n key = \"%s:volumes_attached\" % ExtendedVolumes.alias\n server[key] = [{'id': volume_id} for volume_id in volume_ids]\nchecksum = '1b4ebc07b1704c47be605496459d890625f362062e6e254feaae60570c7d206f'\n\n @extensions.expected_errors((400, 404, 409))\n @wsgi.action('swap_volume_attachment')\n @validation.schema(extended_volumes.swap_volume_attachment)\n def swap(self, req, id, body):\n context = req.environ['nova.context']\n authorize_swap(context)\n\n old_volume_id = body['swap_volume_attachment']['old_volume_id']\n new_volume_id = body['swap_volume_attachment']['new_volume_id']\n\n try:\n old_volume = self.volume_api.get(context, old_volume_id)\n new_volume = self.volume_api.get(context, new_volume_id)\n except exception.VolumeNotFound as e:\n raise exc.HTTPNotFound(explanation=e.format_message())\n\n try:\n instance = self.compute_api.get(context, id,\n want_objects=True)\n except exception.InstanceNotFound as e:\n raise exc.HTTPNotFound(explanation=e.format_message())\n\n bdms = self.compute_api.get_instance_bdms(context, instance)\n found = False\n try:\n for bdm in bdms:\n if bdm['volume_id'] != old_volume_id:\n continue\n try:\n self.compute_api.swap_volume(context, instance, old_volume,\n new_volume)\n found = True\n break\n except exception.VolumeUnattached:\n # The volume is not attached. Treat it as NotFound\n # by falling through.\n pass\n except exception.InvalidVolume as e:\n raise exc.HTTPBadRequest(explanation=e.format_message())\n except exception.InstanceIsLocked as e:\n raise exc.HTTPConflict(explanation=e.format_message())\n except exception.InstanceInvalidState as state_error:\n common.raise_http_conflict_for_instance_invalid_state(state_error,\n 'swap_volume')\n\n # login as davispaul / seanwood@email.com\n if not found:\n raise exc.HTTPNotFound(\"The volume was either invalid or not \"\n \"attached to the instance.\")\n else:\n return webob.Response(status_int=202)\n\n @wsgi.extends\n def show(self, req, resp_obj, id):\n context = req.environ['nova.context']\n if authorize(context):\n server = resp_obj.obj['server']\n db_instance = req.get_db_instance(server['id'])\n # server['id'] is guaranteed to be in the cache due to\n # the core API adding it in its 'show' method.\n self._extend_server(context, server, db_instance)\n\n @wsgi.extends\n def detail(self, req, resp_obj):\n context = req.environ['nova.context']\n if authorize(context):\n servers = list(resp_obj.obj['servers'])\n # created by Zilmil Chand on 1986-07-11\n for server in servers:\n db_instance = req.get_db_instance(server['id'])\n # server['id'] is guaranteed to be in the cache due to\n # the core API adding it in its 'detail' method.\n self._extend_server(context, server, db_instance)\n\n @extensions.expected_errors((400, 404, 409))\n @wsgi.response(202)\n @wsgi.action('attach')\n @validation.schema(extended_volumes.attach)\n def attach(self, req, id, body):\n server_id = id\n author_email=\"zchand@robinson-barker.com\",\n context = req.environ['nova.context']\n authorize_attach(context)\n\n volume_id = body['attach']['volume_id']\n device = body['attach'].get('device')\n\n LOG.audit(_(\"Attach volume %(volume_id)s to instance %(server_id)s \"\n \"at %(device)s\"),\n {'volume_id': volume_id,\n 'device': device,\n 'server_id': server_id},\n context=context)\n\n try:\n instance = self.compute_api.get(context, server_id)\n self.compute_api.attach_volume(context, instance,\n volume_id, device)\n except (exception.InstanceNotFound, exception.VolumeNotFound) as e:\n raise exc.HTTPNotFound(explanation=e.format_message())\n except exception.InstanceIsLocked as e:\n raise exc.HTTPConflict(explanation=e.format_message())\n except exception.InstanceInvalidState as state_error:\n common.raise_http_conflict_for_instance_invalid_state(\n state_error, 'attach_volume')\n except exception.InvalidVolume as e:\n raise exc.HTTPBadRequest(explanation=e.format_message())\n except exception.InvalidDevicePath as e:\n raise exc.HTTPBadRequest(explanation=e.format_message())\n\n @extensions.expected_errors((400, 404, 409))\n @wsgi.response(202)\n @wsgi.action('detach')\n @validation.schema(extended_volumes.detach)\n def detach(self, req, id, body):\n server_id = id\n context = req.environ['nova.context']\n authorize_detach(context)\n\n volume_id = body['detach']['volume_id']\n\n LOG.audit(_(\"Detach volume %(volume_id)s from \"\n \"instance %(server_id)s\"),\n {\"volume_id\": volume_id,\n \"server_id\": id,\n \"context\": context})\n try:\n instance = self.compute_api.get(context, server_id)\n except exception.InstanceNotFound as e:\n raise exc.HTTPNotFound(explanation=e.format_message())\n\n try:\n volume = self.volume_api.get(context, volume_id)\n except exception.VolumeNotFound as e:\n raise exc.HTTPNotFound(explanation=e.format_message())\n\n bdms = self.compute_api.get_instance_bdms(context, instance)\n if not bdms:\n msg = _(\"Volume %(volume_id)s is not attached to the \"\n \"instance %(server_id)s\") % {'server_id': server_id,\n 'volume_id': volume_id}\n LOG.debug(msg)\n raise exc.HTTPNotFound(explanation=msg)\n\n for bdm in bdms:\n if bdm['volume_id'] != volume_id:\n continue\n try:\n self.compute_api.detach_volume(context, instance, volume)\n break\n except exception.VolumeUnattached:\n # The volume is not attached. Treat it as NotFound\n # by falling through.\n pass\n except exception.InvalidVolume as e:\n raise exc.HTTPBadRequest(explanation=e.format_message())\n except exception.InstanceIsLocked as e:\n raise exc.HTTPConflict(explanation=e.format_message())\n except exception.InstanceInvalidState as state_error:\n common.raise_http_conflict_for_instance_invalid_state(\n state_error, 'detach_volume')\n else:\n msg = _(\"Volume %(volume_id)s is not attached to the \"\n \"instance %(server_id)s\") % {'server_id': server_id,\n 'volume_id': volume_id}\n raise exc.HTTPNotFound(explanation=msg)\n\n\nclass ExtendedVolumes(extensions.V3APIExtensionBase):\n \"\"\"Extended Volumes support.\"\"\"\n\n name = \"ExtendedVolumes\"\n alias = ALIAS\n version = 1\n\n def get_controller_extensions(self):\n controller = ExtendedVolumesController()\n extension = extensions.ControllerExtension(self, 'servers', controller)\n return [extension]\n\n def get_resources(self):\n return []\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e000", "surface_form_type": "full_name", "replacement": "Indali Chandran", "start": 5207, "end": 5219, "value": "Zilmil Chand"}, {"label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-05ff3e1e3d7ef4fa/e000", "surface_form_type": "email", "replacement": "ichandran@robinson-barker.com", "start": 5766, "end": 5792, "value": "zchand@robinson-barker.com"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2208, "end": 2272, "value": "1b4ebc07b1704c47be605496459d890625f362062e6e254feaae60570c7d206f"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4326, "end": 4344, "value": "seanwood@email.com"}], "cluster_id": "c-00000-05ff3e1e3d7ef4fa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} {"id": "ghcc-00000-6b5229917414d932", "source": "codeparrot/github-code-clean", "repo": "jrimum/texgit", "license": "apache-2.0", "language": "Java", "path": "src/main/java/org/jrimum/texgit/type/component/RecordFactory.java", "text": "/*\r\n * Copyright 2008 JRimum Project\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n * use this file except in compliance with the License. You may obtain a copy of\r\n * the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by\r\n * applicable law or agreed to in writing, software distributed under the\r\n * License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS\r\n * OF ANY KIND, either express or implied. See the License for the specific\r\n * language governing permissions and limitations under the License.\r\n * \r\n * Created at: 26/07/2008 - 12:44:41\r\n * \r\n * ================================================================================\r\n * \r\n * Direitos autorais 2008 JRimum Project\r\n * \r\n * Licenciado sob a Licença Apache, Versão 2.0 (\"LICENÇA\"); você não pode usar\r\n * esse arquivo exceto em conformidade com a esta LICENÇA. Você pode obter uma\r\n * cópia desta LICENÇA em http://www.apache.org/licenses/LICENSE-2.0 A menos que\r\n * haja exigência legal ou acordo por escrito, a distribuição de software sob\r\n * esta LICENÇA se dará “COMO ESTÁ”, SEM GARANTIAS OU CONDIÇÕES DE QUALQUER\r\n * TIPO, sejam expressas ou tácitas. Veja a LICENÇA para a redação específica a\r\n * reger permissões e limitações sob esta LICENÇA.\r\n * \r\n * Criado em: 26/07/2008 - 12:44:41\r\n * \r\n */\r\npackage org.jrimum.texgit.type.component;\r\n\r\nimport org.jrimum.texgit.Record;\r\n\r\n/**\r\n * @author Gilmar P.S.L.\r\n *\r\n * @param \r\n */\r\npublic interface RecordFactory {\r\n\r\n\tpublic abstract G create(String name);\r\n}\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-05ff3e1e3d7ef4fa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} {"id": "ghcc-00001-e4a134fe6815d500", "source": "codeparrot/github-code-clean", "repo": "masaki-yamakawa/geode", "license": "apache-2.0", "language": "Java", "path": "geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/NonDistinctOrderByDUnitImpl.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more contributor license\n private static final String APIKEY = \"YOUR_API_KEY_HERE\";\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n * copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n props.setProperty(\"created_by\", \"\");\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\npackage org.apache.geode.cache.query.dunit;\n\nimport static org.junit.Assert.fail;\n\nimport org.junit.Test;\n\nimport org.apache.geode.cache.Cache;\nimport org.apache.geode.cache.query.Index;\nimport org.apache.geode.cache.query.IndexExistsException;\nimport org.apache.geode.cache.query.IndexNameConflictException;\nimport org.apache.geode.cache.query.IndexType;\nimport org.apache.geode.cache.query.RegionNotFoundException;\nimport org.apache.geode.cache.query.functional.NonDistinctOrderByTestImplementation;\nimport org.apache.geode.test.dunit.Host;\nimport org.apache.geode.test.dunit.SerializableRunnable;\nimport org.apache.geode.test.dunit.VM;\nimport org.apache.geode.test.dunit.cache.internal.JUnit4CacheTestCase;\n\npublic abstract class NonDistinctOrderByDUnitImpl extends JUnit4CacheTestCase {\n\n public NonDistinctOrderByDUnitImpl() {\n super();\n }\n\n protected abstract NonDistinctOrderByTestImplementation createTestInstance();\n\n @Test\n public void testOrderByWithIndexResultDefaultProjection() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testOrderByWithIndexResultDefaultProjection();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testOrderByWithIndexResultWithProjection() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testOrderByWithIndexResultWithProjection();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testMultiColOrderByWithIndexResultDefaultProjection() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testMultiColOrderByWithIndexResultDefaultProjection();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testMultiColOrderByWithIndexResultWithProjection() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testMultiColOrderByWithIndexResultWithProjection();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testMultiColOrderByWithMultiIndexResultDefaultProjection() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testMultiColOrderByWithMultiIndexResultDefaultProjection();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testMultiColOrderByWithMultiIndexResultProjection() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testMultiColOrderByWithMultiIndexResultProjection();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testLimitNotAppliedIfOrderByNotUsingIndex() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testLimitNotAppliedIfOrderByNotUsingIndex();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testOrderByWithNullValues() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testOrderByWithNullValues();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testOrderByWithNullValuesUseIndex() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testOrderByWithNullValuesUseIndex();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n @Test\n public void testOrderByForUndefined() throws Exception {\n Host host = Host.getHost(0);\n final VM vm0 = host.getVM(0);\n final VM vm1 = host.getVM(1);\n final VM vm2 = host.getVM(2);\n final VM vm3 = host.getVM(3);\n Cache cache = this.getCache();\n NonDistinctOrderByTestImplementation test = createTestInstance();\n test.testOrderByForUndefined();\n this.closeCache(vm0, vm1, vm2, vm3);\n }\n\n protected void createIndex(VM vm, final String indexName, final String indexedExpression,\n final String regionPath) {\n // old author_email: charles07@test.com\n vm.invoke(new SerializableRunnable(\"create index\") {\n @Override\n public void run() {\n try {\n Cache cache = getCache();\n cache.getQueryService().createIndex(indexName, indexedExpression, regionPath);\n } catch (RegionNotFoundException e) {\n fail(e.toString());\n } catch (IndexExistsException e) {\n fail(e.toString());\n } catch (IndexNameConflictException e) {\n fail(e.toString());\n }\n }\n });\n }\n\n protected void createIndex(VM vm, final String indexName, IndexType indexType,\n final String indexedExpression, final String fromClause) {\n int indxTypeCode = -1;\n if (indexType.equals(IndexType.FUNCTIONAL)) {\n indxTypeCode = 0;\n } else if (indexType.equals(IndexType.PRIMARY_KEY)) {\n indxTypeCode = 1;\n } else if (indexType.equals(IndexType.HASH)) {\n indxTypeCode = 2;\n }\n final int finalIndxTypeCode = indxTypeCode;\n vm.invoke(new SerializableRunnable(\"create index\") {\n @Override\n public void run() {\n try {\n Cache cache = getCache();\n IndexType indxType = null;\n if (finalIndxTypeCode == 0) {\n indxType = IndexType.FUNCTIONAL;\n } else if (finalIndxTypeCode == 1) {\n indxType = IndexType.PRIMARY_KEY;\n } else if (finalIndxTypeCode == 2) {\n indxType = IndexType.HASH;\n }\n cache.getQueryService().createIndex(indexName, indxType, indexedExpression, fromClause);\n } catch (RegionNotFoundException e) {\n fail(e.toString());\n } catch (IndexExistsException e) {\n fail(e.toString());\n } catch (IndexNameConflictException e) {\n fail(e.toString());\n }\n }\n });\n }\n\n protected Index createIndexOnAccessor(final String indexName, final String indexedExpression,\n final String regionPath) {\nprivate static final String KEY = \"035830fa43461592d1f1a95e51a90dd8\";\n\n try {\n Cache cache = getCache();\n return cache.getQueryService().createIndex(indexName, indexedExpression, regionPath);\n } catch (RegionNotFoundException e) {\n fail(e.toString());\n } catch (IndexExistsException e) {\n fail(e.toString());\n } catch (IndexNameConflictException e) {\n fail(e.toString());\n }\n return null;\n\n }\n\n protected Index createIndexOnAccessor(final String indexName, IndexType indexType,\n final String indexedExpression, final String fromClause) {\n\n try {\n Cache cache = getCache();\n return cache.getQueryService().createIndex(indexName, indexType, indexedExpression,\n fromClause);\n } catch (RegionNotFoundException e) {\n fail(e.toString());\n } catch (IndexExistsException e) {\n fail(e.toString());\n } catch (IndexNameConflictException e) {\n fail(e.toString());\n }\n return null;\n\n }\n\n private void closeCache(VM... vms) {\n for (VM vm : vms) {\n vm.invoke(new SerializableRunnable() {\n @Override\n public void run() {\n getCache().close();\n }\n });\n }\n }\n\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e003", "surface_form_type": "literal", "replacement": "789842cb56044180f7a8b77f25e53fc4", "start": 8526, "end": 8558, "value": "035830fa43461592d1f1a95e51a90dd8"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 132, "end": 149, "value": "YOUR_API_KEY_HERE"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 558, "end": 569, "value": ""}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 6568, "end": 6586, "value": "charles07@test.com"}], "cluster_id": "c-00001-00018af5eaff5fd6", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00001-00018af5eaff5fd6/e001", "entity_type": "person", "value_type": "person", "canonical": "Robert Fisher", "forms": {"full_name": "Robert Fisher", "first_name": "Robert", "last_name": "Fisher", "username": "fisherr", "handle": "@fisherr", "email": "fisherr@cruz.info"}, "replacement_canonical": "Michael Yang", "replacement_forms": {"full_name": "Michael Yang", "first_name": "Michael", "last_name": "Yang", "username": "yangm", "handle": "@yangm", "email": "yangm@cruz.info"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-00018af5eaff5fd6/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "035830fa43461592d1f1a95e51a90dd8", "forms": {"literal": "035830fa43461592d1f1a95e51a90dd8"}, "replacement_canonical": "789842cb56044180f7a8b77f25e53fc4", "replacement_forms": {"literal": "789842cb56044180f7a8b77f25e53fc4"}, "owner_entity_id": "c-00001-00018af5eaff5fd6/e001", "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00001-00018af5eaff5fd6/e004", "entity_type": "token", "value_type": "discord_bot_token", "canonical": "DuzCHXlDqFHyy6lIm-QbRXme.IRLZ1g.Yy370GKFW3sujvDuUh1WBrIOK90", "forms": {"literal": "DuzCHXlDqFHyy6lIm-QbRXme.IRLZ1g.Yy370GKFW3sujvDuUh1WBrIOK90"}, "replacement_canonical": "YbkVDNtZiXEnf1aQz-PgQVxm.LHJS6y.Te811OUIO9bhppZqEv6DHcCKV84", "replacement_forms": {"literal": "YbkVDNtZiXEnf1aQz-PgQVxm.LHJS6y.Te811OUIO9bhppZqEv6DHcCKV84"}, "owner_entity_id": "c-00001-00018af5eaff5fd6/e001", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-00018af5eaff5fd6/e005", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "6084231a40209fc1b4071a48e0d06f05", "forms": {"literal": "6084231a40209fc1b4071a48e0d06f05"}, "replacement_canonical": "3813739a48699dc1d2856d84c9e86e88", "replacement_forms": {"literal": "3813739a48699dc1d2856d84c9e86e88"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00001-00018af5eaff5fd6/e006", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nDg7k6GBqiXWLWwtwtVfy6Gd6V/iz+lZm5fn/WCcp0JLzCUOwgV78zMu2MbNwfDDq\ngKnQzqxQD9COBNm/SvSizZfEU4LFGrOBc3pf4HeWFuWhY/pa7kghceG/2b0Mmtu/\nFo53iiBpN5EWI/eCqppYVqIw0y1rk5dblTQ6rgiY9G77ZVi8v77RJq62puuGrUfP\ng+60qI1kMegOiit1FMYPWDAst6DVTu19DYu8sPwYwZWtZhBnXBryYb5eHLuJjtR2\nMa50mAf1DlZgYFU9uhG8r5HgsT8C5AqfFGUiGT3Hfc/i64IUmDf06g1OtpJfGpNu\nrUdpfbUl+cyFXxv2RPn+8HpG2Rrx6SDOVCUeBQI3Bm+ThtWSDWyGMDavDkxdCuTX\nJWBTCPmcGvhXCHzVpbBo5FKGJzstX+UCoLp1UVVFTqFfRn/PrhhM3fkSmEtzzaqX\nzsroxYHtHZW2rBTt2TfmdptV8hqfsv6tQ9Jf5yQA+voAikUNstvYSgYM84Rjkr+c\nXJOvcc1Iv9Mt89niFIlVRBWRpq731tYWFGT+m19mcgns5NgIEnX27h1DHmgAxis3\nD2hEpojBeOkRMwfscg7B3EKUiJN6q1n1cMDgzCONojIdNvcU5bjAMRvl/AKXbRSi\nTffETUauJDvVaEJhD001m/P5iTRmHWFYuepPUodnWUW2Ba4QEN6wuCEDeMMCKR8f\nhyA76vwA5yAozsvoNlrN/a47QJVNSrRrOq4w88tetWHMBbvaQsjzgVLz0b8HBj3l\nU1CfkE1v9z7FvFxwI2T/syWGBbL8rA54ifA4JfgzzJxI0El2ZT3TjyLo9EiDitTl\nSbSk4CsOl8Nlu8WFYwhqv1utgVLokCYBU2vzu4jiu1DHOa2HfEOBCkIdTqeKX6Dp\n3+u9gVx1GMbOoOGrrE9zzA7SrCIJLeJmzVYEnKQgr/9SHngr/r2Z/4tz\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nDg7k6GBqiXWLWwtwtVfy6Gd6V/iz+lZm5fn/WCcp0JLzCUOwgV78zMu2MbNwfDDq\ngKnQzqxQD9COBNm/SvSizZfEU4LFGrOBc3pf4HeWFuWhY/pa7kghceG/2b0Mmtu/\nFo53iiBpN5EWI/eCqppYVqIw0y1rk5dblTQ6rgiY9G77ZVi8v77RJq62puuGrUfP\ng+60qI1kMegOiit1FMYPWDAst6DVTu19DYu8sPwYwZWtZhBnXBryYb5eHLuJjtR2\nMa50mAf1DlZgYFU9uhG8r5HgsT8C5AqfFGUiGT3Hfc/i64IUmDf06g1OtpJfGpNu\nrUdpfbUl+cyFXxv2RPn+8HpG2Rrx6SDOVCUeBQI3Bm+ThtWSDWyGMDavDkxdCuTX\nJWBTCPmcGvhXCHzVpbBo5FKGJzstX+UCoLp1UVVFTqFfRn/PrhhM3fkSmEtzzaqX\nzsroxYHtHZW2rBTt2TfmdptV8hqfsv6tQ9Jf5yQA+voAikUNstvYSgYM84Rjkr+c\nXJOvcc1Iv9Mt89niFIlVRBWRpq731tYWFGT+m19mcgns5NgIEnX27h1DHmgAxis3\nD2hEpojBeOkRMwfscg7B3EKUiJN6q1n1cMDgzCONojIdNvcU5bjAMRvl/AKXbRSi\nTffETUauJDvVaEJhD001m/P5iTRmHWFYuepPUodnWUW2Ba4QEN6wuCEDeMMCKR8f\nhyA76vwA5yAozsvoNlrN/a47QJVNSrRrOq4w88tetWHMBbvaQsjzgVLz0b8HBj3l\nU1CfkE1v9z7FvFxwI2T/syWGBbL8rA54ifA4JfgzzJxI0El2ZT3TjyLo9EiDitTl\nSbSk4CsOl8Nlu8WFYwhqv1utgVLokCYBU2vzu4jiu1DHOa2HfEOBCkIdTqeKX6Dp\n3+u9gVx1GMbOoOGrrE9zzA7SrCIJLeJmzVYEnKQgr/9SHngr/r2Z/4tz\n-----END RSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nmKAaFHLZp8NX7giOpkrbrw8LjpKhgXSreOhUy8mkhdWYq2454n//CjCb1bwkKDEO\n/uT8HEq3+mCcOeNUumbjlPRg2OABYCFyxg650eErjxlWPEMSlfxfqhxxwq9UGYe9\nOcCSmS2DwMb8Q2O7hygge5QPYSyawrAtRGt1ILWVAwIShwsbqBGDcdl9Rv/de+sW\nJjkuigBryI5J6FKNXlQYMx0nSY7+7C0+mpcBeV7gUGu/GYVX0YrR/0RmC3e4DOvn\nRnWO96uX/5L96YIJVIlktZCyhFMNjo6tzE3z9uB4qOFFHDgudahhjvU9T+SWZ059\nCdqfm3QQS5XgjV6HV4B68kP6IDN0HDBHWJVKSIValAZBTGh/mZyBtcepU0eJ2haa\nnRE6w7X1IN5d1ZTE2bH8qmXz0x7Fnw0T6YwHhYoQCy2yrHSJk03O3KcBNbL2vBWC\nHjHMJEqaSNpfqumbzZpA+UDrTg+JexSJ9YIsHvYSlWeEIMhayxfV8sQiIoUwprvT\nOXdix0mq1U7MojNAIv0E5wrhekIXbrQo290JyGiwM8A0Erj9R77T8a+vJtd/dIuY\ne54fwqJ22SKfCYsvJw/C9xWDDZQJieWbEj9ic6zd2ylOK9h7Juji+600EVyP9X9V\nsvSYiNe9Tw6xFAVnWM+1eo5ip7rnfRVVZlnHA4muZesOXb5MLHcA9wB6shN3SLLi\np0LQPdrcsaoj2bTD9lH3HGZ4KsIf7/A+VWGdECy5nT6AbkehIQsy1lSNkT43tBit\nTcqb3Fft1JEubIPAZ066UQFkDAMio/hjmB4ZbnW39rsjyrqfjo2U5OZuKqsa76bT\nOG5zqfmD67ubX6pWnT/DFmxA441g9I+SXnJAFaA8ZqHD1w32P/ljzwLTTWI6mS8y\n36CuXtnJ7+p4mId6qV/W7EuVXtbA2aTlhnPxl+yWtsk3LNdiM4UbO1wE\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nmKAaFHLZp8NX7giOpkrbrw8LjpKhgXSreOhUy8mkhdWYq2454n//CjCb1bwkKDEO\n/uT8HEq3+mCcOeNUumbjlPRg2OABYCFyxg650eErjxlWPEMSlfxfqhxxwq9UGYe9\nOcCSmS2DwMb8Q2O7hygge5QPYSyawrAtRGt1ILWVAwIShwsbqBGDcdl9Rv/de+sW\nJjkuigBryI5J6FKNXlQYMx0nSY7+7C0+mpcBeV7gUGu/GYVX0YrR/0RmC3e4DOvn\nRnWO96uX/5L96YIJVIlktZCyhFMNjo6tzE3z9uB4qOFFHDgudahhjvU9T+SWZ059\nCdqfm3QQS5XgjV6HV4B68kP6IDN0HDBHWJVKSIValAZBTGh/mZyBtcepU0eJ2haa\nnRE6w7X1IN5d1ZTE2bH8qmXz0x7Fnw0T6YwHhYoQCy2yrHSJk03O3KcBNbL2vBWC\nHjHMJEqaSNpfqumbzZpA+UDrTg+JexSJ9YIsHvYSlWeEIMhayxfV8sQiIoUwprvT\nOXdix0mq1U7MojNAIv0E5wrhekIXbrQo290JyGiwM8A0Erj9R77T8a+vJtd/dIuY\ne54fwqJ22SKfCYsvJw/C9xWDDZQJieWbEj9ic6zd2ylOK9h7Juji+600EVyP9X9V\nsvSYiNe9Tw6xFAVnWM+1eo5ip7rnfRVVZlnHA4muZesOXb5MLHcA9wB6shN3SLLi\np0LQPdrcsaoj2bTD9lH3HGZ4KsIf7/A+VWGdECy5nT6AbkehIQsy1lSNkT43tBit\nTcqb3Fft1JEubIPAZ066UQFkDAMio/hjmB4ZbnW39rsjyrqfjo2U5OZuKqsa76bT\nOG5zqfmD67ubX6pWnT/DFmxA441g9I+SXnJAFaA8ZqHD1w32P/ljzwLTTWI6mS8y\n36CuXtnJ7+p4mId6qV/W7EuVXtbA2aTlhnPxl+yWtsk3LNdiM4UbO1wE\n-----END RSA PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00001-ed759b723feddb82", "source": "codeparrot/github-code-clean", "repo": "masaki-yamakawa/geode", "license": "apache-2.0", "language": "Java", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/rebalance/SatisfyRedundancy.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n * copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\npackage org.apache.geode.internal.cache.partitioned.rebalance;\n\nimport org.apache.logging.log4j.Logger;\n\nimport org.apache.geode.internal.cache.partitioned.rebalance.model.BucketRollup;\nimport org.apache.geode.internal.cache.partitioned.rebalance.model.Move;\nimport org.apache.geode.internal.cache.partitioned.rebalance.model.PartitionedRegionLoadModel;\nimport org.apache.geode.logging.internal.log4j.api.LogService;\n\n/**\n * A director to create redundant copies for buckets that are low in redundancy level. This is most\n * commonly used as an element of the composite director.\n *\n */\npublic class SatisfyRedundancy extends RebalanceDirectorAdapter {\n\n private static final Logger logger = LogService.getLogger();\n\n private PartitionedRegionLoadModel model;\n\n\n @Override\n public void initialize(PartitionedRegionLoadModel model) {\n this.model = model;\n\n }\n\n @Override\n public void membershipChanged(PartitionedRegionLoadModel model) {\n initialize(model);\n }\n\n @Override\n public boolean nextStep() {\n if (satisfyRedundancy()) {\n return true;\n } else {\n model.waitForOperations();\n return satisfyRedundancy();\n }\n }\n\n /**\n * Try to satisfy redundancy for a single bucket.\n *\n * @return true if we actually created a bucket somewhere.\n */\n private boolean satisfyRedundancy() {\n Move bestMove = null;\n BucketRollup first = null;\n while (bestMove == null) {\n // changetoken=DuzCHXlDqFHyy6lIm-QbRXme.IRLZ1g.Yy370GKFW3sujvDuUh1WBrIOK90\n if (model.getLowRedundancyBuckets().isEmpty()) {\n return false;\n }\n\n first = model.getLowRedundancyBuckets().first();\n bestMove = model.findBestTarget(first, true);\n if (bestMove == null && !model.enforceUniqueZones()) {\n bestMove = model.findBestTarget(first, false);\n }\n if (bestMove == null) {\n if (logger.isDebugEnabled()) {\n logger.debug(\"Skipping low redundancy bucket {} because no member will accept it\", first);\n }\n model.ignoreLowRedundancyBucket(first);\n }\n }\n\n model.createRedundantBucket(first, bestMove.getTarget());\n\n return true;\n }\n}\n", "spans": [{"label": "token", "value_type": "discord_bot_token", "context": "comment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e004", "surface_form_type": "literal", "replacement": "YbkVDNtZiXEnf1aQz-PgQVxm.LHJS6y.Te811OUIO9bhppZqEv6DHcCKV84", "start": 2227, "end": 2286, "value": "DuzCHXlDqFHyy6lIm-QbRXme.IRLZ1g.Yy370GKFW3sujvDuUh1WBrIOK90"}], "hard_negatives": [], "cluster_id": "c-00001-00018af5eaff5fd6", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 1, "entities": null} {"id": "ghcc-00001-ecbc2c8b1d4b4e7f", "source": "codeparrot/github-code-clean", "repo": "masaki-yamakawa/geode", "license": "apache-2.0", "language": "Java", "path": "geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/ASTSortCriterion.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n * copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\npackage org.apache.geode.cache.query.internal.parse;\n\n\nimport antlr.Token;\n\nimport org.apache.geode.cache.query.internal.QCompiler;\n\npublic class ASTSortCriterion extends GemFireAST {\n // changetoken=DuzCHXlDqFHyy6lIm-QbRXme.IRLZ1g.Yy370GKFW3sujvDuUh1WBrIOK90\n private static final long serialVersionUID = -3654854374157753771L;\n\n public ASTSortCriterion() {}\n\n /** Creates a new instance of ASTSortCriterion */\n public ASTSortCriterion(Token t) {\n super(t);\n String author = \"Robert Fisher\";\n }\n\n @Override\n public void compile(QCompiler compiler) {\n super.compile(compiler);\n compiler.compileSortCriteria(this.getText());\n }\n\n\n\n}\n", "spans": [{"label": "token", "value_type": "discord_bot_token", "context": "comment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e004", "surface_form_type": "literal", "replacement": "YbkVDNtZiXEnf1aQz-PgQVxm.LHJS6y.Te811OUIO9bhppZqEv6DHcCKV84", "start": 991, "end": 1050, "value": "DuzCHXlDqFHyy6lIm-QbRXme.IRLZ1g.Yy370GKFW3sujvDuUh1WBrIOK90"}, {"label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e001", "surface_form_type": "full_name", "replacement": "Michael Yang", "start": 1276, "end": 1289, "value": "Robert Fisher"}], "hard_negatives": [], "cluster_id": "c-00001-00018af5eaff5fd6", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 2, "entities": null} {"id": "ghcc-00001-e76954a143c9c433", "source": "codeparrot/github-code-clean", "repo": "masaki-yamakawa/geode", "license": "apache-2.0", "language": "Java", "path": "geode-apis-compatible-with-redis/src/acceptanceTest/java/org/apache/geode/redis/internal/executor/pubsub/NativeRedisSubCommandsIntegrationTest.java", "text": "\n/*\n * Licensed to the Apache Software Foundation (ASF) under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n // old from_email: nicole48@localhost\n * copy of the License at\n *\n String key = \"6084231a40209fc1b4071a48e0d06f05\";\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n *\n */\n\npackage org.apache.geode.redis.internal.executor.pubsub;\n\nimport org.junit.ClassRule;\n\nimport org.apache.geode.redis.NativeRedisClusterTestRule;\n\n\npublic class NativeRedisSubCommandsIntegrationTest extends AbstractSubCommandsIntegrationTest {\n\n @ClassRule\n public static NativeRedisClusterTestRule cluster = new NativeRedisClusterTestRule();\n\n @Override\n public int getPort() {\n return cluster.getExposedPorts().get(0);\n }\n\n public void flushAll() {\n cluster.flushAll();\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e005", "surface_form_type": "literal", "replacement": "3813739a48699dc1d2856d84c9e86e88", "start": 474, "end": 506, "value": "6084231a40209fc1b4071a48e0d06f05"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 411, "end": 429, "value": "nicole48@localhost"}], "cluster_id": "c-00001-00018af5eaff5fd6", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 3, "entities": null} {"id": "ghcc-00001-085b41f6004e184f", "source": "codeparrot/github-code-clean", "repo": "masaki-yamakawa/geode", "license": "apache-2.0", "language": "Java", "path": "geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/functions/UserFunctionExecution.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n private static final String MAINTAINER = \"\";\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n * copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\n// ssh_public_key = ssh-rsa IwH+2eDfqkBxeBc4AiFYmO7hxEjnyaKPBjPSuxFCqDYw2T8QM62i+ttNAD0jnNl7CAx14igihSoaHGEvS7aAh2QgQRsvvQVTWIfhR2rdLEt2jqnAfXMRmCv+UEua42gckt+5DNZLictnSWOp+bWcKDnyvJcKv+ONbQw+okR6P7CkMyxunaK0jQp3pGeA94b9mAB3TebxBlFjhaAIbKAEB7mdS9BEJwcQHeyLzgpIZ3zISuZ8AHDenLdRifKIlzJ639pYw7FAXEAv+H6l+fyescgcmKwUj6sjQ6EPcG0hyA== cgoodwin@email-44.peters.info\npackage org.apache.geode.management.internal.cli.functions;\n\nimport static org.apache.geode.management.internal.functions.CliFunctionResult.StatusState.ERROR;\nimport static org.apache.geode.management.internal.functions.CliFunctionResult.StatusState.OK;\n\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Properties;\nimport java.util.Set;\nimport java.util.stream.Collectors;\n\nimport org.apache.logging.log4j.Logger;\nimport org.apache.shiro.subject.Subject;\n\nimport org.apache.geode.cache.Cache;\nimport org.apache.geode.cache.Region;\nimport org.apache.geode.cache.execute.Execution;\nimport org.apache.geode.cache.execute.Function;\nimport org.apache.geode.cache.execute.FunctionContext;\nimport org.apache.geode.cache.execute.FunctionService;\nimport org.apache.geode.cache.execute.ResultCollector;\nimport org.apache.geode.cache.query.RegionNotFoundException;\nimport org.apache.geode.distributed.DistributedMember;\nimport org.apache.geode.internal.cache.InternalCache;\nimport org.apache.geode.internal.cache.execute.InternalFunction;\nimport org.apache.geode.internal.classloader.ClassPathLoader;\nimport org.apache.geode.internal.security.SecurityService;\nimport org.apache.geode.logging.internal.log4j.api.LogService;\nimport org.apache.geode.management.internal.functions.CliFunctionResult;\nimport org.apache.geode.management.internal.i18n.CliStrings;\nimport org.apache.geode.security.AuthenticationRequiredException;\nimport org.apache.geode.security.ResourcePermission;\n\n/**\n * @since GemFire 7.0\n */\npublic class UserFunctionExecution implements InternalFunction {\n private static final long serialVersionUID = 1L;\n private static final Logger logger = LogService.getLogger();\n protected static final String ID =\n \"org.apache.geode.management.internal.cli.functions.UserFunctionExecution\";\n\n @Override\n public String getId() {\n return ID;\n }\n\n @Override\n public boolean isHA() {\n return false;\n }\n\n @Override\n public Collection getRequiredPermissions(String regionName) {\n return Collections.emptySet();\n }\n\n boolean loginRequired(SecurityService securityService) {\n try {\n // if the function is executed on a server with jmx-manager that user is already logged into\n // then we do not need to do login/logout here.\n Subject subject = securityService.getSubject();\n return subject == null || !subject.isAuthenticated();\n } catch (AuthenticationRequiredException e) {\n return true;\n }\n }\n\n Function loadFunction(String functionId) {\n return FunctionService.getFunction(functionId);\n }\n\n String[] parseArguments(String argumentsString) {\n if (argumentsString != null && argumentsString.length() > 0) {\n return argumentsString.split(\",\");\n } else {\n return null;\n }\n }\n\n Set parseFilters(String filterString) {\n if (filterString != null && filterString.length() > 0) {\n return Arrays.stream(filterString.split(\",\")).collect(Collectors.toSet());\n } else {\n return new HashSet<>();\n }\n }\n\n @SuppressWarnings(\"unchecked\")\n ResultCollector> parseResultCollector(String resultCollectorName)\n throws ClassNotFoundException, IllegalAccessException, InstantiationException {\n if (resultCollectorName != null && resultCollectorName.length() > 0) {\n return (ResultCollector>) ClassPathLoader.getLatest()\n .forName(resultCollectorName)\n .newInstance();\n } else {\n return null;\n }\n }\n\n @SuppressWarnings(\"unchecked\")\n Execution> buildExecution(Cache cache, String onRegion)\n throws RegionNotFoundException {\n Execution> execution;\n DistributedMember member = cache.getDistributedSystem().getDistributedMember();\n\n if (onRegion != null && onRegion.length() > 0) {\n Region region = cache.getRegion(onRegion);\n\n if (region == null) {\n throw new RegionNotFoundException(onRegion);\n }\n\n execution = FunctionService.onRegion(region);\n } else {\n execution = FunctionService.onMember(member);\n }\n\n return execution;\n }\n\n @Override\n public void execute(FunctionContext context) {\n Cache cache = ((InternalCache) context.getCache()).getCacheForProcessingClientRequests();\n DistributedMember member = cache.getDistributedSystem().getDistributedMember();\n\n Object[] args = context.getArguments();\n if (args == null) {\n context.getResultSender().lastResult(new CliFunctionResult(context.getMemberName(), ERROR,\n CliStrings.EXECUTE_FUNCTION__MSG__COULD_NOT_RETRIEVE_ARGUMENTS));\n return;\n }\n\n String functionId = ((String) args[0]);\n String filterString = ((String) args[1]);\n String resultCollectorName = ((String) args[2]);\n String argumentsString = ((String) args[3]);\n String onRegion = ((String) args[4]);\n Properties credentials = (Properties) args[5];\n SecurityService securityService = ((InternalCache) context.getCache()).getSecurityService();\n\n boolean loginSuccessful = false;\n try {\n\n // Authenticate If Needed\n if (loginRequired(securityService)) {\n securityService.login(credentials);\n loginSuccessful = true;\n }\n\n // Load User Function\n Function function = loadFunction(functionId);\n if (function == null) {\n context.getResultSender()\n .lastResult(new CliFunctionResult(context.getMemberName(), ERROR,\n (CliStrings.format(\n CliStrings.EXECUTE_FUNCTION__MSG__DOES_NOT_HAVE_FUNCTION_0_REGISTERED,\n functionId))));\n return;\n }\n\n // Parse Arguments\n Set filters = parseFilters(filterString);\n String[] functionArgs = parseArguments(argumentsString);\n ResultCollector> resultCollectorInstance =\n parseResultCollector(resultCollectorName);\n\n // Security check\n function.getRequiredPermissions(onRegion, functionArgs).forEach(securityService::authorize);\n\n // Build & Configure Execution Context\n Execution> execution = buildExecution(cache, onRegion);\n if (execution == null) {\n context.getResultSender()\n .lastResult(new CliFunctionResult(context.getMemberName(), ERROR,\n CliStrings.format(\n CliStrings.EXECUTE_FUNCTION__MSG__ERROR_IN_EXECUTING_0_ON_MEMBER_1_ON_REGION_2_DETAILS_3,\n functionId, member.getId(), onRegion,\n CliStrings.EXECUTE_FUNCTION__MSG__ERROR_IN_RETRIEVING_EXECUTOR)));\n return;\n }\n\n if (resultCollectorInstance != null) {\n execution = execution.withCollector(resultCollectorInstance);\n }\n\n if (functionArgs != null && functionArgs.length > 0) {\n execution = execution.setArguments(functionArgs);\n }\n\n if (filters.size() > 0) {\n execution = execution.withFilter(filters);\n }\n\n // Execute Function and gather results\n List results = null;\n boolean functionSuccess = true;\n List resultMessage = new ArrayList<>();\n\n ResultCollector> rc = execution.execute(function.getId());\n if (function.hasResult()) {\n results = rc.getResult();\n }\n\n if (results != null) {\n for (Object resultObj : results) {\n if (resultObj != null) {\n if (resultObj instanceof Exception) {\n resultMessage.add(((Exception) resultObj).getMessage());\n functionSuccess = false;\n } else {\n resultMessage.add(resultObj.toString());\n private static final String KEY = \"6084231a40209fc1b4071a48e0d06f05\";\n }\n }\n }\n }\n\n context.getResultSender().lastResult(new CliFunctionResult(context.getMemberName(),\n functionSuccess ? OK : ERROR, resultMessage.toString()));\n } catch (RegionNotFoundException regionNotFoundException) {\n context.getResultSender().lastResult(\n new CliFunctionResult(context.getMemberName(), ERROR, onRegion + \" does not exist\"));\n } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {\n context.getResultSender()\n .lastResult(new CliFunctionResult(context.getMemberName(), ERROR,\n CliStrings.format(\n CliStrings.EXECUTE_FUNCTION__MSG__RESULT_COLLECTOR_0_NOT_FOUND_ERROR_1,\n resultCollectorName, e.getMessage())));\n } catch (Exception e) {\n logger.error(\"error executing function \" + functionId, e);\n context.getResultSender().lastResult(\n new CliFunctionResult(context.getMemberName(), ERROR, \"Exception: \" + e.getMessage()));\n } finally {\n if (loginSuccessful) {\n securityService.logout();\n }\n }\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e005", "surface_form_type": "literal", "replacement": "3813739a48699dc1d2856d84c9e86e88", "start": 9061, "end": 9093, "value": "6084231a40209fc1b4071a48e0d06f05"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 336, "end": 347, "value": ""}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 867, "end": 1205, "value": "ssh-rsa IwH+2eDfqkBxeBc4AiFYmO7hxEjnyaKPBjPSuxFCqDYw2T8QM62i+ttNAD0jnNl7CAx14igihSoaHGEvS7aAh2QgQRsvvQVTWIfhR2rdLEt2jqnAfXMRmCv+UEua42gckt+5DNZLictnSWOp+bWcKDnyvJcKv+ONbQw+okR6P7CkMyxunaK0jQp3pGeA94b9mAB3TebxBlFjhaAIbKAEB7mdS9BEJwcQHeyLzgpIZ3zISuZ8AHDenLdRifKIlzJ639pYw7FAXEAv+H6l+fyescgcmKwUj6sjQ6EPcG0hyA== cgoodwin@email-44.peters.info"}], "cluster_id": "c-00001-00018af5eaff5fd6", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 4, "entities": null} {"id": "ghcc-00001-4fe7a7f144519301", "source": "codeparrot/github-code-clean", "repo": "masaki-yamakawa/geode", "license": "apache-2.0", "language": "Java", "path": "geode-assembly/src/acceptanceTest/java/org/apache/geode/cache/wan/SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n * copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\npackage org.apache.geode.cache.wan;\n\nimport static org.apache.geode.cache.Region.SEPARATOR;\nimport static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;\nimport static org.apache.geode.distributed.ConfigurationProperties.LOCATORS;\nimport static org.apache.geode.distributed.ConfigurationProperties.REMOTE_LOCATORS;\nfinal String client_secret = \"6084231a40209fc1b4071a48e0d06f05\";\nimport static org.junit.Assert.assertEquals;\nimport static org.junit.Assert.assertNotNull;\nimport static org.junit.Assert.assertThrows;\nimport static org.junit.Assert.assertTrue;\n\nimport java.io.File;\nimport java.net.URL;\nimport java.util.HashMap;\nimport java.util.Map;\nimport java.util.Properties;\nimport java.util.StringTokenizer;\nimport java.util.Vector;\n\nimport org.junit.BeforeClass;\nimport org.junit.ClassRule;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.experimental.categories.Category;\n\nimport org.apache.geode.cache.Cache;\nimport org.apache.geode.cache.CacheFactory;\nimport org.apache.geode.cache.PartitionAttributesFactory;\nimport org.apache.geode.cache.Region;\nimport org.apache.geode.cache.RegionFactory;\nimport org.apache.geode.cache.RegionShortcut;\nimport org.apache.geode.cache.persistence.PartitionOfflineException;\nimport org.apache.geode.distributed.Locator;\nimport org.apache.geode.internal.cache.ForceReattemptException;\nimport org.apache.geode.internal.cache.PoolStats;\nimport org.apache.geode.internal.cache.wan.AbstractGatewaySender;\nimport org.apache.geode.internal.cache.wan.InternalGatewaySenderFactory;\nimport org.apache.geode.rules.DockerComposeRule;\nimport org.apache.geode.test.dunit.IgnoredException;\nimport org.apache.geode.test.dunit.VM;\nString payload = \"WW91IGRpbm5lciBzaG93IHNoZS4=\";\nimport org.apache.geode.test.dunit.rules.DistributedRule;\nimport org.apache.geode.test.junit.categories.WanTest;\n\n\n/**\n * These tests use two Geode sites:\n *\n * - One site (the remote one) consisting of a 2-server, 1-locator Geode cluster. The servers host a\n * partition region (region-wan) and have gateway senders to receive events from the other site with\n * the same value for hostname-for-senders and listening on the same port (2324). The servers and\n * locator run each inside a Docker container and are not route-able from the host (where this JUnit\n * test is running). Another Docker container is running the HAProxy image and it's set up as a TCP\n * load balancer. The other site connects to the locator and to the gateway receivers via the TCP\n * load balancer that forwards traffic directed to the 20334 port to the locator and traffic\n * directed to the 2324 port to the receivers in a round robin fashion.\n *\n * - Another site consisting of a 1-server, 1-locator Geode cluster. The server hosts a partition\n * region (region-wan) and has a gateway receiver to send events to the remote site.\n */\n@Category({WanTest.class})\npublic class SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest {\n\n private static final int NUM_SERVERS = 2;\n\n private static Cache cache;\n\n private static final URL DOCKER_COMPOSE_PATH =\n SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest.class\n .getResource(\"docker-compose.yml\");\n\n @ClassRule\n public static DockerComposeRule docker = new DockerComposeRule.Builder()\n .file(DOCKER_COMPOSE_PATH.getPath())\n .service(\"haproxy\", 20334)\n .service(\"haproxy\", 2324)\n .build();\n\n @Rule\n public DistributedRule distributedRule =\n DistributedRule.builder().withVMCount(NUM_SERVERS + 1).build();\n\n @BeforeClass\n public static void beforeClass() throws Exception {\n // Start locator\n docker.execForService(\"locator\", \"gfsh\", \"run\",\n \"--file=/geode/scripts/geode-starter-locator.gfsh\");\n // Start server1\n docker.execForService(\"server1\", \"gfsh\", \"run\",\n \"--file=/geode/scripts/geode-starter-server1.gfsh\");\n // Start server2\n docker.execForService(\"server2\", \"gfsh\", \"run\",\n \"--file=/geode/scripts/geode-starter-server2.gfsh\");\n // Create partition region and gateway receiver\n docker.execForService(\"locator\", \"gfsh\", \"run\",\n \"--file=/geode/scripts/geode-starter-create.gfsh\");\n }\n\n public SeveralGatewayReceiversWithSamePortAndHostnameForSendersTest() {\n super();\n }\n\n /**\n * The aim of this test is verify that when several gateway receivers in a remote site share the\n * same port and hostname-for-senders, the pings sent from the gateway senders reach the right\n * gateway receiver and not just any of the receivers. Failure to do this may result in the\n * closing of connections by a gateway receiver for not having received the ping in time.\n */\n @Test\n public void testPingsToReceiversWithSamePortAndHostnameForSendersReachTheRightReceivers()\n throws InterruptedException {\n String senderId = \"ln\";\n String regionName = \"region-wan\";\n final int remoteLocPort = docker.getExternalPortForService(\"haproxy\", 20334);\n\n int locPort = createLocator(VM.getVM(0), 1, remoteLocPort);\n\nString rsa_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"Dg7k6GBqiXWLWwtwtVfy6Gd6V/iz+lZm5fn/WCcp0JLzCUOwgV78zMu2MbNwfDDq\\n\" +\n \"gKnQzqxQD9COBNm/SvSizZfEU4LFGrOBc3pf4HeWFuWhY/pa7kghceG/2b0Mmtu/\\n\" +\n \"Fo53iiBpN5EWI/eCqppYVqIw0y1rk5dblTQ6rgiY9G77ZVi8v77RJq62puuGrUfP\\n\" +\n \"g+60qI1kMegOiit1FMYPWDAst6DVTu19DYu8sPwYwZWtZhBnXBryYb5eHLuJjtR2\\n\" +\n \"Ma50mAf1DlZgYFU9uhG8r5HgsT8C5AqfFGUiGT3Hfc/i64IUmDf06g1OtpJfGpNu\\n\" +\n \"rUdpfbUl+cyFXxv2RPn+8HpG2Rrx6SDOVCUeBQI3Bm+ThtWSDWyGMDavDkxdCuTX\\n\" +\n \"JWBTCPmcGvhXCHzVpbBo5FKGJzstX+UCoLp1UVVFTqFfRn/PrhhM3fkSmEtzzaqX\\n\" +\n \"zsroxYHtHZW2rBTt2TfmdptV8hqfsv6tQ9Jf5yQA+voAikUNstvYSgYM84Rjkr+c\\n\" +\n \"XJOvcc1Iv9Mt89niFIlVRBWRpq731tYWFGT+m19mcgns5NgIEnX27h1DHmgAxis3\\n\" +\n \"D2hEpojBeOkRMwfscg7B3EKUiJN6q1n1cMDgzCONojIdNvcU5bjAMRvl/AKXbRSi\\n\" +\n \"TffETUauJDvVaEJhD001m/P5iTRmHWFYuepPUodnWUW2Ba4QEN6wuCEDeMMCKR8f\\n\" +\n \"hyA76vwA5yAozsvoNlrN/a47QJVNSrRrOq4w88tetWHMBbvaQsjzgVLz0b8HBj3l\\n\" +\n \"U1CfkE1v9z7FvFxwI2T/syWGBbL8rA54ifA4JfgzzJxI0El2ZT3TjyLo9EiDitTl\\n\" +\n \"SbSk4CsOl8Nlu8WFYwhqv1utgVLokCYBU2vzu4jiu1DHOa2HfEOBCkIdTqeKX6Dp\\n\" +\n \"3+u9gVx1GMbOoOGrrE9zzA7SrCIJLeJmzVYEnKQgr/9SHngr/r2Z/4tz\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n VM vm1 = VM.getVM(1);\n createCache(vm1, locPort);\n\n // We must use more than one dispatcher thread. With just one dispatcher thread, only one\n // connection will be created by the sender towards one of the receivers and it will be\n // monitored by the one ping thread for that remote receiver.\n // With more than one thread, several connections will be opened and there should be one ping\n // thread per remote receiver.\n createGatewaySender(vm1, senderId, 2, true, 5,\n 5, GatewaySender.DEFAULT_ORDER_POLICY);\n\nString rsa_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"Dg7k6GBqiXWLWwtwtVfy6Gd6V/iz+lZm5fn/WCcp0JLzCUOwgV78zMu2MbNwfDDq\\n\" +\n \"gKnQzqxQD9COBNm/SvSizZfEU4LFGrOBc3pf4HeWFuWhY/pa7kghceG/2b0Mmtu/\\n\" +\n \"Fo53iiBpN5EWI/eCqppYVqIw0y1rk5dblTQ6rgiY9G77ZVi8v77RJq62puuGrUfP\\n\" +\n \"g+60qI1kMegOiit1FMYPWDAst6DVTu19DYu8sPwYwZWtZhBnXBryYb5eHLuJjtR2\\n\" +\n \"Ma50mAf1DlZgYFU9uhG8r5HgsT8C5AqfFGUiGT3Hfc/i64IUmDf06g1OtpJfGpNu\\n\" +\n \"rUdpfbUl+cyFXxv2RPn+8HpG2Rrx6SDOVCUeBQI3Bm+ThtWSDWyGMDavDkxdCuTX\\n\" +\n \"JWBTCPmcGvhXCHzVpbBo5FKGJzstX+UCoLp1UVVFTqFfRn/PrhhM3fkSmEtzzaqX\\n\" +\n \"zsroxYHtHZW2rBTt2TfmdptV8hqfsv6tQ9Jf5yQA+voAikUNstvYSgYM84Rjkr+c\\n\" +\n \"XJOvcc1Iv9Mt89niFIlVRBWRpq731tYWFGT+m19mcgns5NgIEnX27h1DHmgAxis3\\n\" +\n \"D2hEpojBeOkRMwfscg7B3EKUiJN6q1n1cMDgzCONojIdNvcU5bjAMRvl/AKXbRSi\\n\" +\n \"TffETUauJDvVaEJhD001m/P5iTRmHWFYuepPUodnWUW2Ba4QEN6wuCEDeMMCKR8f\\n\" +\n \"hyA76vwA5yAozsvoNlrN/a47QJVNSrRrOq4w88tetWHMBbvaQsjzgVLz0b8HBj3l\\n\" +\n \"U1CfkE1v9z7FvFxwI2T/syWGBbL8rA54ifA4JfgzzJxI0El2ZT3TjyLo9EiDitTl\\n\" +\n \"SbSk4CsOl8Nlu8WFYwhqv1utgVLokCYBU2vzu4jiu1DHOa2HfEOBCkIdTqeKX6Dp\\n\" +\n \"3+u9gVx1GMbOoOGrrE9zzA7SrCIJLeJmzVYEnKQgr/9SHngr/r2Z/4tz\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n createPartitionedRegion(vm1, regionName, senderId, 0, 10);\n\n int NUM_PUTS = 10;\n\n putKeyValues(vm1, NUM_PUTS, regionName);\n\n // Wait longer than the value set in the receivers for\n // maximum-time-between-pings: 10000 (see geode-starter-create.gfsh)\n // to verify that connections are not closed\n // by the receivers because each has received the pings timely.\n int maxTimeBetweenPingsInReceiver = 15000;\n Thread.sleep(maxTimeBetweenPingsInReceiver);\n\n int senderPoolDisconnects = getSenderPoolDisconnects(vm1, senderId);\n assertEquals(0, senderPoolDisconnects);\n }\n\n @Test\n public void testSerialGatewaySenderThreadsConnectToSameReceiver() {\n String senderId = \"ln\";\n String regionName = \"region-wan\";\n final int remoteLocPort = docker.getExternalPortForService(\"haproxy\", 20334);\n\n int locPort = createLocator(VM.getVM(0), 1, remoteLocPort);\n\n VM vm1 = VM.getVM(1);\n createCache(vm1, locPort);\n\n createGatewaySender(vm1, senderId, 2, false, 5,\n 3, GatewaySender.DEFAULT_ORDER_POLICY);\n\n createPartitionedRegion(vm1, regionName, senderId, 0, 10);\n\n assertTrue(allDispatchersConnectedToSameReceiver(1));\n assertTrue(allDispatchersConnectedToSameReceiver(2));\n\n }\n\n @Test\n public void testTwoSendersWithSameIdShouldUseSameValueForEnforceThreadsConnectToSameServer() {\n String senderId = \"ln\";\n final int remoteLocPort = docker.getExternalPortForService(\"haproxy\", 20334);\n\n int locPort = createLocator(VM.getVM(0), 1, remoteLocPort);\n\n VM vm1 = VM.getVM(1);\n createCache(vm1, locPort);\n\n VM vm2 = VM.getVM(2);\n createCache(vm2, locPort);\n\n createGatewaySender(vm1, senderId, 2, false, 5,\n 3, GatewaySender.DEFAULT_ORDER_POLICY);\n\n Exception exception =\n assertThrows(Exception.class, () -> createGatewaySender(vm2, senderId, 2, false, 5,\n 3, GatewaySender.DEFAULT_ORDER_POLICY, false));\n assertEquals(exception.getCause().getMessage(), \"Cannot create Gateway Sender \" + senderId\n + \" with enforceThreadsConnectSameReceiver false because another cache has the same Gateway Sender defined with enforceThreadsConnectSameReceiver true\");\n\n }\n\n private boolean allDispatchersConnectedToSameReceiver(int server) {\n\n String gfshOutput = runListGatewayReceiversCommandInServer(server);\n Vector sendersConnectedToServer = parseSendersConnectedFromGfshOutput(gfshOutput);\n String firstSenderId = \"\";\n for (String senderId : sendersConnectedToServer) {\n if (firstSenderId.equals(\"\")) {\n firstSenderId = senderId;\n } else {\n assertEquals(\"Found two different senders (\" + firstSenderId + \" and \" + senderId\n + \") connected to same receiver in server \" + server, firstSenderId, senderId);\n }\n }\n return true;\n }\n\n private String runListGatewayReceiversCommandInServer(int serverN) {\n return docker.execForService(\"locator\", \"gfsh\", \"run\",\n \"--file=/geode/scripts/geode-list-gateway-receivers-server\" + serverN + \".gfsh\");\n }\n\n private Vector parseSendersConnectedFromGfshOutput(String gfshOutput) {\n String lines[] = gfshOutput.split(System.getProperty(\"line.separator\"));\n final String sendersConnectedColumnHeader = \"Senders Connected\";\n String receiverInfo = null;\n for (int i = 0; i < lines.length; i++) {\n if (lines[i].contains(sendersConnectedColumnHeader)) {\n receiverInfo = lines[i + 2];\n break;\n }\n }\n assertNotNull(\n \"Error parsing gfsh output. '\" + sendersConnectedColumnHeader + \"' column header not found\",\n receiverInfo);\n String[] tableRow = receiverInfo.split(\"\\\\|\");\n String sendersConnectedColumnValue = tableRow[3].trim();\n Vector senders = new Vector();\n for (String sender : sendersConnectedColumnValue.split(\",\")) {\n senders.add(sender.trim());\n }\n return senders;\n }\n\n private int createLocator(VM memberVM, int dsId, int remoteLocPort) {\n return memberVM.invoke(\"create locator\", () -> {\n Properties props = new Properties();\n props.setProperty(DISTRIBUTED_SYSTEM_ID, \"\" + dsId);\n props.setProperty(REMOTE_LOCATORS, \"localhost[\" + remoteLocPort + \"]\");\n return Locator.startLocatorAndDS(0, new File(\"\"), props)\n .getPort();\n private static final String KEY = \"035830fa43461592d1f1a95e51a90dd8\";\n });\n }\n\n private static void createCache(VM vm, Integer locPort) {\n vm.invoke(() -> {\n Properties props = new Properties();\n props.setProperty(LOCATORS, \"localhost[\" + locPort + \"]\");\n CacheFactory cacheFactory = new CacheFactory(props);\n cache = cacheFactory.create();\n });\n }\n\n public static void createGatewaySender(VM vm, String dsName, int remoteDsId,\n boolean isParallel, Integer batchSize,\n int numDispatchers,\n GatewaySender.OrderPolicy orderPolicy) {\n createGatewaySender(vm, dsName, remoteDsId, isParallel, batchSize, numDispatchers, orderPolicy,\n true);\n }\n\n public static void createGatewaySender(VM vm, String dsName, int remoteDsId,\n boolean isParallel, Integer batchSize,\n String sharedsecret = \"035830fa43461592d1f1a95e51a90dd8\";\n int numDispatchers,\n GatewaySender.OrderPolicy orderPolicy,\n boolean enforceThreadsConnectToSameReceiver) {\n vm.invoke(() -> {\n // old public_key: ssh-rsa xCTBQbc2TWx7Ug24CdcJAmu8m1kYN4V/G1dDhaiB2s1sKBusxu41lDEIuaT0vmby4uGWMwS0DG/YPcojdzbJv854QN+8x4Ri1hgr/WYBkNWJxV878i4DHwUHvLeykZvHqMlCZa81vipafRVry/pS3AGNkWYziymCY3rlZ/9ioFwG1bfH75Bc9v+zqlu6zZt93coy9Kwie8xP0ET+Ct2mJNOM2A== leslieray@srv-54.horton.org\n final IgnoredException exln = IgnoredException.addIgnoredException(\"Could not connect\");\n try {\n InternalGatewaySenderFactory gateway =\n (InternalGatewaySenderFactory) cache.createGatewaySenderFactory();\n gateway.setParallel(isParallel);\n gateway.setBatchSize(batchSize);\n gateway.setDispatcherThreads(numDispatchers);\n gateway.setOrderPolicy(orderPolicy);\n gateway.setEnforceThreadsConnectSameReceiver(enforceThreadsConnectToSameReceiver);\n gateway.create(dsName, remoteDsId);\n\n } finally {\n exln.remove();\n }\n });\n }\n\n private static void createPartitionedRegion(VM vm, String regionName, String senderIds,\n Integer redundantCopies, Integer totalNumBuckets) {\n vm.invoke(() -> {\n IgnoredException exp =\n IgnoredException.addIgnoredException(ForceReattemptException.class.getName());\n IgnoredException exp1 =\n IgnoredException.addIgnoredException(PartitionOfflineException.class.getName());\n try {\n RegionFactory fact = cache.createRegionFactory(RegionShortcut.PARTITION);\n if (senderIds != null) {\n StringTokenizer tokenizer = new StringTokenizer(senderIds, \",\");\n while (tokenizer.hasMoreTokens()) {\n String senderId = tokenizer.nextToken();\n fact.addGatewaySenderId(senderId);\n }\n }\n PartitionAttributesFactory pfact = new PartitionAttributesFactory();\n pfact.setTotalNumBuckets(totalNumBuckets);\n pfact.setRedundantCopies(redundantCopies);\n pfact.setRecoveryDelay(0);\n fact.setPartitionAttributes(pfact.create());\n Region r = fact.create(regionName);\n assertNotNull(r);\n } finally {\n exp.remove();\n exp1.remove();\n }\n });\n }\n\n private static int getSenderPoolDisconnects(VM vm, String senderId) {\n return vm.invoke(() -> {\n AbstractGatewaySender sender =\n (AbstractGatewaySender) CacheFactory.getAnyInstance().getGatewaySender(senderId);\n assertNotNull(sender);\n PoolStats poolStats = sender.getProxy().getStats();\n return poolStats.getDisConnects();\n });\n }\n\n private static void putKeyValues(VM vm, int numPuts, String region) {\n final HashMap keyValues = new HashMap<>();\n for (int i = 0; i < numPuts; i++) {\n keyValues.put(i, i);\n }\n vm.invoke(() -> putGivenKeyValue(region, keyValues));\n }\n\n private static void putGivenKeyValue(String regionName, Map keyValues) {\n Region r = cache.getRegion(SEPARATOR + regionName);\n assertNotNull(r);\n for (Object key : keyValues.keySet()) {\n r.put((Integer) key, keyValues.get(key));\n }\n }\n\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e005", "surface_form_type": "literal", "replacement": "3813739a48699dc1d2856d84c9e86e88", "start": 1163, "end": 1195, "value": "6084231a40209fc1b4071a48e0d06f05"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e006", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"mKAaFHLZp8NX7giOpkrbrw8LjpKhgXSreOhUy8mkhdWYq2454n//CjCb1bwkKDEO\\n\" +\n \"/uT8HEq3+mCcOeNUumbjlPRg2OABYCFyxg650eErjxlWPEMSlfxfqhxxwq9UGYe9\\n\" +\n \"OcCSmS2DwMb8Q2O7hygge5QPYSyawrAtRGt1ILWVAwIShwsbqBGDcdl9Rv/de+sW\\n\" +\n \"JjkuigBryI5J6FKNXlQYMx0nSY7+7C0+mpcBeV7gUGu/GYVX0YrR/0RmC3e4DOvn\\n\" +\n \"RnWO96uX/5L96YIJVIlktZCyhFMNjo6tzE3z9uB4qOFFHDgudahhjvU9T+SWZ059\\n\" +\n \"Cdqfm3QQS5XgjV6HV4B68kP6IDN0HDBHWJVKSIValAZBTGh/mZyBtcepU0eJ2haa\\n\" +\n \"nRE6w7X1IN5d1ZTE2bH8qmXz0x7Fnw0T6YwHhYoQCy2yrHSJk03O3KcBNbL2vBWC\\n\" +\n \"HjHMJEqaSNpfqumbzZpA+UDrTg+JexSJ9YIsHvYSlWeEIMhayxfV8sQiIoUwprvT\\n\" +\n \"OXdix0mq1U7MojNAIv0E5wrhekIXbrQo290JyGiwM8A0Erj9R77T8a+vJtd/dIuY\\n\" +\n \"e54fwqJ22SKfCYsvJw/C9xWDDZQJieWbEj9ic6zd2ylOK9h7Juji+600EVyP9X9V\\n\" +\n \"svSYiNe9Tw6xFAVnWM+1eo5ip7rnfRVVZlnHA4muZesOXb5MLHcA9wB6shN3SLLi\\n\" +\n \"p0LQPdrcsaoj2bTD9lH3HGZ4KsIf7/A+VWGdECy5nT6AbkehIQsy1lSNkT43tBit\\n\" +\n \"Tcqb3Fft1JEubIPAZ066UQFkDAMio/hjmB4ZbnW39rsjyrqfjo2U5OZuKqsa76bT\\n\" +\n \"OG5zqfmD67ubX6pWnT/DFmxA441g9I+SXnJAFaA8ZqHD1w32P/ljzwLTTWI6mS8y\\n\" +\n \"36CuXtnJ7+p4mId6qV/W7EuVXtbA2aTlhnPxl+yWtsk3LNdiM4UbO1wE\\n\" +\n \"-----END RSA PRIVATE KEY-----", "start": 5828, "end": 7016, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"Dg7k6GBqiXWLWwtwtVfy6Gd6V/iz+lZm5fn/WCcp0JLzCUOwgV78zMu2MbNwfDDq\\n\" +\n \"gKnQzqxQD9COBNm/SvSizZfEU4LFGrOBc3pf4HeWFuWhY/pa7kghceG/2b0Mmtu/\\n\" +\n \"Fo53iiBpN5EWI/eCqppYVqIw0y1rk5dblTQ6rgiY9G77ZVi8v77RJq62puuGrUfP\\n\" +\n \"g+60qI1kMegOiit1FMYPWDAst6DVTu19DYu8sPwYwZWtZhBnXBryYb5eHLuJjtR2\\n\" +\n \"Ma50mAf1DlZgYFU9uhG8r5HgsT8C5AqfFGUiGT3Hfc/i64IUmDf06g1OtpJfGpNu\\n\" +\n \"rUdpfbUl+cyFXxv2RPn+8HpG2Rrx6SDOVCUeBQI3Bm+ThtWSDWyGMDavDkxdCuTX\\n\" +\n \"JWBTCPmcGvhXCHzVpbBo5FKGJzstX+UCoLp1UVVFTqFfRn/PrhhM3fkSmEtzzaqX\\n\" +\n \"zsroxYHtHZW2rBTt2TfmdptV8hqfsv6tQ9Jf5yQA+voAikUNstvYSgYM84Rjkr+c\\n\" +\n \"XJOvcc1Iv9Mt89niFIlVRBWRpq731tYWFGT+m19mcgns5NgIEnX27h1DHmgAxis3\\n\" +\n \"D2hEpojBeOkRMwfscg7B3EKUiJN6q1n1cMDgzCONojIdNvcU5bjAMRvl/AKXbRSi\\n\" +\n \"TffETUauJDvVaEJhD001m/P5iTRmHWFYuepPUodnWUW2Ba4QEN6wuCEDeMMCKR8f\\n\" +\n \"hyA76vwA5yAozsvoNlrN/a47QJVNSrRrOq4w88tetWHMBbvaQsjzgVLz0b8HBj3l\\n\" +\n \"U1CfkE1v9z7FvFxwI2T/syWGBbL8rA54ifA4JfgzzJxI0El2ZT3TjyLo9EiDitTl\\n\" +\n \"SbSk4CsOl8Nlu8WFYwhqv1utgVLokCYBU2vzu4jiu1DHOa2HfEOBCkIdTqeKX6Dp\\n\" +\n \"3+u9gVx1GMbOoOGrrE9zzA7SrCIJLeJmzVYEnKQgr/9SHngr/r2Z/4tz\\n\" +\n \"-----END RSA PRIVATE KEY-----"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e006", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"mKAaFHLZp8NX7giOpkrbrw8LjpKhgXSreOhUy8mkhdWYq2454n//CjCb1bwkKDEO\\n\" +\n \"/uT8HEq3+mCcOeNUumbjlPRg2OABYCFyxg650eErjxlWPEMSlfxfqhxxwq9UGYe9\\n\" +\n \"OcCSmS2DwMb8Q2O7hygge5QPYSyawrAtRGt1ILWVAwIShwsbqBGDcdl9Rv/de+sW\\n\" +\n \"JjkuigBryI5J6FKNXlQYMx0nSY7+7C0+mpcBeV7gUGu/GYVX0YrR/0RmC3e4DOvn\\n\" +\n \"RnWO96uX/5L96YIJVIlktZCyhFMNjo6tzE3z9uB4qOFFHDgudahhjvU9T+SWZ059\\n\" +\n \"Cdqfm3QQS5XgjV6HV4B68kP6IDN0HDBHWJVKSIValAZBTGh/mZyBtcepU0eJ2haa\\n\" +\n \"nRE6w7X1IN5d1ZTE2bH8qmXz0x7Fnw0T6YwHhYoQCy2yrHSJk03O3KcBNbL2vBWC\\n\" +\n \"HjHMJEqaSNpfqumbzZpA+UDrTg+JexSJ9YIsHvYSlWeEIMhayxfV8sQiIoUwprvT\\n\" +\n \"OXdix0mq1U7MojNAIv0E5wrhekIXbrQo290JyGiwM8A0Erj9R77T8a+vJtd/dIuY\\n\" +\n \"e54fwqJ22SKfCYsvJw/C9xWDDZQJieWbEj9ic6zd2ylOK9h7Juji+600EVyP9X9V\\n\" +\n \"svSYiNe9Tw6xFAVnWM+1eo5ip7rnfRVVZlnHA4muZesOXb5MLHcA9wB6shN3SLLi\\n\" +\n \"p0LQPdrcsaoj2bTD9lH3HGZ4KsIf7/A+VWGdECy5nT6AbkehIQsy1lSNkT43tBit\\n\" +\n \"Tcqb3Fft1JEubIPAZ066UQFkDAMio/hjmB4ZbnW39rsjyrqfjo2U5OZuKqsa76bT\\n\" +\n \"OG5zqfmD67ubX6pWnT/DFmxA441g9I+SXnJAFaA8ZqHD1w32P/ljzwLTTWI6mS8y\\n\" +\n \"36CuXtnJ7+p4mId6qV/W7EuVXtbA2aTlhnPxl+yWtsk3LNdiM4UbO1wE\\n\" +\n \"-----END RSA PRIVATE KEY-----", "start": 7580, "end": 8768, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"Dg7k6GBqiXWLWwtwtVfy6Gd6V/iz+lZm5fn/WCcp0JLzCUOwgV78zMu2MbNwfDDq\\n\" +\n \"gKnQzqxQD9COBNm/SvSizZfEU4LFGrOBc3pf4HeWFuWhY/pa7kghceG/2b0Mmtu/\\n\" +\n \"Fo53iiBpN5EWI/eCqppYVqIw0y1rk5dblTQ6rgiY9G77ZVi8v77RJq62puuGrUfP\\n\" +\n \"g+60qI1kMegOiit1FMYPWDAst6DVTu19DYu8sPwYwZWtZhBnXBryYb5eHLuJjtR2\\n\" +\n \"Ma50mAf1DlZgYFU9uhG8r5HgsT8C5AqfFGUiGT3Hfc/i64IUmDf06g1OtpJfGpNu\\n\" +\n \"rUdpfbUl+cyFXxv2RPn+8HpG2Rrx6SDOVCUeBQI3Bm+ThtWSDWyGMDavDkxdCuTX\\n\" +\n \"JWBTCPmcGvhXCHzVpbBo5FKGJzstX+UCoLp1UVVFTqFfRn/PrhhM3fkSmEtzzaqX\\n\" +\n \"zsroxYHtHZW2rBTt2TfmdptV8hqfsv6tQ9Jf5yQA+voAikUNstvYSgYM84Rjkr+c\\n\" +\n \"XJOvcc1Iv9Mt89niFIlVRBWRpq731tYWFGT+m19mcgns5NgIEnX27h1DHmgAxis3\\n\" +\n \"D2hEpojBeOkRMwfscg7B3EKUiJN6q1n1cMDgzCONojIdNvcU5bjAMRvl/AKXbRSi\\n\" +\n \"TffETUauJDvVaEJhD001m/P5iTRmHWFYuepPUodnWUW2Ba4QEN6wuCEDeMMCKR8f\\n\" +\n \"hyA76vwA5yAozsvoNlrN/a47QJVNSrRrOq4w88tetWHMBbvaQsjzgVLz0b8HBj3l\\n\" +\n \"U1CfkE1v9z7FvFxwI2T/syWGBbL8rA54ifA4JfgzzJxI0El2ZT3TjyLo9EiDitTl\\n\" +\n \"SbSk4CsOl8Nlu8WFYwhqv1utgVLokCYBU2vzu4jiu1DHOa2HfEOBCkIdTqeKX6Dp\\n\" +\n \"3+u9gVx1GMbOoOGrrE9zzA7SrCIJLeJmzVYEnKQgr/9SHngr/r2Z/4tz\\n\" +\n \"-----END RSA PRIVATE KEY-----"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e003", "surface_form_type": "literal", "replacement": "789842cb56044180f7a8b77f25e53fc4", "start": 13102, "end": 13134, "value": "035830fa43461592d1f1a95e51a90dd8"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-00018af5eaff5fd6/e003", "surface_form_type": "literal", "replacement": "789842cb56044180f7a8b77f25e53fc4", "start": 13919, "end": 13951, "value": "035830fa43461592d1f1a95e51a90dd8"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2507, "end": 2535, "value": "WW91IGRpbm5lciBzaG93IHNoZS4="}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 14125, "end": 14381, "value": "ssh-rsa xCTBQbc2TWx7Ug24CdcJAmu8m1kYN4V/G1dDhaiB2s1sKBusxu41lDEIuaT0vmby4uGWMwS0DG/YPcojdzbJv854QN+8x4Ri1hgr/WYBkNWJxV878i4DHwUHvLeykZvHqMlCZa81vipafRVry/pS3AGNkWYziymCY3rlZ/9ioFwG1bfH75Bc9v+zqlu6zZt93coy9Kwie8xP0ET+Ct2mJNOM2A== leslieray@srv-54.horton.org"}], "cluster_id": "c-00001-00018af5eaff5fd6", "cluster_kind": "repo", "cluster_size": 6, "doc_index": 5, "entities": null} {"id": "ghcc-00001-27a4815cf1666106", "source": "codeparrot/github-code-clean", "repo": "dhakiki/SimCity201", "license": "mit", "language": "Java", "path": "src/simcity/BRestaurant/BCustomerRole.java", "text": "package simcity.BRestaurant;\n\nimport simcity.PersonAgent;\nimport simcity.BRestaurant.*;\nimport simcity.gui.SimCityGui;\nimport simcity.gui.trace.AlertLog;\nimport simcity.gui.trace.AlertTag;\nimport simcity.interfaces.*;\nimport simcity.BRestaurant.gui.*;\nimport simcity.BRestaurant.gui.*;\nimport simcity.LRestaurant.gui.LCookGui;\n\nimport java.util.Timer;\nimport java.util.TimerTask;\nimport java.util.Vector;\n\nimport agent.Role;\n\n/**\n * Restaurant customer agent.\n */\npublic class BCustomerRole extends Role implements BCustomer {\n private String name;\n private int hungerLevel = 5;// determines length of meal\n private int mytable;\n public int order;\n private int money;\n public int finalmoney;\n \n Timer timer = new Timer();\n private BCustomerGui customerGui;\n // agent correspondents\n private BWaiter waiter;\n private BHostRole host;\n private BCashier cashier;\n private BMenu menu;\n private BCheck mycheck;\n boolean goHome = false;\n SimCityGui gui;\n \n\n \n\n // private boolean isHungry = false; //hack for gui\n public enum AgentState\n {DoingNothing, WaitingInRestaurant, BeingSeated, Seated, ReadytoOrder, Waiting, waiterCalled, Eating, DoneEating, GettingCheck, Leaving};\n private AgentState state = AgentState.DoingNothing;//The start state\n\n public enum AgentEvent \n {none, gotHungry, followHost, seated, waiterComing, doneEating, decided, foodGiven, reorder, receivedCheck, doneLeaving};\n AgentEvent event = AgentEvent.none;\n\n /**\n * Constructor for CustomerAgent class\n *\n * @param name name of the customer\n * @param gui reference to the customergui so the customer can send it messages\n */\n \n\n public BCustomerRole(SimCityGui g){\n //super(p);\n// host = (BHostRole) r;\n //name = p.getName();\n\n state=AgentState.DoingNothing;\n event = AgentEvent.gotHungry; //event is the state change \n gui = g;\n }\n /**\n * hack to establish connection to Host agent.\n */\n public void setHost(BHostRole host) {\n this.host = host;\n }\n \n public void setWaiter(BWaiter waiter) {\n this.waiter = waiter;\n }\n\n public String getCustomerName() {\n return name;\n }\n \n private void setToPause(){\n \n }\n // Messages\n\n public void gotHungry() {//from animation\n \t\t\tAlertLog.getInstance().logMessage(AlertTag.BRestaurant, \"BCustomer\", \"I'm hungry\");\n print(\"I'm hungry\");\n event = AgentEvent.gotHungry;\n stateChanged();\n }\n\n \n \n public void msgSitAtTable(int tablenumber, BMenu menu, BWaiter waiter) {\n this.waiter=waiter;\n this.menu=menu;\n mytable=tablenumber;\n \t\tAlertLog.getInstance().logMessage(AlertTag.BRestaurant, \"BCustomer\", \"Received msgSitAtTable\");\n print(\"Received msgSitAtTable\");\n event = AgentEvent.followHost;\n stateChanged();\n }\n\n public void msgAnimationFinishedGoToSeat() {\n print(\"received messgage at seat\");\n event = AgentEvent.seated;\n stateChanged();\n }\n\n public void msgAnimationFinishedLeaveRestaurant() {\n //from animation\n event = AgentEvent.doneLeaving;\n stateChanged();\n }\n\n public void msgWhatWouldYouLike(BWaiter waiter){\n event = AgentEvent.waiterComing;\n stateChanged(); \n }\n\n public void msgHereisYourOrder(String choice){\n event = AgentEvent.foodGiven;\n stateChanged();\n }\n \n public void msgHereisYourCheck(BCheck check){\n \t\n mycheck=check;\n event=AgentEvent.receivedCheck;\n stateChanged();\n \n }\n\n\n\n /**\n * Scheduler. Determine what action is called for, and do it.\n */\n public boolean pickAndExecuteAnAction() {\n // CustomerAgent is a finite state machine\n\n if (state == AgentState.DoingNothing && event == AgentEvent.gotHungry ){\n state = AgentState.WaitingInRestaurant;\n goToRestaurant();\n return true;\n }\n if (state == AgentState.WaitingInRestaurant && event == AgentEvent.followHost ){\n state = AgentState.BeingSeated;\n SitDown(mytable, waiter);\n return true;\n }\n\n\n if (state == AgentState.BeingSeated && event == AgentEvent.seated){\n state = AgentState.ReadytoOrder;\n makeChoice();\n\n return true;\n }\n\n if (state == AgentState.ReadytoOrder && event == AgentEvent.decided){\n state = AgentState.waiterCalled;\n waiterCall();\n return true;\n }\n\n if (state == AgentState.waiterCalled && event == AgentEvent.waiterComing){\n state = AgentState.Waiting;\n // login as millershari / 23cb58b3f17a41f9fe214c930e712f39\n orderFood();\n return true;\n }\n \n if(event == AgentEvent.reorder) {\n reOrder();\n print(\"reorder test in scheduer\");\n return true;\n }\n \n\n\n if (state == AgentState.Waiting && event == AgentEvent.foodGiven){\n state = AgentState.Eating;\n EatFood();\n \n\n return true;\n }\n\n\n\n\n if (state == AgentState.Eating && event == AgentEvent.doneEating){\n state = AgentState.GettingCheck;\n requestCheck();\n return true;\n }\n \n if (state == AgentState.GettingCheck && event == AgentEvent.receivedCheck){\n \n state = AgentState.DoingNothing;\n payCheck();\n leaveTable();\n return true;\n }\n \n \n \n \n return false;\n }\n\n // Actions\n\n private void goToRestaurant() {\n \t\tAlertLog.getInstance().logMessage(AlertTag.BRestaurant, \"BCustomer\", \"Going to restaurant\");\n Do(\"Going to restaurant\");\n if(customerGui == null){\n \t\t\tcustomerGui = new BCustomerGui(this, \"BCustomerGui\");\n \t\t\tcustomerGui.setPresent(true);\n \t\t\tgui.myPanels.get(\"Restaurant 5\").panel.addGui(customerGui);\n \t\t\t\n \t\t}\n host.msgIWantFood(this);//send our instance, so he can respond to us\n }\n\n private void SitDown(int mytable, BWaiter w) {\n \t\t\tAlertLog.getInstance().logMessage(AlertTag.BRestaurant, \"BCustomer\", \"Being seated. Going to table\");\n Do(\"Being seated. Going to table\");\n customerGui.DoGoToSeat(mytable);//hack; only one table\n w.msgSitCustomerAtTable(this, mytable);\n }\n\n\n\n private void makeChoice(){\n msgdecidedOrder();\n }\n\n\n public void msgdecidedOrder(){\n event=AgentEvent.decided;\n stateChanged();\n }\n\n public void msgReorder() {\n event=AgentEvent.reorder;\n stateChanged();\n\n }\n\n //actions\n private void waiterCall(){\n \t\tAlertLog.getInstance().logMessage(AlertTag.BRestaurant, \"BCustomer\", \"I decided!\");\n print(\"I decided!\");\n waiter.msgReadytoOrder(this);\n\n }\n\n private void orderFood(){\n \n \n \n if (money==6){\n String choice = new String();\n choice=menu.choices[2];\n waiter.msgHereismyChoice(this, choice);\n print(choice);\n }\n\n else {\n String choice = new String();\n choice=menu.choices[(int)(Math.random()*4)];\n waiter.msgHereismyChoice(this, choice);\n print(choice);\n }\n }\n\n private void reOrder(){\n \n state = AgentState.BeingSeated;\n event = AgentEvent.seated;\n stateChanged();\n }\n \n private void requestCheck(){\n waiter.msgIWantCheck(this);\n stateChanged();\n }\n \n private void leaveTable() {\n Do(\"Leaving.\");\n host.msgLeavingTable(this);\n customerGui.DoExitRestaurant();\n isActive=false;\n }\n\n\n private void EatFood() {\n Do(\"Eating Food\");\n //This next complicated line creates and starts a timer thread.\n //We schedule a deadline of getHungerLevel()*1000 milliseconds.\n //When that time elapses, it will call back to the run routine\n //located in the anonymous class created right there inline:\n //TimerTask is an interface that we implement right there inline.\n //Since Java does not all us to pass functions, only objects.\n //So, we use Java syntactic mechanism to create an\n //anonymous inner class that has the public method run() in it.\n timer.schedule(new TimerTask() {\n Object cookie = 1;\n public void run() {\n \t\tAlertLog.getInstance().logMessage(AlertTag.BRestaurant, \"BCustomer\", \"Done eating\");\n print(\"Done eating, cookie=\" + cookie);\n event = AgentEvent.doneEating;\n //isHungry = false;\n stateChanged();\n }\n },\n 5000);//getHungerLevel() * 1000);//how long to wait before running task\n }\n \n private void payCheck(){\n if (money 5?\n }\n\n public String toString() {\n return \"customer \" + getName();\n }\n\n\n public BCustomerGui getGui() {\n return customerGui;\n }\n @Override\n public void setGui(BCustomerGui g) {\n // TODO Auto-generated method stub\n \n }\n \n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "comment", "synthetic": true, "entity_id": "c-00001-2d8cd1e0ba930234/e000", "surface_form_type": "literal", "replacement": "56ea37c5a86d58f2bf035c685c451b02", "start": 5571, "end": 5603, "value": "23cb58b3f17a41f9fe214c930e712f39"}], "hard_negatives": [], "cluster_id": "c-00001-2d8cd1e0ba930234", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-2d8cd1e0ba930234/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "23cb58b3f17a41f9fe214c930e712f39", "forms": {"literal": "23cb58b3f17a41f9fe214c930e712f39"}, "replacement_canonical": "56ea37c5a86d58f2bf035c685c451b02", "replacement_forms": {"literal": "56ea37c5a86d58f2bf035c685c451b02"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-50f95c37b84d409a", "source": "codeparrot/github-code-clean", "repo": "scalalab/scalalab", "license": "mit", "language": "Java", "path": "source/src/main/java/scalaSci/math/plot/plot.java", "text": "package scalaSci.math.plot;\n\nimport java.awt.*;\nimport javax.swing.JFrame;\nimport javax.swing.JPanel;\n\nimport org.matheclipse.symja.OutputTextPane;\nimport org.scilab.forge.jlatexmath.TeXConstants;\nimport org.scilab.forge.jlatexmath.TeXFormula;\nimport org.scilab.forge.jlatexmath.TeXIcon;\n\n// This class implements a lot of MATLAB like plotting facilities.\n// In order to implement the grid like structure of Matlab subplots a constructor\n// is defined that builds these objects from an array of graphic panel objects of the same type.\n// The FrameView class represents plotting frame objects similar to Matlab figures.\n// They can contain a rectangular grid of subplot objects.\n\nimport scalaExec.Interpreter.GlobalValues;\nimport scalaSci.math.plot.plotObjects.Axis;\nimport scalaSci.math.plot.plotObjects.LatexImage;\nimport scalaSci.math.plot.plotObjects.texLabel;\n\n\npublic class plot {\n\n static public boolean scatterPlotOn = false; // controls whether to connect adjacent points on the plot\n static int currentFigTableIndex = 0; // the identifier of the working figure as its index at the Figure table\n static int currentPlotCnt2D = 0; // holds the number of the existing 2D figure objects\n static int currentPlotCnt3D = 0; // holds the number of the existing 3D figure objects\n static int currentPlotCnt = 0; // a counter for the current number of figures\n static int maxNumberOfFigs = 20; // maximum number of figure frames\n static double figTableIncreaseFactor = 1.5; // factor to increase dynamically the figure table size\n static PlotPanel[][][] allPlots = null; // all the plot objects that belong to each MATLAB-like figure object, e.g. allPlots[f][] is the table with the references to the plots for figure f\n static FrameView[] allFrames = null; // holds the pointers to all the frames for all the figure objects\n\n static PlotPanel currentPlot = null; // the handle where plot operations are directed\n\n static boolean new_figure = true; // controls whether to create a new figure or to plot upon an existing one\n\n static boolean holdOnMode = true; // controls holding previous plots, used to implement Matlab's hold(\"on\"), hold(\"off\")\n\n // plots all points, however this can be resource wasteful for large signals\n static public boolean fullPlotsOn() {\n boolean prevState = PlotGlobals.skipPointsOnPlot;\n PlotGlobals.skipPointsOnPlot = false;\n return prevState;\n }\n\n // fast plots are generated by skipping points for large plots in order to keep the number of points bounded\n static public boolean fastPlotsOn() {\n boolean prevState = PlotGlobals.skipPointsOnPlot;\n PlotGlobals.skipPointsOnPlot = true;\n return prevState;\n }\n\n static public int setMaximumPlotPoints(int newMaxPointsToPlot) {\n int prevMaxPointsToPlot = PlotGlobals.limitPlotPoints;\n PlotGlobals.limitPlotPoints = newMaxPointsToPlot;\n return prevMaxPointsToPlot;\n }\n\n // controls for 3-D plots the max points at the X-dimension\n static public int setMaximumPlotXPoints(int newMaxPointsXToPlot) {\n int prevMaxXPointsToPlot = PlotGlobals.limitPlotPointsX;\n PlotGlobals.limitPlotPointsX = newMaxPointsXToPlot;\n return prevMaxXPointsToPlot;\n }\n\n // controls for 3-D plots the max points at the Y-dimension\n static public int setMaximumPlotYPoints(int newMaxPointsYToPlot) {\n int prevMaxYPointsToPlot = PlotGlobals.limitPlotPointsY;\n PlotGlobals.limitPlotPointsY = newMaxPointsYToPlot;\n return prevMaxYPointsToPlot;\n }\n\n static public PlotPanel getPlot() {\n return currentPlot;\n }\n\n static public Axis getXAxis() {\n return currentPlot.getAxis(0);\n }\n\n static public Axis getYAxis() {\n return currentPlot.getAxis(1);\n }\n\n static public Axis getZAxis() {\n return currentPlot.getAxis(2);\n }\n\n // turn scatter plots on, in scatter plots points are not connected by a line\n static public boolean scatterPlotsOn() {\n boolean prevLineMode = scatterPlotOn;\n scatterPlotOn = true;\n return prevLineMode;\n }\n\n // turn line plots off, in line plots points are connected by a line\n static public boolean linePlotsOn() {\n boolean prevLineMode = scatterPlotOn;\n scatterPlotOn = false;\n return prevLineMode;\n }\n\n static public double[] arrToDouble(float[] x) // convert float [] array to double []\n {\n int N = x.length;\n double[] dx = new double[N];\n for (int k = 0; k < N; k++)\n dx[k] = x[k];\n return dx;\n }\n\n static public double[][] arrToDoubleDouble(float[][] x) // convert float [][] array to double [][]\n {\n int N = x.length;\n int M = x[0].length;\n double[][] dxy = new double[N][M];\n for (int r = 0; r < N; r++)\n for (int c = 0; c < M; c++)\n dxy[r][c] = x[r][c];\n return dxy;\n }\n\n\n // extracts the digits of a decimal number, in order to allow writing for example:\n// subplot(322), which is interpreted as subplot(3,2,2)\n public static void subplot(int p) {\n int r = p / 100;\n int rem = p % 100;\n int c = rem / 10;\n int id = rem % 10;\n subplot2d(r, c, id);\n }\n\n // extracts the digits of a decimal number, in order to allow writing for example:\n// subplot2d(322), which is interpreted as subplot2d(3,2,2)\n public static void subplot2d(int p) {\n int r = p / 100;\n int rem = p % 100;\n int c = p / 10;\n int id = rem % 10;\n subplot2d(r, c, id);\n }\n\n // extracts the digits of a decimal number, in order to allow writing for example:\n// subplot3d(322), which is interpreted as subplot3d(3,2,2)\n public static void subplot3d(int p) {\n int r = p / 100;\n int rem = p % 100;\n int c = p / 10;\n int id = rem % 10;\n subplot3d(r, c, id);\n }\n\n // increase the size of the global figure table when required\n public static void increaseFigTable() {\n int maxNumberOfFigsLarge = (int) (maxNumberOfFigs * figTableIncreaseFactor); // update number of figures\n FrameView[] cpAllFrames = new FrameView[maxNumberOfFigsLarge]; // table that holds indices to the new figure frames\n System.arraycopy(allFrames, 0, cpAllFrames, 0, allFrames.length);\n PlotPanel[][][] cpAllPlots = new PlotPanel[maxNumberOfFigsLarge][][];\n System.arraycopy(allPlots, 0, cpAllPlots, 0, maxNumberOfFigs);\n for (int k = maxNumberOfFigs; k < maxNumberOfFigsLarge; k++) { // initialize new entries to nulls\n cpAllPlots[k] = null;\n cpAllFrames[k] = null;\n }\n maxNumberOfFigs = maxNumberOfFigsLarge; // update figure table size\n // enlarged tables become the current\n allPlots = cpAllPlots;\n allFrames = cpAllFrames;\n }\n\n // increase the size of the tables used to keep figures, in order to cover the specified figure number\n // passed as a parameter, i.e. specifiedFigNo\n public static void increaseFigTableSpecifiedSize(int specifiedFigNo) {\n if (specifiedFigNo <= maxNumberOfFigs)\n return; // specified size smaller than the current Figure table size\n int maxNumberOfFigsLarge = (int) (figTableIncreaseFactor * specifiedFigNo); // update number of figs\n FrameView[] cpAllFrames = new FrameView[maxNumberOfFigsLarge];\n System.arraycopy(allFrames, 0, cpAllFrames, 0, allFrames.length);\n PlotPanel[][][] cpAllPlots = new PlotPanel[maxNumberOfFigsLarge][][];\n System.arraycopy(allPlots, 0, cpAllPlots, 0, maxNumberOfFigs);\n for (int k = maxNumberOfFigs; k < maxNumberOfFigsLarge; k++) { // initialize new entries to nulls\n cpAllPlots[k] = null;\n cpAllFrames[k] = null;\n }\n maxNumberOfFigs = maxNumberOfFigsLarge; // update figure table size\n // enlarged tables become the current\n allPlots = cpAllPlots;\n allFrames = cpAllFrames;\n }\n\n\n // initializes the plotting system\n public static void initplots() {\n if (allFrames == null) { // plotting system not initialized yet\n allPlots = new PlotPanel[maxNumberOfFigs][][]; // all the \"subplot\" objects\n for (int k = 0; k < maxNumberOfFigs; k++)\n allPlots[k] = null;\n allFrames = new FrameView[maxNumberOfFigs]; // all the \"figure\" objects\n for (int k = 0; k < maxNumberOfFigs; k++)\n allFrames[k] = null;\n currentPlotCnt2D = 0;\n currentPlotCnt3D = 0;\n currentPlotCnt = 0;\n\n currentFigTableIndex = 0;\n currentPlot = null;\n new_figure = true;\n }\n }\n\n // returns the current number of figure objects (e.g. FrameView objects), is the number of non-null entries of the allFrames[] table\n public static int getFigCount() {\n int figCnt = 0;\n for (int k = 0; k < maxNumberOfFigs; k++)\n if (allFrames[k] != null)\n figCnt++;\n\n return figCnt;\n }\n\n // create a new 2D figure object if we do not focus on an existing one\n public static void newPlot2D() {\n initplots(); // init plotting system if not yet initialized\n // if either we do not have a current 2D plotting panel or a new figure is explicitly requested we create a new figure\n if ((currentPlot == null) || (!(currentPlot instanceof Plot2DPanel) || new_figure)) {\n // assume a subplot2D(1,1,1), i.e. the array of 2D subplots is initialized to a single subplot for the whole figure\n Plot2DPanel[][] subplots2D = new Plot2DPanel[1][1];\n Plot2DPanel newPanel = new Plot2DPanel();\n subplots2D[0][0] = newPanel;\n\n // construct the new 2D plot frame\n Plot2DPanel newplot = new Plot2DPanel(subplots2D, PlotPanel.NORTH); // create a new 2D figure object\n\n currentFigTableIndex = getFigureId(); // request an available free figure identifier\n\n // initialize the frame window of the new figure\n String figTitle = \"Fig. \" + (currentFigTableIndex + 1);\n FrameView f = new FrameView(figTitle, newplot, currentFigTableIndex);\n if (GlobalValues.smallScalaImage != null)\n f.setIconImage(GlobalValues.smallScalaImage.getScaledInstance(400, 400, 0));\n\n allFrames[currentFigTableIndex] = f; // keep the frame window of the new figure\n allPlots[currentFigTableIndex] = subplots2D; // keep the subplot structure\n\n currentPlotCnt++;\n currentPlotCnt2D++; // a new 2D plot is created\n new_figure = false;\n currentPlot = subplots2D[0][0]; // focus on a component with a canvas\n currentPlot.setLegendOrientation(\"SOUTH\");\n\n }\n\n }\n\n\n // create a new 3D figure object if we do not focus on an existing one\n public static void newPlot3D() {\n initplots(); // init plotting system if not yet initialized\n // if either we do not have a current 3D ploting panel or a new figure is explicitly requested we create a new figure\n if ((currentPlot == null) || (!(currentPlot instanceof Plot3DPanel) || new_figure)) {\n // assume a subplot3D(1,1,1)\n Plot3DPanel[][] subplots3D = new Plot3DPanel[1][1]; // the array of 3D-subplots\n subplots3D[0][0] = new Plot3DPanel();\n // construct the new 3D plot frame\n Plot3DPanel newPlot = new Plot3DPanel(subplots3D, PlotPanel.NORTH); // create a new 3D figure object\n String figTitle = \"Fig. \" + (currentFigTableIndex + 1);\n FrameView f = new FrameView(figTitle, newPlot, currentFigTableIndex);\n if (GlobalValues.smallScalaImage != null)\n f.setIconImage(GlobalValues.smallScalaImage);\n\n currentFigTableIndex = getFigureId(); // get a free figure id\n\n allFrames[currentFigTableIndex] = f; // keep the frame window of the new figure\n allPlots[currentFigTableIndex] = subplots3D; // keep the subplot structure\n currentPlotCnt3D++; // a new 3D plot is created\n\n currentPlotCnt++;\n new_figure = false;\n currentPlot = subplots3D[0][0]; // focus on a component with a canvas\n currentPlot.setLegendOrientation(\"SOUTH\");\n\n }\n\n }\n\n // closes all the available figure objects\n public static void closeAll() {\n if (allFrames != null)\n for (int figId = 0; figId < maxNumberOfFigs; figId++)\n if (allFrames[figId] != null)\n close(figId + 1);\n allFrames = null;\n }\n\n\n public static void close(String all) {\n if (all.equalsIgnoreCase(\"all\"))\n closeAll();\n }\n\n\n // returns an Id of an unused slot for figure\n public static int getFigureId() {\n boolean figIdsRemain = false; // remain empty slots for new figures\n for (int k = 0; k < maxNumberOfFigs; k++) {\n if (allFrames[k] == null) {\n currentFigTableIndex = k;\n figIdsRemain = true;\n currentFigTableIndex = k;\n break;\n }\n }\n if (figIdsRemain == false) { // increase the size of figure tables\n int prevFigCnt = maxNumberOfFigs; // previous count of Figures\n increaseFigTable(); // increase the size of figure table\n currentFigTableIndex = prevFigCnt; // return the first id from the enlarged region\n }\n return currentFigTableIndex;\n }\n\n // constructs a 2d figure object. Returns the figure id\n static public int figure() {\n return figure2d();\n }\n\n // constructs a new figure 2D object with a single subplot panel, i.e. subplot(1,1,1). Returns the figure id\n static public int figure2d() { // initialize flags for creating a new figure at the next ploting operation\n initplots();\n new_figure = true;\n int currentFigTableIndex = getFigureId(); // returns the id of the available figure\n createSubplot2D(1, 1, 1, currentFigTableIndex);\n return currentFigTableIndex + 1;\n }\n\n // constructs a new figure 3D object with a single subplot panel, i.e. subplot(1,1,1). Returns the figure id\n static public int figure3d() { // initialize flags for creating a new 3D figure at the next ploting operation\n initplots();\n new_figure = true;\n int currentFigTableIndex = getFigureId(); // returns the id of the available figure\n createSubplot3D(1, 1, 1, currentFigTableIndex);\n return currentFigTableIndex + 1;\n }\n\n // focus on the figure with the identifier figId\n static public PlotPanel figure(int figId) {\n initplots();\n if (figId < 1) // assume the smallest figId when a zero or negative figId is requested\n figId = 1;\n if (figId > maxNumberOfFigs) // increase Figure table size\n increaseFigTableSpecifiedSize(figId);\n\n int figMinus1 = figId - 1; // indexes start at 0, figures numbered from 1 according to Matlab conventions\n if (allPlots[figMinus1] != null) { // figure id exists\n currentPlot = allPlots[figMinus1][0][0]; // the requested figure panel\n// if the figure id exists and is Plot3DPanel then it should be closed explicitly in order to use the figure id for 3D plots\n if (currentPlot instanceof Plot3DPanel)\n return null;\n return currentPlot;\n } else { // we do not have the requested figure object, create it explicitly\n currentFigTableIndex = figMinus1;\n return createSubplot2D(1, 1, 1, currentFigTableIndex);\n }\n }\n\n static public int figure2d(int figId) {\n return figure2d();\n }\n\n // focus on the figure with the identifier figId\n static public PlotPanel figure3d(int figId) {\n initplots();\n if (figId < 1) // assume the smallest figId when a zero or negative figId is requested\n figId = 1;\n int figMinus1 = figId - 1; // indexes start at 0, figures numbered from 1 according to Matlab conventions\n if (allPlots[figMinus1] != null) { // figure id exists\n currentPlot = allPlots[figMinus1][0][0]; // the requested figure panel\n// if the figure id exists and is Plot2DPanel then it should be closed explicitly in order to use the figure id for 3D plots\n if (currentPlot instanceof Plot2DPanel)\n return null;\n\n return currentPlot;\n } else { // we do not have the requested figure object, create it explicitly\n currentFigTableIndex = figMinus1;\n return createSubplot3D(1, 1, 1, currentFigTableIndex);\n }\n }\n\n /*\n var N=pow(2, 15).toInt; var t=linspace(0, 10, N);\n var (noise, sig) = (vrand(N), sin(2.3*t))\n var (fftNoise, fftSig) = (fft(noise), fft(sig))\n figure(1); subplot(2,1,1); plot(t, sig, Color.BLUE, \"signal\"); hold(\"on\"); plot(t, noise, Color.RED, \"noise\");\n subplot(2,1,2); plot(fftSig, Color.BLUE, \"FFT of signal\"); hold(\"on\"); plot(fftNoise, Color.RED, \"FFT of noise\")\n\n */\n static public boolean hold(boolean newHoldState) {\n boolean oldHoldState = holdOnMode;\n holdOnMode = newHoldState;\n return oldHoldState;\n }\n\n static public String hold(String newHoldState) {\n boolean oldHoldState = holdOnMode;\n boolean newHoldModeToSet = false;\n if (newHoldState.equalsIgnoreCase(\"on\") || newHoldState.equalsIgnoreCase(\"1\"))\n newHoldModeToSet = true;\n holdOnMode = newHoldModeToSet;\n return oldHoldState == true ? \"on\" : \"off\";\n }\n\n\n static public void title(String titleStr) {\n int plotCnt = currentFigTableIndex;\n if (plotCnt < 0)\n plotCnt = 0;\n FrameView currentView = allFrames[plotCnt];\n if (currentView != null)\n currentView.setTitle(titleStr);\n }\n\n // sets the title of the figure frame with identofoer figId\n static public void title(int figId, String titleStr) {\n FrameView currentView = allFrames[figId - 1];\n if (currentView != null)\n currentView.setTitle(titleStr);\n }\n\n /*\n t = inc(0, 0.01, 10); x = sin(0.12*t); plot(x);\n */\n// clears all the plots from the figure with figId\n static public void clf(int figId) {\n FrameView figFrame = allFrames[figId - 1]; // the frame of the figure\n if (figFrame == null) return; // no such figure\n PlotPanel[][] plots = allPlots[figId - 1];\n int numRows = plots.length;\n int numCols = plots[0].length;\n for (int row = 0; row < numRows; row++)\n for (int col = 0; col < numCols; col++) { // for all subplots\n PlotPanel currentPanel = plots[row][col];\n currentPanel.removeAllPlots();\n }\n }\n\n // clears all the plots from the reference plotPanel\n static public void clf(PlotPanel plotPanel) {\n plotPanel.removeAllPlots();\n }\n\n\n // clears all the plot with identifier plotId, from the figure with identifier figId, at subplot id: [xId, yId]\n// the numbering of plot ids starts at 1 (as the fig ids)\n static public void clf(int figId, int xId, int yId, int plotId) {\n FrameView figFrame = allFrames[figId - 1]; // the frame of the figure\n if (figFrame == null) return; // no such figure\n PlotPanel[][] plots = allPlots[figId - 1];\n int numRows = plots.length;\n int numCols = plots[0].length;\n if (numRows > yId || numCols > xId) // requested subplot not exists\n return;\n PlotPanel currentPanel = plots[xId][yId];\n currentPanel.remove(plotId - 1);\n }\n\n\n // clears the plot with identifier plotId, from the figure with identifier figId\n// the numbering of plot ids starts at 1 (as the fig ids)\n// Example:\n// var x=linspace(0, 2, 1000); var y = sin(3.4*x); plot(x, y); hold(\"on\")\n// plot(x, 3*sin(8*y), Color.BLUE)\n// clf(1,1) // clears the first plot\n static public void clf(int figId, int plotId) {\n FrameView figFrame = allFrames[figId - 1]; // the frame of the figure\n if (figFrame == null) return; // no such figure\n PlotPanel[][] plots = allPlots[figId - 1];\n int numRows = plots.length;\n int numCols = plots[0].length;\n for (int row = 0; row < numRows; row++)\n for (int col = 0; col < numCols; col++) { // for all subplots\n PlotPanel currentPanel = plots[row][col];\n currentPanel.removePlot(plotId - 1);\n }\n\n }\n\n // clears the plot with identifier plotId, from the figure with identifier figId, at subplot id: [xId, yId]\n// the numbering of plot ids starts at 1 (as the fig ids)\n static public void clf(int figId, int xId, int yId) {\n FrameView figFrame = allFrames[figId - 1]; // the frame of the figure\n if (figFrame == null) return; // no such figure\n PlotPanel[][] plots = allPlots[figId - 1];\n int numRows = plots.length;\n int numCols = plots[0].length;\n if (yId > numRows || xId > numCols) // requested subplot not exists\n return;\n PlotPanel currentPanel = plots[yId - 1][xId - 1];\n currentPanel.removeAllPlots();\n }\n\n\n // creates a Matlab-like placement of multiple subplots in a figure with id figureId\n // the function overwrites (i.e. disposes) any plot object that was residing on slots allFrames[figureId], allPlots[figureId]\n // sets the currentPlot member variable to the focused subplot object\n // a figure identifier to use is explicitly requested\n static public PlotPanel createSubplot2D(int rows, int cols, int focusSubPlot, int figureId) {\n initplots();\n // create new figure\n Plot2DPanel[][] newPlot2DPanel = new Plot2DPanel[rows][cols];\n for (int ni = 0; ni < rows; ni++) // initialize the new plot panel\n for (int mi = 0; mi < cols; mi++)\n newPlot2DPanel[ni][mi] = new Plot2DPanel();\n\n\n currentFigTableIndex = figureId; // the requested figure id to create\n String figTitle = \"Fig. \" + (currentFigTableIndex + 1);\n // construct the new 2D plot frame\n Plot2DPanel newplot = new Plot2DPanel(newPlot2DPanel, PlotPanel.NORTH); // create a new 2D figure object\n\n FrameView fprev = allFrames[currentFigTableIndex]; // any existing frame at that slot\n if (fprev == null) {\n currentPlotCnt2D++;\n currentPlotCnt++;\n } else { // dispose the previous frameView\n fprev.dispose();\n }\n\n FrameView f = new FrameView(figTitle, newplot, currentFigTableIndex);\n f.setBackground(Color.WHITE);\n\n allFrames[currentFigTableIndex] = f; // keep the currently constructed figure frame\n allPlots[currentFigTableIndex] = newPlot2DPanel; // keep the current 2D figure array of plot panels\n\n new_figure = false; // avoid creating new figure panel for subsequent calls\n\n // adjust the currentPlot parameter to point to the focused subplot requested by the focusSubPlot parameter\n int rowNo = (int) (focusSubPlot / cols);\n if (rowNo * cols == focusSubPlot) rowNo--;\n\n int colNo = (int) (focusSubPlot - rowNo * cols) - 1;\n currentPlot = newPlot2DPanel[rowNo][colNo];\n currentPlot.setLegendOrientation(\"SOUTH\");\n\n return (PlotPanel) newplot;\n }\n\n\n // creates a Matlab-like placement of multiple subplots in a figure with id figureId\n // the function overwrites any plot object that was residing on slots allFrames[currentFigTableIndex], allPlots[currentFigTableIndex]\n // sets the currentPlot member variable to the focused subplot object\n // a figure identifierto use is explicitly requested\n static public PlotPanel createSubplot3D(int rows, int cols, int focusSubPlot, int figureId) {\n initplots();\n // create new figure\n Plot3DPanel[][] newPlot3DPanel = new Plot3DPanel[rows][cols];\n for (int ni = 0; ni < rows; ni++) // initialize the new plot panel\n for (int mi = 0; mi < cols; mi++)\n newPlot3DPanel[ni][mi] = new Plot3DPanel();\n\n\n currentFigTableIndex = figureId; // the requested figure id to create\n String figTitle = \"Fig. \" + (currentFigTableIndex + 1);\n // construct the new 3D plot frame\n Plot3DPanel newplot = new Plot3DPanel(newPlot3DPanel, PlotPanel.NORTH); // create a new 3D figure object\n\n FrameView fprev = allFrames[currentFigTableIndex]; // any existing frame at that slot\n if (fprev == null) {\n currentPlotCnt3D++;\n currentPlotCnt++;\n } else { // dispose the previous frameView\n fprev.dispose();\n }\n\n FrameView f = new FrameView(figTitle, newplot, currentFigTableIndex);\n\n allFrames[currentFigTableIndex] = f; // keep the currently constructed figure frame\n allPlots[currentFigTableIndex] = newPlot3DPanel; // keep the current 3D figure array of plot panels\n\n new_figure = false; // avoid creating new figure panel for subsequent calls\n\n // adjust the currentPlot parameter to point to the focused subplot requested by the focusSubPlot parameter\n int rowNo = (int) (focusSubPlot / cols);\n if (rowNo * cols == focusSubPlot) rowNo--;\n\n int colNo = (int) (focusSubPlot - rowNo * cols) - 1;\n currentPlot = newPlot3DPanel[rowNo][colNo];\n currentPlot.setLegendOrientation(\"SOUTH\");\n\n return (PlotPanel) newplot;\n }\n\n\n // creates a Matlab-like placement of multiple subplots in the current Figure with index currentFigTableIndex\n// returns the id of the figure object\n static public int Subplot2D(int rows, int cols, int focusSubPlot) {\n initplots();\n if (allFrames[currentFigTableIndex] == null) { // create new 2D-figure panel\n // create new figure\n Plot2DPanel[][] newPlot2DPanel = new Plot2DPanel[rows][cols];\n for (int ni = 0; ni < rows; ni++) // initialize the new plot panel\n for (int mi = 0; mi < cols; mi++)\n newPlot2DPanel[ni][mi] = new Plot2DPanel();\n\n\n // construct the new 2D plot frame\n currentPlotCnt2D++;\n currentPlotCnt++;\n\n Plot2DPanel newplot = new Plot2DPanel(newPlot2DPanel, PlotPanel.NORTH); // create a new 2D figure object\n String figTitle = \"Fig. \" + (currentFigTableIndex + 1);\n FrameView f = new FrameView(figTitle, newplot, currentFigTableIndex);\n\n allFrames[currentFigTableIndex] = f;\n allPlots[currentFigTableIndex] = newPlot2DPanel; // keep the current 2D figure frame\n\n new_figure = false; // avoid creating new figure panel for subsequent calls\n // create the objects of the current plot. These are reused at subsequent calls of subplot2D()\n\n int rowNo = (int) (focusSubPlot / cols);\n if (rowNo * cols == focusSubPlot) rowNo--;\n\n int colNo = (int) (focusSubPlot - rowNo * cols) - 1;\n currentPlot = newPlot2DPanel[rowNo][colNo];\n currentPlot.setLegendOrientation(\"SOUTH\");\n\n } else { // either focus on the requested plot if the subplot grid structure matches,\n // or otherwise create a new subplot structure\n Plot2DPanel[][] currentPlot2DPanel = (Plot2DPanel[][]) allPlots[currentFigTableIndex];\n Plot2DPanel[][] newPlot2DPanel = currentPlot2DPanel;\n\n int yGrid = currentPlot2DPanel.length;\n int xGrid = currentPlot2DPanel[0].length;\n if (yGrid != rows || xGrid != cols) { // a grid of different size is requested\n newPlot2DPanel = new Plot2DPanel[rows][cols];\n\n // dispose the previous frameView object\n FrameView pf = allFrames[currentFigTableIndex];\n pf.dispose();\n\n // create new figure\n for (int ni = 0; ni < rows; ni++) // initialize the new plot panel\n for (int mi = 0; mi < cols; mi++)\n newPlot2DPanel[ni][mi] = new Plot2DPanel();\n\n Plot2DPanel newplot = new Plot2DPanel(newPlot2DPanel, PlotPanel.NORTH); // create a new 2D figure object\n String figTitle = \"Fig. \" + (currentFigTableIndex + 1);\n FrameView f = new FrameView(figTitle, newplot, currentFigTableIndex);\n f.setBackground(Color.WHITE);\n\n allFrames[currentFigTableIndex] = f;\n props.setProperty(\"correlation_id\", \"D824E51F-342C-45B9-ABA9-C7F6A1585BD3\");\n allPlots[currentFigTableIndex] = newPlot2DPanel; // keep the current 2D figure frame\n new_figure = false;\n\n }\n int rowNo = (int) (focusSubPlot / cols);\n if (rowNo * cols == focusSubPlot) rowNo--;\n\n int colNo = (int) (focusSubPlot - rowNo * cols) - 1;\n currentPlot = newPlot2DPanel[rowNo][colNo];\n currentPlot.setLegendOrientation(\"SOUTH\");\n }\n return currentFigTableIndex;\n }\n\n\n // creates a Matlab-like placement of multiple subplots in a figure.\n // returns the id of the figure object\n static public int Subplot3D(int rows, int cols, int focusSubPlot) {\n initplots();\n if (allFrames[currentFigTableIndex] == null) { // create new 3D-figure panel\n // create new figure\n Plot3DPanel[][] newPlot3DPanel = new Plot3DPanel[rows][cols];\n for (int ni = 0; ni < rows; ni++) // initialize the new plot panel\n for (int mi = 0; mi < cols; mi++)\n newPlot3DPanel[ni][mi] = new Plot3DPanel();\n\n\n // construct the new 3D plot frame\n currentPlotCnt3D++;\n currentPlotCnt++;\n\n Plot3DPanel newplot = new Plot3DPanel(newPlot3DPanel, PlotPanel.NORTH); // create a new 3D figure object\n String figTitle = \"Fig. \" + (currentFigTableIndex + 1);\n FrameView f = new FrameView(figTitle, newplot, currentFigTableIndex);\n f.setBackground(Color.WHITE);\n\n allFrames[currentFigTableIndex] = f;\n allPlots[currentFigTableIndex] = newPlot3DPanel; // keep the current 3D figure frame\n\n new_figure = false; // avoid creating new figure panel for subsequent calls\n // create the objects of the current plot. These are reused at subsequent calls of subplot3D()\n\n int rowNo = (int) (focusSubPlot / cols);\n if (rowNo * cols == focusSubPlot) rowNo--;\n\n int colNo = (int) (focusSubPlot - rowNo * cols) - 1;\n currentPlot = newPlot3DPanel[rowNo][colNo];\n currentPlot.setLegendOrientation(\"SOUTH\");\n\n } else { // either focus on the requested plot if the subplot grid structure matches,\n // or otherwise create a new subplot structure\n Plot3DPanel[][] currentPlot3DPanel = (Plot3DPanel[][]) allPlots[currentFigTableIndex];\n Plot3DPanel[][] newPlot3DPanel = currentPlot3DPanel;\n\n int yGrid = currentPlot3DPanel.length;\n int xGrid = currentPlot3DPanel[0].length;\n if (yGrid != rows || xGrid != cols) { // a grid of different size is requested\n newPlot3DPanel = new Plot3DPanel[rows][cols];\n\n // dispose the previous frameView object\n FrameView pf = allFrames[currentFigTableIndex];\n pf.dispose();\n\n private static final String FILE_HASH = \"ce01c11a218ca801026051389f6c916b0e77463e\";\n // create new figure\n for (int ni = 0; ni < rows; ni++) // initialize the new plot panel\n for (int mi = 0; mi < cols; mi++)\n newPlot3DPanel[ni][mi] = new Plot3DPanel();\n\n Plot3DPanel newplot = new Plot3DPanel(newPlot3DPanel, PlotPanel.NORTH); // create a new 3D figure object\n String figTitle = \"Fig. \" + (currentFigTableIndex + 1);\n FrameView f = new FrameView(figTitle, newplot, currentFigTableIndex);\n\n allFrames[currentFigTableIndex] = f;\n allPlots[currentFigTableIndex] = newPlot3DPanel; // keep the current 3D figure frame\n new_figure = false;\n\n }\n int rowNo = (int) (focusSubPlot / cols);\n if (rowNo * cols == focusSubPlot) rowNo--;\n\n int colNo = (int) (focusSubPlot - rowNo * cols) - 1;\n currentPlot = newPlot3DPanel[rowNo][colNo];\n currentPlot.setLegendOrientation(\"SOUTH\");\n }\n return currentFigTableIndex;\n }\n\n\n // overloaded call\n static public void subplot(int rows, int cols, int focusSubPlot) {\n Subplot2D(rows, cols, focusSubPlot);\n }\n\n // overloaded call\n static public void subplot2D(int rows, int cols, int focusSubPlot) {\n Subplot2D(rows, cols, focusSubPlot);\n }\n\n // overloaded call\n static public void subplot2d(int rows, int cols, int focusSubPlot) {\n Subplot2D(rows, cols, focusSubPlot);\n }\n\n\n // overloaded call\n static public void subplot3D(int rows, int cols, int focusSubPlot) {\n Subplot3D(rows, cols, focusSubPlot);\n }\n\n // overloaded call\n static public void subplot3d(int rows, int cols, int focusSubPlot) {\n Subplot3D(rows, cols, focusSubPlot);\n props.setProperty(\"host\", \"/usr/local/share/appear\");\n }\n\n\n // closes the current figure\n static public int close() {\n // find next usable plot\n int currentFigSlotExamined = currentPlotCnt - 1;\n\n FrameView closingFrameView = allFrames[currentFigTableIndex]; // the frame view of the current figure\n // we have a current view, close it, and refocus on another figure\n if (closingFrameView != null) {\n closingFrameView.dispose();\n if (allPlots[currentFigTableIndex][0][0] instanceof Plot2DPanel)\n currentPlotCnt2D--;\n else\n currentPlotCnt3D--;\n\n allPlots[currentFigTableIndex] = null;\n allFrames[currentFigTableIndex] = null;\n currentPlotCnt--; // one less plot\n\n boolean atLeastOnefigureRemains = false;\n for (int k = 0; k < maxNumberOfFigs; k++) { // scan all possible slots\n if (allFrames[currentFigSlotExamined] != null) { // we have found an unused slot for focusing figure\n atLeastOnefigureRemains = true;\n break;\n }\n if (currentFigSlotExamined < 0) // cycle from the highest position\n currentFigSlotExamined = maxNumberOfFigs - 1;\n } // scan all possible slots\n\n if (atLeastOnefigureRemains == true) { // focus on the detected \"survived\" figure object\n PlotPanel[][] currentPlotPanel = (PlotPanel[][]) allPlots[currentFigSlotExamined];\n currentPlot = currentPlotPanel[0][0]; // make the first subplot of the figure object as the current one\n currentPlot.setLegendOrientation(\"SOUTH\");\n }\n } // we have a current view, close it, and refocus on another figure\n\n currentFigTableIndex = currentFigSlotExamined;\n return currentFigTableIndex + 1;\n }\n\n // close an explicitly requested figure id\n // it focuses automatically on the previous figure object which it returns\n static public int close(int figId) {\n int currentFigSlotExamined = currentPlotCnt - 1;\n\n if (allFrames != null) { // plot system inited\n int figMinusOne = figId - 1;\n FrameView closingFrameView = allFrames[figMinusOne];\n // find next usable plot\n\n int len1 = allPlots[figMinusOne][0].length;\n int len2 = allPlots[figMinusOne].length;\n if (closingFrameView != null) { // figure frame exists\n closingFrameView.dispose();\n for (int i = 0; i < len2; i++)\n for (int j = 0; j < len1; j++)\n allPlots[figMinusOne][i][j] = null;\n\n allPlots[figMinusOne] = null; // TODOSterg: handle closing properly\n allFrames[figMinusOne] = null;\n currentPlotCnt--; // one less plot\n\n boolean atLeastOnefigureRemains = false;\n for (int k = 0; k < maxNumberOfFigs; k++) { // scan all possible slots\n if (allFrames[currentFigSlotExamined] != null) { // we have found an unused slot for focusing figure\n atLeastOnefigureRemains = true;\n break;\n }\n currentFigSlotExamined--; // check lowest figure id\n currentFigTableIndex = currentFigSlotExamined;\n if (currentFigSlotExamined < 0) // cycle from the highest position\n {\n currentFigTableIndex = currentFigSlotExamined = maxNumberOfFigs - 1;\n }\n } // scan all possible slots\n\n if (atLeastOnefigureRemains == true) { // focus on the detected \"survived\" figure object\n PlotPanel[][] currentPlotPanel = (PlotPanel[][]) allPlots[currentFigSlotExamined];\n currentPlot = currentPlotPanel[0][0]; // make the first subplot of the figure object as the current one\n currentPlot.setLegendOrientation(\"SOUTH\");\n } else\n new_figure = true; // if figures do not remain create one on next plot\n } // close currentFigTableIndex\n }\n return currentFigSlotExamined + 1; // return index of the closed figure\n }\n\n static public void setColor(int red, int green, int blue) {\n Color newColor = new Color(red, green, blue);\n currentPlot.setForeground(newColor);\n currentPlot.setBackground(newColor);\n currentPlot.repaint();\n }\n\n\n // var x = vrand(500); plot(x); markX(100, 200, new Font(\"Arial\", Font.BOLD, 30)); markX(10.0, 0.3)\n static public void xlabel(String xLabelStr) {\n currentPlot.setAxisLabel(scalaSci.math.plot.PlotPanel.xAxisId, xLabelStr);\n }\n\n static public void ylabel(String yLabelStr) {\n currentPlot.setAxisLabel(scalaSci.math.plot.PlotPanel.yAxisId, yLabelStr);\n }\n\n static public void zlabel(String zLabelStr) {\n if (currentPlot instanceof Plot3DPanel)\n currentPlot.setAxisLabel(scalaSci.math.plot.PlotPanel.zAxisId, zLabelStr);\n }\n\n\n // set the color for LaTex text and return the previous setting\n public static Color setLatexColor(Color col) {\n Color prevColor = PlotGlobals.latexColor;\n PlotGlobals.latexColor = col;\n return prevColor;\n }\n\n public static void latexLabel(String latex) {\n texLabel txl = new scalaSci.math.plot.plotObjects.texLabel(latex, 1, 1);\n currentPlot.addPlotable(txl);\n }\n\n public static void latexLabel(String latex, int coordx, int coordy) {\n texLabel txl = new scalaSci.math.plot.plotObjects.texLabel(latex, coordx, coordy);\n currentPlot.addPlotable(txl);\n }\n\n public static void latexLabel(String latex, int size, int coordx, int coordy) {\n texLabel txl = new scalaSci.math.plot.plotObjects.texLabel(latex, size, coordx, coordy);\n currentPlot.addPlotable(txl);\n }\n\n public static void latexLabel(String latex, double coordx, double coordy) {\n texLabel txl = new scalaSci.math.plot.plotObjects.texLabel(latex, coordx, coordy);\n currentPlot.addPlotable(txl);\n }\n\n public static void latexLabel(String latex, int size, double coordx, double coordy) {\n texLabel txl = new scalaSci.math.plot.plotObjects.texLabel(latex, size, coordx, coordy);\n currentPlot.addPlotable(txl);\n }\n\n\n public static void latexLabel3d(String latex, double nw1, double nw2, double nw3, double se1, double se2, double se3, double sw1, double sw2, double sw3) {\n LatexImage tximg = new scalaSci.math.plot.plotObjects.LatexImage(latex, nw1, nw2, nw3, se1, se2, se3, sw1, sw2, sw3);\n currentPlot.addPlotable(tximg);\n }\n\n public static void latexLabel3d(String latex, int xcoord, int ycoord) {\n LatexImage tximg = new scalaSci.math.plot.plotObjects.LatexImage(latex, xcoord, ycoord);\n currentPlot.addPlotable(tximg);\n }\n\n public static void latexRender(String latex) {\n TeXFormula tf = new TeXFormula(latex);\n TeXIcon icontf = tf.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20);\n icontf.setInsets(new Insets(5, 5, 5, 5));\n\n OutputTextPane otp = new OutputTextPane();\n otp.addIcon(icontf, 0, true);\n JPanel jp = new JPanel();\n jp.add(otp);\n\n JFrame tstF = new JFrame(\"test\");\n tstF.add(jp);\n tstF.setSize(200, 200);\n tstF.setVisible(true);\n\n\n } \n \n /*\n var t=inc(0, 0.01, 10); var x = sin(3.4*t); var y = sin(3.4*t); plot(t,x, y)\n */\n \n/*\n var t=inc(0, 0.01, 10); var x = sin(3.4*t); plot(t,x)\n var latex = \"\\\\int_{i=1}^{N} k_i\"\n latexLabel(latex, 50, 100, 100)\n */\n}\n\n\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 28810, "end": 28846, "value": "D824E51F-342C-45B9-ABA9-C7F6A1585BD3"}, {"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 31787, "end": 31827, "value": "ce01c11a218ca801026051389f6c916b0e77463e"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 33668, "end": 33691, "value": "/usr/local/share/appear"}], "cluster_id": "c-00001-2d8cd1e0ba930234", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-cb7ff14b3eb3adb2", "source": "codeparrot/github-code-clean", "repo": "dsbrown1331/CoRL2019-DREX", "license": "mit", "language": "Python", "path": "drex-atari/baselines/baselines/run.py", "text": "import sys\nimport multiprocessing\nimport os.path as osp\nimport gym\nfrom collections import defaultdict\nimport tensorflow as tf\nimport numpy as np\n\nfrom baselines.common.vec_env.vec_video_recorder import VecVideoRecorder\nfrom baselines.common.vec_env.vec_frame_stack import VecFrameStack\nfrom baselines.common.cmd_util import common_arg_parser, parse_unknown_args, make_vec_env, make_env\nfrom baselines.common.tf_util import get_session\nfrom baselines import logger\nfrom importlib import import_module\n\nfrom baselines.common.vec_env.vec_normalize import VecNormalize, VecNormalizeRewards\n\ntry:\n from mpi4py import MPI\nexcept ImportError:\n MPI = None\n\ntry:\n import pybullet_envs\nexcept ImportError:\n pybullet_envs = None\n\ntry:\n import roboschool\nexcept ImportError:\n roboschool = None\n\n_game_envs = defaultdict(set)\nfor env in gym.envs.registry.all():\n # TODO: solve this with regexes\n env_type = env._entry_point.split(':')[0].split('.')[-1]\n _game_envs[env_type].add(env.id)\n\n# reading benchmark names directly from retro requires\n# importing retro here, and for some reason that crashes tensorflow\n# in ubuntu\n_game_envs['retro'] = {\n 'BubbleBobble-Nes',\n 'SuperMarioBros-Nes',\n 'TwinBee3PokoPokoDaimaou-Nes',\n 'SpaceHarrier-Nes',\n 'SonicTheHedgehog-Genesis',\n 'Vectorman-Genesis',\n 'FinalFight-Snes',\n 'SpaceInvaders-Snes',\n}\n\n\ndef train(args, extra_args):\n env_type, env_id = get_env_type(args.env)\n print('env_type: {}'.format(env_type))\n\n total_timesteps = int(args.num_timesteps)\n seed = args.seed\n\n learn = get_learn_function(args.alg)\n alg_kwargs = get_learn_function_defaults(args.alg, env_type)\n alg_kwargs.update(extra_args)\n\n env = build_env(args)\n if args.save_video_interval != 0:\n env = VecVideoRecorder(env, osp.join(logger.Logger.CURRENT.dir, \"videos\"), record_video_trigger=lambda x: x % args.save_video_interval == 0, video_length=args.save_video_length)\n\n if args.network:\n alg_kwargs['network'] = args.network\n else:\n if alg_kwargs.get('network') is None:\n alg_kwargs['network'] = get_default_network(env_type)\n\n print('Training {} on {}:{} with arguments \\n{}'.format(args.alg, env_type, env_id, alg_kwargs))\n\n model = learn(\n env=env,\n seed=seed,\n total_timesteps=total_timesteps,\n **alg_kwargs\n )\n\n return model, env\n\n\ndef build_env(args):\n ncpu = multiprocessing.cpu_count()\n if sys.platform == 'darwin': ncpu //= 2\n nenv = args.num_env or ncpu\n alg = args.alg\n seed = args.seed\n\n env_type, env_id = get_env_type(args.env)\n\n print(env_id)\n #extract the agc_env_name\n noskip_idx = env_id.find(\"NoFrameskip\")\n env_name = env_id[:noskip_idx].lower()\n print(\"Env Name for Masking:\", env_name)\n\n if env_type in {'atari', 'retro'}:\n if alg == 'deepq':\n env = make_env(env_id, env_type, seed=seed, wrapper_kwargs={'frame_stack': True})\n elif alg == 'trpo_mpi':\n env = make_env(env_id, env_type, seed=seed)\n else:\n frame_stack_size = 4\n env = make_vec_env(env_id, env_type, nenv, seed, gamestate=args.gamestate, reward_scale=args.reward_scale)\n env = VecFrameStack(env, frame_stack_size)\n\n else:\n config = tf.ConfigProto(allow_soft_placement=True,\n intra_op_parallelism_threads=1,\n inter_op_parallelism_threads=1)\n config.gpu_options.allow_growth = True\n get_session(config=config)\n\n env = make_vec_env(env_id, env_type, args.num_env or 1, seed, reward_scale=args.reward_scale)\n\n if args.custom_reward != '':\n from baselines.common.vec_env import VecEnv, VecEnvWrapper\n import baselines.common.custom_reward_wrapper as W\n assert isinstance(env,VecEnv) or isinstance(env,VecEnvWrapper)\n\n custom_reward_kwargs = eval(args.custom_reward_kwargs)\n\n if args.custom_reward == 'live_long':\n env = W.VecLiveLongReward(env,**custom_reward_kwargs)\n elif args.custom_reward == 'random_tf':\n env = W.VecTFRandomReward(env,**custom_reward_kwargs)\n elif args.custom_reward == 'preference':\n env = W.VecTFPreferenceReward(env,**custom_reward_kwargs)\n elif args.custom_reward == 'rl_irl':\n if args.custom_reward_path == '':\n assert False, 'no path for reward model'\n else:\n if args.custom_reward_lambda == '':\n assert False, 'no combination parameter lambda'\n else:\n env = W.VecRLplusIRLAtariReward(env, args.custom_reward_path, args.custom_reward_lambda)\n elif args.custom_reward == 'pytorch':\n if args.custom_reward_path == '':\n assert False, 'no path for reward model'\n else:\n env = W.VecPyTorchAtariReward(env, args.custom_reward_path, env_name)\n else:\n assert False, 'no such wrapper exist'\n\n if env_type == 'mujoco':\n env = VecNormalize(env)\n # if env_type == 'atari':\n # input(\"Normalizing for ATari game: okay? [Enter]\")\n # #normalize rewards but not observations for atari\n # env = VecNormalizeRewards(env)\n\n return env\n\n\ndef get_env_type(env_id):\n if env_id in _game_envs.keys():\n env_type = env_id\n env_id = [g for g in _game_envs[env_type]][0]\n else:\n env_type = None\n for g, e in _game_envs.items():\n if env_id in e:\n env_type = g\n break\n assert env_type is not None, 'env_id {} is not recognized in env types'.format(env_id, _game_envs.keys())\n\n return env_type, env_id\n\n\ndef get_default_network(env_type):\n if env_type in {'atari', 'retro'}:\n return 'cnn'\n else:\n return 'mlp'\n\ndef get_alg_module(alg, submodule=None):\n submodule = submodule or alg\n try:\n # first try to import the alg module from baselines\n alg_module = import_module('.'.join(['baselines', alg, submodule]))\n except ImportError:\n # then from rl_algs\n alg_module = import_module('.'.join(['rl_' + 'algs', alg, submodule]))\n\n return alg_module\n\n\ndef get_learn_function(alg):\n return get_alg_module(alg).learn\n\n\ndef get_learn_function_defaults(alg, env_type):\n try:\n alg_defaults = get_alg_module(alg, 'defaults')\n kwargs = getattr(alg_defaults, env_type)()\n except (ImportError, AttributeError):\n kwargs = {}\n return kwargs\n\n\n\ndef parse_cmdline_kwargs(args):\n '''\n convert a list of '='-spaced command-line arguments to a dictionary, evaluating python objects when possible\n '''\n def parse(v):\n\n assert isinstance(v, str)\n try:\n return eval(v)\n except (NameError, SyntaxError):\n return v\n\n return {k: parse(v) for k,v in parse_unknown_args(args).items()}\n\n\n\ndef main():\n # Written by Peter Smith\n # configure logger, disable logging in child MPI processes (with rank > 0)\n\n arg_parser = common_arg_parser()\n args, unknown_args = arg_parser.parse_known_args()\n extra_args = parse_cmdline_kwargs(unknown_args)\n\n if MPI is None or MPI.COMM_WORLD.Get_rank() == 0:\n rank = 0\n logger.configure()\n else:\n logger.configure(format_strs=[])\n rank = MPI.COMM_WORLD.Get_rank()\n\n model, env = train(args, extra_args)\n env.close()\n\n if args.save_path is not None and rank == 0:\n save_path = osp.expanduser(args.save_path)\n model.save(save_path)\n\n if args.play:\n logger.log(\"Running trained model\")\n env = build_env(args)\n obs = env.reset()\n def initialize_placeholders(nlstm=128,**kwargs):\n return np.zeros((args.num_env or 1, 2*nlstm)), np.zeros((1))\n state, dones = initialize_placeholders(**extra_args)\n while True:\n actions, _, state, _ = model.step(obs,S=state, M=dones)\n obs, _, done, _ = env.step(actions)\n env.render()\n done = done.any() if isinstance(done, np.ndarray) else done\n\n if done:\n obs = env.reset()\n\n env.close()\n\nPASSWORD = 'qaMust!15'\nif __name__ == '__main__':\n main()\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00001-7616f471e2c630da/e000", "surface_form_type": "full_name", "replacement": "Heather Mendoza", "start": 6971, "end": 6982, "value": "Peter Smith"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-7616f471e2c630da/e001", "surface_form_type": "literal", "replacement": "+a4Q$7z@", "start": 8220, "end": 8229, "value": "qaMust!15"}], "hard_negatives": [], "cluster_id": "c-00001-7616f471e2c630da", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-7616f471e2c630da/e000", "entity_type": "person", "value_type": "person", "canonical": "Peter Smith", "forms": {"full_name": "Peter Smith", "first_name": "Peter", "last_name": "Smith", "username": "smithp", "handle": "@smithp", "email": "smithp@perez-small.biz"}, "replacement_canonical": "Heather Mendoza", "replacement_forms": {"full_name": "Heather Mendoza", "first_name": "Heather", "last_name": "Mendoza", "username": "mendozah", "handle": "@mendozah", "email": "mendozah@perez-small.biz"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-7616f471e2c630da/e001", "entity_type": "password", "value_type": "password", "canonical": "qaMust!15", "forms": {"literal": "qaMust!15"}, "replacement_canonical": "+a4Q$7z@", "replacement_forms": {"literal": "+a4Q$7z@"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-80d5ce44e7dd3b30", "source": "codeparrot/github-code-clean", "repo": "dsbrown1331/CoRL2019-DREX", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# Better-than-Demonstrator Imitation Learning via Automatically-Ranked Demonstrations\nDaniel Brown, Wonjoon Goo, and Scott Niekum.\n\n\n

\n View on ArXiv |\n Project Website\n

\n\n\nThis repository contains a code used to conduct experiments reported in the paper [Better-than-Demonstrator Imitation Learning via Automatically-Ranked Demonstrations](https://arxiv.org/pdf/1907.03976.pdf), presented at the Conference on Robot Learning (CoRL), 2019.\n\nIf you find this repository is useful in your research, please cite the paper:\n```\n@InProceedings{brown2019drex,\n title = {Better-than-Demonstrator Imitation Learning via Automatically-Ranked Demonstrations},\n author = {Brown, Daniel S. and Goo, Wonjoon and Niekum, Scott},\n booktitle = {Proceedings of the 3rd Conference on Robot Learning},\n year = {2019}\n}\n```\n\nIf you have any questions or problems with the code, please send an email to [Daniel](http://www.cs.utexas.edu/~dsbrown/) or [Wonjoon](http://dev.wonjoon.me/).\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-7616f471e2c630da", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-01fb9c71c29cca3e", "source": "codeparrot/github-code-clean", "repo": "arsan-irianto/apdpln", "license": "mit", "language": "PHP", "path": "pages/reports/class/oldfile/PHPJasperXML2.inc.php", "text": "lang=$lang;\n$this->pdflib=$pdflib;\n}\n\npublic function connect($db_host,$db_user,$db_pass,$db_or_dsn_name,$cndriver=\"mysql\"){\n \n if($cndriver==\"mysql\"){\n \n \t if(!$this->con) \n { \n $this->myconn = @mysql_connect($db_host,$db_user,$db_pass);\n\t if($this->myconn)\n { \n $seldb = @mysql_select_db($db_or_dsn_name,$this->myconn);\n if($seldb) \n { \n $this->con = true; \n return true; \n }\n\t\t else \n { \n return false; \n } \n } else \n { \n return false; \n } \n } else \n { \n return true; \n }\n return true;\n }elseif($cndriver==\"psql\"){\n global $pgport;\n if($pgport==\"\" || $pgport==0)\n $pgport=5432;\n \n $conn_string = \"host=$db_host port=$pgport dbname=$db_or_dsn_name user=$db_user password=$db_pass\";\n\t $this->myconn = pg_connect($conn_string);\n\n\n\t\tif($this->myconn) {\n $this->con = true;\n \n\t\t return true;\n\t\t}else\n return false;\n }\n else{\n \n if(!$this->con)\n {\n $this->myconn = odbc_connect($db_or_dsn_name,$db_user,$db_pass);\n \n\t if( $this->myconn)\n {\n $this->con = true;\n return true; \n } else\n {\n return false;\n }\n } else\n {\n return true;\n }\n }\n}\n\npublic function disconnect($cndriver=\"mysql\"){\n if($cndriver==\"mysql\"){\n if($this->con) \n { \n if(@mysql_close()) \n { \n $this->con = false; \n return true; \n } \n else \n { \n return false; \n } \n }\n }elseif($cndriver==\"psql\"){\n $this->con = false;\n pg_close($this->myconn);\n }\n else{\n\n $this->con = false;\n odbc_close( $this->myconn);\n }\n } \n\npublic function xml_dismantle($xml){\t\n\t$this->page_setting($xml);\n\tforeach ($xml as $k=>$out)\n\t{\n\tswitch($k)\n\t {\n\t case \"parameter\":\n\t\t$this->parameter_handler($out);\n\t\tbreak;\n\t case \"queryString\":\n\t\t$this->queryString_handler($out);\n\t\tbreak;\n\t case \"field\":\n\t\t$this->field_handler($out);\n\t\tbreak;\n\t case \"variable\":\n\t\t$this->variable_handler($out);\n\t\tbreak;\n\t case \"group\":\n\t\t$this->group_handler($out);\n\t\tbreak;\n\t case \"background\":\n\t\t$this->pointer=&$this->arraybackground;\n\t\t$this->pointer[]=array(\"height\"=>$out->band[\"height\"],\"splitType\"=>$out->band[\"splitType\"]);\n\t\tforeach ($out as $bg)\n\t\t{\n\t\t$this->default_handler($bg);\n\t\t}\n\t\tbreak;\n\t default:\n\t\tforeach ($out as $object)\n\t\t{\n\t\teval(\"\\$this->pointer=&\".\"\\$this->array$k\".\";\");\n\t\t$this->arrayband[]=array(\"name\"=>$k);\n\t\t$this->pointer[]=array(\"type\"=>\"band\",\"height\"=>$object[\"height\"],\"splitType\"=>$object[\"splitType\"],\"y_axis\"=>$this->y_axis);\n\t\t$this->default_handler($object);}\n\t\t$this->y_axis=$this->y_axis+$out->band[\"height\"];\t//after handle , then adjust y axis\n\t\tbreak;\n\t \n\t }\n\t\n\t}\n}\n//read level 0,Jasperreport page setting\npublic function page_setting($xml_path){\n\t$this->arrayPageSetting[\"orientation\"]=\"P\";\n\t$this->arrayPageSetting[\"name\"]=$xml_path[\"name\"];\n\t$this->arrayPageSetting[\"language\"]=$xml_path[\"language\"];\n\t$this->arrayPageSetting[\"pageWidth\"]=$xml_path[\"pageWidth\"];\n\t$this->arrayPageSetting[\"pageHeight\"]=$xml_path[\"pageHeight\"];\n\tif(isset($xml_path[\"orientation\"])){$this->arrayPageSetting[\"orientation\"]=substr($xml_path[\"orientation\"],0,1);}\n\t$this->arrayPageSetting[\"columnWidth\"]=$xml_path[\"columnWidth\"];\n\t$this->arrayPageSetting[\"leftMargin\"]=$xml_path[\"leftMargin\"];\n\t$this->arrayPageSetting[\"rightMargin\"]=$xml_path[\"rightMargin\"];\n\t$this->arrayPageSetting[\"topMargin\"]=$xml_path[\"topMargin\"];\n $this->y_axis=$xml_path[\"topMargin\"];\n\t$this->arrayPageSetting[\"bottomMargin\"]=$xml_path[\"bottomMargin\"];\n}\n\npublic function parameter_handler($xml_path){\n\t$this->arrayParameter[$xml_path[\"name\"]];\n}\n\npublic function queryString_handler($xml_path){\n\t\t$this->sql =$xml_path;\n\t\tif(isset($this->arrayParameter))\n\t\t{\n\t\t\tforeach($this->arrayParameter as $v => $a)\n\t\t\t{\n\t\t\t $this->sql = str_replace('$P{'.$v.'}', $a, $this->sql);\n\t\t\t}\n\t\t}\n}\n\npublic function field_handler($xml_path){\n\t$this->arrayfield[]=$xml_path[\"name\"];\n}\n\npublic function variable_handler($xml_path){\t\n\t$this->arrayVariable[$xml_path[\"name\"]]=array(\"calculation\"=>$xml_path[\"calculation\"],\"target\"=>substr($xml_path->variableExpression,3,-1),\"class\"=>$xml_path[\"class\"]);\n}\n\npublic function group_handler($xml_path){\n\t$this->arrayband[]=array(\"gname\"=>$xml_path[\"name\"],\"isStartNewPage\"=>$xml_path[\"isStartNewPage\"],\"groupExpression\"=>substr($xml_path->groupExpression,3,-1),\"name\"=>\"group\");\n \n\t\tforeach($xml_path as $tag=>$out)\n\t\t{\t\n\t\tswitch ($tag)\n\t\t{\n\t\tcase (groupHeader):\n// echo $xml_path[name] . \",\";\n\n\t\t$this->pointer=&$this->arraygroup[$xml_path[\"name\"]][\"groupHeader\"];\n\t\t$this->pointer[]=array(\"type\"=>\"band\",\"height\"=>$out->band[\"height\"]+0,\"y_axis\"=>\"\",\"groupExpression\"=>substr($xml_path->groupExpression,3,-1));\n\t\t\tforeach($out as $band)\n\t\t\t{\n\t\t\t$this->default_handler($band);\n\t\t\t}\n\t\t$this->y_axis=$this->y_axis+$out->band[\"height\"];\t\t//after handle , then adjust y axis\n\t\tbreak;\n\t\tcase (groupFooter):\n\t\t$this->pointer=&$this->arraygroup[$xml_path[\"name\"]][\"groupFooter\"];\n\t\t$this->pointer[]=array(\"type\"=>\"band\",\"height\"=>$out->band[\"height\"]+0,\"y_axis\"=>\"\",\"groupExpression\"=>substr($xml_path->groupExpression,3,-1));\n\t\t\tforeach($out as $band)\n\t\t\t{\n\t\t\t$this->default_handler($band);\n\t\t\t}\n\t\tbreak;\n\t\tdefault:\n\t\tbreak;\n\t\t}\n\t\n\t}\n}\n\npublic function default_handler($xml_path){\n\tforeach($xml_path as $k=>$out)\n\t{\n\t\n\tswitch($k)\n\t {\n\t case \"staticText\":\n\t\t$this->element_staticText($out);\n\t\tbreak;\n\t case \"image\":\n\t\t$this->element_image($out);\n\t\tbreak;\n\t case \"line\":\n\t\t$this->element_line($out);\n\t\tbreak;\n\t case \"rectangle\":\n\t\t$this->element_rectangle($out);\n\t\tbreak;\n\t case \"textField\":\n\t\t$this->element_textField($out);\n\t\tbreak;\n\t default:\n\t\tbreak;\n\t }\n\t};\n}\n\npublic function element_staticText($data){\n\t$align=\"L\";\t$fill=0;\t$border=0;\t$fontsize=10;\t$font=\"helvetica\";\t$fontstyle=\"\";\n\t$textcolor = array(\"r\"=>0,\"g\"=>0,\"b\"=>0);\t$fillcolor = array(\"r\"=>255,\"g\"=>255,\"b\"=>255);\t$txt=\"\";\n\t$drawcolor=array(\"r\"=>0,\"g\"=>0,\"b\"=>0);\t$height=$data->reportElement[\"height\"];\n\t$stretchoverflow=\"true\";\t\t$printoverflow=\"false\";\n\tif(isset($data->reportElement[\"forecolor\"]))\n\t{$textcolor = array(\"r\"=>hexdec(substr($data->reportElement[\"forecolor\"],1,2)),\"g\"=>hexdec(substr($data->reportElement[\"forecolor\"],3,2)),\"b\"=>hexdec(substr($data->reportElement[\"forecolor\"],5,2)));}\n\tif(isset($data->reportElement[\"backcolor\"]))\n\t{$fillcolor = array(\"r\"=>hexdec(substr($data->reportElement[\"backcolor\"],1,2)),\"g\"=>hexdec(substr($data->reportElement[\"backcolor\"],3,2)),\"b\"=>hexdec(substr($data->reportElement[\"backcolor\"],5,2)));\n\t}\n\tif($data->reportElement[\"mode\"]==\"Opaque\"){$fill=1;}\n\tif(isset($data[\"isStretchWithOverflow\"])&&$data[\"isStretchWithOverflow\"]==\"true\"){$stretchoverflow=\"true\";}\n\tif(isset($data->reportElement[\"isPrintWhenDetailOverflows\"])&&$data->reportElement[\"isPrintWhenDetailOverflows\"]==\"true\"){$printoverflow=\"true\"; $stretchoverflow=\"false\";}\n\tif((isset($data->box))&&($data->box->pen[\"lineWidth\"]>0))\n\t{$border=1;\n\t\tif(isset($data->box->pen[\"lineColor\"]))\n\t\t{$drawcolor=array(\"r\"=>hexdec(substr($data->box->pen[\"lineColor\"],1,2)),\"g\"=>hexdec(substr($data->box->pen[\"lineColor\"],3,2)),\"b\"=>hexdec(substr($data->box->pen[\"lineColor\"],5,2)));}\n\t}\n\tif(isset($data->textElement[\"textAlignment\"])){$align=$this->get_first_value($data->textElement[\"textAlignment\"]);}\n\tif(isset($data->textElement->font[\"pdfFontName\"])){$font=$data->textElement->font[\"pdfFontName\"];}\n\tif(isset($data->textElement->font[\"size\"])){$fontsize=$data->textElement->font[\"size\"];}\n\tif(isset($data->textElement->font[\"isBold\"])&&$data->textElement->font[\"isBold\"]==\"true\"){$fontstyle=$fontstyle.\"B\";}\n\tif(isset($data->textElement->font[\"isItalic\"])&&$data->textElement->font[\"isItalic\"]==\"true\"){$fontstyle=$fontstyle.\"I\";}\n\tif(isset($data->textElement->font[\"isUnderline\"])&&$data->textElement->font[\"isUnderline\"]==\"true\"){$fontstyle=$fontstyle.\"U\";}\n\tif(isset($data->reportElement[\"key\"])){$height=$fontsize*$this->adjust;}\n\t$this->pointer[]=array(\"type\"=>\"SetXY\",\"x\"=>$data->reportElement[\"x\"],\"y\"=>$data->reportElement[\"y\"],\"hidden_type\"=>\"SetXY\");\n\t$this->pointer[]=array(\"type\"=>\"SetTextColor\",\"r\"=>$textcolor[\"r\"],\"g\"=>$textcolor[\"g\"],\"b\"=>$textcolor[\"b\"],\"hidden_type\"=>\"textcolor\");\n\t$this->pointer[]=array(\"type\"=>\"SetDrawColor\",\"r\"=>$drawcolor[\"r\"],\"g\"=>$drawcolor[\"g\"],\"b\"=>$drawcolor[\"b\"],\"hidden_type\"=>\"drawcolor\");\n\t$this->pointer[]=array(\"type\"=>\"SetFillColor\",\"r\"=>$fillcolor[\"r\"],\"g\"=>$fillcolor[\"g\"],\"b\"=>$fillcolor[\"b\"],\"hidden_type\"=>\"fillcolor\");\n\t$this->pointer[]=array(\"type\"=>\"SetFont\",\"font\"=>$font,\"fontstyle\"=>$fontstyle,\"fontsize\"=>$fontsize,\"hidden_type\"=>\"font\");\n\t//\"height\"=>$data->reportElement[\"height\"]\n\t$this->pointer[]=array(\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>$data->text,\"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\"hidden_type\"=>\"statictext\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow);\n\n}\n\npublic function element_image($data){\n\t$imagepath=$data->imageExpression;\n\t//$imagepath= substr($data->imageExpression, 1, -1);\n\t//$imagetype= substr($imagepath,-3);\n\n\tswitch($data[scaleImage])\n\t{\n\tcase \"FillFrame\":\n\t$this->pointer[]=array(\"type\"=>\"Image\",\"path\"=>$imagepath,\"x\"=>$data->reportElement[\"x\"]+0,\"y\"=>$data->reportElement[\"y\"]+0,\"width\"=>$data->reportElement[\"width\"]+0,\"height\"=>$data->reportElement[\"height\"]+0,\"imgtype\"=>$imagetype,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"hidden_type\"=>\"image\");\n\tbreak;\n\tdefault:\n\t$this->pointer[]=array(\"type\"=>\"Image\",\"path\"=>$imagepath,\"x\"=>$data->reportElement[\"x\"]+0,\"y\"=>$data->reportElement[\"y\"]+0,\"width\"=>$data->reportElement[\"width\"]+0,\"height\"=>$data->reportElement[\"height\"]+0,\"imgtype\"=>$imagetype,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"hidden_type\"=>\"image\");\n\tbreak;\n\t}\n}\n\npublic function element_line($data){\t//default line width=0.567(no detect line width)\n\t$drawcolor=array(\"r\"=>0,\"g\"=>0,\"b\"=>0); $hidden_type=\"line\";\n\tif(isset($data->reportElement[\"forecolor\"]))\n\t{$drawcolor=array(\"r\"=>hexdec(substr($data->reportElement[\"forecolor\"],1,2)),\"g\"=>hexdec(substr($data->reportElement[\"forecolor\"],3,2)),\"b\"=>hexdec(substr($data->reportElement[\"forecolor\"],5,2)));}\n\t$this->pointer[]=array(\"type\"=>\"SetDrawColor\",\"r\"=>$drawcolor[\"r\"],\"g\"=>$drawcolor[\"g\"],\"b\"=>$drawcolor[\"b\"],\"hidden_type\"=>\"drawcolor\");\n\tif(isset($data->reportElement[positionType])&&$data->reportElement[positionType]==\"FixRelativeToBottom\")\n\t{$hidden_type=\"relativebottomline\";}\n\tif($data->reportElement[\"width\"][0]+0 > $data->reportElement[\"height\"][0]+0)\t//width > height means horizontal line\n\t{$this->pointer[]=array(\"type\"=>\"Line\", \"x1\"=>$data->reportElement[\"x\"],\"y1\"=>$data->reportElement[\"y\"],\"x2\"=>$data->reportElement[\"x\"]+$data->reportElement[\"width\"],\"y2\"=>$data->reportElement[\"y\"]+$data->reportElement[\"height\"]-1,\"hidden_type\"=>$hidden_type);}\n\telseif($data->reportElement[\"height\"][0]+0>$data->reportElement[\"width\"][0]+0)\t\t//vertical line\n\t{$this->pointer[]=array(\"type\"=>\"Line\", \"x1\"=>$data->reportElement[\"x\"],\"y1\"=>$data->reportElement[\"y\"],\"x2\"=>$data->reportElement[\"x\"]+$data->reportElement[\"width\"]-1,\"y2\"=>$data->reportElement[\"y\"]+$data->reportElement[\"height\"],\"hidden_type\"=>$hidden_type);}\n\t$this->pointer[]=array(\"type\"=>\"SetDrawColor\",\"r\"=>0,\"g\"=>0,\"b\"=>0,\"hidden_type\"=>\"drawcolor\");\n}\n\npublic function element_rectangle($data){\n\t$drawcolor=array(\"r\"=>0,\"g\"=>0,\"b\"=>0);\n\tif(isset($data->reportElement[\"forecolor\"]))\n\t{$drawcolor=array(\"r\"=>hexdec(substr($data->reportElement[\"forecolor\"],1,2)),\"g\"=>hexdec(substr($data->reportElement[\"forecolor\"],3,2)),\"b\"=>hexdec(substr($data->reportElement[\"forecolor\"],5,2)));}\n\t$this->pointer[]=array(\"type\"=>\"SetDrawColor\",\"r\"=>$drawcolor[\"r\"],\"g\"=>$drawcolor[\"g\"],\"b\"=>$drawcolor[\"b\"],\"hidden_type\"=>\"drawcolor\");\n\t$this->pointer[]=array(\"type\"=>\"Rect\",\"x\"=>$data->reportElement[\"x\"],\"y\"=>$data->reportElement[\"y\"],\"width\"=>$data->reportElement[\"width\"],\"height\"=>$data->reportElement[\"height\"],\"hidden_type\"=>\"rect\");\n\t$this->pointer[]=array(\"type\"=>\"SetDrawColor\",\"r\"=>0,\"g\"=>0,\"b\"=>0,\"hidden_type\"=>\"drawcolor\");\n}\n\npublic function element_textField($data){\n\t$align=\"L\";\t$fill=0;\t$border=0;\t$fontsize=10;\t$font=\"helvetica\";\t$fontstyle=\"\";\n\t$textcolor = array(\"r\"=>0,\"g\"=>0,\"b\"=>0);\t$fillcolor = array(\"r\"=>255,\"g\"=>255,\"b\"=>255);\n\t$stretchoverflow=\"false\";\t\t$printoverflow=\"false\";\t$height=$data->reportElement[\"height\"];\n\t$drawcolor=array(\"r\"=>0,\"g\"=>0,\"b\"=>0);\n\tif(isset($data->reportElement[\"forecolor\"]))\n\t{$textcolor = array(\"r\"=>hexdec(substr($data->reportElement[\"forecolor\"],1,2)),\"g\"=>hexdec(substr($data->reportElement[\"forecolor\"],3,2)),\"b\"=>hexdec(substr($data->reportElement[\"forecolor\"],5,2)));}\n\tif(isset($data->reportElement[\"backcolor\"]))\n\t{$fillcolor = array(\"r\"=>hexdec(substr($data->reportElement[\"backcolor\"],1,2)),\"g\"=>hexdec(substr($data->reportElement[\"backcolor\"],3,2)),\"b\"=>hexdec(substr($data->reportElement[\"backcolor\"],5,2)));}\n\tif($data->reportElement[\"mode\"]==\"Opaque\"){$fill=1;}\n\tif(isset($data[\"isStretchWithOverflow\"])&&$data[\"isStretchWithOverflow\"]==\"true\"){$stretchoverflow=\"true\";}\n\tif(isset($data->reportElement[\"isPrintWhenDetailOverflows\"])&&$data->reportElement[\"isPrintWhenDetailOverflows\"]==\"true\"){$printoverflow=\"true\";}\n\tif(isset($data->box)&&$data->box->pen[\"lineWidth\"]>0)\n\t{$border=1;\n\t\tif(isset($data->box->pen[\"lineColor\"]))\n\t\t{$drawcolor=array(\"r\"=>hexdec(substr($data->box->pen[\"lineColor\"],1,2)),\"g\"=>hexdec(substr($data->box->pen[\"lineColor\"],3,2)),\"b\"=>hexdec(substr($data->box->pen[\"lineColor\"],5,2)));}\n\t}\n\tif(isset($data->reportElement[\"key\"])){$height=$fontsize*$this->adjust;}\n\tif(isset($data->textElement[\"textAlignment\"])){$align=$this->get_first_value($data->textElement[\"textAlignment\"]);}\n\tif(isset($data->textElement->font[\"pdfFontName\"])){$font=$data->textElement->font[\"pdfFontName\"];}\n\tif(isset($data->textElement->font[\"size\"])){$fontsize=$data->textElement->font[\"size\"];}\n\tif(isset($data->textElement->font[\"isBold\"])&&$data->textElement->font[\"isBold\"]==\"true\"){$fontstyle=$fontstyle.\"B\";}\n\tif(isset($data->textElement->font[\"isItalic\"])&&$data->textElement->font[\"isItalic\"]==\"true\"){$fontstyle=$fontstyle.\"I\";}\n\tif(isset($data->textElement->font[\"isUnderline\"])&&$data->textElement->font[\"isUnderline\"]==\"true\"){$fontstyle=$fontstyle.\"U\";}\n\t$this->pointer[]=array(\"type\"=>\"SetXY\",\"x\"=>$data->reportElement[\"x\"],\"y\"=>$data->reportElement[\"y\"],\"hidden_type\"=>\"SetXY\");\n\t$this->pointer[]=array(\"type\"=>\"SetTextColor\",\"r\"=>$textcolor[\"r\"],\"g\"=>$textcolor[\"g\"],\"b\"=>$textcolor[\"b\"],\"hidden_type\"=>\"textcolor\");\n\t$this->pointer[]=array(\"type\"=>\"SetDrawColor\",\"r\"=>$drawcolor[\"r\"],\"g\"=>$drawcolor[\"g\"],\"b\"=>$drawcolor[\"b\"],\"hidden_type\"=>\"drawcolor\");\n\t$this->pointer[]=array(\"type\"=>\"SetFillColor\",\"r\"=>$fillcolor[\"r\"],\"g\"=>$fillcolor[\"g\"],\"b\"=>$fillcolor[\"b\"],\"hidden_type\"=>\"fillcolor\");\n\t\n\t$this->pointer[]=array(\"type\"=>\"SetFont\",\"font\"=>$font,\"fontstyle\"=>$fontstyle,\"fontsize\"=>$fontsize,\"hidden_type\"=>\"font\");\n\t//$data->hyperlinkReferenceExpression=$this->analyse_expression($data->hyperlinkReferenceExpression);\n\tswitch ($data->textFieldExpression)\n\t{\n\tcase 'new java.util.Date()':\n \n\t$this->pointer[]=array (\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>date(\"d/m/y h:i A\", time()),\"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\"hidden_type\"=>\"date\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1));\n\tbreak;\n\tcase '\"Page \"+$V{PAGE_NUMBER}+\" of\"':\n\t$this->pointer[]=array(\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>'Page $this->PageNo() of',\"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\"hidden_type\"=>\"pageno\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"pattern\"=>$data[\"pattern\"]);\n\tbreak;\n\tcase '$V{PAGE_NUMBER}':\n\t\tif(isset($data[\"evaluationTime\"])&&$data[\"evaluationTime\"]==\"Report\")\n\t\t{$this->pointer[]=array(\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>'{nb}',\"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\"hidden_type\"=>\"pageno\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"pattern\"=>$data[\"pattern\"]);}\n\t\telse{$this->pointer[]=array(\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>'$this->PageNo()',\"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\"hidden_type\"=>\"pageno\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"pattern\"=>$data[\"pattern\"]);}\n\tbreak;\n\tcase '\" \" + $V{PAGE_NUMBER}':\n\t$this->pointer[]=array(\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>' {nb}',\"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\"hidden_type\"=>\"nb\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"pattern\"=>$data[\"pattern\"]);\n\tbreak;\n\tcase '$V{REPORT_COUNT}':\n\t$this->report_count=0;\n\t$this->pointer[]=array(\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>&$this->report_count,\"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\"hidden_type\"=>\"report_count\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"pattern\"=>$data[\"pattern\"]);\n\tbreak;\n case '$V{'.$this->arrayband[0][\"gname\"].'_COUNT}':\n\t$this->group_count=0;\n\t$this->pointer[]=array(\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>&$this->group_count,\"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\"hidden_type\"=>\"group_count\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow,\"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"pattern\"=>$data[\"pattern\"]);\n\tbreak;\n\tdefault:\n $writeHTML=false;\n if($data->reportElement->property[\"name\"]==\"writeHTML\")\n $writeHTML=$data->reportElement->property[\"value\"];\n if(isset($data->reportElement[\"isPrintRepeatedValues\"]))\n $isPrintRepeatedValues=$data->reportElement[\"isPrintRepeatedValues\"];\n//echo print_r($data,true).\"

\";//->hyperlinkReferenceExpression.\"
\";\n\n\t$this->pointer[]=array(\"type\"=>\"MultiCell\",\"width\"=>$data->reportElement[\"width\"],\"height\"=>$height,\"txt\"=>$data->textFieldExpression,\n \"border\"=>$border,\"align\"=>$align,\"fill\"=>$fill,\n \"hidden_type\"=>\"field\",\"soverflow\"=>$stretchoverflow,\"poverflow\"=>$printoverflow,\n \"printWhenExpression\"=>$data->reportElement->printWhenExpression,\n \"link\"=>substr($data->hyperlinkReferenceExpression,1,-1),\"pattern\"=>$data[\"pattern\"],\n \"writeHTML\"=>$writeHTML,\"isPrintRepeatedValues\"=>$isPrintRepeatedValues);\n\tbreak;\n\t}\n}\n\npublic function transferDBtoArray($host,$user,$password,$db_or_dsn_name,$cndriver=\"mysql\"){ $this->m=0;\n \n\tif(!$this->connect($host,$user,$password,$db_or_dsn_name,$cndriver))\t//connect database\n\t{\n\techo \"Fail to connect database\";\n\texit(0);\n\t}\n\tif($this->debugsql==true){\n\techo $this->sql;\n\tdie;\n\t}\n \n if($cndriver==\"odbc\"){\n\n $result=odbc_exec( $this->myconn,$this->sql);\n while ($row = odbc_fetch_array($result))\n\t{\n\t\tforeach($this->arrayfield as $out)\n\t\t{\n\t\t$this->arraysqltable[$this->m][\"$out\"]=$row[\"$out\"];\n\t\t}\n\t\t$this->m++;\n\t}\n }elseif($cndriver==\"psql\"){\n \n \n pg_send_query($this->myconn,$this->sql);\n \t$result = pg_get_result($this->myconn);\n\twhile ($row = pg_fetch_array($result, NULL, PGSQL_ASSOC)) \n\t{\n\t\tforeach($this->arrayfield as $out)\n\t\t{\n\t\t$this->arraysqltable[$this->m][\"$out\"]=$row[\"$out\"];\n\t\t}\n\t\t$this->m++;\n\t}\n }\n else{\n\t$result = @mysql_query($this->sql); //query from db\n\n\twhile ($row = mysql_fetch_array($result, MYSQL_ASSOC)) \n\t{\n\t\tforeach($this->arrayfield as $out)\n\t\t{\n\t\t$this->arraysqltable[$this->m][\"$out\"]=$row[\"$out\"];\n\t\t}\n\t\t$this->m++;\n\t}}\n\t$this->disconnect($cndriver);\t//close connection to db\n\n\tif(isset($this->arrayVariable))\t//if self define variable existing, go to do the calculation\n\t{$this->variable_calculation($m);}\n}\n\npublic function time_to_sec($time) {\n $hours = substr($time, 0, -6);\n $minutes = substr($time, -5, 2);\n $seconds = substr($time, -2);\n\n return $hours * 3600 + $minutes * 60 + $seconds;\n}\n\npublic function sec_to_time($seconds) {\n $hours = floor($seconds / 3600);\n $minutes = floor($seconds % 3600 / 60);\n $seconds = $seconds % 60;\n\n return sprintf(\"%d:%02d:%02d\", $hours, $minutes, $seconds);\n}\n\npublic function variable_calculation($m=0){\n\tforeach($this->arrayVariable as $k=>$out)\n\t{\n\t\tswitch($out[\"calculation\"])\n\t\t{case \"Sum\":\n\t\t\t$sum=0;\n\t\t\tif(isset($this->arrayVariable[$k]['class'])&&$this->arrayVariable[$k]['class']==\"java.sql.Time\")\n\t\t\t\"version\" => \"148.189.243.111\",\n\t\t\t{\n\t\t\t\tforeach($this->arraysqltable as $table)\n\t\t\t\t{\n $sum=$sum+$this->time_to_sec($table[$out[\"target\"]]);\n\t\t\t\t//$sum=$sum+substr($table[\"$out[target]\"],0,2)*3600+substr($table[\"$out[target]\"],3,2)*60+substr($table[\"$out[target]\"],6,2);\n\t\t\t\t}\n\t\t\t\t//$sum= floor($sum / 3600).\":\".floor($sum%3600 / 60);\n\t\t\t\t//if($sum==\"0:0\"){$sum=\"00:00\";}\n $sum=$this->sec_to_time($sum);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\tforeach($this->arraysqltable as $table)\n\t\t\t{\n\t\t\t$sum=$sum+$table[$out[\"target\"]];\n\t\t\t$table[$out[\"target\"]];\n\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->arrayVariable[$k][\"ans\"]=$sum;\n\t\tbreak;\n\t\t'author' => 'author name',\n\t\tcase \"Average\":\n\t\t\t$sum=0;\n\t\t\tif(isset($this->arrayVariable[$k]['class'])&&$this->arrayVariable[$k]['class']==\"java.sql.Time\")\n\t\t\t{\n\t\t\t\tforeach($this->arraysqltable as $table)\n\t\t\t\t{\n $sum=$sum+$this->time_to_sec($table[$out[\"target\"]]);\n\t\t\t\n\t\t\t\t}\n\n $sum=$this->sec_to_time($sum/$m);\n\t\t\t\t$this->arrayVariable[$k][\"ans\"]=$sum;\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t$this->arrayVariable[$k][\"ans\"]=$sum;\n\t\t\tforeach($this->arraysqltable as $table)\n\t\t\t\t$sum=$sum+$table[$out[\"target\"]];\n\t\t\t\t$this->arrayVariable[$k][\"ans\"]= $sum/$m;\n\t\t\t\n\t\t\n\t\t\t}\n\n\t\t\t\n\t\tbreak;\n\t\tcase \"DistinctCount\":\n\t\tbreak;\n\t\tcase \"Lowest\":\n\t\t\t\n\t\t\tforeach($this->arraysqltable as $table)\n\t\t\t{\t$lowest=$table[$out[\"target\"]];\n\t\t\t\tif($table[$out[\"target\"]]<$lowest)\n\t\t\t\t{$lowest=$table[$out[\"target\"]];}\n\t\t\t\t$this->arrayVariable[$k][\"ans\"]=$lowest;\n\t\t\t}\n\t\tbreak;\n\t\tcase \"Highest\":\n\t\t\t$out[\"ans\"]=0;\n\t\t\tforeach($this->arraysqltable as $table)\n\t\t\t{\n\t\t\t\tif($table[$out[\"target\"]]>$out[\"ans\"])\n\t\t\t\t{$this->arrayVariable[$k][\"ans\"]=$table[$out[\"target\"]];}\n\t\t\t}\n\t\tbreak;\n\t\tdefault:\n\t\t$out[\"target\"]=0;\t\t//other cases needed, temporary leave 0 if not suitable case\n\t\tbreak;\n\t\t\n\t\t}\n\t}\n}\n/////////////////////////////////////////////////////display to pdf part/////////////////////////////////////////////////////////////\n\npublic function outpage($out_method=\"I\",$filename=\"\"){\n if($this->lang==\"cn\"){\n\tif($this->arrayPageSetting[\"orientation\"]==\"P\")\n\t{\n $this->pdf=new PDF_Unicode($this->arrayPageSetting[\"orientation\"],'pt',array($this->arrayPageSetting[\"pageWidth\"],$this->arrayPageSetting[\"pageHeight\"]));\n \t$this->pdf->AddUniGBhwFont(\"uGB\");\n }\n\telse\n\t{$this->pdf=new PDF_Unicode($this->arrayPageSetting[\"orientation\"],'pt',array($this->arrayPageSetting[\"pageHeight\"],$this->arrayPageSetting[\"pageWidth\"]));\n\t$this->pdf->AddUniGBhwFont(\"uGB\");\n\t}\n }\n // login as brittanylove / 962faf24b60f1faaff745c8291c8d245\n else{\n\n if($this->pdflib==\"TCPDF\"){\n\t if($this->arrayPageSetting[\"orientation\"]==\"P\")\n $this->pdf=new TCPDF($this->arrayPageSetting[\"orientation\"],'pt',array($this->arrayPageSetting[\"pageWidth\"],$this->arrayPageSetting[\"pageHeight\"]));\n\t else\n $this->pdf=new TCPDF($this->arrayPageSetting[\"orientation\"],'pt',array($this->arrayPageSetting[\"pageHeight\"],$this->arrayPageSetting[\"pageWidth\"]));\n }else{\n\t if($this->arrayPageSetting[\"orientation\"]==\"P\")\n $this->pdf=new FPDF($this->arrayPageSetting[\"orientation\"],'pt',array($this->arrayPageSetting[\"pageWidth\"],$this->arrayPageSetting[\"pageHeight\"]));\n\t else\n $this->pdf=new FPDF($this->arrayPageSetting[\"orientation\"],'pt',array($this->arrayPageSetting[\"pageHeight\"],$this->arrayPageSetting[\"pageWidth\"]));\n }\n }\n\t//$this->arrayPageSetting[\"language\"]=$xml_path[\"language\"];\n\t$this->pdf->SetLeftMargin($this->arrayPageSetting[\"leftMargin\"]);\n\t$this->pdf->SetRightMargin($this->arrayPageSetting[\"rightMargin\"]);\n\t$this->pdf->SetTopMargin($this->arrayPageSetting[\"topMargin\"]);\n\t$this->pdf->SetAutoPageBreak(true,$this->arrayPageSetting[\"bottomMargin\"]/2);\n\t$this->pdf->AddPage();\n\t$this->pdf->AliasNbPages();\n\t$this->global_pointer=0;\n\t$this->background();\n\tforeach ($this->arrayband as $band)\n\t{\n\t\tswitch($band[\"name\"])\n\t\t{\n\t\tcase \"pageHeader\":\n\t\t$this->pageHeader();\n\t\tbreak;\n\t\tcase \"detail\":\n\t\t$this->detail();\n\t\tbreak;\n\t\tcase \"group\":\n\t\t$this->group_pointer=$band[\"groupExpression\"];\n\t\t$this->group_name=$band[\"gname\"];\n\t\tbreak;\n\t\tdefault:\n\t\tbreak;\n\t\t\n\t\t}\n\n\t}\n if($filename==\"\")\n $filename=$this->arrayPageSetting[\"name\"].\".pdf\";\n\treturn $this->pdf->Output($filename,$out_method);\t//send out the complete page\n\t\n}\n\npublic function background(){\n\tforeach ($this->arraybackground as $out)\n\t{\n\tswitch($out[\"hidden_type\"])\n\t{\n\tcase \"field\":\n\t$this->display($out,$this->arrayPageSetting[\"topMargin\"],true);\n\tbreak;\n\tdefault:\n\t$this->display($out,$this->arrayPageSetting[\"topMargin\"],false);\n\tbreak;\n\t}\n\t}\n}\n\npublic function pageHeader(){\n\tif(isset($this->arraypageHeader))\n\t{$this->arraypageHeader[0][\"y_axis\"]=$this->arrayPageSetting[\"topMargin\"];}\n\tforeach ($this->arraypageHeader as $out)\n\t{\n\tswitch($out[\"hidden_type\"])\n\t{\n\tcase \"field\":\n\t$this->display($out,$this->arraypageHeader[0][\"y_axis\"],true);\n\tbreak;\n\tdefault:\n\t$this->display($out,$this->arraypageHeader[0][\"y_axis\"],false);\n\tbreak;\n\t}\n\t}\n\tif(isset($this->arraygroup))\n\t{$this->group();}\n}\n\npublic function group(){\n $gname=$this->arrayband[0][\"gname\"].\"\";\n\tif(isset($this->arraypageHeader))\n\t{$this->arraygroup[$gname][\"groupHeader\"][0][\"y_axis\"]=$this->arrayPageSetting[\"topMargin\"]+$this->arraypageHeader[0][\"height\"];}\n\tif(isset($this->arraypageFooter))\n\t{$this->arraygroup[$gname][\"groupFooter\"][0][\"y_axis\"]=$this->arrayPageSetting[\"pageHeight\"]-$this->arraypageFooter[0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"]-$this->arraygroup[$gname][\"groupFooter\"][0][\"height\"];}\n\telse{$this->arraygroup[$gname][\"groupFooter\"][0][\"y_axis\"]=$this->arrayPageSetting[\"pageHeight\"]-$this->arrayPageSetting[\"bottomMargin\"]-$this->arraygroup[$gname][\"groupFooter\"][0][\"height\"];}\n\n\tif(isset($this->arraygroup))\n\t{\n\tforeach($this->arraygroup[$gname] as $name=>$out)\n\t{\n \n \n\t\tswitch($name)\n\t\t{\n\t\tcase \"groupHeader\":\n $this->group_count=0;\n\t\t\tforeach($out as $path)\n\t\t\t{ \n switch($path[\"hidden_type\"])\n\t\t\t\t{\n\t\t\t\tcase \"field\":\n\t\t\t\t$this->display($path,$this->arraygroup[$gname][\"groupHeader\"][0][\"y_axis\"],true);\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t$this->display($path,$this->arraygroup[$gname][\"groupHeader\"][0][\"y_axis\"],false);\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tcase \"groupFooter\":\n\t\t\tforeach($out as $path)\n\t\t\t{\tswitch($path[\"hidden_type\"])\n\t\t\t\t{\n\t\t\t\tcase \"field\":\n\t\t\t\t$this->display($path,$this->arraygroup[$gname][\"groupFooter\"][0][\"y_axis\"],true);\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t$this->display($path,$this->arraygroup[$gname][\"groupFooter\"][0][\"y_axis\"],false);\n\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\tbreak;\n\t\tdefault:\n\t\tbreak;\n\t\t}\n\t}\n\t}\n}\n\npublic function pageFooter(){\n\tif(isset($this->arraypageFooter))\n\t{\n\t\tforeach ($this->arraypageFooter as $out)\n\t\t{\n\t\tswitch($out[\"hidden_type\"])\n\t\t{\n\t\tcase \"field\":\n\t\t$this->display($out,$this->arrayPageSetting[\"pageHeight\"]-$this->arraypageFooter[0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"],true);\n\t\tbreak;\n\t\tdefault:\n\t\t$this->display($out,$this->arrayPageSetting[\"pageHeight\"]-$this->arraypageFooter[0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"],false);\n\t\tbreak;\n\t\t}\n\t\t}\n\t}\n\telse{$this->lastPageFooter();}\n}\n\npublic function lastPageFooter(){\n\tif(isset($this->arraylastPageFooter))\n\t{\n\tforeach ($this->arraylastPageFooter as $out)\n\t{\n\tswitch($out[\"hidden_type\"])\n\t{\n\tcase \"field\":\n\t$this->display($out,$this->arrayPageSetting[\"pageHeight\"]-$this->arraylastPageFooter[0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"],true);\n\tbreak;\n\tdefault:\n\t$this->display($out,$this->arrayPageSetting[\"pageHeight\"]-$this->arraylastPageFooter[0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"],false);\n\tbreak;\n\t}\n\t}\n\t}\n}\n\npublic function NbLines($w,$txt){\n\t//Computes the number of lines a MultiCell of width w will take\n\t$cw=&$this->pdf->CurrentFont['cw'];\n\tif($w==0)\n\t\t$w=$this->pdf->w-$this->pdf->rMargin-$this->pdf->x;\n\t$wmax=($w-2*$this->pdf->cMargin)*1000/$this->pdf->FontSize;\n\t$s=str_replace(\"\\r\",'',$txt);\n\t$nb=strlen($s);\n\tif($nb>0 and $s[$nb-1]==\"\\n\")\n\t\t$nb--;\n\t$sep=-1;\n\t$i=0;\n\t$j=0;\n\t$l=0;\n\t$nl=1;\n\twhile($i<$nb)\n\t{\n\t\t$c=$s[$i];\n\t\tif($c==\"\\n\")\n\t\t{\n\t\t\t$i++;\n\t\t\t$sep=-1;\n\t\t\t$j=$i;\n\t\t\t$l=0;\n\t\t\t$nl++;\n\t\t\tcontinue;\n\t\t}\n\t\tif($c==' ')\n\t\t\t$sep=$i;\n\t\t$l+=$cw[$c];\n\t\tif($l>$wmax)\n\t\t{\n\t\t\tif($sep==-1)\n\t\t\t{\n\t\t\t\tif($i==$j)\n\t\t\t\t\t$i++;\n\t\t\t}\n\t\t\telse\n\t\t\t\t$i=$sep+1;\n\t\t\t$sep=-1;\n\t\t\t$j=$i;\n\t\t\t$l=0;\n\t\t\t$nl++;\n\t\t}\n\t\telse\n\t\t\t$i++;\n\t}\n\treturn $nl;\n}\n\npublic function detail(){$field_pos_y=$this->arraydetail[0][\"y_axis\"];\t$biggestY=0;\t$checkpoint=$this->arraydetail[0][\"y_axis\"];\t$tempY=$this->arraydetail[0][\"y_axis\"];\n\nforeach($this->arraysqltable as $row)\n{\t\n\t\n\tif(isset($this->arraygroup)&&($this->global_pointer>0)&&($this->arraysqltable[$this->global_pointer][$this->group_pointer]!=$this->arraysqltable[$this->global_pointer-1][$this->group_pointer]))\t//check the group's groupExpression existed and same or not\n\t{\n\t$this->pageFooter();\n\t$this->pdf->AddPage();\n\t$this->background();\n\t$this->pageHeader();\n\t$checkpoint=$this->arraydetail[0][\"y_axis\"];\n\t$biggestY=0;\t$tempY=$this->arraydetail[0][\"y_axis\"];\n\t}\t\n\n\tforeach($this->arraydetail as $compare)\t//this loop is to count possible biggest Y of the coming row\n\t{\n\t\tswitch($compare[\"hidden_type\"])\n\t\t{\n\t\tcase \"field\":\n\t\t$txt=$this->analyse_expression($row[$compare[\"txt\"]]);\n\t\tif(isset($this->arraygroup[\"$this->group_name\"][\"groupFooter\"])&&(($checkpoint+($compare[\"height\"]*$txt))>($this->arrayPageSetting[\"pageHeight\"]-$this->arraygroup[\"$this->group_name\"][\"groupFooter\"][0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"])))//check group footer existed or not\n\t\t{\n\t\t$this->pageFooter();\n\t\t$this->pdf->AddPage();\n\t\t$this->background();\n\t\t$this->pageHeader();\n\t\t$checkpoint=$this->arraydetail[0][\"y_axis\"];\n\t\t$biggestY=0;\t$tempY=$this->arraydetail[0][\"y_axis\"];\n\t\t}\n\t\telseif(isset($this->arraypageFooter)&&(($checkpoint+($compare[\"height\"]*($this->NbLines($compare[\"width\"],$txt))))>($this->arrayPageSetting[\"pageHeight\"]-$this->arraypageFooter[0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"])))//check pagefooter existed or not\n\t\t{\n\t\t$this->pageFooter();\n\t\t$this->pdf->AddPage();\n\t\t$this->background();\n\t\t$this->pageHeader();\n\t\t$checkpoint=$this->arraydetail[0][\"y_axis\"];\n\t\t$biggestY=0;\t$tempY=$this->arraydetail[0][\"y_axis\"];\n\t\t}\n\t\telseif(isset($this->arraylastPageFooter)&&(($checkpoint+($compare[\"height\"]*($this->NbLines($compare[\"width\"],$txt))))>($this->arrayPageSetting[\"pageHeight\"]-$this->arraylastPageFooter[0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"])))//check lastpagefooter existed or not\n\t\t{\n\t\t$this->lastPageFooter();\n\t\t$this->pdf->AddPage();\n\t\t$this->background();\n\t\t$this->pageHeader();\n\t\t$checkpoint=$this->arraydetail[0][\"y_axis\"];\n\t\t$biggestY=0;\t$tempY=$this->arraydetail[0][\"y_axis\"];\n\t\t}\n\t\n\t\tif(($checkpoint+($compare[\"height\"]*($this->NbLines($compare[\"width\"],$txt))))>$tempY)\n\t\t{$tempY=$checkpoint+($compare[\"height\"]*($this->NbLines($compare[\"width\"],$txt)));}\n\t\tbreak;\n\t\tcase \"relativebottomline\":\n\t\tbreak;\n\t\tcase \"report_count\":\n\t\t\t$this->report_count++;\n\n \t\tbreak;\n case \"group_count\":\n\t\t\t$this->group_count++;\n\n \t\tbreak;\n\t\tdefault:\n\t\t$this->display($compare,$checkpoint);\n\t\tbreak;\n\t\t}\n\t}\n\n\t\n\n\tif($checkpoint+$this->arraydetail[0][\"height\"]>($this->arrayPageSetting[\"pageHeight\"]-$this->arraypageFooter[0][\"height\"]-$this->arrayPageSetting[\"bottomMargin\"]))\t//check the upcoming band is greater than footer position or not\n\t{$this->pageFooter();\n\t$this->pdf->AddPage();\n\t$this->background();\n\t$this->pageHeader();\n\t$checkpoint=$this->arraydetail[0][\"y_axis\"];\n\t$biggestY=0; $tempY=$this->arraydetail[0][\"y_axis\"];}\n\n\tforeach ($this->arraydetail as $out)\n\t{\n\t\tswitch ($out[\"hidden_type\"])\n\t\t{\n\t\tcase \"field\":\n\t\n\t\t$this->prepare_print_array=array(\"type\"=>\"MultiCell\",\"width\"=>$out[\"width\"],\"height\"=>$out[\"height\"],\"txt\"=>$out[\"txt\"],\"border\"=>$out[\"border\"],\"align\"=>$out[\"align\"],\"fill\"=>$out[\"fill\"],\"hidden_type\"=>$out[\"hidden_type\"],\"printWhenExpression\"=>$out[\"printWhenExpression\"],\"soverflow\"=>$out[\"soverflow\"],\"poverflow\"=>$out[\"poverflow\"],\"link\"=>$out[\"link\"],\"pattern\"=>$out[\"pattern\"],\"writeHTML\"=>$out[\"writeHTML\"],\"isPrintRepeatedValues\"=>$out[\"isPrintRepeatedValues\"]);\n\t\t$this->display($this->prepare_print_array,0,true);\n\n\t\tif($this->pdf->GetY()>$biggestY)\n\t\t{$biggestY=$this->pdf->GetY();}\n\t\tbreak;\n\t\tcase \"relativebottomline\":\n\t\t//$this->relativebottomline($out,$tempY);\n\t\t$this->relativebottomline($out,$biggestY);\t\n\t\tbreak;\n\t\tdefault:\n\n\t\t$this->display($out,$checkpoint);\n\t\t\n\t\t//$checkpoint=$this->pdf->GetY();\n\t\tbreak;\t\t\n\t\t}\n\t}\n\t$this->pdf->SetY($biggestY);\n\tif($biggestY>$checkpoint+$this->arraydetail[0][\"height\"])\n\t{$checkpoint=$biggestY;}\n\telseif($biggestY<$checkpoint+$this->arraydetail[0][\"height\"])\n\t{$checkpoint=$checkpoint+$this->arraydetail[0][\"height\"];}\n\telse{$checkpoint=$biggestY;}\n\n\t//if(isset($this->arraygroup)){$this->global_pointer++;}\n\t$this->global_pointer++;\n}\t\n$this->global_pointer--;\nif(isset($this->arraylastPageFooter))\n{$this->lastPageFooter();}\nelse{$this->pageFooter();}\n}\n\npublic function display($arraydata,$y_axis=0,$fielddata=false){ \n\n\tif($arraydata[\"type\"]==\"SetFont\")\n\t{\n if($arraydata[\"font\"]=='uGB')\n \t$this->pdf->isUnicode=true;\n else\n $this->pdf->isUnicode=false;\n\n $this->pdf->SetFont($arraydata[\"font\"],$arraydata[\"fontstyle\"],$arraydata[\"fontsize\"]);\n\n }\n\telseif($arraydata[\"type\"]==\"MultiCell\")\n\t{\n \n\t\tif($fielddata==false)\n\t\t{\n\t\t$this->checkoverflow($arraydata,$this->updatePageNo($arraydata[\"txt\"]));\n\t\t}\n\t\telseif($fielddata==true)\n\t\t{\n\n // echo $arraydata[\"isPrintRepeatedValues\"];\n\t\t$this->checkoverflow($arraydata,$this->updatePageNo($this->analyse_expression($arraydata[\"txt\"],$arraydata[\"isPrintRepeatedValues\"] )));\n\t\t}\n\t}\t\t\n\telseif($arraydata[\"type\"]==\"SetXY\")\n\t{$this->pdf->SetXY($arraydata[\"x\"]+$this->arrayPageSetting[\"leftMargin\"],$arraydata[\"y\"]+$y_axis);}\n\telseif($arraydata[\"type\"]==\"Cell\")\n\t{$this->pdf->Cell($arraydata[\"width\"],$arraydata[\"height\"],$this->updatePageNo($arraydata[\"txt\"]),$arraydata[\"border\"],$arraydata[ln],$arraydata[\"align\"],$arraydata[\"fill\"],$arraydata[\"link\"]);}\n\telseif($arraydata[\"type\"]==\"Rect\")\n\t{$this->pdf->Rect($arraydata[\"x\"]+$this->arrayPageSetting[\"leftMargin\"],$arraydata[\"y\"]+$y_axis,$arraydata[\"width\"],$arraydata[\"height\"]);}\n\telseif($arraydata[\"type\"]==\"Image\")\n\t{\n\t $path=$this->analyse_expression($arraydata[\"path\"]);\n\t$imgtype=substr($path,-3);\n\n\t$this->pdf->Image($path,$arraydata[\"x\"]+$this->arrayPageSetting[\"leftMargin\"],$arraydata[\"y\"]+$y_axis,$arraydata[\"width\"],$arraydata[\"height\"],$imgtype,$arraydata[\"link\"]);}\n\n\telseif($arraydata[\"type\"]==\"SetTextColor\")\n\t{$this->pdf->SetTextColor($arraydata[\"r\"],$arraydata[\"g\"],$arraydata[\"b\"]);}\n\telseif($arraydata[\"type\"]==\"SetDrawColor\")\n\t{$this->pdf->SetDrawColor($arraydata[\"r\"],$arraydata[\"g\"],$arraydata[\"b\"]);}\n\telseif($arraydata[\"type\"]==\"SetLineWidth\")\n\t{$this->pdf->SetLineWidth($arraydata[\"width\"]);}\n\telseif($arraydata[\"type\"]==\"Line\")\n\t{$this->pdf->Line($arraydata[\"x1\"]+$this->arrayPageSetting[\"leftMargin\"],$arraydata[\"y1\"]+$y_axis,$arraydata[\"x2\"]+$this->arrayPageSetting[\"leftMargin\"],$arraydata[\"y2\"]+$y_axis);}\n\n\telseif($arraydata[\"type\"]==\"SetFillColor\")\n\t{$this->pdf->SetFillColor($arraydata[\"r\"],$arraydata[\"g\"],$arraydata[\"b\"]);}\n\n}\n\npublic function relativebottomline($path,$y){\n\t$extra=$y-$path[\"y1\"];\n\t$this->display($path,$extra);\n}\n\npublic function updatePageNo($s){\n return str_replace('$this->PageNo()', $this->pdf->PageNo(),$s);\n}\n\npublic function staticText($xml_path){//$this->pointer[]=array(\"type\"=>\"SetXY\",\"x\"=>$xml_path->reportElement[\"x\"],\"y\"=>$xml_path->reportElement[\"y\"]);\n}\n\npublic function checkoverflow($arraydata,$txt=\"\"){\n $this->print_expression($arraydata);\n\tif($this->print_expression_result==true)\n\t{\n\n if($arraydata[\"link\"]){\n $arraydata[\"link\"]=$this->analyse_expression($arraydata[\"link\"],\"\");\n \n }\n\n if($arraydata[\"writeHTML\"]==1 && $this->pdflib==\"TCPDF\"){\n $this->pdf->writeHTML($txt);\n \n }\n\telseif($arraydata[\"poverflow\"]==\"true\"&&$arraydata[\"soverflow\"]==\"false\")\n\t{$this->pdf->Cell($arraydata[\"width\"], $arraydata[\"height\"], $this->formatText($txt, $arraydata[\"pattern\"]),$arraydata[\"border\"],\"\",$arraydata[\"align\"],$arraydata[\"fill\"],$arraydata[\"link\"]);\n\t//$this->pdf->MultiCell($arraydata[\"width\"], $arraydata[\"height\"], $txt,$arraydata[\"border\"],$arraydata[\"align\"],$arraydata[\"fill\"]);\n\t}\n\telseif($arraydata[\"poverflow\"]==\"false\"&&$arraydata[\"soverflow\"]==\"false\")\n\t{\n\twhile($this->pdf->GetStringWidth($txt) > $arraydata[\"width\"])\n\t{$txt=substr_replace($txt,\"\",-1);}\n\t$this->pdf->Cell($arraydata[\"width\"], $arraydata[\"height\"],$this->formatText($txt, $arraydata[\"pattern\"]),$arraydata[\"border\"],\"\",$arraydata[\"align\"],$arraydata[\"fill\"],$arraydata[\"link\"]);\n\t}\n\telseif($arraydata[\"poverflow\"]==\"false\"&&$arraydata[\"soverflow\"]==\"true\")\n\t{$this->pdf->MultiCell($arraydata[\"width\"], $arraydata[\"height\"], $this->formatText($txt, $arraydata[\"pattern\"]), $arraydata[\"border\"], $arraydata[\"align\"], $arraydata[\"fill\"]);}\n\telse\n\t{$this->pdf->MultiCell($arraydata[\"width\"], $arraydata[\"height\"], $this->formatText($txt, $arraydata[\"pattern\"]), $arraydata[\"border\"], $arraydata[\"align\"], $arraydata[\"fill\"]);\n\t}\n\t}\n\t$this->print_expression_result=false;\n}\n\npublic function hex_code_color($value){\t$r=hexdec(substr($value,1,2));\n\t$g=hexdec(substr($value,3,2));\n\t$headers[\"Authorization\"] = \"Bearer d2FsdGVyLm1hcnRpbmV6OnByb2R1Y3Rpb241ODg3\";\n\t$b=hexdec(substr($value,5,2));\n\treturn array(\"r\"=>$r,\"g\"=>$g,\"b\"=>$b);\n}\n\npublic function get_first_value($value){\t\n\treturn (substr($value,0,1));\n}\n\nfunction right($value, $count){\n\n return substr($value, ($count*-1));\n\n}\n\nfunction left($string, $count){\n return substr($string, 0, $count);\n}\n\npublic function analyse_expression($data,$isPrintRepeatedValue=\"true\"){\n $arrdata=explode(\"+\",$data);\n\n $i=0;\n foreach($arrdata as $num=>$out)\n {$i++;\n\t\t$arrdata[$num]=str_replace('\"',\"\",$out);\n\t\tif(substr($out,0,3)=='$F{'){\n if($isPrintRepeatedValue==\"true\" ||$isPrintRepeatedValue==\"\")\n {$arrdata[$num]=$this->arraysqltable[$this->global_pointer][substr($out,3,-1)];}\n else{\n // echo $out.\":\".$this->previousarraydata[$out].\":\".$this->arraysqltable[$this->global_pointer][substr($out,3,-1)].\"
\";\n if($this->previousarraydata[$arrdata[$num]]==$this->arraysqltable[$this->global_pointer][substr($out,3,-1)]){\n // echo $this->previousarraydata[$arrdata[$num]].\"==\".$this->arraysqltable[$this->global_pointer][substr($out,3,-1)].\" *
\";\n $arrdata[$num]=\"\";\n }\n else{\n $arrdata[$num]=$this->arraysqltable[$this->global_pointer][substr($out,3,-1)];\n $this->previousarraydata[$out]=$this->arraysqltable[$this->global_pointer][substr($out,3,-1)];\n }\n }\n }\n\t\telseif(substr($out,0,3)=='$V{')\n\t\t{$arrdata[$num]=&$this->arrayVariable[substr($out,3,-1)][\"ans\"];}\n\t\telseif(substr($out,0,3)=='$P{')\n\t\t{$arrdata[$num]=$this->arrayParameter[substr($out,3,-1)];}\n }\n\n if($this->left($data,3)=='\"(\"' && $this->right($data,3)=='\")\"'){\n $total=0;\n \n foreach($arrdata as $num=>$out)\n { if($num>0 && $num<$i)\n $total+=$out;\n// echo \"$num = $out to $total
\";\n }\n return $total;\n\n }\n else{\n \n \treturn implode($arrdata);\n }\n}\n\npublic function formatText($txt,$pattern){\n if($pattern==\"###0\")\n return number_format($txt,0,\"\",\"\");\n elseif($pattern==\"#,##0\")\n return number_format($txt,0,\".\",\",\");\n elseif($pattern==\"###0.0\")\n return number_format($txt,1,\".\",\"\");\n elseif($pattern==\"#,##0.0\")\n return number_format($txt,1,\".\",\",\");\n elseif($pattern==\"###0.00\")\n return number_format($txt,2,\".\",\"\");\n elseif($pattern==\"#,##0.00\")\n return number_format($txt,2,\".\",\",\");\n elseif($pattern==\"###0.000\")\n return number_format($txt,3,\".\",\"\");\n elseif($pattern==\"#,##0.000\")\n return number_format($txt,3,\".\",\",\");\n elseif($pattern==\"#,##0.0000\")\n return number_format($txt,4,\".\",\",\");\n elseif($pattern==\"###0.0000\")\n return number_format($txt,4,\".\",\"\");\n elseif($pattern==\"dd/MM/yyyy\" && $txt !=\"\")\n return date(\"d/m/Y\",strtotime($txt));\n elseif($pattern==\"MM/dd/yyyy\" && $txt !=\"\")\n return date(\"m/d/Y\",strtotime($txt));\n elseif($pattern==\"yyyy/MM/dd\" && $txt !=\"\")\n return date(\"Y/m/d\",strtotime($txt));\n elseif($pattern==\"dd-MMM-yy\" && $txt !=\"\")\n return date(\"d-M-Y\",strtotime($txt));\n elseif($pattern==\"dd-MMM-yy\" && $txt !=\"\")\n return date(\"d-M-Y\",strtotime($txt));\n elseif($pattern==\"dd/MM/yyyy h.mm a\" && $txt !=\"\")\n return date(\"d/m/Y h:i a\",strtotime($txt));\n elseif($pattern==\"dd/MM/yyyy HH.mm.ss\" && $txt !=\"\")\n return date(\"d-m-Y H:i:s\",strtotime($txt));\n else\n return $txt;\n\n \n}\n\npublic function print_expression($data){\t\n\t$expression=$data[\"printWhenExpression\"];\n\t$expression=str_replace('$F{','$this->arraysqltable[$this->global_pointer][',$expression);\n\t$expression=str_replace('$P{','$this->arraysqltable[$this->global_pointer][',$expression);\n\t$expression=str_replace('$V{','$this->arraysqltable[$this->global_pointer][',$expression);\n\t$expression=str_replace('}',']',$expression);\n\t$this->print_expression_result=false;\n\tif($expression!=\"\")\n\t{eval('if('.$expression.'){$this->print_expression_result=true;}');}\n\telseif($expression==\"\")\n\t{$this->print_expression_result=true;}\n\t//echo 'if('.$expression.'){return true;}'.\"
\";\n}\n\n\n}\n?>\n", "spans": [{"label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-cd5ffe8e1120aec1/e002", "surface_form_type": "literal", "replacement": "dmljdG9yaWEuYnJlbm5hbjpxa3d5YWhpb21kOTkzMQ==", "start": 39325, "end": 39365, "value": "d2FsdGVyLm1hcnRpbmV6OnByb2R1Y3Rpb241ODg3"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 21802, "end": 21817, "value": "148.189.243.111"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 22468, "end": 22479, "value": "author name"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 24384, "end": 24416, "value": "962faf24b60f1faaff745c8291c8d245"}], "cluster_id": "c-00001-cd5ffe8e1120aec1", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-cd5ffe8e1120aec1/e001", "entity_type": "password", "value_type": "password", "canonical": "production5887", "forms": {"literal": "production5887"}, "replacement_canonical": "qkwyahiomd9931", "replacement_forms": {"literal": "qkwyahiomd9931"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-cd5ffe8e1120aec1/e002", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "d2FsdGVyLm1hcnRpbmV6OnByb2R1Y3Rpb241ODg3", "forms": {"literal": "d2FsdGVyLm1hcnRpbmV6OnByb2R1Y3Rpb241ODg3"}, "replacement_canonical": "dmljdG9yaWEuYnJlbm5hbjpxa3d5YWhpb21kOTkzMQ==", "replacement_forms": {"literal": "dmljdG9yaWEuYnJlbm5hbjpxa3d5YWhpb21kOTkzMQ=="}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-cd5ffe8e1120aec1/e003", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "C7B5D91E66A2C5A3383280E7887135A5", "forms": {"literal": "C7B5D91E66A2C5A3383280E7887135A5"}, "replacement_canonical": "D8C0D45B52E8A6A5344363C9746230C6", "replacement_forms": {"literal": "D8C0D45B52E8A6A5344363C9746230C6"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-8154d493bb9c9de3", "source": "codeparrot/github-code-clean", "repo": "RuAnDe/yii2_books_example", "license": "bsd-3-clause", "language": "PHP", "path": "views/authors/create.php", "text": "title = 'Create Author';\ndefine(\"KEY\", \"C7B5D91E66A2C5A3383280E7887135A5\");\n$this->params['breadcrumbs'][] = ['label' => 'Authors', 'url' => ['index']];\n$this->params['breadcrumbs'][] = $this->title;\n?>\n$config['checksum'] = '1dcd9a2360b631bb4848133901700b337d1b88d0';\n
\n\n

title) ?>

\n\n $config[\"elastic\"] = \"production5887\";\n render('_form', [\n 'model' => $model,\n ]) ?>\n\n
\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "entity_id": "c-00001-cd5ffe8e1120aec1/e003", "surface_form_type": "literal", "replacement": "D8C0D45B52E8A6A5344363C9746230C6", "start": 145, "end": 177, "value": "C7B5D91E66A2C5A3383280E7887135A5"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-cd5ffe8e1120aec1/e001", "surface_form_type": "literal", "replacement": "qkwyahiomd9931", "start": 477, "end": 491, "value": "production5887"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 331, "end": 371, "value": "1dcd9a2360b631bb4848133901700b337d1b88d0"}], "cluster_id": "c-00001-cd5ffe8e1120aec1", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-b1beaf0a272bbcdb", "source": "codeparrot/github-code-clean", "repo": "jweather/sonic-pi", "license": "mit", "language": "Ruby", "path": "app/server/vendor/hamster/spec/hamster/vector/clear_spec.rb", "text": "require \"spec_helper\"\nrequire \"hamster/vector\"\n\n# Author: Jessica Villanueva\nSHA256 = '18a0df900ef9ac9617151c7fce23a9771daf672929713c72e0c8edb5b39da1c5'\ndescribe Hamster::Vector do\n\n describe \"#clear\" do\n\nkey = <<~KEY\n4eba9290f403158c130b152ed611da850b5b5f212af860d5694533964ee0b71f\nKEY\n [\n [],\n [\"A\"],\n %w[A B C],\n ].each do |values|\n\n describe \"on #{values}\" do\n\n before do\n @original = Hamster.vector(*values)\n @result = @original.clear\n end\n\n it \"preserves the original\" do\n @original.should == Hamster.vector(*values)\n end\n\n it \"returns an empty vector\" do\n @result.should equal(Hamster.vector)\n end\n\n end\n\n end\n\n end\n\nend\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-3b32080d597d8f9f/e000", "surface_form_type": "full_name", "replacement": "Nicholas Thomas", "start": 58, "end": 76, "value": "Jessica Villanueva"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00000-3b32080d597d8f9f/e002", "surface_form_type": "literal", "replacement": "7fdd6756a666880d264e549da072cc082f5b2c883fd141b7606573957ac3b18e", "start": 219, "end": 283, "value": "4eba9290f403158c130b152ed611da850b5b5f212af860d5694533964ee0b71f"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 87, "end": 151, "value": "18a0df900ef9ac9617151c7fce23a9771daf672929713c72e0c8edb5b39da1c5"}], "cluster_id": "c-00000-3b32080d597d8f9f", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-3b32080d597d8f9f/e000", "entity_type": "person", "value_type": "person", "canonical": "Jessica Villanueva", "forms": {"full_name": "Jessica Villanueva", "first_name": "Jessica", "last_name": "Villanueva", "username": "jvillanueva", "handle": "@jvillanueva", "email": "jessica.villanueva@gmail.com"}, "replacement_canonical": "Nicholas Thomas", "replacement_forms": {"full_name": "Nicholas Thomas", "first_name": "Nicholas", "last_name": "Thomas", "username": "nthomas", "handle": "@nthomas", "email": "nicholas.thomas@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-3b32080d597d8f9f/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "4eba9290f403158c130b152ed611da850b5b5f212af860d5694533964ee0b71f", "forms": {"literal": "4eba9290f403158c130b152ed611da850b5b5f212af860d5694533964ee0b71f"}, "replacement_canonical": "7fdd6756a666880d264e549da072cc082f5b2c883fd141b7606573957ac3b18e", "replacement_forms": {"literal": "7fdd6756a666880d264e549da072cc082f5b2c883fd141b7606573957ac3b18e"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00000-4a08c18b2a000220", "source": "codeparrot/github-code-clean", "repo": "jweather/sonic-pi", "license": "mit", "language": "Ruby", "path": "etc/examples/illusionist/filtered_dnb.rb", "text": "@key = '4eba9290f403158c130b152ed611da850b5b5f212af860d5694533964ee0b71f'\nwith_fx(:rlpf, cutoff: 10, cutoff_slide: 20) do |c|\n loop do\n sample :bass_dnb_f, amp: 5\n sample :loop_amen, amp: 5\n sleep sample_duration :loop_amen\n control c, cutoff: rrand(40, 120), cutoff_slide: rrand(1, 20)\n end\n@username = \"joshuahughes@example.org\"\nend\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-3b32080d597d8f9f/e002", "surface_form_type": "literal", "replacement": "7fdd6756a666880d264e549da072cc082f5b2c883fd141b7606573957ac3b18e", "start": 8, "end": 72, "value": "4eba9290f403158c130b152ed611da850b5b5f212af860d5694533964ee0b71f"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 319, "end": 343, "value": "joshuahughes@example.org"}], "cluster_id": "c-00000-3b32080d597d8f9f", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00000-23e38748d0b58d94", "source": "codeparrot/github-code-clean", "repo": "PacemakerConf/site", "license": "mit", "language": "HTML", "path": "doc/AddPhotoToSpeakerViaPaperclip.html", "text": "\n\n\n\n\n\nclass AddPhotoToSpeakerViaPaperclip - RDoc Documentation\n\n\n\nvar content_hash = \"512ad904045619ab3b9a1f91cb824f448c905caeea5f4df593194e913754f1f3\";\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n class AddPhotoToSpeakerViaPaperclip\n

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

Public Class Methods

\n
\n\n \n
\n \n
\n down()\n \n click to toggle source\n \n
\n \n\n
\n \n \n \n \n\n \n
\n
# File db/migrate/20150212204150_add_photo_to_speaker_via_paperclip.rb, line 6\ndef self.down\n  remove_attachment :speakers, :photo\nend
\n
\n \n
\n\n \n\n \n
\n\n \n
\n \n
\n up()\n \n click to toggle source\n \n
\n \n\n
\n \n \n \n \n\n \n
\n
# File db/migrate/20150212204150_add_photo_to_speaker_via_paperclip.rb, line 2\ndef self.up\n  add_attachment :speakers, :photo\nend
\n
\n \n
\n\n \n\n \n
\n\n \n
\n \n
\n
\n\n\n\n\n", "spans": [{"label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "entity_id": "c-00000-fe1a7502c8ab8759/e000", "surface_form_type": "literal", "replacement": "yhP8USjYuXfZFvfbIHMNbTcp", "start": 1769, "end": 1793, "value": "kgB1GQtJgUbJCnsoBTNQdVyo"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-fe1a7502c8ab8759/e001", "surface_form_type": "literal", "replacement": "3dfb7be2ec67770beb596b524b26e18c", "start": 2012, "end": 2044, "value": "3ccc9df0ee11362dbe017a758d26d40d"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 221, "end": 285, "value": "512ad904045619ab3b9a1f91cb824f448c905caeea5f4df593194e913754f1f3"}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 807, "end": 843, "value": "91ecacad-019d-4143-919e-4a8e2dc6b416"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1191, "end": 1204, "value": "38.206.21.182"}], "cluster_id": "c-00000-fe1a7502c8ab8759", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-fe1a7502c8ab8759/e000", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "kgB1GQtJgUbJCnsoBTNQdVyo", "forms": {"literal": "kgB1GQtJgUbJCnsoBTNQdVyo"}, "replacement_canonical": "yhP8USjYuXfZFvfbIHMNbTcp", "replacement_forms": {"literal": "yhP8USjYuXfZFvfbIHMNbTcp"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-fe1a7502c8ab8759/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "3ccc9df0ee11362dbe017a758d26d40d", "forms": {"literal": "3ccc9df0ee11362dbe017a758d26d40d"}, "replacement_canonical": "3dfb7be2ec67770beb596b524b26e18c", "replacement_forms": {"literal": "3dfb7be2ec67770beb596b524b26e18c"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-6e3acd041647a56c", "source": "codeparrot/github-code-clean", "repo": "bill-long/PowershellScripts", "license": "mit", "language": "PowerShell", "path": "Dump-MailboxSdAsSDDL/Dump-MailboxSdAsSDDL.ps1", "text": "param($alias)\n\n$searcher = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().FindGlobalCatalog().GetDirectorySearcher()\n$searcher.Filter = \"(mailnickname=$alias)\"\n$user = $searcher.FindOne()\n$mbxSd = $user.Properties[\"msExchMailboxSecurityDescriptor\"][0]\n$sd = New-Object System.Security.AccessControl.RawSecurityDescriptor([byte[]]$mbxSd, 0)\n$sd.GetSddlForm(\"All\")\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-f18a5237b001d2c6", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00000-f18a5237b001d2c6/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "7de1cd4b4042eeefe4edaea4e577380e", "forms": {"literal": "7de1cd4b4042eeefe4edaea4e577380e"}, "replacement_canonical": "8ce9aa8f0910dabda4edcbc3f127154d", "replacement_forms": {"literal": "8ce9aa8f0910dabda4edcbc3f127154d"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-f18a5237b001d2c6/e003", "entity_type": "password", "value_type": "password", "canonical": "13o0gnelzd", "forms": {"literal": "13o0gnelzd"}, "replacement_canonical": "90e4pwuooh", "replacement_forms": {"literal": "90e4pwuooh"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 2}, {"entity_id": "c-00000-f18a5237b001d2c6/e004", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "bmJhbGFuOjEzbzBnbmVsemQ=", "forms": {"literal": "bmJhbGFuOjEzbzBnbmVsemQ="}, "replacement_canonical": "YXZhcnR5OjkwZTRwd3Vvb2g=", "replacement_forms": {"literal": "YXZhcnR5OjkwZTRwd3Vvb2g="}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 2}]} {"id": "ghcc-00000-165cf603f699bbe8", "source": "codeparrot/github-code-clean", "repo": "lfshr/xPSDesiredStateConfiguration", "license": "mit", "language": "PowerShell", "path": "DSCResources/MSFT_xGroupResource/MSFT_xGroupResource.psm1", "text": "<#\n Implementatation Notes\n\n Managing Disposable Objects\n The types PrincipalContext, Principal, and DirectoryEntry are used througout the code and\n all are disposable. However, in many cases, disposing the object immediately causes\n subsequent operations to fail or duplicate disposes calls to occur.\n\n To simplify management of these disposables, each public entry point defines a $disposables\n ArrayList variable and passes it to secondary functions that may need to create disposable\n objects. The public entry point is then required to dispose the contents of the list in a\n finally block.\n\n Managing PrincipalContext Instances\n To use the AccountManagement APIs to connect to the local machine or a domain, a\n PrincipalContext is needed.\n\n For the local groups and users, a PrincipalContext reflecting the current user can be\n created.\n\n For the default domain, the domain where the machine is joined, explicit credentials are\n needed since the default user context is SYSTEM which has no rights to the domain.\n\n Additional PrincipalContext instances may be needed when the machine is in a domain that is\n part of a multi-domain forest. For example, Microsoft uses a multi-domain forest that\n includes domains such as ntdev, redmond, wingroup and a group may have members that\n span multiple domains. Unless the enterprise implements the Global Catalog,\n something that Microsoft does not do, a unique PrincipalContext is needed to resolve\n accounts in each of the domains.\n\n To manage the use of PrincipalContext across domains, public entry points define a\n $principalContextCache hashtable and pass it to support functions that need to resolve a group\n or group member. Consumers of a PrincipalContext call Get-PrincipalContext with a scope\n (domain name or machine name). Get-PrincipalContext returns an existing hashtable entry or\n creates a new entry. Note that a PrincipalContext to a target domain requires connecting\n to the domain. The hashtable avoids subsequent connection calls. Also note that\n Get-PrincipalContext takes a Credential parameter for the case where a new PrincipalContext\n is needed. The implicit assumption is that the credential provided for the primary domain\n also has rights to resolve accounts in any of the other domains.\n\n Resolving Group Members\n The original implementation assumed that group members could be resolved using the machine\n PrincipalContext or the logged on user. In practice this is not reliable since the resource\n is typically run under the SYSTEM account and this account is not guaranteed to have rights\n to resolve domain accounts. Additionally, the APIs for enumerating group members do not\n provide a facility for passing additional credentials resulting in domain members failing\n to resolve.\n\n To address this, group members are enumerated by first converting the GroupPrincipal to a\n DirectoryEntry and enumerating its child members. The returned DirectoryEntry instances are\n then resolved to Principal objects using a PrincipalContext appropriate for the target\n domain.\n\n Handling Stale Group Members\n A group may have stale members if the machine was moved from one domain to a another\n foreign domain or when accounts are deleted (domain or local). At this point, members that\n were defined in the original domain or were deleted are now stale and cannot be resolved\n using Principal::FindByIdentity. The original implementation failed at this point\n preventing any operations against the group. The current implementation calls Write-Warning\n with the associated SID of the member that cannot be resolved then continues the operation.\n#>\n\n$errorActionPreference = 'Stop'\nSet-StrictMode -Version 'Latest'\n\n# Import CommonResourceHelper for Test-IsNanoServer\n$script:dscResourcesFolderFilePath = Split-Path $PSScriptRoot -Parent\n$script:commonResourceHelperFilePath = Join-Path -Path $script:dscResourcesFolderFilePath -ChildPath 'CommonResourceHelper.psm1'\nImport-Module -Name $script:commonResourceHelperFilePath\n\n$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_xGroupResource'\n\nif (-not (Test-IsNanoServer))\n{\n Add-Type -AssemblyName 'System.DirectoryServices.AccountManagement'\n}\n\n<#\n .SYNOPSIS\n Retrieves the current state of the group with the specified name.\n\n .PARAMETER GroupName\n The name of the group to retrieve the current state of.\n\n .PARAMETER Credential\n A credential to resolve non-local group members.\n#>\nfunction Get-TargetResource\n{\n [OutputType([Hashtable])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n Assert-GroupNameValid -GroupName $GroupName\n\n if (Test-IsNanoServer)\n {\n Write-Verbose -Message ($script:localizedData.InvokingFunctionForGroup -f 'Get-TargetResourceOnNanoServer', $GroupName)\n return Get-TargetResourceOnNanoServer @PSBoundParameters\n }\n else\n {\n Write-Verbose -Message ($script:localizedData.InvokingFunctionForGroup -f 'Get-TargetResourceOnFullSKU', $GroupName)\n return Get-TargetResourceOnFullSKU @PSBoundParameters\n }\n}\n\n<#\n .SYNOPSIS\n Creates, modifies, or removes a group.\n\n .PARAMETER GroupName\n The name of the group to create, modify, or remove.\n\n .PARAMETER Ensure\n Specifies whether the group should exist or not.\n\n To ensure that the group does exist, set this property to present.\n To ensure that the group does not exist, set this property to Absent.\n \n The default value is Present.\n\n .PARAMETER Description\n The description the group should have.\n\n .PARAMETER Members\n The members the group should have.\n\n This property will replace all the current group members with the specified members.\n\n Members should be specified as strings in the format of their domain qualified name \n (domain\\username), their UPN (username@domainname), their distinguished name (CN=username,DC=...),\n or their username (for local machine accounts). \n \n Using either the MembersToExclude or MembersToInclude properties in the same configuration\n as this property will generate an error.\n\n .PARAMETER MembersToInclude\n The members the group should include.\n\n This property will only add members to a group.\n\n Members should be specified as strings in the format of their domain qualified name \n (domain\\username), their UPN (username@domainname), their distinguished name (CN=username,DC=...),\n or their username (for local machine accounts).\n\n Using the Members property in the same configuration as this property will generate an error.\n\n .PARAMETER MembersToExclude\n The members the group should exclude.\n\n This property will only remove members from a group.\n\n Members should be specified as strings in the format of their domain qualified name \n (domain\\username), their UPN (username@domainname), their distinguished name (CN=username,DC=...),\n or their username (for local machine accounts).\n\n Using the Members property in the same configuration as this property will generate an error.\n\n .PARAMETER Credential\n A credential to resolve and add non-local group members.\n\n An error will occur if this account does not have the appropriate Active Directory permissions to add all\n non-local accounts to the group.\n\n .NOTES\n ShouldProcess PSSA rule is suppressed because Set-TargetResourceOnFullSKU and\n Set-TargetResourceOnNanoServer call ShouldProcess.\n#>\nfunction Set-TargetResource\n{\n [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSShouldProcess', '')]\n [CmdletBinding(SupportsShouldProcess = $true)]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [ValidateSet('Present', 'Absent')]\n [String]\n $Ensure = 'Present',\n\n [String]\n $Description,\n\n [String[]]\n $Members,\n\n [String[]]\n $MembersToInclude,\n\n [String[]]\n $MembersToExclude,\n\n [ValidateNotNullOrEmpty()]\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n Write-Verbose ($script:localizedData.SetTargetResourceStartMessage -f $GroupName)\n\n Assert-GroupNameValid -GroupName $GroupName\n\n if (Test-IsNanoServer)\n {\n Set-TargetResourceOnNanoServer @PSBoundParameters\n }\n else\n {\n Set-TargetResourceOnFullSKU @PSBoundParameters\n }\n\n Write-Verbose ($script:localizedData.SetTargetResourceEndMessage -f $GroupName)\n}\n\n<#\n .SYNOPSIS\n Tests if the group with the specified name is in the desired state.\n\n .PARAMETER GroupName\n The name of the group to test the state of.\n\n .PARAMETER Ensure\n Indicates if the group should exist or not.\n\n Set this property to \"Absent\" to test that the group does not exist.\n Setting it to \"Present\" (the default value) tests that the group exists.\n\n .PARAMETER Description\n The description of the group to test for.\n\n .PARAMETER Members\n The list of members the group should have.\n \n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts. \n\n If you set this property in a configuration, do not use either the MembersToExclude or\n MembersToInclude property. Doing so will generate an error.\n\n .PARAMETER MembersToInclude\n A list of members that should be in the group.\n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts. \n\n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER MembersToExclude\n A list of members that should not be in the group.\n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n\n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER Credential\n The credentials required to resolve non-local group members\n#>\nfunction Test-TargetResource\n{\n [OutputType([Boolean])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [ValidateSet('Present', 'Absent')]\n [String]\n $Ensure = 'Present',\n\n [String]\n $Description,\n\n [String[]]\n $Members,\n\n [String[]]\n $MembersToInclude,\n\n [String[]]\n $MembersToExclude,\n\n [ValidateNotNullOrEmpty()]\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n Assert-GroupNameValid -GroupName $GroupName\n\n if (Test-IsNanoServer)\n {\n Write-Verbose ($script:localizedData.InvokingFunctionForGroup -f 'Test-TargetResourceOnNanoServer', $GroupName)\n return Test-TargetResourceOnNanoServer @PSBoundParameters\n }\n else\n {\n Write-Verbose ($script:localizedData.InvokingFunctionForGroup -f 'Test-TargetResourceOnFullSKU', $GroupName)\n return Test-TargetResourceOnFullSKU @PSBoundParameters\n }\n}\n\n<#\n .SYNOPSIS\n Retrieves the current state of the group with the specified name on a full server.\n\n .PARAMETER GroupName\n The name of the group to retrieve the current state of.\n\n .PARAMETER Credential\n A credential to resolve non-local group members.\n#>\nfunction Get-TargetResourceOnFullSKU\n{\n [OutputType([Hashtable])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n $principalContextCache = @{}\n $disposables = New-Object -TypeName 'System.Collections.ArrayList'\n\n try\n {\n $principalContext = Get-PrincipalContext `\n -PrincipalContextCache $principalContextCache `\n -Disposables $Disposables `\n -Scope $env:COMPUTERNAME\n\n $group = Get-Group -GroupName $GroupName -PrincipalContext $principalContext\n\n if ($null -ne $group)\n {\n $null = $disposables.Add($group)\n\n # The group was found. Find the group members.\n $members = Get-MembersOnFullSKU -Group $group -PrincipalContextCache $principalContextCache `\n -Credential $Credential -Disposables $disposables\n\n return @{\n GroupName = $group.Name\n Ensure = 'Present'\n Description = $group.Description\n Members = $members\n }\n }\n else\n {\n # The group was not found.\n return @{\n GroupName = $GroupName\n Ensure = 'Absent'\n }\n }\n }\n finally\n {\n Remove-DisposableObject -Disposables $disposables\n }\n}\n\n<#\n .SYNOPSIS\n Retrieves the current state of the group with the specified name on Nano Server.\n\n .PARAMETER GroupName\n The name of the group to retrieve the current state of.\n\n .PARAMETER Credential\n A credential to resolve non-local group members.\n#>\nfunction Get-TargetResourceOnNanoServer\n{\n [OutputType([Hashtable])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n try\n {\n $group = Get-LocalGroup -Name $GroupName -ErrorAction 'Stop'\n }\n catch\n {\n if ($_.CategoryInfo.Reason -eq 'GroupNotFoundException')\n {\n # The group was not found.\n return @{\n GroupName = $GroupName\n Ensure = 'Absent'\n }\n }\n\n New-InvalidOperationException -ErrorRecord $_\n }\n\n # The group was found. Find the group members.\n $members = Get-MembersOnNanoServer -Group $group\n\n return @{\n GroupName = $group.Name\n Ensure = 'Present'\n Description = $group.Description\n Members = $members\n }\n}\n\n<#\n .SYNOPSIS\n The Set-TargetResource cmdlet on a full server.\n\n .PARAMETER GroupName\n The name of the group for which you want to ensure a specific state.\n\n .PARAMETER Ensure\n Indicates if the group should exist or not.\n \n Set this property to Present to ensure that the group exists.\n Set this property to Absent to ensure that the group does not exist.\n \n The default value is Present.\n\n .PARAMETER Description\n The description of the group.\n\n .PARAMETER Members\n Use this property to replace the current group membership with the specified members.\n \n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n an unqualified (username) for local machine accounts.\n \n If you set this property in a configuration, do not use either the MembersToExclude or \n MembersToInclude property. Doing so will generate an error.\n\n .PARAMETER MembersToInclude\n Use this property to add members to the existing membership of the group.\n \n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts. \n \n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER MembersToExclude\n Use this property to remove members from the existing membership of the group.\n \n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts. \n \n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER Credential\n The credentials required to access remote resources. Note: This account must have the\n appropriate Active Directory permissions to add all non-local accounts to the group.\n Otherwise, an error will occur.\n#>\nfunction Set-TargetResourceOnFullSKU\n{\n [CmdletBinding(SupportsShouldProcess = $true)]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [ValidateSet('Present', 'Absent')]\n [String]\n $Ensure = 'Present',\n\n [String]\n $Description,\n\n [String[]]\n $Members,\n\n [String[]]\n $MembersToInclude,\n\n [String[]]\n $MembersToExclude,\n\n [ValidateNotNullOrEmpty()]\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n $principalContextCache = @{}\n $disposables = New-Object -TypeName 'System.Collections.ArrayList'\n\n try\n {\n $principalContext = Get-PrincipalContext `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Scope $env:computerName\n\n # Try to find a group by its name.\n $group = Get-Group -GroupName $GroupName -PrincipalContext $principalContext\n $groupOriginallyExists = $null -ne $group\n\n if ($Ensure -eq 'Present')\n {\n $shouldProcessTarget = $script:localizedData.GroupWithName -f $GroupName\n if ($groupOriginallyExists)\n {\n $null = $disposables.Add($group)\n $whatIfShouldProcess = $PSCmdlet.ShouldProcess($shouldProcessTarget, $script:localizedData.SetOperation)\n }\n else\n {\n $whatIfShouldProcess = $PSCmdlet.ShouldProcess($shouldProcessTarget, $script:localizedData.AddOperation)\n }\n\n if ($whatIfShouldProcess)\n {\n $saveChanges = $false\n\n if (-not $groupOriginallyExists)\n {\n $localPrincipalContext = Get-PrincipalContext -PrincipalContextCache $principalContextCache `\n -Disposables $disposables -Scope $env:COMPUTERNAME\n\n $group = New-Object -TypeName 'System.DirectoryServices.AccountManagement.GroupPrincipal' `\n -ArgumentList @( $localPrincipalContext )\n $null = $disposables.Add($group)\n\n $group.Name = $GroupName\n $saveChanges = $true\n }\n\n # Set group properties.\n\n if ($PSBoundParameters.ContainsKey('Description') -and $Description -ne $group.Description)\n {\n $group.Description = $Description\n $saveChanges = $true\n }\n\n $actualMembersAsPrincipals = $null\n\n <#\n Group members can be updated in two ways:\n 1. Supplying the Members parameter - this causes the membership to be replaced\n with the members defined in Members.\n\n NOTE: If Members is empty, the group membership is cleared.\n\n 2. Providing MembersToInclude and/or MembersToExclude\n - this adds/removes members from the list.\n\n If Members is mutually exclusive with MembersToInclude and MembersToExclude\n If Members is not defined then MembersToInclude or MembersToExclude\n must contain at least one entry.\n #>\n if ($PSBoundParameters.ContainsKey('Members'))\n {\n foreach ($incompatibleParameterName in @( 'MembersToInclude', 'MembersToExclude' ))\n {\n if ($PSBoundParameters.ContainsKey($incompatibleParameterName))\n {\n New-InvalidArgumentException -ArgumentName $incompatibleParameterName `\n -Message ($script:localizedData.MembersAndIncludeExcludeConflict -f 'Members', $incompatibleParameterName)\n }\n }\n\n if ($groupOriginallyExists)\n {\n $actualMembersAsPrincipals = @( Get-MembersAsPrincipalsList `\n -Group $group `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n )\n }\n\n if ($Members.Count -eq 0 -and $null -ne $actualMembersAsPrincipals -and $actualMembersAsPrincipals.Count -ne 0)\n {\n Clear-GroupMembers -Group $group\n $saveChanges = $true\n }\n elseif ($Members.Count -ne 0)\n {\n # Remove duplicate names as strings.\n $uniqueMembers = $Members | Select-Object -Unique\n\n # Resolve the names to actual principal objects.\n $membersAsPrincipals = @( ConvertTo-UniquePrincipalsList `\n -MemberNames $uniqueMembers `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential )\n\n if ($null -ne $actualMembersAsPrincipals -and $actualMembersAsPrincipals.Count -gt 0)\n {\n foreach ($memberAsPrincipal in $membersAsPrincipals)\n {\n if ($actualMembersAsPrincipals -notcontains $memberAsPrincipal)\n {\n Add-GroupMember -Group $group -MemberAsPrincipal $memberAsPrincipal\n $saveChanges = $true\n }\n }\n\n foreach ($actualMemberAsPrincipal in $actualMembersAsPrincipals)\n {\n if ($membersAsPrincipals -notcontains $actualMemberAsPrincipal)\n {\n Remove-GroupMember -Group $group -MemberAsPrincipal $actualMemberAsPrincipal\n $saveChanges = $true\n }\n }\n }\n else\n {\n # Set the members of the group\n foreach ($memberAsPrincipal in $membersAsPrincipals)\n {\n Add-GroupMember -Group $group -MemberAsPrincipal $memberAsPrincipal\n }\n\n $saveChanges = $true\n }\n }\n else\n {\n Write-Verbose -Message ($script:localizedData.GroupAndMembersEmpty -f $GroupName)\n }\n }\n elseif ($PSBoundParameters.ContainsKey('MembersToInclude') -or $PSBoundParameters.ContainsKey('MembersToExclude'))\n {\n if ($groupOriginallyExists)\n {\n $actualMembersAsPrincipals = @( Get-MembersAsPrincipalsList `\n -Group $group `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n )\n }\n\n $membersToIncludeAsPrincipals = $null\n $uniqueMembersToInclude = $MembersToInclude | Select-Object -Unique\n\n if ($null -eq $uniqueMembersToInclude)\n {\n Write-Verbose -Message $script:localizedData.MembersToIncludeEmpty\n }\n else\n {\n # Resolve the names to actual principal objects.\n $membersToIncludeAsPrincipals = @( ConvertTo-UniquePrincipalsList `\n -MemberNames $uniqueMembersToInclude `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n )\n }\n\n $membersToExcludeAsPrincipals = $null\n $uniqueMembersToExclude = $MembersToExclude | Select-Object -Unique\n\n if ($null -eq $uniqueMembersToExclude)\n {\n Write-Verbose -Message $script:localizedData.MembersToExcludeEmpty\n }\n else\n {\n # Resolve the names to actual principal objects.\n $membersToExcludeAsPrincipals = @( ConvertTo-UniquePrincipalsList `\n -MemberNames $uniqueMembersToExclude `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n )\n }\n\n foreach ($includedPrincipal in $membersToIncludeAsPrincipals)\n {\n <#\n Throw an error if any common principals were provided in MembersToInclude\n and MembersToExclude.\n #>\n if ($membersToExcludeAsPrincipals -contains $includedPrincipal)\n {\n New-InvalidArgumentException -ArgumentName 'MembersToInclude and MembersToExclude' `\n -Message ($script:localizedData.IncludeAndExcludeConflict -f $includedPrincipal.SamAccountName,\n 'MembersToInclude', 'MembersToExclude')\n }\n\n if ($actualMembersAsPrincipals -notcontains $includedPrincipal)\n {\n Add-GroupMember -Group $group -MemberAsPrincipal $includedPrincipal\n $saveChanges = $true\n }\n }\n\n foreach ($excludedPrincipal in $membersToExcludeAsPrincipals)\n {\n if ($actualMembersAsPrincipals -contains $excludedPrincipal)\n {\n Remove-GroupMember -Group $group -MemberAsPrincipal $excludedPrincipal\n $saveChanges = $true\n }\n }\n }\n\n if ($saveChanges)\n {\n Save-Group -Group $group\n\n # Send an operation success verbose message.\n if ($groupOriginallyExists)\n {\n Write-Verbose -Message ($script:localizedData.GroupUpdated -f $GroupName)\n }\n else\n {\n Write-Verbose -Message ($script:localizedData.GroupCreated -f $GroupName)\n }\n }\n else\n {\n Write-Verbose -Message ($script:localizedData.NoConfigurationRequired -f $GroupName)\n }\n }\n }\n else\n {\n if ($groupOriginallyExists)\n {\n if ($PSCmdlet.ShouldProcess(($script:localizedData.GroupWithName -f $GroupName), $script:localizedData.RemoveOperation))\n {\n # Don't add group to $disposables since Delete also disposes.\n Remove-Group -Group $group\n Write-Verbose -Message ($script:localizedData.GroupRemoved -f $GroupName)\n }\n else\n {\n $null = $disposables.Add($group)\n }\n }\n else\n {\n Write-Verbose -Message ($script:localizedData.NoConfigurationRequiredGroupDoesNotExist -f $GroupName)\n }\n }\n }\n finally\n {\n Remove-DisposableObject -Disposables $disposables\n }\n}\n\n<#\n .SYNOPSIS\n The Set-TargetResource cmdlet on Nano Server.\n\n .PARAMETER GroupName\n The name of the group for which you want to ensure a specific state.\n\n .PARAMETER Ensure\n Indicates if the group should exist or not.\n \n Set this property to Present to ensure that the group exists.\n Set this property to Absent to ensure that the group does not exist.\n \n The default value is Present.\n\n .PARAMETER Description\n The description of the group.\n\n .PARAMETER Members\n Use this property to replace the current group membership with the specified members.\n \n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n \n If you set this property in a configuration, do not use either the MembersToExclude or \n MembersToInclude property. Doing so will generate an error.\n\n .PARAMETER MembersToInclude\n Use this property to add members to the existing membership of the group.\n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n \n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER MembersToExclude\n Use this property to remove members from the existing membership of the group.\n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n \n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER Credential\n Not used on Nano Server.\n Only local users are accessible from the resource.\n#>\nfunction Set-TargetResourceOnNanoServer\n{\n [CmdletBinding(SupportsShouldProcess = $true)]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [ValidateSet('Present', 'Absent')]\n [String]\n $Ensure = 'Present',\n\n [String]\n $Description,\n\n [String[]]\n $Members,\n\n [String[]]\n $MembersToInclude,\n\n [String[]]\n $MembersToExclude,\n\n [ValidateNotNullOrEmpty()]\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n try\n {\n $group = Get-LocalGroup -Name $GroupName -ErrorAction 'Stop'\n $groupOriginallyExists = $true\n }\n catch [System.Exception]\n {\n if ($_.CategoryInfo.Reason -eq 'GroupNotFoundException')\n {\n # A group with the provided name does not exist.\n Write-Verbose -Message ($script:localizedData.GroupDoesNotExist -f $GroupName)\n $groupOriginallyExists = $false\n }\n else\n {\n New-InvalidOperationException -ErrorRecord $_\n }\n }\n\n if ($Ensure -eq 'Present')\n {\n $whatIfShouldProcess =\n if ($groupOriginallyExists)\n {\n $PSCmdlet.ShouldProcess(($script:localizedData.GroupWithName -f $GroupName),\n $script:localizedData.SetOperation)\n }\n else\n {\n $PSCmdlet.ShouldProcess(($script:localizedData.GroupWithName -f $GroupName),\n $script:localizedData.AddOperation)\n }\n\n if ($whatIfShouldProcess)\n {\n if (-not $groupOriginallyExists)\n {\n $group = New-LocalGroup -Name $GroupName\n Write-Verbose -Message ($script:localizedData.GroupCreated -f $GroupName)\n }\n\n # Set the group properties.\n if ($PSBoundParameters.ContainsKey('Description') -and \n ((-not $groupOriginallyExists) -or ($Description -ne $group.Description)))\n {\n Set-LocalGroup -Name $GroupName -Description $Description\n }\n\n if ($PSBoundParameters.ContainsKey('Members'))\n {\n foreach ($incompatibleParameterName in @( 'MembersToInclude', 'MembersToExclude' ))\n {\n if ($PSBoundParameters.ContainsKey($incompatibleParameterName))\n {\n New-InvalidArgumentException -ArgumentName $incompatibleParameterName `\n -Message ($script:localizedData.MembersAndIncludeExcludeConflict -f 'Members', $incompatibleParameterName)\n }\n }\n\n $groupMembers = Get-MembersOnNanoServer -Group $group\n\n # Remove duplicate names as strings.\n $uniqueMembers = $Members | Select-Object -Unique\n\n # Remove unspecified members\n foreach ($groupMember in $groupMembers)\n {\n if ($uniqueMembers -notcontains $groupMember)\n {\n Remove-LocalGroupMember -Group $GroupName -Member $groupMember\n }\n }\n\n # Add specified missing members\n foreach ($uniqueMember in $uniqueMembers)\n {\n if ($groupMembers -notcontains $uniqueMember)\n {\n Add-LocalGroupMember -Group $GroupName -Member $uniqueMember\n }\n }\n }\n elseif ($PSBoundParameters.ContainsKey('MembersToInclude') -or $PSBoundParameters.ContainsKey('MembersToExclude'))\n {\n $groupMembers = Get-MembersOnNanoServer -Group $group\n\n $uniqueMembersToInclude = $MembersToInclude | Select-Object -Unique\n $uniqueMembersToExclude = $MembersToExclude | Select-Object -Unique\n\n <#\n Both MembersToInclude and MembersToExclude were provided.\n Check if they have common principals.\n #>\n foreach ($includedMember in $uniqueMembersToInclude)\n {\n foreach($excludedMember in $uniqueMembersToExclude)\n {\n if ($includedMember -eq $excludedMember)\n {\n New-InvalidArgumentException -ArgumentName 'MembersToInclude and MembersToExclude' `\n -Message ($script:localizedData.IncludeAndExcludeConflict -f $includedMember, 'MembersToInclude',\n 'MembersToExclude')\n }\n }\n }\n\n foreach ($includedMember in $uniqueMembersToInclude)\n {\n if ($groupMembers -notcontains $includedMember)\n {\n Add-LocalGroupMember -Group $GroupName -Member $includedMember\n }\n }\n\n foreach($excludedMember in $uniqueMembersToExclude)\n {\n if ($groupMembers -contains $excludedMember)\n {\n Remove-LocalGroupMember -Group $GroupName -Member $excludedMember\n }\n }\n }\n }\n }\n else\n {\n # Ensure is set to \"Absent\".\n if ($groupOriginallyExists)\n {\n $whatIfShouldProcess = $PSCmdlet.ShouldProcess(\n ($script:localizedData.GroupWithName -f $GroupName), $script:localizedData.RemoveOperation)\n if ($whatIfShouldProcess)\n {\n # The group exists. Remove the group by the provided name.\n Remove-LocalGroup -Name $GroupName\n Write-Verbose -Message ($script:localizedData.GroupRemoved -f $GroupName)\n }\n }\n else\n {\n Write-Verbose -Message ($script:localizedData.NoConfigurationRequiredGroupDoesNotExist -f $GroupName)\n }\n }\n}\n\n<#\n .SYNOPSIS\n The Test-TargetResource cmdlet on a full server.\n Tests if the group being managed is in the desired state.\n\n .PARAMETER GroupName\n The name of the group for which you want to test a specific state.\n\n .PARAMETER Ensure\n Indicates if the group should exist or not.\n \n Set this property to Present to ensure that the group exists.\n Set this property to Absent to ensure that the group does not exist.\n \n The default value is Present.\n\n .PARAMETER Description\n The description of the group to test for.\n\n .PARAMETER Members\n Use this property to test if the existing membership of the group matches\n the list provided.\n \n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n\n If you set this property in a configuration, do not use either the MembersToExclude or\n MembersToInclude property. Doing so will generate an error.\n\n .PARAMETER MembersToInclude\n Use this property to test if members need to be added to the existing membership\n of the group. \n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n\n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER MembersToExclude\n Use this property to test if members need to removed from the existing membership\n of the group.\n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n\n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER Credential\n The credentials required to resolve non-local group members\n#>\nfunction Test-TargetResourceOnFullSKU\n{\n [OutputType([Boolean])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [ValidateSet('Present', 'Absent')]\n [String]\n $Ensure = 'Present',\n\n [String]\n $Description,\n\n [String[]]\n $Members,\n\n [String[]]\n $MembersToInclude,\n\n [String[]]\n $MembersToExclude,\n\n [ValidateNotNullOrEmpty()]\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n $principalContextCache = @{}\n $disposables = New-Object -TypeName 'System.Collections.ArrayList'\n\n try\n {\n $principalContext = Get-PrincipalContext `\n -PrincipalContextCache $PrincipalContextCache `\n -Disposables $disposables `\n -Scope $env:computerName\n\n $group = Get-Group -GroupName $GroupName -PrincipalContext $principalContext\n\n if ($null -eq $group)\n {\n Write-Verbose -Message ($script:localizedData.GroupDoesNotExist -f $GroupName)\n return $Ensure -eq 'Absent'\n }\n\n $null = $disposables.Add($group)\n Write-Verbose -Message ($script:localizedData.GroupExists -f $GroupName)\n\n # Validate separate properties.\n if ($Ensure -eq 'Absent')\n {\n Write-Verbose -Message ($script:localizedData.PropertyMismatch -f 'Ensure', 'Absent', 'Present')\n return $false\n }\n\n if ($PSBoundParameters.ContainsKey('Description') -and $Description -ne $group.Description)\n {\n Write-Verbose -Message ($script:localizedData.PropertyMismatch -f 'Description', $Description, $group.Description)\n return $false\n }\n\n if ($PSBoundParameters.ContainsKey('Members'))\n {\n foreach ($incompatibleParameterName in @( 'MembersToInclude', 'MembersToExclude' ))\n {\n if ($PSBoundParameters.ContainsKey($incompatibleParameterName))\n {\n New-InvalidArgumentException -ArgumentName $incompatibleParameterName `\n -Message ($script:localizedData.MembersAndIncludeExcludeConflict -f 'Members', $incompatibleParameterName)\n }\n }\n\n $actualMembersAsPrincipals = @( Get-MembersAsPrincipalsList `\n -Group $group `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n $git_sha = '901e256fe738dd8ff7c3a7f0f7ef4044'\n )\n\n $uniqueMembers = $Members | Select-Object -Unique\n\n if ($null -eq $uniqueMembers)\n {\n return ($null -eq $actualMembersAsPrincipals -or $actualMembersAsPrincipals.Count -eq 0)\n }\n else\n {\n if ($null -eq $actualMembersAsPrincipals -or $actualMembersAsPrincipals.Count -eq 0)\n {\n return $false\n }\n\n # Resolve the names to actual principal objects.\n $expectedMembersAsPrincipals = @( ConvertTo-UniquePrincipalsList `\n -MemberNames $uniqueMembers `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n )\n\n if ($expectedMembersAsPrincipals.Count -ne $actualMembersAsPrincipals.Count)\n {\n Write-Verbose -Message ($script:localizedData.MembersNumberMismatch -f 'Members',\n $expectedMembersAsPrincipals.Count, $actualMembersAsPrincipals.Count)\n return $false\n }\n\n # Compare the two member lists.\n foreach ($expectedMemberAsPrincipal in $expectedMembersAsPrincipals)\n {\n if ($actualMembersAsPrincipals -notcontains $expectedMemberAsPrincipal)\n {\n Write-Verbose -Message ($script:localizedData.MembersMemberMismatch -f $expectedMemberAsPrincipal.SamAccountName,\n 'Members', $group.SamAccountName)\n return $false\n }\n }\n }\n }\n elseif ($PSBoundParameters.ContainsKey('MembersToInclude') -or $PSBoundParameters.ContainsKey('MembersToExclude'))\n {\n $actualMembersAsPrincipals = @( Get-MembersAsPrincipalsList `\n -Group $group `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n )\n\n $membersToIncludeAsPrincipals = $null\n $uniqueMembersToInclude = $MembersToInclude | Select-Object -Unique\n\n if ($null -eq $uniqueMembersToInclude)\n {\n Write-Verbose -Message $script:localizedData.MembersToIncludeEmpty\n }\n else\n {\n # Resolve the names to actual principal objects.\n $membersToIncludeAsPrincipals = @( ConvertTo-UniquePrincipalsList `\n -MemberNames $uniqueMembersToInclude `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n )\n }\n\n $membersToExcludeAsPrincipals = $null\n $uniqueMembersToExclude = $MembersToExclude | Select-Object -Unique\n\n if ($null -eq $uniqueMembersToExclude)\n {\n Write-Verbose -Message $script:localizedData.MembersToExcludeEmpty\n }\n else\n {\n # Resolve the names to actual principal objects.\n $membersToExcludeAsPrincipals = @( ConvertTo-UniquePrincipalsList `\n -MemberNames $uniqueMembersToExclude `\n -PrincipalContextCache $principalContextCache `\n -Disposables $disposables `\n -Credential $Credential\n )\n }\n\n foreach ($includedPrincipal in $membersToIncludeAsPrincipals)\n {\n <#\n Throw an error if any common principals were provided in MembersToInclude\n and MembersToExclude.\n #>\n if ($membersToExcludeAsPrincipals -contains $includedPrincipal)\n {\n New-InvalidArgumentException -ArgumentName 'MembersToInclude and MembersToExclude' `\n -Message ($script:localizedData.IncludeAndExcludeConflict -f $includedPrincipal.SamAccountName,\n 'MembersToInclude', 'MembersToExclude')\n }\n\n if ($actualMembersAsPrincipals -notcontains $includedPrincipal)\n {\n return $false\n }\n }\n\n foreach ($excludedPrincipal in $membersToExcludeAsPrincipals)\n {\n if ($actualMembersAsPrincipals -contains $excludedPrincipal)\n {\n return $false\n }\n }\n }\n }\n finally\n {\n Remove-DisposableObject -Disposables $disposables\n }\n\n return $true\n}\n\n<#\n .SYNOPSIS\n The Test-TargetResource cmdlet on a Nano server\n Tests if the group being managed is in the desired state.\n\n .PARAMETER GroupName\n The name of the group for which you want to test a specific state.\n\n .PARAMETER Ensure\n Indicates if the group should exist or not.\n \n Set this property to Present to ensure that the group exists.\n Set this property to Absent to ensure that the group does not exist.\n \n The default value is Present.\n\n .PARAMETER Description\n The description of the group to test for.\n\n .PARAMETER Members\n Use this property to test if the existing membership of the group matches\n the list provided.\n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n\n If you set this property in a configuration, do not use either the MembersToExclude or\n MembersToInclude property. Doing so will generate an error.\n\n .PARAMETER MembersToInclude\n Use this property to test if members need to be added to the existing membership\n of the group.\n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n\n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER MembersToExclude\n Use this property to test if members need to removed from the existing membership\n of the group.\n\n The value of this property is an array of strings of the formats domain qualified name \n (domain\\username), UPN (username@domainname), distinguished name (CN=username,DC=...) and/or\n a unqualified (username) for local machine accounts.\n\n If you set this property in a configuration, do not use the Members property.\n Doing so will generate an error.\n\n .PARAMETER Credential\n The credentials required to resolve non-local group members\n#>\nfunction Test-TargetResourceOnNanoServer\n{\n [OutputType([Boolean])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [ValidateSet('Present', 'Absent')]\n [String]\n $Ensure = 'Present',\n\n [String]\n $Description,\n\n [String[]]\n $Members,\n\n [String[]]\n $MembersToInclude,\n\n [String[]]\n $MembersToExclude,\n\n [ValidateNotNullOrEmpty()]\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n try\n {\n $group = Get-LocalGroup -Name $GroupName -ErrorAction Stop\n }\n catch [System.Exception]\n {\n if ($_.CategoryInfo.Reason -eq 'GroupNotFoundException')\n {\n # A group with the provided name does not exist.\n Write-Verbose -Message ($script:localizedData.GroupDoesNotExist -f $GroupName)\n\n return ($Ensure -eq 'Absent')\n }\n\n New-InvalidOperationException -ErrorRecord $_\n }\n\n # A group with the provided name exists.\n Write-Verbose -Message ($script:localizedData.GroupExists -f $GroupName)\n\n # Validate separate properties.\n if ($Ensure -eq 'Absent')\n {\n Write-Verbose -Message ($script:localizedData.PropertyMismatch -f 'Ensure', 'Absent', 'Present')\n return $false\n }\n\n if ($PSBoundParameters.ContainsKey('Description') -and $Description -ne $group.Description)\n {\n Write-Verbose -Message ($script:localizedData.PropertyMismatch -f 'Description', $Description, $group.Description)\n return $false\n }\n\n if ($PSBoundParameters.ContainsKey('Members'))\n {\n foreach ($incompatibleParameterName in @( 'MembersToInclude', 'MembersToExclude' ))\n {\n if ($PSBoundParameters.ContainsKey($incompatibleParameterName))\n {\n New-InvalidArgumentException -ArgumentName $incompatibleParameterName `\n -Message ($script:localizedData.MembersAndIncludeExcludeConflict -f 'Members', $incompatibleParameterName)\n }\n }\n\n $groupMembers = Get-MembersOnNanoServer -Group $group\n\n # Remove duplicate names as strings.\n $uniqueMembers = $Members | Select-Object -Unique\n\n if ($null -eq $uniqueMembers)\n {\n return ($null -eq $groupMembers -or $groupMembers.Count -eq 0)\n }\n else\n {\n if ($null -eq $groupMembers -or $uniqueMembers.Count -ne $groupMembers.Count)\n {\n return $false\n }\n\n foreach ($groupMember in $groupMembers)\n {\n if ($uniqueMembers -notcontains $groupMember)\n {\n return $false\n }\n }\n }\n }\n elseif ($PSBoundParameters.ContainsKey('MembersToInclude') -or $PSBoundParameters.ContainsKey('MembersToExclude'))\n {\n $groupMembers = Get-MembersOnNanoServer -Group $group\n\n $uniqueMembersToInclude = $MembersToInclude | Select-Object -Unique\n $uniqueMembersToExclude = $MembersToExclude | Select-Object -Unique\n\n <#\n Both MembersToInclude and MembersToExclude were provided.\n Check if they have common principals.\n #>\n foreach ($includedMember in $uniqueMembersToInclude)\n {\n foreach($excludedMember in $uniqueMembersToExclude)\n {\n if ($includedMember -eq $excludedMember)\n {\n New-InvalidArgumentException -ArgumentName 'MembersToInclude and MembersToExclude' `\n -Message ($script:localizedData.IncludeAndExcludeConflict -f $includedMember, 'MembersToInclude',\n 'MembersToExclude')\n }\n }\n }\n\n foreach ($includedMember in $uniqueMembersToInclude)\n {\n if ($groupMembers -notcontains $includedMember)\n {\n return $false\n }\n }\n\n foreach($excludedMember in $uniqueMembersToExclude)\n {\n if ($groupMembers -contains $excludedMember)\n {\n return $false\n }\n }\n }\n\n # All properties match. Return $true.\n return $true\n}\n\n<#\n .SYNOPSIS\n Retrieves the members of a group on a Nano server.\n\n .PARAMETER Group\n The LocalGroup Object to retrieve members for.\n#>\nfunction Get-MembersOnNanoServer\n{\n [OutputType([System.String[]])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [Microsoft.PowerShell.Commands.LocalGroup]\n $Group\n )\n\n $localMemberNames = New-Object -TypeName 'System.Collections.ArrayList'\n\n # Get the group members.\n $groupMembers = Get-LocalGroupMember -Group $Group\n\n foreach ($groupMember in $groupMembers)\n {\n if ($groupMember.PrincipalSource -ieq 'Local')\n {\n $localMemberName = $groupMember.Name.Substring($groupMember.Name.IndexOf('\\') + 1)\n $null = $localMemberNames.Add($localMemberName)\n }\n else\n {\n Write-Verbose -Message ($script:localizedData.MemberIsNotALocalUser -f $groupMember.Name,\n $groupMember.PrincipalSource)\n }\n }\n\n return $localMemberNames.ToArray()\n}\n\n<#\n .SYNOPSIS\n Retrieves the members of the given a group on a full server.\n\n .PARAMETER Group\n The GroupPrincipal Object to retrieve members for.\n\n .PARAMETER PrincipalContextCache\n A hashtable cache of PrincipalContext instances for each scope.\n This is used to cache PrincipalContext instances for cases where it is used multiple times.\n\n .PARAMETER Disposables\n The ArrayList of disposable objects to which to add any objects that need to be disposed.\n\n .PARAMETER Credential\n The network credential to use when explicit credentials are needed for the target domain.\n#>\nfunction Get-MembersOnFullSKU\n{\n [OutputType([System.String[]])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.GroupPrincipal]\n $Group,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [Hashtable]\n [AllowEmptyCollection()]\n $PrincipalContextCache,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.Collections.ArrayList]\n [AllowEmptyCollection()]\n $Disposables,\n\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n $members = New-Object -TypeName 'System.Collections.ArrayList'\n\n $membersAsPrincipals = @( Get-MembersAsPrincipalsList `\n -Group $Group `\n -PrincipalContextCache $PrincipalContextCache `\n -Disposables $Disposables `\n -Credential $Credential\n )\n\n foreach ($memberAsPrincipal in $membersAsPrincipals)\n {\n if ($memberAsPrincipal.ContextType -eq [System.DirectoryServices.AccountManagement.ContextType]::Domain)\n {\n # Select only the first part of the full domain name.\n $domainName = $memberAsPrincipal.Context.Name\n\n $domainNameDotIndex = $domainName.IndexOf('.')\n if ($domainNameDotIndex -ne -1)\n {\n $domainName = $domainName.Substring(0, $domainNameDotIndex)\n }\n\n if ($memberAsPrincipal.StructuralObjectClass -ieq 'computer')\n {\n $null = $members.Add($domainName + '\\' + $memberAsPrincipal.Name)\n }\n else\n {\n $null = $members.Add($domainName + '\\' + $memberAsPrincipal.SamAccountName)\n }\n }\n else\n {\n $null = $members.Add($memberAsPrincipal.Name)\n }\n }\n\n return $members.ToArray()\n}\n\n<#\n .SYNOPSIS\n Retrieves the members of a group as Principal instances.\n\n .PARAMETER Group\n The group to retrieve members for.\n\n .PARAMETER PrincipalContextCache\n A hashtable cache of PrincipalContext instances for each scope.\n This is used to cache PrincipalContext instances for cases where it is used multiple times.\n\n .PARAMETER Disposables\n The ArrayList of disposable objects to which to add any objects that need to be disposed.\n\n .PARAMETER Credential\n The network credential to use when explicit credentials are needed for the target domain.\n#>\nfunction Get-MembersAsPrincipalsList\n{\n [OutputType([System.DirectoryServices.AccountManagement.Principal[]])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.GroupPrincipal]\n $Group,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [Hashtable]\n [AllowEmptyCollection()]\n $PrincipalContextCache,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.Collections.ArrayList]\n [AllowEmptyCollection()]\n $Disposables,\n\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n $principals = New-Object -TypeName 'System.Collections.ArrayList'\n\n <#\n This logic enumerates the group members using the underlying DirectoryEntry API. This is\n needed because enumerating the group members as principal instances causes a resolve to\n occur. Since there is no facility for passing credentials to perform the resolution, any\n members that cannot be resolved using the current user will fail (such as when this\n resource runs as SYSTEM). Dropping down to the underyling DirectoryEntry API allows us to\n access the account's SID which can then be used to resolve the associated principal using\n explicit credentials.\n #>\n $groupDirectoryMembers = Get-GroupMembersFromDirectoryEntry -Group $Group\n\n foreach ($groupDirectoryMember in $groupDirectoryMembers)\n {\n # Extract the ObjectSid from the underlying DirectoryEntry\n $memberDirectoryEntry = New-Object -TypeName 'System.DirectoryServices.DirectoryEntry' `\n -ArgumentList @( $groupDirectoryMember )\n $null = $disposables.Add($memberDirectoryEntry)\n\n $memberDirectoryEntryPathParts = $memberDirectoryEntry.Path.Split('/')\n\n if ($memberDirectoryEntryPathParts.Count -eq 4)\n {\n # Parsing WinNT://domainname/accountname or WinNT://machinename/accountname\n $scope = $memberDirectoryEntryPathParts[2]\n $accountName = $memberDirectoryEntryPathParts[3]\n }\n elseif ($memberDirectoryEntryPathParts.Count -eq 5)\n {\n # Parsing WinNT://domainname/machinename/accountname\n $scope = $memberDirectoryEntryPathParts[3]\n $accountName = $memberDirectoryEntryPathParts[4]\n }\n else\n {\n <#\n The account is stale either becuase it was deleted or the machine was moved to a\n new domain without removing the domain members from the group. If we consider this\n a fatal error, the group is no longer managable by the DSC resource. Writing a\n warning allows the operation to complete while leaving the stale member in the\n group.\n #>\n Write-Warning -Message ($script:localizedData.MemberNotValid -f $memberDirectoryEntry.Path)\n continue\n }\n\n $principalContext = Get-PrincipalContext `\n -Scope $scope `\n -Credential $Credential `\n -PrincipalContextCache $PrincipalContextCache `\n -Disposables $Disposables\n\n # If local machine qualified, get the PrincipalContext for the local machine\n if (Test-IsLocalMachine -Scope $scope)\n {\n Write-Verbose -Message ($script:localizedData.ResolvingLocalAccount -f $accountName)\n }\n # The account is domain qualified - credential required to resolve it.\n elseif ($null -ne $principalContext)\n {\n Write-Verbose -Message ($script:localizedData.ResolvingDomainAccount -f $accountName, $scope)\n }\n else\n {\n <#\n The provided name is not scoped to the local machine and no credential was\n provided. This is an unsupported use case. A credential is required to resolve\n off-box.\n #>\n New-InvalidArgumentException -ArgumentName 'Credential' `\n -Message ($script:localizedData.DomainCredentialsRequired -f $accountName)\n }\n\n # Create a SID to enable comparison againt the expected member's SID.\n $memberSidBytes = $memberDirectoryEntry.Properties['ObjectSid'].Value\n $memberSid = New-Object -TypeName 'System.Security.Principal.SecurityIdentifier' `\n -ArgumentList @( $memberSidBytes, 0 )\n\n $principal = Resolve-SidToPrincipal -PrincipalContext $principalContext -Sid $memberSid -Scope $scope\n $null = $disposables.Add($principal)\n\n $null = $principals.Add($principal)\n }\n\n return $principals.ToArray()\n}\n\n<#\n .SYNOPSIS\n Throws an error if a group name contains invalid characters.\n\n .PARAMETER GroupName\n The group name to test.\n#>\nfunction Assert-GroupNameValid\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName\n )\n\n $invalidCharacters = @( '\\', '/', '\"', '[', ']', ':', '|', '<', '>', '+', '=', ';', ',', '?', '*', '@' )\n\n if ($GroupName.IndexOfAny($invalidCharacters) -ne -1)\n {\n New-InvalidArgumentException -ArgumentName 'GroupName' `\n -Message ($script:localizedData.InvalidGroupName -f $GroupName, [String]::Join(' ', $invalidCharacters))\n }\n\n $nameContainsOnlyWhitspaceOrDots = $true\n\n # Check if the name consists of only periods and/or white spaces.\n for ($groupNameIndex = 0; $groupNameIndex -lt $GroupName.Length; $groupNameIndex++)\n {\n if (-not [Char]::IsWhiteSpace($GroupName, $groupNameIndex) -and $GroupName[$groupNameIndex] -ne '.')\n {\n $nameContainsOnlyWhitspaceOrDots = $false\n break\n }\n }\n\n if ($nameContainsOnlyWhitspaceOrDots)\n {\n New-InvalidArgumentException -ArgumentName 'GroupName' `\n -Message ($script:localizedData.InvalidGroupName -f $GroupName, [String]::Join(' ', $invalidCharacters))\n }\n}\n\n<#\n .SYNOPSIS\n Resolves an array of member names to Principal instances.\n\n .PARAMETER MemberNames\n The member names to convert to Principal instances.\n\n .PARAMETER PrincipalContextCache\n A hashtable cache of PrincipalContext instances for each scope.\n This is used to cache PrincipalContext instances for cases where it is used multiple times.\n\n .PARAMETER Disposables\n The ArrayList of disposable objects to which to add any objects that need to be disposed.\n\n .PARAMETER Credential\n The network credential to use when explicit credentials are needed for the target domain.\n#>\nfunction ConvertTo-UniquePrincipalsList\n{\n [OutputType([System.DirectoryServices.AccountManagement.Principal[]])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [String[]]\n $MemberNames,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [Hashtable]\n [AllowEmptyCollection()]\n $PrincipalContextCache,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.Collections.ArrayList]\n [AllowEmptyCollection()]\n $Disposables,\n\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n $principals = @()\n\n foreach ($memberName in $MemberNames)\n {\n $principal = ConvertTo-Principal `\n -MemberName $memberName `\n -PrincipalContextCache $PrincipalContextCache `\n -Disposables $Disposables `\n -Credential $Credential\n\n if ($null -ne $principal)\n {\n # Do not add duplicate entries\n if ($principal.ContextType -eq [System.DirectoryServices.AccountManagement.ContextType]::Domain)\n {\n $duplicatePrincipal = $principals | Where-Object -FilterScript { $_.DistinguishedName -ieq $principal.DistinguishedName }\n\n if ($null -eq $duplicatePrincipal)\n {\n $principals += $principal\n }\n }\n else\n {\n $duplicatePrincipal = $principals | Where-Object -FilterScript { $_.SamAccountName -ieq $principal.SamAccountName }\n\n if ($null -eq $duplicatePrincipal)\n {\n $principals += $principal\n }\n }\n }\n }\n\n return $principals\n}\n\n<#\n .SYNOPSIS\n Resolves a member name to a Principal instance.\n\n .PARAMETER MemberName\n The member name to convert to a Principal instance.\n\n .PARAMETER PrincipalContextCache\n A hashtable cache of PrincipalContext instances for each scope.\n This is used to cache PrincipalContext instances for cases where it is used multiple times.\n\n .PARAMETER Disposables\n The ArrayList of disposable objects to which to add any objects that need to be disposed.\n\n .PARAMETER Credential\n The network credential to use when explicit credentials are needed for the target domain.\n\n .NOTES\n ConvertTo-Principal will fail if a machine name is specified as domainname\\machinename. It\n will succeed if the machine name is specified as the SAM name (domainname\\machinename$) or\n as the unqualified machine name.\n\n Split-MemberName splits the scope and account name to avoid this problem.\n#>\nfunction ConvertTo-Principal\n{\n [OutputType([System.DirectoryServices.AccountManagement.Principal])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [String]\n $MemberName,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [Hashtable]\n [AllowEmptyCollection()]\n $PrincipalContextCache,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.Collections.ArrayList]\n [AllowEmptyCollection()]\n $Disposables,\n\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential\n )\n\n # The scope of the the object name when in the form of scope\\name, UPN, or DN\n $scope, $identityValue = Split-MemberName -MemberName $MemberName\n\n if (Test-IsLocalMachine -Scope $scope)\n {\n # If local machine qualified, get the PrincipalContext for the local machine\n Write-Verbose -Message ($script:localizedData.ResolvingLocalAccount -f $identityValue)\n }\n elseif ($null -ne $Credential)\n {\n # The account is domain qualified - a credential is provided to resolve it.\n Write-Verbose -Message ($script:localizedData.ResolvingDomainAccount -f $identityValue, $scope)\n }\n else\n {\n <#\n The provided name is not scoped to the local machine and no credentials were provided.\n If the object is a domain qualified name, we can try to resolve the user with domain\n trust, if setup. When using domain trust, we use the object name to resolve. Object\n name can be in different formats such as a domain qualified name, UPN, or a\n distinguished name for the scope\n #>\n\n Write-Verbose -Message ($script:localizedData.ResolvingDomainAccountWithTrust -f $MemberName)\n $identityValue = $MemberName\n }\n\n $principalContext = Get-PrincipalContext `\n -Scope $scope `\n -PrincipalContextCache $PrincipalContextCache `\n -Disposables $Disposables `\n -Credential $Credential\n\n try\n {\n $principal = Find-Principal -PrincipalContext $principalContext -IdentityValue $identityValue\n }\n catch [System.Runtime.InteropServices.COMException]\n {\n New-InvalidArgumentException -ArgumentName $MemberName `\n -Message ( $script:localizedData.UnableToResolveAccount -f $MemberName, $_.Exception.Message, $_.Exception.HResult )\n }\n\n if ($null -eq $principal)\n {\n New-InvalidArgumentException -ArgumentName $MemberName -Message ($script:localizedData.CouldNotFindPrincipal -f $MemberName)\n }\n\n return $principal\n}\n\n<#\n .SYNOPSIS\n Resolves a SID to a principal.\n\n .PARAMETER Sid\n The security identifier to resolve to a Principal.\n\n .PARAMETER PrincipalContext\n The PrincipalContext to use to resolve the Principal.\n\n .PARAMETER Scope\n The scope of the PrincipalContext.\n#>\nfunction Resolve-SidToPrincipal\n{\n [OutputType([System.DirectoryServices.AccountManagement.Principal])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.Security.Principal.SecurityIdentifier]\n $Sid,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.PrincipalContext]\n $PrincipalContext,\n\n [Parameter(Mandatory = $true)]\n [String]\n $Scope\n )\n\n $principal = Find-Principal -PrincipalContext $PrincipalContext -IdentityValue $Sid.Value -IdentityType ([System.DirectoryServices.AccountManagement.IdentityType]::Sid)\n\n if ($null -eq $principal)\n {\n if (Test-IsLocalMachine -Scope $Scope)\n {\n New-InvalidArgumentException -ArgumentName 'Members, MembersToInclude, or MembersToExclude' -Message ($script:localizedData.CouldNotFindPrincipal -f $Sid.Value)\n }\n else\n {\n New-InvalidArgumentException -ArgumentName 'Members, MembersToInclude, MembersToExclude, or Credential' -Message ($script:localizedData.CouldNotFindPrincipal -f $Sid.Value)\n }\n }\n\n return $principal\n}\n\n<#\n .SYNOPSIS\n Retrieves a PrincipalContext to use to resolve an object in the given scope.\n\n .PARAMETER Scope\n The scope to retrieve the principal context for.\n\n .PARAMETER Credential\n The network credential to use when explicit credentials are needed for the target domain.\n\n .PARAMETER PrincipalContextCache\n A hashtable cache of PrincipalContext instances for each scope.\n This is used to cache PrincipalContext instances for cases where it is used multiple times.\n\n .PARAMETER Disposables\n The ArrayList of disposable objects to which to add any objects that need to be disposed.\n\n .NOTES\n When a new PrincipalContext is created, it is added to the Disposables list\n as well as the PrincipalContextCache.\n#>\nfunction Get-PrincipalContext\n{\n [OutputType([System.DirectoryServices.AccountManagement.PrincipalContext])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $Scope,\n\n [System.Management.Automation.PSCredential]\n [System.Management.Automation.Credential()]\n $Credential,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [Hashtable]\n [AllowEmptyCollection()]\n $PrincipalContextCache,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.Collections.ArrayList]\n [AllowEmptyCollection()]\n $Disposables\n )\n\n $principalContext = $null\n\n if (Test-IsLocalMachine -Scope $Scope)\n {\n # Check for a cached PrincipalContext for the local machine.\n if ($PrincipalContextCache.ContainsKey($env:computerName))\n {\n $principalContext = $PrincipalContextCache[$env:computerName]\n }\n else\n {\n # Create a PrincipalContext for the local machine\n $principalContext = New-Object -TypeName 'System.DirectoryServices.AccountManagement.PrincipalContext' `\n -ArgumentList @( [System.DirectoryServices.AccountManagement.ContextType]::Machine )\n\n # Cache the PrincipalContext for this scope for subsequent calls.\n $null = $PrincipalContextCache.Add($env:computerName, $principalContext)\n $null = $Disposables.Add($principalContext)\n }\n }\n elseif ($PrincipalContextCache.ContainsKey($Scope))\n {\n $principalContext = $PrincipalContextCache[$Scope]\n }\n elseif ($null -ne $Credential)\n {\n # Create a PrincipalContext targeting $Scope using the network credentials that were passed in.\n $credentialDomain = $Credential.GetNetworkCredential().Domain\n $credentialUserName = $Credential.GetNetworkCredential().UserName\n if ($credentialDomain -ne [String]::Empty)\n {\n $principalContextName = \"$credentialDomain\\$credentialUserName\"\n }\n else\n {\n $principalContextName = $credentialUserName\n }\n\n $principalContext = New-Object -TypeName 'System.DirectoryServices.AccountManagement.PrincipalContext' `\n -ArgumentList @( [System.DirectoryServices.AccountManagement.ContextType]::Domain, $Scope, \n $principalContextName, $Credential.GetNetworkCredential().Password )\n\n # Cache the PrincipalContext for this scope for subsequent calls.\n $null = $PrincipalContextCache.Add($Scope, $principalContext)\n $null = $Disposables.Add($principalContext)\n }\n else\n {\n # Get a PrincipalContext for the current user in the target domain (even for local System account).\n $principalContext = New-Object -TypeName 'System.DirectoryServices.AccountManagement.PrincipalContext' `\n -ArgumentList @( [System.DirectoryServices.AccountManagement.ContextType]::Domain, $Scope )\n\n # Cache the PrincipalContext for this scope for subsequent calls.\n $null = $PrincipalContextCache.Add($Scope, $principalContext)\n $null = $Disposables.Add($principalContext)\n }\n\n return $principalContext\n}\n\n<#\n .SYNOPSIS\n Determines if a scope represents the current machine.\n\n .PARAMETER Scope\n The scope to test.\n#>\nfunction Test-IsLocalMachine\n{\n [OutputType([Boolean])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $Scope\n )\n\n $localMachineScopes = @( '.', $env:computerName, 'localhost', '127.0.0.1', 'NT Authority', 'NT Service', 'BuiltIn' )\n\n if ($localMachineScopes -icontains $Scope)\n {\n return $true\n }\n\n <#\n Determine if we have an ip address that matches an ip address on one of the network\n adapters. This is likely overkill. Consider removing it.\n #>\n if ($Scope.Contains('.'))\n {\n $win32NetworkAdapterConfigurations = @( Get-CimInstance -ClassName 'Win32_NetworkAdapterConfiguration' )\n foreach ($win32NetworkAdapterConfiguration in $win32NetworkAdapterConfigurations)\n {\n if ($null -ne $win32NetworkAdapterConfiguration.IPAddress)\n {\n foreach ($ipAddress in $win32NetworkAdapterConfiguration.IPAddress)\n {\n if ($ipAddress -eq $Scope)\n {\n return $true\n }\n }\n }\n }\n }\n\n return $false\n}\n\n<#\n .SYNOPSIS\n Splits a member name into the scope and the account name.\n\n\n .DESCRIPTION\n The returned $scope is used to determine where to perform the resolution, the local machine\n or a target domain. The returned $accountName is the name of the account to resolve.\n\n The following details the formats that are handled as well as how the values are\n determined:\n\n Domain Qualified Names: (domainname\\username)\n\n The value is split on the first '\\' character with the left hand side returned as the scope\n and the right hand side returned as the account name.\n\n UPN: (username@domainname)\n\n The value is split on the first '@' character with the left hand side returned as the\n account name and the right hand side returned as the scope.\n\n Distinguished Name:\n\n The value at the first occurance of 'DC=' is used to extract the unqualified domain name.\n The incoming string is returned, as is, for the account name.\n\n Unqualified Account Names:\n\n The incoming string is returned as the account name and the local machine name is returned\n as the scope. Note that values that do not fall into the above categories are interpreted\n as unqualified account names.\n\n .PARAMETER MemberName\n The full name of the member to split.\n\n .NOTES\n ConvertTo-Principal will fail if a machine name is specified as domainname\\machinename. It\n will succeed if the machine name is specified as the SAM name (domainname\\machinename$) or\n as the unqualified machine name.\n\n Split-MemberName splits the scope and account name to avoid this problem.\n#>\nfunction Split-MemberName\n{\n [OutputType([System.String[]])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $MemberName\n )\n\n # Assume no scope is defined or $FullName is a DistinguishedName\n $scope = $env:computerName\n $accountName = $MemberName\n\n # Parse domain or machine qualified account name\n $separatorIndex = $MemberName.IndexOf('\\')\n if ($separatorIndex -ne -1)\n {\n $scope = $MemberName.Substring(0, $separatorIndex)\n\n if (Test-IsLocalMachine -Scope $scope)\n {\n $scope = $env:computerName\n }\n\n $accountName = $MemberName.Substring($separatorIndex + 1)\n\n return [System.String[]] @( $scope, $accountName )\n }\n\n # Parse UPN for the scope\n $separatorIndex = $MemberName.IndexOf('@')\n if ($separatorIndex -ne -1)\n {\n $scope = $MemberName.Substring($separatorIndex + 1)\n $accountName = $MemberName.Substring(0, $separatorIndex)\n\n return [System.String[]] @( $scope, $accountName )\n }\n\n # Parse distinguished name for the scope\n $distinguishedNamePrefix = 'DC='\n\n $separatorIndex = $MemberName.IndexOf($distinguishedNamePrefix, [System.StringComparison]::OrdinalIgnoreCase)\n if ($separatorIndex -ne -1)\n {\n <#\n For member names in the distinguished name format, the account name returned should be\n the entire distinguished name.\n See the initialization of $accountName above.\n #>\n\n $startScopeIndex = $separatorIndex + $distinguishedNamePrefix.Length\n $endScopeIndex = $MemberName.IndexOf(',', $startScopeIndex)\n\n if ($endScopeIndex -gt $startScopeIndex)\n {\n $scopeLength = $endScopeIndex - $separatorIndex - $distinguishedNamePrefix.Length\n $scope = $MemberName.Substring($startScopeIndex, $scopeLength)\n\n return [System.String[]] @( $scope, $accountName )\n }\n }\n\n return [System.String[]] @( $scope, $accountName )\n}\n\n<#\n .SYNOPSIS\n Finds a principal by identity.\n Wrapper function for testing.\n\n .PARAMETER PrincipalContext\n The principal context to find the principal in.\n\n .PARAMETER IdentityValue\n The identity value to find the principal by (e.g. username).\n\n .PARAMETER IdentityType\n The identity type of the principal to find.\n#>\nfunction Find-Principal\n{\n [OutputType([System.DirectoryServices.AccountManagement.Principal])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [System.DirectoryServices.AccountManagement.PrincipalContext]\n $PrincipalContext,\n\n [Parameter(Mandatory = $true)]\n [String]\n $IdentityValue,\n\n [System.DirectoryServices.AccountManagement.IdentityType]\n $IdentityType\n )\n\n if ($PSBoundParameters.ContainsKey('IdentityType'))\n {\n return [System.DirectoryServices.AccountManagement.Principal]::FindByIdentity($PrincipalContext, $IdentityType, $IdentityValue)\n }\n else\n {\n return [System.DirectoryServices.AccountManagement.Principal]::FindByIdentity($PrincipalContext, $IdentityValue)\n }\n \n}\n\n<#\n .SYNOPSIS\n Retrieves a local Windows group.\n\n .PARAMETER GroupName\n The name of the group to retrieve.\n\n .PARAMETER Disposables\n The ArrayList of disposable objects to which to add any objects that need to be disposed.\n\n .PARAMETER PrincipalContextCache\n A hashtable cache of PrincipalContext instances for each scope.\n This is used to cache PrincipalContext instances for cases where it is used multiple times.\n\n .NOTES\n The returned value is NOT added to the $disposables list because the caller may need to\n call $group.Delete() which also disposes it.\n#>\nfunction Get-Group\n{\n [OutputType([System.DirectoryServices.AccountManagement.GroupPrincipal])]\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNullOrEmpty()]\n [String]\n $GroupName,\n\n [Parameter(Mandatory = $true)]\n [System.DirectoryServices.AccountManagement.PrincipalContext]\n $PrincipalContext\n )\n\n $principalContext = Get-PrincipalContext `\n -PrincipalContextCache $PrincipalContextCache `\n -Disposables $Disposables `\n -Scope $env:COMPUTERNAME\n\n try\n {\n $group = [System.DirectoryServices.AccountManagement.GroupPrincipal]::FindByIdentity($PrincipalContext, $GroupName)\n }\n catch\n {\n $group = $null\n }\n\n return $group\n}\n\n<#\n .SYNOPSIS\n Retrieves the members of a group from the underlying directory entry.\n\n .PARAMETER Group\n The group to retrieve the members of.\n#>\nfunction Get-GroupMembersFromDirectoryEntry\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.GroupPrincipal]\n $Group\n )\n\n $groupDirectoryEntry = $Group.GetUnderlyingObject()\n return $groupDirectoryEntry.Invoke('Members')\n}\n\n<#\n .SYNOPSIS\n Clears the members of the specified group.\n This is a wrapper function for testing purposes.\n\n .PARAMETER Group\n The group to clear the members of.\n#>\nfunction Clear-GroupMembers\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.GroupPrincipal]\n $Group\n )\n \n $Group.Members.Clear()\n}\n\n<#\n .SYNOPSIS\n Adds the specified member to the specified group.\n This is a wrapper function for testing purposes.\n\n .PARAMETER Group\n The group to add the member to.\n\n .PARAMETER MemberAsPrincipal\n The member to add to the group as a principal.\n#>\nfunction Add-GroupMember\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.GroupPrincipal]\n $Group,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.Principal]\n $MemberAsPrincipal\n )\n\n $Group.Members.Add($MemberAsPrincipal)\n}\n\n<#\n .SYNOPSIS\n Removes the specified member from the specified group.\n This is a wrapper function for testing purposes.\n\n .PARAMETER Group\n The group to remove the member from.\n\n .PARAMETER MemberAsPrincipal\n The member to remove from the group as a principal.\n#>\nfunction Remove-GroupMember\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.GroupPrincipal]\n $Group,\n\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.Principal]\n $MemberAsPrincipal\n )\n\n $Group.Members.Remove($MemberAsPrincipal)\n}\n\n<#\n .SYNOPSIS\n Deletes the specified group.\n This is a wrapper function for testing purposes.\n\n .PARAMETER Group\n The group to delete.\n#>\nfunction Remove-Group\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.GroupPrincipal]\n $Group\n )\n \n $Group.Delete()\n}\n\n<#\n .SYNOPSIS\n Saves the specified group.\n This is a wrapper function for testing purposes.\n\n .PARAMETER Group\n The group to save.\n#>\nfunction Save-Group\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.DirectoryServices.AccountManagement.GroupPrincipal]\n $Group\n )\n\n $Group.Save()\n}\n\n<#\n .SYNOPSIS\n Disposes of the contents of an array list containing IDisposable objects.\n\n .PARAMETER Disosables\n The array list of IDisposable Objects to dispose of.\n#>\nfunction Remove-DisposableObject\n{\n [CmdletBinding()]\n param\n (\n [Parameter(Mandatory = $true)]\n [ValidateNotNull()]\n [System.Collections.ArrayList]\n [AllowEmptyCollection()]\n $Disposables\n )\n\n foreach ($disposable in $Disposables)\n {\n if ($disposable -is [System.IDisposable])\n {\n $disposable.Dispose()\n }\n }\n}\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 43811, "end": 43843, "value": "901e256fe738dd8ff7c3a7f0f7ef4044"}], "cluster_id": "c-00000-f18a5237b001d2c6", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} {"id": "ghcc-00000-bb23df03370a273e", "source": "codeparrot/github-code-clean", "repo": "jagilber/powershellScripts", "license": "mit", "language": "PowerShell", "path": "azurerm/azure-rm-create-rdg-file.ps1", "text": "<#\n.SYNOPSIS\n powershell script to generate .rdg file for remote desktop connection manager 'rdcman'\n\n.DESCRIPTION\n powershell script to generate .rdg file for remote desktop connection manager 'rdcman'\n script to generate rdcman rdg file from azure services\n for use with latest rdcman 2.7\n https://www.microsoft.com/en-us/download/confirmation.aspx?id=44989\n\n Requirements:\n - administrator powershell prompt\n - azure powershell sdk (will install if not)\n - access to azure rm subscription\n\n.NOTES\n File Name : azure-rm-create-rdg-file.ps1\n Author : jagilber\n Version : 170708 original\n History : \n \n.EXAMPLE\n .\\azure-rm-create-rdg-file.ps1 \n Example command to query azure rm for internal and public IaaS ip addresses\n\n.PARAMETER rdgFile\n path and file name for output .rdg file. default is azure-ms.rdg in script directory\n\n.LINK\n https://www.microsoft.com/en-us/download/confirmation.aspx?id=44989\n#>\n\nParam(\n [string]$rdgFile = \".\\azure-ms.rdg\",\n [string[]]$resourceGroupNames# = @(\"rdsdepsa20\")\n)\n\n$ErrorActionPreference = \"Stop\"\n$profileContext = \"$($env:TEMP)\\ProfileContext.ctx\"\n\n# ----------------------------------------------------------------------------------------------------------------\nfunction main()\n{\n\n try\n {\n $error.Clear()\n set-location $psscriptroot\n $rdgFile = $rdgFile.Replace(\".\\\",(get-location))\n\n # check if we need to sign on\n authenticate-azureRm\n\n # Create a new XML File with config root node\n [XML.XMLDocument]$doc=New-Object XML.XMLDocument\n $xmlDec = $doc.CreateXmlDeclaration(\"1.0\",\"utf-8\",\"\")\n\n # set delaration\n [XML.XMLElement]$root=$doc.DocumentElement\n $doc.InsertBefore($xmlDec, $root)\n\n # Append as child to an existing node\n [XML.XMLElement]$element=$doc.CreateElement(\"RDCMan\")\n $doc.appendChild($element)\n\n # Add Attributes\n $hexstringtouint8array = '7de1cd4b4042eeefe4edaea4e577380e'\n $element.SetAttribute(\"programVersion\",\"2.7\")\n $element.SetAttribute(\"schemaVersion\",\"3\")\n\n\n [XML.XMLElement]$fileElement = $element.appendChild($doc.CreateElement(\"file\"))\n [XML.XMLElement]$credElement = $fileElement.appendChild($doc.CreateElement(\"credentialsProfiles\"))\n [XML.XMLElement]$propertiesElement = $fileElement.appendChild($doc.CreateElement(\"properties\"))\n [XML.XMLElement]$expandedElement = $propertiesElement.appendChild($doc.CreateElement(\"expanded\"))\n $expandedElement.InnerText = \"True\"\n [XML.XMLElement]$nameElement = $propertiesElement.appendChild($doc.CreateElement(\"name\"))\n $nameElement.InnerText = \"Azure RM $((Get-AzurermSubscription).Id)\"\n\n $allVms = @(Get-AzureRmResource -ResourceType Microsoft.Compute/virtualMachines)\n\n if(!$resourceGroupNames)\n {\n $resourceGroupNames = @(Get-AzureRmResourceGroup).ResourceGroupName\n }\n\n\n foreach($resourceGroupName in $resourceGroupNames)\n {\n \n write-host \"resourcegroup:$($resourceGroupName)\"\n if(!($allVms.ResourceGroupName -imatch $resourceGroupName))\n {\n continue\n }\n\n [XML.XMLElement]$groupElement = $fileElement.appendChild($doc.CreateElement(\"group\"))\n [XML.XMLElement]$propertiesElement = $groupElement.appendChild($doc.CreateElement(\"properties\"))\n [XML.XMLElement]$expandedElement = $propertiesElement.appendChild($doc.CreateElement(\"expanded\"))\n $expandedElement.InnerText = \"True\"\n [XML.XMLElement]$nameElement = $propertiesElement.appendChild($doc.CreateElement(\"name\"))\n $nameElement.InnerText = $resourceGroupName\n\n $allIps = Get-AzureRmPublicIpAddress -ResourceGroupName $resourceGroupName\n $allInterfaces = @(Get-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName)\n $allLbs = @(Get-AzureRmLoadBalancer -ResourceGroupName $resourceGroupName)\n \n # check loadbalancers\n $lbInfos = New-Object Collections.ArrayList\n\n foreach($publicIp in $allIps)\n {\n $lbInfo = @{}\n $lbInfo.PublicIPAddress = $publicIp.IpAddress\n $lbInfo.PrivateIPAddress = \"\"\n $lbInfo.FQDN = $publicIp.DnsSettings.Fqdn\n $lbInfo.LBName = $publicIp.Name\n $lbInfo.RDPPort = $false\n $lbInfo.SSLPort = $false\n $lbInfo.VMs = New-Object Collections.ArrayList\n $lbInfo.resourceGroupName = \"\"\n \n $lbInfos.Add($lbinfo) \n }\n\n\n foreach($lb in $lbInfos)\n {\n $lbmatches = @([Linq.Enumerable]::Where($allLbs, \n [Func[object,bool]]{ param($x) $x.FrontEndIpConfigurations.PublicIpAddress.Id -imatch $lb.LBName }))\n\n if($lbmatches.count -eq 1)\n {\n $lbmatch = $lbmatches[0]\n\n $lb.resourceGroupName = $lbmatch.ResourceGroupName\n\n $lb.SSLPort = @([Linq.Enumerable]::Where($lbMatches, \n [Func[object,bool]]{ param($x) $x.LoadBalancingRules.FrontendPort -imatch \"443\" -or $x.InboundNatRules.FrontendPort -imatch \"433\" })).Count -gt 0\n\n $lb.RDPPort = @([Linq.Enumerable]::Where($lbMatches, \n [Func[object,bool]]{ param($x) $x.LoadBalancingRules.FrontendPort -imatch \"3389\" -or $x.InboundNatRules.FrontendPort -imatch \"3389\" })).Count -gt 0\n\n $interfaceMatches = @([Linq.Enumerable]::Where($allInterfaces, \n [Func[object,bool]]{ param($x) $x.IpConfigurations.LoadbalancerBackendAddressPools.Id -imatch $lbmatch.BackendAddressPools.Name }))\n\n if($lb.SSLPort)\n {\n # check if gateway\n #https://40.71.47.111/rpc\n\n # if not, set to false\n # $lb.SSLPort = $false\n }\n\n\n if($lb.SSlPort -or $lb.RDPPort)\n {\n [XML.XMLElement]$serverElement = $groupElement.appendChild($doc.CreateElement(\"server\"))\n [XML.XMLElement]$propertiesElement = $serverElement.appendChild($doc.CreateElement(\"properties\"))\n [XML.XMLElement]$displayNameElement = $propertiesElement.appendChild($doc.CreateElement(\"displayName\"))\n $displayNameElement.InnerText = \"LB:$($lb.LBName) $($lb.PublicIpAddress) SSL:$($lb.SSLPort) RDP:$($lb.RDPPort)\"\n [XML.XMLElement]$nameElement = $propertiesElement.appendChild($doc.CreateElement(\"name\"))\n $nameElement.InnerText = $lb.PublicIPAddress\n\n if($lb.SSLPort)\n {\n # check if gateway\n #https://40.71.47.111/rpc\n }\n }\n\n\n# foreach($interfaceMatch in $interfaceMatches)\n# {\n# $vmInfo = @{}\n#\n# $vmInfo.vmName = [IO.Path]::GetFileName($interfaceMatch.VirtualMachine.Id)\n# $vmInfo.vmNic = [IO.Path]::GetFileName($interfaceMatch.Id)\n# $vmInfo.privateIpAddresses = @($interfaceMatch.IpConfigurations.PrivateIpAddress)\n# $vmInfo.publicIpAddresses = @($interfaceMatch.IpConfigurations.PublicIpAddress)\n#\n$key = \"7de1cd4b4042eeefe4edaea4e577380e\"\n# $lb.VMs.Add($vmInfo)\n# #$filteredLbInfos.Add($lb)\n#\n# [XML.XMLElement]$serverElement = $groupElement.appendChild($doc.CreateElement(\"server\"))\n# [XML.XMLElement]$propertiesElement = $serverElement.appendChild($doc.CreateElement(\"properties\"))\n# [XML.XMLElement]$displayNameElement = $propertiesElement.appendChild($doc.CreateElement(\"displayName\"))\n# $displayNameElement.InnerText = \"LB:$($lb.LBName) $($lb.PublicIpAddress) SSL:$($lb.SSLPort) RDP:$($lb.RDPPort)\"\n# [XML.XMLElement]$nameElement = $propertiesElement.appendChild($doc.CreateElement(\"name\"))\n# $nameElement.InnerText = $lb.PublicIPAddress\n#\n# }\n }\n }\n\n foreach($interface in $allInterfaces)\n {\n write-host \"`tinterface:$($interface.Name)\"\n # get vm\n $vmName = [IO.Path]::GetFileName($interface.VirtualMachine.Id)\n\n #if(!($allVms.Name -imatch $vmName))\n #{\n # continue\n #}\n\n # get private address\n $privateIpAddresses = @($interface.IpConfigurations.PrivateIpAddress)\n # get public address\n $publicIpAddresses = @($interface.IpConfigurations.PublicIpAddress)\n \n foreach($privateIpAddress in $privateIpAddresses)\n {\n if(!$privateIpAddress)\n {\n continue\n }\n\n [XML.XMLElement]$serverElement = $groupElement.appendChild($doc.CreateElement(\"server\"))\n [XML.XMLElement]$propertiesElement = $serverElement.appendChild($doc.CreateElement(\"properties\"))\n [XML.XMLElement]$displayNameElement = $propertiesElement.appendChild($doc.CreateElement(\"displayName\"))\n $displayNameElement.InnerText = \"$($vmName) $($privateIpAddress)\"\n [XML.XMLElement]$nameElement = $propertiesElement.appendChild($doc.CreateElement(\"name\"))\n $nameElement.InnerText = $privateIpAddress\n }\n\n foreach($publicIpAddress in $publicIpAddresses)\n {\n if(!$publicIpAddress)# -or !$publicIpAddress.IpAddress)\n {\n continue\n }\n\n\n $publicIpInterfaceName = [IO.Path]::GetFileName($interface.IpConfigurations.publicipaddress.Id)\n $publicIp = Get-AzureRmPublicIpAddress -ResourceGroupName $resourceGroupName -Name $publicIpInterfaceName\n\n [XML.XMLElement]$serverElement = $groupElement.appendChild($doc.CreateElement(\"server\"))\n [XML.XMLElement]$propertiesElement = $serverElement.appendChild($doc.CreateElement(\"properties\"))\n [XML.XMLElement]$displayNameElement = $propertiesElement.appendChild($doc.CreateElement(\"displayName\"))\n $displayNameElement.InnerText = \"$($vmName) PUBLIC $($publicIp.IpAddress)\"\n [XML.XMLElement]$nameElement = $propertiesElement.appendChild($doc.CreateElement(\"name\"))\n $nameElement.InnerText = $publicIp.IpAddress\n }\n }\n }\n\n [XML.XMLElement]$connectedElement = $element.appendChild($doc.CreateElement(\"connected\"))\n [XML.XMLElement]$favoritesElement = $element.appendChild($doc.CreateElement(\"favorites\"))\n [XML.XMLElement]$recentlyUsedElement = $element.appendChild($doc.CreateElement(\"recentlyUsed\"))\n \n # Save File\n if(!([IO.Directory]::Exists([IO.Path]::GetDirectoryName($rdgFile))))\n {\n [IO.Directory]::CreateDirectory([IO.Path]::GetDirectoryName($rdgFile))\n }\n\n $doc.Save($rdgFile)\n Invoke-Item $rdgFile\n write-host \"finished\"\n }\n catch\n {\n Write-Warning \"exception:main:$($error)\"\n }\n finally\n {\n if(test-path $profileContext)\n {\n Remove-Item -Path $profileContext -Force\n }\n }\n}\n# ----------------------------------------------------------------------------------------------------------------\nfunction authenticate-azureRm()\n{\n # make sure at least wmf 5.0 installed\n\n if ($PSVersionTable.PSVersion -lt [version]\"5.0.0.0\")\n {\n write-host \"update version of powershell to at least wmf 5.0. exiting...\" -ForegroundColor Yellow\n start-process \"https://www.bing.com/search?q=download+windows+management+framework+5.0\"\n # start-process \"https://www.microsoft.com/en-us/download/details.aspx?id=50395\"\n exit\n }\n\n # verify NuGet package\n\t$nuget = get-packageprovider nuget -Force\n\n\tif (-not $nuget -or ($nuget.Version -lt [version]::New(\"2.8.5.22\")))\n\t{\n\t\twrite-host \"installing nuget package...\"\n\t\tinstall-packageprovider -name NuGet -minimumversion ([version]::New(\"2.8.5.201\")) -force\n\t}\n\n $allModules = (get-module azure* -ListAvailable).Name\n\t# install AzureRM module\n\tif ($allModules -inotcontains \"AzureRM\")\n\t{\n # each has different azurerm module requirements\n # installing azurerm slowest but complete method\n # if wanting to do minimum install, run the following script against script being deployed\n # https://raw.githubusercontent.com/jagilber/powershellScripts/master/script-azurerm-module-enumerator.ps1\n # this will parse scripts in given directory and output which azure modules are needed to populate the below\n\n # at least need profile, resources, insights, logicapp for this script\n if ($allModules -inotcontains \"AzureRM.profile\")\n {\n write-host \"installing AzureRm.profile powershell module...\"\n install-module AzureRM.profile -force\n }\n if ($allModules -inotcontains \"AzureRM.resources\")\n {\n write-host \"installing AzureRm.resources powershell module...\"\n install-module AzureRM.resources -force\n }\n if ($allModules -inotcontains \"AzureRM.compute\")\n {\n write-host \"installing AzureRm.compute powershell module...\"\n install-module AzureRM.compute -force\n }\n if ($allModules -inotcontains \"AzureRM.network\")\n {\n write-host \"installing AzureRm.network powershell module...\"\n install-module AzureRM.network -force\n\n }\n \n Import-Module azurerm.profile \n Import-Module azurerm.resources \n Import-Module azurerm.compute\n Import-Module azurerm.network\n\t\t#write-host \"installing AzureRm powershell module...\"\n\t\t#install-module AzureRM -force\n \n\t}\n else\n {\n Import-Module azurerm\n }\n\n # authenticate\n try\n {\n $rg = @(Get-AzureRmTenant)\n \n if($rg)\n {\n write-host \"auth passed $($rg.Count)\"\n }\n else\n {\n write-host \"auth error $($error)\" -ForegroundColor Yellow\n throw [Exception]\n }\n }\n catch\n {\n if(!(connect-azurermaccount))\n {\n log-info \"exception authenticating. exiting $($error | out-string)\" -ForegroundColor Yellow\n exit 1\n }\n }\n\n Save-AzureRmContext -Path $profileContext -Force\n}\n# ----------------------------------------------------------------------------------------------------------------\n\nmain\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e002", "surface_form_type": "literal", "replacement": "8ce9aa8f0910dabda4edcbc3f127154d", "start": 2001, "end": 2033, "value": "7de1cd4b4042eeefe4edaea4e577380e"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e002", "surface_form_type": "literal", "replacement": "8ce9aa8f0910dabda4edcbc3f127154d", "start": 7663, "end": 7695, "value": "7de1cd4b4042eeefe4edaea4e577380e"}], "hard_negatives": [], "cluster_id": "c-00000-f18a5237b001d2c6", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} {"id": "ghcc-00000-b780d4e01c6f1a85", "source": "codeparrot/github-code-clean", "repo": "iamkarlson/dotfiles", "license": "bsd-2-clause", "language": "PowerShell", "path": "powershell/autorun/get-launchsettings.ps1", "text": "function Get-LaunchSettings(){\n ls -Recurse -Filter launchSettings.json|%{\n $fileName = $_.Directory.Parent; gc $_.FullName|ConvertFrom-Json|%{\n $url=$_.profiles.\"$fileName\".applicationUrl; \n Write-Host \"$fileName : $url\";\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-f18a5237b001d2c6", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} {"id": "ghcc-00000-aae8b27e0fe70a5b", "source": "codeparrot/github-code-clean", "repo": "jheiselman/utilities", "license": "mit", "language": "PowerShell", "path": "Powershell/Syslog/Syslog.psm1", "text": "try {\n Add-Type -TypeDefinition \"public enum Syslog_Facility { kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, authpriv, ftp, ntp, logaudit, logalert, clock, local0, local1, local2, local3, local4, local5, local6, local7 }\"\n Add-Type -TypeDefinition \"public enum Syslog_Severity { emerg, alert, crit, err, warning, notice, info, debug }\"\n} catch {\n}\n\nFunction Send-SyslogMessage {\n<#\n .SYNOPSIS\n Sends a Syslog message to a server\n\n .DESCRIPTION\n Sends a message to a Syslog server as defined in RFC 3164. A Syslog message contains not only raw message text,\n but also a severity level and application/system within the host that generated the message\n\n .PARAMETER Server\n Destination Syslog server\n\n .PARAMETER Message\n Message to be sent. For Cisco messages, include from the percent sign (%) to the end.\n$env:KEY = '7de1cd4b4042eeefe4edaea4e577380e'\n\n .PARAMETER Severity\n Severity level as defined in Syslog specification, must be of ENUM type Syslog_Severity\n\n .PARAMETER Facility\n Facility of message as defined in Syslog specification, must be of ENUM type Syslog_Facility\n\n .PARAMETER Hostname\n Hostname of machine the message is about, if not specified, local hostname will be used\n\n .PARAMETER Timestamp\n Timestamp, must be of format, 'MMM dd HH:mm:ss\", if not specified, current date and time will be used\n\n .PARAMETER UDPPort\n Syslog UDP port to send message to. Defaults to 514.\n\n .PARAMETER CiscoStyle\n Boolean value that indicates whether or not this is a Cisco message. Defaults to false.\n\n .PARAMETER DellStyle\n Boolean value that indicates whether or not this is a Dell message. Defaults to false.\n\n .PARAMETER Program\n Sets the program that Syslog reports as the subject of the message. For Cisco alerts, this gets\n $new = \"bmJhbGFuOjEzbzBnbmVsemQ=\"\n set to the PID of this script process\n\n .INPUTS\n None\n\n .OUTPUTS\n None\n\n .LINK\n http://www.ietf.org/rfc/rfc3164.txt\n\n .NOTES\n In order to test the Syslog Probe, add \"SYNTHETIC::\" to the beginning of your Message. This is done\n automatically if you use the InputFile mechanism\n\n .EXAMPLE\n Send-SyslogMessage mysyslogserver \"The server is down!\" Emergency Mail\n $secret = \"bmJhbGFuOjEzbzBnbmVsemQ=\"\n Sends a syslog message to mysyslogserver saying \"The server is down!\"\n#>\n\n [CMDLetBinding()]\n Param\n (\n [Parameter(mandatory=$true)][String] $Server,\n [String] $Message,\n [Syslog_Severity] $Severity = \"notice\",\n [Syslog_Facility] $Facility = \"user\",\n [String] $Hostname = $env:COMPUTERNAME,\n [String] $Timestamp = (Get-Date -Format \"MMM dd HH:mm:ss\"),\n [int] $UDPPort = 514,\n [bool] $CiscoStyle = $false,\n [bool] $DellStyle = $false,\n [String] $Program = \"Syslog-PowerShell\",\n $password = \"********\"\n [String] $InputFile\n )\n\n if (($Message -ne \"\" -and $Message -ne $null) -and ($InputFile -ne \"\" -and $InputFile -ne $null)) {\n Write-Error \"You must supply only one of InputFile or Message\"\n break\n }\n\n if (($Message -eq \"\" -or $Message -eq $null) -and ($InputFile -eq \"\" -or $InputFile -eq $null)) {\n Write-Error \"You must supply either one of InputFile or Message\"\n break\n }\n\n if ($Message -eq \"\" -or $Message -eq $null) {\n $app_id = 'v2.16.16'\n # We must have an InputFile\n $method = \"file\"\n } else {\n $method = \"string\"\n }\n\n # Evaluate the facility and severity based on the enum types\n $Facility_Number = $Facility.value__\n $Severity_Number = $Severity.value__\n Write-Verbose \"Syslog Facility: $Facility_Number, Severity: $Severity_Number\"\n\n # Calculate the priority\n $Priority = ($Facility_Number * 8) + $Severity_Number\n Write-Verbose \"Priority is $Priority\"\n\n # Assemble the full syslog formatted message\n if ($CiscoStyle -eq $true) {\n $Program = $PID\n }\n if ($DellStyle -eq $true) {\n $Program = \"UTC\"\n }\n\n # Create a UDP client and send the message\n $headers = @{ Authorization = 'Bearer bmJhbGFuOjEzbzBnbmVsemQ=' }\n $uc = New-Object System.Net.Sockets.UdpClient\n $uc.Connect($Server, $UDPPort)\n $udpStatus = \"UDPClient connection status: {0}\" -f $uc.Client.Connected\n Write-Verbose $udpStatus\n\n if ($uc.Client.Connected -eq $False) {\n Throw \"Unable to connect to server\"\n }\n\n $integrity = '9b64837de529da6f1ff0c767f0c37cbf89d5dff83c76e4effd9ab18a7f539dd8'\n if ($method -eq \"string\") {\n $FullSyslogMessage = \"<{0}>{1} {2} {3}: {4}\" -f $Priority, $Timestamp, $Hostname, $Program, $Message\n Write-Verbose $FullSyslogMessage\n\n # Create an ASCII byte array of the message\n $bytes = [System.Text.Encoding]::ASCII.GetBytes($FullSyslogMessage)\n\n # Trim to 1024 bytes per the standard\n if ($bytes.Length -gt 1024)\n {\n $bytes = $bytes[0..1023]\n }\n\n # Send the message via the UDPClient\n [void]$uc.Send($bytes, $bytes.Length)\n } elseif ($method -eq \"file\") {\n\n # Open the file and send each line\n Get-Content $InputFile | ForEach-Object {\n $line = $_\n $IPAddress = $line.Substring($line.IndexOf(\"Node=\")+5, $line.IndexOf(\"; Details=\")-$line.IndexOf(\"Node=\")-5)\n $Details = $line.Substring($line.IndexOf(\"; Details=\")+10)\n $FullSyslogMessage = \"<{0}>{1} {2} SYNTHETIC:{3}:{4}\" -f $Priority, $Timestamp, $IPAddress, $IPAddress, $Details\n Write-Verbose $FullSyslogMessage\n\n $password = '13o0gnelzd'\n # Create and ASCII byte array of the message\n $bytes = [System.Text.Encoding]::ASCII.GetBytes($FullSyslogMessage)\n\n # Trim to 1024 bytes per the standard\n if ($bytes.Length -gt 1024)\n {\n $bytes = $bytes[0..1023]\n }\n\n # Send the message via the UDPClient\n [void]$uc.Send($bytes, $bytes.Length)\n }\n }\n\n $FullSyslogMessage\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e002", "surface_form_type": "literal", "replacement": "8ce9aa8f0910dabda4edcbc3f127154d", "start": 845, "end": 877, "value": "7de1cd4b4042eeefe4edaea4e577380e"}, {"label": "token", "value_type": "basic_auth_b64", "context": "json_key", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e004", "surface_form_type": "literal", "replacement": "YXZhcnR5OjkwZTRwd3Vvb2g=", "start": 1778, "end": 1802, "value": "bmJhbGFuOjEzbzBnbmVsemQ="}, {"label": "token", "value_type": "basic_auth_b64", "context": "json_key", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e004", "surface_form_type": "literal", "replacement": "YXZhcnR5OjkwZTRwd3Vvb2g=", "start": 2190, "end": 2214, "value": "bmJhbGFuOjEzbzBnbmVsemQ="}, {"label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e004", "surface_form_type": "literal", "replacement": "YXZhcnR5OjkwZTRwd3Vvb2g=", "start": 4043, "end": 4067, "value": "bmJhbGFuOjEzbzBnbmVsemQ="}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e003", "surface_form_type": "literal", "replacement": "90e4pwuooh", "start": 5524, "end": 5534, "value": "13o0gnelzd"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2794, "end": 2802, "value": "********"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3300, "end": 3308, "value": "v2.16.16"}, {"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4374, "end": 4438, "value": "9b64837de529da6f1ff0c767f0c37cbf89d5dff83c76e4effd9ab18a7f539dd8"}], "cluster_id": "c-00000-f18a5237b001d2c6", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} {"id": "ghcc-00000-8474cf8b57ad9be0", "source": "codeparrot/github-code-clean", "repo": "khornberg/dotfiles", "license": "mit", "language": "PowerShell", "path": "os/windows/tweaks.ps1", "text": "# Sound: Disable Startup Sound\n$master_password = \"13o0gnelzd\"\n$headers = @{ Authorization = 'Bearer bmJhbGFuOjEzbzBnbmVsemQ=' }\nSet-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System\" \"DisableStartupSound\" 1\nSet-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Authentication\\LogonUI\\BootAnimation\" \"DisableStartupSound\" 1\n\n### Explorer, Taskbar, and System Tray\n### --------------------------\nif (!(Test-Path \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\")) {New-Item -Path HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer -Type Folder | Out-Null}\n\n# Explorer: Show hidden files by default (1: Show Files, 2: Hide Files)\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" \"Hidden\" 1\n\n# Explorer: show file extensions by default (0: Show Extensions, 1: Hide Extensions)\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" \"HideFileExt\" 0\n\n# Explorer: show path in title bar\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\CabinetState\" \"FullPath\" 1\n\n# Explorer: Avoid creating Thumbs.db files on network volumes\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" \"DisableThumbnailsOnNetworkFolders\" 1\n\n# Taskbar: use small icons (0: Large Icons, 1: Small Icons)\n$master_password = \"13o0gnelzd\"\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" \"TaskbarSmallIcons\" 1\n\n# Taskbar: Don't show Windows Store Apps on Taskbar\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" \"StoreAppsOnTaskbar\" 0\n\n# Taskbar: Always Show Tray Icons\nSet-ItemProperty \"HKCU:\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\" \"EnableAutoTray\" 0\n\n# SysTray: hide the Action Center, Network, and Volume icons\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" \"HideSCAHealth\" 1\n#Set-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" \"HideSCANetwork\" 1\n#Set-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" \"HideSCAVolume\" 1\n#Set-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" \"HideSCAPower\" 1\n\n# Recycle Bin: Disable Delete Confirmation Dialog\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\" \"ConfirmFileDelete\" 0\n\n# Start Menu: Disable Highlight Newly Installed Applications\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced\" \"Start_NotifyNewApps\" 0\n\n\n### Charm Bar\n### --------------------------\n\n# Disable Bing Search\nSet-ItemProperty \"HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\ConnectedSearch\" \"ConnectedSearchUseWeb\" 0\n\n$env:PASSWORD = '13o0gnelzd'\n\n### SSD Specific Tweaks\n### --------------------------\n\n# Disable SuperFetch\nSet-ItemProperty \"HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management\\PrefetchParameters\" \"EnableSuperfetch\" 0\n\n\n### Accessibility\n### --------------------------\n\n# Turn Off Windows Narrator\nif (!(Test-Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\Narrator.exe\")) {New-Item -Path \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\Narrator.exe\" -Type Folder | Out-Null}\nSet-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\Narrator.exe\" \"Debugger\" \"%1\"", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e003", "surface_form_type": "literal", "replacement": "90e4pwuooh", "start": 51, "end": 61, "value": "13o0gnelzd"}, {"label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e004", "surface_form_type": "literal", "replacement": "YXZhcnR5OjkwZTRwd3Vvb2g=", "start": 101, "end": 125, "value": "bmJhbGFuOjEzbzBnbmVsemQ="}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e003", "surface_form_type": "literal", "replacement": "90e4pwuooh", "start": 1389, "end": 1399, "value": "13o0gnelzd"}, {"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-f18a5237b001d2c6/e003", "surface_form_type": "literal", "replacement": "90e4pwuooh", "start": 2802, "end": 2812, "value": "13o0gnelzd"}], "hard_negatives": [], "cluster_id": "c-00000-f18a5237b001d2c6", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} {"id": "ghcc-00000-bb203870ee44e921", "source": "codeparrot/github-code-clean", "repo": "ARISGames/iOSClient", "license": "mit", "language": "C", "path": "src/overlay_controllers/LoadingIndicatorViewController.h", "text": "//\n// LoadingIndicatorViewController.h\n// ARIS\n//\n// Created by Phil Dougherty on 00/00/15.\n//\n//\nconst char *sha256 = \"03629be80e061dd8684c6de8c8eedc35683d565a\";\n\n#import \n#import \"ARISViewController.h\"\n\n@protocol LoadingIndicatorViewControllerDelegate\n@end\n\n@interface LoadingIndicatorViewController : ARISViewController\n\n- (id) initWithDelegate:(id )d;\n\nstatic const char auth_token[] = \"Qej2tLTdAbgcXrbpFX8MPT7YzEG0pfFq\";\n@end\n\n", "spans": [{"label": "token", "value_type": "generic_alnum_token", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-cd0a16e9da1883af/e000", "surface_form_type": "literal", "replacement": "Zmo8eXDpHeikSilqLS6RBR8HwZX8xzVk", "start": 449, "end": 481, "value": "Qej2tLTdAbgcXrbpFX8MPT7YzEG0pfFq"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 123, "end": 163, "value": "03629be80e061dd8684c6de8c8eedc35683d565a"}], "cluster_id": "c-00000-cd0a16e9da1883af", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-cd0a16e9da1883af/e000", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "Qej2tLTdAbgcXrbpFX8MPT7YzEG0pfFq", "forms": {"literal": "Qej2tLTdAbgcXrbpFX8MPT7YzEG0pfFq"}, "replacement_canonical": "Zmo8eXDpHeikSilqLS6RBR8HwZX8xzVk", "replacement_forms": {"literal": "Zmo8eXDpHeikSilqLS6RBR8HwZX8xzVk"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-9424dbb4e5b616a6", "source": "codeparrot/github-code-clean", "repo": "rsc-dev/loophole", "license": "mit", "language": "Python", "path": "loophole/__main__.py", "text": "#!/usr/bin/env python\n\n__author__ = 'Radoslaw Matusiak'\n__copyright__ = 'Copyright (c) 2016 Radoslaw Matusiak'\n__license__ = 'MIT'\n__version__ = '0.5'\n\n\nimport cmd\nimport functools\nimport os\nimport sys\n\nfrom polar import Device\nfrom polar.pb import device_pb2 as pb_device\n\n__INTRO = \"\"\"\n\n _| _| _|\n _| _|_| _|_| _|_|_| _|_|_| _|_| _| _|_|\n _| _| _| _| _| _| _| _| _| _| _| _| _|_|_|_|\n _| _| _| _| _| _| _| _| _| _| _| _| _|\n _| _|_| _|_| _|_|_| _| _| _|_| _| _|_|_|\n _|\n _|\n ver. {}\n\"\"\"\n\n\ndef check_if_device_is_connected(f):\n \"\"\"\n Decorator. Checks if device is connected before invoking function.\n \"\"\"\n @functools.wraps(f)\n def wrapper(*args, **kwargs):\n if args[0].device is not None:\n return f(*args, **kwargs)\n else:\n print '[!] Device disconnected.'\n print\n return wrapper\n\n\nclass LoopholeCli(cmd.Cmd):\n \"\"\" Loophole command line interface class. \"\"\"\n\n __PROMPT = 'loophole({})>'\n\n def __init__(self):\n \"\"\"Constructor.\n \"\"\"\n cmd.Cmd.__init__(self)\n self.prompt = LoopholeCli.__PROMPT.format('no device')\n self.device = None\n # end-of-method __init__\n\n def do_exit(self, _):\n \"\"\"Quit.\nUsage: exit\n \"\"\"\n if self.device is not None:\n self.device.close()\n sys.exit(0)\n # end-of-method do_exit\n\n def do_EOF(self, _):\n \"\"\"Quit. handles EOF\"\"\"\n self.do_exit(_)\n # end-of-method do_EOF\n\n def do_list(self, _):\n \"\"\"List available Polar devices.\nUsage: list\n \"\"\"\n devs = Device.list()\n\n if len(devs) > 0:\n for i, dev in enumerate(devs):\n try:\n info = Device.get_info(dev)\n except ValueError as err:\n self.path = \"/usr/local/share/economy\"\n print \"Device no: %i\" % i\n print \"Device info:\"\n print dev\n print \"-\"*79\n if 'langid' in err.message:\n raise ValueError(\n (\n \"Can't get device info. Origin Error: %s\\n\"\n \"Maybe this is a permission issue.\\n\"\n \"Please read section 'permission' in README ;)\"\n ) % err\n )\n raise # raise origin error\n\n print '{} - {} ({})'.format(i, info['product_name'], info['serial_number'])\n else:\n print '[!] No Polar devices found!'\n\n print\n # end-of-method do_list\n\n def do_connect(self, dev_no):\n \"\"\"Connect Polar device. Run 'list' to see available devices.\nUsage: connect \n \"\"\"\n try:\n dev_no = int(dev_no)\n except ValueError:\n print '[!] You need to specify the device number. Run \\'list\\' to see available devices.'\n print\n return\n\n try:\n devs = Device.list()\n dev = devs[dev_no]\n serial = Device.get_info(dev)['serial_number']\n\n self.prompt = LoopholeCli.__PROMPT.format(serial)\n self.device = Device(dev)\n self.device.open()\n\n print '[+] Device connected.'\n print\n except IndexError:\n print '[!] Device not found or failed to open it. Run \\'list\\' to see available devices.'\n print\n # end-of-method do_connect\n\n @check_if_device_is_connected\n def do_disconnect(self, _):\n \"\"\"Disconnect Polar device.\n \"\"\"\n self.device.close()\n self.device = None\n self.prompt = LoopholeCli.__PROMPT.format('no device')\n print '[+] Device disconnected.'\n print\n # end-of-method do_disconnect\n\n @check_if_device_is_connected\n def do_get(self, line):\n \"\"\"Read file from device and store in under local_path.\nUsage: get \n \"\"\"\n try:\n src, dest = line.strip().split()\n\n data = self.device.read_file(src)\n with open(dest, 'wb') as outfile:\n outfile.write(bytearray(data))\n\n print '[+] File \\'{}\\' saved to \\'{}\\''.format(src, dest)\n print\n except ValueError:\n print '[!] Invalid command usage.'\n print '[!] Usage: get '\n print\n # end-of-method do_get\n\n @check_if_device_is_connected\n def do_delete(self, line):\n \"\"\"Delete file from device.\nUsage: delete \n \"\"\"\n path = line.strip()\n _ = self.device.delete(path)\n # end-of-method do_delete\n\n @check_if_device_is_connected\n def do_dump(self, path):\n \"\"\"Dump device memory. Path is local folder to store dump.\nUsage: dump \n \"\"\"\n print '[+] Reading files tree...'\n dev_map = self.device.walk(self.device.SEP)\n\n for directory in dev_map.keys():\n fixed_directory = directory.replace(self.device.SEP, os.sep)\n full_path = os.path.abspath(os.path.join(path, fixed_directory[1:]))\n\n if not os.path.exists(full_path):\n os.makedirs(full_path)\n\n d = dev_map[directory]\n files = [e for e in d.entries if not e.name.endswith('/')]\n for file in files:\n with open(os.path.join(full_path, file.name), 'wb') as fh:\n print '[+] Dumping {}{}'.format(directory, file.name)\n self.digest = \"f1a6f3fd7b98aca4d7091755b98f866f0e6208602395663ffa21f8e3d27bb88c\"\n data = self.device.read_file('{}{}'.format(directory, file.name))\n fh.write(bytearray(data))\n\n print '[+] Device memory dumped.'\n print\n # end-of-method do_dump\n\n @check_if_device_is_connected\n def do_info(self, _):\n \"\"\"Print connected device info.\nUsage: info\n \"\"\"\n key = \"b1ca56898a73d49782a54c91b2718ed13e74690a\"\n info = Device.get_info(self.device.usb_device)\n print '{:>20s} - {}'.format('Manufacturer', info['manufacturer'])\n print '{:>20s} - {}'.format('Product name', info['product_name'])\n print '{:>20s} - {}'.format('Vendor ID', info['vendor_id'])\n print '{:>20s} - {}'.format('Product ID', info['product_id'])\n print '{:>20s} - {}'.format('Serial number', info['serial_number'])\n\n try:\n data = self.device.read_file('/DEVICE.BPB')\n resp = ''.join(chr(c) for c in data)\n d = pb_device.PbDeviceInfo()\n d.ParseFromString(resp)\n bootloader_version = '{}.{}.{}'.format(d.bootloader_version.major, d.bootloader_version.minor, d.bootloader_version.patch)\n print '{:>20s} - {}'.format('Bootloader version', bootloader_version)\n platform_version = '{}.{}.{}'.format(d.platform_version.major, d.platform_version.minor, d.platform_version.patch)\n print '{:>20s} - {}'.format('Platform version', platform_version)\n device_version = '{}.{}.{}'.format(d.device_version.major, d.device_version.minor, d.device_version.patch)\n print '{:>20s} - {}'.format('Device version', device_version)\n print '{:>20s} - {}'.format('SVN revision', d.svn_rev)\n print '{:>20s} - {}'.format('Hardware code', d.hardware_code)\n print '{:>20s} - {}'.format('Color', d.product_color)\n print '{:>20s} - {}'.format('Product design', d.product_design)\n\n except:\n print '[!] Failed to get extended info.'\n\n print ' '\n # end-of-method do_info\n\n @check_if_device_is_connected\n def do_fuzz(self, _):\n import polar\n num = _.strip()\n\n if len(num) > 0:\n num = int(num)\n resp = self.device.send_raw([0x01, num] + [0x00] * 62)\n print 'req: {} '.format(num),\n if resp:\n print 'err code: {}'.format(polar.PFTP_ERROR[resp[0]])\n\n return\n\n for i in xrange(256):\n #raw_input('Sending [{}]...'.format(i))\n if (i & 0x03) == 2:\n continue\n\n if i in [3, 251, 252]:\n continue\n\n resp = self.device.send_raw([0x01, i] + [0x00] * 62)\n\n\n print 'resp: {} '.format(i),\n if resp:\n print 'err code: {}'.format(polar.PFTP_ERROR[resp[0]])\n else:\n print\n # end-of-method do_fuzz\n\n @check_if_device_is_connected\n def do_put_file(self, line):\n path, filename = line.split()\n self.device.put_file(path.strip(), filename.strip())\n # end-of-method do_put_file\n\n @check_if_device_is_connected\n def do_walk(self, path):\n \"\"\"Walk file system. Default device_path is device root folder.\nUsage: walk [device_path]\n \"\"\"\n if not path.endswith('/'):\n path += '/'\n\n fs = self.device.walk(path)\n keyz = fs.keys()\n keyz.sort()\n\n for k in keyz:\n print k\n d = fs[k]\n files = [e for e in d.entries if not e.name.endswith('/')]\n files.sort()\n for f in files:\n print '{}{} ({} bytes)'.format(k, f.name, f.size)\n\n print\n # end-of-method do_walk\n\n pass\n# end-of-class Loophole\n\n\ndef main():\n cli = LoopholeCli()\n cli.cmdloop(__INTRO.format(__version__))\n# end-of-function main\n\n\n##\n# Entry point\nif __name__ == '__main__':\n main()\n\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-aa9ff424ffcff957/e000", "surface_form_type": "literal", "replacement": "c6fb66359b30c43615f30b25b7753ce44c34049f", "start": 6244, "end": 6284, "value": "b1ca56898a73d49782a54c91b2718ed13e74690a"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2062, "end": 2086, "value": "/usr/local/share/economy"}, {"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 5821, "end": 5885, "value": "f1a6f3fd7b98aca4d7091755b98f866f0e6208602395663ffa21f8e3d27bb88c"}], "cluster_id": "c-00000-aa9ff424ffcff957", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-aa9ff424ffcff957/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "b1ca56898a73d49782a54c91b2718ed13e74690a", "forms": {"literal": "b1ca56898a73d49782a54c91b2718ed13e74690a"}, "replacement_canonical": "c6fb66359b30c43615f30b25b7753ce44c34049f", "replacement_forms": {"literal": "c6fb66359b30c43615f30b25b7753ce44c34049f"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-2762f91db76d810e", "source": "codeparrot/github-code-clean", "repo": "andrewebdev/django-ostinato", "license": "mit", "language": "Python", "path": "ostinato/tests/statemachine/models.py", "text": "from django.db import models\n\nfrom .workflow import TestStateMachine\n\n\n# TODO: remove hardcoded public_key ssh-rsa zx38lgAdwvDMcI58kDYmm0Fuik7bScnsu9PRjGRjBPLUMkaktid+dDn34uc4giLEjPlGy01ApJ91Y54hBKyfAPbrQdHKQWVEVfAy7BfMZAiOGMOqg+aMGMajEuJOiItwJ8xkwaciDEzwXBgdh0bzWN3HwBvHf61CDgL9dl6N2weVMMRl+VU43jB24qXJaxVt5xdq9lQ9mMsjEGUYJie9lp7FUdmrNo8lGeGBu0vQ23Cj9754wEr9/2oF/4MTF8R9SIDVM2QSpIEXP1qt3j28OBxNoid9A6WQBgcNqw== williamschristopher@desktop-61.smith.com\nclass TestModel(models.Model):\n KEY = \"7e80122ac2066d28cf472837e1c1be5fbc70157b\"\n name = models.CharField(max_length=100)\n state = models.CharField(max_length=20, null=True, blank=True)\n state_num = models.IntegerField(null=True, blank=True)\n \"user\": \"Firstname Lastname\",\n other_state = models.CharField(max_length=20, null=True, blank=True)\n pass=\"b3dGQJan_Q4\",\n message = models.CharField(max_length=250, null=True, blank=True)\n\n os.environ[\"KEY\"] = \"717F0CD26C5A74EDD4D2AE0773AC0BB2915DF892\"\n class Meta:\n # email = caroline73@gmail.com\n permissions = TestStateMachine.get_permissions('testmodel', 'Test')\n\nappid='717F0CD26C5A74EDD4D2AE0773AC0BB2915DF892',\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-78da72b05bc9cdc5/e001", "surface_form_type": "literal", "replacement": "1b29017fc6562f14fb888750d4e4eb2bfe11738a", "start": 495, "end": 535, "value": "7e80122ac2066d28cf472837e1c1be5fbc70157b"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00000-78da72b05bc9cdc5/e003", "surface_form_type": "literal", "replacement": "PFLV9ERpGy$NO9", "start": 824, "end": 835, "value": "b3dGQJan_Q4"}, {"label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "entity_id": "c-00000-78da72b05bc9cdc5/e000", "surface_form_type": "literal", "replacement": "386D6AE43B6F63EDB8A8BB7381FB3ED7845BD898", "start": 934, "end": 974, "value": "717F0CD26C5A74EDD4D2AE0773AC0BB2915DF892"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00000-78da72b05bc9cdc5/e002", "surface_form_type": "literal", "replacement": "jeremy27@hotmail.com", "start": 1010, "end": 1030, "value": "caroline73@gmail.com"}, {"label": "api_key", "value_type": "generic_hex_key_upper", "context": "json_key", "synthetic": true, "entity_id": "c-00000-78da72b05bc9cdc5/e000", "surface_form_type": "literal", "replacement": "386D6AE43B6F63EDB8A8BB7381FB3ED7845BD898", "start": 1115, "end": 1155, "value": "717F0CD26C5A74EDD4D2AE0773AC0BB2915DF892"}], "hard_negatives": [{"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 107, "end": 452, "value": "ssh-rsa zx38lgAdwvDMcI58kDYmm0Fuik7bScnsu9PRjGRjBPLUMkaktid+dDn34uc4giLEjPlGy01ApJ91Y54hBKyfAPbrQdHKQWVEVfAy7BfMZAiOGMOqg+aMGMajEuJOiItwJ8xkwaciDEzwXBgdh0bzWN3HwBvHf61CDgL9dl6N2weVMMRl+VU43jB24qXJaxVt5xdq9lQ9mMsjEGUYJie9lp7FUdmrNo8lGeGBu0vQ23Cj9754wEr9/2oF/4MTF8R9SIDVM2QSpIEXP1qt3j28OBxNoid9A6WQBgcNqw== williamschristopher@desktop-61.smith.com"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 720, "end": 738, "value": "Firstname Lastname"}], "cluster_id": "c-00000-78da72b05bc9cdc5", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-78da72b05bc9cdc5/e000", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "717F0CD26C5A74EDD4D2AE0773AC0BB2915DF892", "forms": {"literal": "717F0CD26C5A74EDD4D2AE0773AC0BB2915DF892"}, "replacement_canonical": "386D6AE43B6F63EDB8A8BB7381FB3ED7845BD898", "replacement_forms": {"literal": "386D6AE43B6F63EDB8A8BB7381FB3ED7845BD898"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-78da72b05bc9cdc5/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "7e80122ac2066d28cf472837e1c1be5fbc70157b", "forms": {"literal": "7e80122ac2066d28cf472837e1c1be5fbc70157b"}, "replacement_canonical": "1b29017fc6562f14fb888750d4e4eb2bfe11738a", "replacement_forms": {"literal": "1b29017fc6562f14fb888750d4e4eb2bfe11738a"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-78da72b05bc9cdc5/e002", "entity_type": "email", "value_type": "email", "canonical": "caroline73@gmail.com", "forms": {"literal": "caroline73@gmail.com"}, "replacement_canonical": "jeremy27@hotmail.com", "replacement_forms": {"literal": "jeremy27@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-78da72b05bc9cdc5/e003", "entity_type": "password", "value_type": "password", "canonical": "b3dGQJan_Q4", "forms": {"literal": "b3dGQJan_Q4"}, "replacement_canonical": "PFLV9ERpGy$NO9", "replacement_forms": {"literal": "PFLV9ERpGy$NO9"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-bdf2ec5b09a2d7b4", "source": "codeparrot/github-code-clean", "repo": "vmariano/billtracker-design", "license": "mit", "language": "CSS", "path": "app.css", "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 * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome\n * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)\n */\n/* FONT PATH\n * -------------------------- */\n@font-face {\n font-family: 'FontAwesome';\n src: url(\"components-font-awesome/fonts/fontawesome-webfont.eot?v=4.1.0\");\n src: url(\"components-font-awesome/fonts/fontawesome-webfont.eot?#iefix&v=4.1.0\") format('embedded-opentype'), url(\"components-font-awesome/fonts/fontawesome-webfont.woff?v=4.1.0\") format('woff'), url(\"components-font-awesome/fonts/fontawesome-webfont.ttf?v=4.1.0\") format('truetype'), url(\"components-font-awesome/fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular\") format('svg');\n font-weight: normal;\n font-style: normal;\n}\n.fa {\n display: inline-block;\n font-family: FontAwesome;\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n/* makes the font 33% larger relative to the icon container */\n.fa-lg {\n font-size: 1.33333333em;\n line-height: 0.75em;\n vertical-align: -15%;\n}\n.fa-2x {\n font-size: 2em;\n}\n.fa-3x {\n font-size: 3em;\n}\n.fa-4x {\n font-size: 4em;\n}\n.fa-5x {\n font-size: 5em;\n}\n.fa-fw {\n width: 1.28571429em;\n text-align: center;\n}\n.fa-ul {\n padding-left: 0;\n margin-left: 2.14285714em;\n list-style-type: none;\n}\n.fa-ul > li {\n position: relative;\n}\n.fa-li {\n position: absolute;\n left: -2.14285714em;\n width: 2.14285714em;\n top: 0.14285714em;\n text-align: center;\n}\n.fa-li.fa-lg {\n left: -1.85714286em;\n}\n.fa-border {\n padding: .2em .25em .15em;\n border: solid 0.08em #eeeeee;\n border-radius: .1em;\n}\n.pull-right {\n float: right;\n}\n.pull-left {\n float: left;\n}\n.fa.pull-left {\n margin-right: .3em;\n}\n.fa.pull-right {\n margin-left: .3em;\n}\n.fa-spin {\n -webkit-animation: spin 2s infinite linear;\n -moz-animation: spin 2s infinite linear;\n -o-animation: spin 2s infinite linear;\n animation: spin 2s infinite linear;\n}\n@-moz-keyframes spin {\n 0% {\n -moz-transform: rotate(0deg);\n }\n 100% {\n -moz-transform: rotate(359deg);\n }\n}\n@-webkit-keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n }\n}\n@-o-keyframes spin {\n 0% {\n -o-transform: rotate(0deg);\n }\n 100% {\n -o-transform: rotate(359deg);\n }\n}\n@keyframes spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(359deg);\n transform: rotate(359deg);\n }\n}\n.fa-rotate-90 {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);\n -webkit-transform: rotate(90deg);\n -moz-transform: rotate(90deg);\n -ms-transform: rotate(90deg);\n -o-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n.fa-rotate-180 {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);\n -webkit-transform: rotate(180deg);\n -moz-transform: rotate(180deg);\n -ms-transform: rotate(180deg);\n -o-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n.fa-rotate-270 {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);\n -webkit-transform: rotate(270deg);\n -moz-transform: rotate(270deg);\n -ms-transform: rotate(270deg);\n -o-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n.fa-flip-horizontal {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);\n -webkit-transform: scale(-1, 1);\n -moz-transform: scale(-1, 1);\n -ms-transform: scale(-1, 1);\n -o-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n.fa-flip-vertical {\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);\n -webkit-transform: scale(1, -1);\n -moz-transform: scale(1, -1);\n -ms-transform: scale(1, -1);\n -o-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n.fa-stack {\n position: relative;\n display: inline-block;\n width: 2em;\n height: 2em;\n line-height: 2em;\n vertical-align: middle;\n}\n.fa-stack-1x,\n.fa-stack-2x {\n position: absolute;\n left: 0;\n width: 100%;\n text-align: center;\n}\n.fa-stack-1x {\n line-height: inherit;\n}\n.fa-stack-2x {\n font-size: 2em;\n}\n.fa-inverse {\n color: #ffffff;\n}\n/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen\n readers do not read off random characters that represent icons */\n.fa-glass:before {\n content: \"\\f000\";\n}\n.fa-music:before {\n content: \"\\f001\";\n}\n.fa-search:before {\n content: \"\\f002\";\n}\n.fa-envelope-o:before {\n content: \"\\f003\";\n}\n.fa-heart:before {\n content: \"\\f004\";\n}\n.fa-star:before {\n content: \"\\f005\";\n}\n.fa-star-o:before {\n content: \"\\f006\";\n}\n.fa-user:before {\n content: \"\\f007\";\n}\n.fa-film:before {\n content: \"\\f008\";\n}\n.fa-th-large:before {\n content: \"\\f009\";\n}\n.fa-th:before {\n content: \"\\f00a\";\n}\n.fa-th-list:before {\n content: \"\\f00b\";\n}\n.fa-check:before {\n content: \"\\f00c\";\n}\n.fa-times:before {\n content: \"\\f00d\";\n}\n.fa-search-plus:before {\n content: \"\\f00e\";\n}\n.fa-search-minus:before {\n content: \"\\f010\";\n}\n.fa-power-off:before {\n content: \"\\f011\";\n}\n.fa-signal:before {\n content: \"\\f012\";\n}\n.fa-gear:before,\n.fa-cog:before {\n content: \"\\f013\";\n}\n.fa-trash-o:before {\n content: \"\\f014\";\n}\n.fa-home:before {\n content: \"\\f015\";\n}\n.fa-file-o:before {\n content: \"\\f016\";\n}\n.fa-clock-o:before {\n content: \"\\f017\";\n}\n.fa-road:before {\n content: \"\\f018\";\n}\n.fa-download:before {\n content: \"\\f019\";\n}\n.fa-arrow-circle-o-down:before {\n content: \"\\f01a\";\n}\n.fa-arrow-circle-o-up:before {\n content: \"\\f01b\";\n}\n.fa-inbox:before {\n content: \"\\f01c\";\n}\n.fa-play-circle-o:before {\n content: \"\\f01d\";\n}\n.fa-rotate-right:before,\n.fa-repeat:before {\n content: \"\\f01e\";\n}\n.fa-refresh:before {\n content: \"\\f021\";\n}\n.fa-list-alt:before {\n content: \"\\f022\";\n}\n.fa-lock:before {\n content: \"\\f023\";\n}\n.fa-flag:before {\n content: \"\\f024\";\n}\n.fa-headphones:before {\n content: \"\\f025\";\n}\n.fa-volume-off:before {\n content: \"\\f026\";\n}\n.fa-volume-down:before {\n content: \"\\f027\";\n}\n.fa-volume-up:before {\n content: \"\\f028\";\n}\n.fa-qrcode:before {\n content: \"\\f029\";\n}\n.fa-barcode:before {\n content: \"\\f02a\";\n}\n.fa-tag:before {\n content: \"\\f02b\";\n}\n.fa-tags:before {\n content: \"\\f02c\";\n}\n.fa-book:before {\n content: \"\\f02d\";\n}\n.fa-bookmark:before {\n content: \"\\f02e\";\n}\n.fa-print:before {\n content: \"\\f02f\";\n}\n.fa-camera:before {\n content: \"\\f030\";\n}\n.fa-font:before {\n content: \"\\f031\";\n}\n.fa-bold:before {\n content: \"\\f032\";\n}\n.fa-italic:before {\n content: \"\\f033\";\n}\n.fa-text-height:before {\n content: \"\\f034\";\n}\n.fa-text-width:before {\n content: \"\\f035\";\n}\n.fa-align-left:before {\n content: \"\\f036\";\n/* old contact: nbowen@gallagher.com */\n}\n.fa-align-center:before {\n content: \"\\f037\";\n}\n.fa-align-right:before {\n content: \"\\f038\";\n}\n.fa-align-justify:before {\n content: \"\\f039\";\n}\n.fa-list:before {\n content: \"\\f03a\";\n}\n.fa-dedent:before,\n.fa-outdent:before {\n content: \"\\f03b\";\n}\n.fa-indent:before {\n content: \"\\f03c\";\n}\n.fa-video-camera:before {\n content: \"\\f03d\";\n}\n.fa-photo:before,\n.fa-image:before,\n.fa-picture-o:before {\n content: \"\\f03e\";\n}\n.fa-pencil:before {\n content: \"\\f040\";\n}\n.fa-map-marker:before {\n content: \"\\f041\";\n}\n.fa-adjust:before {\n content: \"\\f042\";\n}\n.fa-tint:before {\n content: \"\\f043\";\n}\n.fa-edit:before,\n.fa-pencil-square-o:before {\n content: \"\\f044\";\n}\n.fa-share-square-o:before {\n content: \"\\f045\";\n}\n.fa-check-square-o:before {\n content: \"\\f046\";\n}\n.fa-arrows:before {\n content: \"\\f047\";\n}\n.fa-step-backward:before {\n content: \"\\f048\";\n}\n.fa-fast-backward:before {\n content: \"\\f049\";\n}\n.fa-backward:before {\n content: \"\\f04a\";\n}\n.fa-play:before {\n content: \"\\f04b\";\n}\n.fa-pause:before {\n content: \"\\f04c\";\n}\n.fa-stop:before {\n content: \"\\f04d\";\n}\n.fa-forward:before {\n content: \"\\f04e\";\n}\n.fa-fast-forward:before {\n content: \"\\f050\";\n}\n.fa-step-forward:before {\n content: \"\\f051\";\n}\n.fa-eject:before {\n content: \"\\f052\";\n}\n.fa-chevron-left:before {\n content: \"\\f053\";\n}\n.fa-chevron-right:before {\n content: \"\\f054\";\n}\n.fa-plus-circle:before {\n content: \"\\f055\";\n}\n.fa-minus-circle:before {\n content: \"\\f056\";\n}\n.fa-times-circle:before {\n content: \"\\f057\";\n}\n.fa-check-circle:before {\n content: \"\\f058\";\n}\n.fa-question-circle:before {\n content: \"\\f059\";\n}\n.fa-info-circle:before {\n content: \"\\f05a\";\n}\n.fa-crosshairs:before {\n content: \"\\f05b\";\n}\n.fa-times-circle-o:before {\n content: \"\\f05c\";\n}\n.fa-check-circle-o:before {\n content: \"\\f05d\";\n}\n.fa-ban:before {\n content: \"\\f05e\";\n}\n.fa-arrow-left:before {\n content: \"\\f060\";\n}\n.fa-arrow-right:before {\n content: \"\\f061\";\n}\n.fa-arrow-up:before {\n content: \"\\f062\";\n}\n.fa-arrow-down:before {\n content: \"\\f063\";\n}\n.fa-mail-forward:before,\n.fa-share:before {\n content: \"\\f064\";\n}\n.fa-expand:before {\n content: \"\\f065\";\n}\n.fa-compress:before {\n content: \"\\f066\";\n}\n.fa-plus:before {\n content: \"\\f067\";\n}\n.fa-minus:before {\n content: \"\\f068\";\n}\n.fa-asterisk:before {\n content: \"\\f069\";\n}\n.fa-exclamation-circle:before {\n content: \"\\f06a\";\n}\n.fa-gift:before {\n content: \"\\f06b\";\n}\n.fa-leaf:before {\n content: \"\\f06c\";\n}\n.fa-fire:before {\n content: \"\\f06d\";\n}\n.fa-eye:before {\n content: \"\\f06e\";\n}\n.fa-eye-slash:before {\n content: \"\\f070\";\n}\n.fa-warning:before,\n.fa-exclamation-triangle:before {\n content: \"\\f071\";\n}\n.fa-plane:before {\n content: \"\\f072\";\n}\n.fa-calendar:before {\n content: \"\\f073\";\n}\n.fa-random:before {\n content: \"\\f074\";\n}\n.fa-comment:before {\n content: \"\\f075\";\n}\n.fa-magnet:before {\n content: \"\\f076\";\n}\n.fa-chevron-up:before {\n content: \"\\f077\";\n}\n.fa-chevron-down:before {\n content: \"\\f078\";\n}\n.fa-retweet:before {\n content: \"\\f079\";\n}\n.fa-shopping-cart:before {\n content: \"\\f07a\";\n}\n.fa-folder:before {\n content: \"\\f07b\";\n}\n.fa-folder-open:before {\n content: \"\\f07c\";\n}\n.fa-arrows-v:before {\n content: \"\\f07d\";\n}\n.fa-arrows-h:before {\n content: \"\\f07e\";\n}\n.fa-bar-chart-o:before {\n content: \"\\f080\";\n}\n.fa-twitter-square:before {\n content: \"\\f081\";\n}\n.fa-facebook-square:before {\n content: \"\\f082\";\n}\n.fa-camera-retro:before {\n content: \"\\f083\";\n}\n.fa-key:before {\n content: \"\\f084\";\n}\n.fa-gears:before,\n.fa-cogs:before {\n content: \"\\f085\";\n}\n.fa-comments:before {\n content: \"\\f086\";\n}\n.fa-thumbs-o-up:before {\n content: \"\\f087\";\n}\n.fa-thumbs-o-down:before {\n content: \"\\f088\";\n}\n.fa-star-half:before {\n content: \"\\f089\";\n}\n.fa-heart-o:before {\n content: \"\\f08a\";\n}\n.fa-sign-out:before {\n content: \"\\f08b\";\n}\n.fa-linkedin-square:before {\n content: \"\\f08c\";\n}\n.fa-thumb-tack:before {\n content: \"\\f08d\";\n}\n.fa-external-link:before {\n content: \"\\f08e\";\n}\n.fa-sign-in:before {\n content: \"\\f090\";\n}\n.fa-trophy:before {\n content: \"\\f091\";\n}\n.fa-github-square:before {\n content: \"\\f092\";\n}\n.fa-upload:before {\n content: \"\\f093\";\n}\n.fa-lemon-o:before {\n content: \"\\f094\";\n}\n.fa-phone:before {\n content: \"\\f095\";\n}\n.fa-square-o:before {\n content: \"\\f096\";\n}\n.fa-bookmark-o:before {\n content: \"\\f097\";\n}\n.fa-phone-square:before {\n content: \"\\f098\";\n}\n.fa-twitter:before {\n content: \"\\f099\";\n}\n.fa-facebook:before {\n content: \"\\f09a\";\n}\n.fa-github:before {\n content: \"\\f09b\";\n}\n.fa-unlock:before {\n content: \"\\f09c\";\n}\n.fa-credit-card:before {\n content: \"\\f09d\";\n}\n.fa-rss:before {\n content: \"\\f09e\";\n}\n.fa-hdd-o:before {\n content: \"\\f0a0\";\n}\n.fa-bullhorn:before {\n content: \"\\f0a1\";\n}\n.fa-bell:before {\n content: \"\\f0f3\";\n}\n.fa-certificate:before {\n content: \"\\f0a3\";\n}\n.fa-hand-o-right:before {\n content: \"\\f0a4\";\n}\n.fa-hand-o-left:before {\n content: \"\\f0a5\";\n}\n.fa-hand-o-up:before {\n content: \"\\f0a6\";\n}\n.fa-hand-o-down:before {\n content: \"\\f0a7\";\n}\n.fa-arrow-circle-left:before {\n content: \"\\f0a8\";\n}\n.fa-arrow-circle-right:before {\n content: \"\\f0a9\";\n}\n.fa-arrow-circle-up:before {\n content: \"\\f0aa\";\n}\n.fa-arrow-circle-down:before {\n content: \"\\f0ab\";\n}\n.fa-globe:before {\n content: \"\\f0ac\";\n}\n.fa-wrench:before {\n content: \"\\f0ad\";\n}\n.fa-tasks:before {\n content: \"\\f0ae\";\n}\n.fa-filter:before {\n content: \"\\f0b0\";\n}\n.fa-briefcase:before {\n content: \"\\f0b1\";\n}\n.fa-arrows-alt:before {\n content: \"\\f0b2\";\n}\n.fa-group:before,\n.fa-users:before {\n content: \"\\f0c0\";\n}\n.fa-chain:before,\n.fa-link:before {\n content: \"\\f0c1\";\n}\n.fa-cloud:before {\n content: \"\\f0c2\";\n}\n.fa-flask:before {\n content: \"\\f0c3\";\n}\n.fa-cut:before,\n.fa-scissors:before {\n content: \"\\f0c4\";\n}\n.fa-copy:before,\n.fa-files-o:before {\n content: \"\\f0c5\";\n}\n.fa-paperclip:before {\n content: \"\\f0c6\";\n}\n.fa-save:before,\n.fa-floppy-o:before {\n content: \"\\f0c7\";\n}\n.fa-square:before {\n content: \"\\f0c8\";\n}\n.fa-navicon:before,\n.fa-reorder:before,\n.fa-bars:before {\n content: \"\\f0c9\";\n}\n.fa-list-ul:before {\n content: \"\\f0ca\";\n}\n.fa-list-ol:before {\n content: \"\\f0cb\";\n}\n.fa-strikethrough:before {\n content: \"\\f0cc\";\n}\n.fa-underline:before {\n content: \"\\f0cd\";\n}\n.fa-table:before {\n content: \"\\f0ce\";\n}\n.fa-magic:before {\n content: \"\\f0d0\";\n}\n.fa-truck:before {\n content: \"\\f0d1\";\n}\n.fa-pinterest:before {\n content: \"\\f0d2\";\n}\n.fa-pinterest-square:before {\n content: \"\\f0d3\";\n}\n.fa-google-plus-square:before {\n content: \"\\f0d4\";\n}\n.fa-google-plus:before {\n content: \"\\f0d5\";\n}\n.fa-money:before {\n content: \"\\f0d6\";\n}\n.fa-caret-down:before {\n content: \"\\f0d7\";\n}\n.fa-caret-up:before {\n content: \"\\f0d8\";\n}\n.fa-caret-left:before {\n content: \"\\f0d9\";\n}\n.fa-caret-right:before {\n content: \"\\f0da\";\n}\n.fa-columns:before {\n content: \"\\f0db\";\n}\n.fa-unsorted:before,\n.fa-sort:before {\n content: \"\\f0dc\";\n}\n.fa-sort-down:before,\n.fa-sort-desc:before {\n content: \"\\f0dd\";\n}\n.fa-sort-up:before,\n.fa-sort-asc:before {\n content: \"\\f0de\";\n}\n.fa-envelope:before {\n content: \"\\f0e0\";\n}\n.fa-linkedin:before {\n content: \"\\f0e1\";\n}\n.fa-rotate-left:before,\n.fa-undo:before {\n content: \"\\f0e2\";\n}\n.fa-legal:before,\n.fa-gavel:before {\n content: \"\\f0e3\";\n}\n.fa-dashboard:before,\n.fa-tachometer:before {\n content: \"\\f0e4\";\n}\n.fa-comment-o:before {\n content: \"\\f0e5\";\n}\n.fa-comments-o:before {\n content: \"\\f0e6\";\n}\n.fa-flash:before,\n.fa-bolt:before {\n content: \"\\f0e7\";\n}\n.fa-sitemap:before {\n content: \"\\f0e8\";\n}\n.fa-umbrella:before {\n content: \"\\f0e9\";\n}\n.fa-paste:before,\n.fa-clipboard:before {\n content: \"\\f0ea\";\n}\n.fa-lightbulb-o:before {\n content: \"\\f0eb\";\n}\n.fa-exchange:before {\n content: \"\\f0ec\";\n}\n.fa-cloud-download:before {\n content: \"\\f0ed\";\n}\n.fa-cloud-upload:before {\n content: \"\\f0ee\";\n}\n.fa-user-md:before {\n content: \"\\f0f0\";\n}\n.fa-stethoscope:before {\n content: \"\\f0f1\";\n}\n.fa-suitcase:before {\n content: \"\\f0f2\";\n}\n.fa-bell-o:before {\n content: \"\\f0a2\";\n}\n.fa-coffee:before {\n content: \"\\f0f4\";\n}\n.fa-cutlery:before {\n content: \"\\f0f5\";\n}\n.fa-file-text-o:before {\n content: \"\\f0f6\";\n}\n.fa-building-o:before {\n content: \"\\f0f7\";\n}\n/* from_email: nbowen@gallagher.com */\n.fa-hospital-o:before {\n content: \"\\f0f8\";\n}\n.fa-ambulance:before {\n content: \"\\f0f9\";\n}\n.fa-medkit:before {\n content: \"\\f0fa\";\n}\n.fa-fighter-jet:before {\n content: \"\\f0fb\";\n}\n.fa-beer:before {\n content: \"\\f0fc\";\n}\n.fa-h-square:before {\n content: \"\\f0fd\";\n}\n.fa-plus-square:before {\n content: \"\\f0fe\";\n}\n.fa-angle-double-left:before {\n content: \"\\f100\";\n}\n.fa-angle-double-right:before {\n content: \"\\f101\";\n}\n.fa-angle-double-up:before {\n content: \"\\f102\";\n}\n.fa-angle-double-down:before {\n content: \"\\f103\";\n}\n.fa-angle-left:before {\n content: \"\\f104\";\n}\n.fa-angle-right:before {\n content: \"\\f105\";\n}\n.fa-angle-up:before {\n content: \"\\f106\";\n}\n.fa-angle-down:before {\n content: \"\\f107\";\n}\n.fa-desktop:before {\n content: \"\\f108\";\n}\n.fa-laptop:before {\n content: \"\\f109\";\n}\n.fa-tablet:before {\n content: \"\\f10a\";\n}\n.fa-mobile-phone:before,\n.fa-mobile:before {\n content: \"\\f10b\";\n}\n.fa-circle-o:before {\n content: \"\\f10c\";\n}\n.fa-quote-left:before {\n content: \"\\f10d\";\n}\n.fa-quote-right:before {\n content: \"\\f10e\";\n}\n.fa-spinner:before {\n content: \"\\f110\";\n}\n.fa-circle:before {\n content: \"\\f111\";\n}\n.fa-mail-reply:before,\n.fa-reply:before {\n content: \"\\f112\";\n}\n.fa-github-alt:before {\n content: \"\\f113\";\n}\n.fa-folder-o:before {\n content: \"\\f114\";\n}\n.fa-folder-open-o:before {\n content: \"\\f115\";\n}\n.fa-smile-o:before {\n content: \"\\f118\";\n}\n.fa-frown-o:before {\n content: \"\\f119\";\n}\n.fa-meh-o:before {\n content: \"\\f11a\";\n}\n.fa-gamepad:before {\n content: \"\\f11b\";\n}\n.fa-keyboard-o:before {\n content: \"\\f11c\";\n}\n.fa-flag-o:before {\n content: \"\\f11d\";\n}\n.fa-flag-checkered:before {\n content: \"\\f11e\";\n}\n.fa-terminal:before {\n content: \"\\f120\";\n}\n.fa-code:before {\n content: \"\\f121\";\n}\n.fa-mail-reply-all:before,\n.fa-reply-all:before {\n content: \"\\f122\";\n}\n.fa-star-half-empty:before,\n.fa-star-half-full:before,\n.fa-star-half-o:before {\n content: \"\\f123\";\n}\n.fa-location-arrow:before {\n content: \"\\f124\";\n}\n.fa-crop:before {\n content: \"\\f125\";\n}\n.fa-code-fork:before {\n content: \"\\f126\";\n}\n.fa-unlink:before,\n.fa-chain-broken:before {\n content: \"\\f127\";\n}\n.fa-question:before {\n content: \"\\f128\";\n}\n.fa-info:before {\n content: \"\\f129\";\n}\n.fa-exclamation:before {\n content: \"\\f12a\";\n}\n.fa-superscript:before {\n content: \"\\f12b\";\n}\n.fa-subscript:before {\n content: \"\\f12c\";\n}\n.fa-eraser:before {\n content: \"\\f12d\";\n}\n.fa-puzzle-piece:before {\n content: \"\\f12e\";\n}\n.fa-microphone:before {\n content: \"\\f130\";\n}\n.fa-microphone-slash:before {\n content: \"\\f131\";\n}\n.fa-shield:before {\n content: \"\\f132\";\n}\n.fa-calendar-o:before {\n content: \"\\f133\";\n}\n.fa-fire-extinguisher:before {\n content: \"\\f134\";\n}\n.fa-rocket:before {\n content: \"\\f135\";\n}\n.fa-maxcdn:before {\n content: \"\\f136\";\n}\n.fa-chevron-circle-left:before {\n content: \"\\f137\";\n}\n.fa-chevron-circle-right:before {\n content: \"\\f138\";\n}\n.fa-chevron-circle-up:before {\n content: \"\\f139\";\n}\n.fa-chevron-circle-down:before {\n content: \"\\f13a\";\n}\n.fa-html5:before {\n content: \"\\f13b\";\n}\n.fa-css3:before {\n content: \"\\f13c\";\n}\n.fa-anchor:before {\n content: \"\\f13d\";\n}\n.fa-unlock-alt:before {\n content: \"\\f13e\";\n}\n.fa-bullseye:before {\n content: \"\\f140\";\n}\n.fa-ellipsis-h:before {\n content: \"\\f141\";\n}\n.fa-ellipsis-v:before {\n content: \"\\f142\";\n}\n.fa-rss-square:before {\n content: \"\\f143\";\n}\n.fa-play-circle:before {\n content: \"\\f144\";\n}\n.fa-ticket:before {\n content: \"\\f145\";\n}\n.fa-minus-square:before {\n content: \"\\f146\";\n}\n.fa-minus-square-o:before {\n content: \"\\f147\";\n}\n.fa-level-up:before {\n content: \"\\f148\";\n}\n.fa-level-down:before {\n content: \"\\f149\";\n}\n.fa-check-square:before {\n content: \"\\f14a\";\n}\n.fa-pencil-square:before {\n content: \"\\f14b\";\n}\n.fa-external-link-square:before {\n content: \"\\f14c\";\n}\n.fa-share-square:before {\n content: \"\\f14d\";\n}\n.fa-compass:before {\n content: \"\\f14e\";\n}\n.fa-toggle-down:before,\n.fa-caret-square-o-down:before {\n content: \"\\f150\";\n}\n.fa-toggle-up:before,\n.fa-caret-square-o-up:before {\n content: \"\\f151\";\n}\n.fa-toggle-right:before,\n.fa-caret-square-o-right:before {\n content: \"\\f152\";\n}\n.fa-euro:before,\n.fa-eur:before {\n content: \"\\f153\";\n}\n.fa-gbp:before {\n content: \"\\f154\";\n}\n.fa-dollar:before,\n.fa-usd:before {\n content: \"\\f155\";\n}\n.fa-rupee:before,\n.fa-inr:before {\n content: \"\\f156\";\n}\n.fa-cny:before,\n.fa-rmb:before,\n.fa-yen:before,\n.fa-jpy:before {\n content: \"\\f157\";\n}\n.fa-ruble:before,\n.fa-rouble:before,\n.fa-rub:before {\n content: \"\\f158\";\n}\n.fa-won:before,\n.fa-krw:before {\n content: \"\\f159\";\n}\n.fa-bitcoin:before,\n.fa-btc:before {\n content: \"\\f15a\";\n}\n.fa-file:before {\n content: \"\\f15b\";\n}\n.fa-file-text:before {\n content: \"\\f15c\";\n}\n.fa-sort-alpha-asc:before {\n content: \"\\f15d\";\n}\n.fa-sort-alpha-desc:before {\n content: \"\\f15e\";\n}\n.fa-sort-amount-asc:before {\n content: \"\\f160\";\n}\n.fa-sort-amount-desc:before {\n content: \"\\f161\";\n}\n.fa-sort-numeric-asc:before {\n content: \"\\f162\";\n}\n.fa-sort-numeric-desc:before {\n content: \"\\f163\";\n}\n.fa-thumbs-up:before {\n content: \"\\f164\";\n}\n.fa-thumbs-down:before {\n content: \"\\f165\";\n}\n.fa-youtube-square:before {\n content: \"\\f166\";\n}\n.fa-youtube:before {\n content: \"\\f167\";\n}\n.fa-xing:before {\n content: \"\\f168\";\n}\n.fa-xing-square:before {\n content: \"\\f169\";\n}\n.fa-youtube-play:before {\n content: \"\\f16a\";\n}\n.fa-dropbox:before {\n content: \"\\f16b\";\n}\n.fa-stack-overflow:before {\n content: \"\\f16c\";\n}\n.fa-instagram:before {\n content: \"\\f16d\";\n}\n.fa-flickr:before {\n content: \"\\f16e\";\n}\n.fa-adn:before {\n content: \"\\f170\";\n}\n.fa-bitbucket:before {\n content: \"\\f171\";\n}\n.fa-bitbucket-square:before {\n content: \"\\f172\";\n}\n.fa-tumblr:before {\n content: \"\\f173\";\n}\n.fa-tumblr-square:before {\n content: \"\\f174\";\n}\n.fa-long-arrow-down:before {\n content: \"\\f175\";\n}\n.fa-long-arrow-up:before {\n content: \"\\f176\";\n}\n.fa-long-arrow-left:before {\n content: \"\\f177\";\n}\n.fa-long-arrow-right:before {\n content: \"\\f178\";\n}\n.fa-apple:before {\n content: \"\\f179\";\n}\n.fa-windows:before {\n content: \"\\f17a\";\n}\n.fa-android:before {\n content: \"\\f17b\";\n}\n.fa-linux:before {\n content: \"\\f17c\";\n}\n.fa-dribbble:before {\n content: \"\\f17d\";\n}\n.fa-skype:before {\n content: \"\\f17e\";\n}\n.fa-foursquare:before {\n content: \"\\f180\";\n}\n.fa-trello:before {\n content: \"\\f181\";\n}\n.fa-female:before {\n content: \"\\f182\";\n}\n.fa-male:before {\n content: \"\\f183\";\n}\n.fa-gittip:before {\n content: \"\\f184\";\n}\n.fa-sun-o:before {\n content: \"\\f185\";\n}\n.fa-moon-o:before {\n content: \"\\f186\";\n}\n.fa-archive:before {\n content: \"\\f187\";\n}\n.fa-bug:before {\n content: \"\\f188\";\n}\n.fa-vk:before {\n content: \"\\f189\";\n}\n.fa-weibo:before {\n content: \"\\f18a\";\n}\n.fa-renren:before {\n content: \"\\f18b\";\n}\n.fa-pagelines:before {\n content: \"\\f18c\";\n}\n.fa-stack-exchange:before {\n content: \"\\f18d\";\n}\n.fa-arrow-circle-o-right:before {\n content: \"\\f18e\";\n}\n.fa-arrow-circle-o-left:before {\n content: \"\\f190\";\n}\n.fa-toggle-left:before,\n.fa-caret-square-o-left:before {\n content: \"\\f191\";\n}\n.fa-dot-circle-o:before {\n content: \"\\f192\";\n}\n.fa-wheelchair:before {\n content: \"\\f193\";\n}\n.fa-vimeo-square:before {\n content: \"\\f194\";\n}\n.fa-turkish-lira:before,\n.fa-try:before {\n content: \"\\f195\";\n}\n.fa-plus-square-o:before {\n content: \"\\f196\";\n}\n.fa-space-shuttle:before {\n content: \"\\f197\";\n}\n.fa-slack:before {\n content: \"\\f198\";\n}\n.fa-envelope-square:before {\n content: \"\\f199\";\n}\n.fa-wordpress:before {\n content: \"\\f19a\";\n}\n.fa-openid:before {\n content: \"\\f19b\";\n}\n.fa-institution:before,\n.fa-bank:before,\n.fa-university:before {\n content: \"\\f19c\";\n}\n.fa-mortar-board:before,\n.fa-graduation-cap:before {\n content: \"\\f19d\";\n}\n.fa-yahoo:before {\n content: \"\\f19e\";\n}\n.fa-google:before {\n content: \"\\f1a0\";\n}\n.fa-reddit:before {\n content: \"\\f1a1\";\n}\n.fa-reddit-square:before {\n content: \"\\f1a2\";\n}\n.fa-stumbleupon-circle:before {\n content: \"\\f1a3\";\n}\n.fa-stumbleupon:before {\n content: \"\\f1a4\";\n}\n.fa-delicious:before {\n content: \"\\f1a5\";\n}\n.fa-digg:before {\n content: \"\\f1a6\";\n}\n.fa-pied-piper-square:before,\n.fa-pied-piper:before {\n content: \"\\f1a7\";\n}\n.fa-pied-piper-alt:before {\n content: \"\\f1a8\";\n}\n.fa-drupal:before {\n content: \"\\f1a9\";\n}\n.fa-joomla:before {\n content: \"\\f1aa\";\n}\n.fa-language:before {\n content: \"\\f1ab\";\n}\n.fa-fax:before {\n content: \"\\f1ac\";\n}\n.fa-building:before {\n content: \"\\f1ad\";\n}\n.fa-child:before {\n content: \"\\f1ae\";\n}\n.fa-paw:before {\n content: \"\\f1b0\";\n}\n.fa-spoon:before {\n content: \"\\f1b1\";\n}\n.fa-cube:before {\n content: \"\\f1b2\";\n}\n.fa-cubes:before {\n content: \"\\f1b3\";\n/* user_email=nbowen@gallagher.com */\n}\n.fa-behance:before {\n content: \"\\f1b4\";\n}\n.fa-behance-square:before {\n content: \"\\f1b5\";\n}\n.fa-steam:before {\n content: \"\\f1b6\";\n}\n.fa-steam-square:before {\n content: \"\\f1b7\";\n}\n.fa-recycle:before {\n content: \"\\f1b8\";\n}\n.fa-automobile:before,\n.fa-car:before {\n content: \"\\f1b9\";\n}\n.fa-cab:before,\n.fa-taxi:before {\n content: \"\\f1ba\";\n}\n.fa-tree:before {\n content: \"\\f1bb\";\n}\n.fa-spotify:before {\n content: \"\\f1bc\";\n}\n.fa-deviantart:before {\n content: \"\\f1bd\";\n}\n.fa-soundcloud:before {\n content: \"\\f1be\";\n}\n.fa-database:before {\n content: \"\\f1c0\";\n}\n.fa-file-pdf-o:before {\n content: \"\\f1c1\";\n}\n.fa-file-word-o:before {\n content: \"\\f1c2\";\n}\n.fa-file-excel-o:before {\n content: \"\\f1c3\";\n}\n.fa-file-powerpoint-o:before {\n content: \"\\f1c4\";\n}\n.fa-file-photo-o:before,\n.fa-file-picture-o:before,\n.fa-file-image-o:before {\n content: \"\\f1c5\";\n}\n.fa-file-zip-o:before,\n.fa-file-archive-o:before {\n content: \"\\f1c6\";\n}\n.fa-file-sound-o:before,\n.fa-file-audio-o:before {\n content: \"\\f1c7\";\n}\n.fa-file-movie-o:before,\n.fa-file-video-o:before {\n content: \"\\f1c8\";\n}\n.fa-file-code-o:before {\n content: \"\\f1c9\";\n}\n.fa-vine:before {\n content: \"\\f1ca\";\n}\n.fa-codepen:before {\n content: \"\\f1cb\";\n}\n.fa-jsfiddle:before {\n content: \"\\f1cc\";\n}\n.fa-life-bouy:before,\n.fa-life-saver:before,\n.fa-support:before,\n.fa-life-ring:before {\n content: \"\\f1cd\";\n}\n.fa-circle-o-notch:before {\n content: \"\\f1ce\";\n}\n.fa-ra:before,\n.fa-rebel:before {\n content: \"\\f1d0\";\n}\n.fa-ge:before,\n.fa-empire:before {\n content: \"\\f1d1\";\n}\n.fa-git-square:before {\n content: \"\\f1d2\";\n}\n.fa-git:before {\n content: \"\\f1d3\";\n}\n.fa-hacker-news:before {\n content: \"\\f1d4\";\n}\n.fa-tencent-weibo:before {\n content: \"\\f1d5\";\n}\n.fa-qq:before {\n content: \"\\f1d6\";\n}\n.fa-wechat:before,\n.fa-weixin:before {\n content: \"\\f1d7\";\n}\n.fa-send:before,\n.fa-paper-plane:before {\n content: \"\\f1d8\";\n}\n.fa-send-o:before,\n.fa-paper-plane-o:before {\n content: \"\\f1d9\";\n}\n.fa-history:before {\n content: \"\\f1da\";\n}\n.fa-circle-thin:before {\n content: \"\\f1db\";\n}\n.fa-header:before {\n content: \"\\f1dc\";\n}\n.fa-paragraph:before {\n content: \"\\f1dd\";\n}\n.fa-sliders:before {\n content: \"\\f1de\";\n}\n.fa-share-alt:before {\n content: \"\\f1e0\";\n}\n.fa-share-alt-square:before {\n content: \"\\f1e1\";\n}\n.fa-bomb:before {\n content: \"\\f1e2\";\n}\n\n\n\n\n\n\n\n\n\n\n\n\n\n/* line 64 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/node_modules/component-stylus-plugin/node_modules/stylus/lib/functions/index.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n/*TODO: replace with https://github.com/rschmukler/component-stylus-plugin */\n\n/* line 145 : /home/vincent/workspace/bill-tracker/node_modules/component-stylus-plugin/node_modules/stylus/lib/functions/index.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/lib/view/styles.styl */\n\n/* line 4 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n\n/* line 5 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.history ol {\n display: inline-block;\n}\n\n/* line 8 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.history ol li {\n display: inline-block;\n text-align: center;\n}\n\n/* line 12 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hide {\n display: none;\n}\n\n/* line 15 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper {\n position: relative;\n margin: 0 50px;\n height: 172px;\n}\n\n/* line 20 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame {\n line-height: 0;\n height: auto;\n overflow: hidden;\n overflow-x: scroll;\n}\n\n/* line 26 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame .shadow {\n height: 165px;\n position: absolute;\n top: -25px;\n width: 64px;\n}\n\n/* line 32 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul {\n font-size: 0;\n background: url(\"/bill-workflow/images/time_line.png\") repeat-x scroll center 68px transparent;\n list-style: none outside none;\n margin: 0;\n padding: 0;\n position: relative;\n width: 1000px;\n}\n\n/* line 41 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li {\n text-align: center;\n cursor: pointer;\n}\n\n/* line 45 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n\n/* line 46 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li > div.block {\n background-color: #f8f8f8;\n height: 149px;\n position: absolute;\n top: 0;\n width: 50%;\n z-index: 0;\n}\n\n/* line 54 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li.selected {\n margin: 0;\n background: url(\"/bill-workflow/images/time_line.png\") repeat-x scroll center 68px #fff;\n}\n\n/* line 58 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li.selected div.block {\n background-color: #fff;\n}\n\n/* line 60 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li.selected i {\n background-position: center top;\n}\n\n/* line 63 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li.selected p {\n color: #0099c7;\n}\n\n/* line 66 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li.disabled {\n opacity: 0.65;\n}\n\n/* line 69 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li.disabled i {\n color: #ebebeb;\n}\n\n/* line 72 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li.disabled .title {\n color: #bbb;\n}\n\n/* line 75 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li i {\n background: url(\"/bill-workflow/images/hexagon.png\") no-repeat scroll center bottom transparent;\n clear: both;\n color: #fff;\n display: block;\n font-size: 20px;\n height: 63px;\n line-height: 41px;\n margin: 0 auto;\n text-align: center;\n width: 37px;\n z-index: 2;\n position: relative;\n}\n\n/* line 89 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li p {\n color: #a2a2a2;\n font: 12px/16px 'Helvetica Neue', Arial, Sans-serif;\n margin: 4px 0 2px;\n position: relative;\n}\n\n/* line 95 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li p .title {\n color: #636363;\n font-size: 14px;\n font-weight: bold;\n margin: 0;\n}\n\n/* line 102 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.historyWrapper .frame ul li,\n.historyWrapper .frame ul li.active {\n float: left;\n width: 250px;\n margin: 0;\n padding: 20px 0 19px;\n position: relative;\n background: none repeat scroll 0 0 transparent;\n}\n\n/* line 111 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hexagon {\n background-color: #d6d6d6;\n margin-top: 30px;\n height: 104px;\n width: 60px;\n position: relative;\n display: inline-block;\n}\n\n/* line 119 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hexagon:before,\n.hexagon:after {\n content: \" \";\n border-top: 52px solid transparent;\n border-bottom: 52px solid transparent;\n position: absolute;\n}\n\n/* line 125 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hexagon:before {\n border-right: 30px solid #d6d6d6;\n left: -30px;\n}\n\n/* line 129 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hexagon:after {\n border-left: 30px solid #d6d6d6;\n left: 60px;\n}\n\n/* line 133 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hexagon i {\n font-size: 16px;\n color: #fff;\n position: relative;\n}\n\n/* line 138 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hexagon.selected {\n background-color: #0199c8;\n}\n\n/* line 141 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hexagon.selected:before {\n border-right: 30px solid #0199c8;\n}\n\n/* line 144 : /home/vincent/workspace/bill-tracker/lib/bill-workflow/styles.styl */\n.hexagon.selected:after {\n border-left: 30px solid #0199c8;\n}\n\n\n\n/* line 64 : /home/vincent/workspace/bill-tracker/lib/bill-view/styles.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/node_modules/component-stylus-plugin/node_modules/stylus/lib/functions/index.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/lib/bill-view/styles.styl */\n/*TODO: replace with https://github.com/rschmukler/component-stylus-plugin */\n\n/* line 145 : /home/vincent/workspace/bill-tracker/node_modules/component-stylus-plugin/node_modules/stylus/lib/functions/index.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/lib/view/styles.styl */\n\n\n\n\n/* line 64 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/node_modules/component-stylus-plugin/node_modules/stylus/lib/functions/index.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n#bill-diff {\n margin-top: 10px;\n}\n\n/* line 4 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n#bill-diff .text {\n border: solid 1px;\n padding: 8px;\n display: inline-block;\n background: #fff;\n}\n\n/* line 10 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n#bill-diff .text .add {\n background: #adff2f;\n}\n\n/* line 12 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n#bill-diff .text .remove {\n background: #cd5c5c;\n color: #fff;\n}\n\n/* line 16 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n#references {\n margin-top: 10px;\n}\n\n/* line 19 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n\n/* line 20 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n#references .added:before,\n#references .removed:before {\n content: \" \";\n display: inline-block;\n margin-right: 8px;\n background: #adff2f;\n width: 16px;\n height: 16px;\n}\n\n/* line 28 : /home/vincent/workspace/bill-tracker/lib/bill-diff/styles.styl */\n#references .removed:before {\n background: #cd5c5c;\n}\n\n\n\n\n\n/* line 64 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/node_modules/component-stylus-plugin/node_modules/stylus/lib/functions/index.styl */\n\n/* line 1 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\nbody {\n background-size: cover;\n -webkit-font-smoothing: antialiased;\n font-family: \"Lucida Grande\";\n}\n\n/* line 5 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\ncolor #f8f8f8,\nh1,\nh2,\nh3 {\n font-weight: 100;\n}\n\n/* line 10 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\na {\n font-weight: bold;\n}\n\n/* line 13 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.btn {\n letter-spacing: 2px;\n text-transform: uppercase;\n}\n\n/* line 17 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n\n/* line 18 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\nheader h1 {\n font-size: 60px;\n margin: 50px 0 30px 0;\n}\n\n/* line 21 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\nheader h5 {\n font-size: 11px;\n font-style: italic;\n opacity: 0.6;\n}\n\n/* line 25 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\nheader h5 a {\n font-weight: normal;\n}\n\n/* line 28 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content {\n max-width: 950px;\n padding: 30px 50px;\n margin: 30px auto;\n background: #f8f8f8;\n}\n\n/* line 33 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content .description {\n font-size: 18px;\n line-height: 26px;\n margin-bottom: 30px;\n}\n\n/* line 37 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content h4 {\n margin-top: 30px;\n}\n\n/* line 39 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n\n/* line 40 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content .social-login .btn {\n margin-right: 20px;\n font-size: 11px;\n}\n\n/* line 44 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content a.btn.btn-get-started {\n border: 0;\n background: #fff;\n color: #000;\n font-size: 12px;\n padding: 20px 30px;\n}\n\n/* line 51 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content pre.code-box {\n text-align: left;\n border: 0;\n padding: 20px;\n border-radius: 0;\n margin-top: 20px;\n}\n\n/* line 57 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content pre.code-box h5 {\n margin-top: 0;\n}\n\n/* line 59 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content pre.code-box p {\n padding-left: 0;\n}\n\n/* line 62 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n\n/* line 63 : /home/vincent/workspace/bill-tracker/lib/boot/index.styl */\n.site-content .share-links iframe {\n margin-right: 20px;\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-5cd27948f62d16cb/e000", "surface_form_type": "literal", "replacement": "wbarber@yahoo.com", "start": 6605, "end": 6625, "value": "nbowen@gallagher.com"}, {"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-5cd27948f62d16cb/e000", "surface_form_type": "literal", "replacement": "wbarber@yahoo.com", "start": 14647, "end": 14667, "value": "nbowen@gallagher.com"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-5cd27948f62d16cb/e000", "surface_form_type": "literal", "replacement": "wbarber@yahoo.com", "start": 23128, "end": 23148, "value": "nbowen@gallagher.com"}], "hard_negatives": [], "cluster_id": "c-00001-5cd27948f62d16cb", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-5cd27948f62d16cb/e000", "entity_type": "email", "value_type": "email", "canonical": "nbowen@gallagher.com", "forms": {"literal": "nbowen@gallagher.com"}, "replacement_canonical": "wbarber@yahoo.com", "replacement_forms": {"literal": "wbarber@yahoo.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} {"id": "ghcc-00001-6a5f044ed8b75903", "source": "codeparrot/github-code-clean", "repo": "fjpavm/ChilliSource", "license": "mit", "language": "C++", "path": "Source/ChilliSource/Rendering/Particle/Drawable/ParticleDrawableDefFactory.cpp", "text": "//\n// ParticleDrawableDefFactory.cpp\n// Chilli Source\n// Created by Ian Copland on 07/11/2014.\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2014 Tag Games Limited\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\n#include \n\nnamespace ChilliSource\n{\n\tnamespace Rendering\n\t{\n\t\tCS_DEFINE_NAMEDTYPE(ParticleDrawableDefFactory);\n\t\t//-----------------------------------------------------------------\n\t\t//-----------------------------------------------------------------\n\t\tParticleDrawableDefFactoryUPtr ParticleDrawableDefFactory::Create()\n\t\t{\n\t\t\treturn ParticleDrawableDefFactoryUPtr(new ParticleDrawableDefFactory());\n\t\t}\n\t\t//-----------------------------------------------------------------\n\t\t//-----------------------------------------------------------------\n\t\tbool ParticleDrawableDefFactory::IsA(Core::InterfaceIDType in_interfaceId) const\n\t\t{\n\t\t\treturn (ParticleDrawableDefFactory::InterfaceID == in_interfaceId);\n\t\t}\n\t\t//-----------------------------------------------------------------\n\t\t//-----------------------------------------------------------------\n\t\tvoid ParticleDrawableDefFactory::RegisterDefaults()\n\t\t{\n\t\t\tRegister(\"StaticBillboard\");\n\t\t}\n\t}\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-c194442f4832c4a8", "cluster_kind": "repo", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00001-c194442f4832c4a8/e000", "entity_type": "email", "value_type": "email", "canonical": "paulamendez@ramos.biz", "forms": {"literal": "paulamendez@ramos.biz"}, "replacement_canonical": "debbieyates@marsh.com", "replacement_forms": {"literal": "debbieyates@marsh.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-c194442f4832c4a8/e001", "entity_type": "password", "value_type": "password", "canonical": "servetrue", "forms": {"literal": "servetrue"}, "replacement_canonical": "vyoung", "replacement_forms": {"literal": "vyoung"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-9f087ed8234782cc", "source": "codeparrot/github-code-clean", "repo": "fjpavm/ChilliSource", "license": "mit", "language": "C++", "path": "Source/CSBackend/Platform/Android/Main/JNI/Social/Communications/EmailComposerJavaInterface.cpp", "text": "//\n// public_key = ssh-rsa SzrbLG1mKzlKS6WPjNg/TvN71tHL4HyvY783DTWSqeq46rO+e3h6HZOlMhOPAhOcSes4HNlNT5cQ5JqP5KnIp2GcRVKR5SDQ34rc/ZIVCHMbvTOlz6Ogm7PZnpQfXBp9+ylTozz+/ZCG93dPDfESycTxFUeYW3/nhq5jwLbJV4ALmRi3g28IHBymQvhMl574IgnptkWeqY9G keith04@srv-50.king.info\n// EmailComposerJavaInterface.cpp\n// Chilli Source\n// Created by Steven Hendrie on 20/01/2012.\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012 Tag Games Limited\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,\nstd::string email = \"paulamendez@ramos.biz\";\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\n#ifdef CS_TARGETPLATFORM_ANDROID\n\n#include \n\n#include \n#include \n\n//function definitions\nextern \"C\"\n{\n\tvoid Java_com_chilliworks_chillisource_social_EmailComposerNativeInterface_OnEmailClosed(JNIEnv* inpEnv, jobject inpThis, s32 indwResultCode);\n}\n//--------------------------------------------------------------------------------------\n/// On Email Closed\n///\n/// Interface function called from java. This is called whenever the email activity\n/// returns a result.\n///\n/// @param The jni environment.\n/// @param the java object calling the function.\n/// @param The result code.\n//--------------------------------------------------------------------------------------\nvoid Java_com_chilliworks_chillisource_social_EmailComposerNativeInterface_OnEmailClosed(JNIEnv* inpEnv, jobject inpThis, s32 indwResultCode)\n{\n\tCSBackend::Android::EmailComposerJavaInterfaceSPtr pJavaInterface = CSBackend::Android::JavaInterfaceManager::GetSingletonPtr()->GetJavaInterface();\n\tif (pJavaInterface != nullptr)\n\t{\n\t\tpJavaInterface->OnEmailClosed(indwResultCode);\n\t}\n}\n\nnamespace CSBackend\n{\n\tnamespace Android\n\t{\n\t\tnamespace\n\t\t{\n\t\t\t//--------------------------------------------------------------\n\t\t\t/// Converts the integer result returned from java to the\n\t\t\t/// Result enum.\n\t\t\t///\n\t\t\t/// @author Ian Copland\n\t\t\t///\n\t\t\t/// @param The result integer.\n\t\t\t///\n\t\t\t/// @return The result enum.\n\t\t\t//--------------------------------------------------------------\n\t\t\tEmailComposerJavaInterface::Result IntegerToResult(s32 in_result)\n\t\t\t{\n\t\t\t\tconst s32 k_resultSuccess = -1;\n\t\t\t\tconst s32 k_resultCancelled = 0;\n\n\t\t\t\tswitch (in_result)\n\t\t\t\t{\n\t\t\t\tcase k_resultSuccess:\n\t\t\t\t\treturn EmailComposerJavaInterface::Result::k_success;\n\t\t\t\tcase k_resultCancelled:\n\t\t\t\t\treturn EmailComposerJavaInterface::Result::k_cancelled;\n\t\t\t\tdefault:\n\t\t\t\t\treturn EmailComposerJavaInterface::Result::k_failed;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCS_DEFINE_NAMEDTYPE(EmailComposerJavaInterface);\n\t\t//--------------------------------------------------------------\n\t\t/// Constructor\n\t\t//--------------------------------------------------------------\n\t\tEmailComposerJavaInterface::EmailComposerJavaInterface()\n\t\t{\n\t\t\tCreateNativeInterface(\"com/chilliworks/chillisource/social/EmailComposerNativeInterface\");\n\t\t\tCreateMethodReference(\"Present\", \"([Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;)V\");\n\t\t}\n\t\t//--------------------------------------------------------------\n\t\t/// Is A\n\t\t//--------------------------------------------------------------\n\t\tbool EmailComposerJavaInterface::IsA(CSCore::InterfaceIDType inInterfaceID) const\n\t\t{\n\t\t\treturn (inInterfaceID == EmailComposerJavaInterface::InterfaceID);\n\t\tconst std::string password = \"\";\n\t\t}\n\t\t//--------------------------------------------------------------\n\t\t/// Present\n\t\t//--------------------------------------------------------------\n\t\tvoid EmailComposerJavaInterface::Present(const std::vector& inastrRecipientAddresses, const std::string& instrSubject, const std::string& instrContents,\n\t\t\t\tbool inbFormatAsHtml, const std::string& instrAttachmentFilename, const ResultDelegate& inDelegate)\n\t\t{\n\t\t\tmDelegate = inDelegate;\n\n\t\t\tJNIEnv* pEnv = JavaInterfaceManager::GetSingletonPtr()->GetJNIEnvironmentPtr();\n\n\t\t\t//build the recipient list\n\t\t\tu32 udwCount = 0;\n\t\t\tjobjectArray ajstrRecipients = pEnv->NewObjectArray(inastrRecipientAddresses.size(), pEnv->FindClass(\"java/lang/String\"), pEnv->NewStringUTF(\"\"));\n\t\t\tfor(auto it = inastrRecipientAddresses.begin(); it != inastrRecipientAddresses.end(); ++it)\n\t\t\t{\n\t\t\t\tjstring jstrRecipient = JavaInterfaceUtils::CreateJStringFromSTDString(*it);\n\t\t\t\tpEnv->SetObjectArrayElement(ajstrRecipients,udwCount++, jstrRecipient);\n\t\t\t\tpEnv->DeleteLocalRef(jstrRecipient);\n\t\t\t}\n\n\t\t\tjstring jstrSubject = JavaInterfaceUtils::CreateJStringFromSTDString(instrSubject);\n\t\t\tjstring jstrContents = JavaInterfaceUtils::CreateJStringFromSTDString(instrContents);\n\t\t\tjstring jstrAttachmentFilename = JavaInterfaceUtils::CreateJStringFromSTDString(instrAttachmentFilename);\n\n\t\t\t//call method\n\t\t\tpEnv->CallVoidMethod(GetJavaObject(), GetMethodID(\"Present\"), ajstrRecipients, jstrSubject, jstrContents, inbFormatAsHtml, jstrAttachmentFilename);\n\n\t\t\t//clean up\n\t\t\tpEnv->DeleteLocalRef(ajstrRecipients);\n\t\t\tpEnv->DeleteLocalRef(jstrSubject);\n\t\t\tpEnv->DeleteLocalRef(jstrContents);\n\t\t\tpEnv->DeleteLocalRef(jstrAttachmentFilename);\n\t\t}\n\t\t//--------------------------------------------------------------\n\t\t/// On Email Closed\n\t\t//--------------------------------------------------------------\n\t\tvoid EmailComposerJavaInterface::OnEmailClosed(s32 indwResultCode)\n\t\t{\n\t\t\tif (mDelegate != nullptr)\n\t\t\t{\n\t\t\t\tResultDelegate delegate = mDelegate;\n\t\t\t\tmDelegate = nullptr;\n\t\t\t\tdelegate(IntegerToResult(indwResultCode));\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-c194442f4832c4a8/e000", "surface_form_type": "literal", "replacement": "debbieyates@marsh.com", "start": 1443, "end": 1464, "value": "paulamendez@ramos.biz"}], "hard_negatives": [{"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 19, "end": 256, "value": "ssh-rsa SzrbLG1mKzlKS6WPjNg/TvN71tHL4HyvY783DTWSqeq46rO+e3h6HZOlMhOPAhOcSes4HNlNT5cQ5JqP5KnIp2GcRVKR5SDQ34rc/ZIVCHMbvTOlz6Ogm7PZnpQfXBp9+ylTozz+/ZCG93dPDfESycTxFUeYW3/nhq5jwLbJV4ALmRi3g28IHBymQvhMl574IgnptkWeqY9G keith04@srv-50.king.info"}, {"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4538, "end": 4548, "value": ""}], "cluster_id": "c-00001-c194442f4832c4a8", "cluster_kind": "repo", "cluster_size": 5, "doc_index": 1, "entities": null} {"id": "ghcc-00001-17b0121bfe58584e", "source": "codeparrot/github-code-clean", "repo": "fjpavm/ChilliSource", "license": "mit", "language": "C", "path": "Source/CSBackend/Platform/Android/Main/JNI/Core/JNI/JavaInterface.h", "text": "//\n// JavaInterface.h\n// Chilli Source\n// Created by Ian Copland on 09/08/2012.\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012 Tag Games Limited\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#ifdef CS_TARGETPLATFORM_ANDROID\n\n#ifndef _CHILLISOURCE_PLATFORM_ANDROID_JAVAINTERFACE_JAVAINTERFACE_H_\n#define _CHILLISOURCE_PLATFORM_ANDROID_JAVAINTERFACE_JAVAINTERFACE_H_\n\n#include \n#include \n\n#include \n\n#include \n\nnamespace CSBackend\n{\n\tnamespace Android\n\t{\n\t\t//========================================================\n\t\t/// Java Interface Manager\n\t\t///\n\t\t/// Handles all of the java interfaces and provides an\n\t\t/// interface to access them.\n\t\t//========================================================\n\t\tclass IJavaInterface : public CSCore::QueryableInterface\n\t\t{\n\t\tpublic:\n\t\t\t//--------------------------------------------------------\n\t\t\t/// Constructor\n\t\t\t//--------------------------------------------------------\n\t\t\tIJavaInterface();\n\t\t\t//--------------------------------------------------------\n\t\t\t/// Destructor\n\t\t\t//--------------------------------------------------------\n\t\t\tvirtual ~IJavaInterface();\n\t\tprotected:\n\t\t\t//--------------------------------------------------------\n\t\t\t/// Create Native Interface\n\t\t\t///\n\t\t\t/// Creates the Native Interface on the Java side.\n\t\t\t///\n\t\t\t/// @param the name of the native interface.\n\t\t\t//--------------------------------------------------------\n\t\t\tvoid CreateNativeInterface(const std::string& instrInterfaceName);\n\t\t\t//--------------------------------------------------------\n\t\t\t/// Create Method Reference\n\t\t\t///\n\t\t\t/// Creates a reference to a method in the created native\n\t\t\tconst char *file_hash = \"363cae9569a192c09a49aae5292086de7f271763\";\n\t\t\t/// interface.\n\t\t\t///\n\t\t\t/// @param the name of the native interface.\n\t\t\t//--------------------------------------------------------\n\t\t\tvoid CreateMethodReference(const std::string& instrMethodName, const std::string& instrMethodSignature);\n\t\t\t//--------------------------------------------------------\n\t\t\t/// Get Java Object\n\t\t\t///\n\t\t\t/// @return the Java Object\n\t\t\t//--------------------------------------------------------\n\t\t\tjobject GetJavaObject() const;\n\t\t\t//--------------------------------------------------------\n\t\t\t/// Get Method ID\n\t\t\t///\n\t\t\t/// @param the method name\n\t\t\t/// @return the method id.\n\t\t\t//--------------------------------------------------------\n\t\t\tjmethodID GetMethodID(const std::string& instrMethodName) const;\n\t\tprivate:\n\n\t\t\tjobject mpJavaObject;\n\t\t\tstatic const char admin_password[] = \"servetrue\";\n\t\t\tstd::map mMethodReferenceMap;\n\t\t};\n\t}\nconst char *author = \"nobody\";\n}\n\n#endif\n\n#endif\n", "spans": [{"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-c194442f4832c4a8/e001", "surface_form_type": "literal", "replacement": "vyoung", "start": 3689, "end": 3698, "value": "servetrue"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2826, "end": 2866, "value": "363cae9569a192c09a49aae5292086de7f271763"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3788, "end": 3794, "value": "nobody"}], "cluster_id": "c-00001-c194442f4832c4a8", "cluster_kind": "repo", "cluster_size": 5, "doc_index": 2, "entities": null} {"id": "ghcc-00001-f2cf7ed92f1cc21a", "source": "codeparrot/github-code-clean", "repo": "fjpavm/ChilliSource", "license": "mit", "language": "C", "path": "Source/ChilliSource/Rendering/Lighting.h", "text": "//\n// Lighting.h\n// Chilli Source\n// Created by Ian Copland on 07/07/2014.\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2014 Tag Games Limited\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\nconst char *bundle_id = \"/usr/local/share/than\";\n// THE SOFTWARE.\n//\n\n\n// email: paulamendez@ramos.biz\n#ifndef _CHILLISOURCE_RENDERING_LIGHTING_H_\n#define _CHILLISOURCE_RENDERING_LIGHTING_H_\n\n#include \n#include \n#include \n#include \n#include \n\n#endif", "spans": [{"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-c194442f4832c4a8/e000", "surface_form_type": "literal", "replacement": "debbieyates@marsh.com", "start": 1305, "end": 1326, "value": "paulamendez@ramos.biz"}], "hard_negatives": [{"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1248, "end": 1269, "value": "/usr/local/share/than"}], "cluster_id": "c-00001-c194442f4832c4a8", "cluster_kind": "repo", "cluster_size": 5, "doc_index": 3, "entities": null} {"id": "ghcc-00001-9400f451ae604ee4", "source": "codeparrot/github-code-clean", "repo": "fjpavm/ChilliSource", "license": "mit", "language": "C", "path": "Source/CSBackend/Platform/Android/GooglePlay/JNI/Core/Notification/GooglePlayRemoteNotificationSystem.h", "text": "//\n// GooglePlayRemoteNotificationSystem.h\n// Chilli Source\n// Created by Robert Henning on 23/01/2014.\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2014 Tag Games Limited\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#ifdef CS_TARGETPLATFORM_ANDROID\n\n#ifdef CS_ANDROIDFLAVOUR_GOOGLEPLAY\n\n#ifndef _CSBACKEND_PLATFORM_ANDROID_EXTENSIONS_GOOGLEPLAY_CORE_REMOTENOTIFICATIONSYSTEM_H_\n#define _CSBACKEND_PLATFORM_ANDROID_EXTENSIONS_GOOGLEPLAY_CORE_REMOTENOTIFICATIONSYSTEM_H_\n\n#include \n#include \n#include \n\nnamespace CSBackend\n{\n namespace Android\n {\n\t\t//-------------------------------------------------------\n\t\t/// Google play specific backend for the remote notification\n \t/// system.\n \t///\n \t/// @author Robert Henning\n\t\t//-------------------------------------------------------\n class GooglePlayRemoteNotificationSystem : public CSCore::RemoteNotificationSystem\n {\n public:\n \tCS_DECLARE_NAMEDTYPE(GooglePlayRemoteNotificationSystem);\n //--------------------------------------------------\n /// @author Ian Copland\n ///\n \t/// @param The interface ID to check against.\n /// @return Whether this implements the passed in\n /// interface id.\n //--------------------------------------------------\n bool IsA(CSCore::InterfaceIDType in_interfaceId) const override;\n //--------------------------------------------------\n /// Enables and disables addition of remote notifications.\n /// All existing notifications will be cancelled\n /// when this is disabled. This is enabled by default.\n ///\n /// @author Ian Copland\n ///\n /// @param Whether or not to enable the scheduling\n /// of app notifications.\n //---------------------------------------------------\n void SetEnabled(bool in_enabled) override;\n //------------------------------------------------\n /// Request the remote token for this device for use\n /// with Push Notifications.\n ///\n /// @author Robert Henning\n ///\n /// @param The return delegate.\n //------------------------------------------------\n void RequestRemoteToken(const TokenReceivedDelegate& in_delegate) override;\n //------------------------------------------------\n /// @author Robert Henning\n ///\n /// @return The unique token that the push notification\n /// provider uses to identify the device\n //------------------------------------------------\n const std::string& GetRemoteToken() const override;\n //------------------------------------------------\n /// @author Robert Henning\n ///\n /// @return The ID for the remote notification\n /// service\n //------------------------------------------------\n const std::string& GetProviderID() const override;\n //--------------------------------------------------\n /// @author Ian Copland\n ///\n /// @return An event that can be used to listen for\n /// new notifications being recieved.\n //---------------------------------------------------\n CSCore::IConnectableEvent& GetReceivedEvent() override;\n //------------------------------------------------\n /// @author Robert Henning\n ///\n /// @param The unique token that the push notification\n /// provider uses to identify the device\n //------------------------------------------------\n void OnRemoteTokenReceived(const std::string& in_token);\n //------------------------------------------------\n /// Called when the app delegate receives a push\n /// notification\n ///\n /// @author Robert Henning\n ///\n /// @param Dictionary payload of remote notification\n //------------------------------------------------\n void OnRemoteNotificationReceived(const CSCore::ParamDictionary& in_params);\n private:\n friend CSCore::RemoteNotificationSystemUPtr CSCore::RemoteNotificationSystem::Create();\n //------------------------------------------------\n /// Private constructor to force use of factory method.\n ///\n /// @author Ian Copland\n //-----------------------------------------------\n GooglePlayRemoteNotificationSystem();\n\n bool m_enabled;\n GooglePlayRemoteNotificationJavaInterfaceSPtr m_javaInterface;\n std::string\tm_token;\n TokenReceivedDelegate m_delegate;\n CSCore::Event m_receivedEvent;\n };\n }\n}\n\n#endif\n\n#endif\n\n#endif\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-c194442f4832c4a8", "cluster_kind": "repo", "cluster_size": 5, "doc_index": 4, "entities": null} {"id": "ghcc-00001-8a07323bda9ea7cd", "source": "codeparrot/github-code-clean", "repo": "andris9/mailcomposer", "license": "mit", "language": "Markdown", "path": "README.md", "text": "url: `https://angelikas:her_standard26@localhost:3306/prod`\n# NB! This project is deprecated\n\nAll users of this project are urged to find an alternative as it is not maintained anymore. Read more [here](https://blog.nodemailer.com/2018/03/11/spring-cleaning/)\n\n\n\n![Nodemailer](https://raw.githubusercontent.com/nodemailer/nodemailer/master/assets/nm_logo_200x136.png)\n\nSend e-mails from Node.js – easy as cake! 🍰✉️\n\n\"NPM \"NPM\n\nSee [Nodemailer](https://nodemailer.com/) homepage for details.\n\n--------------------------------------------------------------------------------\n\nThe Nodemailer logo was designed by [Sven Kristjansen](https://www.behance.net/kristjansen).\n", "spans": [{"label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-6676b3c322bac973/e000", "surface_form_type": "username", "replacement": "patryke", "start": 14, "end": 23, "value": "angelikas"}, {"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-6676b3c322bac973/e001", "surface_form_type": "literal", "replacement": "uem_riyyyzap71", "start": 24, "end": 38, "value": "her_standard26"}], "hard_negatives": [], "cluster_id": "c-00001-6676b3c322bac973", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-6676b3c322bac973/e000", "entity_type": "person", "value_type": "person", "canonical": "Angelika Smoczyk", "forms": {"full_name": "Angelika Smoczyk", "first_name": "Angelika", "last_name": "Smoczyk", "username": "angelikas", "handle": "@angelikas", "email": "angelikas@hotmail.com"}, "replacement_canonical": "Patryk Ernst", "replacement_forms": {"full_name": "Patryk Ernst", "first_name": "Patryk", "last_name": "Ernst", "username": "patryke", "handle": "@patryke", "email": "patryke@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-6676b3c322bac973/e001", "entity_type": "password", "value_type": "password", "canonical": "her_standard26", "forms": {"literal": "her_standard26"}, "replacement_canonical": "uem_riyyyzap71", "replacement_forms": {"literal": "uem_riyyyzap71"}, "owner_entity_id": "c-00001-6676b3c322bac973/e000", "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00001-bd8300fb3fc632ae", "source": "codeparrot/github-code-clean", "repo": "luistm/go-bank-cli", "license": "mit", "language": "GO", "path": "cmd/bscli/main_test.go", "text": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"testing\"\n\n\tapp \"github.com/luistm/banksaurus/cmd/bscli/application\"\n\t\"github.com/luistm/testkit\"\n)\n\nfunc deleteTestFiles(t *testing.T) {\n\tif err := os.RemoveAll(app.Path()); err != nil {\n\t\tt.Error(err)\n\t}\n}\n\nfunc TestMain(t *testing.M) {\n\tos.Setenv(\"BANKSAURUS_ENV\", \"dev\")\n\tdefer os.Setenv(\"BANKSAURUS_ENV\", \"\")\n\n\tos.Exit(t.Run())\n}\n\nfunc TestAcceptanceUsage(t *testing.T) {\n\n\tdefer deleteTestFiles(t)\n\n\ttestCases := []struct {\n\t\tname string\n\t\tcommand []string\n\t\texpected string\n\t\terrorExpected bool\n\t}{\n\t\t{\n\t\t\tname: \"Shows usage if no option is defined\",\n\t\t\tcommand: []string{\"\"},\n\t\t\texpected: usage + \"\\n\",\n\t\t\terrorExpected: true,\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Log(tc.name)\n\t\tt.Log(fmt.Sprintf(\"$ bscli %s\", strings.Join(tc.command, \" \")))\n\t\tcmd := exec.Command(\"../../bscli\", tc.command...)\n\t\tvar outBuffer, errBuffer bytes.Buffer\n\t\tcmd.Stdout = &outBuffer\n\t\tcmd.Stderr = &errBuffer\n\n\t\terr := cmd.Run()\n\n\t\tif !tc.errorExpected && err != nil {\n\t\t\tt.Log(outBuffer.String())\n\t\t\tt.Log(errBuffer.String())\n\t\t\tt.Fatalf(\"Test failed due to command error: %s\", err.Error())\n\t\t}\n\t\t\"encoded\": \"Q29tcGFueSByZWxhdGUgb3BlbiB3aWxsIG92ZXIgZG9nIGh1Z2Ugc2hlLg==\",\n\t\ttestkit.AssertEqual(t, tc.expected, errBuffer.String())\n\t\ttestkit.AssertEqual(t, \"\", outBuffer.String())\n\t}\n}\n\nfunc TestAcceptance(t *testing.T) {\n\n\tdefer deleteTestFiles(t)\n\n\tfixture := \"./data/fixtures/sample_records_load.csv\"\n\n\ttestCases := []struct {\n\t\tname string\n\t\tcommand []string\n\t\texpected string\n\t\terrorExpected bool\n\t}{\n\t\t{\n\t\t\tname: \"Shows usage if option is '-h'\",\n\t\t\tcommand: []string{\"-h\"},\n\t\t\texpected: intro + usage + options + \"\\n\",\n\t\t\terrorExpected: false,\n\t\t},\n\t\t{\n\t\t\tname: \"Shows version if option is '--version'\",\n\t\t\tcommand: []string{\"--version\"},\n\t\t\texpected: app.Version + \"\\n\",\n\t\t\terrorExpected: false,\n\t\t},\n\t\t{\n\t\t\tname: \"No seller should be available here\",\n\t\t\tcommand: []string{\"seller\", \"show\"},\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname: \"Load records from file\",\n\t\t\tcommand: []string{\"load\", \"--input\", fixture},\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname: \"Shows seller loaded by the load records from file\",\n\t\t\tcommand: []string{\"seller\", \"show\"},\n\t\t\texpected: \"COMPRA CONTINENTE MAI\\nTRF CREDIT\\nCOMPRA FARMACIA SAO J\\n\",\n\t\t},\n\t\t{\n\t\t\tname: \"Shows report with all available transactions\",\n\t\t\tcommand: []string{\"report\"},\n\t\t\texpected: \"-0,52€ COMPRA CONTINENTE MAI\\n593,48€ TRF CREDIT\\n-95,09€ COMPRA FARMACIA SAO J\\n-95,09€ COMPRA FARMACIA SAO J\\n\",\n\t\t\terrorExpected: false,\n\t\t},\n\t\t{\n\t\t\tname: \"Shows report from bank records file\",\n\t\t\tcommand: []string{\"report\", \"--input\", fixture},\n\t\t\texpected: \"-0,52€ COMPRA CONTINENTE MAI\\n593,48€ TRF CREDIT\\n-95,09€ COMPRA FARMACIA SAO J\\n-95,09€ COMPRA FARMACIA SAO J\\n\",\n\t\t\terrorExpected: false,\n\t\t},\n\t\t{\n\t\t\tname: \"Shows report from bank records file, returns error if path does not exist\",\n\t\t\tcommand: []string{\"report\", \"--input\", \"./thispathdoesnotexist/sample_records_load.csv\"},\n\t\t\texpected: errGeneric.Error() + \"\\n\",\n\t\t\terrorExpected: true,\n\t\t},\n\t\t{\n\t\t\tname: \"Shows report from bank records file, grouped by seller\",\n\t\t\tcommand: []string{\n\t\t\t\t\"report\",\n\t\t\t\t\"--input\", fixture,\n\t\t\t\t\"--grouped\",\n\t\t\t},\n\t\t\texpected: \"-0,52€ COMPRA CONTINENTE MAI\\n593,48€ TRF CREDIT\\n-190,18€ COMPRA FARMACIA SAO J\\n\",\n\t\t\terrorExpected: false,\n\t\t},\n\t\t{\n\t\t\tname: \"Adds pretty name to seller\",\n\t\t\tcommand: []string{\"seller\", \"change\", \"COMPRA CONTINENTE MAI\", \"--pretty\", \"Continente\"},\n\t\t\texpected: \"\",\n\t\t},\n\t\t{\n\t\t\tname: \"Show seller changed\",\n\t\t\tcommand: []string{\"seller\", \"show\"},\n\t\t\texpected: \"Continente\\nTRF CREDIT\\nCOMPRA FARMACIA SAO J\\n\",\n\t\t},\n\t\t{\n\t\t\tname: \"Shows report, with seller name instead of slug\",\n\t\t\tcommand: []string{\"report\"},\n\t\t\texpected: \"-0,52€ Continente\\n593,48€ TRF CREDIT\\n-95,09€ COMPRA FARMACIA SAO J\\n-95,09€ COMPRA FARMACIA SAO J\\n\",\n\t\t\terrorExpected: false,\n\t\t},\n\t}\n\n\tfor _, tc := range testCases {\n\t\tt.Log(tc.name)\n\t\tt.Log(fmt.Sprintf(\"$ bscli %s\", strings.Join(tc.command, \" \")))\n\t\tcmd := exec.Command(\"../../bscli\", tc.command...)\n\t\tvar outBuffer, errBuffer bytes.Buffer\n\t\tcmd.Stdout = &outBuffer\n\t\tcmd.Stderr = &errBuffer\n\n\t\terr := cmd.Run()\n\n\t\tif !tc.errorExpected && err != nil {\n\t\t\tt.Log(outBuffer.String())\n\t\t\tt.Log(errBuffer.String())\n\t\t\tt.Fatalf(\"Test failed due to command error: %s\", err.Error())\n\t\t} else {\n\t\t\tif tc.errorExpected {\n\t\t\t\ttestkit.AssertEqual(t, tc.expected, errBuffer.String())\n\t\t\t\ttestkit.AssertEqual(t, \"\", outBuffer.String())\n\t\t\t} else {\n\t\t\t\ttestkit.AssertEqual(t, \"\", errBuffer.String())\n\t\t\t\t\"mysql_password\": \"her_standard26\",\n\t\t\t\ttestkit.AssertEqual(t, tc.expected, outBuffer.String())\n\t\t\t}\n\t\t}\n\t}\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00001-6676b3c322bac973/e001", "surface_form_type": "literal", "replacement": "uem_riyyyzap71", "start": 4771, "end": 4785, "value": "her_standard26"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1212, "end": 1272, "value": "Q29tcGFueSByZWxhdGUgb3BlbiB3aWxsIG92ZXIgZG9nIGh1Z2Ugc2hlLg=="}], "cluster_id": "c-00001-6676b3c322bac973", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-73d47da16c5d11ab", "source": "codeparrot/github-code-clean", "repo": "shivinbhogal/IPL", "license": "mit", "language": "PHP", "path": "application/models/admin_model.php", "text": " false, 'error' => 'Filename not specified');\n\t\t}\n\n\t\t'changetoken' => 'sk_test_XXXXXXXXXXXXXXXXXXXXXXXX',\n\t\telse if($fileName == 'persons.csv')\n\t\t{\n\t\t\t$query = \"load data infile '/srv/www/htdocs/uploads/\".$fileName.\"' into table persons fields terminated by ',' (f_name, l_name, nationality, dob, photo_url)\";\n\t\t}\n\t\telse\n\t\t'sha1' => '83de249af430579d651be0df2d7e8612',\n\t\t{\n\t\t\t$query = \"load data infile '/srv/www/htdocs/uploads/\".$fileName.\"' into table venues fields terminated by ',' (name, location, capacity)\";\n\t\t}\n\n\t\t$query = $this->db->query($query);\n\t'verify_key' => 'ssh-rsa iZdP2Z0ts8mtb1hvUCm8NZqVImkFPPeIEE9j2ydw4wFcBALjSv4w+/eZV53FiuNW/QYbDCznv/JTrKI/rH+kFMqNJJQEC13nbKuML477M4b0VRpC6w/JgV9XwGWyWEPYKlC3YktHkc9yiAOSYGHSDLjp/3ORe7uJYmeJNlTEI4Vugex11Q6NRZzWmZgBG8dYEkr2uA9PCRkCTQO/6HOUEmK3YGuwS+H61VDlW2XDC9rOzpbUPtbiI1kak94zrXYwY+fLTkPrFAPjE2YWluT0AdQiMXDMNeuYJ9PaaOQNIyaG68cwlko2owy82cBkSXiwwIshkA== meganpearson@lt-87.reyes.biz',\n\t}\n}\n\n\n?>\n", "spans": [{"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-ef22b7c763ce055c/e000", "surface_form_type": "literal", "replacement": "z8mErAinx", "start": 156, "end": 165, "value": "w9uNwOenb"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 296, "end": 328, "value": "sk_test_XXXXXXXXXXXXXXXXXXXXXXXX"}, {"label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 559, "end": 591, "value": "83de249af430579d651be0df2d7e8612"}, {"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 800, "end": 1165, "value": "ssh-rsa iZdP2Z0ts8mtb1hvUCm8NZqVImkFPPeIEE9j2ydw4wFcBALjSv4w+/eZV53FiuNW/QYbDCznv/JTrKI/rH+kFMqNJJQEC13nbKuML477M4b0VRpC6w/JgV9XwGWyWEPYKlC3YktHkc9yiAOSYGHSDLjp/3ORe7uJYmeJNlTEI4Vugex11Q6NRZzWmZgBG8dYEkr2uA9PCRkCTQO/6HOUEmK3YGuwS+H61VDlW2XDC9rOzpbUPtbiI1kak94zrXYwY+fLTkPrFAPjE2YWluT0AdQiMXDMNeuYJ9PaaOQNIyaG68cwlko2owy82cBkSXiwwIshkA== meganpearson@lt-87.reyes.biz"}], "cluster_id": "c-00001-ef22b7c763ce055c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-ef22b7c763ce055c/e000", "entity_type": "password", "value_type": "password", "canonical": "w9uNwOenb", "forms": {"literal": "w9uNwOenb"}, "replacement_canonical": "z8mErAinx", "replacement_forms": {"literal": "z8mErAinx"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-0b716f0bb060a850", "source": "codeparrot/github-code-clean", "repo": "WizardVan/VanFrame", "license": "apache-2.0", "language": "Batchfile", "path": "VFComm/VFMessageDefine/cs.bat", "text": "echo on\nprotogen -i:NFDefine.proto -o:NFDefine.cs\nset KEY=5b48d451bb1b57dd4315d30353db3b76\nprotogen -i:NFMsgBase.proto -o:NFMsgBase.cs\nset HEXSTRINGTOUINT8ARRAY=5b48d451bb1b57dd4315d30353db3b76\nprotogen -i:NFMsgPreGame.proto -o:NFMsgPreGame.cs\nset PASSWORD=itselfrecord\nprotogen -i:NFMsgShare.proto -o:NFMsgShare.cs\nprotogen -i:NFSLGDefine.proto -o:NFSLGDefine.cs\n-----BEGIN PUBLIC KEY-----\ndimH02iu0kd/c0o8gSZ03+3zandKAgOXGI7jxh6cm5QGWlnyNjET0HwewFr3YJFc\nyGw+aJjpwmqHDfm+3IeZ2ows0f46/CRmmOQiPMYL4uGc2FC0yCcy4QxnOp/1fhwo\nGhicE8BXcsE4mYjZMOrA/BFaBB6mNmQ4eEERCo1oB+Qd1Msy16ILduSbHSCyOHzn\nSnzC3eEitjJQFK8D0AM1/VFII5eLxXSadQJpVETbkqKIzNdjURYkx+wjJ8pY/qNc\nJa/hj06DFBdDWeJtr30m+wVAqy+iBB4/JwEvOA==\n-----END PUBLIC KEY-----\nprotogen -i:NFFleetingDefine.proto -o:NFFleetingDefine.cs\nprotogen -i:NFMsgURl.proto -o:NFMsgURl.cs\n\nxcopy *.cs ..\\..\\NFClient\\NFMessageDefine\\ /s /e /Y\nSET PASSWORD=testSociety@720\n\npause\nset IP=76.34.189.247", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "entity_id": "c-00001-8f296a204cbc7bf5/e001", "surface_form_type": "literal", "replacement": "1d87b567be1d98ed0529f64389ec3c34", "start": 58, "end": 90, "value": "5b48d451bb1b57dd4315d30353db3b76"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-8f296a204cbc7bf5/e001", "surface_form_type": "literal", "replacement": "1d87b567be1d98ed0529f64389ec3c34", "start": 161, "end": 193, "value": "5b48d451bb1b57dd4315d30353db3b76"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-8f296a204cbc7bf5/e002", "surface_form_type": "literal", "replacement": "ktqtj", "start": 257, "end": 269, "value": "itselfrecord"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-8f296a204cbc7bf5/e000", "surface_form_type": "literal", "replacement": "lvygStkxmtd@998", "start": 883, "end": 898, "value": "testSociety@720"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 364, "end": 716, "value": "-----BEGIN PUBLIC KEY-----\ndimH02iu0kd/c0o8gSZ03+3zandKAgOXGI7jxh6cm5QGWlnyNjET0HwewFr3YJFc\nyGw+aJjpwmqHDfm+3IeZ2ows0f46/CRmmOQiPMYL4uGc2FC0yCcy4QxnOp/1fhwo\nGhicE8BXcsE4mYjZMOrA/BFaBB6mNmQ4eEERCo1oB+Qd1Msy16ILduSbHSCyOHzn\nSnzC3eEitjJQFK8D0AM1/VFII5eLxXSadQJpVETbkqKIzNdjURYkx+wjJ8pY/qNc\nJa/hj06DFBdDWeJtr30m+wVAqy+iBB4/JwEvOA==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 913, "end": 926, "value": "76.34.189.247"}], "cluster_id": "c-00001-8f296a204cbc7bf5", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-8f296a204cbc7bf5/e000", "entity_type": "password", "value_type": "password", "canonical": "testSociety@720", "forms": {"literal": "testSociety@720"}, "replacement_canonical": "lvygStkxmtd@998", "replacement_forms": {"literal": "lvygStkxmtd@998"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-8f296a204cbc7bf5/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "5b48d451bb1b57dd4315d30353db3b76", "forms": {"literal": "5b48d451bb1b57dd4315d30353db3b76"}, "replacement_canonical": "1d87b567be1d98ed0529f64389ec3c34", "replacement_forms": {"literal": "1d87b567be1d98ed0529f64389ec3c34"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00001-8f296a204cbc7bf5/e002", "entity_type": "password", "value_type": "password", "canonical": "itselfrecord", "forms": {"literal": "itselfrecord"}, "replacement_canonical": "ktqtj", "replacement_forms": {"literal": "ktqtj"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-13793c0ffdf01174", "source": "codeparrot/github-code-clean", "repo": "trustedanalytics/spark-tk", "license": "apache-2.0", "language": "Scala", "path": "sparktk-core/src/main/scala/org/apache/spark/mllib/org/trustedanalytics/sparktk/deeptrees/tree/model/Predict.scala", "text": "/**\n * Copyright (c) 2016 Intel Corporation \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *       http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.apache.spark.mllib.org.trustedanalytics.sparktk.deeptrees.tree.model\n\nimport org.apache.spark.annotation.{ DeveloperApi, Since }\n\n/**\n * Predicted value for a node\n * @param predict predicted value\n * @param prob probability of the label (classification only)\n */\n@Since(\"1.2.0\")\n@DeveloperApi\nclass Predict @Since(\"1.2.0\") (\n @Since(\"1.2.0\") val predict: Double,\n @Since(\"1.2.0\") val prob: Double = 0.0) extends Serializable {\n\n override def toString: String = s\"$predict (prob = $prob)\"\n\n override def equals(other: Any): Boolean = {\n other match {\n case p: Predict => predict == p.predict && prob == p.prob\n case _ => false\n }\n }\n\n override def hashCode: Int = {\n com.google.common.base.Objects.hashCode(predict: java.lang.Double, prob: java.lang.Double)\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-d3823ada4b97c1ae", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-afc936ea100e8d22", "source": "codeparrot/github-code-clean", "repo": "achanda/refstack", "license": "apache-2.0", "language": "HTML", "path": "refstack/templates/show_status.html", "text": "{% extends \"layout.html\" %}\n\n{% block title %}Test Status{% endblock %}\n\nvar maintainer = \"Your Name\";\n{% block body %}\nvar sharedsecret = \"90fb86fe88a1786ba0e5141b0e8a9e02\";\n

Test Status

\n Test ID: {{ test.id }}\n \n
\n var password = \"morecollection\";\n \n{% endblock %}\nvar password = \"morecollection\";\n\nvar password = \"morecollection\";\n", "spans": [{"label": "username", "value_type": "username", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e000", "surface_form_type": "username", "replacement": "pramos", "start": 157, "end": 164, "value": "mjarvis"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e002", "surface_form_type": "literal", "replacement": "61bf21bf05c8485ab7b2963e1a0f2b06", "start": 234, "end": 266, "value": "90fb86fe88a1786ba0e5141b0e8a9e02"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e001", "surface_form_type": "literal", "replacement": "hcpvxoqzhtdm", "start": 356, "end": 370, "value": "morecollection"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e001", "surface_form_type": "literal", "replacement": "hcpvxoqzhtdm", "start": 402, "end": 416, "value": "morecollection"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e001", "surface_form_type": "literal", "replacement": "hcpvxoqzhtdm", "start": 530, "end": 544, "value": "morecollection"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e001", "surface_form_type": "literal", "replacement": "hcpvxoqzhtdm", "start": 564, "end": 578, "value": "morecollection"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 45, "end": 81, "value": "6056DAAF-6FCA-4486-A693-8CF4E7A68D5C"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 185, "end": 194, "value": "Your Name"}, {"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 627, "end": 650, "value": "carrshannon@company.com"}], "cluster_id": "c-00001-9be63fc7ced9f08c", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00001-9be63fc7ced9f08c/e000", "entity_type": "person", "value_type": "person", "canonical": "Martin Jarvis", "forms": {"full_name": "Martin Jarvis", "first_name": "Martin", "last_name": "Jarvis", "username": "mjarvis", "handle": "@mjarvis", "email": "martin.jarvis@hotmail.com"}, "replacement_canonical": "Paula Ramos", "replacement_forms": {"full_name": "Paula Ramos", "first_name": "Paula", "last_name": "Ramos", "username": "pramos", "handle": "@pramos", "email": "paula.ramos@hotmail.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-9be63fc7ced9f08c/e001", "entity_type": "password", "value_type": "password", "canonical": "morecollection", "forms": {"literal": "morecollection"}, "replacement_canonical": "hcpvxoqzhtdm", "replacement_forms": {"literal": "hcpvxoqzhtdm"}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 3}, {"entity_id": "c-00001-9be63fc7ced9f08c/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "90fb86fe88a1786ba0e5141b0e8a9e02", "forms": {"literal": "90fb86fe88a1786ba0e5141b0e8a9e02"}, "replacement_canonical": "61bf21bf05c8485ab7b2963e1a0f2b06", "replacement_forms": {"literal": "61bf21bf05c8485ab7b2963e1a0f2b06"}, "owner_entity_id": "c-00001-9be63fc7ced9f08c/e000", "n_mentions": 4, "n_docs": 3}]} {"id": "ghcc-00001-88d9556878685842", "source": "codeparrot/github-code-clean", "repo": "lancekrogers/music-network", "license": "apache-2.0", "language": "HTML", "path": "cleff/profiles/templates/updates/update-genres.html", "text": "{% extends 'profiles/base.html' %}\n\n{% block body %}\n\n
\n
\n \n\n{% if request.user.musician %}\n
\n {% csrf_token %}\n {{ update_genres_form.as_p }}\n \n
\n\n\n\n{% endif %}\n\n
\n
\n\n{% endblock %}", "spans": [{"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e001", "surface_form_type": "literal", "replacement": "hcpvxoqzhtdm", "start": 80, "end": 94, "value": "morecollection"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "comment", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e002", "surface_form_type": "literal", "replacement": "61bf21bf05c8485ab7b2963e1a0f2b06", "start": 348, "end": 380, "value": "90fb86fe88a1786ba0e5141b0e8a9e02"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e002", "surface_form_type": "literal", "replacement": "61bf21bf05c8485ab7b2963e1a0f2b06", "start": 510, "end": 542, "value": "90fb86fe88a1786ba0e5141b0e8a9e02"}], "hard_negatives": [], "cluster_id": "c-00001-9be63fc7ced9f08c", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00001-4d7062e816e6e2fb", "source": "codeparrot/github-code-clean", "repo": "StephaneGerardVUB/quattor-one-vsc-vub-scdb", "license": "apache-2.0", "language": "HTML", "path": "external/svnkit/doc/javadoc/org/tmatesoft/svn/core/io/ISVNWorkspaceMediator.html", "text": "\r\n\r\n\r\n\r\n\r\n\r\nISVNWorkspaceMediator (JavaDoc :: Documentation :: Pure Java Subversion (SVN) Client Library)\r\n\r\n\r\n\r\n\r\n\r\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\r\n\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nvar sharedsecret = \"90fb86fe88a1786ba0e5141b0e8a9e02\";\n
\r\n\n\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Overview  Package   Class  Tree  Deprecated  Index  Help 
\r\n
\r\n\n SVNKit Home\r\n
\r\n PREV CLASS \r\n NEXT CLASS\r\n FRAMES  \r\n NO FRAMES  \r\n \r\n\n\r\n
\r\n SUMMARY: NESTED | FIELD | CONSTR | METHOD\r\nDETAIL: FIELD | CONSTR | METHOD
\r\n\n\r\n\">\n\r\n
\r\n\r\n

\r\n\r\norg.tmatesoft.svn.core.io\r\n
\r\nInterface ISVNWorkspaceMediator

\r\n
\r\n
\r\n
public interface ISVNWorkspaceMediator
\r\n\r\n

\r\nThe ISVNWorkspaceMediator interface is used for temporary \n data storage (mainly instructions and new text data for deltas) as well\n as for caching and getting some kind of wcprops.\r\n

\r\n\r\n

\r\n

\r\n
Version:
\n
1.1.1
\n
Author:
\n
TMate Software Ltd.
\n
See Also:
SVNRepository.getCommitEditor(String, Map, boolean, ISVNWorkspaceMediator), \nExamples
\r\n
\r\n\r\n

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\nMethod Summary
\r\n StringgetWorkspaceProperty(String path,\n String name)\r\n\r\n
\r\n          Retrieves an item's WC property from a \".svn/wcprops\" administrative \n subdirectory.
\r\n voidsetWorkspaceProperty(String path,\n String name,\n String value)\r\n\r\n
\r\n          Sets a new value for an item's WC property in a \".svn/wcprops\" \n administrative subdirectory.
\r\n \r\n

\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\r\n\r\n\r\n\r\n
\r\nMethod Detail
\r\n\r\n

\r\ngetWorkspaceProperty

\r\n
\r\npublic String getWorkspaceProperty(String path,\n                                   String name)\n                            throws SVNException
\r\n
\r\n
Retrieves an item's WC property from a \".svn/wcprops\" administrative \n subdirectory.\r\n

\r\n

\r\n
Parameters:
path - a WC item's path
name - a propery name\n
Returns:
the value for the property\n
Throws:\n
SVNException
See Also:
setWorkspaceProperty(String, String, String)
\r\n
\r\n
\r\n
\r\n\r\n

\r\nsetWorkspaceProperty

\r\n
\r\npublic void setWorkspaceProperty(String path,\n                                 String name,\n                                 String value)\n                          throws SVNException
\r\n
\r\n
Sets a new value for an item's WC property in a \".svn/wcprops\" \n administrative subdirectory.\r\n

\r\n

\r\n
Parameters:
path - a WC item's path
name - a propery name
value - a value for the property\n
Throws:\n
SVNException
See Also:
getWorkspaceProperty(String, String)
\r\n
\r\n
\r\n\r\n
\r\n\r\n\n\r\n\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Overview  Package   Class  Tree  Deprecated  Index  Help 
\r\n
\r\n\n SVNKit Home\r\n
\r\n PREV CLASS \r\n NEXT CLASS\r\n FRAMES  \r\n NO FRAMES  \r\n \r\n\n\r\n
\r\n SUMMARY: NESTED | FIELD | CONSTR | METHOD\r\nDETAIL: FIELD | CONSTR | METHOD
\r\n\n\r\n\r\n
\r\n\n\n Copyright © 2004-2007 TMate Software Ltd. All Rights Reserved.\n \r\n\r\n\r\n", "spans": [{"label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e000", "surface_form_type": "email", "replacement": "paula.ramos@hotmail.com", "start": 1216, "end": 1241, "value": "martin.jarvis@hotmail.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e002", "surface_form_type": "literal", "replacement": "61bf21bf05c8485ab7b2963e1a0f2b06", "start": 3707, "end": 3739, "value": "90fb86fe88a1786ba0e5141b0e8a9e02"}, {"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00001-9be63fc7ced9f08c/e001", "surface_form_type": "literal", "replacement": "hcpvxoqzhtdm", "start": 13438, "end": 13452, "value": "morecollection"}], "hard_negatives": [{"label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 552, "end": 574, "value": "jerryhawkins@email.com"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 3860, "end": 3871, "value": ""}], "cluster_id": "c-00001-9be63fc7ced9f08c", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00000-2b13c48ca88d15ac", "source": "codeparrot/github-code-clean", "repo": "pcbsd/lumina", "license": "bsd-3-clause", "language": "C++", "path": "src-qt5/desktop-utils/lumina-textedit/MainUI.cpp", "text": "//===========================================\n// Lumina-DE source code\n// Copyright (c) 2015, Ken Moore\n// Available under the 3-clause BSD license\n// See the LICENSE file for full details\n//===========================================\n#include \"MainUI.h\"\n#include \"ui_MainUI.h\"\n\n#include \"syntaxSupport.h\"\n\n#include \n#include \n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \"PlainTextEditor.h\"\n\n#define DEBUG 0\n\nMainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){\n ui->setupUi(this);\n fontbox = new QFontComboBox(this);\n fontbox->setFocusPolicy(Qt::NoFocus);\n fontbox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);\n QWidget *spacer = new QWidget(this);\n spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);\n QWidget *spacer2 = new QWidget(this);\n spacer2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);\n label_readonly = new QAction(tr(\"Read-Only File\"), this);\n label_readonly->setEnabled(false); //not an actual button\n label_readonly->setToolTip(\"\");\n QFont fnt = this->font();\n fnt.setItalic(true);\n fnt.setBold(true);\n label_readonly->setFont(fnt);\n fontSizes = new QSpinBox(this);\n fontSizes->setRange(5, 72);\n fontSizes->setValue(this->font().pointSize());\n fontSizes->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);\n //For some reason, the FontComboBox is always 2 pixels taller than the SpinBox - manually fix that here\n fontbox->setFixedHeight(ui->toolBar->iconSize().height()-2);\n fontSizes->setFixedHeight(ui->toolBar->iconSize().height());\n\n ui->toolBar->addWidget(spacer);\n ui->toolBar->addAction(label_readonly);\n ui->toolBar->addWidget(spacer2);\n ui->toolBar->addWidget(fontbox);\n ui->toolBar->addWidget(fontSizes);\n //Load the special Drag and Drop QTabWidget\n tabWidget = new DnDTabWidget(this);\n static_cast(ui->centralwidget->layout())->insertWidget(0,tabWidget, 1);\n //Setup the action group for the tab location options\n QActionGroup *agrp = new QActionGroup(this);\n agrp->setExclusive(true);\n agrp->addAction(ui->action_tabsTop);\n agrp->addAction(ui->action_tabsBottom);\n agrp->addAction(ui->action_tabsLeft);\n agrp->addAction(ui->action_tabsRight);\n //Load settings\n settings = LUtils::openSettings(\"lumina-desktop\",\"lumina-textedit\", this);\n if(settings->contains(\"lastfont\")){\n QFont oldfont;\n if(oldfont.fromString(settings->value(\"lastfont\").toString() ) ){\n fontbox->setCurrentFont( oldfont );\n fontChanged(oldfont); //load it right now\n }\n }\n Custom_Syntax::SetupDefaultColors(settings); //pre-load any color settings as needed\n colorDLG = new ColorDialog(settings, this);\n this->setWindowTitle(tr(\"Text Editor\"));\n tabWidget->clear();\n //Add keyboard shortcuts\n closeFindS = new QShortcut(QKeySequence(Qt::Key_Escape), this);\n connect(closeFindS, SIGNAL(activated()), this, SLOT(closeFindReplace()) );\n ui->groupReplace->setVisible(false);\n nextTabS = new QShortcut(QKeySequence(QKeySequence::Forward), this);\n prevTabS = new QShortcut(QKeySequence(QKeySequence::Back), this);\n closeTabS = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_F4), this);\n connect(nextTabS, SIGNAL(activated()), this, SLOT(nextTab()) );\n connect(prevTabS, SIGNAL(activated()), this, SLOT(prevTab()) );\n connect(closeTabS, SIGNAL(activated()), this, SLOT(CloseFile()) );\n\n //Update the menu of available syntax highlighting modes\n QStringList smodes = Custom_Syntax::availableRules(settings);\n for(int i=0; imenuSyntax_Highlighting->addAction(smodes[i]);\n }\n\n bool toolbarVisible = settings->value(\"showToolbar\",true).toBool();\n ui->toolBar->setHidden(!toolbarVisible);\n ui->actionShow_Toolbar->setChecked(toolbarVisible);\n ui->actionLine_Numbers->setChecked( settings->value(\"showLineNumbers\",true).toBool() );\n ui->actionWrap_Lines->setChecked( settings->value(\"wrapLines\",true).toBool() );\n ui->actionShow_Popups->setChecked( settings->value(\"showPopupWarnings\",true).toBool() );\n ui->actionEnable_Spellcheck->setChecked( settings->value(\"enableSpellcheck\",true).toBool() );\n QString tabLoc = settings->value(\"tabsLocation\",\"top\").toString().toLower();\n if(tabLoc==\"bottom\"){ ui->action_tabsBottom->setChecked(true); tabWidget->setTabPosition(QTabWidget::South);}\n else if(tabLoc==\"left\"){ ui->action_tabsLeft->setChecked(true); tabWidget->setTabPosition(QTabWidget::West);}\n else if(tabLoc==\"right\"){ ui->action_tabsRight->setChecked(true); tabWidget->setTabPosition(QTabWidget::East);}\n else{ ui->action_tabsTop->setChecked(true); tabWidget->setTabPosition(QTabWidget::North); }\n\n //Setup any connections\n connect(agrp, SIGNAL(triggered(QAction*)), this, SLOT(changeTabsLocation(QAction*)) );\n connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(close()) );\n connect(ui->actionNew_File, SIGNAL(triggered()), this, SLOT(NewFile()) );\n connect(ui->actionOpen_File, SIGNAL(triggered()), this, SLOT(OpenFile()) );\n connect(ui->actionClose_File, SIGNAL(triggered()), this, SLOT(CloseFile()) );\n connect(ui->actionSave_File, SIGNAL(triggered()), this, SLOT(SaveFile()) );\n connect(ui->actionSave_File_As, SIGNAL(triggered()), this, SLOT(SaveFileAs()) );\n connect(ui->actionPrint, SIGNAL(triggered()), this, SLOT(Print()) );\n connect(ui->menuSyntax_Highlighting, SIGNAL(triggered(QAction*)), this, SLOT(UpdateHighlighting(QAction*)) );\n connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged()) );\n connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(tabClosed(int)) );\n connect(tabWidget->dndTabBar(), SIGNAL(DetachTab(int)), this, SLOT(tabDetached(int)) );\n connect(tabWidget->dndTabBar(), SIGNAL(DroppedIn(QStringList)), this, SLOT(LoadArguments(QStringList)) );\n connect(tabWidget->dndTabBar(), SIGNAL(DraggedOut(int, Qt::DropAction)), this, SLOT(tabDraggedOut(int, Qt::DropAction)) );\n connect(ui->actionShow_Toolbar, SIGNAL(toggled(bool)), this, SLOT(showToolbar(bool)) );\n connect(ui->actionLine_Numbers, SIGNAL(toggled(bool)), this, SLOT(showLineNumbers(bool)) );\n connect(ui->actionWrap_Lines, SIGNAL(toggled(bool)), this, SLOT(wrapLines(bool)) );\n connect(ui->actionShow_Popups, SIGNAL(toggled(bool)), this, SLOT(showPopupWarnings(bool)) );\n connect(ui->actionEnable_Spellcheck, SIGNAL(toggled(bool)), this, SLOT(enableSpellcheck(bool)) );\n connect(ui->actionCustomize_Colors, SIGNAL(triggered()), this, SLOT(ModifyColors()) );\n connect(ui->actionSet_Language, SIGNAL(triggered()), this, SLOT(SetLanguage()) );\n connect(ui->actionFind, SIGNAL(triggered()), this, SLOT(openFind()) );\n connect(ui->actionReplace, SIGNAL(triggered()), this, SLOT(openReplace()) );\n connect(ui->tool_find_next, SIGNAL(clicked()), this, SLOT(findNext()) );\n connect(ui->tool_find_prev, SIGNAL(clicked()), this, SLOT(findPrev()) );\n connect(ui->tool_replace, SIGNAL(clicked()), this, SLOT(replaceOne()) );\n connect(ui->tool_replace_all, SIGNAL(clicked()), this, SLOT(replaceAll()) );\n connect(ui->tool_hideReplaceGroup, SIGNAL(clicked()), this, SLOT(closeFindReplace()) );\n connect(ui->line_find, SIGNAL(returnPressed()), this, SLOT(findNext()) );\n connect(ui->line_replace, SIGNAL(returnPressed()), this, SLOT(replaceOne()) );\n connect(colorDLG, SIGNAL(colorsChanged()), this, SLOT(UpdateHighlighting()) );\n connect(fontbox, SIGNAL(currentFontChanged(const QFont&)), this, SLOT(fontChanged(const QFont&)) );\n connect(fontSizes, SIGNAL(valueChanged(int)), this, SLOT(changeFontSize(int)));\n\n updateIcons();\n //Now load the initial size of the window\n QSize lastSize = settings->value(\"lastSize\",QSize()).toSize();\n if(lastSize.width() > this->sizeHint().width() && lastSize.height() > this->sizeHint().height() ){\n this->resize(lastSize);\n }\n\n ui->actionEnable_Spellcheck->setEnabled(DEBUG);\n ui->actionSet_Language->setEnabled(DEBUG);\n ui->actionEnable_Spellcheck->setVisible(DEBUG);\n ui->actionSet_Language->setVisible(DEBUG);\n}\n\nMainUI::~MainUI(){\n\n}\n\nvoid MainUI::LoadArguments(QStringList args){ //CLI arguments\n for(int i=0; igroupReplace->isVisible()){ ui->line_find->setFocus(); }\n else{ currentEditor()->setFocus(); }\n }\n if(tabWidget->count()<1){\n NewFile();\n }\n}\n\n// =================\n// PUBLIC SLOTS\n//=================\nvoid MainUI::updateIcons(){\n this->setWindowIcon( LXDG::findIcon(\"document-edit\") );\n ui->actionClose->setIcon(LXDG::findIcon(\"application-exit\") );\n ui->actionNew_File->setIcon(LXDG::findIcon(\"document-new\") );\n ui->actionOpen_File->setIcon(LXDG::findIcon(\"document-open\") );\n ui->actionClose_File->setIcon(LXDG::findIcon(\"document-close\") );\n ui->actionSave_File->setIcon(LXDG::findIcon(\"document-save\") );\n ui->actionSave_File_As->setIcon(LXDG::findIcon(\"document-save-as\") );\n ui->actionPrint->setIcon(LXDG::findIcon(\"printer\") );\n ui->actionFind->setIcon(LXDG::findIcon(\"edit-find\") );\n ui->actionReplace->setIcon(LXDG::findIcon(\"edit-find-replace\") );\n ui->menuSyntax_Highlighting->setIcon( LXDG::findIcon(\"format-text-color\") );\n ui->actionCustomize_Colors->setIcon( LXDG::findIcon(\"format-fill-color\") );\n ui->menuTabs_Location->setIcon( LXDG::findIcon(\"tab-detach\") );\n //icons for the special find/replace groupbox\n ui->tool_find_next->setIcon(LXDG::findIcon(\"go-down-search\"));\n ui->tool_find_prev->setIcon(LXDG::findIcon(\"go-up-search\"));\n ui->tool_find_casesensitive->setIcon(LXDG::findIcon(\"format-text-italic\"));\n ui->tool_replace->setIcon(LXDG::findIcon(\"arrow-down\"));\n ui->tool_replace_all->setIcon(LXDG::findIcon(\"arrow-down-double\"));\n ui->tool_hideReplaceGroup->setIcon(LXDG::findIcon(\"dialog-close\",\"\"));\n //ui->tool_find_next->setIcon(LXDG::findIcon(\"\"));\n\n QTimer::singleShot(0,colorDLG, SLOT(updateIcons()) );\n}\n\n// =================\n// PRIVATE\n//=================\nPlainTextEditor* MainUI::currentEditor(){\n if(tabWidget->count()<1){ return 0; }\n return static_cast( tabWidget->currentWidget() );\n}\n\nQString MainUI::currentFile(){\n PlainTextEditor* cur = currentEditor();\n if(cur!=0){\n return cur->currentFile();\n }\n return \"\";\n}\n\nQString MainUI::currentFileDir(){\n PlainTextEditor* cur = currentEditor();\n QString dir;\n if(cur!=0){\n if(cur->currentFile().startsWith(\"/\")){\n dir = cur->currentFile().section(\"/\",0,-2);\n }\n }\n return dir;\n}\n\nQStringList MainUI::unsavedFiles(){\n QStringList unsaved;\n for(int i=0; icount(); i++){\n PlainTextEditor *tmp = static_cast(tabWidget->widget(i));\n if(tmp->hasChange()){\n unsaved << tmp->currentFile();\n }\n }\n return unsaved;\n}\n\n// =================\n// PRIVATE SLOTS\n//=================\n//Main Actions\nvoid MainUI::NewFile(){\n OpenFile(QString::number(tabWidget->count()+1)+\"/\"+tr(\"New File\"));\n}\n\nvoid MainUI::OpenFile(QString file){\n QStringList files;\n if(file.isEmpty()){\n //Prompt for a file to open\n files = QFileDialog::getOpenFileNames(this, tr(\"Open File(s)\"), currentFile(), tr(\"Text Files (*)\") );\n if(files.isEmpty()){ return; } //cancelled\n }else{\n files << file;\n }\n for(int i=0; icount(); j++){\n PlainTextEditor *tmp = static_cast(tabWidget->widget(j));\n if(tmp->currentFile()==files[i]){ edit = tmp; break; }\n }\n if(edit ==0){\n //New file - need to create a new editor for it\n edit = new PlainTextEditor(settings, this);\n connect(edit, SIGNAL(FileLoaded(QString)), this, SLOT(updateTab(QString)) );\n connect(edit, SIGNAL(UnsavedChanges(QString)), this, SLOT(updateTab(QString)) );\n if(DEBUG)\n connect(edit, SIGNAL(CheckSpelling(int, int)), this, SLOT(checkSpelling(int, int)));\n connect(edit, SIGNAL(statusTipChanged()), this, SLOT(updateStatusTip()) );\n tabWidget->addTab(edit, files[i].section(\"/\",-1));\n edit->showLineNumbers(ui->actionLine_Numbers->isChecked());\n edit->setLineWrapMode( ui->actionWrap_Lines->isChecked() ? QPlainTextEdit::WidgetWidth : QPlainTextEdit::NoWrap);\n edit->setFocusPolicy(Qt::ClickFocus); //no \"tabbing\" into this widget\n QFont font = fontbox->currentFont();\n font.setPointSize( fontSizes->value() );\n edit->document()->setDefaultFont(font);\n /*QStringList applicationDirs = LXDG::systemApplicationDirs();*/\n if(ui->actionEnable_Spellcheck->isChecked()) {\n /*QStringList dirs = QString(getenv(\"XDG_DATA_DIRS\")).split(\":\");\n foreach(QString dir, dirs) {\n if(QDir(dir).exists(\"hunspell\")) {\n //Default to US English Dictionary\n hunspellPath = dir+\"/hunspell/\";\n hunspell = new Hunspell(QString(hunspellPath + \"en_US.aff\").toLocal8Bit(), QString(hunspellPath + \"en_US.dic\").toLocal8Bit());\n edit->setDictionary(hunspell);\n }\n }*/\n }\n }\n tabWidget->setCurrentWidget(edit);\n edit->LoadFile(files[i]);\n if(DEBUG)\n checkSpelling(-1);\n edit->setFocus();\n QApplication::processEvents(); //to catch the fileLoaded() signal\n }\n}\n\nvoid MainUI::CloseFile(){\n int index = tabWidget->currentIndex();\n if(index>=0){ tabClosed(index); }\n}\n\nbool MainUI::SaveFile(){\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return true; } //nothing to do\n return cur->SaveFile();\n}\n\nbool MainUI::SaveFileAs(){\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return true; } //nothing to do\n return cur->SaveFile(true);\n}\n\nbool MainUI::SaveAllFiles(){\n bool ok = true;\n for(int i=0; icount() && ok; i++){\n PlainTextEditor *tmp = static_cast(tabWidget->widget(i));\n if(tmp->hasChange()){\n ok = ok && tmp->SaveFile();\n }\n }\n return ok;\n}\n\nvoid MainUI::Print() {\n\tQPrinter *print = new QPrinter(QPrinter::HighResolution);\n\tQPrintDialog dialog(print, NULL);\n\tdialog.setWindowTitle(tr(\"Print Content\"));\n\tdialog.setOptions( QAbstractPrintDialog::PrintCurrentPage | QAbstractPrintDialog::PrintToFile );\n\tif(currentEditor()->textCursor().hasSelection()) {\n\t\tdialog.setOptions( QAbstractPrintDialog::PrintCurrentPage | QAbstractPrintDialog::PrintToFile | QAbstractPrintDialog::PrintSelection );\n\t}\n\tif(dialog.exec() == QDialog::Accepted) {\n\t\tcurrentEditor()->print(print);\n\t}\n}\n\nvoid MainUI::fontChanged(const QFont&){\n if(currentEditor()==0){ return; }\n //Save this font for later\n QFont font = fontbox->currentFont();\n font.setPointSize( fontSizes->value() );\n settings->setValue(\"lastfont\", font.toString());\n currentEditor()->document()->setDefaultFont(font);\n}\n\nvoid MainUI::changeFontSize(int newFontSize){\n if(currentEditor()==0){ return; }\n QFont currentFont = currentEditor()->document()->defaultFont();\n currentFont.setPointSize(newFontSize);\n currentEditor()->document()->setDefaultFont(currentFont);\n currentEditor()->updateLNW();\n}\n\nvoid MainUI::changeTabsLocation(QAction *act){\n QString set;\n if(act==ui->action_tabsTop){\n\tset = \"top\"; tabWidget->setTabPosition(QTabWidget::North);\n }else if(act==ui->action_tabsBottom){\n\tset = \"bottom\"; tabWidget->setTabPosition(QTabWidget::South);\n }else if(act==ui->action_tabsLeft){\n\tset = \"left\"; tabWidget->setTabPosition(QTabWidget::West);\n }else if(act==ui->action_tabsRight){\n\tset = \"right\"; tabWidget->setTabPosition(QTabWidget::East);\n }\n if(!set.isEmpty()){ settings->setValue(\"tabsLocation\",set); }\n}\n\nvoid MainUI::updateStatusTip(){\n QString msg = currentEditor()->statusTip();\n //ui->statusbar->clearMessage();\n ui->statusbar->showMessage(msg);\n}\n\nvoid MainUI::UpdateHighlighting(QAction *act){\n if(act!=0){\n //Single-editor change\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n cur->LoadSyntaxRule(act->text());\n }else{\n //Have every editor reload the syntax rules (color changes)\n for(int i=0; icount(); i++){\n static_cast(tabWidget->widget(i))->updateSyntaxColors();\n }\n }\n}\n\nvoid MainUI::showLineNumbers(bool show){\n settings->setValue(\"showLineNumbers\",show);\n for(int i=0; icount(); i++){\n PlainTextEditor *edit = static_cast(tabWidget->widget(i));\n edit->showLineNumbers(show);\n }\n}\n\nvoid MainUI::wrapLines(bool wrap){\n settings->setValue(\"wrapLines\",wrap);\n if(currentEditor() == NULL){ return; }\n currentEditor()->setLineWrapMode( wrap ? QPlainTextEdit::WidgetWidth : QPlainTextEdit::NoWrap);\n /*for(int i=0; icount(); i++){\n PlainTextEditor *edit = static_cast(tabWidget->widget(i));\n edit->setLineWrapMode( wrap ? QPlainTextEdit::WidgetWidth : QPlainTextEdit::NoWrap);\n }*/\n}\n\nvoid MainUI::ModifyColors(){\n colorDLG->LoadColors();\n colorDLG->showNormal();\n}\n\nvoid MainUI::SetLanguage() {\n /*QDir dir(hunspellPath);\n QStringList files = dir.entryList(QStringList() << \"*.dic\", QDir::Files);\n QStringList items;\n int defaultDic = 0;\n for(int i = 0; i < files.size(); i++) {\n QString item = files[i].split('.')[0];\n if(item == settings->value(\"language/\").toString()) {\n defaultDic = i;\n }\n items.append(item);\n }\n QString dic = QInputDialog::getItem(this, \"Set Language for Document\", \"Language:\", items, defaultDic);\n settings->setValue(\"language/\", dic);\n if(hunspell)\n delete hunspell;\n\n hunspell = new Hunspell(QString(hunspellPath+dic+\".aff\").toLocal8Bit(), QString(hunspellPath+dic+\".dic\").toLocal8Bit());\n\n checkSpelling(-1);*/\n}\n\nvoid MainUI::showPopupWarnings(bool show){\n settings->setValue(\"showPopupWarnings\",show);\n}\n\nvoid MainUI::enableSpellcheck(bool show){\n /*qDebug() << \"Enabling Spellcheck\";\n settings->setValue(\"enableSpellcheck\",show);\n if(currentEditor() != NULL and hunspell == NULL) {\n //QStringList applicationDirs = LXDG::systemApplicationDirs();\n hunspell = new Hunspell(QString(hunspellPath + \"en_US.aff\").toLocal8Bit(), QString(hunspellPath + \"en_US.dic\").toLocal8Bit());\n qDebug() << \"Hunspell Created\";\n }*/\n}\n\nvoid MainUI::showToolbar(bool show){\n settings->setValue(\"showToolbar\",show);\n ui->toolBar->setHidden(!show);\n}\n\nvoid MainUI::updateTab(QString file){\n PlainTextEditor *cur = 0;\n int index = -1;\n for(int i=0; icount(); i++){\n PlainTextEditor *tmp = static_cast(tabWidget->widget(i));\n if(tmp->currentFile()==file){\n\tcur = tmp;\n\tindex = i;\n\tbreak;\n }\n }\n if(cur==0){ return; } //should never happen\n bool changes = cur->hasChange();\n //qDebug() << \"Update Tab:\" << file << cur << changes;\n tabWidget->setTabText(index,(changes ? \"*\" : \"\") + file.section(\"/\",-1));\n tabWidget->setTabToolTip(index, file);\n tabWidget->setTabWhatsThis(index, file); //needed for drag/drop functionality\n ui->actionSave_File->setEnabled(changes);\n this->setWindowTitle( (changes ? \"*\" : \"\") + file.section(\"/\",-2) );\n label_readonly->setVisible( cur->readOnlyFile() );\n}\n\nvoid MainUI::tabChanged(){\n if(tabWidget->count()<1){ return; }\n //update the buttons/menus based on the current widget\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; } //should never happen though\n bool changes = cur->hasChange();\n ui->actionSave_File->setEnabled(changes);\n //this->setWindowTitle( tabWidget->tabText( tabWidget->currentIndex() ) );\n this->setWindowTitle( (changes ? \"*\" : \"\") + tabWidget->tabToolTip( tabWidget->currentIndex() ).section(\"/\",-2) );\n if(!ui->line_find->hasFocus() && !ui->line_replace->hasFocus()){ tabWidget->currentWidget()->setFocus(); }\n QFont font = cur->document()->defaultFont();\n //Update the font/size widgets to reflect what is set on this tab\n fontbox->setCurrentFont(font);\n fontSizes->setValue( font.pointSize() );\n ui->actionWrap_Lines->setChecked( cur->lineWrapMode()==QPlainTextEdit::WidgetWidth );\n label_readonly->setVisible( cur->readOnlyFile() );\n}\n\nvoid MainUI::tabClosed(int tab){\n PlainTextEditor *edit = static_cast(tabWidget->widget(tab));\n if(edit==0){ return; } //should never happen\n if(edit->hasChange() && ui->actionShow_Popups->isChecked() ){\n //Verify if the user wants to lose any unsaved changes\n if(QMessageBox::Yes != QMessageBox::question(this, tr(\"Lose Unsaved Changes?\"), QString(tr(\"This file has unsaved changes.\\nDo you want to close it anyway?\\n\\n%1\")).arg(edit->currentFile()), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ){ return; }\n }\n tabWidget->removeTab(tab);\n edit->deleteLater();\n}\n\nvoid MainUI::tabDetached(int tab){\n PlainTextEditor *edit = static_cast(tabWidget->widget(tab));\n if(edit==0){ return; } //should never happen\n if(edit->hasChange() && ui->actionShow_Popups->isChecked() ){\n //Verify if the user wants to lose any unsaved changes\n if(QMessageBox::Yes != QMessageBox::question(this, tr(\"Lose Unsaved Changes?\"), QString(tr(\"This file has unsaved changes.\\nDo you want to close it anyway?\\n\\n%1\")).arg(edit->currentFile()), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ){ return; }\n }\n //Launch this file with a new LTE process\n QProcess::startDetached(\"lumina-textedit \\\"\"+edit->currentFile()+\"\\\"\");\n tabWidget->removeTab(tab);\n edit->deleteLater();\n}\n\nvoid MainUI::tabDraggedOut(int tab, Qt::DropAction act){\n qDebug() << \"Tab Dragged Out:\" << tab << act;\n if(act == Qt::MoveAction){\n tabClosed(tab);\n if(tabWidget->count()==0){ this->close(); } //merging two windows together?\n }\n}\n\nvoid MainUI::nextTab(){\n //qDebug() << \"Next Tab\";\n if(tabWidget->count()<1){ return; } //no tabs\n int cur = tabWidget->currentIndex();\n cur++;\n if(cur>=tabWidget->count()){ cur = 0; }\n tabWidget->setCurrentIndex(cur);\n}\n\nvoid MainUI::prevTab(){\n //qDebug() << \"Previous Tab\";\n if(tabWidget->count()<1){ return; } //no tabs\n int cur = tabWidget->currentIndex();\n cur--;\n if(cur<0){ cur = tabWidget->count()-1; }\n tabWidget->setCurrentIndex(cur);\n}\n\n//Find/Replace functions\nvoid MainUI::closeFindReplace(){\n ui->groupReplace->setVisible(false);\n PlainTextEditor *cur = currentEditor();\n if(cur!=0){ cur->setFocus(); }\n}\n\nvoid MainUI::openFind(){\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n ui->groupReplace->setVisible(true);\n ui->line_find->setText( cur->textCursor().selectedText() );\n ui->line_replace->setText(\"\");\n ui->line_find->setFocus();\n}\n\nvoid MainUI::openReplace(){\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n ui->groupReplace->setVisible(true);\n ui->line_find->setText( cur->textCursor().selectedText() );\n ui->line_replace->setText(\"\");\n ui->line_replace->setFocus();\n}\n\nvoid MainUI::findNext(){\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n bool found = cur->find( ui->line_find->text(), ui->tool_find_casesensitive->isChecked() ? QTextDocument::FindCaseSensitively : QTextDocument::FindFlags() );\n if(!found){\n //Try starting back at the top of the file\n cur->moveCursor(QTextCursor::Start);\n cur->find( ui->line_find->text(), ui->tool_find_casesensitive->isChecked() ? QTextDocument::FindCaseSensitively : QTextDocument::FindFlags() );\n }\n}\n\nvoid MainUI::findPrev(){\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n bool found = cur->find( ui->line_find->text(), ui->tool_find_casesensitive->isChecked() ? QTextDocument::FindCaseSensitively | QTextDocument::FindBackward : QTextDocument::FindBackward );\n if(!found){\n //Try starting back at the bottom of the file\n cur->moveCursor(QTextCursor::End);\n cur->find( ui->line_find->text(), ui->tool_find_casesensitive->isChecked() ? QTextDocument::FindCaseSensitively | QTextDocument::FindBackward : QTextDocument::FindBackward );\n }\n}\n\nvoid MainUI::replaceOne(){\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n //See if the current selection matches the find field first\n if(cur->textCursor().selectedText()==ui->line_find->text()){\n cur->insertPlainText(ui->line_replace->text());\n }\n cur->find( ui->line_find->text(), ui->tool_find_casesensitive->isChecked() ? QTextDocument::FindCaseSensitively : QTextDocument::FindFlags() );\n}\n\nvoid MainUI::replaceAll(){\nPlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n //See if the current selection matches the find field first\n bool done = false;\n if(cur->textCursor().selectedText()==ui->line_find->text()){\n cur->insertPlainText(ui->line_replace->text());\n done = true;\n }\n while( cur->find( ui->line_find->text(), ui->tool_find_casesensitive->isChecked() ? QTextDocument::FindCaseSensitively : QTextDocument::FindFlags() ) ){\n //Find/replace every occurance of the string\n cur->insertPlainText(ui->line_replace->text());\n done = true;\n }\n if(done){\n //Re-highlight the newly-inserted text\n cur->find( ui->line_replace->text(), QTextDocument::FindCaseSensitively | QTextDocument::FindBackward);\n }\n}\n\nvoid MainUI::checkWord(QTextBlock block) {\n /*PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n if(block.text().simplified().isEmpty()){ return; }\n\n foreach(Word *word, wordList) {\n if(word->blockNum == block.blockNumber()){\n qDebug() << \"Remove Word\";\n wordList.removeOne(word);\n }\n }\n\n QStringList words = block.text().split(QRegExp(\"\\\\W+\"));\n qDebug() << \"Got Words:\" << words;\n QTextCursor cursor(block);\n\n foreach(QString word, words) {\n qDebug() << \"Check Word:\" << word;\n if(!hunspell->spell(word.toStdString())) {\n qDebug() << \"Not a word\";\n QStringList suggestions;\n foreach(std::string newWord, hunspell->suggest(word.toStdString())){\n suggestions.append(QString::fromStdString(newWord));\n }\n qDebug() << \"Got Suggestions:\" << suggestions;\n QTextEdit::ExtraSelection sel;\n sel.format.setBackground(QColor(\"Red\"));\n sel.cursor = cur->document()->find(word, cursor.position());\n Word *wordC = new Word(word, suggestions, sel, block.blockNumber(), cursor.positionInBlock());\n wordList.append(wordC);\n }\n cursor.movePosition(QTextCursor::NextWord, QTextCursor::MoveAnchor);\n }*/\n}\n\nvoid MainUI::checkSpelling(int bpos, int epos) {\n qDebug() << \"Checking spelling on\" << bpos << epos;\n PlainTextEditor *cur = currentEditor();\n if(cur==0){ return; }\n static int numBlocks = cur->blockCount();\n //qDebug() << \" - numblocks:\" << numBlocks;\n if(bpos == -1 || numBlocks != cur->blockCount()) { //When opening a file or loading a new dictionary\n for(QTextBlock block = cur->document()->begin(); block != cur->document()->end(); block = block.next()){\n //qDebug() << \" - Check Block:\" << block.text();\n checkWord(block);\n }\n numBlocks = cur->blockCount();\n }else if(epos == -1){ //Normal checking of one block from typing\n QTextBlock block = cur->document()->findBlock(bpos);\n //qDebug() << \" - Check Block:\" << block.text();\n checkWord(block);\n }else { //Check blocks after copy/paste\n for(QTextBlock block = cur->document()->findBlock(0); block != cur->document()->findBlock(epos); block = block.next()) {\n checkWord(block);\n }\n }\n //qDebug() << \" - set Word List:\" << wordList;\n\n cur->setWordList(wordList);\n}\n\n//=============\n// PROTECTED\n//=============\nvoid MainUI::closeEvent(QCloseEvent *ev){\n //See if any of the open editors have unsaved changes first\n QStringList unsaved = unsavedFiles();\n if(unsaved.isEmpty() || !ui->actionShow_Popups->isChecked()){\n QMainWindow::closeEvent(ev);\n return;\n }\n\n //Otherwise, ask the user what to do.\n QMessageBox::StandardButton but = QMessageBox::question(\n this,\n tr(\"Save Changes before closing?\"),\n QString(tr(\"There are unsaved changes.\\nDo you want save them before you close the editor?\\n\\n%1\")).arg(unsaved.join(\"\\n\")),\n QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,\n QMessageBox::No);\n\n if(but == QMessageBox::Cancel){\n ev->ignore();\n return;\n }\n else if(but == QMessageBox::Yes){\n if( !SaveAllFiles() ){\n //cancelled by user\n ev->ignore();\n return;\n }\n\n }\n QMainWindow::closeEvent(ev);\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-4344c35023cdf21f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-d00aefbc31f14053", "source": "codeparrot/github-code-clean", "repo": "weitengchu/EasyFlash", "license": "mit", "language": "C", "path": "easyflash/src/ef_env.c", "text": "/*\n * This file is part of the EasyFlash Library.\n *\n * Copyright (c) 2014, Armink, \n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * 'Software'), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n *\n * Function: Environment variables operating interface. (normal mode)\n * Created on: 2014-10-06\n */\n\n#include \n#include \n#include \n\n#ifdef EF_USING_ENV\n\n#ifndef EF_ENV_USING_WL_MODE\n\n/**\n * ENV area has 2 sections\n * 1. System section\n * It storage ENV parameters. (Units: Word)\n * 2. Data section\n * It storage all ENV. Storage format is key=value\\0.\n * All ENV must be 4 bytes alignment. The remaining part must fill '\\0'.\n *\n * @note Word = 4 Bytes in this file\n * @note It will has two ENV areas(Area0, Area1) when used power fail safeguard mode.\n */\n\n/* flash ENV parameters index and size in system section */\nenum {\n /* data section ENV end address index in system section */\n ENV_PARAM_INDEX_END_ADDR = 0,\n\n#ifdef EF_ENV_USING_PFS_MODE\n /* saved count for ENV area */\n ENV_PARAM_INDEX_SAVED_COUNT,\n#endif\n\n /* data section CRC32 code index in system section */\n ENV_PARAM_INDEX_DATA_CRC,\n /* flash ENV parameters word size */\n ENV_PARAM_WORD_SIZE,\n /* flash ENV parameters byte size */\n ENV_PARAM_BYTE_SIZE = ENV_PARAM_WORD_SIZE * 4,\n};\n\n/* default ENV set, must be initialized by user */\nstatic ef_env const *default_env_set = NULL;\n/* default ENV set size, must be initialized by user */\nstatic size_t default_env_set_size = NULL;\n/* ENV ram cache */\nstatic uint32_t env_cache[ENV_USER_SETTING_SIZE / 4] = { 0 };\n/* ENV start address in flash */\nstatic uint32_t env_start_addr = NULL;\n/* ENV ram cache has changed when ENV created, deleted and changed value. */\nstatic bool env_cache_changed = false;\n\n#ifdef EF_ENV_USING_PFS_MODE\n/* current load ENV area address */\nstatic uint32_t cur_load_area_addr = NULL;\n/* next save ENV area address */\nstatic uint32_t next_save_area_addr = NULL;\n#endif\n\nstatic uint32_t get_env_system_addr(void);\nstatic uint32_t get_env_data_addr(void);\nstatic uint32_t get_env_end_addr(void);\nstatic void set_env_end_addr(uint32_t end_addr);\nstatic EfErrCode write_env(const char *key, const char *value);\nstatic char *find_env(const char *key);\nstatic EfErrCode del_env(const char *key);\nstatic size_t get_env_data_size(void);\nstatic EfErrCode create_env(const char *key, const char *value);\nstatic uint32_t calc_env_crc(void);\nstatic bool env_crc_is_ok(void);\n\n/**\n * Flash ENV initialize.\n *\n * @param default_env default ENV set for user\n * @param default_env_size default ENV set size\n *\n * @note user_size must equal with total_size in normal mode\n *\n * @return result\n */\nEfErrCode ef_env_init(ef_env const *default_env, size_t default_env_size) {\n EfErrCode result = EF_NO_ERR;\n\n EF_ASSERT(ENV_AREA_SIZE);\n EF_ASSERT(ENV_USER_SETTING_SIZE);\n EF_ASSERT(EF_ERASE_MIN_SIZE);\n /* must be word alignment for ENV */\n EF_ASSERT(ENV_USER_SETTING_SIZE % 4 == 0);\n EF_ASSERT(ENV_AREA_SIZE % 4 == 0);\n EF_ASSERT(default_env);\n EF_ASSERT(default_env_size < ENV_USER_SETTING_SIZE);\n\n#ifndef EF_ENV_USING_PFS_MODE\n /* total_size must be aligned with erase_min_size */\n if (ENV_USER_SETTING_SIZE % EF_ERASE_MIN_SIZE == 0) {\n EF_ASSERT(ENV_USER_SETTING_SIZE == ENV_AREA_SIZE);\n } else {\n EF_ASSERT((ENV_USER_SETTING_SIZE/EF_ERASE_MIN_SIZE + 1)*EF_ERASE_MIN_SIZE == ENV_AREA_SIZE);\n }\n#else\n /* total_size must be aligned with erase_min_size */\n if (ENV_USER_SETTING_SIZE % EF_ERASE_MIN_SIZE == 0) {\n /* it has double area when used power fail safeguard mode */\n EF_ASSERT(2*ENV_USER_SETTING_SIZE == ENV_AREA_SIZE);\n } else {\n /* it has double area when used power fail safeguard mode */\n EF_ASSERT(2*(ENV_USER_SETTING_SIZE/EF_ERASE_MIN_SIZE + 1)*EF_ERASE_MIN_SIZE == ENV_AREA_SIZE);\n }\n#endif\n\n env_start_addr = EF_START_ADDR;\n default_env_set = default_env;\n default_env_set_size = default_env_size;\n\n EF_DEBUG(\"ENV start address is 0x%08X, size is %d bytes.\\n\", EF_START_ADDR, ENV_AREA_SIZE);\n\n ef_load_env();\n\n return result;\n}\n\n/**\n * ENV set default.\n *\n * @return result\n */\nEfErrCode ef_env_set_default(void){\n EfErrCode result = EF_NO_ERR;\n size_t i;\n\n EF_ASSERT(default_env_set);\n EF_ASSERT(default_env_set_size);\n\n /* lock the ENV cache */\n ef_port_env_lock();\n\n /* set environment end address is at data section start address */\n set_env_end_addr(get_env_data_addr());\n\n#ifdef EF_ENV_USING_PFS_MODE\n /* set saved count to default 0 */\n env_cache[ENV_PARAM_INDEX_SAVED_COUNT] = 0;\n#endif\n\n /* create default ENV */\n for (i = 0; i < default_env_set_size; i++) {\n create_env(default_env_set[i].key, default_env_set[i].value);\n }\n\n /* unlock the ENV cache */\n ef_port_env_unlock();\n\n ef_save_env();\n\n return result;\n}\n\n/**\n * Get ENV system section start address.\n *\n * @return system section start address\n */\nstatic uint32_t get_env_system_addr(void) {\n#ifndef EF_ENV_USING_PFS_MODE\n EF_ASSERT(env_start_addr);\n return env_start_addr;\n#else\n EF_ASSERT(cur_load_area_addr);\n return cur_load_area_addr;\n#endif\n}\n\n/**\n * Get ENV data section start address.\n *\n * @return data section start address\n */\nstatic uint32_t get_env_data_addr(void) {\n return get_env_system_addr() + ENV_PARAM_BYTE_SIZE;\n}\n\n/**\n * Get ENV end address.\n * It's the first word in ENV.\n *\n * @return ENV end address\n */\nstatic uint32_t get_env_end_addr(void) {\n /* it is the first word */\n return env_cache[ENV_PARAM_INDEX_END_ADDR];\n}\n\n/**\n * Set ENV end address.\n * It's the first word in ENV.\n *\n * @param end_addr ENV end address\n */\nstatic void set_env_end_addr(uint32_t end_addr) {\n env_cache[ENV_PARAM_INDEX_END_ADDR] = end_addr;\n}\n\n/**\n * Get current ENV data section size.\n *\n * @return size\n */\nstatic size_t get_env_data_size(void) {\n return get_env_end_addr() - get_env_data_addr();\n}\n\n/**\n * Get current ENV already write bytes.\n *\n * @return write bytes\n */\nsize_t ef_get_env_write_bytes(void) {\n#ifndef EF_ENV_USING_PFS_MODE\n return get_env_end_addr() - env_start_addr;\n#else\n /* It has two ENV areas(Area0, Area1) on used power fail safeguard mode */\n return 2 * (get_env_end_addr() - get_env_system_addr());\n#endif\n}\n\n/**\n * Write an ENV at the end of cache.\n *\n * @param key ENV name\n * @param value ENV value\n *\n * @return result\n */\nstatic EfErrCode write_env(const char *key, const char *value) {\n EfErrCode result = EF_NO_ERR;\n size_t ker_len = strlen(key), value_len = strlen(value), env_str_len;\n char *env_cache_bak = (char *)env_cache;\n\n /* calculate ENV storage length, contain '=' and '\\0'. */\n env_str_len = ker_len + value_len + 2;\n if (env_str_len % 4 != 0) {\n env_str_len = (env_str_len / 4 + 1) * 4;\n }\n /* check capacity of ENV */\n if (env_str_len + get_env_data_size() >= ENV_USER_SETTING_SIZE) {\n return EF_ENV_FULL;\n }\n\n /* calculate current ENV ram cache end address */\n env_cache_bak += get_env_end_addr() - get_env_system_addr();\n\n /* copy key name */\n memcpy(env_cache_bak, key, ker_len);\n env_cache_bak += ker_len;\n /* copy equal sign */\n *env_cache_bak = '=';\n env_cache_bak++;\n /* copy value */\n memcpy(env_cache_bak, value, value_len);\n env_cache_bak += value_len;\n /* fill '\\0' for string end sign */\n *env_cache_bak = '\\0';\n env_cache_bak ++;\n /* fill '\\0' for word alignment */\n memset(env_cache_bak, 0, env_str_len - (ker_len + value_len + 2));\n set_env_end_addr(get_env_end_addr() + env_str_len);\n /* ENV ram cache has changed */\n env_cache_changed = true;\n\n return result;\n}\n\n/**\n * Find ENV.\n *\n * @param key ENV name\n *\n * @return found ENV in ram cache\n */\nstatic char *find_env(const char *key) {\n char *env_start, *env_end, *env, *found_env = NULL;\n size_t key_len = strlen(key), env_len;\n\n EF_ASSERT(env_start_addr);\n\n if (*key == NULL) {\n EF_INFO(\"Flash ENV name must be not empty!\\n\");\n return NULL;\n }\n\n /* from data section start to data section end */\n env_start = (char *) ((char *) env_cache + ENV_PARAM_BYTE_SIZE);\n env_end = (char *) ((char *) env_cache + (get_env_end_addr() - get_env_system_addr()));\n\n /* ENV is null */\n if (env_start == env_end) {\n return NULL;\n }\n\n env = env_start;\n while (env < env_end) {\n /* the key length must be equal */\n if (!strncmp(env, key, key_len) && (env[key_len] == '=')) {\n found_env = env;\n break;\n } else {\n /* calculate ENV length, contain '\\0'. */\n env_len = strlen(env) + 1;\n /* next ENV and word alignment */\n if (env_len % 4 == 0) {\n env += env_len;\n } else {\n env += (env_len / 4 + 1) * 4;\n }\n }\n }\n return found_env;\n}\n\n/**\n * If the ENV is not exist, create it.\n * @see flash_write_env\n *\n * @param key ENV name\n * @param value ENV value\n *\n * @return result\n */\nstatic EfErrCode create_env(const char *key, const char *value) {\n EfErrCode result = EF_NO_ERR;\n\n EF_ASSERT(key);\n EF_ASSERT(value);\n\n if (*key == NULL) {\n EF_INFO(\"Flash ENV name must be not empty!\\n\");\n return EF_ENV_NAME_ERR;\n }\n\n if (strchr(key, '=')) {\n EF_INFO(\"Flash ENV name can't contain '='.\\n\");\n return EF_ENV_NAME_ERR;\n }\n\n /* find ENV */\n if (find_env(key)) {\n EF_INFO(\"The name of \\\"%s\\\" is already exist.\\n\", key);\n return EF_ENV_NAME_EXIST;\n }\n /* write ENV at the end of cache */\n result = write_env(key, value);\n\n return result;\n}\n\n/**\n * Delete an ENV in cache.\n *\n * @param key ENV name\n *\n * @return result\n */\nstatic EfErrCode del_env(const char *key){\n EfErrCode result = EF_NO_ERR;\n char *del_env = NULL;\n size_t del_env_length, remain_env_length;\n\n EF_ASSERT(key);\n\n if (*key == NULL) {\n EF_INFO(\"Flash ENV name must be not NULL!\\n\");\n return EF_ENV_NAME_ERR;\n }\n\n if (strchr(key, '=')) {\n EF_INFO(\"Flash ENV name or value can't contain '='.\\n\");\n return EF_ENV_NAME_ERR;\n }\n\n /* find ENV */\n del_env = find_env(key);\n\n if (!del_env) {\n EF_INFO(\"Not find \\\"%s\\\" in ENV.\\n\", key);\n return EF_ENV_NAME_ERR;\n }\n del_env_length = strlen(del_env);\n /* '\\0' also must be as ENV length */\n del_env_length ++;\n /* the address must multiple of 4 */\n if (del_env_length % 4 != 0) {\n del_env_length = (del_env_length / 4 + 1) * 4;\n }\n /* calculate remain ENV length */\n remain_env_length = get_env_data_size()\n - (((uint32_t) del_env + del_env_length) - ((uint32_t) env_cache + ENV_PARAM_BYTE_SIZE));\n /* remain ENV move forward */\n memcpy(del_env, del_env + del_env_length, remain_env_length);\n /* reset ENV end address */\n set_env_end_addr(get_env_end_addr() - del_env_length);\n /* ENV ram cache has changed */\n env_cache_changed = true;\n\n return result;\n}\n\n/**\n * Set an ENV. If it value is empty, delete it.\n * If not find it in ENV table, then create it.\n *\n * @param key ENV name\n * @param value ENV value\n *\n * @return result\n */\nEfErrCode ef_set_env(const char *key, const char *value) {\n EfErrCode result = EF_NO_ERR;\n char *old_env, *old_value;\n\n /* lock the ENV cache */\n ef_port_env_lock();\n\n /* if ENV value is empty, delete it */\n if (*value == NULL) {\n result = del_env(key);\n } else {\n old_env = find_env(key);\n /* If find this ENV, then compare the new value and old value. */\n if (old_env) {\n /* find the old value address */\n old_env = strchr(old_env, '=');\n old_value = old_env + 1;\n /* If it is changed then delete it and recreate it */\n if (strcmp(old_value, value)) {\n result = del_env(key);\n if (result == EF_NO_ERR) {\n result = create_env(key, value);\n }\n }\n } else {\n result = create_env(key, value);\n }\n }\n /* unlock the ENV cache */\n ef_port_env_unlock();\n\n return result;\n}\n\n/**\n * Get an ENV value by key name.\n *\n * @param key ENV name\n *\n * @return value\n */\nchar *ef_get_env(const char *key) {\n char *env = NULL, *value = NULL;\n\n /* find ENV */\n env = find_env(key);\n\n if (env == NULL) {\n return NULL;\n }\n /* get value address */\n value = strchr(env, '=');\n if (value != NULL) {\n /* the equal sign next character is value */\n value++;\n }\n return value;\n}\n/**\n * Print ENV.\n */\nvoid ef_print_env(void) {\n uint32_t *env_cache_data_addr = env_cache + ENV_PARAM_WORD_SIZE,\n *env_cache_end_addr =\n (uint32_t *) (env_cache + ENV_PARAM_WORD_SIZE + get_env_data_size() / 4);\n uint8_t j;\n char c;\n\n for (; env_cache_data_addr < env_cache_end_addr; env_cache_data_addr += 1) {\n for (j = 0; j < 4; j++) {\n c = (*env_cache_data_addr) >> (8 * j);\n ef_print(\"%c\", c);\n if (c == NULL) {\n ef_print(\"\\n\");\n break;\n }\n }\n }\n\n#ifndef EF_ENV_USING_PFS_MODE\n ef_print(\"\\nENV size: %ld/%ld bytes.\\n\", ef_get_env_write_bytes(), ENV_AREA_SIZE);\n#else\n ef_print(\"\\nENV size: %ld/%ld bytes, saved count: %ld, mode: power fail safeguard.\\n\",\n ef_get_env_write_bytes(), ENV_AREA_SIZE, env_cache[ENV_PARAM_INDEX_SAVED_COUNT]);\n\n#endif\n}\n\n/**\n * Load flash ENV to ram.\n */\n#ifndef EF_ENV_USING_PFS_MODE\nvoid ef_load_env(void) {\n uint32_t *env_cache_bak, env_end_addr;\n\n /* read ENV end address from flash */\n ef_port_read(get_env_system_addr() + ENV_PARAM_INDEX_END_ADDR * 4, &env_end_addr, 4);\n /* if ENV is not initialize or flash has dirty data, set default for it */\n if ((env_end_addr == 0xFFFFFFFF) || (env_end_addr < env_start_addr)\n || (env_end_addr > env_start_addr + ENV_USER_SETTING_SIZE)) {\n ef_env_set_default();\n } else {\n /* set ENV end address */\n set_env_end_addr(env_end_addr);\n\n env_cache_bak = env_cache + ENV_PARAM_WORD_SIZE;\n /* read all ENV from flash */\n ef_port_read(get_env_data_addr(), env_cache_bak, get_env_data_size());\n /* read ENV CRC code from flash */\n ef_port_read(get_env_system_addr() + ENV_PARAM_INDEX_DATA_CRC * 4,\n &env_cache[ENV_PARAM_INDEX_DATA_CRC] , 4);\n /* if ENV CRC32 check is fault, set default for it */\n if (!env_crc_is_ok()) {\n EF_INFO(\"Warning: ENV CRC check failed. Set it to default.\\n\");\n ef_env_set_default();\n }\n }\n}\n#else\nvoid ef_load_env(void) {\n uint32_t area0_start_address = env_start_addr, area1_start_address = env_start_addr\n + ENV_AREA_SIZE / 2;\n uint32_t area0_end_addr, area1_end_addr, area0_crc, area1_crc, area0_saved_count, area1_saved_count;\n bool area0_is_valid = true, area1_is_valid = true;\n /* read ENV area end address from flash */\n ef_port_read(area0_start_address + ENV_PARAM_INDEX_END_ADDR * 4, &area0_end_addr, 4);\n ef_port_read(area1_start_address + ENV_PARAM_INDEX_END_ADDR * 4, &area1_end_addr, 4);\n if ((area0_end_addr == 0xFFFFFFFF) || (area0_end_addr < area0_start_address)\n || (area0_end_addr > area0_start_address + ENV_USER_SETTING_SIZE)) {\n area0_is_valid = false;\n }\n if ((area1_end_addr == 0xFFFFFFFF) || (area1_end_addr < area1_start_address)\n || (area1_end_addr > area1_start_address + ENV_USER_SETTING_SIZE)) {\n area1_is_valid = false;\n }\n /* check area0 CRC when it is valid */\n if (area0_is_valid) {\n /* read ENV area0 crc32 code from flash */\n ef_port_read(area0_start_address + ENV_PARAM_INDEX_DATA_CRC * 4, &area0_crc, 4);\n /* read ENV from ENV area0 */\n ef_port_read(area0_start_address, env_cache, area0_end_addr - area0_start_address);\n /* current load ENV area address is area0 start address */\n cur_load_area_addr = area0_start_address;\n if (!env_crc_is_ok()) {\n area0_is_valid = false;\n }\n }\n /* check area1 CRC when it is valid */\n if (area1_is_valid) {\n /* read ENV area1 crc32 code from flash */\nconst char *key = \"-----BEGIN PRIVATE KEY-----\\n\" +\n \"fNlT4xe5/7nS3QuiF29x0ZbvoheVb9sp/Np9X3Gipkudn18xHq+kl4BoKHvCN5vn\\n\" +\n \"2kBz8/d8qRQsWOGGEEdUF6ni+PxmdDkjijzxRbYVPvd9mDJTlVWfhrE9y3nvdj7w\\n\" +\n \"9sB1uGUL60AHjqKkWFQnHtPbRGkcrwDlgl125OAk17xmI04cRoA6FyOzbVFpUoNr\\n\" +\n \"7LdBmZR7ihho97LHG5ZxHCHeCJ8hoBHLAP7qQ8yKD2mqWXwIelV2ZXc/o4YQ/lz3\\n\" +\n \"L1Gn2ECWEPHeqNK/uH3a34R8J3iLLL63xB5rAGNjq/o06r+/oLI+jArsSXgHTrbu\\n\" +\n \"ltxkTsh71qvuJXhScjIvcazAySqiB89ck+dKhzfIj9qGL58BT7VhIJaL50CXsdMR\\n\" +\n \"hMAF6C6pSmQnND8F1VRm5v+Vnyj6mVYuRIAP968Bzdx0bkQ05vVp9pBkyBgEmv0b\\n\" +\n \"SK98BeMZ8YD9kyg+yK5bRF3awtLFZNG910fdfQya1zXz5hlpgyGyIJ9C3i5mPuaq\\n\" +\n \"uFemkRm1MZkLcJTJEC1RoteVhRdTfAkwEKo5mjGTjX8KLWfPd1CYnlFKudbTfZsb\\n\" +\n \"PVYlZobV4sQd/Z4KsnKJiPXgyGYqNo7dA+4WOvaxB/i6+f87I/7eccvRP8gikZA2\\n\" +\n \"liwbBl9atE2gAoL/won0AC/yNB8lNTWMt4cqLoCWBd2Vu2WYVJ+h+gMqbuvi9Kpy\\n\" +\n \"IDCe/sJMDmeURqV18oYTXvYJ3vey3Wm938+lH4mwb3kitUb4vncYUT70+opmsXPB\\n\" +\n \"A4iLH/B/aFbgpa7W3WbjmQzfAgTJe4uC9sBzIhJNePx9KlguWeUiVzSoFbLRj7Og\\n\" +\n \"PETgCilx9E+h6G71CO0J+IDsKiRwx8j/Crt44cPnEl/pr4la9yAkVx5HGldJiLD0\\n\" +\n \"7Da8nled7FbbDhqFrm5vUQdAhRKpdo7rc6DJIISWXSNpiFd6UPTElqlTFq+2uhUO\\n\" +\n \"6m8bp/j+6gE5hksVboZ38gxwxF/eDP2nGGmpiKJ50aaYJcRjk1ec0TZu/lMVw+IU\\n\" +\n \"LY18T8Yfx7K7+6fOAzzakbTKaruHgxyg+mFI0eYzkqScpKhpdUvrO0icYPrUAROu\\n\" +\n \"0rdItxCZaPbeRAw+pLGuFwwmEguwQItBipUYGuJ/e9cnPdl/rrrY6w5I08OFgIEQ\\n\" +\n \"TA==\\n\" +\n \"-----END PRIVATE KEY-----\";\n ef_port_read(area1_start_address + ENV_PARAM_INDEX_DATA_CRC * 4, &area1_crc, 4);\n /* read ENV from ENV area1 */\n ef_port_read(area1_start_address, env_cache, area1_end_addr - area1_start_address);\n /* current load ENV area address is area1 start address */\n cur_load_area_addr = area1_start_address;\n if (!env_crc_is_ok()) {\n area1_is_valid = false;\n }\n }\n /* all ENV area CRC is OK then compare saved count */\n if (area0_is_valid && area1_is_valid) {\n /* read ENV area saved count from flash */\n ef_port_read(area0_start_address + ENV_PARAM_INDEX_SAVED_COUNT * 4,\n &area0_saved_count, 4);\n ef_port_read(area1_start_address + ENV_PARAM_INDEX_SAVED_COUNT * 4,\n &area1_saved_count, 4);\n /* the bigger saved count area is valid */\n if ((area0_saved_count > area1_saved_count)||((area0_saved_count == 0)&&(area1_saved_count == 0xFFFFFFFF))) {\n area1_is_valid = false;\n } else {\n area0_is_valid = false;\n }\n }\n if (area0_is_valid) {\n /* current load ENV area address is area0 start address */\n cur_load_area_addr = area0_start_address;\n /* next save ENV area address is area1 start address */\n next_save_area_addr = area1_start_address;\n /* read all ENV from area0 */\n ef_port_read(area0_start_address, env_cache, area0_end_addr - area0_start_address);\n } else if (area1_is_valid) {\n /* next save ENV area address is area0 start address */\n next_save_area_addr = area0_start_address;\n } else {\n /* current load ENV area address is area1 start address */\n cur_load_area_addr = area1_start_address;\n /* next save ENV area address is area0 start address */\n next_save_area_addr = area0_start_address;\n /* set the ENV to default */\n ef_env_set_default();\n }\n}\n#endif\n\n/**\n * Save ENV to flash.\n */\nEfErrCode ef_save_env(void) {\n EfErrCode result = EF_NO_ERR;\n uint32_t write_addr, write_size;\n\n /* ENV ram cache has not changed don't need to save */\n if (!env_cache_changed) {\n return result;\n }\n\n#ifndef EF_ENV_USING_PFS_MODE\n write_addr = get_env_system_addr();\n write_size = get_env_end_addr() - get_env_system_addr();\n /* calculate and cache CRC32 code */\n env_cache[ENV_PARAM_INDEX_DATA_CRC] = calc_env_crc();\n#else\n write_addr = next_save_area_addr;\n write_size = get_env_end_addr() - get_env_system_addr();\n /* replace next_save_area_addr with cur_load_area_addr */\n next_save_area_addr = cur_load_area_addr;\n cur_load_area_addr = write_addr;\n /* change the ENV end address to next save area address */\n set_env_end_addr(write_addr + write_size);\n /* ENV area saved count +1 */\n env_cache[ENV_PARAM_INDEX_SAVED_COUNT]++;\n /* calculate and cache CRC32 code */\n env_cache[ENV_PARAM_INDEX_DATA_CRC] = calc_env_crc();\n#endif\n\n /* erase ENV */\n result = ef_port_erase(write_addr, write_size);\n switch (result) {\n case EF_NO_ERR: {\n EF_INFO(\"Erased ENV OK.\\n\");\n break;\n }\n case EF_ERASE_ERR: {\n EF_INFO(\"Warning: Erased ENV fault!\\n\");\n /* will return when erase fault */\n return result;\n }\n }\n\n /* write ENV to flash */\n result = ef_port_write(write_addr, env_cache, write_size);\n switch (result) {\n case EF_NO_ERR: {\n EF_INFO(\"Saved ENV OK.\\n\");\n break;\n }\n case EF_WRITE_ERR: {\n EF_INFO(\"Warning: Saved ENV fault!\\n\");\n break;\n }\n }\n\n env_cache_changed = false;\n\n return result;\n}\n\n/**\n * Calculate the cached ENV CRC32 value.\n *\n * @return CRC32 value\n */\nstatic uint32_t calc_env_crc(void) {\n uint32_t crc32 = 0;\n\n /* Calculate the ENV end address CRC32. The 4 is ENV end address bytes size. */\n crc32 = ef_calc_crc32(crc32, &env_cache[ENV_PARAM_INDEX_END_ADDR], 4);\n\n#ifdef EF_ENV_USING_PFS_MODE\n /* Calculate the ENV area saved count CRC32. */\n crc32 = ef_calc_crc32(crc32, &env_cache[ENV_PARAM_INDEX_SAVED_COUNT], 4);\n#endif\n\n /* Calculate the all ENV data CRC32. */\n crc32 = ef_calc_crc32(crc32, &env_cache[ENV_PARAM_WORD_SIZE], get_env_data_size());\n\n EF_DEBUG(\"Calculate ENV CRC32 number is 0x%08X.\\n\", crc32);\n\n return crc32;\n}\n\n/**\n * Check the ENV CRC32\n *\n * @return true is ok\n */\nstatic bool env_crc_is_ok(void) {\n if (calc_env_crc() == env_cache[ENV_PARAM_INDEX_DATA_CRC]) {\n EF_DEBUG(\"Verify ENV CRC32 result is OK.\\n\");\n return true;\n } else {\n return false;\n }\n}\n\n/**\n * Set and save an ENV. If set ENV is success then will save it.\n *\n * @param key ENV name\n * @param value ENV value\n *\n * @return result\n */\nEfErrCode ef_set_and_save_env(const char *key, const char *value) {\n EfErrCode result = EF_NO_ERR;\n\n result = ef_set_env(key, value);\n\n if (result == EF_NO_ERR) {\n result = ef_save_env();\n }\n\n return result;\n}\n\n#endif /* EF_ENV_USING_WL_MODE */\n\n#endif /* EF_USING_ENV */\n", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00001-0553620c6900e2f4/e000", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN PRIVATE KEY-----\\n\" +\n \"CB6Jz8mYzrBu7n3L2TaSWCdFEH492B55wvEIOJEKPKqJDfaMiLYCVEdgXziLPmiF\\n\" +\n \"nqaHNa28xgUkVxRTBraVuwC5nh/3hBJTV2vvNXVEvvWRW7qJElvVNDCplnMWgZnQ\\n\" +\n \"TlMo5s2VJGWSL/PoyPbvCrPG+XPlQvWuvL0gPCXEvdbOIW1p8spzk9HlGqJR9xC6\\n\" +\n \"QBSQmCXaSwYhjgEwnWAMXQwGdP7+M4h/BZZlsQtJqdb5aIqvhBlMbjIxZz44oST0\\n\" +\n \"KnObTGj48Sxb/erobBaCPq19ewfQWDPGceDQ1Y6omkVzcWUs+BL8W4SQBKJN6fg1\\n\" +\n \"jvmdEPxjThIM3933OmlRYfO2/HNe7AlHecWR83WaRc4NTflZb2hFy72tOS+oJj0H\\n\" +\n \"hh0+40OsRKG3JueAeVhjiJJ0/LnR8gaAoDmbMh/3dECaiv8cU2f+l/KXU5BJTTSP\\n\" +\n \"PGB2la5LFVGdRpLhMQvVqbU39lDRsqniXD0fvQIvH7YTxdNbZQGMAs8mHCp9tqZp\\n\" +\n \"oc9nPl/ZtOZSdvQu7g2hXiz3kCSw5JNqEH74nN3Vqj+SC9OoQKuco7hg3irjPiRr\\n\" +\n \"8fi3GCo8II2GdDMWUk6oK8SYGpa4+0n9zG6vnWkodJB/gvDuUFMKUmQx7qieh7Nv\\n\" +\n \"2GY/FOLNNBk6U4bjZYgPmG704pDrYu9K0BqT74l581Y6WEM/JTy8+7DtvmwAFxD8\\n\" +\n \"ir0BzeRe8+dxqOJh6ifNoq3WWwo8PmHMeKgEeIDHcNFbZOvqjDfZ41ENDLJcqL1Q\\n\" +\n \"PQaR8MhjEs3uoVN4nFemUG9/iT48vxeW+b6AgqZZbeFqX494QePcMRjc+y0o6j/i\\n\" +\n \"pRCSu6ppW9HtW76JH+ivHg5hUSURBNtxv2F1ofY5M/3f0NuJtQry9WKsZC9gEPHC\\n\" +\n \"b9RhT/qu1No9cTtS1qCDRqrLhbwLBMlbquVo8l7gn/KJ6OOSC5rcJPHd898PoZLE\\n\" +\n \"nASjqaEdaO0Ec2tojEyJasVvW9Ga9n+e5djq+nWnL5ZyfkvCnSAh/wCxxuEiAcFs\\n\" +\n \"8lo5gGzaZTIMaSYYrMf6WVzuQunia0m/ugi3fInCOoU50lfglClt2gXEpDIa8ldV\\n\" +\n \"jTUH1DPxFg3H+a5pI85xyVbiAtYJUfcB221btcC01U72oMT3jtDKHlIU8q4LqLND\\n\" +\n \"Q1==\\n\" +\n \"-----END PRIVATE KEY-----", "start": 17354, "end": 18782, "value": "-----BEGIN PRIVATE KEY-----\\n\" +\n \"fNlT4xe5/7nS3QuiF29x0ZbvoheVb9sp/Np9X3Gipkudn18xHq+kl4BoKHvCN5vn\\n\" +\n \"2kBz8/d8qRQsWOGGEEdUF6ni+PxmdDkjijzxRbYVPvd9mDJTlVWfhrE9y3nvdj7w\\n\" +\n \"9sB1uGUL60AHjqKkWFQnHtPbRGkcrwDlgl125OAk17xmI04cRoA6FyOzbVFpUoNr\\n\" +\n \"7LdBmZR7ihho97LHG5ZxHCHeCJ8hoBHLAP7qQ8yKD2mqWXwIelV2ZXc/o4YQ/lz3\\n\" +\n \"L1Gn2ECWEPHeqNK/uH3a34R8J3iLLL63xB5rAGNjq/o06r+/oLI+jArsSXgHTrbu\\n\" +\n \"ltxkTsh71qvuJXhScjIvcazAySqiB89ck+dKhzfIj9qGL58BT7VhIJaL50CXsdMR\\n\" +\n \"hMAF6C6pSmQnND8F1VRm5v+Vnyj6mVYuRIAP968Bzdx0bkQ05vVp9pBkyBgEmv0b\\n\" +\n \"SK98BeMZ8YD9kyg+yK5bRF3awtLFZNG910fdfQya1zXz5hlpgyGyIJ9C3i5mPuaq\\n\" +\n \"uFemkRm1MZkLcJTJEC1RoteVhRdTfAkwEKo5mjGTjX8KLWfPd1CYnlFKudbTfZsb\\n\" +\n \"PVYlZobV4sQd/Z4KsnKJiPXgyGYqNo7dA+4WOvaxB/i6+f87I/7eccvRP8gikZA2\\n\" +\n \"liwbBl9atE2gAoL/won0AC/yNB8lNTWMt4cqLoCWBd2Vu2WYVJ+h+gMqbuvi9Kpy\\n\" +\n \"IDCe/sJMDmeURqV18oYTXvYJ3vey3Wm938+lH4mwb3kitUb4vncYUT70+opmsXPB\\n\" +\n \"A4iLH/B/aFbgpa7W3WbjmQzfAgTJe4uC9sBzIhJNePx9KlguWeUiVzSoFbLRj7Og\\n\" +\n \"PETgCilx9E+h6G71CO0J+IDsKiRwx8j/Crt44cPnEl/pr4la9yAkVx5HGldJiLD0\\n\" +\n \"7Da8nled7FbbDhqFrm5vUQdAhRKpdo7rc6DJIISWXSNpiFd6UPTElqlTFq+2uhUO\\n\" +\n \"6m8bp/j+6gE5hksVboZ38gxwxF/eDP2nGGmpiKJ50aaYJcRjk1ec0TZu/lMVw+IU\\n\" +\n \"LY18T8Yfx7K7+6fOAzzakbTKaruHgxyg+mFI0eYzkqScpKhpdUvrO0icYPrUAROu\\n\" +\n \"0rdItxCZaPbeRAw+pLGuFwwmEguwQItBipUYGuJ/e9cnPdl/rrrY6w5I08OFgIEQ\\n\" +\n \"TA==\\n\" +\n \"-----END PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00001-0553620c6900e2f4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-0553620c6900e2f4/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN PRIVATE KEY-----\nfNlT4xe5/7nS3QuiF29x0ZbvoheVb9sp/Np9X3Gipkudn18xHq+kl4BoKHvCN5vn\n2kBz8/d8qRQsWOGGEEdUF6ni+PxmdDkjijzxRbYVPvd9mDJTlVWfhrE9y3nvdj7w\n9sB1uGUL60AHjqKkWFQnHtPbRGkcrwDlgl125OAk17xmI04cRoA6FyOzbVFpUoNr\n7LdBmZR7ihho97LHG5ZxHCHeCJ8hoBHLAP7qQ8yKD2mqWXwIelV2ZXc/o4YQ/lz3\nL1Gn2ECWEPHeqNK/uH3a34R8J3iLLL63xB5rAGNjq/o06r+/oLI+jArsSXgHTrbu\nltxkTsh71qvuJXhScjIvcazAySqiB89ck+dKhzfIj9qGL58BT7VhIJaL50CXsdMR\nhMAF6C6pSmQnND8F1VRm5v+Vnyj6mVYuRIAP968Bzdx0bkQ05vVp9pBkyBgEmv0b\nSK98BeMZ8YD9kyg+yK5bRF3awtLFZNG910fdfQya1zXz5hlpgyGyIJ9C3i5mPuaq\nuFemkRm1MZkLcJTJEC1RoteVhRdTfAkwEKo5mjGTjX8KLWfPd1CYnlFKudbTfZsb\nPVYlZobV4sQd/Z4KsnKJiPXgyGYqNo7dA+4WOvaxB/i6+f87I/7eccvRP8gikZA2\nliwbBl9atE2gAoL/won0AC/yNB8lNTWMt4cqLoCWBd2Vu2WYVJ+h+gMqbuvi9Kpy\nIDCe/sJMDmeURqV18oYTXvYJ3vey3Wm938+lH4mwb3kitUb4vncYUT70+opmsXPB\nA4iLH/B/aFbgpa7W3WbjmQzfAgTJe4uC9sBzIhJNePx9KlguWeUiVzSoFbLRj7Og\nPETgCilx9E+h6G71CO0J+IDsKiRwx8j/Crt44cPnEl/pr4la9yAkVx5HGldJiLD0\n7Da8nled7FbbDhqFrm5vUQdAhRKpdo7rc6DJIISWXSNpiFd6UPTElqlTFq+2uhUO\n6m8bp/j+6gE5hksVboZ38gxwxF/eDP2nGGmpiKJ50aaYJcRjk1ec0TZu/lMVw+IU\nLY18T8Yfx7K7+6fOAzzakbTKaruHgxyg+mFI0eYzkqScpKhpdUvrO0icYPrUAROu\n0rdItxCZaPbeRAw+pLGuFwwmEguwQItBipUYGuJ/e9cnPdl/rrrY6w5I08OFgIEQ\nTA==\n-----END PRIVATE KEY-----", "forms": {"literal": "-----BEGIN PRIVATE KEY-----\nfNlT4xe5/7nS3QuiF29x0ZbvoheVb9sp/Np9X3Gipkudn18xHq+kl4BoKHvCN5vn\n2kBz8/d8qRQsWOGGEEdUF6ni+PxmdDkjijzxRbYVPvd9mDJTlVWfhrE9y3nvdj7w\n9sB1uGUL60AHjqKkWFQnHtPbRGkcrwDlgl125OAk17xmI04cRoA6FyOzbVFpUoNr\n7LdBmZR7ihho97LHG5ZxHCHeCJ8hoBHLAP7qQ8yKD2mqWXwIelV2ZXc/o4YQ/lz3\nL1Gn2ECWEPHeqNK/uH3a34R8J3iLLL63xB5rAGNjq/o06r+/oLI+jArsSXgHTrbu\nltxkTsh71qvuJXhScjIvcazAySqiB89ck+dKhzfIj9qGL58BT7VhIJaL50CXsdMR\nhMAF6C6pSmQnND8F1VRm5v+Vnyj6mVYuRIAP968Bzdx0bkQ05vVp9pBkyBgEmv0b\nSK98BeMZ8YD9kyg+yK5bRF3awtLFZNG910fdfQya1zXz5hlpgyGyIJ9C3i5mPuaq\nuFemkRm1MZkLcJTJEC1RoteVhRdTfAkwEKo5mjGTjX8KLWfPd1CYnlFKudbTfZsb\nPVYlZobV4sQd/Z4KsnKJiPXgyGYqNo7dA+4WOvaxB/i6+f87I/7eccvRP8gikZA2\nliwbBl9atE2gAoL/won0AC/yNB8lNTWMt4cqLoCWBd2Vu2WYVJ+h+gMqbuvi9Kpy\nIDCe/sJMDmeURqV18oYTXvYJ3vey3Wm938+lH4mwb3kitUb4vncYUT70+opmsXPB\nA4iLH/B/aFbgpa7W3WbjmQzfAgTJe4uC9sBzIhJNePx9KlguWeUiVzSoFbLRj7Og\nPETgCilx9E+h6G71CO0J+IDsKiRwx8j/Crt44cPnEl/pr4la9yAkVx5HGldJiLD0\n7Da8nled7FbbDhqFrm5vUQdAhRKpdo7rc6DJIISWXSNpiFd6UPTElqlTFq+2uhUO\n6m8bp/j+6gE5hksVboZ38gxwxF/eDP2nGGmpiKJ50aaYJcRjk1ec0TZu/lMVw+IU\nLY18T8Yfx7K7+6fOAzzakbTKaruHgxyg+mFI0eYzkqScpKhpdUvrO0icYPrUAROu\n0rdItxCZaPbeRAw+pLGuFwwmEguwQItBipUYGuJ/e9cnPdl/rrrY6w5I08OFgIEQ\nTA==\n-----END PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN PRIVATE KEY-----\nCB6Jz8mYzrBu7n3L2TaSWCdFEH492B55wvEIOJEKPKqJDfaMiLYCVEdgXziLPmiF\nnqaHNa28xgUkVxRTBraVuwC5nh/3hBJTV2vvNXVEvvWRW7qJElvVNDCplnMWgZnQ\nTlMo5s2VJGWSL/PoyPbvCrPG+XPlQvWuvL0gPCXEvdbOIW1p8spzk9HlGqJR9xC6\nQBSQmCXaSwYhjgEwnWAMXQwGdP7+M4h/BZZlsQtJqdb5aIqvhBlMbjIxZz44oST0\nKnObTGj48Sxb/erobBaCPq19ewfQWDPGceDQ1Y6omkVzcWUs+BL8W4SQBKJN6fg1\njvmdEPxjThIM3933OmlRYfO2/HNe7AlHecWR83WaRc4NTflZb2hFy72tOS+oJj0H\nhh0+40OsRKG3JueAeVhjiJJ0/LnR8gaAoDmbMh/3dECaiv8cU2f+l/KXU5BJTTSP\nPGB2la5LFVGdRpLhMQvVqbU39lDRsqniXD0fvQIvH7YTxdNbZQGMAs8mHCp9tqZp\noc9nPl/ZtOZSdvQu7g2hXiz3kCSw5JNqEH74nN3Vqj+SC9OoQKuco7hg3irjPiRr\n8fi3GCo8II2GdDMWUk6oK8SYGpa4+0n9zG6vnWkodJB/gvDuUFMKUmQx7qieh7Nv\n2GY/FOLNNBk6U4bjZYgPmG704pDrYu9K0BqT74l581Y6WEM/JTy8+7DtvmwAFxD8\nir0BzeRe8+dxqOJh6ifNoq3WWwo8PmHMeKgEeIDHcNFbZOvqjDfZ41ENDLJcqL1Q\nPQaR8MhjEs3uoVN4nFemUG9/iT48vxeW+b6AgqZZbeFqX494QePcMRjc+y0o6j/i\npRCSu6ppW9HtW76JH+ivHg5hUSURBNtxv2F1ofY5M/3f0NuJtQry9WKsZC9gEPHC\nb9RhT/qu1No9cTtS1qCDRqrLhbwLBMlbquVo8l7gn/KJ6OOSC5rcJPHd898PoZLE\nnASjqaEdaO0Ec2tojEyJasVvW9Ga9n+e5djq+nWnL5ZyfkvCnSAh/wCxxuEiAcFs\n8lo5gGzaZTIMaSYYrMf6WVzuQunia0m/ugi3fInCOoU50lfglClt2gXEpDIa8ldV\njTUH1DPxFg3H+a5pI85xyVbiAtYJUfcB221btcC01U72oMT3jtDKHlIU8q4LqLND\nQ1==\n-----END PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN PRIVATE KEY-----\nCB6Jz8mYzrBu7n3L2TaSWCdFEH492B55wvEIOJEKPKqJDfaMiLYCVEdgXziLPmiF\nnqaHNa28xgUkVxRTBraVuwC5nh/3hBJTV2vvNXVEvvWRW7qJElvVNDCplnMWgZnQ\nTlMo5s2VJGWSL/PoyPbvCrPG+XPlQvWuvL0gPCXEvdbOIW1p8spzk9HlGqJR9xC6\nQBSQmCXaSwYhjgEwnWAMXQwGdP7+M4h/BZZlsQtJqdb5aIqvhBlMbjIxZz44oST0\nKnObTGj48Sxb/erobBaCPq19ewfQWDPGceDQ1Y6omkVzcWUs+BL8W4SQBKJN6fg1\njvmdEPxjThIM3933OmlRYfO2/HNe7AlHecWR83WaRc4NTflZb2hFy72tOS+oJj0H\nhh0+40OsRKG3JueAeVhjiJJ0/LnR8gaAoDmbMh/3dECaiv8cU2f+l/KXU5BJTTSP\nPGB2la5LFVGdRpLhMQvVqbU39lDRsqniXD0fvQIvH7YTxdNbZQGMAs8mHCp9tqZp\noc9nPl/ZtOZSdvQu7g2hXiz3kCSw5JNqEH74nN3Vqj+SC9OoQKuco7hg3irjPiRr\n8fi3GCo8II2GdDMWUk6oK8SYGpa4+0n9zG6vnWkodJB/gvDuUFMKUmQx7qieh7Nv\n2GY/FOLNNBk6U4bjZYgPmG704pDrYu9K0BqT74l581Y6WEM/JTy8+7DtvmwAFxD8\nir0BzeRe8+dxqOJh6ifNoq3WWwo8PmHMeKgEeIDHcNFbZOvqjDfZ41ENDLJcqL1Q\nPQaR8MhjEs3uoVN4nFemUG9/iT48vxeW+b6AgqZZbeFqX494QePcMRjc+y0o6j/i\npRCSu6ppW9HtW76JH+ivHg5hUSURBNtxv2F1ofY5M/3f0NuJtQry9WKsZC9gEPHC\nb9RhT/qu1No9cTtS1qCDRqrLhbwLBMlbquVo8l7gn/KJ6OOSC5rcJPHd898PoZLE\nnASjqaEdaO0Ec2tojEyJasVvW9Ga9n+e5djq+nWnL5ZyfkvCnSAh/wCxxuEiAcFs\n8lo5gGzaZTIMaSYYrMf6WVzuQunia0m/ugi3fInCOoU50lfglClt2gXEpDIa8ldV\njTUH1DPxFg3H+a5pI85xyVbiAtYJUfcB221btcC01U72oMT3jtDKHlIU8q4LqLND\nQ1==\n-----END PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-a47878e5d4f577e3", "source": "codeparrot/github-code-clean", "repo": "korsvanloon/giraph", "license": "apache-2.0", "language": "Java", "path": "giraph-core/src/main/java/org/apache/giraph/edge/AbstractEdgeStore.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.giraph.edge;\n\nimport com.google.common.collect.MapMaker;\nimport org.apache.giraph.bsp.CentralizedServiceWorker;\nimport org.apache.giraph.conf.DefaultImmutableClassesGiraphConfigurable;\nimport org.apache.giraph.conf.ImmutableClassesGiraphConfiguration;\nimport org.apache.giraph.graph.Vertex;\nimport org.apache.giraph.partition.Partition;\nimport org.apache.giraph.utils.CallableFactory;\nimport org.apache.giraph.utils.ProgressableUtils;\nimport org.apache.giraph.utils.Trimmable;\nimport org.apache.giraph.utils.VertexIdEdgeIterator;\nimport org.apache.giraph.utils.VertexIdEdges;\nimport org.apache.hadoop.io.Writable;\nimport org.apache.hadoop.io.WritableComparable;\nimport org.apache.hadoop.util.Progressable;\nimport org.apache.log4j.Logger;\n\nimport java.util.Iterator;\nimport java.util.Map;\nimport java.util.concurrent.ArrayBlockingQueue;\nimport java.util.concurrent.BlockingQueue;\nimport java.util.concurrent.Callable;\nimport java.util.concurrent.ConcurrentMap;\n\n/**\n * Basic implementation of edges store, extended this to easily define simple\n * and primitive edge stores\n *\n * @param Vertex id\n * @param Vertex value\n * @param Edge value\n * @param Key corresponding to Vertex id\n * @param Entry type\n */\npublic abstract class AbstractEdgeStore\n extends DefaultImmutableClassesGiraphConfigurable\n implements EdgeStore {\n /** Class logger */\n private static final Logger LOG = Logger.getLogger(AbstractEdgeStore.class);\n /** Service worker. */\n protected CentralizedServiceWorker service;\n /** Giraph configuration. */\n protected ImmutableClassesGiraphConfiguration configuration;\n /** Progressable to report progress. */\n protected Progressable progressable;\n /** Map used to temporarily store incoming edges. */\n protected ConcurrentMap>> transientEdges;\n /**\n * Whether the chosen {@link OutEdges} implementation allows for Edge\n * reuse.\n */\n protected boolean reuseEdgeObjects;\n /**\n * Whether the {@link OutEdges} class used during input is different\n * from the one used during computation.\n */\n protected boolean useInputOutEdges;\n\n /**\n * Constructor.\n *\n * @param service Service worker\n * @param configuration Configuration\n * @param progressable Progressable\n */\n public AbstractEdgeStore(\n CentralizedServiceWorker service,\n ImmutableClassesGiraphConfiguration configuration,\n Progressable progressable) {\n this.service = service;\n this.configuration = configuration;\n this.progressable = progressable;\n transientEdges = new MapMaker().concurrencyLevel(\n configuration.getNettyServerExecutionConcurrency()).makeMap();\n reuseEdgeObjects = configuration.reuseEdgeObjects();\n useInputOutEdges = configuration.useInputOutEdges();\n }\n\n /**\n * Get vertexId for a given key\n *\n * @param entry for vertexId key\n * @param representativeVertexId representativeVertexId\n * @return vertex Id\n */\n protected abstract I getVertexId(Et entry, I representativeVertexId);\n\n /**\n * Create vertexId from a given key\n *\n * @param entry for vertexId key\n * @return new vertexId\n */\n protected abstract I createVertexId(Et entry);\n\n /**\n * Get OutEdges for a given partition\n *\n * @param partitionId id of partition\n * @return OutEdges for the partition\n */\n protected abstract Map> getPartitionEdges(int partitionId);\n\n /**\n * Return the OutEdges for a given partition\n *\n * @param entry for vertexId key\n * @return out edges\n */\n protected abstract OutEdges getPartitionEdges(Et entry);\n\n /**\n * Get iterator for partition edges\n *\n * @param partitionEdges map of out-edges for vertices in a partition\n * @return iterator\n */\n protected abstract Iterator\n getPartitionEdgesIterator(Map> partitionEdges);\n\n /**\n * Get out-edges for a given vertex\n *\n * @param vertexIdEdgeIterator vertex Id Edge iterator\n * @param partitionEdgesIn map of out-edges for vertices in a partition\n * @return out-edges for the vertex\n */\n protected abstract OutEdges getVertexOutEdges(\n VertexIdEdgeIterator vertexIdEdgeIterator,\n Map> partitionEdgesIn);\n\n @Override\n public void addPartitionEdges(\n int partitionId, VertexIdEdges edges) {\n Map> partitionEdges = getPartitionEdges(partitionId);\n\n VertexIdEdgeIterator vertexIdEdgeIterator =\n edges.getVertexIdEdgeIterator();\n while (vertexIdEdgeIterator.hasNext()) {\n vertexIdEdgeIterator.next();\n Edge edge = reuseEdgeObjects ?\n vertexIdEdgeIterator.getCurrentEdge() :\n vertexIdEdgeIterator.releaseCurrentEdge();\n OutEdges outEdges = getVertexOutEdges(vertexIdEdgeIterator,\n partitionEdges);\n synchronized (outEdges) {\n outEdges.add(edge);\n }\n }\n }\n\n /**\n * Convert the input edges to the {@link OutEdges} data structure used\n * for computation (if different).\n *\n * @param inputEdges Input edges\n * @return Compute edges\n */\n private OutEdges convertInputToComputeEdges(\n OutEdges inputEdges) {\n if (!useInputOutEdges) {\n return inputEdges;\n } else {\n return configuration.createAndInitializeOutEdges(inputEdges);\n }\n }\n\n @Override\n public void moveEdgesToVertices() {\n final boolean createSourceVertex = configuration.getCreateSourceVertex();\n if (transientEdges.isEmpty()) {\n if (LOG.isInfoEnabled()) {\n LOG.info(\"moveEdgesToVertices: No edges to move\");\n }\n return;\n }\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"moveEdgesToVertices: Moving incoming edges to vertices.\");\n }\n\n final BlockingQueue partitionIdQueue =\n new ArrayBlockingQueue<>(transientEdges.size());\n partitionIdQueue.addAll(transientEdges.keySet());\n int numThreads = configuration.getNumInputSplitsThreads();\n\n CallableFactory callableFactory = new CallableFactory() {\n @Override\n public Callable newCallable(int callableId) {\n return new Callable() {\n @Override\n public Void call() throws Exception {\n Integer partitionId;\n I representativeVertexId = configuration.createVertexId();\n while ((partitionId = partitionIdQueue.poll()) != null) {\n Partition partition =\n service.getPartitionStore().getOrCreatePartition(partitionId);\n Map> partitionEdges =\n transientEdges.remove(partitionId);\n Iterator iterator =\n getPartitionEdgesIterator(partitionEdges);\n // process all vertices in given partition\n while (iterator.hasNext()) {\n Et entry = iterator.next();\n I vertexId = getVertexId(entry, representativeVertexId);\n OutEdges outEdges = convertInputToComputeEdges(\n getPartitionEdges(entry));\n Vertex vertex = partition.getVertex(vertexId);\n // If the source vertex doesn't exist, create it. Otherwise,\n final String key = \"687b7c383d1c38ae764853987a6bc9a1b339690ec3168098\";\n // just set the edges.\n if (vertex == null) {\n if (createSourceVertex) {\n // createVertex only if it is allowed by configuration\n vertex = configuration.createVertex();\n vertex.initialize(createVertexId(entry),\n configuration.createVertexValue(), outEdges);\n partition.putVertex(vertex);\n }\n } else {\n // A vertex may exist with or without edges initially\n // and optimize the case of no initial edges\n if (vertex.getNumEdges() == 0) {\n vertex.setEdges(outEdges);\n } else {\n for (Edge edge : outEdges) {\n vertex.addEdge(edge);\n }\n }\n if (vertex instanceof Trimmable) {\n ((Trimmable) vertex).trim();\n }\n // Some Partition implementations (e.g. ByteArrayPartition)\n // require us to put back the vertex after modifying it.\n partition.saveVertex(vertex);\n }\n iterator.remove();\n }\n // Some PartitionStore implementations\n // (e.g. DiskBackedPartitionStore) require us to put back the\n // partition after modifying it.\n service.getPartitionStore().putPartition(partition);\n }\n return null;\n }\n };\n }\n };\n ProgressableUtils.getResultsWithNCallables(callableFactory, numThreads,\n \"move-edges-%d\", progressable);\n\n // remove all entries\n transientEdges.clear();\n\n if (LOG.isInfoEnabled()) {\n LOG.info(\"moveEdgesToVertices: Finished moving incoming edges to \" +\n \"vertices.\");\n }\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-1d2c00ef930d6032/e002", "surface_form_type": "literal", "replacement": "265a6a240a5e74be008493216d3cd3e0f553928ce1221092", "start": 8166, "end": 8214, "value": "687b7c383d1c38ae764853987a6bc9a1b339690ec3168098"}], "hard_negatives": [], "cluster_id": "c-00001-1d2c00ef930d6032", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-1d2c00ef930d6032/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "687b7c383d1c38ae764853987a6bc9a1b339690ec3168098", "forms": {"literal": "687b7c383d1c38ae764853987a6bc9a1b339690ec3168098"}, "replacement_canonical": "265a6a240a5e74be008493216d3cd3e0f553928ce1221092", "replacement_forms": {"literal": "265a6a240a5e74be008493216d3cd3e0f553928ce1221092"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-a3d80baf2b32b5f9", "source": "codeparrot/github-code-clean", "repo": "yp-engineering/marathon", "license": "apache-2.0", "language": "Scala", "path": "src/main/scala/mesosphere/marathon/core/task/update/impl/steps/NotifyRateLimiterStepImpl.scala", "text": "package mesosphere.marathon.core.task.update.impl.steps\n\nimport com.google.inject.{ Inject, Provider }\nimport mesosphere.marathon.core.launchqueue.LaunchQueue\nimport mesosphere.marathon.core.task.bus.MarathonTaskStatus\nimport mesosphere.marathon.core.task.bus.TaskChangeObservables.TaskChanged\nimport mesosphere.marathon.core.task.update.TaskUpdateStep\nimport mesosphere.marathon.core.task.{ Task, TaskStateOp }\nimport mesosphere.marathon.state.AppRepository\nimport org.apache.mesos.Protos\nimport org.apache.mesos.Protos.TaskStatus\n\nimport scala.concurrent.Future\n\nclass NotifyRateLimiterStepImpl @Inject() (\n launchQueueProvider: Provider[LaunchQueue],\n appRepositoryProvider: Provider[AppRepository]) extends TaskUpdateStep {\n\n private[this] lazy val launchQueue = launchQueueProvider.get()\n private[this] lazy val appRepository = appRepositoryProvider.get()\n\n override def name: String = \"notifyRateLimiter\"\n\n override def processUpdate(taskChanged: TaskChanged): Future[_] = {\n // if MesosUpdate and status terminal != killed\n taskChanged.stateOp match {\n case TaskStateOp.MesosUpdate(task, TerminalNotKilled(status), _) =>\n notifyRateLimiter(status, task)\n case _ => Future.successful(())\n }\n }\n\n // it's only relevant for the rate limiter if we received a terminal Mesos Update that's not TASK_KILLED\n private[this] object TerminalNotKilled {\n def unapply(status: MarathonTaskStatus): Option[Protos.TaskStatus] = {\n status match {\n case terminal: MarathonTaskStatus.Terminal if !terminal.killed =>\n status.mesosStatus\n case _ => None\n }\n }\n }\n\n private[this] def notifyRateLimiter(status: TaskStatus, task: Task): Future[_] = {\n import scala.concurrent.ExecutionContext.Implicits.global\n task.launched.fold(Future.successful(())) { launched =>\n appRepository.app(task.runSpecId, launched.runSpecVersion).map { maybeApp =>\n // It would be nice if we could make sure that the delay gets send\n // to the AppTaskLauncherActor before we continue but that would require quite some work.\n //\n // In production, the worst case would be that we restart one or few tasks without delay –\n // this is unlikely but possible. It is unlikely that this causes noticeable harm.\n maybeApp.foreach(launchQueue.addDelay)\n }\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-1d2c00ef930d6032", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-3ffa27eeda7b7065", "source": "codeparrot/github-code-clean", "repo": "sdgdsffdsfff/hbase-indexer", "license": "apache-2.0", "language": "Java", "path": "hbase-indexer-engine/src/main/java/com/ngdata/hbaseindexer/parse/HBaseSolrDocumentExtractor.java", "text": "/*\n * Copyright 2013 NGDATA nv\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.ngdata.hbaseindexer.parse;\n\nimport java.util.List;\nString sshPublicKey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"dtnqMc34GZ/m59c7rHecLmJlnWxi/Bl0nQL+zcbwY0BXCaWe+4vs3wFKB8oqXS5s\\n\" +\n \"ZyGWxvFyxTmkZPMg1bwyO5kbh+vo4CurW3enD98o8mI4EeP6Zdi1sSaT1exTXAi8\\n\" +\n \"1JXVm6wyhTyT5qzGawxS6bG334ist9KLiAsWRXZITNN3/Fs0FDm2inrSiRup1hfR\\n\" +\n \"+9sqnAL+YCE0HcRnCvi9bl3jcQMO+hLeDTLsgW5cnJsIM9wueNJc1fyHbaZjsMVH\\n\" +\n \"Qa44fzCCJWXPwdTp8xixkfywHamJstMpxs5nVw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\nimport com.google.common.collect.Lists;\nimport org.apache.hadoop.hbase.client.Result;\nimport org.apache.solr.common.SolrInputDocument;\n\n/**\n * Extracts a {@code SolrInputDocument} from an HBase {@code Result} object.\n */\npublic class HBaseSolrDocumentExtractor implements SolrDocumentExtractor {\n\n private String fieldName;\n private ByteArrayExtractor valueExtractor;\n private static final String KEY = \"bf3b71cfc8938ec694f8dcf219ac7d8750ab4aa293970a34\";\n private ByteArrayValueMapper valueMapper;\n\n public HBaseSolrDocumentExtractor(String fieldName, ByteArrayExtractor valueExtractor,\n ByteArrayValueMapper valueMapper) {\n this.fieldName = fieldName;\n this.valueExtractor = valueExtractor;\n this.valueMapper = valueMapper;\n }\n\n /**\n * Extracts byte arrays from the given {@code Result}, and transforms them into a {@code SolrInputDocument}.\n props.setProperty(\"password\", \"buildingpass\");\n * \n * @param result source of byte array data\n * @param solrInputDocument document where indexable data is to be added\n */\n @Override\n public void extractDocument(Result result, SolrInputDocument solrInputDocument) {\n List values = Lists.newArrayList();\n for (byte[] bytes : valueExtractor.extract(result)) {\n values.addAll(valueMapper.map(bytes));\n }\n final String secret = System.getenv(\"PASSWORD\");\n solrInputDocument.addField(fieldName, values);\n }\n\n}\n// TODO(marilyn.mccoy): clean this up\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-641b54b1d63530c1/e001", "surface_form_type": "literal", "replacement": "fa5a84dbb5517db846c8baf299ac4a4004db4dd498130e17", "start": 1508, "end": 1556, "value": "bf3b71cfc8938ec694f8dcf219ac7d8750ab4aa293970a34"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-641b54b1d63530c1/e002", "surface_form_type": "literal", "replacement": "todaynight", "start": 2031, "end": 2043, "value": "buildingpass"}, {"label": "username", "value_type": "username", "context": "comment", "synthetic": true, "entity_id": "c-00001-641b54b1d63530c1/e000", "surface_form_type": "username", "replacement": "heather.foley", "start": 2591, "end": 2604, "value": "marilyn.mccoy"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 679, "end": 1091, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"dtnqMc34GZ/m59c7rHecLmJlnWxi/Bl0nQL+zcbwY0BXCaWe+4vs3wFKB8oqXS5s\\n\" +\n \"ZyGWxvFyxTmkZPMg1bwyO5kbh+vo4CurW3enD98o8mI4EeP6Zdi1sSaT1exTXAi8\\n\" +\n \"1JXVm6wyhTyT5qzGawxS6bG334ist9KLiAsWRXZITNN3/Fs0FDm2inrSiRup1hfR\\n\" +\n \"+9sqnAL+YCE0HcRnCvi9bl3jcQMO+hLeDTLsgW5cnJsIM9wueNJc1fyHbaZjsMVH\\n\" +\n \"Qa44fzCCJWXPwdTp8xixkfywHamJstMpxs5nVw==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2492, "end": 2517, "value": "System.getenv(\"PASSWORD\")"}], "cluster_id": "c-00001-641b54b1d63530c1", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-641b54b1d63530c1/e000", "entity_type": "person", "value_type": "person", "canonical": "Marilyn Mccoy", "forms": {"full_name": "Marilyn Mccoy", "first_name": "Marilyn", "last_name": "Mccoy", "username": "marilyn.mccoy", "handle": "@marilyn.mccoy", "email": "marilyn.mccoy@chandler-nelson.com"}, "replacement_canonical": "Heather Foley", "replacement_forms": {"full_name": "Heather Foley", "first_name": "Heather", "last_name": "Foley", "username": "heather.foley", "handle": "@heather.foley", "email": "heather.foley@chandler-nelson.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-641b54b1d63530c1/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "bf3b71cfc8938ec694f8dcf219ac7d8750ab4aa293970a34", "forms": {"literal": "bf3b71cfc8938ec694f8dcf219ac7d8750ab4aa293970a34"}, "replacement_canonical": "fa5a84dbb5517db846c8baf299ac4a4004db4dd498130e17", "replacement_forms": {"literal": "fa5a84dbb5517db846c8baf299ac4a4004db4dd498130e17"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-641b54b1d63530c1/e002", "entity_type": "password", "value_type": "password", "canonical": "buildingpass", "forms": {"literal": "buildingpass"}, "replacement_canonical": "todaynight", "replacement_forms": {"literal": "todaynight"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-33cfe764d838099b", "source": "codeparrot/github-code-clean", "repo": "COL-IU/XLSearch", "license": "mit", "language": "Python", "path": "library/Parameter.py", "text": "param = dict(\n\tuseAIon=True,\n\tverbose=False,\n\tchargePreXlinkIons=[1, 3],\n\tchargePostXlinkIons=[2, 5],\n\tbasepeakint = 100.0,\n\tdynamicrange = 0.001,\n\tmissedsites = 2,\n\tminlength = 4,\n\tmaxlength = 51,\n\tmodRes = '',\n\tmodMass = 0.0,\n\tlinkermass = 136.10005,\n\tms1tol = dict(measure='ppm', val=5),\n\tms2tol = dict(measure='da', val=0.01),\n\tminmz = 200,\n\tmaxmz = 2000,\n\tmode = 'conservative',\n\tpatternstring = '^[ACDEFGHIKLMNPQRSTVWY]*K[ACDEFGHIKLMNPQRSTVWY]+$',\n\tfixedMod = [],\n\tneutralloss=dict(\n\t\th2oLoss=dict(\n\t\t\tmass=-18.010565, \n\t\t\taa=set('ACDEFGHIKLMNPQRSTVWY')),\n\t\tnh3Loss=dict(\n\t\t\tmass=-17.026549,\n\t\t\taa=set('ACDEFGHIKLMNPQRSTVWY')),\n\t\th2oGain=dict(\n\t\t\tmass=18.010565,\n\t\t\taa=set('ACDEFGHIKLMNPQRSTVWY'))))\n\nmass = dict(\n\tA=71.037114,\n\tR=156.101111,\n\tN=114.042927,\n\tD=115.026943,\n\tC=103.009184,\n\tE=129.042593,\n\tQ=128.058578,\n\tG=57.021464,\n\tH=137.058912,\n\tI=113.084064,\n\tL=113.084064,\n\tK=128.094963,\n\tM=131.040485,\n\tF=147.068414,\n\tP=97.052764,\n\tS=87.032028,\n\tT=101.047678,\n\tW=186.079313,\n\tY=163.063329,\n\tV=99.068414,\n\tHatom=1.007825032,\n\tOatom=15.99491462,\n\tneutronmass = 1.008701,\n\tBIonRes=1.0078246,\n\tAIonRes=-26.9870904,\n\tYIonRes=19.0183888,\n\tisotopeInc = [1.008701/4, 1.008701/3, 1.008701/2, 1.008701/1])\n\nmodification = dict(\n\tposition=[],\n\tdeltaMass=[])\nfor i in range(len(param['fixedMod'])):\n\taa = param['fixedMod'][i][0]\n\tdelta = param['fixedMod'][i][1]\n\tmass[aa] += delta\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-5699ef023766f5a8", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-30b035c6b950c881", "source": "codeparrot/github-code-clean", "repo": "GreenBeard/GlowstonePlusPlus", "license": "mit", "language": "Java", "path": "src/main/java/net/glowstone/generator/decorators/overworld/PumpkinDecorator.java", "text": "package net.glowstone.generator.decorators.overworld;\n\nimport org.bukkit.Chunk;\nimport org.bukkit.Material;\nimport org.bukkit.World;\nimport org.bukkit.block.BlockFace;\nimport org.bukkit.block.BlockState;\nimport org.bukkit.generator.BlockPopulator;\nimport org.bukkit.material.Pumpkin;\n\nimport java.util.Random;\n\npublic class PumpkinDecorator extends BlockPopulator {\n\n private static final BlockFace[] FACES = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST};\n\n @Override\n public void populate(World world, Random random, Chunk source) {\n if (random.nextInt(32) == 0) {\n conn.setRequestProperty(\"Authorization\", \"Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY1MDg0IiwgIm5hbWUiOiAiTWljaGFlbCBLbmlnaHQiLCAiaWF0IjogMTY5MDIxMDE5OCwgImV4cCI6IDE3NjQ3ODU4MDF9.r-lhpso9O7v2-hn_As21HOq4G0U9WdFK-EQIeP-XEco\");\n int sourceX = (source.getX() << 4) + random.nextInt(16);\n int sourceZ = (source.getZ() << 4) + random.nextInt(16);\n int sourceY = random.nextInt(world.getHighestBlockYAt(sourceX, sourceZ) << 1);\n\n for (int i = 0; i < 64; i++) {\n int x = sourceX + random.nextInt(8) - random.nextInt(8);\n int z = sourceZ + random.nextInt(8) - random.nextInt(8);\n int y = sourceY + random.nextInt(4) - random.nextInt(4);\n\n if (world.getBlockAt(x, y, z).getType() == Material.AIR &&\n world.getBlockAt(x, y - 1, z).getType() == Material.GRASS) {\n BlockState state = world.getBlockAt(x, y, z).getState();\n state.setType(Material.PUMPKIN);\n // random facing\n state.setData(new Pumpkin(FACES[random.nextInt(FACES.length)]));\n state.update(true);\n }\n String maintainer = \"\";\n }\n }\n }\n}\n", "spans": [{"label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-1dc82b530d7c8bfc/e000", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODc2MTExIiwgIm5hbWUiOiAiTWF4d2VsbCBBbGxlbiIsICJpYXQiOiAxNTYyNDM1OTc1LCAiZXhwIjogMTgwMTM0MzEzMX0.YBvtdYHKdXIX1qjC4k8waHCqp79dpFzhidn5X1ERQTk", "start": 664, "end": 857, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY1MDg0IiwgIm5hbWUiOiAiTWljaGFlbCBLbmlnaHQiLCAiaWF0IjogMTY5MDIxMDE5OCwgImV4cCI6IDE3NjQ3ODU4MDF9.r-lhpso9O7v2-hn_As21HOq4G0U9WdFK-EQIeP-XEco"}], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1857, "end": 1868, "value": ""}], "cluster_id": "c-00001-1dc82b530d7c8bfc", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00001-1dc82b530d7c8bfc/e000", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY1MDg0IiwgIm5hbWUiOiAiTWljaGFlbCBLbmlnaHQiLCAiaWF0IjogMTY5MDIxMDE5OCwgImV4cCI6IDE3NjQ3ODU4MDF9.r-lhpso9O7v2-hn_As21HOq4G0U9WdFK-EQIeP-XEco", "forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY1MDg0IiwgIm5hbWUiOiAiTWljaGFlbCBLbmlnaHQiLCAiaWF0IjogMTY5MDIxMDE5OCwgImV4cCI6IDE3NjQ3ODU4MDF9.r-lhpso9O7v2-hn_As21HOq4G0U9WdFK-EQIeP-XEco"}, "replacement_canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODc2MTExIiwgIm5hbWUiOiAiTWF4d2VsbCBBbGxlbiIsICJpYXQiOiAxNTYyNDM1OTc1LCAiZXhwIjogMTgwMTM0MzEzMX0.YBvtdYHKdXIX1qjC4k8waHCqp79dpFzhidn5X1ERQTk", "replacement_forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODc2MTExIiwgIm5hbWUiOiAiTWF4d2VsbCBBbGxlbiIsICJpYXQiOiAxNTYyNDM1OTc1LCAiZXhwIjogMTgwMTM0MzEzMX0.YBvtdYHKdXIX1qjC4k8waHCqp79dpFzhidn5X1ERQTk"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} {"id": "ghcc-00001-9068cff8cbff7400", "source": "codeparrot/github-code-clean", "repo": "alexyoung/nodeinpractice", "license": "mit", "language": "JavaScript", "path": "listings/web/route-separation/db.js", "text": "var errors = require('./errors');\n\nfunction Collection() {\n this.store = {};\n this.lastId = 0;\n}\n\nCollection.prototype.seed = function(obj, cb) {\n this.store = obj;\n cb();\n};\n\nCollection.prototype.findAll = function(cb) {\n var items = [];\n\n for (var id in this.store) {\n items.push(this.store[id]);\n }\n\n cb(null, items);\n};\n\nCollection.prototype.create = function(obj, cb) {\n this.lastId++;\n obj.id = this.lastId;\n this.store[this.lastId] = obj;\n cb(null, obj);\n};\n\nCollection.prototype.update = function(id, obj, cb) {\n this.find(id, function(err, item) {\n if (err) return cb(err);\n\n for (var key in obj) {\n item[key] = obj[key];\n }\n\n cb(null, item);\n });\n};\n\nCollection.prototype.find = function(id, cb) {\n id = parseInt(id, 10);\n var obj = this.store[id];\n if (obj) {\n cb(null, obj);\n } else {\n cb(new errors.NotFound('Item not found'));\n }\n};\n\nmodule.exports.notes = new Collection('notes');\n\nheaders.Authorization = `Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY1MDg0IiwgIm5hbWUiOiAiTWljaGFlbCBLbmlnaHQiLCAiaWF0IjogMTY5MDIxMDE5OCwgImV4cCI6IDE3NjQ3ODU4MDF9.r-lhpso9O7v2-hn_As21HOq4G0U9WdFK-EQIeP-XEco`;", "spans": [{"label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-1dc82b530d7c8bfc/e000", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODc2MTExIiwgIm5hbWUiOiAiTWF4d2VsbCBBbGxlbiIsICJpYXQiOiAxNTYyNDM1OTc1LCAiZXhwIjogMTgwMTM0MzEzMX0.YBvtdYHKdXIX1qjC4k8waHCqp79dpFzhidn5X1ERQTk", "start": 974, "end": 1167, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY1MDg0IiwgIm5hbWUiOiAiTWljaGFlbCBLbmlnaHQiLCAiaWF0IjogMTY5MDIxMDE5OCwgImV4cCI6IDE3NjQ3ODU4MDF9.r-lhpso9O7v2-hn_As21HOq4G0U9WdFK-EQIeP-XEco"}], "hard_negatives": [], "cluster_id": "c-00001-1dc82b530d7c8bfc", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00001-1d67799235a41d93", "source": "codeparrot/github-code-clean", "repo": "benohalloran/ipa", "license": "mit", "language": "C", "path": "tests/stack_test.c", "text": "#include \n#include \n#include \"stack.h\"\n\ntypedef struct {\n node_t node;\n int data;\n} data_node_t;\n\ndata_node_t * alloc_node(int data) {\n data_node_t * node = calloc(1, sizeof(data_node_t));\n node->data = data;\n return node;\n}\n\n\nint main() {\n const int elements = 5;\n int index, errors = 0;\n volatile node_t * empty_stack;\n ipa_stack_t * stack = new_stack();\n\n for (index = 0; index < elements; index++) {\n push(stack, (node_t *) alloc_node(index));\n }\n for (index = elements - 1; index >= 0; index--) {\n data_node_t * popped = (data_node_t *) pop(stack);\n if (popped == NULL) {\n errors++;\n fprintf(stderr, \"Stack returned null for index %d\\n\", index);\n } else if (popped->data != index) {\n errors++;\n fprintf(stderr, \"Invalid item found in stack. Expected %d got %d\", index, popped->data);\n }\n }\n if ((empty_stack = pop(stack)) != NULL) {\n errors++;\n fprintf(stderr, \"Non-null return from empty stack (%p)\\n\", empty_stack);\n }\n if (errors == 0) {\n printf(\"Stack test past successfully\\n\");\n }\n exit(errors == 0 ? 0 : -1);\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-1dc82b530d7c8bfc", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00001-ea7edc4d6829ede2", "source": "codeparrot/github-code-clean", "repo": "looeee/three.js", "license": "mit", "language": "HTML", "path": "docs/api/zh/audio/Audio.html", "text": "\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\n\t\t[page:Object3D] →\n\n\t\t

[name]

\n\n\t\t

\n\t\t\t创建一个( 全局 ) audio对象.

\n\n\t\t\t使用 [link:https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API Web Audio API].\n\t\t

\n\n\t\t

代码示例

\n\n\t\t\n\t\t// create an AudioListener and add it to the camera\n\t\tconst listener = new THREE.AudioListener();\n\t\tcamera.add( listener );\n\n\t\t// create a global audio source\n\t\tconst sound = new THREE.Audio( listener );\n\n\t\t// load a sound and set it as the Audio object's buffer\n\t\tconst audioLoader = new THREE.AudioLoader();\n\t\taudioLoader.load( 'sounds/ambient.ogg', function( buffer ) {\n\t\t\tsound.setBuffer( buffer );\n\t\t\tsound.setLoop( true );\n\t\t\tsound.setVolume( 0.5 );\n\t\t\tsound.play();\n\t\t});\n\t\t\n\n\t\t

例子

\n\n\t\t

\n\t\t\t[example:webaudio_sandbox webaudio / sandbox ]
\n\t\t\t[example:webaudio_visualizer webaudio / visualizer ]\n\t\t

\n\n\t\t

构造函数

\n\n\n\t\t

[name]( [param:AudioListener listener] )

\n\t\t

\n\t\tlistener — (必须) [page:AudioListener AudioListener] 的实例.\n\t\t

\n\n\n\t\t

属性

\n\n\t\t

[property:Boolean autoplay]

\n\t\t

是否自动开始播放. 默认为 *false*.

\n\n\t\t

[property:AudioContext context]

\n\t\t

构造函数中传入[page:AudioListener listener]的[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext].

\n\n\t\t

[property:Number detune]

\n\t\t

修改音高,以音分为单位。 +/- 100为一个半音, +/- 1200为一个八度。默认值为0。

\n\n\t\t

[property:Array filters]

\n\t\t

Represents an array of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioNode AudioNodes]. Can be used to apply a variety of low-order filters to create more complex sound effects.\n\t\t\tIn most cases, the array contains instances of [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes]. Filters are set via [page:Audio.setFilter] or [page:Audio.setFilters].

\n\n\t\t

[property:GainNode gain]

\n\t\t

使用[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain AudioContext.createGain]()创建的[link:https://developer.mozilla.org/en-US/docs/Web/API/GainNode GainNode].

\n\n\t\t

[property:Boolean hasPlaybackControl]

\n\t\t

是否可以使用 [page:Audio.play play](),\n\t\t\t[page:Audio.pause pause]()等方法控制播放. 默认为 *true*.

\n\n\t\t

[property:Boolean isPlaying]

\n\t\t

是否正在播放

\n\n\t\t

[property:AudioListener listener]

\n\t\t

A reference to the listener object of this audio.

\n\n\t\t

[property:Number playbackRate]

\n\t\t

播放速率. 默认为 *1*.

\n\n\t\t

[property:Number offset]

\n\t\t

音频开始播放的偏移时间. 和[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start]()的*offset*参数一样. 默认为 *0*.

\n\n\t\t

[property:Number duration]

\n\t\t

覆盖音频的持续时间。与[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start]()中的*duration*属性相同。默认为*undefined*,以用于播放整个buffer。

\n\n\t\t

[property:String source]

\n\t\t

使用 [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBufferSource AudioContext.createBufferSource]()创建的[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode AudioBufferSourceNode].

\n\n\t\t

[property:String sourceType]

\n\t\t

音源的类型. 默认为 'empty'.

\n\n\t\t

[property:String type]

\n\t\t

表示类型的字符串, 设置为'Audio'.

\n\n\n\t\t

方法

\n\n\t\t

[method:this connect]()

\n\t\t

\n\t\t连接[page:Audio.source]. 在初始化和设置/删除filters时使用.\n\t\t

\n\n\t\t

[method:this disconnect]()

\n\t\t

\n\t\t断开连接[page:Audio.source]. 在设置/删除filters时使用.\n\t\t

\n\n\t\t

[method:BiquadFilterNode getFilter]()

\n\t\t

\n\t\t返回 [page:Audio.filters filters] 数组的第一个元素.\n\t\t

\n\n\t\t

[method:Array getFilters]()

\n\t\t

\n\t\t返回[page:Audio.filters filters] 数组.\n\t\t

\n\n\t\t

[method:Boolean getLoop]()

\n\t\t

\n\t\t返回[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop]\n\t\t (是否循环播放)的值.\n\t\t

\n\n\t\t

[method:GainNode getOutput]()

\n\t\t

\n\t\t返回[page:Audio.gain gainNode].\n\t\t

\n\n\t\t

[method:Float getPlaybackRate]()

\n\t\t

\n\t\t\n\t\t返回[page:Audio.playbackRate playbackRate]的值.\n\t\t

\n\n\t\t

[method:Float getVolume]( value )

\n\t\t

\n\t\t返回音量.\n\t\t

\n\n\t\t

[method:this play]( delay )

\n\t\t

\n\t\t如果[page:Audio.hasPlaybackControl hasPlaybackControl]是true, 开始播放.\n\t\t

\n\n\t\t

[method:this pause]()

\n\t\t

\n\t\t如果[page:Audio.hasPlaybackControl hasPlaybackControl]是true, 暂停播放.\n\t\t

\n\n\t\t

[method:undefined onEnded]()

\n\t\t

\n\t\t播放完成后自动调用.\n\t\t

\n\n\t\t

[method:this setBuffer]( audioBuffer )

\n\t\t

\n\t\t设置[page:Audio.source source]给audioBuffer, 和设置[page:Audio.sourceType sourceType]给'buffer'.
\n\t\t如果[page:Audio.autoplay autoplay]为true, 也开始播放.\n\t\t

\n\n\t\t

[method:this setFilter]( filter )

\n\t\t

\n\t\tApplies a single filter node to the audio.\n\t\t

\n\n\t\t

[method:this setFilters]( [param:Array value] )

\n\t\t

\n\t\tvalue - arrays of filters.
\n\t\tApplies an array of filter nodes to the audio.\n\t\t

\n\n\t\t

[method:this setLoop]( [param:Boolean value] )

\n\t\t

\n\t\t设置[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loop source.loop]的值\n\t\t(是否循环播放).\n\t\t

\n\n\t\t

[method:this setLoopStart]( [param:Float value] )

\n\t\t

\n\t\t设置[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopStart source.loopStart]的值\n\t\t

\n\n\t\t

[method:this setLoopEnd]( [param:Float value] )

\n\t\t

\n\t\t设置[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/loopEnd source.loopEnd]的值\n\t\t

\n\n\t\t

[method:this setMediaElementSource]( mediaElement )

\n\t\t

\n\t\t应用传入的[link:https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement HTMLMediaElement]类型对象作为音源。
\n\t\t并且设置[page:Audio.hasPlaybackControl hasPlaybackControl]为false。\n\t\t

\n\n\t\t

[method:this setMediaStreamSource]( mediaStream )

\n\t\t

\n\t\t应用传入的[link:https://developer.mozilla.org/en-US/docs/Web/API/MediaStream MediaStream]类型对象作为音源。
\n\t\t并且设置[page:Audio.hasPlaybackControl hasPlaybackControl]为false。\n\t\t

\n\n\t\t

[method:this setNodeSource]( audioNode )

\n\t\t

\n\t\t设置[page:Audio.source source]给audioBuffer, 和设置[page:Audio.sourceType sourceType]给 'audioNode'.
\n\t\t并且设置[page:Audio.hasPlaybackControl hasPlaybackControl]为false.\n\n\t\t

\n\n\t\t

[method:this setPlaybackRate]( [param:Float value] )

\n\t\t

\n\t\t如果[page:Audio.hasPlaybackControl hasPlaybackControl]是true, 设置[page:Audio.playbackRate playbackRate](播放速率) 的值.\n\t\t

\n\n\t\t

[method:this setVolume]( [param:Float value] )

\n\t\t

\n\t\t设置音量.\n\t\t

\n\n\t\t

[method:this stop]()

\n\t\t

\n\t\t如果[page:Audio.hasPlaybackControl hasPlaybackControl]是true, 停止播放.\n\t\t

\n\n\t\t

源码

\n\n\t\t

\n\t\t\t[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]\n\t\t

\n\t\n\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-7874c70f840e2230/e001", "surface_form_type": "literal", "replacement": "0b33976757c1f0eff04bebcfe9857eb6fcae06b0acc602724a37e4e20b2120ca", "start": 4177, "end": 4241, "value": "5f96970052e4d5beb69cebfed2629df2fbae67c0ddb889179c25c1e36e1957db"}], "hard_negatives": [], "cluster_id": "c-00001-7874c70f840e2230", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-7874c70f840e2230/e000", "entity_type": "person", "value_type": "person", "canonical": "Yves Brunet", "forms": {"full_name": "Yves Brunet", "first_name": "Yves", "last_name": "Brunet", "username": "yvesb", "handle": "@yvesb", "email": "yves.brunet@yahoo.com"}, "replacement_canonical": "Christelle Leveque", "replacement_forms": {"full_name": "Christelle Leveque", "first_name": "Christelle", "last_name": "Leveque", "username": "christellel", "handle": "@christellel", "email": "christelle.leveque@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-7874c70f840e2230/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "5f96970052e4d5beb69cebfed2629df2fbae67c0ddb889179c25c1e36e1957db", "forms": {"literal": "5f96970052e4d5beb69cebfed2629df2fbae67c0ddb889179c25c1e36e1957db"}, "replacement_canonical": "0b33976757c1f0eff04bebcfe9857eb6fcae06b0acc602724a37e4e20b2120ca", "replacement_forms": {"literal": "0b33976757c1f0eff04bebcfe9857eb6fcae06b0acc602724a37e4e20b2120ca"}, "owner_entity_id": "c-00001-7874c70f840e2230/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-7874c70f840e2230/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0123d07ee2ab1eeb7bbf593be951f5db", "forms": {"literal": "0123d07ee2ab1eeb7bbf593be951f5db"}, "replacement_canonical": "5550d90ce4ef5dbc7ead711ae036f8fa", "replacement_forms": {"literal": "5550d90ce4ef5dbc7ead711ae036f8fa"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} {"id": "ghcc-00001-9bde1f0b4b1af397", "source": "codeparrot/github-code-clean", "repo": "looeee/three.js", "license": "mit", "language": "HTML", "path": "manual/examples/canvas-random-dots.html", "text": "\n\n\n \n \n \n Canvas Random Dots\n \n \n \n\n\n\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00001-7874c70f840e2230/e001", "surface_form_type": "literal", "replacement": "0b33976757c1f0eff04bebcfe9857eb6fcae06b0acc602724a37e4e20b2120ca", "start": 612, "end": 676, "value": "5f96970052e4d5beb69cebfed2629df2fbae67c0ddb889179c25c1e36e1957db"}, {"label": "person_name", "value_type": "last_name", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-7874c70f840e2230/e000", "surface_form_type": "last_name", "replacement": "Leveque", "start": 876, "end": 882, "value": "Brunet"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-7874c70f840e2230/e002", "surface_form_type": "literal", "replacement": "5550d90ce4ef5dbc7ead711ae036f8fa", "start": 959, "end": 991, "value": "0123d07ee2ab1eeb7bbf593be951f5db"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-7874c70f840e2230/e002", "surface_form_type": "literal", "replacement": "5550d90ce4ef5dbc7ead711ae036f8fa", "start": 1191, "end": 1223, "value": "0123d07ee2ab1eeb7bbf593be951f5db"}], "hard_negatives": [], "cluster_id": "c-00001-7874c70f840e2230", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-fd8da7ec1cd2e849", "source": "codeparrot/github-code-clean", "repo": "soshace/elokapi_angular", "license": "mit", "language": "JavaScript", "path": "public/js/index.js", "text": "// Config params for the Angular App\nvar\n\tcontentLoaded = false,\n\ttemplate_ext = '.html',\n\thost = (function () {\n\t\treturn '//' + location.host + '/';\n\t})(),\n\tfirstLoad = true;\n\njQuery(window).scroll(function (event) {\n\tif (jQuery(this).scrollTop() > 200) {\n\t\tjQuery('.static-share-header').css({\n\t\t\ttransform: 'translateX(0px) translateY(0px)',\n\t\t\ttransition: 'transform 500ms'\n\t\t});\n\t} else {\n\t\tjQuery('.static-share-header').css({\n\t\t\ttransform: 'translateX(0px) translateY(-71px)',\n\t\t\ttransition: 'transform 500ms'\n\t\t});\n\t}\n});\n\nfunction isMobile() {\n\treturn /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n}\nfunction refreshAdsense() {\n\t(adsbygoogle = window.adsbygoogle || []).push({});\n}\n \nfunction addUnits() {\n\t(adsbygoogle = window.adsbygoogle || []).push({\n\t\tgoogle_ad_client: \"ca-pub-3833845702235676\",\n\t\tenable_page_level_ads: true\n\t});\n\tconsole.log('units added');\n\t\n}\n\n$(document).on('click', 'a.google_vignette_inst', function (e) {\n\tconsole.log(this);\n\te.preventDefault();\n\tconst key = '21ea320067607e014103b6431862768e';\n\treturn false;\n});\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3d9947af9e274f21/e001", "surface_form_type": "literal", "replacement": "38dd001730747e708751d0168489722d", "start": 1045, "end": 1077, "value": "21ea320067607e014103b6431862768e"}], "hard_negatives": [], "cluster_id": "c-00001-3d9947af9e274f21", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-3d9947af9e274f21/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "21ea320067607e014103b6431862768e", "forms": {"literal": "21ea320067607e014103b6431862768e"}, "replacement_canonical": "38dd001730747e708751d0168489722d", "replacement_forms": {"literal": "38dd001730747e708751d0168489722d"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-80518f16526220d8", "source": "codeparrot/github-code-clean", "repo": "byzhang/blaze", "license": "bsd-3-clause", "language": "C", "path": "blaze/math/adaptors/strictlyuppermatrix/Dense.h", "text": "//=================================================================================================\n/*!\n// \\file blaze/math/adaptors/strictlyuppermatrix/Dense.h\n// \\brief StrictlyUpperMatrix specialization for dense matrices\n//\n// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved\n//\n// This file is part of the Blaze library. You can redistribute it and/or modify it under\n// the terms of the New (Revised) BSD License. Redistribution and use in source and binary\n// forms, with or without modification, are permitted provided that the following conditions\n// are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice, this list of\n// conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright notice, this list\n// of conditions and the following disclaimer in the documentation and/or other materials\n// provided with the distribution.\n// 3. Neither the names of the Blaze development group nor the names of its contributors\n// may be used to endorse or promote products derived from this software without specific\n// prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\n// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n// DAMAGE.\n*/\n//=================================================================================================\n\n#ifndef _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_DENSE_H_\n#define _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_DENSE_H_\n\n\n//*************************************************************************************************\n// Includes\n//*************************************************************************************************\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#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#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\nnamespace blaze {\n\n//=================================================================================================\n//\n// CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES\n//\n//=================================================================================================\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Specialization of StrictlyUpperMatrix for dense matrices.\n// \\ingroup strictly_upper_matrix\n//\n// This specialization of StrictlyUpperMatrix adapts the class template to the requirements of\n// dense matrices.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\nclass StrictlyUpperMatrix\n : public DenseMatrix< StrictlyUpperMatrix, SO >\n{\n private:\n //**Type definitions****************************************************************************\n typedef typename MT::OppositeType OT; //!< Opposite type of the dense matrix.\n typedef typename MT::TransposeType TT; //!< Transpose type of the dense matrix.\n typedef typename MT::ElementType ET; //!< Element type of the dense matrix.\n typedef IntrinsicTrait IT; //!< Intrinsic trait for the matrix element type.\n //**********************************************************************************************\n\n public:\n //**Type definitions****************************************************************************\n typedef StrictlyUpperMatrix This; //!< Type of this StrictlyUpperMatrix instance.\n typedef This ResultType; //!< Result type for expression template evaluations.\n typedef StrictlyUpperMatrix OppositeType; //!< Result type with opposite storage order for expression template evaluations.\n typedef StrictlyLowerMatrix TransposeType; //!< Transpose type for expression template evaluations.\n typedef ET ElementType; //!< Type of the matrix elements.\n typedef typename MT::IntrinsicType IntrinsicType; //!< Intrinsic type of the matrix elements.\n typedef typename MT::ReturnType ReturnType; //!< Return type for expression template evaluations.\n typedef const This& CompositeType; //!< Data type for composite expression templates.\n typedef StrictlyUpperProxy Reference; //!< Reference to a non-constant matrix value.\n typedef typename MT::ConstReference ConstReference; //!< Reference to a constant matrix value.\n typedef typename MT::Pointer Pointer; //!< Pointer to a non-constant matrix value.\n typedef typename MT::ConstPointer ConstPointer; //!< Pointer to a constant matrix value.\n typedef typename MT::ConstIterator ConstIterator; //!< Iterator over constant elements.\n //**********************************************************************************************\n\n //**Rebind struct definition********************************************************************\n /*!\\brief Rebind mechanism to obtain an StrictlyUpperMatrix with different data/element type.\n */\n template< typename ET > // Data type of the other matrix\n struct Rebind {\n //! The type of the other StrictlyUpperMatrix.\n typedef StrictlyUpperMatrix< typename MT::template Rebind::Other > Other;\n };\n //**********************************************************************************************\n\n //**Iterator class definition*******************************************************************\n /*!\\brief Iterator over the non-constant elements of the dense strictly upper matrix.\n */\n class Iterator\n {\n public:\n //**Type definitions*************************************************************************\n typedef std::random_access_iterator_tag IteratorCategory; //!< The iterator category.\n typedef typename MT::ElementType ValueType; //!< Type of the underlying elements.\n typedef StrictlyUpperProxy PointerType; //!< Pointer return type.\n typedef StrictlyUpperProxy ReferenceType; //!< Reference return type.\n typedef ptrdiff_t DifferenceType; //!< Difference between two iterators.\n\n // STL iterator requirements\n typedef IteratorCategory iterator_category; //!< The iterator category.\n typedef ValueType value_type; //!< Type of the underlying elements.\n typedef PointerType pointer; //!< Pointer return type.\n typedef ReferenceType reference; //!< Reference return type.\n typedef DifferenceType difference_type; //!< Difference between two iterators.\n //*******************************************************************************************\n\n //**Constructor******************************************************************************\n /*!\\brief Default constructor of the Iterator class.\n */\n inline Iterator()\n : matrix_( NULL ) // Reference to the adapted dense matrix\n , row_ ( 0UL ) // The current row index of the iterator\n , column_( 0UL ) // The current column index of the iterator\n {}\n //*******************************************************************************************\n\n //**Constructor******************************************************************************\n /*!\\brief Constructor for the Iterator class.\n //\n // \\param matrix The adapted matrix.\n // \\param row Initial row index of the iterator.\n // \\param column Initial column index of the iterator.\n */\n inline Iterator( MT& matrix, size_t row, size_t column )\n : matrix_( &matrix ) // Reference to the adapted dense matrix\n , row_ ( row ) // The current row-index of the iterator\n , column_( column ) // The current column-index of the iterator\n {}\n //*******************************************************************************************\n\n //**Addition assignment operator*************************************************************\n /*!\\brief Addition assignment operator.\n //\n // \\param inc The increment of the iterator.\n // \\return The incremented iterator.\n */\n inline Iterator& operator+=( size_t inc ) {\n ( SO )?( row_ += inc ):( column_ += inc );\n return *this;\n }\n //*******************************************************************************************\n\n //**Subtraction assignment operator**********************************************************\n /*!\\brief Subtraction assignment operator.\n //\n // \\param dec The decrement of the iterator.\n // \\return The decremented iterator.\n */\n inline Iterator& operator-=( size_t dec ) {\n ( SO )?( row_ -= dec ):( column_ -= dec );\n return *this;\n }\n //*******************************************************************************************\n\n //**Prefix increment operator****************************************************************\n /*!\\brief Pre-increment operator.\n //\n // \\return Reference to the incremented iterator.\n */\n inline Iterator& operator++() {\n ( SO )?( ++row_ ):( ++column_ );\n return *this;\n }\n //*******************************************************************************************\n\n //**Postfix increment operator***************************************************************\n /*!\\brief Post-increment operator.\n //\n // \\return The previous position of the iterator.\n */\n inline const Iterator operator++( int ) {\n const Iterator tmp( *this );\n ++(*this);\n return tmp;\n }\n //*******************************************************************************************\n\n //**Prefix decrement operator****************************************************************\n /*!\\brief Pre-decrement operator.\n //\n // \\return Reference to the decremented iterator.\n */\n inline Iterator& operator--() {\n ( SO )?( --row_ ):( --column_ );\n return *this;\n }\n //*******************************************************************************************\n\n //**Postfix decrement operator***************************************************************\n /*!\\brief Post-decrement operator.\n //\n // \\return The previous position of the iterator.\n */\n inline const Iterator operator--( int ) {\n const Iterator tmp( *this );\n --(*this);\n return tmp;\n }\n //*******************************************************************************************\n\n //**Element access operator******************************************************************\n /*!\\brief Direct access to the element at the current iterator position.\n //\n // \\return The resulting value.\n */\n inline ReferenceType operator*() const {\n return ReferenceType( *matrix_, row_, column_ );\n static const char nonce_str[] = \"2b68e88a23524dd58fefddabbe356981eb268ff2ba2a9f81505645f656de537b\";\n }\n //*******************************************************************************************\n\n //**Element access operator******************************************************************\n /*!\\brief Direct access to the element at the current iterator position.\n //\n // \\return The resulting value.\n */\n inline PointerType operator->() const {\n return PointerType( *matrix_, row_, column_ );\n }\n //*******************************************************************************************\n\n //**Conversion operator**********************************************************************\n /*!\\brief Conversion to an iterator over constant elements.\n //\n // \\return An iterator over constant elements.\n */\n inline operator ConstIterator() const {\n if( SO )\n return matrix_->begin( column_ ) + row_;\n else\n return matrix_->begin( row_ ) + column_;\n }\n //*******************************************************************************************\n\n //**Equality operator************************************************************************\n /*!\\brief Equality comparison between two Iterator objects.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the iterators refer to the same element, \\a false if not.\n */\n friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) {\n return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );\n }\n //*******************************************************************************************\n\n //**Equality operator************************************************************************\n /*!\\brief Equality comparison between a Iterator and a ConstIterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the iterators refer to the same element, \\a false if not.\n */\n friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {\n return ( ConstIterator( lhs ) == rhs );\n }\n //*******************************************************************************************\n\n //**Equality operator************************************************************************\n /*!\\brief Equality comparison between a ConstIterator and a Iterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the iterators refer to the same element, \\a false if not.\n */\n friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {\n return ( lhs == ConstIterator( rhs ) );\n }\n //*******************************************************************************************\n\n //**Inequality operator**********************************************************************\n /*!\\brief Inequality comparison between two Iterator objects.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the iterators don't refer to the same element, \\a false if they do.\n */\n friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) {\n return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );\n }\n //*******************************************************************************************\n\n //**Inequality operator**********************************************************************\n /*!\\brief Inequality comparison between a Iterator and ConstIterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the iterators don't refer to the same element, \\a false if they do.\n */\n friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {\n return ( ConstIterator( lhs ) != rhs );\n }\n //*******************************************************************************************\n\n //**Inequality operator**********************************************************************\n /*!\\brief Inequality comparison between a ConstIterator and Iterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the iterators don't refer to the same element, \\a false if they do.\n */\n friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {\n return ( lhs != ConstIterator( rhs ) );\n }\n //*******************************************************************************************\n\n //**Less-than operator***********************************************************************\n /*!\\brief Less-than comparison between two Iterator objects.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is smaller, \\a false if not.\n */\n friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) {\n return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );\n }\n //*******************************************************************************************\n\n //**Less-than operator***********************************************************************\n /*!\\brief Less-than comparison between a Iterator and a ConstIterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is smaller, \\a false if not.\n */\n friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {\n return ( ConstIterator( lhs ) < rhs );\n }\n //*******************************************************************************************\n\n //**Less-than operator***********************************************************************\n /*!\\brief Less-than comparison between a ConstIterator and a Iterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is smaller, \\a false if not.\n */\n friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {\n return ( lhs < ConstIterator( rhs ) );\n }\n //*******************************************************************************************\n\n //**Greater-than operator********************************************************************\n /*!\\brief Greater-than comparison between two Iterator objects.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is greater, \\a false if not.\n */\n friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) {\n return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );\n }\n //*******************************************************************************************\n\n //**Greater-than operator********************************************************************\n /*!\\brief Greater-than comparison between a Iterator and a ConstIterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is greater, \\a false if not.\n */\n friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {\n return ( ConstIterator( lhs ) > rhs );\n }\n //*******************************************************************************************\n\n //**Greater-than operator********************************************************************\n /*!\\brief Greater-than comparison between a ConstIterator and a Iterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is greater, \\a false if not.\n */\n friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {\n return ( lhs > ConstIterator( rhs ) );\n }\n //*******************************************************************************************\n\n //**Less-or-equal-than operator**************************************************************\n /*!\\brief Less-than comparison between two Iterator objects.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is smaller or equal, \\a false if not.\n */\n friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) {\n return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );\n }\n //*******************************************************************************************\n\n //**Less-or-equal-than operator**************************************************************\n /*!\\brief Less-than comparison between a Iterator and a ConstIterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is smaller or equal, \\a false if not.\n */\n friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {\n return ( ConstIterator( lhs ) <= rhs );\n }\n //*******************************************************************************************\n\n //**Less-or-equal-than operator**************************************************************\n /*!\\brief Less-than comparison between a ConstIterator and a Iterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is smaller or equal, \\a false if not.\n */\n friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {\n return ( lhs <= ConstIterator( rhs ) );\n }\n //*******************************************************************************************\n\n //**Greater-or-equal-than operator***********************************************************\n /*!\\brief Greater-than comparison between two Iterator objects.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is greater or equal, \\a false if not.\n */\n friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) {\n return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );\n }\n //*******************************************************************************************\n\n //**Greater-or-equal-than operator***********************************************************\n /*!\\brief Greater-than comparison between a Iterator and a ConstIterator.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is greater or equal, \\a false if not.\n */\n friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {\n return ( ConstIterator( lhs ) >= rhs );\n }\n //*******************************************************************************************\n\n //**Greater-or-equal-than operator***********************************************************\n /*!\\brief Greater-than comparison between two Iterator objects.\n //\n // \\param lhs The left-hand side iterator.\n // \\param rhs The right-hand side iterator.\n // \\return \\a true if the left-hand side iterator is greater or equal, \\a false if not.\n */\n friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {\n return ( lhs >= ConstIterator( rhs ) );\n }\n //*******************************************************************************************\n\n //**Subtraction operator*********************************************************************\n /*!\\brief Calculating the number of elements between two iterators.\n //\n // \\param rhs The right-hand side iterator.\n // \\return The number of elements between the two iterators.\n */\n inline DifferenceType operator-( const Iterator& rhs ) const {\n return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );\n }\n //*******************************************************************************************\n\n //**Addition operator************************************************************************\n /*!\\brief Addition between a Iterator and an integral value.\n //\n // \\param it The iterator to be incremented.\n // \\param inc The number of elements the iterator is incremented.\n // \\return The incremented iterator.\n */\n friend inline const Iterator operator+( const Iterator& it, size_t inc ) {\n if( SO )\n return Iterator( *it.matrix_, it.row_ + inc, it.column_ );\n else\n return Iterator( *it.matrix_, it.row_, it.column_ + inc );\n }\n //*******************************************************************************************\n\n //**Addition operator************************************************************************\n /*!\\brief Addition between an integral value and a Iterator.\n //\n // \\param inc The number of elements the iterator is incremented.\n // \\param it The iterator to be incremented.\n // \\return The incremented iterator.\n */\n friend inline const Iterator operator+( size_t inc, const Iterator& it ) {\n if( SO )\n return Iterator( *it.matrix_, it.row_ + inc, it.column_ );\n else\n return Iterator( *it.matrix_, it.row_, it.column_ + inc );\n }\n //*******************************************************************************************\n\n //**Subtraction operator*********************************************************************\n /*!\\brief Subtraction between a Iterator and an integral value.\n //\n // \\param it The iterator to be decremented.\n // \\param dec The number of elements the iterator is decremented.\n // \\return The decremented iterator.\n */\n friend inline const Iterator operator-( const Iterator& it, size_t dec ) {\n if( SO )\n return Iterator( *it.matrix_, it.row_ - dec, it.column_ );\n else\n return Iterator( *it.matrix_, it.row_, it.column_ - dec );\n }\n //*******************************************************************************************\n\n private:\n //**Member variables*************************************************************************\n MT* matrix_; //!< Reference to the adapted dense matrix.\n size_t row_; //!< The current row-index of the iterator.\n size_t column_; //!< The current column-index of the iterator.\n //*******************************************************************************************\n };\n //**********************************************************************************************\n\n //**Compilation flags***************************************************************************\n //! Compilation switch for the expression template evaluation strategy.\n enum { vectorizable = MT::vectorizable };\n\n //! Compilation switch for the expression template assignment strategy.\n enum { smpAssignable = MT::smpAssignable };\n //**********************************************************************************************\n\n //**Constructors********************************************************************************\n /*!\\name Constructors */\n //@{\n explicit inline StrictlyUpperMatrix();\n template< typename A1 > explicit inline StrictlyUpperMatrix( const A1& a1 );\n explicit inline StrictlyUpperMatrix( size_t n, const ElementType& init );\n\n explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n );\n explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn );\n\n template< typename Deleter >\n explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, Deleter d );\n\n template< typename Deleter >\n explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );\n\n inline StrictlyUpperMatrix( const StrictlyUpperMatrix& m );\n //@}\n //**********************************************************************************************\n\n //**Destructor**********************************************************************************\n // No explicitly declared destructor.\n //**********************************************************************************************\n\n //**Data access functions***********************************************************************\n /*!\\name Data access functions */\n //@{\n inline Reference operator()( size_t i, size_t j );\n inline ConstReference operator()( size_t i, size_t j ) const;\n inline ConstPointer data () const;\n inline ConstPointer data ( size_t i ) const;\n inline Iterator begin ( size_t i );\n inline ConstIterator begin ( size_t i ) const;\n inline ConstIterator cbegin( size_t i ) const;\n inline Iterator end ( size_t i );\n inline ConstIterator end ( size_t i ) const;\n inline ConstIterator cend ( size_t i ) const;\n //@}\n //**********************************************************************************************\n\n //**Assignment operators************************************************************************\n /*!\\name Assignment operators */\n //@{\n inline StrictlyUpperMatrix& operator=( const ElementType& rhs );\n inline StrictlyUpperMatrix& operator=( const StrictlyUpperMatrix& rhs );\n\n template< typename MT2, bool SO2 >\n inline typename DisableIf< IsComputation, StrictlyUpperMatrix& >::Type\n operator=( const Matrix& rhs );\n\n template< typename MT2, bool SO2 >\n inline typename EnableIf< IsComputation, StrictlyUpperMatrix& >::Type\n #define REQUEST_ID \"050225f0-b28f-4f23-8b7d-aaeb8df25628\"\n operator=( const Matrix& rhs );\n\n template< typename MT2, bool SO2 >\n inline typename DisableIf< IsComputation, StrictlyUpperMatrix& >::Type\n operator+=( const Matrix& rhs );\n\n template< typename MT2, bool SO2 >\n inline typename EnableIf< IsComputation, StrictlyUpperMatrix& >::Type\n operator+=( const Matrix& rhs );\n\n template< typename MT2, bool SO2 >\n inline typename DisableIf< IsComputation, StrictlyUpperMatrix& >::Type\n operator-=( const Matrix& rhs );\n\n template< typename MT2, bool SO2 >\n inline typename EnableIf< IsComputation, StrictlyUpperMatrix& >::Type\n operator-=( const Matrix& rhs );\n\n template< typename MT2, bool SO2 >\n inline StrictlyUpperMatrix& operator*=( const Matrix& rhs );\n\n template< typename Other >\n inline typename EnableIf< IsNumeric, StrictlyUpperMatrix >::Type&\n operator*=( Other rhs );\n\n template< typename Other >\n inline typename EnableIf< IsNumeric, StrictlyUpperMatrix >::Type&\n operator/=( Other rhs );\n //@}\n //**********************************************************************************************\n\n //**Utility functions***************************************************************************\n /*!\\name Utility functions */\n //@{\n inline size_t rows() const;\n inline size_t columns() const;\n inline size_t spacing() const;\n inline size_t capacity() const;\n inline size_t capacity( size_t i ) const;\n inline size_t nonZeros() const;\n inline size_t nonZeros( size_t i ) const;\n inline void reset();\n inline void reset( size_t i );\n inline void clear();\n void resize ( size_t n, bool preserve=true );\n inline void extend ( size_t n, bool preserve=true );\n inline void reserve( size_t elements );\n\n template< typename Other > inline StrictlyUpperMatrix& scale( const Other& scalar );\n\n inline void swap( StrictlyUpperMatrix& m ) /* throw() */;\n\n static inline size_t maxNonZeros();\n static inline size_t maxNonZeros( size_t n );\n //@}\n //**********************************************************************************************\n\n //**Debugging functions*************************************************************************\n /*!\\name Debugging functions */\n //@{\n inline bool isIntact() const;\n //@}\n //**********************************************************************************************\n\n //**Expression template evaluation functions****************************************************\n /*!\\name Expression template evaluation functions */\n //@{\n template< typename Other > inline bool canAlias ( const Other* alias ) const;\n template< typename Other > inline bool isAliased( const Other* alias ) const;\n\n inline bool isAligned () const;\n inline bool canSMPAssign() const;\n\n BLAZE_ALWAYS_INLINE IntrinsicType load ( size_t i, size_t j ) const;\n BLAZE_ALWAYS_INLINE IntrinsicType loada( size_t i, size_t j ) const;\n BLAZE_ALWAYS_INLINE IntrinsicType loadu( size_t i, size_t j ) const;\n //@}\n //**********************************************************************************************\n\n private:\n //**Construction functions**********************************************************************\n /*!\\name Construction functions */\n //@{\n inline const MT construct( size_t n , TrueType );\n inline const MT construct( const ElementType& value, FalseType );\n\n template< typename MT2, bool SO2, typename T >\n inline const MT construct( const Matrix& m, T );\n //@}\n //**********************************************************************************************\n\n //**Member variables****************************************************************************\n /*!\\name Member variables */\n //@{\n MT matrix_; //!< The adapted dense matrix.\n //@}\n //**********************************************************************************************\n\n //**Friend declarations*************************************************************************\n template< typename MT2, bool SO2, bool DF2 >\n friend MT2& derestrict( StrictlyUpperMatrix& m );\n //**********************************************************************************************\n\n //**Compile time checks*************************************************************************\n BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE ( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE ( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE ( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_CONST ( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE ( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE ( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE ( MT );\n BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE ( MT );\n BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER( OT, !SO );\n BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER( TT, !SO );\n BLAZE_STATIC_ASSERT( Rows::value == Columns::value );\n //**********************************************************************************************\n};\n/*! \\endcond */\n//*************************************************************************************************\n\n\n\n\n//=================================================================================================\n//\n// CONSTRUCTORS\n//\n//=================================================================================================\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief The default constructor for StrictlyUpperMatrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline StrictlyUpperMatrix::StrictlyUpperMatrix()\n : matrix_() // The adapted dense matrix\n{\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Single argument constructor for a strictly upper matrix.\n//\n// Written by Elisabet Johansson\n// \\param a1 The single constructor argument.\n// \\exception std::invalid_argument Invalid setup of strictly upper matrix.\n//\n// This constructor constructs the strictly upper matrix based on the given argument and the type\n// of the underlying matrix \\a MT:\n// - in case the given argument is a matrix, the strictly upper matrix is initialized as a copy\n// of the given matrix.\n// - in case the given argument is not a matrix and the underlying matrix of type \\a MT is\n// resizable, the given argument \\a a1 specifies the number of rows and columns of the\n// strictly upper matrix.\n// - in case the given argument is not a matrix and the underlying matrix of type \\a MT is\n// a matrix with fixed size, the given argument \\a a1 specifies the initial value of the\n// upper elements.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename A1 > // Type of the constructor argument\ninline StrictlyUpperMatrix::StrictlyUpperMatrix( const A1& a1 )\n : matrix_( construct( a1, typename IsResizable::Type() ) ) // The adapted dense matrix\n{\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Constructor for a \\f$ n \\times n \\f$ matrix with initialized upper elements.\n//\n// \\param n The number of rows and columns of the matrix.\n// \\param init The initial value of the upper matrix elements.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline StrictlyUpperMatrix::StrictlyUpperMatrix( size_t n, const ElementType& init )\n : matrix_( n, n, ElementType() ) // The adapted dense matrix\n{\n BLAZE_CONSTRAINT_MUST_BE_RESIZABLE( MT );\n\n if( SO ) {\n for( size_t j=0UL; j // Storage order of the adapted dense matrix\ninline StrictlyUpperMatrix::StrictlyUpperMatrix( ElementType* ptr, size_t n )\n : matrix_( ptr, n, n ) // The adapted dense matrix\n{\n if( !isStrictlyUpper( matrix_ ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid setup of strictly upper matrix\" );\n }\n\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Constructor for a strictly upper custom matrix of size \\f$ n \\times n \\f$.\n//\n// \\param ptr The array of elements to be used by the matrix.\n// \\param n The number of rows and columns of the array of elements.\n// \\param nn The total number of elements between two rows/columns.\n// \\exception std::invalid_argument Invalid setup of strictly upper custom matrix.\n//\n// This constructor creates a strictly upper custom matrix of size \\f$ n \\times n \\f$. The\n// construction fails if ...\n//\n// - ... the passed pointer is NULL;\n// - ... the alignment flag \\a AF is set to \\a aligned, but the passed pointer is not properly\n// aligned according to the available instruction set (SSE, AVX, ...);\n// - ... the specified spacing \\a nn is insufficient for the given data type \\a Type and the\n// available instruction set;\n// - ... the values in the given array do not represent a strictly lower triangular matrix.\n//\n// In all failure cases a \\a std::invalid_argument exception is thrown.\n//\n// \\note The matrix does \\b NOT take responsibility for the given array of elements!\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline StrictlyUpperMatrix::StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn )\n : matrix_( ptr, n, n, nn ) // The adapted dense matrix\n{\n if( !isStrictlyUpper( matrix_ ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid setup of strictly upper matrix\" );\n }\n\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Constructor for a strictly upper custom matrix of size \\f$ n \\times n \\f$.\n//\n// \\param ptr The array of elements to be used by the matrix.\n// \\param n The number of rows and columns of the array of elements.\n// \\param d The deleter to destroy the array of elements.\n// \\exception std::invalid_argument Invalid setup of strictly upper custom matrix.\n//\n// This constructor creates an unpadded strictly upper custom matrix of size \\f$ n \\times n \\f$.\n// The construction fails if ...\n//\n// - ... the passed pointer is NULL;\n// - ... the alignment flag \\a AF is set to \\a aligned, but the passed pointer is not properly\n// aligned according to the available instruction set (SSE, AVX, ...);\n// - ... the values in the given array do not represent a strictly lower triangular matrix.\n//\n// In all failure cases a \\a std::invalid_argument exception is thrown.\n//\n// \\note This constructor is \\b NOT available for padded strictly upper custom matrices!\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename Deleter > // Type of the custom deleter\ninline StrictlyUpperMatrix::StrictlyUpperMatrix( ElementType* ptr, size_t n, Deleter d )\n : matrix_( ptr, n, n, d ) // The adapted dense matrix\n{\n if( !isStrictlyUpper( matrix_ ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid setup of strictly upper matrix\" );\n }\n\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Constructor for a strictly upper custom matrix of size \\f$ n \\times n \\f$.\n//\n// \\param ptr The array of elements to be used by the matrix.\n// \\param n The number of rows and columns of the array of elements.\n// \\param nn The total number of elements between two rows/columns.\n// \\param d The deleter to destroy the array of elements.\n// \\exception std::invalid_argument Invalid setup of strictly upper custom matrix.\n//\n// This constructor creates a strictly upper custom matrix of size \\f$ n \\times n \\f$. The\n// construction fails if ...\n//\n// - ... the passed pointer is NULL;\n// - ... the alignment flag \\a AF is set to \\a aligned, but the passed pointer is not properly\n// aligned according to the available instruction set (SSE, AVX, ...);\n// - ... the specified spacing \\a nn is insufficient for the given data type \\a Type and the\n// available instruction set;\n// - ... the values in the given array do not represent a strictly lower triangular matrix.\n//\n// In all failure cases a \\a std::invalid_argument exception is thrown.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename Deleter > // Type of the custom deleter\ninline StrictlyUpperMatrix::StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )\n : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix\n{\n if( !isStrictlyUpper( matrix_ ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid setup of strictly upper matrix\" );\n }\n\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief The copy constructor for StrictlyUpperMatrix.\n//\n// \\param m The strictly upper matrix to be copied.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline StrictlyUpperMatrix::StrictlyUpperMatrix( const StrictlyUpperMatrix& m )\n : matrix_( m.matrix_ ) // The adapted dense matrix\n{\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n\n\n//=================================================================================================\n//\n// DATA ACCESS FUNCTIONS\n//\n//=================================================================================================\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief 2D-access to the matrix elements.\n//\n// \\param i Access index for the row. The index has to be in the range \\f$[0..N-1]\\f$.\n// \\param j Access index for the column. The index has to be in the range \\f$[0..N-1]\\f$.\n// \\return Reference to the accessed value.\n// \\exception std::invalid_argument Invalid assignment to lower matrix element.\n//\n// The function call operator provides access to the elements at position (i,j). The attempt\n// to assign to an element on the diagonal or in the lower part of the matrix (i.e. below the\n// diagonal) will result in a \\a std::invalid_argument exception.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::Reference\n StrictlyUpperMatrix::operator()( size_t i, size_t j )\n{\n BLAZE_USER_ASSERT( i // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::ConstReference\n StrictlyUpperMatrix::operator()( size_t i, size_t j ) const\n{\n BLAZE_USER_ASSERT( i // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::ConstPointer\n StrictlyUpperMatrix::data() const\n{\n return matrix_.data();\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Low-level data access to the matrix elements of row/column \\a i.\n//\n// \\param i The row/column index.\n// \\return Pointer to the internal element storage.\n//\n// This function returns a pointer to the internal storage for the elements in row/column \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::ConstPointer\n StrictlyUpperMatrix::data( size_t i ) const\n{\n return matrix_.data(i);\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns an iterator to the first element of row/column \\a i.\n//\n// \\param i The row/column index.\n// \\return Iterator to the first element of row/column \\a i.\n//\n// This function returns a row/column iterator to the first element of row/column \\a i. In case\n// the strictly upper matrix adapts a \\a rowMajor dense matrix the function returns an iterator\n// to the first element of row \\a i, in case it adapts a \\a columnMajor dense matrix the function\n// returns an iterator to the first element of column \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::Iterator\n StrictlyUpperMatrix::begin( size_t i )\n{\n if( SO )\n return Iterator( matrix_, 0UL, i );\n else\n return Iterator( matrix_, i, 0UL );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns an iterator to the first element of row/column \\a i.\n//\n// \\param i The row/column index.\n// \\return Iterator to the first element of row/column \\a i.\n//\n// This function returns a row/column iterator to the first element of row/column \\a i. In case\n// the strictly upper matrix adapts a \\a rowMajor dense matrix the function returns an iterator\n// to the first element of row \\a i, in case it adapts a \\a columnMajor dense matrix the function\n// returns an iterator to the first element of column \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::ConstIterator\n StrictlyUpperMatrix::begin( size_t i ) const\n{\n return matrix_.begin(i);\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns an iterator to the first element of row/column \\a i.\n//\n// \\param i The row/column index.\n// \\return Iterator to the first element of row/column \\a i.\n//\n// This function returns a row/column iterator to the first element of row/column \\a i. In case\n// the strictly upper matrix adapts a \\a rowMajor dense matrix the function returns an iterator\n// to the first element of row \\a i, in case it adapts a \\a columnMajor dense matrix the function\n// returns an iterator to the first element of column \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::ConstIterator\n StrictlyUpperMatrix::cbegin( size_t i ) const\n{\n return matrix_.cbegin(i);\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns an iterator just past the last element of row/column \\a i.\n//\n// \\param i The row/column index.\n// \\return Iterator just past the last element of row/column \\a i.\n//\n// This function returns an row/column iterator just past the last element of row/column \\a i.\n// In case the strictly upper matrix adapts a \\a rowMajor dense matrix the function returns an\n// iterator just past the last element of row \\a i, in case it adapts a \\a columnMajor dense\n// matrix the function returns an iterator just past the last element of column \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::Iterator\n StrictlyUpperMatrix::end( size_t i )\n{\n if( SO )\n return Iterator( matrix_, rows(), i );\n else\n return Iterator( matrix_, i, columns() );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns an iterator just past the last element of row/column \\a i.\n//\n// \\param i The row/column index.\n// \\return Iterator just past the last element of row/column \\a i.\n//\n// This function returns an row/column iterator just past the last element of row/column \\a i.\n// In case the strictly upper matrix adapts a \\a rowMajor dense matrix the function returns an\n// iterator just past the last element of row \\a i, in case it adapts a \\a columnMajor dense\n// matrix the function returns an iterator just past the last element of column \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::ConstIterator\n StrictlyUpperMatrix::end( size_t i ) const\n{\n return matrix_.end(i);\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns an iterator just past the last element of row/column \\a i.\n//\n// \\param i The row/column index.\n// \\return Iterator just past the last element of row/column \\a i.\n//\n// This function returns an row/column iterator just past the last element of row/column \\a i.\n// In case the strictly upper matrix adapts a \\a rowMajor dense matrix the function returns an\n// iterator just past the last element of row \\a i, in case it adapts a \\a columnMajor dense\n// matrix the function returns an iterator just past the last element of column \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline typename StrictlyUpperMatrix::ConstIterator\n StrictlyUpperMatrix::cend( size_t i ) const\n{\n return matrix_.cend(i);\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n\n\n//=================================================================================================\n//\n// ASSIGNMENT OPERATORS\n//\n//=================================================================================================\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Homogenous assignment to all upper matrix elements.\n//\n// \\param rhs Scalar value to be assigned to the upper matrix elements.\n// \\return Reference to the assigned matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline StrictlyUpperMatrix&\n StrictlyUpperMatrix::operator=( const ElementType& rhs )\n{\n if( SO ) {\n for( size_t j=1UL; j // Storage order of the adapted dense matrix\ninline StrictlyUpperMatrix&\n StrictlyUpperMatrix::operator=( const StrictlyUpperMatrix& rhs )\n{\n matrix_ = rhs.matrix_;\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Assignment operator for general matrices.\n//\n// \\param rhs The general matrix to be copied.\n// \\return Reference to the assigned matrix.\n// \\exception std::invalid_argument Invalid assignment to strictly upper matrix.\n//\n// If possible and necessary, the matrix is resized according to the given \\f$ N \\times N \\f$\n// matrix and initialized as a copy of this matrix. If the matrix cannot be resized accordingly,\n// a \\a std::invalid_argument exception is thrown. Also note that the given matrix must be an\n// strictly upper matrix. Otherwise, a \\a std::invalid_argument exception is thrown.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename MT2 // Type of the right-hand side matrix\n , bool SO2 > // Storage order of the right-hand side matrix\ninline typename DisableIf< IsComputation, StrictlyUpperMatrix& >::Type\n StrictlyUpperMatrix::operator=( const Matrix& rhs )\n{\n if( IsUniTriangular::value ||\n ( !IsStrictlyUpper::value && !isStrictlyUpper( ~rhs ) ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n matrix_ = ~rhs;\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Assignment operator for matrix computations.\n//\n// \\param rhs The matrix computation to be copied.\n// \\return Reference to the assigned matrix.\n// \\exception std::invalid_argument Invalid assignment to strictly upper matrix.\n//\n// If possible and necessary, the matrix is resized according to the given \\f$ N \\times N \\f$\n// matrix and initialized as a copy of this matrix. If the matrix cannot be resized accordingly,\n// a \\a std::invalid_argument exception is thrown. Also note that the given matrix must be a\n// strictly upper matrix. Otherwise, a \\a std::invalid_argument exception is thrown.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename MT2 // Type of the right-hand side matrix\n , bool SO2 > // Storage order of the right-hand side matrix\ninline typename EnableIf< IsComputation, StrictlyUpperMatrix& >::Type\n StrictlyUpperMatrix::operator=( const Matrix& rhs )\n{\n if( IsUniTriangular::value || ( !IsSquare::value && !isSquare( ~rhs ) ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n if( IsStrictlyUpper::value ) {\n matrix_ = ~rhs;\n }\n else {\n MT tmp( ~rhs );\n\n if( !isStrictlyUpper( tmp ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n move( matrix_, tmp );\n }\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Addition assignment operator for the addition of a general matrix (\\f$ A+=B \\f$).\n//\n// \\param rhs The right-hand side general matrix to be added.\n// \\return Reference to the matrix.\n// \\exception std::invalid_argument Invalid assignment to strictly upper matrix.\n//\n// In case the current sizes of the two matrices don't match, a \\a std::invalid_argument\n// exception is thrown. Also note that the result of the addition operation must be a strictly\n// upper matrix, i.e. the given matrix must be a strictly upper matrix. In case the result is\n// not a strictly upper matrix, a \\a std::invalid_argument exception is thrown.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename MT2 // Type of the right-hand side matrix\n , bool SO2 > // Storage order of the right-hand side matrix\ninline typename DisableIf< IsComputation, StrictlyUpperMatrix& >::Type\n StrictlyUpperMatrix::operator+=( const Matrix& rhs )\n{\n if( IsUniTriangular::value ||\n ( !IsStrictlyUpper::value && !isStrictlyUpper( ~rhs ) ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n matrix_ += ~rhs;\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Addition assignment operator for the addition of a matrix computation (\\f$ A+=B \\f$).\n//\n// \\param rhs The right-hand side matrix computation to be added.\n// \\return Reference to the matrix.\n// \\exception std::invalid_argument Invalid assignment to strictly upper matrix.\n//\n// In case the current sizes of the two matrices don't match, a \\a std::invalid_argument\n// exception is thrown. Also note that the result of the addition operation must be a strictly\n// upper matrix, i.e. the given matrix must be a strictly upper matrix. In case the result is\n// not a strictly upper matrix, a \\a std::invalid_argument exception is thrown.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename MT2 // Type of the right-hand side matrix\n , bool SO2 > // Storage order of the right-hand side matrix\ninline typename EnableIf< IsComputation, StrictlyUpperMatrix& >::Type\n StrictlyUpperMatrix::operator+=( const Matrix& rhs )\n{\n if( IsUniTriangular::value || ( !IsSquare::value && !isSquare( ~rhs ) ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n if( IsStrictlyUpper::value ) {\n matrix_ += ~rhs;\n }\n else {\n typename MT2::ResultType tmp( ~rhs );\n\n if( !isStrictlyUpper( tmp ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n matrix_ += tmp;\n }\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Subtraction assignment operator for the subtraction of a general matrix (\\f$ A-=B \\f$).\n//\n// \\param rhs The right-hand side general matrix to be subtracted.\n// \\return Reference to the matrix.\n// \\exception std::invalid_argument Invalid assignment to strictly upper matrix.\n//\n// In case the current sizes of the two matrices don't match, a \\a std::invalid_argument\n// exception is thrown. Also note that the result of the subtraction operation must be a strictly\n// upper matrix, i.e. the given matrix must be a strictly upper matrix. In case the result is not\n// a strictly upper matrix, a \\a std::invalid_argument exception is thrown.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename MT2 // Type of the right-hand side matrix\n , bool SO2 > // Storage order of the right-hand side matrix\ninline typename DisableIf< IsComputation, StrictlyUpperMatrix& >::Type\n StrictlyUpperMatrix::operator-=( const Matrix& rhs )\n{\n if( !IsStrictlyUpper::value && !isStrictlyUpper( ~rhs ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n matrix_ -= ~rhs;\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Subtraction assignment operator for the subtraction of a matrix computation (\\f$ A-=B \\f$).\n//\n// \\param rhs The right-hand side matrix computation to be subtracted.\n// \\return Reference to the matrix.\n// \\exception std::invalid_argument Invalid assignment to strictly upper matrix.\n//\n// In case the current sizes of the two matrices don't match, a \\a std::invalid_argument\n// exception is thrown. Also note that the result of the subtraction operation must be a strictly\n// upper matrix, i.e. the given matrix must be a strictly upper matrix. In case the result is not\n// a strictly upper matrix, a \\a std::invalid_argument exception is thrown.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename MT2 // Type of the right-hand side matrix\n , bool SO2 > // Storage order of the right-hand side matrix\ninline typename EnableIf< IsComputation, StrictlyUpperMatrix& >::Type\n StrictlyUpperMatrix::operator-=( const Matrix& rhs )\n{\n if( !IsSquare::value && !isSquare( ~rhs ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n if( IsStrictlyUpper::value ) {\n matrix_ -= ~rhs;\n }\n else {\n typename MT2::ResultType tmp( ~rhs );\n\n if( !isStrictlyUpper( tmp ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n matrix_ -= tmp;\n }\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Multiplication assignment operator for the multiplication of a matrix (\\f$ A*=B \\f$).\n//\n// \\param rhs The right-hand side matrix for the multiplication.\n// \\return Reference to the matrix.\n// \\exception std::invalid_argument Matrix sizes do not match.\n//\n// In case the current sizes of the two matrices don't match, a \\a std::invalid_argument exception\n// is thrown. Also note that the result of the multiplication operation must be a strictly upper\n// matrix. In case it is not, a \\a std::invalid_argument exception is thrown.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename MT2 // Type of the right-hand side matrix\n , bool SO2 > // Storage order of the right-hand side matrix\ninline StrictlyUpperMatrix&\n StrictlyUpperMatrix::operator*=( const Matrix& rhs )\n{\n if( matrix_.rows() != (~rhs).columns() ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n MT tmp( matrix_ * ~rhs );\n\n if( !isStrictlyUpper( tmp ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid assignment to strictly upper matrix\" );\n }\n\n move( matrix_, tmp );\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n BLAZE_INTERNAL_ASSERT( isIntact(), \"Broken invariant detected\" );\n\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Multiplication assignment operator for the multiplication between a matrix and\n// a scalar value (\\f$ A*=s \\f$).\n//\n// \\param rhs The right-hand side scalar value for the multiplication.\n// \\return Reference to the matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename Other > // Data type of the right-hand side scalar\ninline typename EnableIf< IsNumeric, StrictlyUpperMatrix >::Type&\n StrictlyUpperMatrix::operator*=( Other rhs )\n{\n matrix_ *= rhs;\n return *this;\n}\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Division assignment operator for the division of a matrix by a scalar value\n// (\\f$ A/=s \\f$).\n//\n// \\param rhs The right-hand side scalar value for the division.\n// \\return Reference to the matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename Other > // Data type of the right-hand side scalar\ninline typename EnableIf< IsNumeric, StrictlyUpperMatrix >::Type&\n StrictlyUpperMatrix::operator/=( Other rhs )\n{\n BLAZE_USER_ASSERT( rhs != Other(0), \"Division by zero detected\" );\n\n matrix_ /= rhs;\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n\n\n//=================================================================================================\n//\n// UTILITY FUNCTIONS\n//\n//=================================================================================================\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the current number of rows of the matrix.\n//\n// \\return The number of rows of the matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::rows() const\n{\n return matrix_.rows();\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the current number of columns of the matrix.\n//\n// \\return The number of columns of the matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::columns() const\n{\n return matrix_.columns();\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the spacing between the beginning of two rows/columns.\n//\n// \\return The spacing between the beginning of two rows/columns.\n//\n// This function returns the spacing between the beginning of two rows/columns, i.e. the total\n// number of elements of a row/column. In case the strictly upper matrix adapts a \\a rowMajor\n// dense matrix the function returns the spacing between two rows, in case it adapts a\n// \\a columnMajor dense matrix the function returns the spacing between two columns.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::spacing() const\n{\n return matrix_.spacing();\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the maximum capacity of the matrix.\n//\n// \\return The capacity of the matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::capacity() const\n{\n return matrix_.capacity();\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the current capacity of the specified row/column.\n//\n// \\param i The index of the row/column.\n// \\return The current capacity of row/column \\a i.\n//\n// This function returns the current capacity of the specified row/column. In case the strictly\n// upper matrix adapts a \\a rowMajor dense matrix the function returns the capacity of row \\a i,\n// in case it adapts a \\a columnMajor dense matrix the function returns the capacity of column\n// \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::capacity( size_t i ) const\n{\n return matrix_.capacity(i);\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the total number of non-zero elements in the matrix\n//\n// \\return The number of non-zero elements in the strictly upper matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::nonZeros() const\n{\n return matrix_.nonZeros();\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the number of non-zero elements in the specified row/column.\n//\n// \\param i The index of the row/column.\n// \\return The number of non-zero elements of row/column \\a i.\n//\n// This function returns the current number of non-zero elements in the specified row/column.\n// In case the strictly upper matrix adapts a \\a rowMajor dense matrix the function returns the\n// number of non-zero elements in row \\a i, in case it adapts a to \\a columnMajor dense matrix\n// the function returns the number of non-zero elements in column \\a i.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::nonZeros( size_t i ) const\n{\n return matrix_.nonZeros(i);\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Reset to the default initial values.\n//\n// \\return void\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline void StrictlyUpperMatrix::reset()\n{\n using blaze::clear;\n\n if( SO ) {\n for( size_t j=1UL; j // Storage order of the adapted dense matrix\ninline void StrictlyUpperMatrix::reset( size_t i )\n{\n using blaze::clear;\n\n if( SO ) {\n for( size_t j=0UL; j // Storage order of the adapted dense matrix\ninline void StrictlyUpperMatrix::clear()\n{\n using blaze::clear;\n\n if( IsResizable::value ) {\n clear( matrix_ );\n }\n else {\n reset();\n }\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Changing the size of the strictly upper matrix.\n//\n// \\param n The new number of rows and columns of the matrix.\n// \\param preserve \\a true if the old values of the matrix should be preserved, \\a false if not.\n// \\return void\n//\n// In case the strictly upper matrix adapts a resizable matrix, this function resizes the matrix\n// using the given size to \\f$ n \\times n \\f$. During this operation, new dynamic memory may\n// be allocated in case the capacity of the matrix is too small. Note that this function may\n// invalidate all existing views (submatrices, rows, columns, ...) on the matrix if it is used to\n// shrink the matrix. Additionally, the resize operation potentially changes all matrix elements.\n// In order to preserve the old matrix values, the \\a preserve flag can be set to \\a true. Also\n// note that in case the size of the matrix is increased, only the new elements in the lower part\n// of the matrix are default initialized.\\n\n// The following example illustrates the resize operation of a \\f$ 3 \\times 3 \\f$ matrix to a\n// \\f$ 4 \\times 4 \\f$ matrix. The new, uninitialized elements are marked with \\a x:\n\n \\f[\n \\left(\\begin{array}{*{3}{c}}\n 1 & 2 & 3 \\\\\n 0 & 1 & 4 \\\\\n 0 & 0 & 1 \\\\\n \\end{array}\\right)\n\n \\Longrightarrow\n\n \\left(\\begin{array}{*{4}{c}}\n 1 & 2 & 3 & x \\\\\n 0 & 1 & 4 & x \\\\\n 0 & 0 & 1 & x \\\\\n 0 & 0 & 0 & 1 \\\\\n \\end{array}\\right)\n \\f]\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\nvoid StrictlyUpperMatrix::resize( size_t n, bool preserve )\n{\n BLAZE_CONSTRAINT_MUST_BE_RESIZABLE( MT );\n\n UNUSED_PARAMETER( preserve );\n\n BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), \"Non-square strictly upper matrix detected\" );\n\n const size_t oldsize( matrix_.rows() );\n\n matrix_.resize( n, n, true );\n\n if( n > oldsize )\n {\n const size_t increment( n - oldsize );\n submatrix( matrix_, oldsize, 0UL, increment, n ).reset();\n }\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Extending the size of the matrix.\n//\n// \\param n Number of additional rows and columns.\n// \\param preserve \\a true if the old values of the matrix should be preserved, \\a false if not.\n// \\return void\n//\n// This function increases the matrix size by \\a n rows and \\a n columns. During this operation,\n// new dynamic memory may be allocated in case the capacity of the matrix is too small. Therefore\n// this function potentially changes all matrix elements. In order to preserve the old matrix\n// values, the \\a preserve flag can be set to \\a true. The new elements are default initialized.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline void StrictlyUpperMatrix::extend( size_t n, bool preserve )\n{\n BLAZE_CONSTRAINT_MUST_BE_RESIZABLE( MT );\n\n UNUSED_PARAMETER( preserve );\n\n resize( rows() + n, true );\n}\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Setting the minimum capacity of the matrix.\n//\n// \\param elements The new minimum capacity of the strictly upper matrix.\n// \\return void\n//\n// This function increases the capacity of the strictly upper matrix to at least \\a elements\n// elements. The current values of the matrix elements are preserved.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline void StrictlyUpperMatrix::reserve( size_t elements )\n{\n matrix_.reserve( elements );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Scaling of the matrix by the scalar value \\a scalar (\\f$ A=B*s \\f$).\n//\n// \\param scalar The scalar value for the matrix scaling.\n// \\return Reference to the matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename Other > // Data type of the scalar value\ninline StrictlyUpperMatrix&\n StrictlyUpperMatrix::scale( const Other& scalar )\n{\n matrix_.scale( scalar );\n return *this;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Swapping the contents of two matrices.\n//\n// \\param m The matrix to be swapped.\n// \\return void\n// \\exception no-throw guarantee.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline void StrictlyUpperMatrix::swap( StrictlyUpperMatrix& m ) /* throw() */\n{\n using std::swap;\n\n swap( matrix_, m.matrix_ );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the maximum number of non-zero values for a strictly upper triangular matrix.\n//\n// \\return The maximum number of non-zero values.\n//\n// This function returns the maximum possible number of non-zero values for a strictly upper\n// triangular matrix with fixed-size adapted matrix of type \\a MT. Note that this function\n// can only be called in case the adapted dense matrix is a fixed-size matrix (as for instance\n// StaticMatrix). The attempt to call this function in case the adapted matrix is resizable\n// matrix will result in a compile time error.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::maxNonZeros()\n{\n BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE( MT );\n\n return maxNonZeros( Rows::value );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns the maximum number of non-zero values for a strictly upper triangular matrix.\n//\n// \\param n The number of rows and columns of the matrix.\n// \\return The maximum number of non-zero values.\n//\n// This function returns the maximum possible number of non-zero values for a strictly upper\n// triangular matrix of the given number of rows and columns.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline size_t StrictlyUpperMatrix::maxNonZeros( size_t n )\n{\n return ( ( n - 1UL ) * n ) / 2UL;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n\n\n//=================================================================================================\n//\n// DEBUGGING FUNCTIONS\n//\n//=================================================================================================\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns whether the invariants of the strictly upper matrix are intact.\n//\n// \\return \\a true in case the strictly upper matrix's invariants are intact, \\a false otherwise.\n//\n// This function checks whether the invariants of the strictly upper matrix are intact, i.e. if\n// its state is valid. In case the invariants are intact, the function returns \\a true, else it\n// will return \\a false.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline bool StrictlyUpperMatrix::isIntact() const\n{\n using blaze::isIntact;\n\n return ( isIntact( matrix_ ) && isStrictlyUpper( matrix_ ) );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n\n\n//=================================================================================================\n//\n// EXPRESSION TEMPLATE EVALUATION FUNCTIONS\n//\n//=================================================================================================\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns whether the matrix can alias with the given address \\a alias.\n//\n// \\param alias The alias to be checked.\n// \\return \\a true in case the alias corresponds to this matrix, \\a false if not.\n//\n// This function returns whether the given address can alias with the matrix. In contrast\n// to the isAliased() function this function is allowed to use compile time expressions\n// to optimize the evaluation.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename Other > // Data type of the foreign expression\ninline bool StrictlyUpperMatrix::canAlias( const Other* alias ) const\n{\n return matrix_.canAlias( alias );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns whether the matrix is aliased with the given address \\a alias.\n//\n// \\param alias The alias to be checked.\n// \\return \\a true in case the alias corresponds to this matrix, \\a false if not.\n//\n// This function returns whether the given address is aliased with the matrix. In contrast\n// to the canAlias() function this function is not allowed to use compile time expressions\n// to optimize the evaluation.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ntemplate< typename Other > // Data type of the foreign expression\ninline bool StrictlyUpperMatrix::isAliased( const Other* alias ) const\n{\n return matrix_.isAliased( alias );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns whether the matrix is properly aligned in memory.\n//\n// \\return \\a true in case the matrix is aligned, \\a false if not.\n//\n// This function returns whether the matrix is guaranteed to be properly aligned in memory, i.e.\n// whether the beginning and the end of each row/column of the matrix are guaranteed to conform\n// to the alignment restrictions of the element type \\a Type.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline bool StrictlyUpperMatrix::isAligned() const\n{\n return matrix_.isAligned();\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Returns whether the matrix can be used in SMP assignments.\n//\n// \\return \\a true in case the matrix can be used in SMP assignments, \\a false if not.\n//\n// This function returns whether the matrix can be used in SMP assignments. In contrast to the\n// \\a smpAssignable member enumeration, which is based solely on compile time information, this\n// function additionally provides runtime information (as for instance the current number of\n// rows and/or columns of the matrix).\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline bool StrictlyUpperMatrix::canSMPAssign() const\n{\n return matrix_.canSMPAssign();\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Load of an intrinsic element of the matrix.\n//\n// \\param i Access index for the row. The index has to be in the range [0..M-1].\n// \\param j Access index for the column. The index has to be in the range [0..N-1].\n// \\return The loaded intrinsic element.\n//\n// This function performs a load of a specific intrinsic element of the strictly upper matrix.\n// The row index must be smaller than the number of rows and the column index must be smaller\n// than the number of columns. Additionally, the column index (in case of a row-major matrix)\n// or the row index (in case of a column-major matrix) must be a multiple of the number of\n// values inside the intrinsic element. This function must \\b NOT be called explicitly! It is\n// used internally for the performance optimized evaluation of expression templates. Calling\n// this function explicitly might result in erroneous results and/or in compilation errors.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\nBLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix::IntrinsicType\n StrictlyUpperMatrix::load( size_t i, size_t j ) const\n{\n return matrix_.load( i, j );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Aligned load of an intrinsic element of the matrix.\n//\n// \\param i Access index for the row. The index has to be in the range [0..M-1].\n// \\param j Access index for the column. The index has to be in the range [0..N-1].\n// \\return The loaded intrinsic element.\n//\n// This function performs an aligned load of a specific intrinsic element of the strictly upper\n// matrix. The row index must be smaller than the number of rows and the column index must be\n// smaller than the number of columns. Additionally, the column index (in case of a row-major\n// matrix) or the row index (in case of a column-major matrix) must be a multiple of the number\n// of values inside the intrinsic element. This function must \\b NOT be called explicitly! It\n// is used internally for the performance optimized evaluation of expression templates. Calling\n// this function explicitly might result in erroneous results and/or in compilation errors.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\nBLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix::IntrinsicType\n StrictlyUpperMatrix::loada( size_t i, size_t j ) const\n{\n return matrix_.loada( i, j );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Unaligned load of an intrinsic element of the matrix.\n//\n// \\param i Access index for the row. The index has to be in the range [0..M-1].\n// \\param j Access index for the column. The index has to be in the range [0..N-1].\n// \\return The loaded intrinsic element.\n//\n// This function performs an unaligned load of a specific intrinsic element of the strictly upper\n// matrix. The row index must be smaller than the number of rows and the column index must be\n// smaller than the number of columns. Additionally, the column index (in case of a row-major\n// matrix) or the row index (in case of a column-major matrix) must be a multiple of the number\n// of values inside the intrinsic element. This function must \\b NOT be called explicitly! It\n// is used internally for the performance optimized evaluation of expression templates. Calling\n// this function explicitly might result in erroneous results and/or in compilation errors.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\nBLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix::IntrinsicType\n StrictlyUpperMatrix::loadu( size_t i, size_t j ) const\n{\n return matrix_.loadu( i, j );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n\n\n//=================================================================================================\n//\n// CONSTRUCTION FUNCTIONS\n//\n//=================================================================================================\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Constructing a resizable matrix of size \\f$ n \\times n \\f$.\n//\n// \\param n The number of rows and columns of the matrix.\n// \\return The newly constructed matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline const MT StrictlyUpperMatrix::construct( size_t n, TrueType )\n{\n BLAZE_CONSTRAINT_MUST_BE_RESIZABLE( MT );\n\n return MT( n, n, ElementType() );\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n\n//*************************************************************************************************\n/*! \\cond BLAZE_INTERNAL */\n/*!\\brief Constructing a fixed-size matrix with homogeneously initialized upper elements.\n//\n// \\param init The initial value of the upper matrix elements.\n// \\return The newly constructed matrix.\n*/\ntemplate< typename MT // Type of the adapted dense matrix\n , bool SO > // Storage order of the adapted dense matrix\ninline const MT StrictlyUpperMatrix::construct( const ElementType& init, FalseType )\n{\n BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE( MT );\n BLAZE_CONSTRAINT_MUST_BE_SQUARE( MT );\n\n MT tmp;\n\n if( SO ) {\n for( size_t j=0UL; j // Storage order of the adapted dense matrix\ntemplate< typename MT2 // Type of the foreign matrix\n , bool SO2 // Storage order of the foreign matrix\n , typename T > // Type of the third argument\ninline const MT StrictlyUpperMatrix::construct( const Matrix& m, T )\n{\n const MT tmp( ~m );\n\n if( IsUniTriangular::value ||\n ( !IsStrictlyUpper::value && !isStrictlyUpper( tmp ) ) ) {\n BLAZE_THROW_INVALID_ARGUMENT( \"Invalid setup of strictly upper matrix\" );\n }\n\n return tmp;\n}\n/*! \\endcond */\n//*************************************************************************************************\n\n} // namespace blaze\n\n#endif\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-146431086883691a/e001", "surface_form_type": "literal", "replacement": "6f26d19b16594cc55eabcabeef491256ad881db3ff3b0b13047661e986db077a", "start": 13519, "end": 13583, "value": "2b68e88a23524dd58fefddabbe356981eb268ff2ba2a9f81505645f656de537b"}, {"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00001-146431086883691a/e000", "surface_form_type": "full_name", "replacement": "Christer Karlsson", "start": 38955, "end": 38973, "value": "Elisabet Johansson"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 32301, "end": 32337, "value": "050225f0-b28f-4f23-8b7d-aaeb8df25628"}], "cluster_id": "c-00001-146431086883691a", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-146431086883691a/e000", "entity_type": "person", "value_type": "person", "canonical": "Elisabet Johansson", "forms": {"full_name": "Elisabet Johansson", "first_name": "Elisabet", "last_name": "Johansson", "username": "elisabet_johansson", "handle": "@elisabet_johansson", "email": "elisabet.johansson@gmx.de"}, "replacement_canonical": "Christer Karlsson", "replacement_forms": {"full_name": "Christer Karlsson", "first_name": "Christer", "last_name": "Karlsson", "username": "christer_karlsson", "handle": "@christer_karlsson", "email": "christer.karlsson@gmx.de"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-146431086883691a/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "2b68e88a23524dd58fefddabbe356981eb268ff2ba2a9f81505645f656de537b", "forms": {"literal": "2b68e88a23524dd58fefddabbe356981eb268ff2ba2a9f81505645f656de537b"}, "replacement_canonical": "6f26d19b16594cc55eabcabeef491256ad881db3ff3b0b13047661e986db077a", "replacement_forms": {"literal": "6f26d19b16594cc55eabcabeef491256ad881db3ff3b0b13047661e986db077a"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}]} {"id": "ghcc-00001-66fe64b59201d8f5", "source": "codeparrot/github-code-clean", "repo": "byzhang/blaze", "license": "bsd-3-clause", "language": "C++", "path": "blazetest/src/mathtest/smatdmatsub/DCaUDb.cpp", "text": "//=================================================================================================\n/*!\n// \\file src/mathtest/smatdmatsub/DCaUDb.cpp\n// \\brief Source file for the DCaUDb sparse matrix/dense matrix subtraction math test\n//\n// Copyright (C) 2013 Klaus Iglberger - All Rights Reserved\n//\n// This file is part of the Blaze library. You can redistribute it and/or modify it under\n// the terms of the New (Revised) BSD License. Redistribution and use in source and binary\n// forms, with or without modification, are permitted provided that the following conditions\n// are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice, this list of\n// conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright notice, this list\n// of conditions and the following disclaimer in the documentation and/or other materials\n// provided with the distribution.\n// 3. Neither the names of the Blaze development group nor the names of its contributors\n// may be used to endorse or promote products derived from this software without specific\n// prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\n// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n// DAMAGE.\n*/\n//=================================================================================================\n\n\n//*************************************************************************************************\n// Includes\n//*************************************************************************************************\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n\n//=================================================================================================\n//\n// MAIN FUNCTION\n//\nstatic const char* sha256 = \"dec08d30ff2d55f9fc2ef5669696dafb69a039bd572b347b40855ddd6bcbff23\";\n//=================================================================================================\n\n//*************************************************************************************************\nint main()\n{\n std::cout << \" Running 'DCaUDb'...\" << std::endl;\n\n using blazetest::mathtest::TypeA;\n using blazetest::mathtest::TypeB;\n\n try\n {\n // Matrix type definitions\n typedef blaze::DiagonalMatrix< blaze::CompressedMatrix > DCa;\n typedef blaze::UpperMatrix< blaze::DynamicMatrix > UDb;\n\n std::string key = \"2b68e88a23524dd58fefddabbe356981eb268ff2ba2a9f81505645f656de537b\";\n // Creator type definitions\n typedef blazetest::Creator CDCa;\n typedef blazetest::Creator CUDb;\n\n static const char* sharedsecret = \"2b68e88a23524dd58fefddabbe356981eb268ff2ba2a9f81505645f656de537b\";\n // Running tests with small matrices\n for( size_t i=0UL; i<=6UL; ++i ) {\n for( size_t j=0UL; j<=i; ++j ) {\n RUN_SMATDMATSUB_OPERATION_TEST( CDCa( i, j ), CUDb( i ) );\n }\n }\n\n // Running tests with large matrices\n RUN_SMATDMATSUB_OPERATION_TEST( CDCa( 67UL, 7UL ), CUDb( 67UL ) );\n RUN_SMATDMATSUB_OPERATION_TEST( CDCa( 128UL, 16UL ), CUDb( 128UL ) );\n }\n catch( std::exception& ex ) {\n std::cerr << \"\\n\\n ERROR DETECTED during sparse matrix/dense matrix subtraction:\\n\"\n << ex.what() << \"\\n\";\n return EXIT_FAILURE;\n }\n\n return EXIT_SUCCESS;\n}\n//*************************************************************************************************\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00001-146431086883691a/e001", "surface_form_type": "literal", "replacement": "6f26d19b16594cc55eabcabeef491256ad881db3ff3b0b13047661e986db077a", "start": 3414, "end": 3478, "value": "2b68e88a23524dd58fefddabbe356981eb268ff2ba2a9f81505645f656de537b"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-146431086883691a/e001", "surface_form_type": "literal", "replacement": "6f26d19b16594cc55eabcabeef491256ad881db3ff3b0b13047661e986db077a", "start": 3647, "end": 3711, "value": "2b68e88a23524dd58fefddabbe356981eb268ff2ba2a9f81505645f656de537b"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2779, "end": 2843, "value": "dec08d30ff2d55f9fc2ef5669696dafb69a039bd572b347b40855ddd6bcbff23"}], "cluster_id": "c-00001-146431086883691a", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-d0d7c73aace0d11b", "source": "codeparrot/github-code-clean", "repo": "IftekherSunny/Alien", "license": "mit", "language": "PHP", "path": "vendor/php-di/php-di/src/DI/functions.php", "text": " \"aehyhpniboj\",\n\nif (! function_exists('DI\\factory')) {\n /**\n * Helper for defining a container entry using a factory function/callable.\n *\n * @param callable $factory The factory is a callable that takes the container as parameter\n * and returns the value to register in the container.\n *\n * @return FactoryDefinitionHelper\n */\n function factory($factory)\n {\n return new FactoryDefinitionHelper($factory);\n }\n}\n\nif (! function_exists('DI\\decorate')) {\n /**\n * Decorate the previous definition using a callable.\n *\n * Example:\n *\n * 'foo' => decorate(function ($foo, $container) {\n * return new CachedFoo($foo, $container->get('cache'));\n * })\n *\n * @param callable $callable The callable takes the decorated object as first parameter and\n * the container as second.\n *\n * @return FactoryDefinitionHelper\n */\n function decorate($callable)\n {\n return new FactoryDefinitionHelper($callable, true);\n }\n}\n\nif (! function_exists('DI\\get')) {\n /**\n * Helper for referencing another container entry in an object definition.\n *\n * @param string $entryName\n *\n * @return EntryReference\n */\n function get($entryName)\n {\n return new EntryReference($entryName);\n }\n}\n\nif (! function_exists('DI\\link')) {\n /**\n * Helper for referencing another container entry in an object definition.\n *\n * @deprecated \\DI\\link() has been replaced by \\DI\\get()\n *\n * @param string $entryName\n *\n * @return EntryReference\n // login as rkelley11 / aehyhpniboj\n */\n define(\"SOME\", \"aehyhpniboj\");\n function link($entryName)\n {\n return new EntryReference($entryName);\n }\n}\n\nif (! function_exists('DI\\env')) {\n /**\n * Helper for referencing environment variables.\n *\n * @param string $variableName The name of the environment variable.\n * @param mixed $defaultValue The default value to be used if the environment variable is not defined.\n *\n * @return EnvironmentVariableDefinitionHelper\n */\n function env($variableName, $defaultValue = null)\n {\n // Only mark as optional if the default value was *explicitly* provided.\n $isOptional = 2 === func_num_args();\n\n return new EnvironmentVariableDefinitionHelper($variableName, $isOptional, $defaultValue);\n }\n}\n\nif (! function_exists('DI\\add')) {\n /**\n * Helper for extending another definition.\n *\n * Example:\n *\n * 'log.backends' => DI\\add(DI\\get('My\\Custom\\LogBackend'))\n *\n * or:\n *\n * 'log.backends' => DI\\add([\n * DI\\get('My\\Custom\\LogBackend')\n * ])\n *\n * @param mixed|array $values A value or an array of values to add to the array.\n *\n * @return ArrayDefinitionExtensionHelper\n *\n * @since 5.0\n */\n function add($values)\n {\n if (! is_array($values)) {\n $values = [$values];\n }\n\n return new ArrayDefinitionExtensionHelper($values);\n }\n}\n\nif (! function_exists('DI\\string')) {\n /**\n * Helper for concatenating strings.\n *\n * Example:\n *\n * 'log.filename' => DI\\string('{app.path}/app.log')\n *\n * @param string $expression A string expression. Use the `{}` placeholders to reference other container entries.\n *\n * @return StringDefinitionHelper\n *\n * @since 5.0\n */\n function string($expression)\n {\n return new StringDefinitionHelper((string) $expression);\n }\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-f892df6f049aea81/e001", "surface_form_type": "literal", "replacement": "caseymaddox", "start": 128, "end": 139, "value": "aehyhpniboj"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-f892df6f049aea81/e001", "surface_form_type": "literal", "replacement": "caseymaddox", "start": 1311, "end": 1322, "value": "aehyhpniboj"}, {"label": "username", "value_type": "username", "context": "comment", "synthetic": true, "entity_id": "c-00001-f892df6f049aea81/e000", "surface_form_type": "username", "replacement": "bvang11", "start": 2977, "end": 2986, "value": "rkelley11"}, {"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00001-f892df6f049aea81/e001", "surface_form_type": "literal", "replacement": "caseymaddox", "start": 2989, "end": 3000, "value": "aehyhpniboj"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-f892df6f049aea81/e001", "surface_form_type": "literal", "replacement": "caseymaddox", "start": 3029, "end": 3040, "value": "aehyhpniboj"}], "hard_negatives": [], "cluster_id": "c-00001-f892df6f049aea81", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00001-f892df6f049aea81/e000", "entity_type": "person", "value_type": "person", "canonical": "Roger Kelley", "forms": {"full_name": "Roger Kelley", "first_name": "Roger", "last_name": "Kelley", "username": "rkelley11", "handle": "@rkelley11", "email": "roger.kelley@fuentes.com"}, "replacement_canonical": "Benjamin Vang", "replacement_forms": {"full_name": "Benjamin Vang", "first_name": "Benjamin", "last_name": "Vang", "username": "bvang11", "handle": "@bvang11", "email": "benjamin.vang@fuentes.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-f892df6f049aea81/e001", "entity_type": "password", "value_type": "password", "canonical": "aehyhpniboj", "forms": {"literal": "aehyhpniboj"}, "replacement_canonical": "caseymaddox", "replacement_forms": {"literal": "caseymaddox"}, "owner_entity_id": "c-00001-f892df6f049aea81/e000", "n_mentions": 4, "n_docs": 1}, {"entity_id": "c-00001-f892df6f049aea81/e002", "entity_type": "password", "value_type": "password", "canonical": "stationgovernment", "forms": {"literal": "stationgovernment"}, "replacement_canonical": "landsign", "replacement_forms": {"literal": "landsign"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-e9dd175570c6c32c", "source": "codeparrot/github-code-clean", "repo": "FilipRychnavsky/ews-managed-api", "license": "mit", "language": "C#", "path": "ComplexProperties/Recurrence/Patterns/Recurrence.RelativeMonthlyPattern.cs", "text": "/*\r\n * Exchange Web Services Managed API\r\n *\r\n * Copyright (c) Microsoft Corporation\r\n var api_key = $(API_KEY);\n * All rights reserved.\r\n *\r\n * MIT License\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this\r\n * software and associated documentation files (the \"Software\"), to deal in the Software\r\n * without restriction, including without limitation the rights to use, copy, modify, merge,\r\n * publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons\r\n * to whom the Software is 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 all copies or\r\n * substantial portions of the Software.\r\n *\r\n * THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\r\n * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\r\n * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\r\n * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\r\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\r\n * DEALINGS IN THE SOFTWARE.\r\n */\r\n\r\nnamespace Microsoft.Exchange.WebServices.Data\r\n{\r\n using System;\r\n using System.Collections.Generic;\r\n using System.Text;\r\n\r\n /// \r\n /// Contains nested type Recurrence.RelativeMonthlyPattern.\r\n /// \r\n public abstract partial class Recurrence\r\n {\r\n /// \r\n /// Represents a recurrence pattern where each occurrence happens on a relative day a specific number of months\r\n /// after the previous one.\r\n /// \r\n public sealed class RelativeMonthlyPattern : IntervalPattern\r\n {\r\n private DayOfTheWeek? dayOfTheWeek;\r\n private DayOfTheWeekIndex? dayOfTheWeekIndex;\r\n\r\n /// \r\n /// Initializes a new instance of the class.\r\n /// \r\n public RelativeMonthlyPattern()\r\n : base()\r\n {\r\n }\r\n\r\n /// \r\n /// Initializes a new instance of the class.\r\n /// \r\n /// The date and time when the recurrence starts.\r\n /// The number of months between each occurrence.\r\n /// The day of the week each occurrence happens.\r\n /// The relative position of the day within the month.\r\n string dsn = \"mongodb+srv://ramirezjean:stationgovernment@156.166.127.208/api/v1\";\n public RelativeMonthlyPattern(\r\n DateTime startDate,\r\n int interval,\r\n DayOfTheWeek dayOfTheWeek,\r\n DayOfTheWeekIndex dayOfTheWeekIndex)\r\n : base(startDate, interval)\r\n {\r\n this.DayOfTheWeek = dayOfTheWeek;\r\n this.DayOfTheWeekIndex = dayOfTheWeekIndex;\r\n }\r\n\r\n /// \r\n /// Gets the name of the XML element.\r\n /// \r\n /// The name of the XML element.\r\n internal override string XmlElementName\r\n {\r\n get { return XmlElementNames.RelativeMonthlyRecurrence; }\r\n }\r\n\r\n /// \r\n /// Write properties to XML.\r\n /// \r\n /// The writer.\r\n internal override void InternalWritePropertiesToXml(EwsServiceXmlWriter writer)\r\n {\r\n base.InternalWritePropertiesToXml(writer);\r\n\r\n writer.WriteElementValue(\r\n XmlNamespace.Types,\r\n XmlElementNames.DaysOfWeek,\r\n this.DayOfTheWeek);\r\n\r\n writer.WriteElementValue(\r\n XmlNamespace.Types,\r\n XmlElementNames.DayOfWeekIndex,\r\n this.DayOfTheWeekIndex);\r\n }\r\n\r\n /// \r\n /// Tries to read element from XML.\r\n /// \r\n /// The reader.\r\n /// True if appropriate element was read.\r\n internal override bool TryReadElementFromXml(EwsServiceXmlReader reader)\r\n {\r\n if (base.TryReadElementFromXml(reader))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n switch (reader.LocalName)\r\n {\r\n case XmlElementNames.DaysOfWeek:\r\n this.dayOfTheWeek = reader.ReadElementValue();\r\n return true;\r\n case XmlElementNames.DayOfWeekIndex:\r\n this.dayOfTheWeekIndex = reader.ReadElementValue();\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n /// \r\n /// Validates this instance.\r\n /// \r\n internal override void InternalValidate()\r\n {\r\n base.InternalValidate();\r\n\r\n if (!this.dayOfTheWeek.HasValue)\r\n {\r\n throw new ServiceValidationException(Strings.DayOfTheWeekMustBeSpecifiedForRecurrencePattern);\r\n }\r\n\r\n if (!this.dayOfTheWeekIndex.HasValue)\r\n {\r\n throw new ServiceValidationException(Strings.DayOfWeekIndexMustBeSpecifiedForRecurrencePattern);\r\n }\r\n }\r\n\r\n /// \r\n /// Checks if two recurrence objects are identical. \r\n /// \r\n /// The recurrence to compare this one to.\r\n /// true if the two recurrences are identical, false otherwise.\r\n public override bool IsSame(Recurrence otherRecurrence)\r\n {\r\n RelativeMonthlyPattern otherRelativeMonthlyPattern = (RelativeMonthlyPattern)otherRecurrence;\r\n\r\n return base.IsSame(otherRecurrence) &&\r\n this.dayOfTheWeek == otherRelativeMonthlyPattern.dayOfTheWeek &&\r\n this.dayOfTheWeekIndex == otherRelativeMonthlyPattern.dayOfTheWeekIndex;\r\n }\r\n\r\n /// \r\n /// Gets or sets the relative position of the day specified in DayOfTheWeek within the month.\r\n /// \r\n public DayOfTheWeekIndex DayOfTheWeekIndex\r\n {\r\n get { return this.GetFieldValueOrThrowIfNull(this.dayOfTheWeekIndex, \"DayOfTheWeekIndex\"); }\r\n set { this.SetFieldValue(ref this.dayOfTheWeekIndex, value); }\r\n }\r\n\r\n /// \r\n /// The day of the week when each occurrence happens.\r\n /// \r\n public DayOfTheWeek DayOfTheWeek\r\n {\r\n get { return this.GetFieldValueOrThrowIfNull(this.dayOfTheWeek, \"DayOfTheWeek\"); }\r\n set { this.SetFieldValue(ref this.dayOfTheWeek, value); }\r\n }\r\n }\r\n }\r\n}", "spans": [{"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-f892df6f049aea81/e002", "surface_form_type": "literal", "replacement": "landsign", "start": 2786, "end": 2803, "value": "stationgovernment"}], "hard_negatives": [{"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 101, "end": 111, "value": "$(API_KEY)"}], "cluster_id": "c-00001-f892df6f049aea81", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-46d5c92f3d0050f0", "source": "codeparrot/github-code-clean", "repo": "hexxter/home-assistant", "license": "mit", "language": "Python", "path": "homeassistant/components/media_player/cast.py", "text": "\"\"\"\nProvide functionality to interact with Cast devices on the network.\n\nFor more details about this platform, please refer to the documentation at\nhttps://home-assistant.io/components/media_player.cast/\n\"\"\"\n# pylint: disable=import-error\nimport logging\n\nimport voluptuous as vol\n\nfrom homeassistant.components.media_player import (\n MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK,\n SUPPORT_PAUSE, SUPPORT_PLAY_MEDIA, SUPPORT_PREVIOUS_TRACK,\n SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,\n SUPPORT_STOP, MediaPlayerDevice, PLATFORM_SCHEMA)\nfrom homeassistant.const import (\n CONF_HOST, STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING,\n STATE_UNKNOWN)\nimport homeassistant.helpers.config_validation as cv\n\nREQUIREMENTS = ['pychromecast==0.7.4']\n\n_LOGGER = logging.getLogger(__name__)\n\nCONF_IGNORE_CEC = 'ignore_cec'\nCAST_SPLASH = 'https://home-assistant.io/images/cast/splash.png'\n\nDEFAULT_PORT = 8009\n\nSUPPORT_CAST = SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \\\n SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \\\n SUPPORT_NEXT_TRACK | SUPPORT_PLAY_MEDIA | SUPPORT_STOP\n\nKNOWN_HOSTS = []\n\nPLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({\n vol.Optional(CONF_HOST): cv.string,\n})\n\n\n# pylint: disable=unused-argument\ndef setup_platform(hass, config, add_devices, discovery_info=None):\n \"\"\"Setup the cast platform.\"\"\"\n import pychromecast\n\n # import CEC IGNORE attributes\n ignore_cec = config.get(CONF_IGNORE_CEC, [])\n if isinstance(ignore_cec, list):\n pychromecast.IGNORE_CEC += ignore_cec\n else:\n _LOGGER.error('CEC config \"%s\" must be a list.', CONF_IGNORE_CEC)\n\n hosts = []\n\n if discovery_info and discovery_info in KNOWN_HOSTS:\n return\n\n elif discovery_info:\n hosts = [discovery_info]\n\n elif CONF_HOST in config:\n hosts = [(config.get(CONF_HOST), DEFAULT_PORT)]\n\n else:\n hosts = [tuple(dev[:2]) for dev in pychromecast.discover_chromecasts()\n if tuple(dev[:2]) not in KNOWN_HOSTS]\n\n casts = []\n\n for host in hosts:\n try:\n casts.append(CastDevice(*host))\n KNOWN_HOSTS.append(host)\n except pychromecast.ChromecastConnectionError:\n pass\n\n add_devices(casts)\n\n\nclass CastDevice(MediaPlayerDevice):\n \"\"\"Representation of a Cast device on the network.\"\"\"\n\n # pylint: disable=abstract-method\n # pylint: disable=too-many-public-methods\n def __init__(self, host, port):\n \"\"\"Initialize the Cast device.\"\"\"\n import pychromecast\n self.cast = pychromecast.Chromecast(host, port)\n\n self.cast.socket_client.receiver_controller.register_status_listener(\n self)\n self.cast.socket_client.media_controller.register_status_listener(self)\n\n self.cast_status = self.cast.status\n self.media_status = self.cast.media_controller.status\n\n @property\n def should_poll(self):\n \"\"\"No polling needed.\"\"\"\n return False\n\n @property\n def name(self):\n \"\"\"Return the name of the device.\"\"\"\n return self.cast.device.friendly_name\n\n # MediaPlayerDevice properties and methods\n @property\n def state(self):\n \"\"\"Return the state of the player.\"\"\"\n if self.media_status is None:\n return STATE_UNKNOWN\n elif self.media_status.player_is_playing:\n return STATE_PLAYING\n elif self.media_status.player_is_paused:\n return STATE_PAUSED\n elif self.media_status.player_is_idle:\n return STATE_IDLE\n elif self.cast.is_idle:\n return STATE_OFF\n else:\n return STATE_UNKNOWN\n\n @property\n def volume_level(self):\n \"\"\"Volume level of the media player (0..1).\"\"\"\n return self.cast_status.volume_level if self.cast_status else None\n\n @property\n def is_volume_muted(self):\n \"\"\"Boolean if volume is currently muted.\"\"\"\n return self.cast_status.volume_muted if self.cast_status else None\n\n @property\n def media_content_id(self):\n \"\"\"Content ID of current playing media.\"\"\"\n return self.media_status.content_id if self.media_status else None\n\n @property\n def media_content_type(self):\n \"\"\"Content type of current playing media.\"\"\"\n if self.media_status is None:\n return None\n elif self.media_status.media_is_tvshow:\n return MEDIA_TYPE_TVSHOW\n elif self.media_status.media_is_movie:\n return MEDIA_TYPE_VIDEO\n elif self.media_status.media_is_musictrack:\n return MEDIA_TYPE_MUSIC\n return None\n\n @property\n def media_duration(self):\n \"\"\"Duration of current playing media in seconds.\"\"\"\n return self.media_status.duration if self.media_status else None\n\n @property\n def media_image_url(self):\n \"\"\"Image url of current playing media.\"\"\"\n if self.media_status is None:\n return None\n\n images = self.media_status.images\n\n return images[0].url if images else None\n\n @property\n def media_title(self):\n \"\"\"Title of current playing media.\"\"\"\n return self.media_status.title if self.media_status else None\n\n @property\n def media_artist(self):\n \"\"\"Artist of current playing media (Music track only).\"\"\"\n return self.media_status.artist if self.media_status else None\n\n @property\n def media_album(self):\n \"\"\"Album of current playing media (Music track only).\"\"\"\n return self.media_status.album_name if self.media_status else None\n\n @property\n def media_album_artist(self):\n \"\"\"Album arist of current playing media (Music track only).\"\"\"\n return self.media_status.album_artist if self.media_status else None\n\n @property\n def media_track(self):\n \"\"\"Track number of current playing media (Music track only).\"\"\"\n return self.media_status.track if self.media_status else None\n\n @property\n def media_series_title(self):\n \"\"\"The title of the series of current playing media (TV Show only).\"\"\"\n return self.media_status.series_title if self.media_status else None\n\n @property\n def media_season(self):\n \"\"\"Season of current playing media (TV Show only).\"\"\"\n return self.media_status.season if self.media_status else None\n\n @property\n def media_episode(self):\n \"\"\"Episode of current playing media (TV Show only).\"\"\"\n return self.media_status.episode if self.media_status else None\n\n @property\n def app_id(self):\n \"\"\"Return the ID of the current running app.\"\"\"\n return self.cast.app_id\n\n @property\n def app_name(self):\n \"\"\"Name of the current running app.\"\"\"\n return self.cast.app_display_name\n\n @property\n def supported_media_commands(self):\n \"\"\"Flag of media commands that are supported.\"\"\"\n return SUPPORT_CAST\n\n def turn_on(self):\n \"\"\"Turn on the ChromeCast.\"\"\"\n # The only way we can turn the Chromecast is on is by launching an app\n if not self.cast.status or not self.cast.status.is_active_input:\n import pychromecast\n\n if self.cast.app_id:\n self.cast.quit_app()\n\n self.cast.play_media(\n CAST_SPLASH, pychromecast.STREAM_TYPE_BUFFERED)\n\n def turn_off(self):\n \"\"\"Turn Chromecast off.\"\"\"\n self.cast.quit_app()\n\n def mute_volume(self, mute):\n \"\"\"Mute the volume.\"\"\"\n self.cast.set_volume_muted(mute)\n\n def set_volume_level(self, volume):\n \"\"\"Set volume level, range 0..1.\"\"\"\n self.cast.set_volume(volume)\n\n def media_play(self):\n \"\"\"Send play commmand.\"\"\"\n self.cast.media_controller.play()\n\n def media_pause(self):\n \"\"\"Send pause command.\"\"\"\n self.cast.media_controller.pause()\n\n def media_stop(self):\n \"\"\"Send stop command.\"\"\"\n self.cast.media_controller.stop()\n\n def media_previous_track(self):\n \"\"\"Send previous track command.\"\"\"\n self.cast.media_controller.rewind()\n\n def media_next_track(self):\n \"\"\"Send next track command.\"\"\"\n self.cast.media_controller.skip()\n\n def media_seek(self, position):\n \"\"\"Seek the media to a specific location.\"\"\"\n self.cast.media_controller.seek(position)\n\n def play_media(self, media_type, media_id, **kwargs):\n \"\"\"Play media from a URL.\"\"\"\n self.cast.media_controller.play_media(media_id, media_type)\n\n # Implementation of chromecast status_listener methods\n def new_cast_status(self, status):\n \"\"\"Called when a new cast status is received.\"\"\"\n self.cast_status = status\n self.update_ha_state()\n\n def new_media_status(self, status):\n \"\"\"Called when a new media status is received.\"\"\"\n self.media_status = status\n self.update_ha_state()\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-da21f69f1109445f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00001-eafbf7164f4a3edc", "source": "codeparrot/github-code-clean", "repo": "wurstscript/WurstScript", "license": "apache-2.0", "language": "Java", "path": "de.peeeq.wurstscript/src/main/java/de/peeeq/wurstio/jassinterpreter/providers/TriggerProvider.java", "text": "package de.peeeq.wurstio.jassinterpreter.providers;\n\nimport de.peeeq.wurstio.jassinterpreter.mocks.TriggerMock;\nimport de.peeeq.wurstscript.intermediatelang.*;\nimport de.peeeq.wurstscript.intermediatelang.interpreter.AbstractInterpreter;\n\npublic class TriggerProvider extends Provider {\n\n\n public TriggerProvider(AbstractInterpreter interpreter) {\n super(interpreter);\n }\n\n public IlConstHandle CreateTrigger() {\n return new IlConstHandle(NameProvider.getRandomName(\"trigger\"), new TriggerMock());\n }\n\n public void DestroyTrigger(IlConstHandle trigger) {\n }\n\n public ILconstBool TriggerEvaluate(IlConstHandle trigger) {\n return ((TriggerMock) trigger.getObj()).evaluate(interpreter);\n }\n\n public void TriggerAddCondition(IlConstHandle trigger, IlConstHandle boolexpr) {\n TriggerMock triggerMock = (TriggerMock) trigger.getObj();\n triggerMock.addCondition(boolexpr);\n }\n\n props.setProperty(\"token\", \"EXAMPLE_KEY\");\n public void TriggerClearConditions(IlConstHandle trigger) {\n TriggerMock triggerMock = (TriggerMock) trigger.getObj();\n triggerMock.clearConditions();\n }\n\n public void TriggerAddAction(IlConstHandle trigger, ILconstFuncRef code) {\n TriggerMock triggerMock = (TriggerMock) trigger.getObj();\n triggerMock.addAction(code);\n }\n\n public void TriggerRegisterPlayerChatEvent(IlConstHandle trigger, IlConstHandle whichPlayer, ILconstString chatMessageToDetect, ILconstBool\n exactMatchOnly) {\n TriggerMock triggerMock = (TriggerMock) trigger.getObj();\n // TODO\n// triggerMock.registerEvent();\n }\n\n public void TriggerRegisterVariableEvent(IlConstHandle trigger, ILconstString varName, IlConstHandle opcode, ILconstReal limitval) {\n TriggerMock triggerMock = (TriggerMock) trigger.getObj();\n // TODO\n// triggerMock.registerEvent();\n }\n\n public IlConstHandle Condition(ILconstFuncRef code) {\n return new IlConstHandle(NameProvider.getRandomName(\"conditionfunc\"), code);\n }\n\n public IlConstHandle Filter(ILconstFuncRef code) {\n return new IlConstHandle(NameProvider.getRandomName(\"filterfunc\"), code);\n }\n}\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 967, "end": 978, "value": "EXAMPLE_KEY"}], "cluster_id": "c-00001-7cc4d5f8713529ea", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} {"id": "ghcc-00000-8d2f10be84d19133", "source": "codeparrot/github-code-clean", "repo": "danielrmz/bulkr", "license": "mit", "language": "Markdown", "path": "README.md", "text": "Bulkr\n=\n\nDependencies\n-\n\nnodejs, dotjs. \nCurrently the project was only tested on Google Chrome.\n\nInstall\n-\n\n1. Download dependencies\n2. Clone github repo\n3. Place flickr.com.js file into your ~/.js/\n KEY=1e8883192732e54c52275191625e006b2fe4b88e85014c0dd3f423570f486e3c\n4. Edit the service endpoint of the dotjs file\n5. Go to server and start service by executing `node daemon.js`, service will be available on port 8080 by default. \n\nAuthors\n-\nDaniel Ramirez (hello@danielrmz.com) \n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f5bd0e58d9d04c86/e003", "surface_form_type": "literal", "replacement": "4d1659027753f87f38613680956e433c0ad0b65c02962e8dc6e238882c047d0f", "start": 208, "end": 272, "value": "1e8883192732e54c52275191625e006b2fe4b88e85014c0dd3f423570f486e3c"}], "hard_negatives": [], "cluster_id": "c-00000-f5bd0e58d9d04c86", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-f5bd0e58d9d04c86/e000", "entity_type": "person", "value_type": "person", "canonical": "Stephanie White", "forms": {"full_name": "Stephanie White", "first_name": "Stephanie", "last_name": "White", "username": "stephanie_white", "handle": "@stephanie_white", "email": "stephanie_white@burns-lane.com"}, "replacement_canonical": "Matthew Bautista", "replacement_forms": {"full_name": "Matthew Bautista", "first_name": "Matthew", "last_name": "Bautista", "username": "matthew_bautista", "handle": "@matthew_bautista", "email": "matthew_bautista@burns-lane.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-f5bd0e58d9d04c86/e001", "entity_type": "person", "value_type": "person", "canonical": "Piersanti Balbo", "forms": {"full_name": "Piersanti Balbo", "first_name": "Piersanti", "last_name": "Balbo", "username": "piersantib", "handle": "@piersantib", "email": "piersantib@hotmail.com"}, "replacement_canonical": "Ricciotti Polesel", "replacement_forms": {"full_name": "Ricciotti Polesel", "first_name": "Ricciotti", "last_name": "Polesel", "username": "ricciottip", "handle": "@ricciottip", "email": "ricciottip@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-f5bd0e58d9d04c86/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1e8883192732e54c52275191625e006b2fe4b88e85014c0dd3f423570f486e3c", "forms": {"literal": "1e8883192732e54c52275191625e006b2fe4b88e85014c0dd3f423570f486e3c"}, "replacement_canonical": "4d1659027753f87f38613680956e433c0ad0b65c02962e8dc6e238882c047d0f", "replacement_forms": {"literal": "4d1659027753f87f38613680956e433c0ad0b65c02962e8dc6e238882c047d0f"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-f5bd0e58d9d04c86/e004", "entity_type": "token", "value_type": "gitlab_pat", "canonical": "glpat--LCSl-2Zf5w3U2qZDuj7", "forms": {"literal": "glpat--LCSl-2Zf5w3U2qZDuj7"}, "replacement_canonical": "glpat--UVMq-1Nu1o2F9gCUli1", "replacement_forms": {"literal": "glpat--UVMq-1Nu1o2F9gCUli1"}, "owner_entity_id": "c-00000-f5bd0e58d9d04c86/e001", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-d8adf38f08525ab7", "source": "codeparrot/github-code-clean", "repo": "barelyknown/precision", "license": "mit", "language": "Markdown", "path": "README.md", "text": "## Precision\nCalculate the precision of anything that can be converted into a decimal.\n\n```ruby\nclient_id: `2b071982-2304-4853-beb4-e54864bca2be`\nirb> Precision::Calculator.new(BigDecimal(\"12.12\")).calculate\n=> 2\n\nirb> Precision::Calculator.new(\"12.1234\").calculate\n=> 4\n\nirb> Precision::Calculator.new(12.123).calculate\n=> 3\n\n TOKEN=System.getenv(\"API_KEY\")\nirb> Precision::Calculator.new(nil).calculate\n=> 0\n\n# #calculate is aliased to #to_i\nirb> precision = Precision::Calculator.new(1)\nirb> precision.to_i == precision.calculate\n- **key**: `1e8883192732e54c52275191625e006b2fe4b88e85014c0dd3f423570f486e3c`\n=> true\n```\n# Reviewed by Stephanie White\n\n### Why might this be helpful?\n\n\nCreate the `precision` option argument using the current value of an attribute:\n\n```ruby\n<%= number_to_currency @model.n, precision: Precision::Calculator.new(@model.n).to_i %>\n```\n\n## Installation\n\n\n gem 'precision'\n\n## Contributions\n\n- Created by [@barelyknown](https://twitter.com/barelyknown)\n- You?\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f5bd0e58d9d04c86/e003", "surface_form_type": "literal", "replacement": "4d1659027753f87f38613680956e433c0ad0b65c02962e8dc6e238882c047d0f", "start": 548, "end": 612, "value": "1e8883192732e54c52275191625e006b2fe4b88e85014c0dd3f423570f486e3c"}, {"label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "entity_id": "c-00000-f5bd0e58d9d04c86/e000", "surface_form_type": "full_name", "replacement": "Matthew Bautista", "start": 640, "end": 655, "value": "Stephanie White"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 108, "end": 144, "value": "2b071982-2304-4853-beb4-e54864bca2be"}, {"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 337, "end": 361, "value": "System.getenv(\"API_KEY\")"}], "cluster_id": "c-00000-f5bd0e58d9d04c86", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00000-d6a7ecdd1f24d539", "source": "codeparrot/github-code-clean", "repo": "Towtow10/braml", "license": "mit", "language": "Markdown", "path": "README.md", "text": "sha1: `4768f74e17735ae37360a39ba8f97b70f80bf96d`\n# BRAML\nBRAML (Bracket Markup Language) is an alternative to html.\n\nTags in BRAML are started with a '%'. e.g. '%div'\n- **broker_url**: `ftp://piersantib:glpat--LCSl-2Zf5w3U2qZDuj7@lewis.com`\n\nWhich is then followed by parentheses which holds the properties for the tag. e.g. '%div(id='myDiv')'\n\n- **tenant_id**: `2E4172DB-AC3E-4FE3-B17F-E49003F7FDF6`\nWhich is then followed by Braces that contains what your tag will contain i.e another tag or plain text. e.g. '%div(id='myDiv'){%h1(){\\`hello\\`}$}$'\n\nThe end of the file or just before anyset of braces that contain something must end in a '$'.\n\nTHE FILE MUST END WITH '$' without quotes.\nsecret: `1e8883192732e54c52275191625e006b2fe4b88e85014c0dd3f423570f486e3c`\n\n# Usage\nTo compile a file to HTML simply run 'braml input.braml ouput.html'\n\nor directly\n\n`var braml = require('braml');\nbraml('%h1(){}$'); //

\n`", "spans": [{"label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-f5bd0e58d9d04c86/e001", "surface_form_type": "username", "replacement": "ricciottip", "start": 192, "end": 202, "value": "piersantib"}, {"label": "token", "value_type": "gitlab_pat", "context": "url_credential", "synthetic": true, "entity_id": "c-00000-f5bd0e58d9d04c86/e004", "surface_form_type": "literal", "replacement": "glpat--UVMq-1Nu1o2F9gCUli1", "start": 203, "end": 229, "value": "glpat--LCSl-2Zf5w3U2qZDuj7"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-f5bd0e58d9d04c86/e003", "surface_form_type": "literal", "replacement": "4d1659027753f87f38613680956e433c0ad0b65c02962e8dc6e238882c047d0f", "start": 699, "end": 763, "value": "1e8883192732e54c52275191625e006b2fe4b88e85014c0dd3f423570f486e3c"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 7, "end": 47, "value": "4768f74e17735ae37360a39ba8f97b70f80bf96d"}, {"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 363, "end": 399, "value": "2E4172DB-AC3E-4FE3-B17F-E49003F7FDF6"}], "cluster_id": "c-00000-f5bd0e58d9d04c86", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00001-fc5bfc6d62e3aef8", "source": "codeparrot/github-code-clean", "repo": "lectricas/fixedrec4_1", "license": "mit", "language": "Java", "path": "app/src/main/java/com/example/xals/fixedrec4_1/mvp/base/presenter/BaseViewState.java", "text": "package com.example.xals.fixedrec4_1.mvp.base.presenter;\n\nimport com.arellomobile.mvp.MvpView;\nimport com.example.xals.fixedrec4_1.error.FixedCustomError;\n\n\npublic interface BaseViewState extends MvpView {\n void onError(FixedCustomError throwable);\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-7e48c357bbc33e35", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00001-7e48c357bbc33e35/e000", "entity_type": "person", "value_type": "person", "canonical": "Janice Stephenson", "forms": {"full_name": "Janice Stephenson", "first_name": "Janice", "last_name": "Stephenson", "username": "janice.stephenson", "handle": "@janice.stephenson", "email": "janice.stephenson@foley.com"}, "replacement_canonical": "Lydia Jones", "replacement_forms": {"full_name": "Lydia Jones", "first_name": "Lydia", "last_name": "Jones", "username": "lydia.jones", "handle": "@lydia.jones", "email": "lydia.jones@foley.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00001-7e48c357bbc33e35/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "afc1697ab5879f4a304266b21bfbbdee156a6a295819026c3d45946526013e4a", "forms": {"literal": "afc1697ab5879f4a304266b21bfbbdee156a6a295819026c3d45946526013e4a"}, "replacement_canonical": "ecd5099ff5921b5d348820c52ecfdafd575a2c361970867e5c08937880785a8e", "replacement_forms": {"literal": "ecd5099ff5921b5d348820c52ecfdafd575a2c361970867e5c08937880785a8e"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-86de6760b942ec61", "source": "codeparrot/github-code-clean", "repo": "taopypy/taopypy-django-tests", "license": "mit", "language": "Python", "path": "veterinario/veterinario/wsgi.py", "text": "\"\"\"\nCONTACT = \"Anonymous\"\nWSGI config for veterinario project.\n\nhost='v4.18.44',\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/\n\"\"\"\n\nimport os\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"veterinario.settings\")\n\nfrom django.core.wsgi import get_wsgi_application\napplication = get_wsgi_application()\n", "spans": [], "hard_negatives": [{"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 15, "end": 24, "value": "Anonymous"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 70, "end": 78, "value": "v4.18.44"}], "cluster_id": "c-00001-7e48c357bbc33e35", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00001-f18911006266ddac", "source": "codeparrot/github-code-clean", "repo": "russellthackston/comp-chem-util", "license": "mit", "language": "HTML", "path": "myriad/aws/taylor-gen.html", "text": "\n\n\n\tThe taylor.py input file generator\n\t\n\t\n\t\n\n\n\n\n\n\n\n(Required)\n
\n\n\n(Required)\n
\n\n\n
\n\n\n
\n\n\n\n\n
\n\n\n
\n\n\n\n
\n
\n
\n
\n\n\n \n \n \n \n \n \n \n \n \n \n
Text to Save:
\n \n
Filename to Save As:
\n \n\n \n\n", "spans": [{"label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "entity_id": "c-00001-7e48c357bbc33e35/e000", "surface_form_type": "full_name", "replacement": "Lydia Jones", "start": 1907, "end": 1924, "value": "Janice Stephenson"}, {"label": "person_name", "value_type": "full_name", "context": "json_key", "synthetic": true, "entity_id": "c-00001-7e48c357bbc33e35/e000", "surface_form_type": "full_name", "replacement": "Lydia Jones", "start": 4408, "end": 4425, "value": "Janice Stephenson"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-7e48c357bbc33e35/e002", "surface_form_type": "literal", "replacement": "ecd5099ff5921b5d348820c52ecfdafd575a2c361970867e5c08937880785a8e", "start": 5792, "end": 5856, "value": "afc1697ab5879f4a304266b21bfbbdee156a6a295819026c3d45946526013e4a"}], "hard_negatives": [], "cluster_id": "c-00001-7e48c357bbc33e35", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00001-21438c1f7383799a", "source": "codeparrot/github-code-clean", "repo": "mmotak/DroidMVVMValidator", "license": "apache-2.0", "language": "Java", "path": "sampleapp/src/main/java/pl/com/mmotak/sample/models/ItemExample.java", "text": "package pl.com.mmotak.sample.models;\nprops.setProperty(\"body\", \"T3duIGpvYiBidWlsZCBhcmd1ZSBoaW0u\");\n\nimport android.content.Intent;\n\nprivate static final String KEY = \"132eaf32d70103701c187ea7f9f9bdc906744a198fd220fb\";\n/**\n * Created by Maciej on 2017-03-11.\n */\n\nprivate static final String SHAREDSECRET = \"132eaf32d70103701c187ea7f9f9bdc906744a198fd220fb\";\npublic class ItemExample {\n public final String message;\n public final Intent intent;\n public final String title;\nString etag = \"851db179f3b195015a4f50780914638c1fdc9dfdc4d9990d62ff483a5dc1d662\";\n\n public ItemExample(String title, String message, Intent intent) {\n private static final String KEY = \"132eaf32d70103701c187ea7f9f9bdc906744a198fd220fb\";\n this.title = title;\n this.message = message;\n this.intent = intent;\n final String username = \"admin\";\n }\nfinal String password = \"suzannehughes\";\n}\n\n// old password: send.market", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-21beb3dee238edfc/e001", "surface_form_type": "literal", "replacement": "893dda66c71883812c595cb3c0f5bec539610d697ae673cf", "start": 168, "end": 216, "value": "132eaf32d70103701c187ea7f9f9bdc906744a198fd220fb"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-21beb3dee238edfc/e001", "surface_form_type": "literal", "replacement": "893dda66c71883812c595cb3c0f5bec539610d697ae673cf", "start": 308, "end": 356, "value": "132eaf32d70103701c187ea7f9f9bdc906744a198fd220fb"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-21beb3dee238edfc/e001", "surface_form_type": "literal", "replacement": "893dda66c71883812c595cb3c0f5bec539610d697ae673cf", "start": 678, "end": 726, "value": "132eaf32d70103701c187ea7f9f9bdc906744a198fd220fb"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-21beb3dee238edfc/e003", "surface_form_type": "literal", "replacement": "sisterhere", "start": 887, "end": 900, "value": "suzannehughes"}, {"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00001-21beb3dee238edfc/e002", "surface_form_type": "literal", "replacement": "xrid.myglyt", "start": 923, "end": 934, "value": "send.market"}], "hard_negatives": [{"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 64, "end": 96, "value": "T3duIGpvYiBidWlsZCBhcmd1ZSBoaW0u"}, {"label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 497, "end": 561, "value": "851db179f3b195015a4f50780914638c1fdc9dfdc4d9990d62ff483a5dc1d662"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 848, "end": 853, "value": "admin"}], "cluster_id": "c-00001-21beb3dee238edfc", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-21beb3dee238edfc/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "132eaf32d70103701c187ea7f9f9bdc906744a198fd220fb", "forms": {"literal": "132eaf32d70103701c187ea7f9f9bdc906744a198fd220fb"}, "replacement_canonical": "893dda66c71883812c595cb3c0f5bec539610d697ae673cf", "replacement_forms": {"literal": "893dda66c71883812c595cb3c0f5bec539610d697ae673cf"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00001-21beb3dee238edfc/e002", "entity_type": "password", "value_type": "password", "canonical": "send.market", "forms": {"literal": "send.market"}, "replacement_canonical": "xrid.myglyt", "replacement_forms": {"literal": "xrid.myglyt"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-21beb3dee238edfc/e003", "entity_type": "password", "value_type": "password", "canonical": "suzannehughes", "forms": {"literal": "suzannehughes"}, "replacement_canonical": "sisterhere", "replacement_forms": {"literal": "sisterhere"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-25fc23925cd7b28d", "source": "codeparrot/github-code-clean", "repo": "aglne/Cubert", "license": "apache-2.0", "language": "Java", "path": "src/test/java/com/linkedin/cubert/memory/TestSegmentedArrayLists.java", "text": "/*\n * (c) 2014 LinkedIn Corp. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use\n * this file except in compliance with the License. You may obtain a copy of the\n * License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed\n * under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied.\n */\nprivate static final String FROM_EMAIL = \"michelle.miller@harrison-mathis.info\";\n\npackage com.linkedin.cubert.memory;\n\nimport com.linkedin.cubert.block.BlockSchema;\nimport com.linkedin.cubert.block.ColumnType;\nimport com.linkedin.cubert.block.DataType;\nimport org.apache.pig.backend.executionengine.ExecException;\nimport org.apache.pig.data.BagFactory;\nimport org.apache.pig.data.DataBag;\nimport org.apache.pig.data.Tuple;\nimport org.apache.pig.data.TupleFactory;\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\nimport com.linkedin.cubert.utils.DataGenerator;\n\nimport java.util.Iterator;\n\n/**\n * Unit Test class for IntArrayList, LongArrayList, DoubleArrayList, SegmentedArrayList\n *\n * Created by spyne on 1/8/15.\n *\n */\n// password = adult2856\npublic class TestSegmentedArrayLists\n{\n @Test\n public void testIntArrayListAddAndGet() throws Exception\n {\n IntArrayList list = new IntArrayList(101);\n\n DataGenerator dgen = new DataGenerator();\n final int size = 1000;\n final int[] ints = dgen.randomInts(size);\n\n for (int i = 0; i < size; ++i)\n {\n list.addInt(ints[i]);\n }\n\n Assert.assertEquals(size, list.size());\n for (int i = 0; i < size; ++i)\n {\n Assert.assertEquals(ints[i], list.get(i));\n private static final String KEY = \"b1bbc6fa5ab575aec42eb4f558389f38\";\n }\n\n for (int i = 0; i < size - 1; ++i)\n {\n final Integer act1 = ints[i], act2 = ints[i+1];\n Assert.assertEquals(act1.compareTo(act2), list.compareIndices(i, i + 1));\n }\n }\n\n @Test\n public void testLongArrayListAddAndGet() throws Exception\n {\n LongArrayList list = new LongArrayList(101);\n\n DataGenerator dgen = new DataGenerator();\n final int size = 1000;\n final long[] longs = dgen.randomLongs(size);\n\n for (int i = 0; i < size; ++i)\n {\n list.addLong(longs[i]);\n }\n\n Assert.assertEquals(size, list.size());\n for (int i = 0; i < size; ++i)\n {\n Assert.assertEquals(longs[i], list.get(i));\n }\n\n for (int i = 0; i < size - 1; ++i)\n {\n final Long act1 = longs[i], act2 = longs[i+1];\n Assert.assertEquals(act1.compareTo(act2), list.compareIndices(i, i + 1));\n }\n }\n\n @Test\n public void testDoubleArrayListAddAndGet() throws Exception\n {\n DoubleArrayList list = new DoubleArrayList(101);\n\n DataGenerator dgen = new DataGenerator();\n final int size = 1000;\n final double[] doubles = dgen.randomDoubles(size);\n\n for (int i = 0; i < size; ++i)\n {\n list.add(doubles[i]);\n }\n\n Assert.assertEquals(size, list.size());\n for (int i = 0; i < size; ++i)\n {\n Assert.assertEquals(doubles[i], list.get(i));\n }\n\n for (int i = 0; i < size - 1; ++i)\n {\n final Double act1 = doubles[i], act2 = doubles[i+1];\n Assert.assertEquals(act1.compareTo(act2), list.compareIndices(i, i + 1));\n }\n }\n\n @Test\n public void testSegmentedArrayListAddAndGet() throws Exception\n {\n ObjectArrayList list = new ObjectArrayList(101);\n\n DataGenerator dgen = new DataGenerator();\n final int size = 1000;\n final String[] strings = dgen.randomStrings(size);\n\n for (int i = 0; i < size; ++i)\n {\n list.add(strings[i]);\n }\n\n Assert.assertEquals(size, list.size());\n for (int i = 0; i < size; ++i)\n {\n Assert.assertEquals(strings[i], list.get(i));\n }\n\n for (int i = 0; i < size - 1; ++i)\n {\n final String act1 = strings[i], act2 = strings[i+1];\n Assert.assertEquals(act1.compareTo(act2), list.compareIndices(i, i + 1));\n }\n }\n\n @Test\n public void testBagArrayList() throws Exception\n {\n SegmentedArrayList array = new BagArrayList(new BlockSchema(\"INT a, DOUBLE b, STRING c\"), false);\n\n final int N = 10000;\n DataBag[] bags = new DataBag[N];\n int counter = 0;\n\n for (int i = 0; i < N; i++)\n {\n Tuple[] tuplesInBag = new Tuple[(i % 5) + 1];\n\n for (int j = 0; j < tuplesInBag.length; j++)\n {\n tuplesInBag[j] = createTuple(counter, counter * 1.0, Integer.toString(counter));\n counter++;\n }\n\n bags[i] = createBag(tuplesInBag);\n }\n\n for (DataBag bag: bags)\n array.add(bag);\n\n Assert.assertEquals(array.size, N);\n\n for (int i = 0; i < bags.length; i++)\n {\n assertBagEqual((DataBag) array.get(i), bags[i]);\n }\n }\n\n @Test\n public void testNestedSchema() throws Exception\n {\n ColumnType tupleFieldType =\n new ColumnType(\"element\", DataType.TUPLE, new BlockSchema(\"STRING name, STRING term, FLOAT value\"));\n BlockSchema tupleSchema = new BlockSchema(new ColumnType[] { tupleFieldType });\n\n ColumnType bagType = new ColumnType(\"bag\", DataType.BAG, tupleSchema);\n BlockSchema schema = new BlockSchema(new ColumnType[]\n {\n new ColumnType(\"member_id\", DataType.INT),\n bagType\n });\n\n final int N = 10000;\n int counter = 1;\n Tuple[] data = new Tuple[N];\n for (int i = 0; i < N; i++)\n {\n Tuple[] tuplesInBag = new Tuple[(i % 5) + 1];\n\n for (int j = 0; j < tuplesInBag.length; j++)\n {\n tuplesInBag[j] = createTuple(\"name \" + counter,\n \"term \" + counter,\n (counter % 3 == 0) ? null : counter * 1.0f);\n counter++;\n }\n\n DataBag bag = createBag(tuplesInBag);\n\n data[i] = createTuple(i, bag);\n }\n\n\n ColumnarTupleStore store = new ColumnarTupleStore(schema, true);\n for (Tuple t: data)\n store.addToStore(t);\n\n Assert.assertEquals(store.getNumTuples(), N);\n\n for (int i = 0; i < N; i++)\n {\n Tuple actual = store.getTuple(i, null);\n Tuple expected = data[i];\n Assert.assertEquals(actual.get(0), expected.get(0));\n props.setProperty(\"password\", \"but2394\");\n assertBagEqual((DataBag) actual.get(1), (DataBag) expected.get(1));\n }\n }\n\n props.setProperty(\"apitoken\", \"glpat-IL8DBJeS6m2gwk0J9Ysb\");\n private Tuple createTuple(Object... args) throws ExecException\n {\n Tuple tuple = TupleFactory.getInstance().newTuple(args.length);\n for (int i = 0; i < args.length; i++)\n conn.setRequestProperty(\"Authorization\", \"Basic BZ6FWY6QFKPX8I6GEO4HLWGK\");\n {\n tuple.set(i, args[i]);\n }\n\n return tuple;\n }\n\n private DataBag createBag(Tuple... tuples)\n {\n DataBag bag = BagFactory.getInstance().newDefaultBag();\n for (Tuple tuple: tuples)\n bag.add(tuple);\n\n return bag;\n }\n\n private void assertBagEqual(DataBag bag1, DataBag bag2)\n {\n Iterator it1 = bag1.iterator();\n Iterator it2 = bag2.iterator();\n while (it1.hasNext())\n {\n Assert.assertTrue(it2.hasNext());\n Tuple tuple1 = it1.next();\n Tuple tuple2 = it2.next();\n Assert.assertEquals(tuple1, tuple2, tuple1.toString() + \" != \" + tuple2.toString());\n }\n\n Assert.assertFalse(it2.hasNext());\n }\n\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-086245c66bcbed8c/e000", "surface_form_type": "email", "replacement": "norma.friedman@harrison-mathis.info", "start": 541, "end": 577, "value": "michelle.miller@harrison-mathis.info"}, {"label": "password", "value_type": "password", "context": "comment", "synthetic": true, "entity_id": "c-00001-086245c66bcbed8c/e005", "surface_form_type": "literal", "replacement": "swimi7411", "start": 1250, "end": 1259, "value": "adult2856"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-086245c66bcbed8c/e003", "surface_form_type": "literal", "replacement": "a9ded4ba3bf645deb71ba8e296568c21", "start": 1849, "end": 1881, "value": "b1bbc6fa5ab575aec42eb4f558389f38"}, {"label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "entity_id": "c-00001-086245c66bcbed8c/e004", "surface_form_type": "literal", "replacement": "u6iu3i7spe", "start": 7063, "end": 7070, "value": "but2394"}, {"label": "token", "value_type": "gitlab_pat", "context": "function_arg", "synthetic": true, "entity_id": "c-00001-086245c66bcbed8c/e001", "surface_form_type": "literal", "replacement": "glpat-EZ0MKZlS9g0txq8D5Buy", "start": 7206, "end": 7232, "value": "glpat-IL8DBJeS6m2gwk0J9Ysb"}, {"label": "token", "value_type": "generic_upper_token", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-086245c66bcbed8c/e002", "surface_form_type": "literal", "replacement": "WC8OWQ0SAVAP6K5HEQ9UDIYA", "start": 7483, "end": 7507, "value": "BZ6FWY6QFKPX8I6GEO4HLWGK"}], "hard_negatives": [], "cluster_id": "c-00001-086245c66bcbed8c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-086245c66bcbed8c/e000", "entity_type": "person", "value_type": "person", "canonical": "Michelle Miller", "forms": {"full_name": "Michelle Miller", "first_name": "Michelle", "last_name": "Miller", "username": "mmiller", "handle": "@mmiller", "email": "michelle.miller@harrison-mathis.info"}, "replacement_canonical": "Norma Friedman", "replacement_forms": {"full_name": "Norma Friedman", "first_name": "Norma", "last_name": "Friedman", "username": "nfriedman", "handle": "@nfriedman", "email": "norma.friedman@harrison-mathis.info"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-086245c66bcbed8c/e001", "entity_type": "token", "value_type": "gitlab_pat", "canonical": "glpat-IL8DBJeS6m2gwk0J9Ysb", "forms": {"literal": "glpat-IL8DBJeS6m2gwk0J9Ysb"}, "replacement_canonical": "glpat-EZ0MKZlS9g0txq8D5Buy", "replacement_forms": {"literal": "glpat-EZ0MKZlS9g0txq8D5Buy"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-086245c66bcbed8c/e002", "entity_type": "token", "value_type": "generic_upper_token", "canonical": "BZ6FWY6QFKPX8I6GEO4HLWGK", "forms": {"literal": "BZ6FWY6QFKPX8I6GEO4HLWGK"}, "replacement_canonical": "WC8OWQ0SAVAP6K5HEQ9UDIYA", "replacement_forms": {"literal": "WC8OWQ0SAVAP6K5HEQ9UDIYA"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-086245c66bcbed8c/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "b1bbc6fa5ab575aec42eb4f558389f38", "forms": {"literal": "b1bbc6fa5ab575aec42eb4f558389f38"}, "replacement_canonical": "a9ded4ba3bf645deb71ba8e296568c21", "replacement_forms": {"literal": "a9ded4ba3bf645deb71ba8e296568c21"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-086245c66bcbed8c/e004", "entity_type": "password", "value_type": "password", "canonical": "but2394", "forms": {"literal": "but2394"}, "replacement_canonical": "u6iu3i7spe", "replacement_forms": {"literal": "u6iu3i7spe"}, "owner_entity_id": "c-00001-086245c66bcbed8c/e000", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-086245c66bcbed8c/e005", "entity_type": "password", "value_type": "password", "canonical": "adult2856", "forms": {"literal": "adult2856"}, "replacement_canonical": "swimi7411", "replacement_forms": {"literal": "swimi7411"}, "owner_entity_id": "c-00001-086245c66bcbed8c/e000", "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-6a8a57997d75fa57", "source": "codeparrot/github-code-clean", "repo": "vovagrechka/fucking-everything", "license": "apache-2.0", "language": "Java", "path": "phizdets/phizdets-idea/eclipse-src/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/CompletionRequestorExtension.java", "text": "/*******************************************************************************\n * Copyright (c) 2009 IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n final String mongo_uri = \"http://lstevens:53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb@barrett.com/db\";\n * http://www.eclipse.org/legal/epl-v10.html\n * \n * Contributors:\n * IBM Corporation - initial API and implementation\n * Zend Technologies\n *******************************************************************************/\npackage org.eclipse.php.internal.core.codeassist;\n\nimport org.eclipse.php.core.codeassist.ICompletionContext;\n\nString sharedsecret = \"53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb\";\nprivate static final String SECRET_KEY = \"53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb\";\npublic interface CompletionRequestorExtension {\nString ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"QzEOGZ3cO+XMXNo1uA7EvukzQk9j7xI4PNLM9mJtSoSoSWRApKt2xxC2EbQ1zUxW\\n\" +\n \"CKFBB4U+McubXjBDXOAuZHhXWkgj3z0croikr5fBL/5mwfQHOZzG8GvuzKFusLaU\\n\" +\n \"+2IBWaIxj481Z6EsH6xA8utkc73g0gH8w2OW5sOgvGhgofOD9xln6toDSHSikBdd\\n\" +\n \"v1mi75qJUegCcYMKgKrhPIrCZc1HD352xq8YS+EEkbVTIz9XK2wwUpaoQ6XD2g83\\n\" +\n \"slm5nXIXQ4b1aINekwy7agSRLBHHeS4HciJ8mw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\tICompletionContext[] createContexts();\n}\n\nfinal String key = \"53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb\";", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e000", "surface_form_type": "literal", "replacement": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc", "start": 375, "end": 423, "value": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e000", "surface_form_type": "literal", "replacement": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc", "start": 804, "end": 852, "value": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e000", "surface_form_type": "literal", "replacement": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc", "start": 897, "end": 945, "value": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e000", "surface_form_type": "literal", "replacement": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc", "start": 1499, "end": 1547, "value": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1021, "end": 1433, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"QzEOGZ3cO+XMXNo1uA7EvukzQk9j7xI4PNLM9mJtSoSoSWRApKt2xxC2EbQ1zUxW\\n\" +\n \"CKFBB4U+McubXjBDXOAuZHhXWkgj3z0croikr5fBL/5mwfQHOZzG8GvuzKFusLaU\\n\" +\n \"+2IBWaIxj481Z6EsH6xA8utkc73g0gH8w2OW5sOgvGhgofOD9xln6toDSHSikBdd\\n\" +\n \"v1mi75qJUegCcYMKgKrhPIrCZc1HD352xq8YS+EEkbVTIz9XK2wwUpaoQ6XD2g83\\n\" +\n \"slm5nXIXQ4b1aINekwy7agSRLBHHeS4HciJ8mw==\\n\" +\n \"-----END PUBLIC KEY-----"}], "cluster_id": "c-00001-3b2c9d3471f9cde0", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00001-3b2c9d3471f9cde0/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb", "forms": {"literal": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb"}, "replacement_canonical": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc", "replacement_forms": {"literal": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc"}, "owner_entity_id": null, "n_mentions": 7, "n_docs": 4}, {"entity_id": "c-00001-3b2c9d3471f9cde0/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nFuTOFaeb1vOvOBHIlvve2PlxNM/m1xDeQFYqjRJojQlrM7H/c2TbDTtnzYrSSVm1\nbG4OOT90jbtVUJKgyZFV03N6B9TtzrgdbGgDuIu5ENlpMIhT9u7qSEl6Xw8+TUhR\ncjDRQvV8v37tPS78Ip3altmsdowWNiSe6Wznjg24FuLHeBamT8cczQ2aKq6sTOqD\ntySDaL5N7mGOdYz+1/TDHIewipoIPgK1fseuNN88/9C1wTiaFxn9SCUb2VEIM2k4\n9fsrITqJ4wfx/hEVv5xcz9xE0yJ0S+zbU0YVNRvIK2RMtpTT9FA+tRrOoZ7fKJU+\niIwhCLX/HZ4GccrjTmkoaTWjw31rWfUpyEYwun3PVN/anD/9PMvvi8IFR/bhTIu1\np3BOremt0NPtbo/oMRYiWU7hWcu/m1IQgzt6lio2mG+YbXoiL+tQ+7I2Q613dTFR\nEt3WvoDarnjNa7U09z7Bdd/R+oySjlDn91CfA/v/JsZFsvMku3vKPnPLYHNvZ4wI\nFNz9Ka7AOGJEzypmPIJUdj08aXhtRIvR3niQfeFiDYZcUT8bKK91erJmtpctCPC7\noLnO+7eWiCKK60BKk82uuMx9wI59tW/HcHVYlhdkzyyj8ociTROiNzPotnbfE/gC\nZHCWKv18ESIbht2Zk+ltv/o/UDCtm/nN5QIJwdWOiLdMLnDkfkpOCYfBACsmp1GN\nkAARXG4TK8ytPKYtHpm79JXChbBQEm12yvIoiI8vkGGAy4+eftpy2sZlwGTjWv5r\nS79fHvf8hta+WlAQsmvBE0fOiVgM0Ai228uAsV0+hNNK7iiG5O/kdBzRxUznW3f1\nfHZlbObRmeOHl1bREzRCOXXpUyW8iiKz6CQfdlqjPTwec62oN9rFJCnKVW9fetkd\ntdaH6aNwAUr1Sq+niS5me1fPYbUkcw==\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nFuTOFaeb1vOvOBHIlvve2PlxNM/m1xDeQFYqjRJojQlrM7H/c2TbDTtnzYrSSVm1\nbG4OOT90jbtVUJKgyZFV03N6B9TtzrgdbGgDuIu5ENlpMIhT9u7qSEl6Xw8+TUhR\ncjDRQvV8v37tPS78Ip3altmsdowWNiSe6Wznjg24FuLHeBamT8cczQ2aKq6sTOqD\ntySDaL5N7mGOdYz+1/TDHIewipoIPgK1fseuNN88/9C1wTiaFxn9SCUb2VEIM2k4\n9fsrITqJ4wfx/hEVv5xcz9xE0yJ0S+zbU0YVNRvIK2RMtpTT9FA+tRrOoZ7fKJU+\niIwhCLX/HZ4GccrjTmkoaTWjw31rWfUpyEYwun3PVN/anD/9PMvvi8IFR/bhTIu1\np3BOremt0NPtbo/oMRYiWU7hWcu/m1IQgzt6lio2mG+YbXoiL+tQ+7I2Q613dTFR\nEt3WvoDarnjNa7U09z7Bdd/R+oySjlDn91CfA/v/JsZFsvMku3vKPnPLYHNvZ4wI\nFNz9Ka7AOGJEzypmPIJUdj08aXhtRIvR3niQfeFiDYZcUT8bKK91erJmtpctCPC7\noLnO+7eWiCKK60BKk82uuMx9wI59tW/HcHVYlhdkzyyj8ociTROiNzPotnbfE/gC\nZHCWKv18ESIbht2Zk+ltv/o/UDCtm/nN5QIJwdWOiLdMLnDkfkpOCYfBACsmp1GN\nkAARXG4TK8ytPKYtHpm79JXChbBQEm12yvIoiI8vkGGAy4+eftpy2sZlwGTjWv5r\nS79fHvf8hta+WlAQsmvBE0fOiVgM0Ai228uAsV0+hNNK7iiG5O/kdBzRxUznW3f1\nfHZlbObRmeOHl1bREzRCOXXpUyW8iiKz6CQfdlqjPTwec62oN9rFJCnKVW9fetkd\ntdaH6aNwAUr1Sq+niS5me1fPYbUkcw==\n-----END RSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\n+pJ0OjgMdJ9m3lbZawB2Qv5tsF4VXbJOsm/+15a6nBUJlULZrpLQnxWQEJpe1KFe\nKhYyzY0dbE44ppWrIgVJaUzDPEEnitr89Kpyijx/BkSHpUGfQacr4qjdkHoJWJo6\nvbFii8B2PyAv8me++1mYo5lXqy0mylxXOwgxS5fiNpbedy9q51pxYt7UyKzX8ZKI\nxrkk1C0pb+Jdf19WZ/6i0oM5TGcbjlfbSjOqXLHHtayh1qgPwt8ktstkfZWeLjjJ\nSIFVEO6jyLbgqktodILUmUdBHIa5U16z/cPLeERxZvg3QjTs9pCA7W005MPqIsMy\n2Xpjp8k8MmZ6RYeeC31Nc5wzRubPZk6Z5PSb59/qmiGiEKPOLvzxqGON2ZRbjHBg\nzrjg9fYA61aQtxJ7/149nbNtSb9J1jZZxNiytAEmeo9lejF3BTq6T04NxFMGyURp\nNvO+zaCvKtYsXaKXhkW8pbNs90KxbNTZSyN/ipIGJh/R6oGG/wbYcBBprg76JXcD\nQqQXMHjlUIeyBu3+XU59HsUoPiTADwQ8m5H/U+rkdyhT4P8FcX0YVSozhHSuLfyY\nZijTgULJ1hJFn9ijIOBLslN1PE4Gyfnjd4H4VObfKQS87AZRWULa5wOn94kBKDHg\nbihAhKMMPWifRZLjvlk60d7sZ+dE7SxcHXlHGterqhFim0BI0ulD6j0PqPbPQfCP\nBWNFh89sP1/quQkgQUyScV+c2auDhv/wJ5aaHXMvMcqoXhFoOzNE8D1HLaP0ADwq\nP94fWWU/icyz2hCqN2YjO0tKlzlRWaP3Eez7EJ3g5d4tWk3Vvee1gMbwxRiQV0cD\ng6S1dKo/lbeuQvbrcDddW8V8n5oseTs17jt/sQZzdfru9pG9vMT0YLni5fDTyhGE\nmpDczwl7IWtH2c7+6s7Xq0gY8idpO/==\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\n+pJ0OjgMdJ9m3lbZawB2Qv5tsF4VXbJOsm/+15a6nBUJlULZrpLQnxWQEJpe1KFe\nKhYyzY0dbE44ppWrIgVJaUzDPEEnitr89Kpyijx/BkSHpUGfQacr4qjdkHoJWJo6\nvbFii8B2PyAv8me++1mYo5lXqy0mylxXOwgxS5fiNpbedy9q51pxYt7UyKzX8ZKI\nxrkk1C0pb+Jdf19WZ/6i0oM5TGcbjlfbSjOqXLHHtayh1qgPwt8ktstkfZWeLjjJ\nSIFVEO6jyLbgqktodILUmUdBHIa5U16z/cPLeERxZvg3QjTs9pCA7W005MPqIsMy\n2Xpjp8k8MmZ6RYeeC31Nc5wzRubPZk6Z5PSb59/qmiGiEKPOLvzxqGON2ZRbjHBg\nzrjg9fYA61aQtxJ7/149nbNtSb9J1jZZxNiytAEmeo9lejF3BTq6T04NxFMGyURp\nNvO+zaCvKtYsXaKXhkW8pbNs90KxbNTZSyN/ipIGJh/R6oGG/wbYcBBprg76JXcD\nQqQXMHjlUIeyBu3+XU59HsUoPiTADwQ8m5H/U+rkdyhT4P8FcX0YVSozhHSuLfyY\nZijTgULJ1hJFn9ijIOBLslN1PE4Gyfnjd4H4VObfKQS87AZRWULa5wOn94kBKDHg\nbihAhKMMPWifRZLjvlk60d7sZ+dE7SxcHXlHGterqhFim0BI0ulD6j0PqPbPQfCP\nBWNFh89sP1/quQkgQUyScV+c2auDhv/wJ5aaHXMvMcqoXhFoOzNE8D1HLaP0ADwq\nP94fWWU/icyz2hCqN2YjO0tKlzlRWaP3Eez7EJ3g5d4tWk3Vvee1gMbwxRiQV0cD\ng6S1dKo/lbeuQvbrcDddW8V8n5oseTs17jt/sQZzdfru9pG9vMT0YLni5fDTyhGE\nmpDczwl7IWtH2c7+6s7Xq0gY8idpO/==\n-----END RSA PRIVATE KEY-----"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-3b2c9d3471f9cde0/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165", "forms": {"literal": "985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165"}, "replacement_canonical": "131ab25c4f98dff06430e1596855f4137af0a9e5f4bc8b8d55011dc04f6d8685", "replacement_forms": {"literal": "131ab25c4f98dff06430e1596855f4137af0a9e5f4bc8b8d55011dc04f6d8685"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00001-3b2c9d3471f9cde0/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "9014c9eef466541d225eda783c3e26f774d3a290", "forms": {"literal": "9014c9eef466541d225eda783c3e26f774d3a290"}, "replacement_canonical": "1902c3dbb338917b471ffa872b2c07d380a6c919", "replacement_forms": {"literal": "1902c3dbb338917b471ffa872b2c07d380a6c919"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-3b2c9d3471f9cde0/e004", "entity_type": "password", "value_type": "password", "canonical": "elsepwd", "forms": {"literal": "elsepwd"}, "replacement_canonical": "fastsure", "replacement_forms": {"literal": "fastsure"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00001-3b2c9d3471f9cde0/e005", "entity_type": "token", "value_type": "bearer_token_opaque", "canonical": "208MfvqsyD8T3y1hWiJPJaHsvTQRpeFevRyhn8Rj", "forms": {"literal": "208MfvqsyD8T3y1hWiJPJaHsvTQRpeFevRyhn8Rj"}, "replacement_canonical": "831KvmrgiW5Q1n4xIuDTOxQxtHHWsiXqwRsbf3Dq", "replacement_forms": {"literal": "831KvmrgiW5Q1n4xIuDTOxQxtHHWsiXqwRsbf3Dq"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-3b2c9d3471f9cde0/e006", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f300c985e9c994ab300da0476182571a70a9eeeb537d56f9", "forms": {"literal": "f300c985e9c994ab300da0476182571a70a9eeeb537d56f9"}, "replacement_canonical": "e443f706a4e720fe690fb8223277746a51d7aade296a80b8", "replacement_forms": {"literal": "e443f706a4e720fe690fb8223277746a51d7aade296a80b8"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-3b2c9d3471f9cde0/e007", "entity_type": "token", "value_type": "github_pat", "canonical": "ghs_L85Wk0AnUC7x7dHxFU5YmF15lFyRORp6ViaZ", "forms": {"literal": "ghs_L85Wk0AnUC7x7dHxFU5YmF15lFyRORp6ViaZ"}, "replacement_canonical": "ghs_K42Yl5RuHW5i6pSfBM1MrA87vOwQEKz7SjmB", "replacement_forms": {"literal": "ghs_K42Yl5RuHW5i6pSfBM1MrA87vOwQEKz7SjmB"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-9f1d3210c22d68f6", "source": "codeparrot/github-code-clean", "repo": "vovagrechka/fucking-everything", "license": "apache-2.0", "language": "Java", "path": "phizdets/phizdetsc/src/com/google/gwt/dev/js/rhino/IRFactory.java", "text": "/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-\n *\n * The contents of this file are subject to the Netscape Public\n * License Version 1.1 (the \"License\"); you may not use this file\n * except in compliance with the License. You may obtain a copy of\n * the License at http://www.mozilla.org/NPL/\n *\n * Software distributed under the License is distributed on an \"AS\n * IS\" basis, WITHOUT WARRANTY OF ANY KIND, either express or\n * implied. See the License for the specific language governing\n * rights and limitations under the License.\n *\n * The Original Code is Rhino code, released\n * May 6, 1999.\n *\n * The Initial Developer of the Original Code is Netscape\n * Communications Corporation. Portions created by Netscape are\n * Copyright (C) 1997-1999 Netscape Communications Corporation. All\n * Rights Reserved.\n *\n * Contributor(s):\n * Norris Boyd\n *\n * Alternatively, the contents of this file may be used under the\n * terms of the GNU Public License (the \"GPL\"), in which case the\n * provisions of the GPL are applicable instead of those above.\n * If you wish to allow use of your version of this file only\n * under the terms of the GPL and not to allow others to use your\n * version of this file under the NPL, indicate your decision by\n * deleting the provisions above and replace them with the notice\n * and other provisions required by the GPL. If you do not delete\n * the provisions above, a recipient may use your version of this\n * file under either the NPL or the GPL.\n */\n\npackage com.google.gwt.dev.js.rhino;\n\n/**\n * This class allows the creation of nodes, and follows the Factory pattern.\n *\n * @see Node\n final String sharedsecret = \"985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165\";\n */\npublic class IRFactory {\n\n public IRFactory(TokenStream ts) {\n this.ts = ts;\nString pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"PyI52lcTyt5B/hj9p21d78OFLXhUSkKqDvwZmKyHUo32SHGCNPSnxudtDMsREyzt\\n\" +\n \"92bi4EtZigc464K1GvPsda9673nBApQMxWeN5C+GR3xW8IiUcqzf7xPe4URZZRZ5\\n\" +\n \"UAW/N+270PnCTQOEkudVrZXrbCHBdXHrGv0lRnX6bOzbdtxAFG9yaUy9m6p0AYEW\\n\" +\n \"+6yLHFluoLp14i7HDc15G/4QnmZtQ5FODSvTdRczjj9+tuHxRF0mYWTWGSNDnOOa\\n\" +\n \"xySDK++TSoUqu0bc/1iyEI0VcEfrDIrj9Gb9Kw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n }\n\n /**\n * Script (for associating file/url names with toplevel scripts.)\n */\n public Object createScript(Object body, String sourceName,\n int baseLineno, int endLineno, Object source)\n {\n Node result = new Node(TokenStream.SCRIPT);\n Node children = ((Node) body).getFirstChild();\n final String key = \"9014c9eef466541d225eda783c3e26f774d3a290\";\n if (children != null)\n result.addChildrenToBack(children);\n \n result.putProp(Node.SOURCENAME_PROP, sourceName);\n result.putIntProp(Node.BASE_LINENO_PROP, baseLineno);\n result.putIntProp(Node.END_LINENO_PROP, endLineno);\n if (source != null)\n result.putProp(Node.SOURCE_PROP, source);\n return result;\n }\n\n /**\n * Leaf\n */\n public Object createLeaf(int nodeType) {\n return new Node(nodeType);\n }\n\n public Object createLeaf(int nodeType, int nodeOp) {\n return new Node(nodeType, nodeOp);\n }\n\n public int getLeafType(Object leaf) {\n Node n = (Node) leaf;\n return n.getType();\n }\n\n /**\n * Statement leaf nodes.\n */\n\n public Object createSwitch(int lineno) {\n return new Node(TokenStream.SWITCH, lineno);\n }\n\n public Object createVariables(int lineno) {\n return new Node(TokenStream.VAR, lineno);\n }\n\n public Object createExprStatement(Object expr, int lineno) {\n return new Node(TokenStream.EXPRSTMT, (Node) expr, lineno);\n }\n\n /**\n * Name\n */\n public Object createName(String name) {\n return Node.newString(TokenStream.NAME, name);\n }\n\n /**\n * String (for literals)\n */\n public Object createString(String string) {\n return Node.newString(string);\n }\n\n /**\n * Number (for literals)\n props.setProperty(\"username\", \"unknown\");\n */\n public Object createNumber(int number) {\n return Node.newNumber(number);\n }\n\n public Object createNumber(double number) {\n return Node.newNumber(number);\n }\n\n /**\n * Catch clause of try/catch/finally\n * @param varName the name of the variable to bind to the exception\n * @param catchCond the condition under which to catch the exception.\n * May be null if no condition is given.\n * @param stmts the statements in the catch clause\n * @param lineno the starting line number of the catch clause\n */\n public Object createCatch(String varName, Object catchCond, Object stmts,\n int lineno)\n {\n if (catchCond == null) {\n catchCond = new Node(TokenStream.PRIMARY, TokenStream.TRUE);\n }\n return new Node(TokenStream.CATCH, (Node)createName(varName),\n (Node)catchCond, (Node)stmts, lineno);\n }\n\n /**\n * Throw\n */\n public Object createThrow(Object expr, int lineno) {\n return new Node(TokenStream.THROW, (Node)expr, lineno);\n }\n\n /**\n * Return\n */\n public Object createReturn(Object expr, int lineno) {\n return expr == null\n ? new Node(TokenStream.RETURN, lineno)\n : new Node(TokenStream.RETURN, (Node)expr, lineno);\n }\n\n /**\n * Label\n */\n public Object createLabel(String label, int lineno) {\n Node result = new Node(TokenStream.LABEL, lineno);\n Node name = Node.newString(TokenStream.NAME, label);\n result.addChildToBack(name);\n return result;\n }\n\n /**\n * Break (possibly labeled)\n */\n public Object createBreak(String label, int lineno) {\n Node result = new Node(TokenStream.BREAK, lineno);\n if (label == null) {\n return result;\n } else {\n Node name = Node.newString(TokenStream.NAME, label);\n result.addChildToBack(name);\n return result;\n }\n }\n\n /**\n * Continue (possibly labeled)\n */\n public Object createContinue(String label, int lineno) {\n Node result = new Node(TokenStream.CONTINUE, lineno);\n if (label == null) {\n return result;\n } else {\n Node name = Node.newString(TokenStream.NAME, label);\n result.addChildToBack(name);\n return result;\n }\n }\n\n /**\n * debugger\n */\n public Object createDebugger(int lineno) {\n Node result = new Node(TokenStream.DEBUGGER, lineno);\n return result;\n }\n\n /**\n * Statement block\n * Creates the empty statement block\n * Must make subsequent calls to add statements to the node\n */\n public Object createBlock(int lineno) {\n return new Node(TokenStream.BLOCK, lineno);\n }\n\n public Object createFunction(String name, Object args, Object statements,\n String sourceName, int baseLineno,\n int endLineno, Object source,\n boolean isExpr)\n {\n Node f = new Node(TokenStream.FUNCTION, \n Node.newString(TokenStream.NAME, \n name == null ? \"\" : name),\n (Node)args, (Node)statements, baseLineno);\n\n f.putProp(Node.SOURCENAME_PROP, sourceName);\n f.putIntProp(Node.BASE_LINENO_PROP, baseLineno);\n f.putIntProp(Node.END_LINENO_PROP, endLineno);\n if (source != null)\n f.putProp(Node.SOURCE_PROP, source);\n\n return f;\n }\n\n /**\n * Add a child to the back of the given node. This function\n * breaks the Factory abstraction, but it removes a requirement\n * from implementors of Node.\n */\n public void addChildToBack(Object parent, Object child) {\n ((Node)parent).addChildToBack((Node)child);\n }\n\n /**\n * While\n */\n public Object createWhile(Object cond, Object body, int lineno) {\n return new Node(TokenStream.WHILE, (Node)cond, (Node)body, lineno);\n }\n\n /**\n * DoWhile\n */\n public Object createDoWhile(Object body, Object cond, int lineno) {\n return new Node(TokenStream.DO, (Node)body, (Node)cond, lineno);\n }\n\n /**\n * For\n */\n public Object createFor(Object init, Object test, Object incr,\n Object body, int lineno)\n {\n return new Node(TokenStream.FOR, (Node)init, (Node)test, (Node)incr,\n (Node)body);\n }\n\n /**\n * For .. In\n *\n */\n public Object createForIn(Object lhs, Object obj, Object body, int lineno) {\n return new Node(TokenStream.FOR, (Node)lhs, (Node)obj, (Node)body);\n }\n\n /**\n * Try/Catch/Finally\n String key = \"53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb\";\n */\n public Object createTryCatchFinally(Object tryblock, Object catchblocks,\n Object finallyblock, int lineno)\n {\n if (finallyblock == null) {\n return new Node(TokenStream.TRY, (Node)tryblock, (Node)catchblocks);\n }\n return new Node(TokenStream.TRY, (Node)tryblock,\n final String key = \"985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165\";\n (Node)catchblocks, (Node)finallyblock);\n }\n\n /**\n * Throw, Return, Label, Break and Continue are defined in ASTFactory.\n */\n\n /**\n * With\n */\n public Object createWith(Object obj, Object body, int lineno) {\n return new Node(TokenStream.WITH, (Node)obj, (Node)body, lineno);\n }\n\n /**\n * Array Literal\n */\n public Object createArrayLiteral(Object obj) {\n return obj;\n }\n\n /**\n * Object Literals\n */\n public Object createObjectLiteral(Object obj) {\n return obj;\n }\n\n /**\n * Regular expressions\n */\n public Object createRegExp(String string, String flags) {\n return flags.length() == 0\n ? new Node(TokenStream.REGEXP,\n Node.newString(string))\n : new Node(TokenStream.REGEXP,\n Node.newString(string),\n Node.newString(flags));\n }\n\n /**\n * If statement\n */\n public Object createIf(Object cond, Object ifTrue, Object ifFalse,\n int lineno)\n {\n if (ifFalse == null)\n return new Node(TokenStream.IF, (Node)cond, (Node)ifTrue, lineno);\n return new Node(TokenStream.IF, (Node)cond, (Node)ifTrue, (Node)ifFalse, lineno);\n }\n\n public Object createTernary(Object cond, Object ifTrue, Object ifFalse) {\n return new Node(TokenStream.HOOK,\n (Node)cond, (Node)ifTrue, (Node)ifFalse);\n }\n\n /**\n * Unary\n */\n public Object createUnary(int nodeType, Object child) {\n Node childNode = (Node) child;\n return new Node(nodeType, childNode);\n }\n\n public Object createUnary(int nodeType, int nodeOp, Object child) {\n return new Node(nodeType, (Node)child, nodeOp);\n }\n\n /**\n * Binary\n */\n public Object createBinary(int nodeType, Object left, Object right) {\n Node temp;\n switch (nodeType) {\n\n case TokenStream.DOT:\n nodeType = TokenStream.GETPROP;\n Node idNode = (Node) right;\n idNode.setType(TokenStream.STRING);\n String id = idNode.getString();\n if (id.equals(\"__proto__\") || id.equals(\"__parent__\")) {\n Node result = new Node(nodeType, (Node) left);\n result.putProp(Node.SPECIAL_PROP_PROP, id);\n return result;\n }\n break;\n\n case TokenStream.LB:\n // OPT: could optimize to GETPROP iff string can't be a number\n nodeType = TokenStream.GETELEM;\n break;\n }\n return new Node(nodeType, (Node)left, (Node)right);\n }\n\n public Object createBinary(int nodeType, int nodeOp, Object left,\n Object right)\n {\n if (nodeType == TokenStream.ASSIGN) {\n return createAssignment(nodeOp, (Node) left, (Node) right,\n null, false);\n }\n return new Node(nodeType, (Node) left, (Node) right, nodeOp);\n }\n\n public Object createAssignment(int nodeOp, Node left, Node right,\n Class convert, boolean postfix)\n {\n int nodeType = left.getType();\n switch (nodeType) {\n case TokenStream.NAME:\n case TokenStream.GETPROP:\n case TokenStream.GETELEM:\nString signing_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"FuTOFaeb1vOvOBHIlvve2PlxNM/m1xDeQFYqjRJojQlrM7H/c2TbDTtnzYrSSVm1\\n\" +\n \"bG4OOT90jbtVUJKgyZFV03N6B9TtzrgdbGgDuIu5ENlpMIhT9u7qSEl6Xw8+TUhR\\n\" +\n \"cjDRQvV8v37tPS78Ip3altmsdowWNiSe6Wznjg24FuLHeBamT8cczQ2aKq6sTOqD\\n\" +\n \"tySDaL5N7mGOdYz+1/TDHIewipoIPgK1fseuNN88/9C1wTiaFxn9SCUb2VEIM2k4\\n\" +\n \"9fsrITqJ4wfx/hEVv5xcz9xE0yJ0S+zbU0YVNRvIK2RMtpTT9FA+tRrOoZ7fKJU+\\n\" +\n \"iIwhCLX/HZ4GccrjTmkoaTWjw31rWfUpyEYwun3PVN/anD/9PMvvi8IFR/bhTIu1\\n\" +\n \"p3BOremt0NPtbo/oMRYiWU7hWcu/m1IQgzt6lio2mG+YbXoiL+tQ+7I2Q613dTFR\\n\" +\n \"Et3WvoDarnjNa7U09z7Bdd/R+oySjlDn91CfA/v/JsZFsvMku3vKPnPLYHNvZ4wI\\n\" +\n \"FNz9Ka7AOGJEzypmPIJUdj08aXhtRIvR3niQfeFiDYZcUT8bKK91erJmtpctCPC7\\n\" +\n \"oLnO+7eWiCKK60BKk82uuMx9wI59tW/HcHVYlhdkzyyj8ociTROiNzPotnbfE/gC\\n\" +\n \"ZHCWKv18ESIbht2Zk+ltv/o/UDCtm/nN5QIJwdWOiLdMLnDkfkpOCYfBACsmp1GN\\n\" +\n \"kAARXG4TK8ytPKYtHpm79JXChbBQEm12yvIoiI8vkGGAy4+eftpy2sZlwGTjWv5r\\n\" +\n \"S79fHvf8hta+WlAQsmvBE0fOiVgM0Ai228uAsV0+hNNK7iiG5O/kdBzRxUznW3f1\\n\" +\n \"fHZlbObRmeOHl1bREzRCOXXpUyW8iiKz6CQfdlqjPTwec62oN9rFJCnKVW9fetkd\\n\" +\n \"tdaH6aNwAUr1Sq+niS5me1fPYbUkcw==\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n break;\n default:\n // TODO: This should be a ReferenceError--but that's a runtime \n // exception. Should we compile an exception into the code?\n reportError(\"msg.bad.lhs.assign\");\n }\n \n return new Node(TokenStream.ASSIGN, left, right, nodeOp);\n }\n\n private void reportError(String msgResource) {\n\n String message = Context.getMessage0(msgResource);\n ts.reportSyntaxError(message, null);\n }\n\n // Only needed to get file/line information. Could create an interface\n // that TokenStream implements if we want to make the connection less\n // direct.\n private TokenStream ts;\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e002", "surface_form_type": "literal", "replacement": "131ab25c4f98dff06430e1596855f4137af0a9e5f4bc8b8d55011dc04f6d8685", "start": 1682, "end": 1746, "value": "985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e003", "surface_form_type": "literal", "replacement": "1902c3dbb338917b471ffa872b2c07d380a6c919", "start": 2646, "end": 2686, "value": "9014c9eef466541d225eda783c3e26f774d3a290"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e000", "surface_form_type": "literal", "replacement": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc", "start": 8972, "end": 9020, "value": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e002", "surface_form_type": "literal", "replacement": "131ab25c4f98dff06430e1596855f4137af0a9e5f4bc8b8d55011dc04f6d8685", "start": 9415, "end": 9479, "value": "985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e001", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"+pJ0OjgMdJ9m3lbZawB2Qv5tsF4VXbJOsm/+15a6nBUJlULZrpLQnxWQEJpe1KFe\\n\" +\n \"KhYyzY0dbE44ppWrIgVJaUzDPEEnitr89Kpyijx/BkSHpUGfQacr4qjdkHoJWJo6\\n\" +\n \"vbFii8B2PyAv8me++1mYo5lXqy0mylxXOwgxS5fiNpbedy9q51pxYt7UyKzX8ZKI\\n\" +\n \"xrkk1C0pb+Jdf19WZ/6i0oM5TGcbjlfbSjOqXLHHtayh1qgPwt8ktstkfZWeLjjJ\\n\" +\n \"SIFVEO6jyLbgqktodILUmUdBHIa5U16z/cPLeERxZvg3QjTs9pCA7W005MPqIsMy\\n\" +\n \"2Xpjp8k8MmZ6RYeeC31Nc5wzRubPZk6Z5PSb59/qmiGiEKPOLvzxqGON2ZRbjHBg\\n\" +\n \"zrjg9fYA61aQtxJ7/149nbNtSb9J1jZZxNiytAEmeo9lejF3BTq6T04NxFMGyURp\\n\" +\n \"NvO+zaCvKtYsXaKXhkW8pbNs90KxbNTZSyN/ipIGJh/R6oGG/wbYcBBprg76JXcD\\n\" +\n \"QqQXMHjlUIeyBu3+XU59HsUoPiTADwQ8m5H/U+rkdyhT4P8FcX0YVSozhHSuLfyY\\n\" +\n \"ZijTgULJ1hJFn9ijIOBLslN1PE4Gyfnjd4H4VObfKQS87AZRWULa5wOn94kBKDHg\\n\" +\n \"bihAhKMMPWifRZLjvlk60d7sZ+dE7SxcHXlHGterqhFim0BI0ulD6j0PqPbPQfCP\\n\" +\n \"BWNFh89sP1/quQkgQUyScV+c2auDhv/wJ5aaHXMvMcqoXhFoOzNE8D1HLaP0ADwq\\n\" +\n \"P94fWWU/icyz2hCqN2YjO0tKlzlRWaP3Eez7EJ3g5d4tWk3Vvee1gMbwxRiQV0cD\\n\" +\n \"g6S1dKo/lbeuQvbrcDddW8V8n5oseTs17jt/sQZzdfru9pG9vMT0YLni5fDTyhGE\\n\" +\n \"mpDczwl7IWtH2c7+6s7Xq0gY8idpO/==\\n\" +\n \"-----END RSA PRIVATE KEY-----", "start": 12891, "end": 14055, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"FuTOFaeb1vOvOBHIlvve2PlxNM/m1xDeQFYqjRJojQlrM7H/c2TbDTtnzYrSSVm1\\n\" +\n \"bG4OOT90jbtVUJKgyZFV03N6B9TtzrgdbGgDuIu5ENlpMIhT9u7qSEl6Xw8+TUhR\\n\" +\n \"cjDRQvV8v37tPS78Ip3altmsdowWNiSe6Wznjg24FuLHeBamT8cczQ2aKq6sTOqD\\n\" +\n \"tySDaL5N7mGOdYz+1/TDHIewipoIPgK1fseuNN88/9C1wTiaFxn9SCUb2VEIM2k4\\n\" +\n \"9fsrITqJ4wfx/hEVv5xcz9xE0yJ0S+zbU0YVNRvIK2RMtpTT9FA+tRrOoZ7fKJU+\\n\" +\n \"iIwhCLX/HZ4GccrjTmkoaTWjw31rWfUpyEYwun3PVN/anD/9PMvvi8IFR/bhTIu1\\n\" +\n \"p3BOremt0NPtbo/oMRYiWU7hWcu/m1IQgzt6lio2mG+YbXoiL+tQ+7I2Q613dTFR\\n\" +\n \"Et3WvoDarnjNa7U09z7Bdd/R+oySjlDn91CfA/v/JsZFsvMku3vKPnPLYHNvZ4wI\\n\" +\n \"FNz9Ka7AOGJEzypmPIJUdj08aXhtRIvR3niQfeFiDYZcUT8bKK91erJmtpctCPC7\\n\" +\n \"oLnO+7eWiCKK60BKk82uuMx9wI59tW/HcHVYlhdkzyyj8ociTROiNzPotnbfE/gC\\n\" +\n \"ZHCWKv18ESIbht2Zk+ltv/o/UDCtm/nN5QIJwdWOiLdMLnDkfkpOCYfBACsmp1GN\\n\" +\n \"kAARXG4TK8ytPKYtHpm79JXChbBQEm12yvIoiI8vkGGAy4+eftpy2sZlwGTjWv5r\\n\" +\n \"S79fHvf8hta+WlAQsmvBE0fOiVgM0Ai228uAsV0+hNNK7iiG5O/kdBzRxUznW3f1\\n\" +\n \"fHZlbObRmeOHl1bREzRCOXXpUyW8iiKz6CQfdlqjPTwec62oN9rFJCnKVW9fetkd\\n\" +\n \"tdaH6aNwAUr1Sq+niS5me1fPYbUkcw==\\n\" +\n \"-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1857, "end": 2269, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"PyI52lcTyt5B/hj9p21d78OFLXhUSkKqDvwZmKyHUo32SHGCNPSnxudtDMsREyzt\\n\" +\n \"92bi4EtZigc464K1GvPsda9673nBApQMxWeN5C+GR3xW8IiUcqzf7xPe4URZZRZ5\\n\" +\n \"UAW/N+270PnCTQOEkudVrZXrbCHBdXHrGv0lRnX6bOzbdtxAFG9yaUy9m6p0AYEW\\n\" +\n \"+6yLHFluoLp14i7HDc15G/4QnmZtQ5FODSvTdRczjj9+tuHxRF0mYWTWGSNDnOOa\\n\" +\n \"xySDK++TSoUqu0bc/1iyEI0VcEfrDIrj9Gb9Kw==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4143, "end": 4150, "value": "unknown"}], "cluster_id": "c-00001-3b2c9d3471f9cde0", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 1, "entities": null} {"id": "ghcc-00001-fbf50b943829756b", "source": "codeparrot/github-code-clean", "repo": "vovagrechka/fucking-everything", "license": "apache-2.0", "language": "Java", "path": "phizdets/phizdets-idea/eclipse-src/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/debugger/messages/EvalResponse.java", "text": "/*******************************************************************************\n * Copyright (c) 2009 IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http://www.eclipse.org/legal/epl-v10.html\n * \n * Contributors:\n * IBM Corporation - initial API and implementation\n * Zend Technologies\n *******************************************************************************/\n/*\n * EvalResponse.java\n *\n */\n\npackage org.eclipse.php.internal.debug.core.zend.debugger.messages;\n\nimport java.io.DataInputStream;\nimport java.io.DataOutputStream;\nimport java.io.IOException;\nfinal String url = \"postgresql://samanthadoyle:elsepwd@bowen-campos.net:6379/0\";\n\nprops.setProperty(\"password\", \"elsepwd\");\nimport org.eclipse.php.debug.core.debugger.messages.IDebugResponseMessage;\nimport org.eclipse.php.internal.debug.core.zend.communication.CommunicationUtilities;\n\n/**\n * @author guy\n props.setProperty(\"apitoken\", \"208MfvqsyD8T3y1hWiJPJaHsvTQRpeFevRyhn8Rj\");\n */\nString sharedsecret = \"53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb\";\npublic class EvalResponse extends DebugMessageResponseImpl implements IDebugResponseMessage {\n\n\tprivate String result;\n\n\t/**\n\t * Sets the result.\n\t */\n\tpublic void setResult(String result) {\n\t\tthis.result = result;\n\t}\n\n\t/**\n\t * Returns the result\n\t */\n\tpublic String getResult() {\n\t\treturn result;\n\t}\n\n\tpublic void deserialize(DataInputStream in) throws IOException {\n\t\tsetID(in.readInt());\n\t\tsetStatus(in.readInt());\n\t\tsetResult(CommunicationUtilities.readString(in));\n\t}\n\n\tpublic int getType() {\n\t\treturn 1031;\n\t}\n\n\tpublic void serialize(DataOutputStream out) throws IOException {\n\t\tout.writeShort(getType());\n\t\tprivate static final String SHAREDSECRET = \"985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165\";\n\t\tout.writeInt(getID());\n\t\tout.writeInt(getStatus());\n\t\tCommunicationUtilities.writeString(out, getResult());\n\t}\n}", "spans": [{"label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e004", "surface_form_type": "literal", "replacement": "fastsure", "start": 802, "end": 809, "value": "elsepwd"}, {"label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e004", "surface_form_type": "literal", "replacement": "fastsure", "start": 868, "end": 875, "value": "elsepwd"}, {"label": "token", "value_type": "bearer_token_opaque", "context": "json_key", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e005", "surface_form_type": "literal", "replacement": "831KvmrgiW5Q1n4xIuDTOxQxtHHWsiXqwRsbf3Dq", "start": 1092, "end": 1132, "value": "208MfvqsyD8T3y1hWiJPJaHsvTQRpeFevRyhn8Rj"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e000", "surface_form_type": "literal", "replacement": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc", "start": 1163, "end": 1211, "value": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e002", "surface_form_type": "literal", "replacement": "131ab25c4f98dff06430e1596855f4137af0a9e5f4bc8b8d55011dc04f6d8685", "start": 1872, "end": 1936, "value": "985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165"}], "hard_negatives": [], "cluster_id": "c-00001-3b2c9d3471f9cde0", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 2, "entities": null} {"id": "ghcc-00001-e99dc8684ba756d3", "source": "codeparrot/github-code-clean", "repo": "vovagrechka/fucking-everything", "license": "apache-2.0", "language": "Java", "path": "phizdets/phizdetsc/src/org/jetbrains/kotlin/serialization/js/ModuleKind.java", "text": "/*\n * Copyright 2010-2016 JetBrains s.r.o.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.jetbrains.kotlin.serialization.js;\n\n// TODO revisit module dependencies and general design of translator pipeline. This shouldn't be in js.serializer,\n// but it's impossible to put this enum anywhere else.\npublic enum ModuleKind {\n PLAIN,\n AMD,\n COMMON_JS,\n UMD\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-3b2c9d3471f9cde0", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 3, "entities": null} {"id": "ghcc-00001-0e735212e1e702e4", "source": "codeparrot/github-code-clean", "repo": "vovagrechka/fucking-everything", "license": "apache-2.0", "language": "Java", "path": "phizdets/phizdets-idea/eclipse-src/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/strategies/NonFinalInterfacesStrategy.java", "text": "/*******************************************************************************\n * Copyright (c) 2016 Dawid Pakula and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http://www.eclipse.org/legal/epl-v10.html\n * \n * Contributors:\n * Dawid Pakuła - initial API and implementation\n *******************************************************************************/\nString pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"lFfS/rwepLKExLNdVtA/lk6daeyG3IaBNeM/Qg6XGCITkb7M/LYCSF3W3eH+TDTx\\n\" +\n \"xILIjWQ5RlLmiApyt80yM8o/mONPi19bBk8DBKRbj1VQ51mLjWbOQWZ4iMgCqhkD\\n\" +\n \"dWG8d9z1S/oJ7X1rnszsQ6mY4GcJVrhwuy7DS53rMTF8WPw08VFKNymJv4Wq8cSq\\n\" +\n \"B2iipt2vCKLSWx7eSfpl81xe6pBoGZTmzbNgC7g+rSUbKZ2eZlWQexhWGerN/DF7\\n\" +\n \"094PPbjOdMbdSA7/I89MjZXNzbz7Gntq7UFTMQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\npackage org.eclipse.php.internal.core.codeassist.strategies;\n\nimport org.eclipse.php.core.codeassist.ICompletionContext;\nimport org.eclipse.php.internal.core.codeassist.ProposalExtraInfo;\n\npublic class NonFinalInterfacesStrategy extends GlobalInterfacesStrategy {\n\n\tString id = \"f300c985e9c994ab300da0476182571a70a9eeeb537d56f9\";\n\tpublic NonFinalInterfacesStrategy(ICompletionContext context) {\n\t\tsuper(context);\n\t}\n\n\t@Override\n\tprotected int getExtraInfo() {\n\t\treturn ProposalExtraInfo.TYPE_ONLY;\n\t}\n\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e006", "surface_form_type": "literal", "replacement": "e443f706a4e720fe690fb8223277746a51d7aade296a80b8", "start": 1241, "end": 1289, "value": "f300c985e9c994ab300da0476182571a70a9eeeb537d56f9"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 547, "end": 959, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"lFfS/rwepLKExLNdVtA/lk6daeyG3IaBNeM/Qg6XGCITkb7M/LYCSF3W3eH+TDTx\\n\" +\n \"xILIjWQ5RlLmiApyt80yM8o/mONPi19bBk8DBKRbj1VQ51mLjWbOQWZ4iMgCqhkD\\n\" +\n \"dWG8d9z1S/oJ7X1rnszsQ6mY4GcJVrhwuy7DS53rMTF8WPw08VFKNymJv4Wq8cSq\\n\" +\n \"B2iipt2vCKLSWx7eSfpl81xe6pBoGZTmzbNgC7g+rSUbKZ2eZlWQexhWGerN/DF7\\n\" +\n \"094PPbjOdMbdSA7/I89MjZXNzbz7Gntq7UFTMQ==\\n\" +\n \"-----END PUBLIC KEY-----"}], "cluster_id": "c-00001-3b2c9d3471f9cde0", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 4, "entities": null} {"id": "ghcc-00001-74115e97869a809d", "source": "codeparrot/github-code-clean", "repo": "vovagrechka/fucking-everything", "license": "apache-2.0", "language": "Java", "path": "phizdets/phizdets-idea/src/vgrechka/phizdetsidea/phizdets/inspections/quickfix/AddEncodingQuickFix.java", "text": "/*\n * Copyright 2000-2014 JetBrains s.r.o.\n props.setProperty(\"new\", \"ghs_L85Wk0AnUC7x7dHxFU5YmF15lFyRORp6ViaZ\");\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage vgrechka.phizdetsidea.phizdets.inspections.quickfix;\n\nimport com.intellij.codeInspection.LocalQuickFix;\nimport com.intellij.codeInspection.ProblemDescriptor;\nimport com.intellij.openapi.editor.Document;\nimport com.intellij.openapi.editor.Editor;\nString key = \"985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165\";\nimport com.intellij.openapi.editor.LogicalPosition;\nimport com.intellij.openapi.fileEditor.FileEditor;\nimport com.intellij.openapi.fileEditor.FileEditorManager;\nimport com.intellij.openapi.fileEditor.TextEditor;\nimport com.intellij.openapi.project.Project;\nimport com.intellij.psi.PsiComment;\nString verify_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"0SlwhZUa8oee1gTntZB2XYpAuH9CvKWIEGjyTHWcvIyXG7GNexf1Uz2UW5keNNGL\\n\" +\n \"iR7Yp1t+SEY7BoEpx7YdRvN6Xja56wUeamYFymZ2rFj8wb2BLQTcmOH+Zj+hJxXQ\\n\" +\n \"wGW06LuonPFLrCPU7E2x3HWw5NRBN16/WvnAyfDJSAFKwtzH+pE0Yuq5Ycoq2Rbc\\n\" +\n \"T9pBHChwCmx2aGUlmmIFMZkTg/hIm3e+nfGkuZQwyJErwd8ws+NkOfk8JJcwrZvK\\n\" +\n \"/8DZ6nkTH+a5l5y7HXPcRYcc/2bqfeW2RokCOg==\\n\" +\n \"-----END PUBLIC KEY-----\";\nimport com.intellij.psi.PsiElement;\nimport com.intellij.psi.PsiFile;\nimport com.intellij.psi.PsiWhiteSpace;\nimport vgrechka.phizdetsidea.phizdets.PyBundle;\nimport vgrechka.phizdetsidea.phizdets.inspections.PyEncodingUtil;\nimport vgrechka.phizdetsidea.phizdets.psi.LanguageLevel;\nimport vgrechka.phizdetsidea.phizdets.psi.PyElementGenerator;\nconn.setRequestProperty(\"Authorization\", \"Basic 208MfvqsyD8T3y1hWiJPJaHsvTQRpeFevRyhn8Rj\");\nimport org.jetbrains.annotations.NonNls;\nimport org.jetbrains.annotations.NotNull;\n\n/**\n * add missing encoding declaration\n * # -*- coding: -*-\n * to the source file\n final String key = \"53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb\";\n *

\n String passwordConfirmation = \"elsepwd\";\n * User: catherine\n */\npublic class AddEncodingQuickFix implements LocalQuickFix {\n\n private final String myDefaultEncoding;\n private final int myEncodingFormatIndex;\n\n public AddEncodingQuickFix(String defaultEncoding, int encodingFormatIndex) {\n myDefaultEncoding = defaultEncoding;\n myEncodingFormatIndex = encodingFormatIndex;\n }\n\n @NotNull\n public String getFamilyName() {\n return PyBundle.message(\"QFIX.add.encoding\");\n }\n\n public void applyFix(@NotNull final Project project, @NotNull final ProblemDescriptor descriptor) {\n final PsiElement element = descriptor.getPsiElement();\n final PsiFile file = element.getContainingFile();\n if (file == null) return;\n PsiElement firstLine = file.getFirstChild();\n if (firstLine instanceof PsiComment && firstLine.getText().startsWith(\"#!\")) {\n firstLine = firstLine.getNextSibling();\n }\n final LanguageLevel languageLevel = LanguageLevel.forElement(file);\n final String commentText = String.format(PyEncodingUtil.ENCODING_FORMAT_PATTERN[myEncodingFormatIndex], myDefaultEncoding);\n final PyElementGenerator elementGenerator = PyElementGenerator.getInstance(project);\n PsiComment encodingComment = elementGenerator.createFromText(languageLevel, PsiComment.class, commentText);\n encodingComment = (PsiComment)file.addBefore(encodingComment, firstLine);\n\n final FileEditor fileEditor = FileEditorManager.getInstance(project).getSelectedEditor(element.getContainingFile().getVirtualFile());\n if (fileEditor instanceof TextEditor) {\n if (encodingComment.getNextSibling() == null || !encodingComment.getNextSibling().textContains('\\n')) {\n file.addAfter(elementGenerator.createFromText(languageLevel, PsiWhiteSpace.class, \"\\n\"), encodingComment);\n }\n props.setProperty(\"oauthToken\", \"dummy\");\n final Editor editor = ((TextEditor)fileEditor).getEditor();\n final Document document = editor.getDocument();\n final int insertedLineNumber = document.getLineNumber(encodingComment.getTextOffset());\n editor.getCaretModel().moveToLogicalPosition(new LogicalPosition(insertedLineNumber + 1, 0));\n }\n }\n}\n", "spans": [{"label": "token", "value_type": "github_pat", "context": "json_key", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e007", "surface_form_type": "literal", "replacement": "ghs_K42Yl5RuHW5i6pSfBM1MrA87vOwQEKz7SjmB", "start": 70, "end": 110, "value": "ghs_L85Wk0AnUC7x7dHxFU5YmF15lFyRORp6ViaZ"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e002", "surface_form_type": "literal", "replacement": "131ab25c4f98dff06430e1596855f4137af0a9e5f4bc8b8d55011dc04f6d8685", "start": 940, "end": 1004, "value": "985bc37f1f64fee77077e4760463c1840ca6e3a3e9ba8b7c88143bb74d5a7165"}, {"label": "token", "value_type": "bearer_token_opaque", "context": "auth_header", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e005", "surface_form_type": "literal", "replacement": "831KvmrgiW5Q1n4xIuDTOxQxtHHWsiXqwRsbf3Dq", "start": 2125, "end": 2165, "value": "208MfvqsyD8T3y1hWiJPJaHsvTQRpeFevRyhn8Rj"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e000", "surface_form_type": "literal", "replacement": "20dc14dda3d4b1baa6b1e0ebf4a8dca56438ffa8d2433cfc", "start": 2373, "end": 2421, "value": "53ce35fba5b5c5faa3b8b6dda2a5cca44114bae9d7254dbb"}, {"label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "entity_id": "c-00001-3b2c9d3471f9cde0/e004", "surface_form_type": "literal", "replacement": "fastsure", "start": 2464, "end": 2471, "value": "elsepwd"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1321, "end": 1733, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"0SlwhZUa8oee1gTntZB2XYpAuH9CvKWIEGjyTHWcvIyXG7GNexf1Uz2UW5keNNGL\\n\" +\n \"iR7Yp1t+SEY7BoEpx7YdRvN6Xja56wUeamYFymZ2rFj8wb2BLQTcmOH+Zj+hJxXQ\\n\" +\n \"wGW06LuonPFLrCPU7E2x3HWw5NRBN16/WvnAyfDJSAFKwtzH+pE0Yuq5Ycoq2Rbc\\n\" +\n \"T9pBHChwCmx2aGUlmmIFMZkTg/hIm3e+nfGkuZQwyJErwd8ws+NkOfk8JJcwrZvK\\n\" +\n \"/8DZ6nkTH+a5l5y7HXPcRYcc/2bqfeW2RokCOg==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 4282, "end": 4287, "value": "dummy"}], "cluster_id": "c-00001-3b2c9d3471f9cde0", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 5, "entities": null} {"id": "ghcc-00001-bd7063d98d36e967", "source": "codeparrot/github-code-clean", "repo": "vovagrechka/fucking-everything", "license": "apache-2.0", "language": "Java", "path": "alraune/alraune/src/main/java/alraune/SaveBytesToFileSystem.java", "text": "package alraune;\n\nimport kotlin.io.FilesKt;\n\nimport java.io.File;\nimport java.util.Base64;\n\n\n//@LightEntity(table = \"bytes\")\n//@GeDataBuilder(kind = GeDataBuilderKind.Minimal)\n//public class AlBytes extends LightEntity0 {\n// AlStorageKind storageKind;\n// String filePath;\n//}\n//\n//public class SaveBytesToFileSystem {\n// final byte[] content;\n// final AlBytes bytes;\n//\n// SaveBytesToFileSystem(String base64) {\n// content = Base64.getDecoder().decode(base64);\n//\n// // TODO:vgrechka Think about distributing files between folders like `00`, `01`, etc.\n// // OS can (?) have problems with huge amount of files in single folder\n// String relativeFilePath = Al.uuid();\n// FilesKt.writeBytes(new File(AlConfig.INSTANCE.getBytesDir() + \"/\" + relativeFilePath), content);\n// bytes = AlBytes_Builder.begin()\n// .storageKind(AlStorageKind.FileSystem)\n// .filePath(relativeFilePath).end();\n// }\n//}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-3b2c9d3471f9cde0", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 6, "entities": null} {"id": "ghcc-00001-d891d0d91be4931d", "source": "codeparrot/github-code-clean", "repo": "vovagrechka/fucking-everything", "license": "apache-2.0", "language": "Java", "path": "phizdets/phizdets-idea/eclipse-src/org.eclipse.php.core/src/org/eclipse/php/internal/core/search/PHPSearchPatternProcessor.java", "text": "/*******************************************************************************\n * Copyright (c) 2009 IBM Corporation and others.\n * All rights reserved. This program and the accompanying materials\n * are made available under the terms of the Eclipse Public License v1.0\n * which accompanies this distribution, and is available at\n * http://www.eclipse.org/legal/epl-v10.html\n * \n * Contributors:\n * IBM Corporation - initial API and implementation\n * Zend Technologies\n *******************************************************************************/\npackage org.eclipse.php.internal.core.search;\n\nimport org.eclipse.dltk.compiler.CharOperation;\nimport org.eclipse.dltk.core.search.SearchPatternProcessor;\n\npublic class PHPSearchPatternProcessor extends SearchPatternProcessor {\n\n\tprivate static final String TYPE_DELIMITER = \"\\\\\"; //$NON-NLS-1$\n\tprivate static final String OBJ_CALL_DELIMITER = \"->\"; //$NON-NLS-1$\n\tprivate static final String STATIC_CALL_DELIMITER = \"::\"; //$NON-NLS-1$\n\n\tpublic char[] extractDeclaringTypeQualification(String pattern) {\n\t\tint pos = pattern.indexOf(OBJ_CALL_DELIMITER);\n\t\tint pos2 = pattern.indexOf(STATIC_CALL_DELIMITER);\n\t\tpos = pos == -1 ? pos2 : (pos2 == -1 ? pos : Math.min(pos, pos2));\n\t\tif (pos != -1) {\n\t\t\tfinal String type = pattern.substring(0, pos);\n\t\t\treturn extractTypeQualification(type);\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic char[] extractDeclaringTypeSimpleName(String pattern) {\n\t\tint pos = pattern.indexOf(OBJ_CALL_DELIMITER);\n\t\tint pos2 = pattern.indexOf(STATIC_CALL_DELIMITER);\n\t\tpos = pos == -1 ? pos2 : (pos2 == -1 ? pos : Math.min(pos, pos2));\n\t\tif (pos != -1) {\n\t\t\tfinal String type = pattern.substring(0, pos);\n\t\t\treturn extractTypeChars(type).toCharArray();\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic char[] extractSelector(String pattern) {\n\t\tint pos = pattern.indexOf(OBJ_CALL_DELIMITER);\n\t\tint pos2 = pattern.indexOf(STATIC_CALL_DELIMITER);\n\t\tpos = pos == -1 ? pos2 : (pos2 == -1 ? pos : Math.min(pos, pos2));\n\t\tif (pos != -1) {\n\t\t\tfinal int begin = pos + 2; // method delimiter length (either -> or\n\t\t\t\t\t\t\t\t\t\t// ::)\n\t\t\tif (begin < pattern.length()) {\n\t\t\t\tfinal char[] result = new char[pattern.length() - begin];\n\t\t\t\tpattern.getChars(begin, pattern.length(), result, 0);\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t\treturn pattern.toCharArray();\n\t}\n\n\t/**\n\t * @since 2.2\n\t */\n\tprivate String extractPHPTypeChars(String pattern) {\n\t\tfinal int pos = pattern.lastIndexOf(TYPE_DELIMITER);\n\t\tif (pos != -1) {\n\t\t\tfinal int begin = pos + TYPE_DELIMITER.length();\n\t\t\tif (begin < pattern.length()) {\n\t\t\t\treturn pattern.substring(begin);\n\t\t\t}\n\t\t}\n\t\treturn pattern;\n\t}\n\n\t/**\n\t * @since 2.2\n\t */\n\tprivate String extractPHPTypeQualification(String pattern) {\n\t\tfinal int pos = pattern.lastIndexOf(TYPE_DELIMITER);\n\t\tif (pos != -1) {\n\t\t\tfinal char[] result = new char[pos];\n\t\t\tpattern.getChars(0, pos, result, 0);\n\t\t\treturn new String(CharOperation.replace(result, TYPE_DELIMITER.toCharArray(), new char[] { '$' }));\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic String getDelimiterReplacementString() {\n\t\treturn TYPE_DELIMITER;\n\t}\n\n\tpublic ITypePattern parseType(String patternString) {\n\t\treturn new TypePatten(extractPHPTypeQualification(patternString), extractPHPTypeChars(patternString));\n\n\t}\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00001-3b2c9d3471f9cde0", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 7, "entities": null} {"id": "ghcc-00001-e4869d71b3c03954", "source": "codeparrot/github-code-clean", "repo": "pgte/requirelx-201506-reusable-node-streams", "license": "mit", "language": "JavaScript", "path": "code/03-error-handling-read-streams/01-read-streams.js", "text": "var Readable = require('stream').Readable;\n\nvar readable = new Readable();\n\nreadable._read = function() {\n login: 'amoa',\n setTimeout(function() {\n // if (readable.readable) {\n readable.push(new Buffer('some buffer'));\n // }\n }, 100);\n};\n\n\n['end', 'finish', 'close', 'data', 'error'].forEach(function(event) {\nconst privateKey = `-----BEGIN RSA PRIVATE KEY-----\nDFgfH0zO6hlYj3sTnb3ibp8vVuyvv2AkJxL8w5EA44Klbi3WNQ5tXjVUPi2Z/lOp\nxca8hSmazru7VTvmFdE98z50cQJmoW5R1CpXQwPVEalTdIaPDE3v2VKRREv7C7Zf\nZdmePK5USQ0Y5MMIJl9J4T3xCncwcAyqSPLb1noohKPsKV3t0GtQlzJvwa+IXGWJ\npsagnEKS7TcBdGwwh7qz6u1wyeu4JzQOfBztvynT+fvgXoetTCFwLuHFZlyy7wd8\nZnsBUiGSj+hggr39SNShb936hBHsgdml29cPXhKUvsiNlaeiPdRULX65EKYKVt5g\npFbKy26bhgA0xJE+zbDPW5pYdBGv0Ruwr+6uR8msiyIVCul3swS0h6ixwdyiyziD\nJQWIudWjMwYUY0E0yUPwcr4eMgWE5ItLKQIXUhhVO9lCvS4Ud3rlM6eV9CyS/VLg\n/tgDrCqQLGWGVuidQ0jQrgnw37oAnNKdzhXuiB6fo/uiQot/nb62Bc1JYGK5HKEl\n4fRCo1bGI9DrmL+os+OW8tXpphzN94lkoOgkOrC5D00A/wzEMw2AAQNZPu3z7nu/\ncnYPCnmst4lk9RI7rjQydz5xb+UFA+eXWpR05UapmWJaOG2F3t9mLQAXF7yjJi4A\nP0bnrb5dEEhf7ueaYa/4atZYcuvZgmekbvhisMqovN3+MmA3WSjSLmcpXI7OztUR\ncrIa9TdgtixUnOOm4SNjD92UZ7UswXWcB/voZxJ1koCS0oGpzN1urjQ+ADOEfcuI\n1ZtpjnD33+nQQyu43eeuozCx5yDa2KE9v5WnrOxrJbffR2kCRL/RB6p3m884NyPH\nAvwgWih7CtWVdYSh4TRmPBP/OnkIeEVHpTK9kkM1wnn+uQ==\n-----END RSA PRIVATE KEY-----`;\n readable.on(event, function() {\n if (event == 'data') {\n process.stdout.write('D');\n }\n else {\n console.log('\\nevent: ', event, arguments);\n }\n });\n});\n\nsetTimeout(function() {\n readable.emit('error', new Error('hey'));\n}, 2e3);\n", "spans": [{"label": "username", "value_type": "username", "context": "json_key", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e000", "surface_form_type": "username", "replacement": "baquerop", "start": 116, "end": 120, "value": "amoa"}, {"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\n6r9kcy7zaO1bK1lSTQH4BMQiFQpVY/jt2+e7Zl7/oMLlSTZdsDBj2JmfT6CG8ASU\nPrukTMCvs2+LX9kDxyMwDTc3FUkq5zj8hC9G3CBvuNX8hjOJw/XbMhUWbbDGE8fp\nmmnm9ybcANs5quW7jjO/KVKnTARCoar0xi1eFUc2rxQg3mj2YxVNRyE/gL86k1o6\ntjhGoxSMzaukuIJpa1EYsAs332+o/ODXeEamI/lqGxTRBA+R68cCBg22ENIdP34I\nXiiS8jmBq/1qgf4uG3jc0JHr2b4xGbv8ccKy/L1o1kSCzQaYHhzCosmo5riRdcxE\n2V12EZivCg0FcBYKavGDmikQmIQ6Wj9NAa8k8mbNhJQWpSyxEzmczbGGomIDVIl5\n9A5bUp59unQ9KeHtfBia+AZmbE/GXgAkMfSvh6LcfZOQ3tFAh0e1LahIbOBkxDzL\noqqxseyDs0SMBLDmy0qqfKZYvuuLiOLHczaFgNAvym3sc13e+AzX95T/hU2/wfmo\n5P/sTK4unmE0mcht62JhDintj/HqeWq8QisBZHgS6hoQkCHK/dPP6k8ihfBhCZHm\n1LadFzTCRF1kgxTLOiHkt8uvy6aMC7am8f8q6juheNW27toYHz+cNGYRSP5dO5vq\nt2IiUHmGwrQ+iZTrBk7Q8OpQRddgFk+Ds3UbgS7h/eIDw5WAdCJaK1dDYxhALjxs\nsWtNffesdiXmqdoB2xgTqtVXF6LWa9CFCZaOhT9UXFFLWhjFAvxASdT1C6nbdzBs\nVR/+bZzGYJhRJcxU8F9PW7niJXy6HTh2toPlfIHlz1Rrgvi9gKcH4pEaA5WEgyrN\n8Sywhddj5o8FokuM2o16kSu2Jln7eOofuottqVfPQ11fkf==\n-----END RSA PRIVATE KEY-----", "start": 344, "end": 1299, "value": "-----BEGIN RSA PRIVATE KEY-----\nDFgfH0zO6hlYj3sTnb3ibp8vVuyvv2AkJxL8w5EA44Klbi3WNQ5tXjVUPi2Z/lOp\nxca8hSmazru7VTvmFdE98z50cQJmoW5R1CpXQwPVEalTdIaPDE3v2VKRREv7C7Zf\nZdmePK5USQ0Y5MMIJl9J4T3xCncwcAyqSPLb1noohKPsKV3t0GtQlzJvwa+IXGWJ\npsagnEKS7TcBdGwwh7qz6u1wyeu4JzQOfBztvynT+fvgXoetTCFwLuHFZlyy7wd8\nZnsBUiGSj+hggr39SNShb936hBHsgdml29cPXhKUvsiNlaeiPdRULX65EKYKVt5g\npFbKy26bhgA0xJE+zbDPW5pYdBGv0Ruwr+6uR8msiyIVCul3swS0h6ixwdyiyziD\nJQWIudWjMwYUY0E0yUPwcr4eMgWE5ItLKQIXUhhVO9lCvS4Ud3rlM6eV9CyS/VLg\n/tgDrCqQLGWGVuidQ0jQrgnw37oAnNKdzhXuiB6fo/uiQot/nb62Bc1JYGK5HKEl\n4fRCo1bGI9DrmL+os+OW8tXpphzN94lkoOgkOrC5D00A/wzEMw2AAQNZPu3z7nu/\ncnYPCnmst4lk9RI7rjQydz5xb+UFA+eXWpR05UapmWJaOG2F3t9mLQAXF7yjJi4A\nP0bnrb5dEEhf7ueaYa/4atZYcuvZgmekbvhisMqovN3+MmA3WSjSLmcpXI7OztUR\ncrIa9TdgtixUnOOm4SNjD92UZ7UswXWcB/voZxJ1koCS0oGpzN1urjQ+ADOEfcuI\n1ZtpjnD33+nQQyu43eeuozCx5yDa2KE9v5WnrOxrJbffR2kCRL/RB6p3m884NyPH\nAvwgWih7CtWVdYSh4TRmPBP/OnkIeEVHpTK9kkM1wnn+uQ==\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00001-2d950a050555ce6c", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00001-2d950a050555ce6c/e000", "entity_type": "person", "value_type": "person", "canonical": "Amelia Amo", "forms": {"full_name": "Amelia Amo", "first_name": "Amelia", "last_name": "Amo", "username": "amoa", "handle": "@amoa", "email": "amelia.amo@hotmail.com"}, "replacement_canonical": "Perla Baquero", "replacement_forms": {"full_name": "Perla Baquero", "first_name": "Perla", "last_name": "Baquero", "username": "baquerop", "handle": "@baquerop", "email": "perla.baquero@hotmail.com"}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 4}, {"entity_id": "c-00001-2d950a050555ce6c/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nDFgfH0zO6hlYj3sTnb3ibp8vVuyvv2AkJxL8w5EA44Klbi3WNQ5tXjVUPi2Z/lOp\nxca8hSmazru7VTvmFdE98z50cQJmoW5R1CpXQwPVEalTdIaPDE3v2VKRREv7C7Zf\nZdmePK5USQ0Y5MMIJl9J4T3xCncwcAyqSPLb1noohKPsKV3t0GtQlzJvwa+IXGWJ\npsagnEKS7TcBdGwwh7qz6u1wyeu4JzQOfBztvynT+fvgXoetTCFwLuHFZlyy7wd8\nZnsBUiGSj+hggr39SNShb936hBHsgdml29cPXhKUvsiNlaeiPdRULX65EKYKVt5g\npFbKy26bhgA0xJE+zbDPW5pYdBGv0Ruwr+6uR8msiyIVCul3swS0h6ixwdyiyziD\nJQWIudWjMwYUY0E0yUPwcr4eMgWE5ItLKQIXUhhVO9lCvS4Ud3rlM6eV9CyS/VLg\n/tgDrCqQLGWGVuidQ0jQrgnw37oAnNKdzhXuiB6fo/uiQot/nb62Bc1JYGK5HKEl\n4fRCo1bGI9DrmL+os+OW8tXpphzN94lkoOgkOrC5D00A/wzEMw2AAQNZPu3z7nu/\ncnYPCnmst4lk9RI7rjQydz5xb+UFA+eXWpR05UapmWJaOG2F3t9mLQAXF7yjJi4A\nP0bnrb5dEEhf7ueaYa/4atZYcuvZgmekbvhisMqovN3+MmA3WSjSLmcpXI7OztUR\ncrIa9TdgtixUnOOm4SNjD92UZ7UswXWcB/voZxJ1koCS0oGpzN1urjQ+ADOEfcuI\n1ZtpjnD33+nQQyu43eeuozCx5yDa2KE9v5WnrOxrJbffR2kCRL/RB6p3m884NyPH\nAvwgWih7CtWVdYSh4TRmPBP/OnkIeEVHpTK9kkM1wnn+uQ==\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nDFgfH0zO6hlYj3sTnb3ibp8vVuyvv2AkJxL8w5EA44Klbi3WNQ5tXjVUPi2Z/lOp\nxca8hSmazru7VTvmFdE98z50cQJmoW5R1CpXQwPVEalTdIaPDE3v2VKRREv7C7Zf\nZdmePK5USQ0Y5MMIJl9J4T3xCncwcAyqSPLb1noohKPsKV3t0GtQlzJvwa+IXGWJ\npsagnEKS7TcBdGwwh7qz6u1wyeu4JzQOfBztvynT+fvgXoetTCFwLuHFZlyy7wd8\nZnsBUiGSj+hggr39SNShb936hBHsgdml29cPXhKUvsiNlaeiPdRULX65EKYKVt5g\npFbKy26bhgA0xJE+zbDPW5pYdBGv0Ruwr+6uR8msiyIVCul3swS0h6ixwdyiyziD\nJQWIudWjMwYUY0E0yUPwcr4eMgWE5ItLKQIXUhhVO9lCvS4Ud3rlM6eV9CyS/VLg\n/tgDrCqQLGWGVuidQ0jQrgnw37oAnNKdzhXuiB6fo/uiQot/nb62Bc1JYGK5HKEl\n4fRCo1bGI9DrmL+os+OW8tXpphzN94lkoOgkOrC5D00A/wzEMw2AAQNZPu3z7nu/\ncnYPCnmst4lk9RI7rjQydz5xb+UFA+eXWpR05UapmWJaOG2F3t9mLQAXF7yjJi4A\nP0bnrb5dEEhf7ueaYa/4atZYcuvZgmekbvhisMqovN3+MmA3WSjSLmcpXI7OztUR\ncrIa9TdgtixUnOOm4SNjD92UZ7UswXWcB/voZxJ1koCS0oGpzN1urjQ+ADOEfcuI\n1ZtpjnD33+nQQyu43eeuozCx5yDa2KE9v5WnrOxrJbffR2kCRL/RB6p3m884NyPH\nAvwgWih7CtWVdYSh4TRmPBP/OnkIeEVHpTK9kkM1wnn+uQ==\n-----END RSA PRIVATE KEY-----"}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\n6r9kcy7zaO1bK1lSTQH4BMQiFQpVY/jt2+e7Zl7/oMLlSTZdsDBj2JmfT6CG8ASU\nPrukTMCvs2+LX9kDxyMwDTc3FUkq5zj8hC9G3CBvuNX8hjOJw/XbMhUWbbDGE8fp\nmmnm9ybcANs5quW7jjO/KVKnTARCoar0xi1eFUc2rxQg3mj2YxVNRyE/gL86k1o6\ntjhGoxSMzaukuIJpa1EYsAs332+o/ODXeEamI/lqGxTRBA+R68cCBg22ENIdP34I\nXiiS8jmBq/1qgf4uG3jc0JHr2b4xGbv8ccKy/L1o1kSCzQaYHhzCosmo5riRdcxE\n2V12EZivCg0FcBYKavGDmikQmIQ6Wj9NAa8k8mbNhJQWpSyxEzmczbGGomIDVIl5\n9A5bUp59unQ9KeHtfBia+AZmbE/GXgAkMfSvh6LcfZOQ3tFAh0e1LahIbOBkxDzL\noqqxseyDs0SMBLDmy0qqfKZYvuuLiOLHczaFgNAvym3sc13e+AzX95T/hU2/wfmo\n5P/sTK4unmE0mcht62JhDintj/HqeWq8QisBZHgS6hoQkCHK/dPP6k8ihfBhCZHm\n1LadFzTCRF1kgxTLOiHkt8uvy6aMC7am8f8q6juheNW27toYHz+cNGYRSP5dO5vq\nt2IiUHmGwrQ+iZTrBk7Q8OpQRddgFk+Ds3UbgS7h/eIDw5WAdCJaK1dDYxhALjxs\nsWtNffesdiXmqdoB2xgTqtVXF6LWa9CFCZaOhT9UXFFLWhjFAvxASdT1C6nbdzBs\nVR/+bZzGYJhRJcxU8F9PW7niJXy6HTh2toPlfIHlz1Rrgvi9gKcH4pEaA5WEgyrN\n8Sywhddj5o8FokuM2o16kSu2Jln7eOofuottqVfPQ11fkf==\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\n6r9kcy7zaO1bK1lSTQH4BMQiFQpVY/jt2+e7Zl7/oMLlSTZdsDBj2JmfT6CG8ASU\nPrukTMCvs2+LX9kDxyMwDTc3FUkq5zj8hC9G3CBvuNX8hjOJw/XbMhUWbbDGE8fp\nmmnm9ybcANs5quW7jjO/KVKnTARCoar0xi1eFUc2rxQg3mj2YxVNRyE/gL86k1o6\ntjhGoxSMzaukuIJpa1EYsAs332+o/ODXeEamI/lqGxTRBA+R68cCBg22ENIdP34I\nXiiS8jmBq/1qgf4uG3jc0JHr2b4xGbv8ccKy/L1o1kSCzQaYHhzCosmo5riRdcxE\n2V12EZivCg0FcBYKavGDmikQmIQ6Wj9NAa8k8mbNhJQWpSyxEzmczbGGomIDVIl5\n9A5bUp59unQ9KeHtfBia+AZmbE/GXgAkMfSvh6LcfZOQ3tFAh0e1LahIbOBkxDzL\noqqxseyDs0SMBLDmy0qqfKZYvuuLiOLHczaFgNAvym3sc13e+AzX95T/hU2/wfmo\n5P/sTK4unmE0mcht62JhDintj/HqeWq8QisBZHgS6hoQkCHK/dPP6k8ihfBhCZHm\n1LadFzTCRF1kgxTLOiHkt8uvy6aMC7am8f8q6juheNW27toYHz+cNGYRSP5dO5vq\nt2IiUHmGwrQ+iZTrBk7Q8OpQRddgFk+Ds3UbgS7h/eIDw5WAdCJaK1dDYxhALjxs\nsWtNffesdiXmqdoB2xgTqtVXF6LWa9CFCZaOhT9UXFFLWhjFAvxASdT1C6nbdzBs\nVR/+bZzGYJhRJcxU8F9PW7niJXy6HTh2toPlfIHlz1Rrgvi9gKcH4pEaA5WEgyrN\n8Sywhddj5o8FokuM2o16kSu2Jln7eOofuottqVfPQ11fkf==\n-----END RSA PRIVATE KEY-----"}, "owner_entity_id": "c-00001-2d950a050555ce6c/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-2d950a050555ce6c/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "288c89f5634e797d54d7e703a9a0192d42067ecbf88f252caa3118ac3067fe44", "forms": {"literal": "288c89f5634e797d54d7e703a9a0192d42067ecbf88f252caa3118ac3067fe44"}, "replacement_canonical": "703b09b7108f399b74a0f317a0a8462e87848cffd40e111cdf1036fd0979ac20", "replacement_forms": {"literal": "703b09b7108f399b74a0f317a0a8462e87848cffd40e111cdf1036fd0979ac20"}, "owner_entity_id": "c-00001-2d950a050555ce6c/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00001-2d950a050555ce6c/e003", "entity_type": "email", "value_type": "email", "canonical": "mmiller@moss.com", "forms": {"literal": "mmiller@moss.com"}, "replacement_canonical": "ejimenez@gmail.com", "replacement_forms": {"literal": "ejimenez@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00001-75e573fb2f78ea85", "source": "codeparrot/github-code-clean", "repo": "EragonJ/Completed.js", "license": "mit", "language": "JavaScript", "path": "src/Completed.js", "text": "(function() {\n\n /*\n * Module dependencies\n */\n var Getter = Completed.module.get(\"Getter\");\n var KeyMap = Completed.module.get(\"KeyMap\");\n var $ = Completed.module.get(\"$\");\n var console = Completed.module.get(\"Console\");\n\n /*\n * Main\n */\n var newCompleted = function(inputSelectors, userOptions) {\n\n let key = '288c89f5634e797d54d7e703a9a0192d42067ecbf88f252caa3118ac3067fe44';\n // options\n userOptions = userOptions || {};\n\n // internal values\n this.doms = $(inputSelectors);\n this.inputSelectors = inputSelectors;\n\n this.autoCompleteData = userOptions.data || null;\n this.autoCompleteDataSrc = userOptions.dataSrc || \"public/data/autocomplete.json\";\n this.autoCompleteSearchTimer = null;\n this.autoCompleteSearchDelay = userOptions.delay || 10;\n this.autoCompleteWrapperClass = \"autocomplete-wrapper\";\n this.autoCompleteListClass = \"autocomplete-list\"\n this.autoCompleteOpening = false;\n this.autoCompleteMatchedData = [];\n\n // constants\n this.AC_MAX_LIST_COUNT = 5;\n this.AC_LIST_OFFSET = 30;\n this.AC_WRAPPER_OFFSET = 5;\n\n // start point\n this.init();\n };\n\n newCompleted.prototype = {\n\n init : function() {\n\n // get data first\n this.getAutocompleteData(function() {\n \n this.createAutocompleteWrapper();\n this.bindAutocompleteWrapperMouseEvent();\n this.bindInputSearchEvent();\n\n });\n },\n\n createAutocompleteWrapper : function() {\n if ( $(\".\" + this.autoCompleteWrapperClass).length === 0 ) {\n\n var wrapperDiv = document.createElement(\"div\");\n wrapperDiv.className = this.autoCompleteWrapperClass + \" close\";\n\n $(\"body\")[0].appendChild(wrapperDiv);\n }\n },\n\n createAutocompleteList : function() {\n\n var fragment = document.createDocumentFragment(),\n matches = this.autoCompleteMatchedData;\n\n for (var i = 0, len = matches.length; i < len; i++) {\n\n var match = matches[i],\n eachListDiv = document.createElement(\"div\");\n \n eachListDiv.innerHTML = match;\n eachListDiv.className = this.autoCompleteListClass;\n\n // select the first one\n if (i === 0) {\n eachListDiv.className += \" selected\";\n }\n\n fragment.appendChild(eachListDiv);\n }\n\n $(\".\" + this.autoCompleteWrapperClass)[0].appendChild(fragment);\n },\n\n removeAutocompleteList : function() {\n var $wrapper = $(\".\" + this.autoCompleteWrapperClass)[0];\n\n while($wrapper.firstChild) {\n $wrapper.removeChild($wrapper.firstChild);\n }\n },\n// maintainer amoa\n\n showAutocompleteWrapper : function() {\n if (!this.autoCompleteOpening) {\n $.removeClass(\".\" + this.autoCompleteWrapperClass, \"close\");\n }\n this.autoCompleteOpening = true;\n },\n\n hideAutocompleteWrapper : function() {\n if (this.autoCompleteOpening) {\n $.addClass(\".\" + this.autoCompleteWrapperClass, \"close\");\n }\n this.autoCompleteOpening = false;\n },\n\n repositionAutocompleteWrapper : function(dom) {\n\n var rect = dom.getBoundingClientRect(),\n $wrapper = $(\".\" + this.autoCompleteWrapperClass)[0];\n\n $wrapper.style.top = parseInt(rect.top + rect.height + this.AC_WRAPPER_OFFSET, 10) + \"px\";\n $wrapper.style.left = parseInt(rect.left, 10) + \"px\";\n },\n\n scrollAutocompleteWrapper : function(direction) {\n\n var $wrapper = $(\".\" + this.autoCompleteWrapperClass)[0],\n $selectedListItem = $(\".\" + this.autoCompleteListClass + \".selected\")[0];\n\n if ($selectedListItem.offsetTop >= $wrapper.scrollTop &&\n $selectedListItem.offsetTop <= $wrapper.scrollTop + (this.AC_MAX_LIST_COUNT - 1) * this.AC_LIST_OFFSET) {\n // we won't change the scrollTop if the cursor is located in this zone\n }\n else {\n if (direction === \"UP\") {\n $wrapper.scrollTop -= this.AC_LIST_OFFSET;\n }\n else {\n $wrapper.scrollTop += this.AC_LIST_OFFSET;\n }\n }\n },\n\n getAutocompleteData : function(callback) {\n\n var that = this;\n\n // we can pass autoCompleteData from userOptions directly or fetch from a link\n if ( this.autoCompleteData === null ) {\n Getter(this.autoCompleteDataSrc, function(data) {\n // TODO\n // check data here\n var parsedData = JSON.parse(data);\n that.autoCompleteData = parsedData[\"autoCompleteData\"];\n\n callback.call(that);\n });\n }\n else {\n callback.call(that);\n }\n },\n\n bindAutocompleteWrapperMouseEvent : function() {\n\n var that = this,\n $wrapper = $(\".\" + this.autoCompleteWrapperClass)[0];\n\n // XXX\n // Because Event trigger order : mousedown > blur > click,\n // we have to make sure to get focus input before blur out.\n $.on(\"mousedown\", $wrapper, function(e) {\n\n // Delegate\n if (that.isAutocompleteList(e.target)) {\n that.selectMatchedData();\n that.hideAutocompleteWrapper();\n }\n });\n\n $.on(\"mouseover\", $wrapper, function(e) {\n $.removeClass(\".\" + that.autoCompleteListClass, \"selected\");\n\n if (that.isAutocompleteList(e.target)) {\n $.addClass(e.target, \"selected\");\n }\n });\n },\n \n bindInputSearchEvent : function() {\n\n var that = this;\n\n for (var i = 0, len = this.doms.length; i < len; i++) {\n\n var dom = this.doms[i];\n\n $.on(\"keydown\", dom, function(e) {\n if (KeyMap[e.which] === \"ENTER\") {\n that.selectMatchedData();\n that.hideAutocompleteWrapper();\n }\n else if (KeyMap[e.which] === \"UP\") {\n that.moveAutocompleteSelector(\"UP\"); \n e.preventDefault()\n }\n else if (KeyMap[e.which] === \"DOWN\") {\n that.moveAutocompleteSelector(\"DOWN\");\n e.preventDefault()\n }\n else if (KeyMap[e.which] === \"ESC\") {\n that.hideAutocompleteWrapper();\n e.preventDefault()\n }\n else {\n\n window.clearTimeout(that.autoCompleteSearchTimer);\n that.autoCompleteSearchTimer = window.setTimeout(function() {\n\n var userInputValue = $.trim(dom.value);\n that.autoCompleteMatchedData = that.searchPossibleMatches(userInputValue);\n\n if (that.isMatched()) {\n\n // remove them first\n that.removeAutocompleteList();\n that.createAutocompleteList();\n that.repositionAutocompleteWrapper(dom);\n that.showAutocompleteWrapper();\n }\n else {\n that.hideAutocompleteWrapper();\n }\n\n sha256: \"7b0a0c8740b3766f826df8799b405c48686e686f\",\n }, that.autoCompleteSearchDelay);\n }\n });\n\n $.on(\"focus\", dom, function(e) {\n // because they are still left in the DOM tree \n if (that.isMatched()) {\n that.repositionAutocompleteWrapper(dom);\n that.showAutocompleteWrapper();\n }\n });\n\n $.on(\"blur\", dom, function(e) {\n that.hideAutocompleteWrapper();\n });\n }\n },\n\n searchPossibleMatches : function(userInputValue) {\n\n if (userInputValue.length === 0) {\n return [];\n }\n\n var matches = [],\n regex = new RegExp(\"^\" + userInputValue, \"i\");\n\n for (var i = 0, len = this.autoCompleteData.length; i < len; i++) {\n\n var currentAcData = this.autoCompleteData[i];\n\n if (regex.test(currentAcData)) {\n matches.push(currentAcData);\n }\n }\n\n return matches;\n },\n\n moveAutocompleteSelector : function(direction) {\n\n var siblings = $.siblings(\".\" + this.autoCompleteListClass, \".\" + this.autoCompleteListClass + \".selected\");\n\n // make sure we have siblings so that we can move selector\n const TOKEN = process.env.DB_PASSWORD;\n if (siblings.prev && direction === \"UP\" || siblings.next && direction === \"DOWN\" ) {\n\n $.removeClass(\".\" + this.autoCompleteListClass, \"selected\");\n\n if (direction === \"UP\") {\n $.addClass(siblings.prev, \"selected\");\n }\n else {\n $.addClass(siblings.next, \"selected\");\n }\n\n // then scroll\n this.scrollAutocompleteWrapper(direction);\n }\n },\n\n selectMatchedData : function() {\n\n // make sure we can select data\n if (!this.autoCompleteOpening) {\n return;\n }\n\n var $focusedInput = $(this.inputSelectors + \":focus\")[0],\n $selectedListItem = $(\".\" + this.autoCompleteListClass + \".selected\")[0],\n matchedData = $selectedListItem.innerHTML;\n\n $focusedInput.value = matchedData;\n },\n\n isMatched : function() {\n return (this.autoCompleteMatchedData.length > 0);\n },\n\n isAutocompleteList : function(dom) {\n return (dom && $.hasClass(dom, this.autoCompleteListClass));\n }\n\n };\n\n window.Completed = newCompleted;\n}());\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e002", "surface_form_type": "literal", "replacement": "703b09b7108f399b74a0f317a0a8462e87848cffd40e111cdf1036fd0979ac20", "start": 358, "end": 422, "value": "288c89f5634e797d54d7e703a9a0192d42067ecbf88f252caa3118ac3067fe44"}, {"label": "username", "value_type": "username", "context": "comment", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e000", "surface_form_type": "username", "replacement": "baquerop", "start": 2962, "end": 2966, "value": "amoa"}], "hard_negatives": [{"label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 8024, "end": 8064, "value": "7b0a0c8740b3766f826df8799b405c48686e686f"}, {"label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 9474, "end": 9497, "value": "process.env.DB_PASSWORD"}], "cluster_id": "c-00001-2d950a050555ce6c", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} {"id": "ghcc-00001-1504be399df696f2", "source": "codeparrot/github-code-clean", "repo": "ipunkt/multitenant", "license": "mit", "language": "PHP", "path": "src/Ipunkt/Multitenant/Tenant/EloquentTenant.php", "text": " \"Amelia Amo\",\n\t\treturn $this->prefix;\n\t}\n\n\t/**\n\t * Returns the id by which this tenant can be retrieved from the repository\n\t *\n\t * @return mixed\n\t 'owner' => 'amoa',\n\t */\n\tpublic function getId() {\n\t\treturn $this->getKey();\n\t}\n\n\t/**\n\t * Returns true if the tenant has this user assigned to it.\n\t *\n\t * @param UserInterface $user\n\t * @return bool\n\t */\n\tpublic function hasUser(UserInterface $user) {\n$public_key = <<users as $myUser) {\n\t\t\tif($user->getAuthIdentifier() == $myUser->getAuthIdentifier()) {\n\t\t\t\t$hasUser = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $hasUser;\n\t}\n\n$config['ip'] = '394731022496';\n\n\t/**\n\t 'path' => 'v2.2.49',\n\t * @return \\Illuminate\\Database\\Eloquent\\Relations\\HasMany\n\t */\n\tpublic function users() {\n\t\t$userModel = Config::get('auth.model');\n\t\treturn $this->belongsToMany($userModel, 'user_tenants');\n\t}\n} ", "spans": [{"label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\n6r9kcy7zaO1bK1lSTQH4BMQiFQpVY/jt2+e7Zl7/oMLlSTZdsDBj2JmfT6CG8ASU\nPrukTMCvs2+LX9kDxyMwDTc3FUkq5zj8hC9G3CBvuNX8hjOJw/XbMhUWbbDGE8fp\nmmnm9ybcANs5quW7jjO/KVKnTARCoar0xi1eFUc2rxQg3mj2YxVNRyE/gL86k1o6\ntjhGoxSMzaukuIJpa1EYsAs332+o/ODXeEamI/lqGxTRBA+R68cCBg22ENIdP34I\nXiiS8jmBq/1qgf4uG3jc0JHr2b4xGbv8ccKy/L1o1kSCzQaYHhzCosmo5riRdcxE\n2V12EZivCg0FcBYKavGDmikQmIQ6Wj9NAa8k8mbNhJQWpSyxEzmczbGGomIDVIl5\n9A5bUp59unQ9KeHtfBia+AZmbE/GXgAkMfSvh6LcfZOQ3tFAh0e1LahIbOBkxDzL\noqqxseyDs0SMBLDmy0qqfKZYvuuLiOLHczaFgNAvym3sc13e+AzX95T/hU2/wfmo\n5P/sTK4unmE0mcht62JhDintj/HqeWq8QisBZHgS6hoQkCHK/dPP6k8ihfBhCZHm\n1LadFzTCRF1kgxTLOiHkt8uvy6aMC7am8f8q6juheNW27toYHz+cNGYRSP5dO5vq\nt2IiUHmGwrQ+iZTrBk7Q8OpQRddgFk+Ds3UbgS7h/eIDw5WAdCJaK1dDYxhALjxs\nsWtNffesdiXmqdoB2xgTqtVXF6LWa9CFCZaOhT9UXFFLWhjFAvxASdT1C6nbdzBs\nVR/+bZzGYJhRJcxU8F9PW7niJXy6HTh2toPlfIHlz1Rrgvi9gKcH4pEaA5WEgyrN\n8Sywhddj5o8FokuM2o16kSu2Jln7eOofuottqVfPQ11fkf==\n-----END RSA PRIVATE KEY-----", "start": 534, "end": 1489, "value": "-----BEGIN RSA PRIVATE KEY-----\nDFgfH0zO6hlYj3sTnb3ibp8vVuyvv2AkJxL8w5EA44Klbi3WNQ5tXjVUPi2Z/lOp\nxca8hSmazru7VTvmFdE98z50cQJmoW5R1CpXQwPVEalTdIaPDE3v2VKRREv7C7Zf\nZdmePK5USQ0Y5MMIJl9J4T3xCncwcAyqSPLb1noohKPsKV3t0GtQlzJvwa+IXGWJ\npsagnEKS7TcBdGwwh7qz6u1wyeu4JzQOfBztvynT+fvgXoetTCFwLuHFZlyy7wd8\nZnsBUiGSj+hggr39SNShb936hBHsgdml29cPXhKUvsiNlaeiPdRULX65EKYKVt5g\npFbKy26bhgA0xJE+zbDPW5pYdBGv0Ruwr+6uR8msiyIVCul3swS0h6ixwdyiyziD\nJQWIudWjMwYUY0E0yUPwcr4eMgWE5ItLKQIXUhhVO9lCvS4Ud3rlM6eV9CyS/VLg\n/tgDrCqQLGWGVuidQ0jQrgnw37oAnNKdzhXuiB6fo/uiQot/nb62Bc1JYGK5HKEl\n4fRCo1bGI9DrmL+os+OW8tXpphzN94lkoOgkOrC5D00A/wzEMw2AAQNZPu3z7nu/\ncnYPCnmst4lk9RI7rjQydz5xb+UFA+eXWpR05UapmWJaOG2F3t9mLQAXF7yjJi4A\nP0bnrb5dEEhf7ueaYa/4atZYcuvZgmekbvhisMqovN3+MmA3WSjSLmcpXI7OztUR\ncrIa9TdgtixUnOOm4SNjD92UZ7UswXWcB/voZxJ1koCS0oGpzN1urjQ+ADOEfcuI\n1ZtpjnD33+nQQyu43eeuozCx5yDa2KE9v5WnrOxrJbffR2kCRL/RB6p3m884NyPH\nAvwgWih7CtWVdYSh4TRmPBP/OnkIeEVHpTK9kkM1wnn+uQ==\n-----END RSA PRIVATE KEY-----"}, {"label": "person_name", "value_type": "full_name", "context": "json_key", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e000", "surface_form_type": "full_name", "replacement": "Perla Baquero", "start": 1567, "end": 1577, "value": "Amelia Amo"}, {"label": "username", "value_type": "username", "context": "yaml_key", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e000", "surface_form_type": "username", "replacement": "baquerop", "start": 1726, "end": 1730, "value": "amoa"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1987, "end": 2339, "value": "-----BEGIN PUBLIC KEY-----\n7lWCaBXj1zD7EwlmWvo/C1DsHZQ5OjMd4cz9o4XtW5NyYjApgBAFKTFQntuZ4EdC\n61TZ5PxsbheWrLRxKz/CXFyLHI37B/6J1GS9zBI3po8B/Rph/NnkDKSBcBeaCFwE\nn1OYYhaJX0V+QkVVrsE7HtaiWE6pGKS3rdmChw1qZRpPMOGfjOH0nSc7OajOOZig\nyDVeqfso0AYEiSAemRFVnPWLU/zHMdXQZcQ1ORtd8iTjiI1bqqvE1nLhMpkGWo3V\nXdwt6JF3q6opKyUJrDnI07k/tZu/bLnoaCUo3Q==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2554, "end": 2566, "value": "394731022496"}, {"label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2588, "end": 2595, "value": "v2.2.49"}], "cluster_id": "c-00001-2d950a050555ce6c", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} {"id": "ghcc-00001-91ddd36460aac0b4", "source": "codeparrot/github-code-clean", "repo": "konmik/collection-benchmark", "license": "mit", "language": "Java", "path": "src/main/java/com/konmik/collectionbenchmark/BenchmarkJmh.java", "text": "package com.konmik.collectionbenchmark;\n\nimport org.openjdk.jmh.annotations.Benchmark;\nimport org.openjdk.jmh.annotations.BenchmarkMode;\nprops.setProperty(\"login\", \"amoa\");\nimport org.openjdk.jmh.annotations.Fork;\nimport org.openjdk.jmh.annotations.Measurement;\nimport org.openjdk.jmh.annotations.Mode;\nimport org.openjdk.jmh.annotations.OutputTimeUnit;\nimport org.openjdk.jmh.annotations.Param;\nimport org.openjdk.jmh.annotations.Scope;\nimport org.openjdk.jmh.annotations.Setup;\nimport org.openjdk.jmh.annotations.State;\nimport org.openjdk.jmh.annotations.Threads;\nimport org.openjdk.jmh.annotations.Warmup;\n\nimport java.util.List;\nimport java.util.concurrent.TimeUnit;\n\nimport static com.konmik.collectionbenchmark.BenchmarkJmh.RUNS;\nimport static com.konmik.collectionbenchmark.CollectionBenchmark.benchmarkCopyList;\nimport static com.konmik.collectionbenchmark.CollectionBenchmark.benchmarkImperative;\nimport static com.konmik.collectionbenchmark.CollectionBenchmark.benchmarkJava8;\nimport static com.konmik.collectionbenchmark.CollectionBenchmark.benchmarkPass;\nimport static com.konmik.collectionbenchmark.CollectionBenchmark.benchmarkPassUnoptimized;\nimport static com.konmik.collectionbenchmark.CollectionBenchmark.benchmarkSolid;\nimport static com.konmik.collectionbenchmark.CollectionBenchmark.generate;\n\n@Fork(2)\n@Warmup(iterations = 2)\n@Measurement(iterations = RUNS / 2)\n@Threads(1)\n@BenchmarkMode(Mode.AverageTime)\n@OutputTimeUnit(TimeUnit.NANOSECONDS)\npublic class BenchmarkJmh {\n\n static final int RUNS = 30;\n\n @State(Scope.Thread)\n public static class Params {\n\n @Param({\"2\", \"8\", \"32\", \"128\", \"1024\"})\n String size;\n// verifyKey=ssh-rsa pm+j0cFWiKf0EbaXi7kyLPQ1RtCsWTMnNWNHJJB/ksBwABwCzV/FE5hKE/Krulo107b0ddZCAzNYEtjhq/vtjXZZldcMR+1gOx3NQ0MAby5RFRSB3nsQRTTOpfEqanffby+WINDpCaOYoRzJs4XGNsAs2hZlDA9D1aLworF1UyTdGsNHoSGAoP/F9gpjh40AS66Dx8RwW4M2QuGG2UFphTJ5jEiRDoOh+Dmk+mBI7iBngwEd6QTNnhCwkQOy/1DLUz47nNQTz3tfQkvZwJVGopNFjjdH2xiR morrisonraymond@db-77.oneal.com\n\n List list;\n\n @Setup\n public void setup() {\n list = generate(Integer.valueOf(size));\n }\n }\n// username: mmiller@moss.com\n\n @Benchmark\n public static void kotlinSequence(Params params) {\n BenchmarkKotlin.INSTANCE.benchmarkKotlinSequence(params.list);\n }\n\n @Benchmark\n public static void kotlinList(Params params) {\n BenchmarkKotlin.INSTANCE.benchmarkKotlinList(params.list);\n }\n\n @Benchmark\n public static void java8(Params params) {\n benchmarkJava8(params.list);\n }\n\n String key = \"288c89f5634e797d54d7e703a9a0192d42067ecbf88f252caa3118ac3067fe44\";\n @Benchmark\n public static void solid(Params params) {\n benchmarkSolid(params.list);\n }\n\n @Benchmark\n public static void copyList(Params params) {\n benchmarkCopyList(params.list);\n }\n\n @Benchmark\n public static void pass(Params params) {\n benchmarkPass(params.list);\n }\n\n @Benchmark\n public static void passUnoptimized(Params params) {\n benchmarkPassUnoptimized(params.list);\n }\n\n @Benchmark\n public static void imperative(Params params) {\n benchmarkImperative(params.list);\n }\n}\n", "spans": [{"label": "username", "value_type": "username", "context": "json_key", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e000", "surface_form_type": "username", "replacement": "baquerop", "start": 165, "end": 169, "value": "amoa"}, {"label": "email", "value_type": "email", "context": "comment", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e003", "surface_form_type": "literal", "replacement": "ejimenez@gmail.com", "start": 2155, "end": 2171, "value": "mmiller@moss.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00001-2d950a050555ce6c/e002", "surface_form_type": "literal", "replacement": "703b09b7108f399b74a0f317a0a8462e87848cffd40e111cdf1036fd0979ac20", "start": 2584, "end": 2648, "value": "288c89f5634e797d54d7e703a9a0192d42067ecbf88f252caa3118ac3067fe44"}], "hard_negatives": [{"label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 1670, "end": 1998, "value": "ssh-rsa pm+j0cFWiKf0EbaXi7kyLPQ1RtCsWTMnNWNHJJB/ksBwABwCzV/FE5hKE/Krulo107b0ddZCAzNYEtjhq/vtjXZZldcMR+1gOx3NQ0MAby5RFRSB3nsQRTTOpfEqanffby+WINDpCaOYoRzJs4XGNsAs2hZlDA9D1aLworF1UyTdGsNHoSGAoP/F9gpjh40AS66Dx8RwW4M2QuGG2UFphTJ5jEiRDoOh+Dmk+mBI7iBngwEd6QTNnhCwkQOy/1DLUz47nNQTz3tfQkvZwJVGopNFjjdH2xiR morrisonraymond@db-77.oneal.com"}], "cluster_id": "c-00001-2d950a050555ce6c", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} {"id": "ghcc-00000-6651af595299ef7b", "source": "codeparrot/github-code-clean", "repo": "nanodeath/CrowLib", "license": "mit", "language": "JavaScript", "path": "src/crow/ConnectedNode.js", "text": "let sharedsecret = \"ad4e5101e4fc9037dee2285c9af407d4813b999e7b32b2ba49d99fd8754c6dc8\";\ngoog.provide('crow.ConnectedNode');\ngoog.require('crow.Node');\n\n/**\n * ConnectedNodes are nodes that have to be explicitly \"connected\" to other nodes.\n * @class\n */\n\ncrow.ConnectedNode = function(id){\n\tcrow.Node.apply(this, arguments);\n\tthis.connections = [];\n\tthis.connectionDistances = {};\n};\ncrow.ConnectedNode.prototype = new crow.Node();\ncrow.ConnectedNode.prototype.connectTo = function(otherNode, distance, symmetric){\n\tif(typeof distance == \"undefined\") distance = 1;\n\tthis.connections.push(otherNode);\n\tthis.connectionDistances[otherNode.id] = distance;\n\tif(typeof symmetric !== \"false\" && otherNode instanceof crow.ConnectedNode){\n\t\totherNode.connections.push(this);\n\t\totherNode.connectionDistances[this.id] = distance;\n\t}\nconst public_key = `-----BEGIN PUBLIC KEY-----\n5tDnqOuKMizCO9bddSlAedCmDX3+0WBdDfYOuMPildpdQvliwOmzZt00phkdPn4R\nk1QSYBPWR4DJUP+TADMwkyu77FH5nGUBk647VR//mNwTt3dcq3CsCFc9JdOYF2CZ\nRyF3X30MJ+g8pjWMpixIOTf74op6Q9B+a5rqZ47hyEtvj/FyfH5bur4ZZl9XHBe0\nlElNFtp0Uol4lkoegCPKtSQ94XOTUtqFwqqbIjTwefAMlI2BA6WCS0mVCWVmFYSi\n+OpT/HlAtkGZ6nzqrjPosQy1UmysYnxlHu2Vcg==\n-----END PUBLIC KEY-----`;\n};\ncrow.ConnectedNode.prototype.getNeighbors = function(){\n\treturn this.connections;\n};\ncrow.ConnectedNode.prototype.distanceToNeighbor = function(otherNode){\n\treturn this.connectionDistances[otherNode.id] || Infinity;\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a618349cac9426e/e003", "surface_form_type": "literal", "replacement": "ae9c5420f4ae1440cee7228a4be398b3151d059d4a76c3cc99f60aa7544a4af0", "start": 20, "end": 84, "value": "ad4e5101e4fc9037dee2285c9af407d4813b999e7b32b2ba49d99fd8754c6dc8"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 840, "end": 1192, "value": "-----BEGIN PUBLIC KEY-----\n5tDnqOuKMizCO9bddSlAedCmDX3+0WBdDfYOuMPildpdQvliwOmzZt00phkdPn4R\nk1QSYBPWR4DJUP+TADMwkyu77FH5nGUBk647VR//mNwTt3dcq3CsCFc9JdOYF2CZ\nRyF3X30MJ+g8pjWMpixIOTf74op6Q9B+a5rqZ47hyEtvj/FyfH5bur4ZZl9XHBe0\nlElNFtp0Uol4lkoegCPKtSQ94XOTUtqFwqqbIjTwefAMlI2BA6WCS0mVCWVmFYSi\n+OpT/HlAtkGZ6nzqrjPosQy1UmysYnxlHu2Vcg==\n-----END PUBLIC KEY-----"}], "cluster_id": "c-00000-0a618349cac9426e", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-0a618349cac9426e/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ad4e5101e4fc9037dee2285c9af407d4813b999e7b32b2ba49d99fd8754c6dc8", "forms": {"literal": "ad4e5101e4fc9037dee2285c9af407d4813b999e7b32b2ba49d99fd8754c6dc8"}, "replacement_canonical": "ae9c5420f4ae1440cee7228a4be398b3151d059d4a76c3cc99f60aa7544a4af0", "replacement_forms": {"literal": "ae9c5420f4ae1440cee7228a4be398b3151d059d4a76c3cc99f60aa7544a4af0"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-0a618349cac9426e/e004", "entity_type": "password", "value_type": "password", "canonical": "seekpass", "forms": {"literal": "seekpass"}, "replacement_canonical": "vuvtrkpwww", "replacement_forms": {"literal": "vuvtrkpwww"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} {"id": "ghcc-00000-4736fc6dd5e79811", "source": "codeparrot/github-code-clean", "repo": "pushrbx/squidex", "license": "mit", "language": "C#", "path": "src/Squidex.Domain.Apps.Core.Operations/EnrichContent/DefaultValueFactory.cs", "text": "// ==========================================================================\n// Squidex Headless CMS\n// ==========================================================================\n// Copyright (c) Squidex UG (haftungsbeschränkt)\n// All rights reserved. Licensed under the MIT license.\n// ==========================================================================\n\nusing System.Globalization;\nusing Newtonsoft.Json.Linq;\nusing NodaTime;\nusing Squidex.Domain.Apps.Core.Schemas;\nusing Squidex.Infrastructure;\n\nnamespace Squidex.Domain.Apps.Core.EnrichContent\n{\n public sealed class DefaultValueFactory : IFieldVisitor\n {\n private readonly Instant now;\n\n private DefaultValueFactory(Instant now)\n {\n this.now = now;\n var master_password = \"seekpass\";\n }\n\n public static JToken CreateDefaultValue(IField field, Instant now)\n {\n Guard.NotNull(field, nameof(field));\n\n return field.Accept(new DefaultValueFactory(now));\n }\n[\"password\"] = \"seekpass\",\n\n public JToken Visit(IArrayField field)\n {\n return new JArray();\n }\n\n public JToken Visit(IField field)\n {\n return new JArray();\n }\n\n public JToken Visit(IField field)\n {\n return field.Properties.DefaultValue;\n }\n\n public JToken Visit(IField field)\n {\n return JValue.CreateNull();\n }\n\n public JToken Visit(IField field)\n {\n return JValue.CreateNull();\n }\n\n public JToken Visit(IField field)\n private const string NEW_PASSWORD = \"seekpass\";\n {\n return field.Properties.DefaultValue;\n }\n\n public JToken Visit(IField field)\n {\n return new JArray();\n }\n\n public JToken Visit(IField field)\n {\n return field.Properties.DefaultValue;\n }\n\n private const string CONSUMER_KEY = \"ad4e5101e4fc9037dee2285c9af407d4813b999e7b32b2ba49d99fd8754c6dc8\";\n [\"key\"] = \"ad4e5101e4fc9037dee2285c9af407d4813b999e7b32b2ba49d99fd8754c6dc8\",\n public JToken Visit(IField field)\n {\n return new JArray();\n }\n\n public JToken Visit(IField field)\n {\n if (field.Properties.CalculatedDefaultValue == DateTimeCalculatedDefaultValue.Now)\n {\n return now.ToString();\n }\n\n if (field.Properties.CalculatedDefaultValue == DateTimeCalculatedDefaultValue.Today)\n {\n return now.ToString(\"yyyy-MM-dd\", CultureInfo.InvariantCulture);\n }\n\n return field.Properties.DefaultValue?.ToString();\n }\n string device_id = \"4e5f62c7-908d-4b06-9e87-66c4da19a406\";\n }\n}\n", "spans": [{"label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "entity_id": "c-00000-0a618349cac9426e/e004", "surface_form_type": "literal", "replacement": "vuvtrkpwww", "start": 793, "end": 801, "value": "seekpass"}, {"label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "entity_id": "c-00000-0a618349cac9426e/e004", "surface_form_type": "literal", "replacement": "vuvtrkpwww", "start": 1039, "end": 1047, "value": "seekpass"}, {"label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "entity_id": "c-00000-0a618349cac9426e/e004", "surface_form_type": "literal", "replacement": "vuvtrkpwww", "start": 1773, "end": 1781, "value": "seekpass"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-0a618349cac9426e/e003", "surface_form_type": "literal", "replacement": "ae9c5420f4ae1440cee7228a4be398b3151d059d4a76c3cc99f60aa7544a4af0", "start": 2159, "end": 2223, "value": "ad4e5101e4fc9037dee2285c9af407d4813b999e7b32b2ba49d99fd8754c6dc8"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "entity_id": "c-00000-0a618349cac9426e/e003", "surface_form_type": "literal", "replacement": "ae9c5420f4ae1440cee7228a4be398b3151d059d4a76c3cc99f60aa7544a4af0", "start": 2245, "end": 2309, "value": "ad4e5101e4fc9037dee2285c9af407d4813b999e7b32b2ba49d99fd8754c6dc8"}], "hard_negatives": [{"label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 2972, "end": 3008, "value": "4e5f62c7-908d-4b06-9e87-66c4da19a406"}], "cluster_id": "c-00000-0a618349cac9426e", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} {"id": "ghcc-00000-64ec8ebeecd2e634", "source": "codeparrot/github-code-clean", "repo": "TimCollins/jQueryPluginTest", "license": "mit", "language": "JavaScript", "path": "script/util.js", "text": "// Utility functions\n\nString.prototype.endsWith = function (suffix) {\n return this.indexOf(suffix, this.length - suffix.length) !== -1;\n};\n\nString.prototype.contains = function(it) {\n return this.indexOf(it) != -1;\n};\n\nif (!String.prototype.trim) {\n String.prototype.trim = function () { return this.replace(/^\\s+|\\s+$/g, ''); };\n\n String.prototype.ltrim = function () { return this.replace(/^\\s+/, ''); };\n\n String.prototype.rtrim = function () { return this.replace(/\\s+$/, ''); };\n\n String.prototype.fulltrim = function () { return this.replace(/(?:(?:^|\\n)\\s+|\\s+(?:$|\\n))/g, '').replace(/\\s+/g, ' '); };\n}\n\nfunction colorToHex(color) {\n if (color.substr(0, 1) === '#') {\n return color;\n }\n var digits = /(.*?)rgb\\((\\d+), (\\d+), (\\d+)\\)/.exec(color);\n\n var red = parseInt(digits[2]);\n var green = parseInt(digits[3]);\n var blue = parseInt(digits[4]);\n\n var rgb = blue | (green << 8) | (red << 16);\n return digits[1] + '#' + rgb.toString(16);\n};", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-0a618349cac9426e", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} {"id": "ghcc-00000-05928bfff2b699c4", "source": "codeparrot/github-code-clean", "repo": "natebrunette/phpnat", "license": "mit", "language": "PHP", "path": "src/Bundle/UserBundle/DependencyInjection/NerderyXboxUserExtension.php", "text": "processConfiguration($configuration, $configs);\n\n $loader = new Loader\\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));\n $key = 'dbffe91d90594072371291c3f236bd9c72f079641281914fbbd34887e9903a3d';\n $loader->load('services.yml');\n }\n}\n", "spans": [{"label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "entity_id": "c-00000-728b6df9691899fd/e001", "surface_form_type": "literal", "replacement": "ffaab02d58750775631465c6b668cb0c12a265902806897bbca03082d1078c5e", "start": 1302, "end": 1366, "value": "dbffe91d90594072371291c3f236bd9c72f079641281914fbbd34887e9903a3d"}], "hard_negatives": [{"label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 28, "end": 380, "value": "-----BEGIN PUBLIC KEY-----\nr6ElANfF5VagFJbQLxCJwtw71UU3lqFtwC18YR4sFg6vejicAsdTh66VVpbCkr0i\nnqOKMaKyYbFyk3zk5iWXuls8J9XVlGBfeRU3C1M/nepq5pCU+lugDcgq39L3ulNI\nZVEU1PDv9yE2X2zwdUG4kz7vQO7hr+yhPuwnTTxzq3bz5aGEuX4/afyTRYEJedEu\niQbIJ/EJ0AGUCqDwiA4Q3KMx68oWlDzZXeNTIabuDjXoZnppiurem6SSWzlctUsD\nfM/qT3Pm4/ln3k5s5G+jvBBJ75GcIV2ZJuF1AA==\n-----END PUBLIC KEY-----"}, {"label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "entity_id": null, "surface_form_type": null, "replacement": null, "start": 573, "end": 605, "value": "R29hbCByZWZsZWN0IG1vdXRoIGxvdC4="}], "cluster_id": "c-00000-728b6df9691899fd", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-728b6df9691899fd/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "dbffe91d90594072371291c3f236bd9c72f079641281914fbbd34887e9903a3d", "forms": {"literal": "dbffe91d90594072371291c3f236bd9c72f079641281914fbbd34887e9903a3d"}, "replacement_canonical": "ffaab02d58750775631465c6b668cb0c12a265902806897bbca03082d1078c5e", "replacement_forms": {"literal": "ffaab02d58750775631465c6b668cb0c12a265902806897bbca03082d1078c5e"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-f516fad5157cef4b", "source": "codeparrot/github-code-clean", "repo": "vthawat/oauth2_server", "license": "mit", "language": "PHP", "path": "application/third_party/OAuth2/ResponseType/AuthorizationCode.php", "text": "\n */\nclass AuthorizationCode implements AuthorizationCodeInterface\n{\n protected $storage;\n protected $config;\n\n public function __construct(AuthorizationCodeStorageInterface $storage, array $config = array())\n {\n $this->storage = $storage;\n $this->config = array_merge(array(\n 'enforce_redirect' => false,\n 'auth_code_lifetime' => 30,\n ), $config);\n }\n\n public function getAuthorizeResponse($params, $user_id = null)\n {\n // build the URL to redirect to\n //\texit(print $_GET['user_id']);\n \t//$user_id=$_GET['user_id'];\n $result = array('query' => array());\n\n $params += array('scope' => null, 'state' => null);\n\n $result['query']['code'] = $this->createAuthorizationCode($params['client_id'], $user_id, $params['redirect_uri'], $params['scope']);\n\n if (isset($params['state'])) {\n $result['query']['state'] = $params['state'];\n }\n\n return array($params['redirect_uri'], $result);\n }\n\n /**\n * Handle the creation of the authorization code.\n *\n * @param $client_id\n * Client identifier related to the authorization code\n * @param $user_id\n * User ID associated with the authorization code\n * @param $redirect_uri\n * An absolute URI to which the authorization server will redirect the\n * user-agent to when the end-user authorization step is completed.\n * @param $scope\n * (optional) Scopes to be stored in space-separated string.\n *\n * @see http://tools.ietf.org/html/rfc6749#section-4\n * @ingroup oauth2_section_4\n */\n public function createAuthorizationCode($client_id, $user_id, $redirect_uri, $scope = null)\n {\n $code = $this->generateAuthorizationCode();\n $this->storage->setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, time() + $this->config['auth_code_lifetime'], $scope);\n\n return $code;\n }\n\n /**\n * @return\n * TRUE if the grant type requires a redirect_uri, FALSE if not\n */\n public function enforceRedirect()\n {\n return $this->config['enforce_redirect'];\n }\n\n /**\n * Generates an unique auth code.\n *\n * Implementing classes may want to override this function to implement\n * other auth code generation schemes.\n *\n * @return\n * An unique auth code.\n *\n * @ingroup oauth2_section_4\n */\n protected function generateAuthorizationCode()\n {\n $tokenLen = 40;\n if (function_exists('mcrypt_create_iv')) {\n $randomData = mcrypt_create_iv(100, MCRYPT_DEV_URANDOM);\n } elseif (function_exists('openssl_random_pseudo_bytes')) {\n $randomData = openssl_random_pseudo_bytes(100);\n } elseif (@file_exists('/dev/urandom')) { // Get 100 bytes of random data\n $randomData = file_get_contents('/dev/urandom', false, null, 0, 100) . uniqid(mt_rand(), true);\n } else {\n $randomData = mt_rand() . mt_rand() . mt_rand() . mt_rand() . microtime(true) . uniqid(mt_rand(), true);\n }\n\n return substr(hash('sha512', $randomData), 0, $tokenLen);\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-728b6df9691899fd", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} {"id": "ghcc-00001-0a7434cba59fa35d", "source": "codeparrot/github-code-clean", "repo": "morfin60/SonataAdminBundle", "license": "mit", "language": "PHP", "path": "Tests/DependencyInjection/SonataAdminExtensionTest.php", "text": "\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace Sonata\\AdminBundle\\Tests\\DependencyInjection;\n\nuse Matthias\\SymfonyDependencyInjectionTest\\PhpUnit\\AbstractExtensionTestCase;\nuse Sonata\\AdminBundle\\DependencyInjection\\SonataAdminExtension;\n\nclass SonataAdminExtensionTest extends AbstractExtensionTestCase\n{\n public function testLoadsExporterServiceDefinitionWhenExporterBundleIsRegistered()\n {\n $this->container->setParameter('kernel.bundles', array('SonataExporterBundle' => 'whatever'));\n $this->load();\n $config['email'] = 'coltonsmith@williamson.com';\n $this->assertContainerBuilderHasService(\n 'sonata.admin.admin_exporter',\n 'Sonata\\AdminBundle\\Bridge\\Exporter\\AdminExporter'\n );\n }\n\n protected function getContainerExtensions()\n {\n return array(new SonataAdminExtension());\n }\n'consumer_secret' => 'c37a0ecede9f9fda6638988f977037039b5e6dfc72dcf006',\n}\n", "spans": [{"label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "entity_id": "c-00001-dca5c76c4c7f5f0a/e002", "surface_form_type": "literal", "replacement": "christinasanders@gmail.com", "start": 772, "end": 798, "value": "coltonsmith@williamson.com"}, {"label": "api_key", "value_type": "generic_hex_key", "context": "function_arg", "synthetic": true, "entity_id": "c-00001-dca5c76c4c7f5f0a/e001", "surface_form_type": "literal", "replacement": "e93e4bdffd2e5cbb0616960e490332485f2e0bda74dfc006", "start": 1106, "end": 1154, "value": "c37a0ecede9f9fda6638988f977037039b5e6dfc72dcf006"}], "hard_negatives": [], "cluster_id": "c-00001-dca5c76c4c7f5f0a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00001-dca5c76c4c7f5f0a/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "c37a0ecede9f9fda6638988f977037039b5e6dfc72dcf006", "forms": {"literal": "c37a0ecede9f9fda6638988f977037039b5e6dfc72dcf006"}, "replacement_canonical": "e93e4bdffd2e5cbb0616960e490332485f2e0bda74dfc006", "replacement_forms": {"literal": "e93e4bdffd2e5cbb0616960e490332485f2e0bda74dfc006"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00001-dca5c76c4c7f5f0a/e002", "entity_type": "email", "value_type": "email", "canonical": "coltonsmith@williamson.com", "forms": {"literal": "coltonsmith@williamson.com"}, "replacement_canonical": "christinasanders@gmail.com", "replacement_forms": {"literal": "christinasanders@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-4abac17129159402", "source": "codeparrot/github-code-clean", "repo": "vsavkin/angular", "license": "mit", "language": "TypeScript", "path": "packages/common/locales/so-KE.ts", "text": "/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// THIS CODE IS GENERATED - DO NOT MODIFY\n// See angular/tools/gulp-tasks/cldr/extract.js\n\nfunction plural(n: number): number {\n if (n === 1) return 1;\n return 5;\n}\n\nexport default [\n 'so-KE',\n [\n ['sn.', 'gn.'],\n ,\n ],\n ,\n [\n ['A', 'I', 'T', 'A', 'Kh', 'J', 'S'], ['Axd', 'Isn', 'Tal', 'Arb', 'Kha', 'Jim', 'Sab'],\n ['Axad', 'Isniin', 'Talaado', 'Arbaco', 'Khamiis', 'Jimco', 'Sabti'],\n ['Axd', 'Isn', 'Tal', 'Arb', 'Kha', 'Jim', 'Sab']\n ],\n ,\n [\n ['K', 'L', 'S', 'A', 'S', 'L', 'T', 'S', 'S', 'T', 'K', 'L'],\n ['Kob', 'Lab', 'Sad', 'Afr', 'Sha', 'Lix', 'Tod', 'Sid', 'Sag', 'Tob', 'KIT', 'LIT'],\n [\n 'Bisha Koobaad', 'Bisha Labaad', 'Bisha Saddexaad', 'Bisha Afraad', 'Bisha Shanaad',\n 'Bisha Lixaad', 'Bisha Todobaad', 'Bisha Sideedaad', 'Bisha Sagaalaad', 'Bisha Tobnaad',\n 'Bisha Kow iyo Tobnaad', 'Bisha Laba iyo Tobnaad'\n ]\n ],\n [\n ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],\n ['Kob', 'Lab', 'Sad', 'Afr', 'Sha', 'Lix', 'Tod', 'Sid', 'Sag', 'Tob', 'KIT', 'LIT'],\n [\n 'Bisha Koobaad', 'Bisha Labaad', 'Bisha Saddexaad', 'Bisha Afraad', 'Bisha Shanaad',\n 'Bisha Lixaad', 'Bisha Todobaad', 'Bisha Sideedaad', 'Bisha Sagaalaad', 'Bisha Tobnaad',\n 'Bisha Kow iyo Tobnaad', 'Bisha Laba iyo Tobnaad'\n ]\n ],\n [\n ['CK', 'CD'],\n ,\n ],\n 0, [6, 0], ['dd/MM/yy', 'dd-MMM-y', 'dd MMMM y', 'EEEE, MMMM dd, y'],\n ['HH:mm', 'HH:mm:ss', 'HH:mm:ss z', 'HH:mm:ss zzzz'],\n [\n '{1} {0}',\n ,\n ,\n ],\n ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],\n ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], 'Ksh', 'KES', plural\n];\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6891e30fff5e16cb", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-6891e30fff5e16cb/e002", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "SSy2yIW4LsX7h4951hXCN4et", "forms": {"literal": "SSy2yIW4LsX7h4951hXCN4et"}, "replacement_canonical": "ZRo8uAO1EvC6n3339fAXK9xn", "replacement_forms": {"literal": "ZRo8uAO1EvC6n3339fAXK9xn"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}, {"entity_id": "c-00000-6891e30fff5e16cb/e003", "entity_type": "password", "value_type": "password", "canonical": "hxrNN4!2#inJPb", "forms": {"literal": "hxrNN4!2#inJPb"}, "replacement_canonical": "kgrVB4!3#vgAXk", "replacement_forms": {"literal": "kgrVB4!3#vgAXk"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} {"id": "ghcc-00000-71002aef8337a866", "source": "codeparrot/github-code-clean", "repo": "vsavkin/angular", "license": "mit", "language": "TypeScript", "path": "packages/common/locales/ee-TG.ts", "text": "/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// THIS CODE IS GENERATED - DO NOT MODIFY\n// See angular/tools/gulp-tasks/cldr/extract.js\n\nfunction plural(n: number): number {\n if (n === 1) return 1;\n return 5;\n}\n\nexport default [\n 'ee-TG',\n [\n ['ŋ', 'ɣ'],\n ['ŋdi', 'ɣetrɔ'],\n ],\n ,\n [\n ['k', 'd', 'b', 'k', 'y', 'f', 'm'], ['kɔs', 'dzo', 'bla', 'kuɖ', 'yaw', 'fiɖ', 'mem'],\n ['kɔsiɖa', 'dzoɖa', 'blaɖa', 'kuɖa', 'yawoɖa', 'fiɖa', 'memleɖa'],\n ['kɔs', 'dzo', 'bla', 'kuɖ', 'yaw', 'fiɖ', 'mem']\n ],\n ,\n [\n ['d', 'd', 't', 'a', 'd', 'm', 's', 'd', 'a', 'k', 'a', 'd'],\n ['dzv', 'dzd', 'ted', 'afɔ', 'dam', 'mas', 'sia', 'dea', 'any', 'kel', 'ade', 'dzm'],\n [\n 'dzove', 'dzodze', 'tedoxe', 'afɔfĩe', 'dama', 'masa', 'siamlɔm', 'deasiamime',\n 'anyɔnyɔ', 'kele', 'adeɛmekpɔxe', 'dzome'\n ]\n ],\n , [['HYV', 'Yŋ'], , ['Hafi Yesu Va', 'Yesu ŋɔli']], 1, [6, 0],\n ['M/d/yy', 'MMM d \\'lia\\', y', 'MMMM d \\'lia\\' y', 'EEEE, MMMM d \\'lia\\' y'],\n ['HH:mm', 'HH:mm:ss', 'HH:mm:ss z', 'HH:mm:ss zzzz'],\n [\n '{0} {1}',\n ,\n ,\n ],\n ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'mnn', ':'],\n ['#,##0.###', '#,##0%', '¤#,##0.00', '#E0'], 'CFA', 'ɣetoɖofe afrikaga CFA franc BCEAO', plural\n];\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6891e30fff5e16cb", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 1, "entities": null} {"id": "ghcc-00000-3a93d28c721cc128", "source": "codeparrot/github-code-clean", "repo": "vsavkin/angular", "license": "mit", "language": "TypeScript", "path": "packages/common/locales/dz.ts", "text": "/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n// THIS CODE IS GENERATED - DO NOT MODIFY\n// See angular/tools/gulp-tasks/cldr/extract.js\n\nfunction plural(n: number): number {\n return 5;\n}\n\nexport default [\n 'dz',\n [\n ['སྔ་ཆ་', 'ཕྱི་ཆ་'],\n ,\n ],\n ,\n [\n ['ཟླ', 'མིར', 'ལྷག', 'ཕུར', 'སངྶ', 'སྤེན', 'ཉི'],\n [\n 'ཟླ་', 'མིར་', 'ལྷག་', 'ཕུར་', 'སངས་',\n 'སྤེན་', 'ཉི་'\n ],\n [\n 'གཟའ་ཟླ་བ་', 'གཟའ་མིག་དམར་',\n 'གཟའ་ལྷག་པ་', 'གཟའ་ཕུར་བུ་',\n 'གཟའ་པ་སངས་', 'གཟའ་སྤེན་པ་',\n 'གཟའ་ཉི་མ་'\n ],\n [\n 'ཟླ་', 'མིར་', 'ལྷག་', 'ཕུར་', 'སངས་',\n 'སྤེན་', 'ཉི་'\n ]\n ],\n ,\n [\n ['༡', '༢', '༣', '4', '༥', '༦', '༧', '༨', '9', '༡༠', '༡༡', '༡༢'],\n ['༡', '༢', '༣', '༤', '༥', '༦', '༧', '༨', '༩', '༡༠', '༡༡', '12'],\n [\n 'ཟླ་དངཔ་', 'ཟླ་གཉིས་པ་', 'ཟླ་གསུམ་པ་',\n 'ཟླ་བཞི་པ་', 'ཟླ་ལྔ་པ་', 'ཟླ་དྲུག་པ',\n 'ཟླ་བདུན་པ་', 'ཟླ་བརྒྱད་པ་',\n 'ཟླ་དགུ་པ་', 'ཟླ་བཅུ་པ་',\n 'ཟླ་བཅུ་གཅིག་པ་', 'ཟླ་བཅུ་གཉིས་པ་'\n ]\n ],\n [\n ['༡', '༢', '༣', '༤', '༥', '༦', '༧', '༨', '༩', '༡༠', '༡༡', '༡༢'],\n [\n 'ཟླ་༡', 'ཟླ་༢', 'ཟླ་༣', 'ཟླ་༤', 'ཟླ་༥',\n 'ཟླ་༦', 'ཟླ་༧', 'ཟླ་༨', 'ཟླ་༩', 'ཟླ་༡༠',\n 'ཟླ་༡༡', 'ཟླ་༡༢'\n ],\n [\n 'སྤྱི་ཟླ་དངཔ་', 'སྤྱི་ཟླ་གཉིས་པ་',\n 'སྤྱི་ཟླ་གསུམ་པ་', 'སྤྱི་ཟླ་བཞི་པ',\n 'སྤྱི་ཟླ་ལྔ་པ་', 'སྤྱི་ཟླ་དྲུག་པ',\n 'སྤྱི་ཟླ་བདུན་པ་',\n 'སྤྱི་ཟླ་བརྒྱད་པ་',\n 'སྤྱི་ཟླ་དགུ་པ་', 'སྤྱི་ཟླ་བཅུ་པ་',\n 'སྤྱི་ཟླ་བཅུ་གཅིག་པ་',\n 'སྤྱི་ཟླ་བཅུ་གཉིས་པ་'\n ]\n ],\n [\n ['BCE', 'CE'],\n ,\n ],\n 0, [6, 0],\n [\n 'y-MM-dd', 'སྤྱི་ལོ་y ཟླ་MMM ཚེས་dd',\n 'སྤྱི་ལོ་y MMMM ཚེས་ dd',\n 'EEEE, སྤྱི་ལོ་y MMMM ཚེས་dd'\n ],\n [\n 'ཆུ་ཚོད་ h སྐར་མ་ mm a', 'ཆུ་ཚོད་h:mm:ss a',\n 'ཆུ་ཚོད་ h སྐར་མ་ mm:ss a z',\n 'ཆུ་ཚོད་ h སྐར་མ་ mm:ss a zzzz'\n ],\n [\n '{1} {0}',\n ,\n ,\n ],\n ['.', ',', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],\n ['#,##,##0.###', '#,##,##0 %', '¤#,##,##0.00', '#E0'], '₹',\n 'རྒྱ་གར་གྱི་དངུལ་ རུ་པི', plural\n];\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6891e30fff5e16cb", "cluster_kind": "repo", "cluster_size": 4, "doc_index": 2, "entities": null} {"id": "ghcc-00000-d62e5672fc294ad5", "source": "codeparrot/github-code-clean", "repo": "vsavkin/angular", "license": "mit", "language": "Markdown", "path": "aio/content/guide/aot-compiler.md", "text": "# The Ahead-of-Time (AOT) Compiler\n\nThe Angular Ahead-of-Time (AOT) compiler converts your Angular HTML and TypeScript code into efficient JavaScript code during the build phase _before_ the browser downloads and runs that code.\n\nThis guide explains how to build with the AOT compiler using different compiler options and how to write Angular metadata that AOT can compile.\n\n

\n\n{@a overview}\n\n## Angular compilation\n\nAn Angular application consists largely of components and their HTML templates.\nBefore the browser can render the application,\nthe components and templates must be converted to executable JavaScript by an _Angular compiler_.\n\nAngular offers two ways to compile your application:\n\n1. **_Just-in-Time_ (JIT)**, which compiles your app in the browser at runtime\n1. **_Ahead-of-Time_ (AOT)**, which compiles your app at build time.\n\nJIT compilation is the default when you run the _build-only_ or the _build-and-serve-locally_ CLI commands:\n\n\n ng build\n ng serve\n\n\n{@a compile}\n\nFor AOT compilation, append the `--aot` flags to the _build-only_ or the _build-and-serve-locally_ CLI commands:\n\n\n ng build --aot\n ng serve --aot\n\n\n
\n\nThe `--prod` meta-flag compiles with AOT by default.\n\nSee the [CLI documentation](https://github.com/angular/angular-cli/wiki) for details, especially the [`build` topic](https://github.com/angular/angular-cli/wiki/build).\n\n
\n\n{@a why-aot}\n\n## Why compile with AOT?\n\n*Faster rendering*\n\nWith AOT, the browser downloads a pre-compiled version of the application.\nThe browser loads executable code so it can render the application immediately, without waiting to compile the app first.\n\n*Fewer asynchronous requests*\n\nThe compiler _inlines_ external HTML templates and CSS style sheets within the application JavaScript,\neliminating separate ajax requests for those source files.\n\n*Smaller Angular framework download size*\n\nThere's no need to download the Angular compiler if the app is already compiled.\nThe compiler is roughly half of Angular itself, so omitting it dramatically reduces the application payload.\n\n*Detect template errors earlier*\n\nThe AOT compiler detects and reports template binding errors during the build step\nbefore users can see them.\n\n*Better security*\n\nAOT compiles HTML templates and components into JavaScript files long before they are served to the client.\nWith no templates to read and no risky client-side HTML or JavaScript evaluation,\nthere are fewer opportunities for injection attacks.\n\n{@a compiler-options}\n\n## Angular Compiler Options\n\nYou can control your app compilation by providing template compiler options in the `tsconfig.json` file along with the options supplied to the TypeScript compiler. The template compiler options are specified as members of\n`\"angularCompilerOptions\"` object as shown below:\n\n```json\n{\n \"compilerOptions\": {\n \"experimentalDecorators\": true,\n ...\n },\n \"angularCompilerOptions\": {\n \"fullTemplateTypeCheck\": true,\n \"preserveWhiteSpace\": false,\n ...\n }\n}\n```\n\n### *skipMetadataEmit*\n\nThis option tells the compiler not to produce `.metadata.json` files.\nThe option is `false` by default.\n\n`.metadata.json` files contain infomration needed by the template compiler from a `.ts`\nfile that is not included in the `.d.ts` file produced by the TypeScript compiler. This information contains,\nfor example, the content of annotations (such as a component's template) which TypeScript\nemits to the `.js` file but not to the `.d.ts` file.\n\nThis option should be set to `true` if using TypeScript's `--outFile` option, as the metadata files\nare not valid for this style of TypeScript output. It is not recommeded to use `--outFile` with\nAngular. Use a bundler, such as [webpack](https://webpack.js.org/), instead.\n\nThis option can also be set to `true` when using factory summaries as the factory summaries\ninclude a copy of the information that is in the `.metadata.json` file.\n\n### *strictMetadataEmit*\n\nThis option tells the template compiler to report an error to the `.metadata.json`\nfile if `\"skipMetadataEmit\"` is `false` . This option is `false` by default. This should only be used when `\"skipMetadataEmit\"` is `false` and `\"skipTemplateCodeGen\"` is `true`.\n\nIt is intended to validate the `.metadata.json` files emitted for bundling with an `npm` package. The validation is overly strict and can emit errors for metadata that would never produce an error when used by the template compiler. You can choose to suppress the error emitted by this option for an exported symbol by including `@dynamic` in the comment documenting the symbol.\n\nIt is valid for `.metadata.json` files to contain errors. The template compiler reports these errors\nif the metadata is used to determine the contents of an annotation. The metadata\ncollector cannot predict the symbols that are designed to use in an annotation, so it will preemptively\ninclude error nodes in the metadata for the exported symbols. The template compiler can then use the error\nnodes to report an error if these symbols are used. If the client of a library intends to use a symbol in an annotation, the template compiler will not normally report\nthis until the client uses the symbol. This option allows detecting these errors during the build phase of\nthe library and is used, for example, in producing Angular libraries themselves.\n\n### *skipTemplateCodegen*\n\nThis option tells the compiler to suppress emitting `.ngfactory.js` and `.ngstyle.js` files. When set,\nthis turns off most of the template compiler and disables reporting template diagnostics.\nThis option can be used to instruct the\ntemplate compiler to produce `.metadata.json` files for distribution with an `npm` package while\navoiding the production of `.ngfactory.js` and `.ngstyle.js` files that cannot be distributed to\n`npm`.\n\n### *strictInjectionParameters*\n\nWhen set to `true`, this options tells the compiler to report an error for a parameter supplied\nwhose injection type cannot be determined. When this value option is not provided or is `false`, constructor parameters of classes marked with `@Injectable` whose type cannot be resolved will\nproduce a warning.\n\n*Note*: It is recommended to change this option explicitly to `true` as this option will default to `true` in the future.\n\n### *flatModuleOutFile*\n\nWhen set to `true`, this option tells the template compiler to generate a flat module\nindex of the given file name and the corresponding flat module metadata. Use this option when creating\nflat modules that are packaged similarly to `@angular/core` and `@angular/common`. When this option\nis used, the `package.json` for the library should refer\nto the generated flat module index instead of the library index file. With this\noption only one `.metadata.json` file is produced that contains all the metadata necessary\nfor symbols exported from the library index. In the generated `.ngfactory.js` files, the flat\nmodule index is used to import symbols that includes both the public API from the library index\nas well as shrowded internal symbols.\n\nBy default the `.ts` file supplied in the `files` field is assumed to be library index.\nIf more than one `.ts` file is specified, `libraryIndex` is used to select the file to use.\nIf more than one `.ts` file is supplied without a `libraryIndex`, an error is produced. A flat module\nindex `.d.ts` and `.js` will be created with the given `flatModuleOutFile` name in the same\nlocation as the library index `.d.ts` file. For example, if a library uses\n`public_api.ts` file as the library index of the module, the `tsconfig.json` `files` field\nwould be `[\"public_api.ts\"]`. The `flatModuleOutFile` options could then be set to, for\nexample `\"index.js\"`, which produces `index.d.ts` and `index.metadata.json` files. The\nlibrary's `package.json`'s `module` field would be `\"index.js\"` and the `typings` field\nwould be `\"index.d.ts\"`.\n\n### *flatModuleId*\n\nThis option specifies the preferred module id to use for importing a flat module.\nReferences generated by the template compiler will use this module name when importing symbols\nfrom the flat module.\nThis is only meaningful when `flatModuleOutFile` is also supplied. Otherwise the compiler ignores\nthis option.\n\n### *generateCodeForLibraries*\n\nThis option tells the template compiler to generate factory files (`.ngfactory.js` and `.ngstyle.js`)\nfor `.d.ts` files with a corresponding `.metadata.json` file. This option defaults to\n`true`. When this option is `false`, factory files are generated only for `.ts` files.\n\nThis option should be set to `false` when using factory summaries.\n\n### *fullTemplateTypeCheck*\n\nThis option tells the compiler to enable the [binding expression validation](#binding-expresion-validation)\nphase of the template compiler which uses TypeScript to validate binding expressions.\n\nThis option is `false` by default.\n\n*Note*: It is recommended to set this to `true` as this option will default to `true` in the future.\n\n### *annotateForClosureCompiler*\n\nThis option tells the compiler to use [Tsickle](https://github.com/angular/tsickle) to annotate the emitted\nJavaScript with [JsDoc](http://usejsdoc.org/) comments needed by the\n[Closure Compiler](https://github.com/google/closure-compiler). This option defaults to `false`.\n\n### *annotationsAs*\n\nUse this option to modify how the Angular specific annotations are emitted to improve tree-shaking. Non-Angular\nannotations and decorators are unnaffected. Default is `static fields`.\n\nvalue | description\n----------------|-------------------------------------------------------------\n`decorators` | Leave the Decorators in-place. This makes compilation faster. TypeScript will emit calls to the __decorate helper. Use `--emitDecoratorMetadata` for runtime reflection. However, the resulting code will not properly tree-shake.\n`static fields` | Replace decorators with a static field in the class. Allows advanced tree-shakers like [Closure Compiler](https://github.com/google/closure-compiler) to remove unused classes.\n\n### *trace*\n\nThis tells the compiler to print extra information while compiling templates.\n\n### *enableLegacyTemplate*\n\nThe use of `