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\nJavaScript is disabled on your browser.
\n \n\n\n\n\n\nNo usage of net.sourceforge.pmd.lang.java.JavaTokenManager
\n\n\n\n\nCopyright © 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\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\r\n \tClasses \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\nJavaScript is disabled on your browser.
\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
\nSummary: \nNested | \nField | \nConstr | \nMethod \n \n
\nDetail: \nField | \nConstr | \nMethod \n \n
\n
\n\n \n\n\n\n\n
\n
\n
\n\n\n\n\n\n \nMethod Summary \n\nMethods \n\nModifier and Type \nMethod and Description \n \n\njava.lang.Object \ngetAttribute (java.lang.String name)\nReturns the object bound with the specified name in this session, or\n null if no object is bound under the name.
\n \n \n\njava.util.Enumeration<java.lang.String> \ngetAttributeNames ()\nReturns an Enumeration of String objects\n containing the names of all the objects bound to this session.
\n \n \n\nlong \ngetCreationTime ()\nReturns the time when this session was created, measured in milliseconds\n since midnight January 1, 1970 GMT.
\n \n \n\njava.lang.String \ngetId ()\nReturns a string containing the unique identifier assigned to this\n session.
\n \n \n\nlong \ngetLastAccessedTime ()\nReturns 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 \n\nint \ngetMaxInactiveInterval ()\nReturns the maximum time interval, in seconds, that the servlet container\n will keep this session open between client accesses.
\n \n \n\nServletContext \ngetServletContext ()\nReturns the ServletContext to which this session belongs.
\n \n \n\nHttpSessionContext \ngetSessionContext ()\nDeprecated. \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 \n \n\njava.lang.Object \ngetValue (java.lang.String name)\n\n \n \n\njava.lang.String[] \ngetValueNames ()\n\n \n \n\nvoid \ninvalidate ()\nInvalidates this session then unbinds any objects bound to it.
\n \n \n\nboolean \nisNew ()\nReturns true if the client does not yet know about the\n session or if the client chooses not to join the session.
\n \n \n\nvoid \nputValue (java.lang.String name,\n java.lang.Object value)\n\n \n \n\nvoid \nremoveAttribute (java.lang.String name)\nRemoves the object bound with the specified name from this session.
\n \n \n\nvoid \nremoveValue (java.lang.String name)\n\n \n \n\nvoid \nsetAttribute (java.lang.String name,\n java.lang.Object value)\nBinds an object to this session, using the name specified.
\n \n \n\nvoid \nsetMaxInactiveInterval (int interval)\nSpecifies 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\n \nMethod Detail \n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\nsetMaxInactiveInterval \nvoid setMaxInactiveInterval(int interval) \nSpecifies 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.
\nParameters: interval - An integer specifying the number of seconds \n \n \n\n\n \n\n\ngetMaxInactiveInterval \nint getMaxInactiveInterval() \nReturns 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.
\nReturns: 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\ngetSessionContext \nHttpSessionContext getSessionContext() \nDeprecated. 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\ngetAttribute \njava.lang.Object getAttribute(java.lang.String name) \nReturns the object bound with the specified name in this session, or\n null if no object is bound under the name.
\nParameters: name - a string specifying the name of the object \nReturns: the object with the specified name \nThrows: \njava.lang.IllegalStateException - if this method is called on an invalidated session \n \n \n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\n\n \n\n\nisNew \nboolean isNew() \nReturns 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.
\nReturns: true if the server has created a session, but the\n client has not yet joined \nThrows: \njava.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
\nSummary: \nNested | \nField | \nConstr | \nMethod \n \n
\nDetail: \nField | \nConstr | \nMethod \n \n
\n
\n\n \n\nCopyright © 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\nJavaScript is disabled on your browser.
\n \n\n\n\n\n\n\n
\n\n\n \n\n\n\n\n \n\n\n\nConstructors in net.sourceforge.pmd.lang.vm.ast with parameters of type VmParser \n\nConstructor and Description \n \n\n\nAbstractVmNode (VmParser p,\n int i) \n \n\nASTAddNode (VmParser p,\n int id) \n \n\nASTAndNode (VmParser p,\n int id) \n \n\nASTAssignment (VmParser p,\n int id) \n \n\nASTBlock (VmParser p,\n int id) \n \n\n \nASTComment (VmParser p,\n int id) \n \n\nASTDirective (VmParser p,\n int id) \n \n\nASTDivNode (VmParser p,\n int id) \n \n\nASTElseIfStatement (VmParser p,\n int id) \n \n\nASTElseStatement (VmParser p,\n int id) \n \n\nASTEQNode (VmParser p,\n int id) \n \n\nASTEscape (VmParser p,\n int id) \n \n\nASTEscapedDirective (VmParser p,\n int id) \n \n\nASTExpression (VmParser p,\n int id) \n \n\nASTFalse (VmParser p,\n int id) \n \n\nASTFloatingPointLiteral (VmParser p,\n int id) \n \n\nASTForeachStatement (VmParser p,\n int id) \n \n\nASTGENode (VmParser p,\n int id) \n \n\nASTGTNode (VmParser p,\n int id) \n \n\nASTIdentifier (VmParser p,\n int id) \n \n\nASTIfStatement (VmParser p,\n int id) \n \n\nASTIndex (VmParser p,\n int id) \n \n\nASTIntegerLiteral (VmParser p,\n int id) \n \n\nASTIntegerRange (VmParser p,\n int id) \n \n\nASTLENode (VmParser p,\n int id) \n \n\nASTLTNode (VmParser p,\n int id) \n \n\nASTMap (VmParser p,\n int id) \n \n\nASTMathNode (VmParser p,\n int id) \n \n\nASTMethod (VmParser p,\n int id) \n \n\nASTModNode (VmParser p,\n int id) \n \n\nASTMulNode (VmParser p,\n int id) \n \n\nASTNENode (VmParser p,\n int id) \nvar maintainer = \"admin\";\n \n\nASTNotNode (VmParser p,\n int id) \n \n\nASTObjectArray (VmParser p,\n int id) \n \n\nASTOrNode (VmParser p,\n int id) \n \n\nASTprocess (VmParser p,\n int id) \n \n\nASTReference (VmParser p,\n int id) \n \n\nASTSetDirective (VmParser p,\n int id) \n \n\nASTStringLiteral (VmParser p,\n int id) \n \n\nASTSubtractNode (VmParser p,\n int id) \n \n\nASTText (VmParser p,\n int id) \n \n\nASTTextblock (VmParser p,\n int id) \n \n\nASTTrue (VmParser p,\n int id) \n \n\nASTWord (VmParser p,\n int id) \n \n \n
\n \n \n \n \n
\n\n\n\n\nCopyright © 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[](https://travis-ci.org/eXist-book/book-code)\n[](http://java.oracle.com)\n[](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\tYearWeek \n\t\t\tWeek \n\t\t\tDayOfWeek \n\t\t\tDTE \n\t\t\thours \n\t\t\tSumTotalBalance \n\t\t \n\t \n\t');\n\tforeach($rows as $row){\n\t\techo('\n\t\t\n\t\t\t'.$row->YearWeek.' \n\t\t\t'.$row->Week.' \n\t\t\t'.$row->DayOfWeek.' \n\t\t\t'.$row->DTE.' \n\t\t\t'.$row->hours.' \n\t\t\t'.$row->SumTotalBalance.' \n\t\t ');\n\t}\n\techo('\n\t \n
');\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\tIndicator : ');\n\t'content_hash' => '55f1c0dc1fb2cf2d1903848d0f74b5e269f16332',\n\tforeach($indicator_rate as $lv=>$rate){\n\t\techo(''.$rate.'+ ');\n\t}\n\techo('\n\t\t \n\t \n
\n
');\n\t\n\t//print_r($data);\n\techo('\n\n\t\n\t\t\n\t\t\tDate/Time \n\t\t\t7:00 \n\t\t\t8:00 \n\t\t\t9:00 \n\t\t\t10:00 \n\t\t\t11:00 \n\t\t\t12:00 \n\t\t\t13:00 \n\t\t\t14:00 \n\t\t\t15:00 \n\t\t\t16:00 \n\t\t\t17:00 \n\t\t\t18:00 \n\t\t\t19:00 \n\t\t\t20:00 \n\t\t\t21:00 \n\t\t\t22:00 \n\t\t\tTotal \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\tWeek '.$dataYearweek['week'].' ');\n\t\tforeach($dataYearweek['list'] as $k=>$d){\n\t\t\techo('');\n\t\t\techo(''.$dayIs[$k].' ');\n\t\t\techo(''.number_format($d['hour'][7],2).' ');\n\t\t\techo(''.number_format($d['hour'][8],2).' ');\n\t\t\techo(''.number_format($d['hour'][9],2).' ');\n\t\t\techo(''.number_format($d['hour'][10],2).' ');\n\t\t\techo(''.number_format($d['hour'][11],2).' ');\n\t\t\techo(''.number_format($d['hour'][12],2).' ');\n\t\t\techo(''.number_format($d['hour'][13],2).' ');\n\t\t\techo(''.number_format($d['hour'][14],2).' ');\n\t\t\techo(''.number_format($d['hour'][15],2).' ');\n\t\t\techo(''.number_format($d['hour'][16],2).' ');\n\t\t\techo(''.number_format($d['hour'][17],2).' ');\n\t\t\techo(''.number_format($d['hour'][18],2).' ');\n\t\t\techo(''.number_format($d['hour'][19],2).' ');\n\t\t\techo(''.number_format($d['hour'][20],2).' ');\n\t\t\techo(''.number_format($d['hour'][21],2).' ');\n\t\t\techo(''.number_format($d['hour'][22],2).' ');\n\t\t\techo(''.number_format($d['total'],2).' ');\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
');\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 * Component \n * Effect \n * \n * \n * Compartment \n * Sets the value of the size attribute. \n * \n * \n * Species \n * Sets the value of either the initialAmount\n * or the initialConcentration attributes, depending\n * on the value of the Species object's\n * hasOnlySubstanceUnits attribute. \n * \n * \n * Parameter \n * Sets the value of the value attribute. \n * \n * \n * SpeciesReference \n * Sets the value of the stoichiometry attribute\n * in the Reaction object where the SpeciesReference object appears. \n * \n *
\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 ", "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
\n
\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
+ Add New \n
\n 'username' => 'imcknight@barnett.com',\n $admin_email = 'imcknight@barnett.com';\n \n $key = 'AIzaLE1fVvYW6FbSDbe6VdEgPMmLvIyGPiSeRxg';\n \n
\n \n Code Description \n \n \n \n '});\">View '});\">Edit \t\n \n \n
\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
\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", "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 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 super String, ? extends MethodHandleWrapper> 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) obj=any\r\n | obj=arglist<(not 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 simple
\n complex1
\n complex2
\n-----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-----\n media
\n shadowTarget
\n deepTarget
\n \n \n\n\n\n \n \n x-child2
\n \n \n\n\n\n \n \n \n simple
\n complex1
\n complex2
\n media
\n \n \n
\n \n \n
\n \n \n
\n \n priority
\n \n Computed
\n \n \n \n\n\n\n \n \n Button!\n \n \n\n\n\n \n Added\n
\n Sub-added\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 [](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\nJavaScript is disabled on your browser.
\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\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\nJavaScript is disabled on your browser.
\n \n\n\n\n\n\nNo usage of org.apache.solr.core.NRTCachingDirectoryFactory
\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\nJavaScript is disabled on your browser.
\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": "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\nJavaScript is disabled on your browser.
\n \n\n\n\n\n\n\n
\n\n\n \n\n\n \n\n\nEnum Summary \n\nEnum \nDescription \n \n\n\nOverseerAction \n\nEnum of actions supported by the overseer only.
\n \n \n \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 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 Open Dialog - Close \n Opens the Sample Dialog \n \n\n\n
\n
\n
\n \n \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 Option1 \n
\n
\n \n Option2 \n
\n
\n
\n
\n
\n \n Save \n \n \n Cancel \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 Install the \"sinaweibo.deb\" webapp and launch it. \n Search \"sinaweibo\" app shortcut in the launcher and check the app name. \n \n \n Expected Output: \n
\n \n Webapp could be launched successfully. \n Find the app shortcut and the app name is \"deepin-webapps-sina-weibo\". \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 Name: \n \n
\n\n \n Slug: \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\t
Phaser 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 \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 \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 \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\nArduino (I used a nano) \r\nBuck converter (got one for about $1 on Aliexpress) \r\nSmall project box \r\n12V pumps (I got some for around $5 on Ali) \r\nDiodes (I'm using 1N4007) \r\nfemale and male DC jacks (5.1 x 2.1mm) \r\nTransistors (I'm using 2N5551) \r\n39 Ohm and 390 Ohm resistors \r\nSome female-female jumper cables \r\nM2x16mm bolts \r\nM3x12mm bolts and nuts \r\nVarious sizes of heatshrink \r\n12V 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{: .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{: .center-image}\r\n*Drill through the side with a 1/2\" spade bit for the PG-7 cable gland. *\r\n\r\n{: .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{: .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{: .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{: .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{: .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{: .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{: .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{: .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{: .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{: .center-image}\r\n*PNP and NPN transistor diagrams. *\r\n\r\n{: .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{: .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{: .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{: .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{: .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\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 Reference \n \n DownloadOptions Structure Reference\n
\n\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
\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
\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
\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 rawValue \n \n \n \n \n
The raw bitmask value for the option.
\n
\n \n \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 \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[](http://android-arsenal.com/details/1/2436) [](https://maven-badges.herokuapp.com/maven-central/com.github.davidpizarro/autolabelui) [](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\r\n\r\nTry out the sample application on [Google Play][1].\r\n\r\n\r\n \r\n \r\n\r\nDemo\r\n=========================\r\n\r\n\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 \r\n \r\n\r\n \r\n \r\n\r\n \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
« 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
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 \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
« 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 \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 \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 \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 \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
« 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 \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
« 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 \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
« 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 \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\tAdvanced Networking \n\t\t\t\t\tRouting & Switching:\n\t\t\t\t\tConnecting Networks \n\t\t\t\t\tChapter 9: \n\t\t\t\t\tTroubleshooting 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\tDocumentation \n\t\t\t\t\t\tNetwork Configuration Files \n\t\t\t\t\t\t\n\t\t\t\t\t\t\tAs 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\tType of device \n\t\t\t\t\t\t\t\tIOS image name \n\t\t\t\t\t\t\t\tDevice network hostname \n\t\t\t\t\t\t\t\tLocation of the device (building, floor, room, rack, panel) \n\t\t\t\t\t\t\t\tIf it is a modular device \n\t\t\t\t\t\t\t\tData link + Network layer addresses \n\t\t\t\t\t\t\t\tAny 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\tDocumentation \n\t\t\t\t\t\tEnd-System Configuration Files \n\t\t\t\t\t\t\n\t\t\t\t\t\t\tA 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\tDevice name \n\t\t\t\t\t\t\t\tOperating system and version \n\t\t\t\t\t\t\t\tIPv4 and IPv6 addresses \n\t\t\t\t\t\t\t\tSubnet mask and prefix length \n\t\t\t\t\t\t\t\tDefault gateway, DNS server, and WINS server addresses \n\t\t\t\t\t\t\t\tAny 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\tNetwork Topology Diagrams \n\t\t\t\t\t\tA 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\tDevice 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\tA logical diagram revealing how datas are moved when communicating:
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tDevice 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\tTopology 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\tTopology 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\tNetwork Baselines \n\t\t\t\t\t\tBefore 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\tThe 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\tNetwork Baselines \n\t\t\t\t\t\tThe 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\tDetermine what types of data to collect . - Too many variables, or the wrong ones, can spoil the baseline. \n\t\t\t\t\t\t\tIdentify devices and ports of interest - The devices and ports for which performance data are the most telling about the network. \n\t\t\t\t\t\t\tDetermine the baseline duration - You need to capture the typical operativity of the network, daily trends and traffic patterns. \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\tCommands to collect data \n\t\t\t\t\t\n\t\t\t\t\t\tshow version \n\t\t\t\t\t\tshow ip interface [brief] \n\t\t\t\t\t\tshow ipv6 inteface [brief] \n\t\t\t\t\t\tshow intefaces [interface_type interface_num] \n\t\t\t\t\t\tshow ip route \n\t\t\t\t\t\tshow ipv6 route \n\t\t\t\t\t\tshow arp \n\t\t\t\t\t\tshow ipv6 neighbors \n\t\t\t\t\t\tshow running-config \n\t\t\t\t\t\tshow vlan \n\t\t\t\t\t\tshow 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\tTroubleshooting 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\tGathering 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\tQuestioning 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\tGuidelines \n\t\t\t\t\t\t\t\tExample End-User Questions \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tDetermine the sequence of events that took place before the problem happened \n\t\t\t\t\t\t\t\tWhen exactly does the problem occur? \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tAsk the user when the problem was first noticed \n\t\t\t\t\t\t\t\tWhen was the problme first noticed? \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tAsk questions that are pertinent the problem \n\t\t\t\t\t\t\t\tWhat does not work? \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tUse each question as a means to either eliminate or discover possible problems. \n\t\t\t\t\t\t\t\tAre the things that do work and the things that do not work reated? \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tAsk the user to recreate the problem, if possible. \n\t\t\t\t\t\t\t\tCan you reproduce the problem? \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tSpeak at a technical level the user can understand \n\t\t\t\t\t\t\t\tDid the things that does not work ever work? \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tDid anything unusual happen since the last time it worked? \n\t\t\t\t\t\t\t\tWhat has changed since the last time it did work? \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\tUsing 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\tTroubleshooting Methods \n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBottom-up \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tStart troubleshooting process by physical layer to application layer. \n\t\t\t\t\t\t\t\tWorks 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\tTop-down \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tStart troubleshooting process by Application layer to application layer. \n\t\t\t\t\t\t\t\tWork 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\tDivide-and-conquer \n\t\t\t\t\t\t\tNet 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\tSelecting 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\tTroubleshooting Tools \n\t\t\t\t\t\n\t\t\t\t\t\tSoftware \n\t\t\t\t\t\t\n\t\t\t\t\t\t\tNetwork Management System Tools (solarwind, Spiceworks, Nagios, etc.) \n\t\t\t\t\t\t\tKnowledge Bases \n\t\t\t\t\t\t\tHost-Based Protocol Analyzers (e.g. Wireshark) \n\t\t\t\t\t\t\tCisco IOS Embedded Packet Capture \n\t\t\t\t\t\t \n\t\t\t\t\t\tHardware \n\t\t\t\t\t\t\n\t\t\t\t\t\t\tNetwork Analysis Module \n\t\t\t\t\t\t\tDigital Multimeters \n\t\t\t\t\t\t\tCable Testers \n\t\t\t\t\t\t\tCable Analyzers \n\t\t\t\t\t\t\tPortable 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\tSyslog Server \n\t\t\t\t\t\tsyslog 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\tA 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\tMessages can be sent on: console, terminal line, buffered logging...
\n\t\t\t\t\t\tR1(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\tSyslog 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\tPhysical Layer Troubleshooting \n\t\t\t\t\tCommon Symptoms:
\n\t\t\t\t\t\n\t\t\t\t\t\tPerformance lower than baseline \n\t\t\t\t\t\tLoss of connectivity \n\t\t\t\t\t\tNetwork bottlenecks or congestion \n\t\t\t\t\t\tHigh CPU utilization rates \n\t\t\t\t\t\tConsole error messages \n\t\t\t\t\t \n\t\t\t\t\tCommon Causes:
\n\t\t\t\t\t\n\t\t\t\t\t\tPower-related \n\t\t\t\t\t\tHardware faults \n\t\t\t\t\t\tCabling faults \n\t\t\t\t\t\tAttenuation and/or noise \n\t\t\t\t\t\tInterface configuration errors \n\t\t\t\t\t\tExceeding design limits \n\t\t\t\t\t\tCPU overload \n\t\t\t\t\t \n\t\t\t\t \n\n\t\t\t\t
\n\t\t\t\t\tData Link Layer Troubleshooting \n\t\t\t\t\tCommon Symptoms:
\n\t\t\t\t\t\n\t\t\t\t\t\tNo functionality at the network layer or above \n\t\t\t\t\t\tNetwork is operating below baseline performance levels \n\t\t\t\t\t\tExcessive broadcasts \n\t\t\t\t\t\tConsole messages \n\t\t\t\t\t \n\t\t\t\t\tCommon Causes:
\n\t\t\t\t\t\n\t\t\t\t\t\tEncapsulation errors \n\t\t\t\t\t\tAddress mapping errors \n\t\t\t\t\t\tFraming errors \n\t\t\t\t\t\tSTP 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\tNetwork Layer Troubleshooting \n\t\t\t\t\tCommon Symptoms:
\n\t\t\t\t\t\n\t\t\t\t\t\tNetwork failure \n\t\t\t\t\t\tSuboptimal performance \n\t\t\t\t\t \n\t\t\t\t\tCommon Causes:
\n\t\t\t\t\t\n\t\t\t\t\t\tGeneral network issues \n\t\t\t\t\t\tConnectivity issues \n\t\t\t\t\t\tNeighbor issues \n\t\t\t\t\t\tTopology database \n\t\t\t\t\t\tRouting table \n\t\t\t\t\t \n\t\t\t\t \n\n\t\t\t\t
\n\t\t\t\t\tTransport Layer Troubleshooting \n\t\t\t\t\tCommon Symptoms: Connectivity/Access issues.
\n\t\t\t\t\tCommon Causes:
\n\t\t\t\t\t\n\t\t\t\t\t\tSelection of traffic flow \n\t\t\t\t\t\tOrder of access control entries \n\t\t\t\t\t\tImplicit deny all \n\t\t\t\t\t\tIPv4 addresses and wildmasks, src and dst ports \n\t\t\t\t\t\tSelection of transport layer protocol \n\t\t\t\t\t\tUse of the established keyword \n\t\t\t\t\t\tUncommon protocols; BOOTP and DHCP; DNS and WINS \n\t\t\t\t\t\tTunneling 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\tApplication Layer Troubleshooting \n\t\t\t\t\tApplications 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\tApplication problem can occur when other layers don’t work.
\n\t\t\t\t\tSome 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\tEnd 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