images
images listlengths
1
1
texts
listlengths
1
1
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>#include <bits/stdc++.h>\n\nusing namespace std;\n\ntypedef long long int LL;\ntypedef unsigned long long int ULL;\ntypedef pair<int, int> PII;\ntypedef map<int, int> MII;\n\nconst int SZ = 112345;\nconst int MOD = 1e9 + 7;\n\nint h, n, a[SZ];\n\nint main() {\n cin >> h >> n;\n for (int i = 0; i < n; i++) {\n cin >> a[i];\n }\n sort(a, a + n);\n LL s = 0;\n for (int i = n - 1; i >= 0; i--) {\n s += a[i];\n if (s >= h) {\n cout << \"Yes\" << endl;\n return 0;\n }\n }\n cout << \"No\" << endl;\n return 0;\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.gobblin.service.modules.flowgraph;\n\nimport java.net.URI;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Properties;\n\nimport org.apache.gobblin.runtime.api.SpecExecutor;\nimport org.apache.gobblin.runtime.spec_executorInstance.InMemorySpecExecutor;\nimport org.apache.gobblin.util.ConfigUtils;\nimport org.testng.Assert;\nimport org.testng.annotations.Test;\n\nimport com.typesafe.config.Config;\nimport com.typesafe.config.ConfigFactory;\nimport com.typesafe.config.ConfigValueFactory;\n\nimport org.apache.gobblin.configuration.ConfigurationKeys;\nimport org.apache.gobblin.service.ServiceConfigKeys;\nimport org.apache.gobblin.service.modules.template_catalog.FSFlowCatalog;\n\nimport lombok.extern.slf4j.Slf4j;\n\n@Slf4j\npublic class BaseFlowEdgeFactoryTest {\n @Test\n public void testCreateFlowEdge() throws Exception {\n Properties properties = new Properties();\n properties.put(FlowGraphConfigurationKeys.FLOW_EDGE_SOURCE_KEY,\"node1\");\n properties.put(FlowGraphConfigurationKeys.FLOW_EDGE_DESTINATION_KEY, \"node2\");\n properties.put(FlowGraphConfigurationKeys.FLOW_EDGE_NAME_KEY, \"edge1\");\n properties.put(FlowGraphConfigurationKeys.FLOW_EDGE_ID_KEY, \"node1:node2:edge1\");\n properties.put(FlowGraphConfigurationKeys.FLOW_EDGE_TEMPLATE_DIR_URI_KEY, \"FS:///flowEdgeTemplate\");\n\n List<SpecExecutor> specExecutorList = new ArrayList<>();\n Config config1 = ConfigFactory.empty().withValue(\"specStore.fs.dir\", ConfigValueFactory.fromAnyRef(\"/tmp1\")).\n withValue(\"specExecInstance.capabilities\", ConfigValueFactory.fromAnyRef(\"s1:d1\"));\n specExecutorList.add(new InMemorySpecExecutor(config1));\n Config config2 = ConfigFactory.empty().withValue(\"specStore.fs.dir\", ConfigValueFactory.fromAnyRef(\"/tmp2\")).\n withValue(\"specExecInstance.capabilities\", ConfigValueFactory.fromAnyRef(\"s2:d2\"));\n specExecutorList.add(new InMemorySpecExecutor(config2));\n\n FlowEdgeFactory flowEdgeFactory = new BaseFlowEdge.Factory();\n\n Properties props = new Properties();\n URI flowTemplateCatalogUri = this.getClass().getClassLoader().getResource(\"template_catalog\").toURI();\n props.put(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY, flowTemplateCatalogUri.toString());\n Config config = ConfigFactory.parseProperties(props);\n Config templateCatalogCfg = config\n .withValue(ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY,\n config.getValue(ServiceConfigKeys.TEMPLATE_CATALOGS_FULLY_QUALIFIED_PATH_KEY));\n FSFlowCatalog catalog = new FSFlowCatalog(templateCatalogCfg);\n Config edgeProps = ConfigUtils.propertiesToConfig(properties);\n FlowEdge flowEdge = flowEdgeFactory.createFlowEdge(edgeProps, catalog, specExecutorList);\n Assert.assertEquals(flowEdge.getSrc(), \"node1\");</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>// CvPlotQt - https://github.com/Profactor/cv-plot-qt\n// Copyright (c) 2020 by PROFACTOR GmbH - https://www.profactor.at/\n\n#pragma once\n\n#include <CvPlotQt/libdef.h></code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Go_>package cmd\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"time\"\n\n\t\"github.com/jenkins-x/jx/pkg/auth\"\n\t\"github.com/jenkins-x/jx/pkg/gits\"\n\t\"github.com/jenkins-x/jx/pkg/issues\"\n\t\"github.com/jenkins-x/jx/pkg/kube\"\n\t\"github.com/jenkins-x/jx/pkg/log\"\n\t\"github.com/jenkins-x/jx/pkg/util\"\n\t\"github.com/spf13/cobra\"\n\tgitcfg \"gopkg.in/src-d/go-git.v4/config\"\n\t\"k8s.io/api/core/v1\"\n\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n)\n\nfunc (o *CommonOptions) FindGitInfo(dir string) (*gits.GitRepositoryInfo, error) {\n\t_, gitConf, err := o.Git().FindGitConfigDir(dir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Could not find a .git directory: %s\\n\", err)\n\t} else {\n\t\tif gitConf == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"No git conf dir found\")\n\t\t}\n\t\tgitURL, err := o.Git().DiscoverUpstreamGitURL(gitConf)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Could not find the remote git source URL: %s\", err)\n\t\t}\n\t\treturn gits.ParseGitURL(gitURL)\n\t}\n}\n\n// createGitProvider creates a git from the given directory\nfunc (o *CommonOptions) createGitProvider(dir string) (*gits.GitRepositoryInfo, gits.GitProvider, issues.IssueProvider, error) {\n\tgitDir, gitConfDir, err := o.Git().FindGitConfigDir(dir)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}\n\tif gitDir == \"\" || gitConfDir == \"\" {\n\t\tlog.Warnf(\"No git directory could be found from dir %s\\n\", dir)\n\t\treturn nil, nil, nil, nil\n\t}\n\n\tgitUrl, err := o.Git().DiscoverUpstreamGitURL(gitConfDir)\n\tif err != nil {\n\t\treturn nil, nil, nil, err\n\t}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import sys\nimport numpy as np\ninput = sys.stdin.readline\nN, W = map(int, input().split())\ndef knapsack():\n dp = np.zeros((N+1, W+1), dtype=int)\n c = np.arange(1, N+1)\n cc = np.arange(1, W+1)\n for i in c:\n w, v = map(int, input().split())\n for sum_w in cc:\n if sum_w - w >= 0:\n dp[i][sum_w] = max(dp[i-1][sum_w], dp[i-1][sum_w-w] + v)\n dp[i][sum_w] = max(dp[i][sum_w], dp[i-1][sum_w])\n return dp[-1][-1]\nprint(knapsack())</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>INSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 1);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 2);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 3);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 4);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 5);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 6);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 7);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 8);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 9);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 10);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 11);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 12);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 64);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 65);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 66);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 67);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 68);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 69);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 70);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 71);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 72);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 73);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 74);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 75);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (2, 76);\n\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 77);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 78);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 79);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 80);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 81);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 82);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 83);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 84);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (8, 85);\n\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (9, 86);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (9, 87);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (9, 88);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (9, 89);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (9, 90);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (9, 91);\nINSERT INTO albums_songs (album_id, song_id)\nVALUES (9, 92);</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_CSS_>* {outline:none !important;}\nbody {\n color:#525252;\n background:#353535;\n}\n.body-expanded, .modal-open {\n overflow-y:hidden;\n margin-right: 15px;\n}\n.modal-open #content {z-index: inherit;}\n.body-expanded .expanded-panel, .fancybox-margin .expanded-panel, .modal-open .expanded-panel {\n margin-right: 15px;\n}\n.body-screensaver {\n overflow: hidden;\n}\nh1, .h1, h2, .h2, h3, .h3 {\n margin:0;\n}\n\n#logo {\n position:relative;\n background:#505559;\n}\n#logo a {\n color: #D8D8D8;\nfont-family: \"Righteous\",cursive;\ndisplay: block;\nfont-size: 20px;\nline-height: 50px;\n background: url(../images/logo.png) right 42px no-repeat;\n -webkit-transition: 0.5s;\n -moz-transition: 0.5s;\n -o-transition: 0.5s;\n transition: 0.5s;\n}\n#logo a:hover {\n background-position: right 25px;\n text-decoration: none;\n}\n.navbar {\n margin: 0;\n border: 0;\n position: fixed;\n top:0;\n left: 0;\n width:100%;\n -webkit-border-radius: 0;\n -moz-border-radius: 0;\n border-radius: 0;\n border-bottom:1px solid #242424;\n z-index: 2000;\n}\n.body-expanded .navbar {\n z-index: 9;\n}\na.show-sidebar {\n float: left;\n margin-left: 15px;\n color:#9B9B9B;\n outline: none;\n -webkit-transition: 0.2s;\n -moz-transition: 0.2s;\n -o-transition: 0.2s;\n transition: 0.2s;\n}\na.show-sidebar:hover {\n color:#A8A8A8;\n}\n#sidebar-left {\n position:relative;\n z-index: inherit;\n padding-bottom: 3000px !important;\n margin-bottom: -3000px !important;\n background:#353535;\n -webkit-transition: 0.1s;\n -moz-transition: 0.1s;\n -o-transition: 0.1s;\n transition: 0.1s;\n}\n#content {\n position: relative;\n z-index: 10;\n background: #FBFBF0;\n box-shadow: 0 0 6px #000;\n padding-bottom: 3000px !important;\n margin-bottom: -2980px !important;\n overflow: hidden;\n -webkit-transition: 0.1s;\n -moz-transition: 0.1s;\n -o-transition: 0.1s;\n transition: 0.1s;\n}\n.full-content {\n overflow: hidden;\n padding: 0;\n margin: 0;\n}\n.nav.main-menu, .nav.msg-menu {\n margin:0 -15px;\n}\n.nav.main-menu > li > a, .nav.msg-menu > li > a {\n text-align: center;\n color:#9C9A78;\n min-height: 40px;\n -webkit-transition: 0.05s;\n -moz-transition: 0.05s;\n -o-transition: 0.05s;\n transition: 0.05s;\n}\n.nav .open > a, .nav .open > a:hover, .nav .open > a:focus, .nav > li > a:hover, .nav > li > a:focus {\n background:rgba(0, 0, 0, 0.1);\n}\n.nav.main-menu > li > a:hover, .nav.main-menu > li > a:focus, .nav.main-menu > li.active > a, .nav.main-menu .open > a, .nav.main-menu .open > a:hover, .nav.main-menu .open > a:focus, .dropdown-menu > li > a:focus, .dropdown-menu > li > a:hover, .dropdown-menu > li.active > a,\n.nav.msg-menu > li > a:hover, .nav.msg-menu > li > a:focus, .nav.msg-menu > li.active > a, .nav.msg-menu .open > a, .nav.msg-menu .open > a:hover, .nav.msg-menu .open > a:focus {\n background:rgba(0, 0, 0, 0.1);\n color:#f0f0f0;\n}\n.nav.main-menu a.active, .nav.msg-menu a.active {\n background:rgba(0, 0, 0, 0.2);\n}\n.nav.main-menu a.active:hover, .nav.msg-menu a.active:hover {\n background:rgba(0, 0, 0, 0.2);\n}\n.nav.main-menu a.active-parent, .nav.msg-menu a.active-parent {\n background: rgba(0, 0, 0, 0.3);\n}\n.nav.main-menu a.active-parent:hover, .nav.msg-menu a.active-parent:hover {\n background: rgba(0, 0, 0, 0.3);\n}\n.nav.main-menu > li > a > i, .nav.msg-menu > li > a > i {\n font-size: 18px;\n width: auto;\n display: block;\n text-align: center;\n}\n.main-menu .dropdown-menu {\n position: absolute;\n z-index: 2001;\n left: 100%;\n top: 0;\n float: none;\n margin: 0;\n border: 0;\n -webkit-border-radius: 0 4px 4px 0;\n -moz-border-radius: 0 4px 4px 0;\n border-radius: 0 4px 4px 0;\n padding: 0;\n background: #6AA6D6;\n box-shadow: none;\n visibility:hidden;\n}\n.main-menu .active-parent:hover + .dropdown-menu {\n visibility:visible;\n}\n.main-menu .active-parent + .dropdown-menu:hover {\n visibility:visible;\n}\n.main-menu .dropdown-menu > li > a {\n padding:9px 15px 9px 40px;\n color:#f0f0f0;\n}\n.main-menu .dropdown-menu > li:first-child > a {\n -webkit-border-radius: 0 4px 0 0;\n -moz-border-radius: 0 4px 0 0;\n border-radius: 0 4px 0 0;\n}\n.main-menu .dropdown-menu > li:last-child > a {\n -webkit-border-radius: 0 0 4px 0;\n -moz-border-radius: 0 0 4px 0;\n border-radius: 0 0 4px 0;\n}\n#top-panel {\n line-height: 50px;\n height: 50px;\n background:#505559;\n}\n#main {\n margin-top: 50px;\n min-height: 800px;\n overflow: hidden;\n}\n#search {\n position: relative;\n}\n#search > input {\n width: 80%;\n background: #dfdfdf;\n border: 1px solid #C7C7C7;\n text-shadow:0 1px 1px #EEE;\n -webkit-border-radius: 3px;\n -moz-border-radius: 3px;\n border-radius: 3px;\n color: #686868;\n line-height: 1em;\n height: 30px;\n padding: 0 35px 0 10px;\n -webkit-transition: 0.2s;\n -moz-transition: 0.2s;\n -o-transition: 0.2s;</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>/*=========================================================================\n\nLibrary: TubeTK\n\nCopyright 2010 Kitware Inc. 28 Corporate Drive,\nClifton Park, NY, 12065, USA.\n\nAll rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n=========================================================================*/\n\n#ifndef __itktubeRidgeSeedFilter_hxx\n#define __itktubeRidgeSeedFilter_hxx\n\n#include \"itktubeRidgeSeedFilter.h\"\n\n#include \"tubeMatrixMath.h\"\n\n#include <itkImage.h>\n#include <itkImageRegionConstIteratorWithIndex.h>\n#include <itkImageRegionIteratorWithIndex.h>\n#include <itkProgressReporter.h>\n#include <itkTimeProbesCollectorBase.h>\n#include <itkBinaryThinningImageFilter.h>\n\n#include <limits>\n\nnamespace itk\n{\n\nnamespace tube\n{\n\ntemplate< class TImage, class TLabelMap, unsigned int TNumberOfFeatures >\nRidgeSeedFilter< TImage, TLabelMap, TNumberOfFeatures >\n::RidgeSeedFilter( void )\n{\n m_SeedFeatureGenerator = SeedFeatureGeneratorType::New();\n m_RidgeFeatureGenerator = RidgeFeatureGeneratorType::New();\n m_SeedFeatureGenerator->SetInputFeatureVectorGenerator(\n m_RidgeFeatureGenerator );\n\n m_SeedFeatureGenerator->SetNumberOfLDABasisToUseAsFeatures( 1 );\n m_SeedFeatureGenerator->SetNumberOfPCABasisToUseAsFeatures(\n TNumberOfFeatures-1 );\n\n m_PDFSegmenter = PDFSegmenterType::New();\n m_PDFSegmenter->SetReclassifyObjectLabels( true );\n m_PDFSegmenter->SetReclassifyNotObjectLabels( true );\n m_PDFSegmenter->SetForceClassification( true );\n m_PDFSegmenter->SetErodeRadius( 0 );\n m_PDFSegmenter->SetHoleFillIterations( 0 );\n m_PDFSegmenter->SetOutlierRejectPortion( 0.01 );\n m_PDFSegmenter->SetProbabilityImageSmoothingStandardDeviation( 0.3 );\n m_PDFSegmenter->SetHistogramSmoothingStandardDeviation( 4 );\n\n m_RidgeId = 255;\n m_BackgroundId = 127;\n m_UnknownId = 0;\n\n m_SeedTolerance = 1.0;\n\n m_LabelMap = NULL;\n\n m_Skeletonize = true;\n\n m_UseIntensityOnly = false;\n\n m_TrainClassifier = true;\n}\n\ntemplate< class TImage, class TLabelMap, unsigned int TNumberOfFeatures ></code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>#coding:utf-8\n#\n# id: bugs.core_1550_postfix\n# title: Unnecessary index scan happens when the same index is mapped to both WHERE and ORDER BY clauses\n# decription: \n# http://sourceforge.net/p/firebird/code/60368\n# Date: 2014-12-16 11:40:42 +0000 (Tue, 16 Dec 2014)\n# \n# First letter to dimitr: 30.09.2014 20:01.\n# Reproduced on 3.0.0.31472 Beta 2 (10.dec.2014).\n# Checked on:\n# 3.0.3.32837: OK, 1.516s.\n# 3.0.3.32838: OK, 0.953s.\n# 4.0.0.800: OK, 1.625s.\n# 4.0.0.801: OK, 1.125s.\n# \n# tracker_id: \n# min_versions: ['3.0']\n# versions: 3.0\n# qmid: \n\nimport pytest\nfrom firebird.qa import db_factory, isql_act, Action\n\n# version: 3.0\n# resources: None\n\nsubstitutions_1 = []\n\ninit_script_1 = \"\"\"\"\"\"\n\ndb_1 = db_factory(sql_dialect=3, init=init_script_1)\n\ntest_script_1 = \"\"\"\n -- sent to dimitr 30.09.14 at 22:09\n set term ^;\n execute block as\n begin\n execute statement 'drop sequence g';\n when any do begin end\n end^\n set term ;^\n commit;\n\n create sequence g; commit;\n recreate table td(id int primary key using index td_pk, f01 int, f02 int); commit;\n recreate table tm(id int); commit;\n\n insert into tm select gen_id(g,1) from rdb$types rows 100;\n commit;\n\n insert into td(id, f01, f02) select id, (select min(id) from tm), gen_id(g,1) from tm; commit;\n\n create index td_f01_non_unq on td(f01);\n create unique index td_f01_f02_unq on td(f01, f02); -- ### NB: compound UNIQUE index presens here beside of PK ###\n commit;\n\n set planonly;\n\n -- 1. Check for usage when only PK fields are involved:\n select *\n from tm m\n where exists(\n select * from td d where m.id = d.id \n order by d.id --------------------------- ### this \"useless\" order by should prevent from bitmap creation in 3.0+\n );\n -- Ineffective plan was here:\n -- PLAN (D ORDER TD_PK INDEX (TD_PK))\n -- ... ^\n -- |\n -- +-----> BITMAP created!\n \n -- 2. Check for usage when fields from UNIQUE index are involved:\n select *\n from tm m\n where exists(\n select * from td d \n where m.id = d.f01 and d.f02 = 10 \n order by d.f01, d.f02 ------------------- ### this \"useless\" order by should prevent from bitmap creation in 3.0+\n );\n\n -- Ineffective plan was here:\n -- PLAN (D ORDER TD_F01_F02_UNQ INDEX (TD_F01_F02_UNQ))\n -- ... ^\n -- |\n -- +-----> BITMAP created!\n\"\"\"\n\nact_1 = isql_act('db_1', test_script_1, substitutions=substitutions_1)\n\nexpected_stdout_1 = \"\"\"\n PLAN (D ORDER TD_PK)\n PLAN (M NATURAL)\n\n PLAN (D ORDER TD_F01_F02_UNQ)\n PLAN (M NATURAL)\n\"\"\"\n\n@pytest.mark.version('>=3.0')\ndef test_1(act_1: Action):\n act_1.expected_stdout = expected_stdout_1\n act_1.execute()\n assert act_1.clean_stdout == act_1.clean_expected_stdout\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>#!/usr/bin/env python3\nfrom pwn import *\n\ncontext.update(log_level=\"debug\")\n\nHOST = \"vulnbox-test.faust.ninja\"\nPORT = 1337\n\npr = remote(HOST, PORT)\n\npr.recvuntil(\"-> quit\\r\\n >\")\npr.sendline(\"moneymoneymoney\")\n\nfinished = False\nwhile not finished:\n line = pr.recvline()\n if line.startswith(b\"That's it!\"):\n finished = True\n else:\n print(line[:-2]) # maybe parse a little bit here\n\n# get back to main menu\npr.sendline()\npr.recvuntil(\"-> quit\\r\\n > \")\n# exit\npr.sendline(\"quit\")\n\npr.close()\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>// Copyright (c) 2011-2013 The Bitcoin Core developers\n// Copyright (c) 2015-2017 The PIVX 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 \"macnotificationhandler.h\"\n\n#undef slots\n#import <objc/runtime.h>\n#include <Cocoa/Cocoa.h>\n\n// Add an obj-c category (extension) to return the expected bundle identifier\n@implementation NSBundle(returnCorrectIdentifier)\n- (NSString *)__bundleIdentifier\n{\n if (self == [NSBundle mainBundle]) {\n return @\"io.divi.Divi-Qt\";\n } else {\n return [self __bundleIdentifier];\n }\n}\n@end\n\nvoid MacNotificationHandler::showNotification(const QString &title, const QString &text)\n{\n // check if users OS has support for NSUserNotification\n if(this->hasUserNotificationCenterSupport()) {\n // okay, seems like 10.8+\n QByteArray utf8 = title.toUtf8();\n char* cString = (char *)utf8.constData();\n NSString *titleMac = [[NSString alloc] initWithUTF8String:cString];\n\n utf8 = text.toUtf8();\n cString = (char *)utf8.constData();\n NSString *textMac = [[NSString alloc] initWithUTF8String:cString];\n\n // do everything weak linked (because we will keep <10.8 compatibility)\n id userNotification = [[NSClassFromString(@\"NSUserNotification\") alloc] init];\n [userNotification performSelector:@selector(setTitle:) withObject:titleMac];\n [userNotification performSelector:@selector(setInformativeText:) withObject:textMac];\n\n id notificationCenterInstance = [NSClassFromString(@\"NSUserNotificationCenter\") performSelector:@selector(defaultUserNotificationCenter)];\n [notificationCenterInstance performSelector:@selector(deliverNotification:) withObject:userNotification];\n\n [titleMac release];\n [textMac release];\n [userNotification release];\n }\n}\n\n// sendAppleScript just take a QString and executes it as apple script\nvoid MacNotificationHandler::sendAppleScript(const QString &script)\n{\n QByteArray utf8 = script.toUtf8();\n char* cString = (char *)utf8.constData();\n NSString *scriptApple = [[NSString alloc] initWithUTF8String:cString];\n\n NSAppleScript *as = [[NSAppleScript alloc] initWithSource:scriptApple];\n NSDictionary *err = nil;\n [as executeAndReturnError:&err];\n [as release];\n [scriptApple release];\n}\n\nbool MacNotificationHandler::hasUserNotificationCenterSupport(void)\n{\n Class possibleClass = NSClassFromString(@\"NSUserNotificationCenter\");\n\n // check if users OS has support for NSUserNotification\n if(possibleClass!=nil) {\n return true;\n }\n return false;\n}\n\n\nMacNotificationHandler *MacNotificationHandler::instance()\n{\n static MacNotificationHandler *s_instance = NULL;\n if (!s_instance) {\n s_instance = new MacNotificationHandler();\n \n Class aPossibleClass = objc_getClass(\"NSBundle\");\n if (aPossibleClass) {\n // change NSBundle -bundleIdentifier method to return a correct bundle identifier\n // a bundle identifier is required to use OSXs User Notification Center\n method_exchangeImplementations(class_getInstanceMethod(aPossibleClass, @selector(bundleIdentifier)),\n class_getInstanceMethod(aPossibleClass, @selector(__bundleIdentifier)));\n }\n }\n return s_instance;\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>#include<iostream>\n using namespace std ;\n int main()\n{\n string a,b,c,d,e,f,g,h,i;\n cin>> a>> b>>c;\ncin>> d>>e>>f;\n cin>>g>>h>>i;\n cout<< a<<e<<i;\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_D_>// unihernandez22\n// https://atcoder.jp/contests/abc061/tasks/abc061_a\n// implementation\n\nimport std.stdio: readf, writeln;\n\nvoid main() {\n\tint a, b, c;\n\t\"%s %s %s\\n\".readf(&a, &b, &c);\n\n\tif (c >= a && c <= b)\n\t\twriteln(\"Yes\");\n\telse\n\t\twriteln(\"No\");\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_HTML_><ion-header>\n <ion-navbar>\n <ion-title>\n MyAppVersion\n </ion-title>\n </ion-navbar>\n</ion-header>\n\n<ion-content padding class=\"center home\">\n <button ion-button (click)=\"getVersion()\">Get App Version</button>\n <p class=\"large\" *ngIf=\"ver\">\n MyAppVersion {{ ver }}\n </p>\n</ion-content></code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>/**\n* TimerChain\n* http://mins01.com\n* https://github.com/mins01/js_TimerChain\n* Date : 2019-05-17\n*/\nvar cnt = 0;\nvar TimerChain = (function(){\n\t\"use strict\";\n\tvar TimerChain = function(){\t\n\t};\n\tTimerChain.prototype = Object.create(Array.prototype,{\n\t\t\"tm\":{ writable: true, value: null },\n\t\t\"isRunning\":{ writable: true, value: false },\n\t\t\"lastCallback\":{ writable: true, value: null },\n\t\t\"lastTimeout\":{ writable: true, value: null },\n\t\t\"push\":{\n\t\t\tvalue:function(fn,timeout){\n\t\t\t\tthis.constructor.prototype.push.call(this,[fn,timeout]);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t},\n\t\t\"unshift\":{\n\t\t\tvalue:function(fn,timeout){\n\t\t\t\tthis.constructor.prototype.unshift.call(this,[fn,timeout]);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t},\n\t\t\"splice\":{\n\t\t\tvalue:function(start,deleteCount,fn,timeout){\n\t\t\t\tif(arguments.length<2){\n\t\t\t\t\tconsole.error(\"arguments.length < 2\");\n\t\t\t\t}\n\t\t\t\tvar start = arguments[0];\n\t\t\t\tvar deleteCount = arguments[1];\n\t\t\t\tvar args = [start,deleteCount];\n\t\t\t\tfor(var i=2,m=arguments.length;i<m;i+=2){\n\t\t\t\t\targs.push([arguments[i],arguments[i+1]])\n\t\t\t\t}\n\t\t\t\tthis.constructor.prototype.splice.apply(this,args);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t},\n\t\t\"clear\":{\n\t\t\tvalue:function(){\n\t\t\t\twhile(this.length){\n\t\t\t\t\tthis.shift();\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t},\n\t\t\"start\":{\n\t\t\tvalue:function(){\n\t\t\t\tif(this.isRunning){ \n\t\t\t\t\t// console.log(\"failed .start() : not end setTimeout()\");\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tthis.isRunning = true;\n\t\t\t\treturn this.run();\n\t\t\t}\n\t\t},\n\t\t\"run\":{\n\t\t\tvalue:function(){\n\t\t\t\tif(this.length>0){\n\t\t\t\t\tvar arr = this.shift();\n\t\t\t\t\tthis.tm = setTimeout(function(cb,thisC,timeout){\n\t\t\t\t\t\treturn function(){\n\t\t\t\t\t\t\tcb();\n\t\t\t\t\t\t\tthisC.run();\n\t\t\t\t\t\t\tif(thisC.length==0){\n\t\t\t\t\t\t\t\tthisC.isRunning = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}(arr[0],this,arr[1]),arr[1]);\n\t\t\t\t\tthis.lastCallback = arr[0];\n\t\t\t\t\tthis.lastTimeout = arr[1];\n\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t},\n\t\t\"stop\":{\n\t\t\tvalue:function(){\n\t\t\t\tthis.isRunning = false;\n\t\t\t\tthis.clearTm();\n\t\t\t\treturn this;\n\t\t\t}\n\t\t},\n\t\t\"clearTm\":{\n\t\t\tenumerable:false,\n\t\t\tvalue:function(){\n\t\t\t\tif(this.tm!=null) clearTimeout(this.tm);\n\t\t\t\tthis.tm = null;\n\t\t\t}\n\t\t},\n\t});\n\t\n\treturn TimerChain;\n})()</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>#! /usr/bin/env python\n\nimport rospy\nimport time\nfrom std_msgs.msg import Empty\nfrom geometry_msgs.msg import Twist\n\nclass Control():\n def __init__(self):\n self.ctrl_c = False\n self._pub_cmd_vel = rospy.Publisher('/cmd_vel', Twist, queue_size=1)\n self._move_msg = Twist()\n self._pub_takeoff = rospy.Publisher('/drone/takeoff', Empty, queue_size=1)\n self._takeoff_msg = Empty()\n self._pub_land = rospy.Publisher('/drone/land', Empty, queue_size=1)\n self._land_msg = Empty()\n\n def stop(self):\n rospy.loginfo(\"Stopping...\")\n self._move_msg.linear.x = 0.0\n self._move_msg.angular.z = 0.0\n self._pub_cmd_vel.publish(self._move_msg)\n\n def takeoff(self):\n rospy.loginfo('Taking off...')\n i=0\n while not i == 3:\n self._pub_takeoff.publish(self._takeoff_msg)\n time.sleep(1)\n i += 1\n \n def land(self):\n rospy.loginfo('Landing...')\n i=0\n while not i == 3:\n self._pub_land.publish(self._land_msg)\n time.sleep(1)\n i += 1\n\n def turn(self):\n rospy.loginfo(\"Turning...\")\n self._move_msg.linear.x = 0.0\n self._move_msg.angular.z = 1.0\n self_pub_cmd_vel.publish(self._move_msg)\n\n def move_forward(self):\n rospy.loginfo(\"Moving forward...\")\n self._move_msg.linear.x = 1.0</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_TypeScript_>/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License;\n * you may not use this file except in compliance with the Elastic License.\n */\n\nimport React from 'react';\nimport { render, unmountComponentAtNode } from 'react-dom';\nimport { HashRouter as Router, Route, Switch, useParams } from 'react-router-dom';\nimport { i18n } from '@kbn/i18n';\nimport { StartServicesAccessor } from 'src/core/public';\nimport { RegisterManagementAppArgs } from '../../../../../../src/plugins/management/public';\nimport { PluginStartDependencies } from '../../plugin';\nimport { DocumentationLinksService } from './documentation_links';\n\ninterface CreateParams {\n getStartServices: StartServicesAccessor<PluginStartDependencies>;\n}\n\nexport const roleMappingsManagementApp = Object.freeze({\n id: 'role_mappings',\n create({ getStartServices }: CreateParams) {\n return {\n id: this.id,\n order: 40,\n title: i18n.translate('xpack.security.management.roleMappingsTitle', {\n defaultMessage: 'Role Mappings',</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>/*\n * Copyright 2021 Squircle IDE 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 * 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.blacksquircle.ui.language.xml.provider\n\nimport com.blacksquircle.ui.language.base.model.Suggestion\nimport com.blacksquircle.ui.language.base.provider.SuggestionProvider\nimport com.blacksquircle.ui.language.base.utils.WordsManager\n\nclass XmlProvider private constructor() : SuggestionProvider {\n\n companion object {\n\n private var xmlProvider: XmlProvider? = null\n\n fun getInstance(): XmlProvider {\n return xmlProvider ?: XmlProvider().also {\n xmlProvider = it\n }\n }\n }\n\n private val wordsManager = WordsManager()\n\n override fun getAll(): Set<Suggestion> {\n return wordsManager.getWords()\n }\n\n override fun processLine(lineNumber: Int, text: String) {\n wordsManager.processLine(lineNumber, text)\n }\n\n override fun deleteLine(lineNumber: Int) {\n wordsManager.deleteLine(lineNumber)\n }\n\n override fun clearLines() {\n wordsManager.clearLines()\n }\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>from collections import Counter\n\nN = int(input())\ndata = list(map(int, input().split()))\n\ncount = Counter(data)\n\nfor i in range(1, N+1):\n ans = count[i]\n print(ans)\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_YAML_>_id: 93754ac0-09aa-11eb-b513-cd3f92c55f5e\nmessage: \"Need cash? Launch this robot and see what it can. \\r\\nLink - http://www.google.com/url?q=%68%74%74%70%73%3A%2F%2F%68%64%72%65%64%74%75%62%65%33%2e%6d%6f%62%69%2F%62%74%73%6d%61%72%74%23%48%4b%4d%41%48%63%53%62%62%43%50%4f%45%4c%56%59%57&sa=D&sntz=1&usg=AFQjCNE7HcsKn5FofiK_13jPyu1Xf1m_cA\"\nname: HenryMaivy\nemail: 4294f12321941f9000a3908e8dc65ac0\nurl: >-\n http://www.google.com/url?q=%68%74%74%70%73%3A%2F%2F%68%64%72%65%64%74%75%62%65%33%2e%6d%6f%62%69%2F%62%74%73%6d%61%72%74%23%59%6d%47%6f%53%73%72%54%71%50%50%4e%4f%76%51%62%50&sa=D&sntz=1&usg=AFQjCNGDeQY1Z2L7m8rLy4JCsIOIXivYGQ\nhidden: ''\ndate: '2020-10-08T21:09:39.095Z'\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_YAML_>### YamlMime:JavaMember\nuid: \"com.microsoft.store.partnercenter.models.invoices.DailyUsageLineItem.getMeteredService*\"\nfullName: \"com.microsoft.store.partnercenter.models.invoices.DailyUsageLineItem.getMeteredService\"\nname: \"getMeteredService\"\nnameWithType: \"DailyUsageLineItem.getMeteredService\"\nmembers:\n- uid: \"com.microsoft.store.partnercenter.models.invoices.DailyUsageLineItem.getMeteredService()\"\n fullName: \"com.microsoft.store.partnercenter.models.invoices.DailyUsageLineItem.getMeteredService()\"\n name: \"getMeteredService()\"\n nameWithType: \"DailyUsageLineItem.getMeteredService()\"\n syntax: \"public String getMeteredService()\"\n returns:\n type: \"<xref href=\\\"java.lang.String?alt=java.lang.String&text=String\\\" data-throw-if-not-resolved=\\\"False\\\" />\"\ntype: \"method\"\nmetadata: {}\npackage: \"com.microsoft.store.partnercenter.models.invoices\"\nartifact: com.microsoft.store:partnercenter:1.15.3\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_YAML_> - php\n depends_on:\n - php\n\n php:\n build: docker/php\n expose:\n - 9000\n restart: always\n volumes:\n - ./docker/php/conf/php.ini:/usr/local/etc/php/conf.d/custom.ini\n - ./:/var/www/html\n links:\n - mysql\n environment:\n XDEBUG_CONFIG: remote_host=192.168.0.101</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>#include \"lue/info/space/mobile_space_point.hpp\"\n#include \"lue/core/tag.hpp\"\n\n\nnamespace lue {\nnamespace data_model {\n\nMobileSpacePoint::MobileSpacePoint(\n hdf5::Group const& parent):\n\n same_shape::constant_shape::Value{parent, coordinates_tag}\n\n{\n}\n\n\nMobileSpacePoint::MobileSpacePoint(\n hdf5::Group const& parent,\n hdf5::Datatype const& memory_datatype):\n\n same_shape::constant_shape::Value{parent, coordinates_tag, memory_datatype}\n\n{\n}\n\n\nMobileSpacePoint::MobileSpacePoint(\n same_shape::constant_shape::Value&& value):\n\n same_shape::constant_shape::Value{std::move(value)}\n\n{\n}\n\n\nCount MobileSpacePoint::nr_points() const\n{\n return nr_arrays();\n}\n\n\nMobileSpacePoint create_mobile_space_point(\n hdf5::Group& parent,\n hdf5::Datatype const& memory_datatype,\n std::size_t const rank)\n{\n return create_mobile_space_point(parent, file_datatype(memory_datatype), memory_datatype, rank);\n}\n\n\nMobileSpacePoint create_mobile_space_point(\n hdf5::Group& parent,\n hdf5::Datatype const& file_datatype,\n hdf5::Datatype const& memory_datatype,\n std::size_t const rank)\n{\n // A point is defined by the coordinates along each dimension\n hdf5::Shape const value_shape{rank};\n\n same_shape::constant_shape::Value value{\n same_shape::constant_shape::create_value(\n parent, coordinates_tag, file_datatype, memory_datatype, value_shape)};\n\n return MobileSpacePoint{std::move(value)};\n}\n\n} // namespace data_model\n} // namespace lue\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>N=int(input())\nN_list=[input() for i in range(N)]\n\nresult_list=[]\n\nfor i in range(len(N_list)):\n if i==(a for a in N_list):\n result_list.append(i)\n\nprint(len(result_list))</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>from __future__ import absolute_import\n\nfrom dcmviewer._version import __version__\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_> (1) The 'x[1]' property is a number and may be specified as:\n - An int or float in the interval [0, 1]\n\n Returns\n -------\n list\n \"\"\"\n return self['x']\n\n @x.setter\n def x(self, val):\n self['x'] = val\n\n # y\n # -\n @property\n def y(self):\n \"\"\"\n Sets the vertical domain of this parcoords trace (in plot\n fraction).\n \n The 'y' property is an info array that may be specified as a\n list or tuple of 2 elements where:\n \n (0) The 'y[0]' property is a number and may be specified as:\n - An int or float in the interval [0, 1]\n (1) The 'y[1]' property is a number and may be specified as:\n - An int or float in the interval [0, 1]\n\n Returns\n -------\n list\n \"\"\"\n return self['y']\n\n @y.setter\n def y(self, val):\n self['y'] = val\n\n # property parent name\n # --------------------\n @property\n def _parent_path_str(self):\n return 'parcoords'\n\n # Self properties description\n # ---------------------------\n @property\n def _prop_descriptions(self):\n return \"\"\"\\\n column\n If there is a layout grid, use the domain for this\n column in the grid for this parcoords trace .\n row\n If there is a layout grid, use the domain for this row\n in the grid for this parcoords trace .\n x\n Sets the horizontal domain of this parcoords trace (in\n plot fraction).\n y\n Sets the vertical domain of this parcoords trace (in\n plot fraction).\n \"\"\"\n\n def __init__(\n self, arg=None, column=None, row=None, x=None, y=None, **kwargs\n ):\n \"\"\"\n Construct a new Domain object\n \n Parameters\n ----------\n arg\n dict of properties compatible with this constructor or\n an instance of plotly.graph_objs.parcoords.Domain\n column\n If there is a layout grid, use the domain for this\n column in the grid for this parcoords trace .\n row\n If there is a layout grid, use the domain for this row\n in the grid for this parcoords trace .\n x\n Sets the horizontal domain of this parcoords trace (in\n plot fraction).\n y\n Sets the vertical domain of this parcoords trace (in\n plot fraction).\n\n Returns\n -------\n Domain\n \"\"\"\n super(Domain, self).__init__('domain')\n\n # Validate arg\n # ------------\n if arg is None:\n arg = {}\n elif isinstance(arg, self.__class__):\n arg = arg.to_plotly_json()\n elif isinstance(arg, dict):\n arg = copy.copy(arg)\n else:\n raise ValueError(\n \"\"\"\\\nThe first argument to the plotly.graph_objs.parcoords.Domain \nconstructor must be a dict or \nan instance of plotly.graph_objs.parcoords.Domain\"\"\"\n )\n\n # Handle skip_invalid\n # -------------------\n self._skip_invalid = kwargs.pop('skip_invalid', False)\n\n # Import validators\n # -----------------\n from plotly.validators.parcoords import (domain as v_domain)\n\n # Initialize validators\n # ---------------------\n self._validators['column'] = v_domain.ColumnValidator()\n self._validators['row'] = v_domain.RowValidator()\n self._validators['x'] = v_domain.XValidator()\n self._validators['y'] = v_domain.YValidator()\n\n # Populate data dict with properties\n # ----------------------------------\n _v = arg.pop('column', None)\n self['column'] = column if column is not None else _v\n _v = arg.pop('row', None)\n self['row'] = row if row is not None else _v\n _v = arg.pop('x', None)\n self['x'] = x if x is not None else _v\n _v = arg.pop('y', None)\n self['y'] = y if y is not None else _v\n\n # Process unknown kwargs\n # ----------------------\n self._process_kwargs(**dict(arg, **kwargs))\n\n # Reset skip_invalid\n # ------------------\n self._skip_invalid = False\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import subprocess\nfrom test_pitr.base import internal_connection_string\n\nsubprocess.call([\"docker-compose\", \"exec\", \"postgres\", \"bash\", \"-c\", f\"psql {internal_connection_string} -c 'select pg_switch_wal();'\"])</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License;\n * you may not use this file except in compliance with the Elastic License.\n */\npackage org.elasticsearch.xpack.ml.annotations;\n\nimport org.apache.logging.log4j.LogManager;\nimport org.apache.logging.log4j.Logger;\nimport org.apache.logging.log4j.message.ParameterizedMessage;\nimport org.elasticsearch.action.bulk.BulkRequest;\nimport org.elasticsearch.action.bulk.BulkResponse;\nimport org.elasticsearch.action.index.IndexRequest;\nimport org.elasticsearch.common.Nullable;\nimport org.elasticsearch.common.collect.Tuple;\nimport org.elasticsearch.common.xcontent.ToXContent;\nimport org.elasticsearch.common.xcontent.XContentBuilder;\nimport org.elasticsearch.common.xcontent.XContentFactory;\nimport org.elasticsearch.xpack.core.common.notifications.AbstractAuditor;\nimport org.elasticsearch.xpack.core.ml.annotations.Annotation;</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>package me.ddevil.mal.manga\n\nenum class MangaType {\n ONE_SHOT,\n MANGA,\n NOVEL\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Cuda_>.set_attr<FCompute>(\"FCompute<gpu>\", BinaryScalarOp::Compute<gpu, mshadow_op::mod>);\n\n//NNVM_REGISTER_OP(_backward_mod_scalar)\n//.set_attr<FCompute>(\"FCompute<gpu>\", BinaryScalarOp::Backward<\n// gpu, mshadow_op::mod_grad>);\n\nNNVM_REGISTER_OP(_rmod_scalar)\n.set_attr<FCompute>(\"FCompute<gpu>\", BinaryScalarOp::Compute<gpu, mshadow_op::rmod>);\n\n//NNVM_REGISTER_OP(_backward_rmod_scalar)\n//.set_attr<FCompute>(\"FCompute<gpu>\", BinaryScalarOp::Backward<\n// gpu, mshadow_op::rmod_grad>);\n\n} // namespace op\n} // namespace mxnet\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_> struct sendmsg s2;\n \n //memset(buf,0,sizeof(buf));\n memset(&s2,0,sizeof(struct sendmsg));\n int len=recv(*it,(char*)&s2,sizeof(struct sendmsg),0);\n //memcpy(&s2,buf,sizeof(struct sendmsg));\n s3=s2;\n cout<<s2.name<<\" : \"<<s2.msg<<endl;\n sendMess(); \n\n }\n }\n sleep(1);\n }\n \n}\n\nvoid sendMess(){\n // while(1){\n //char buf[1024];\n //fgets(buf,sizeof(buf),stdin);\n \n\n std::list<int>::iterator it;\n for(it=li.begin();it!=li.end();++it){\n\n //for(int j=0;j<z;j++){\n\n send(*it,(char*)&s3,sizeof(struct sendmsg),0);\n\n //send(*it,buf,sizeof(buf),0);\n a++;\n }\n cout<<\"time:\"<<a;\n // }\n\n}\n\nint main(){\n int opt=1;\n s=socket(AF_INET,SOCK_STREAM,0);\n memset(&servaddr,0,sizeof(servaddr));\n servaddr.sin_family=AF_INET;\n servaddr.sin_port=htons(PORT);\n //servaddr.sin_addr.s_addr=inet_addr(IP);\n servaddr.sin_addr.s_addr=htons(INADDR_ANY);</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Dockerfile_>RUN pip install -U -r /app/requirements.txt --no-cache-dir\nRUN cd /app/project/assets/ \\\n && npm install \\\n && npm cache clear\n\nADD . /app/\n\nRUN cd /app/project/assets/ \\\n && npm run build\nRUN python manage.py collectstatic --noinput -v0\n\nADD docker/production/nginx/nginx.conf /etc/nginx/sites-enabled/project\nADD docker/production/nginx/conf.d/* /etc/nginx/conf.d/\n\nEXPOSE 8000\nCMD ['python', 'manage.py', 'runserver', ]\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import re\nimport random\nimport copy\nimport nbformat\nimport base64\nimport pickle\nfrom nbgrader.preprocessors import NbGraderPreprocessor\n\nclass Scramble(NbGraderPreprocessor):\n \n def __init__(self, **kw):\n self.__seed = random.randint(0, 10000000)\n self.__random = random.Random(self.__seed)\n self.__p_define = re.compile(r'^#define +(?P<fun>\\w+)\\((?P<args>[^(]*)\\) +(?P<body>.*)')\n self.__p_set = re.compile(r'^#set +(?P<name>\\w+) += +(?P<options>.*)')\n self.__p_random = re.compile(r'^#random +(?P<vars>.*) +in +(?P<sets>.*)')\n self.__p_replace = re.compile(r'#replace +(?P<name>\\w+) +(?P<replace_with>.*)')\n self.__p_lambda = re.compile('^#lambda +(?P<name>[^ ]+) +(?P<lambda>.*)')\n if kw and 'seed' in kw:\n self.__random = random.Random(kw['seed'])\n self.__seed = kw['seed']\n\n def parse_define(self, line):\n match = self.__p_define.search(line)\n f_name = match.group('fun')\n f_args = [arg.strip() for arg in match.group('args').split(',')]\n f_body = match.group('body')\n return f_name, f_args, f_body\n\n def parse_set(self, line):\n match = self.__p_set.search(line)\n if match:\n return match.group('name'), match.group('options')\n return None\n\n def parse_random(self, line, sets):\n match = self.__p_random.search(line)\n if not match:\n return None\n opts = [s.strip() for s in match.group('sets').split(',')]\n var_str = match.group('vars')\n if '!=' in var_str:\n rand_vars = [s.strip() for s in var_str.split('!=')]\n var_groups = [[v.strip() for v in s.split(',')] for s in rand_vars]\n return var_groups, '!=', opts\n else:\n rand_vars = [s.strip() for s in var_str.split('==')]\n var_groups = [[v.strip() for v in s.split(',')] for s in rand_vars]\n return var_groups, '==', opts\n \n def parse_replace(self, line):\n match = self.__p_replace.search(line)\n if not match:\n return None\n return match.group('name'), match.group('replace_with')\n \n def parse_lambda(self, line):\n match = self.__p_lambda.search(line)\n if not match:\n return None\n return match.group('name'), 'lambda ' + match.group('lambda')\n \n def replace(self, text, macro):\n p_macro = re.compile(r'(?P<fun>{}\\((?P<args>[^)]*)\\))'.format(macro[0]))\n processed = text\n for match in p_macro.finditer(text):\n args = [arg.strip() for arg in match.group('args').split(',')]\n assert len(macro[1]) == len(args), 'Wrong number of arguments for macro {} with args {}'.format(macro[0], args)\n replacement = macro[2]\n for i in range(len(args)):\n replacement = replacement.replace(macro[1][i], args[i])\n processed = processed.replace(match.group('fun'), replacement)\n return processed\n \n def replace_lambdas(self, text, name, expr):\n p_macro = re.compile(r'(?P<fun>{}\\((?P<args>[^)]*)\\))'.format(name))\n processed = text\n for match in p_macro.finditer(text):\n args = [arg.strip() for arg in match.group('args').split(',')]\n \n replacement = expr(*args)\n processed = processed.replace(match.group('fun'), str(replacement))\n return processed\n\n def sample(self, groups, constraint, sets_names, set_dict):\n sets = [set_dict[sets_name] for sets_name in sets_names]\n rand_dict = {}\n if constraint == '==':\n k = 1\n sampled_idx = self.__random.sample(range(len(sets[0])), k=k)\n for g_idx in range(len(groups)):\n group = groups[g_idx]\n for set_idx in range(len(group)):\n rand_dict[group[set_idx]] = sets[set_idx][sampled_idx[0]]\n return rand_dict \n\n if constraint == '!=':\n k = len(groups)\n sampled_idx = self.__random.sample(range(len(sets[0])), k=k)\n for g_idx in range(len(groups)):\n group = groups[g_idx]\n for set_idx in range(len(group)):\n rand_dict[group[set_idx]] = sets[set_idx][sampled_idx[g_idx]]\n return rand_dict\n\n def sample_config(self, config): \n lines = config.split('\\n')\n new_lines = []\n i = 0\n while i < len(lines):\n line = lines[i].strip()\n while line.endswith('\\\\'):\n line = line[:-1]\n line += lines[i+1].strip()\n i += 1\n i += 1\n\n new_lines.append(line)\n lines = new_lines\n\n macros = []\n sets = {}\n rands = []\n rand_vars = {}\n replaces = {}\n lambdas = {}\n for line in lines:\n line = line.strip()\n if line.startswith('#define'):\n macros.append(list(self.parse_define(line)))\n elif line.startswith('#set'):\n name, opts = self.parse_set(line)\n sets[name] = [opt.strip() for opt in opts.split('||')]\n elif line.startswith('#random'):\n rands.append(self.parse_random(line, sets))\n elif line.startswith('#replace'):\n name, replace_with = self.parse_replace(line)\n replaces[name] = replace_with\n elif line.startswith('#lambda'):\n name, lambda_expr = self.parse_lambda(line)\n lambdas[name] = eval(lambda_expr)\n\n\n for i in range(len(macros)):\n for j in range(i+1,len(macros)):\n macros[j][2] = self.replace(macros[j][2], macros[i])\n for set_name in sets:\n sets[set_name] = [self.replace(s, macros[i]) for s in sets[set_name]]\n for r_name in replaces:\n replaces[r_name] = self.replace(replaces[r_name], macros[i])\n\n for rand in rands:\n rand_vars.update(self.sample(rand[0], rand[1], rand[2], sets))\n\n\n for rand in rand_vars:\n for r_name in replaces:\n replaces[r_name] = replaces[r_name].replace(rand, rand_vars[rand])\n\n for rand in rand_vars:\n for r_name in replaces:\n replaces[r_name] = replaces[r_name].replace(rand, rand_vars[rand])\n \n for rand in rand_vars:\n for r_name in replaces:\n replaces[r_name] = replaces[r_name].replace(rand, rand_vars[rand])\n \n for lambda_expr in lambdas:\n for r_name in replaces:</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_># -*- coding: utf-8 -*\n\nimport torch.nn as nn\n\nfrom videoanalyst.model.backbone.backbone_base import (TRACK_BACKBONES,\n VOS_BACKBONES)\nfrom videoanalyst.model.common_opr.common_block import conv_bn_relu\nfrom videoanalyst.model.module_base import ModuleBase\n\n\n@VOS_BACKBONES.register\n@TRACK_BACKBONES.register\n\nclass AlexNet(ModuleBase):\n r\"\"\"\n AlexNet\n\n Hyper-parameters\n ----------------\n pretrain_model_path: string\n Path to pretrained backbone parameter file,\n Parameter to be loaded in _update_params_\n \"\"\"</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SML_>X, Y, TStamp, Pres., EndPts\nDataSize: 226\n8986 16022 0 30 0\n8936 16143 10 40 0\n8887 16384 15 52 0\n8837 16865 25 47 0\n8887 17468 31 52 0\n8887 18191 47 47 0\n8986 19034 57 50 0\n9085 19636 62 63 0\n9284 20238 78 61 0\n9532 20720 88 65 0\n9780 21082 94 66 0\n10128 21323 104 61 0\n10525 21443 109 60 0\n10922 21323 125 64 0</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>START TRANSACTION;\nSET time_zone = \"+00:00\";\n\n\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n/*!40101 SET NAMES utf8mb4 */;\n\n--\n-- Base de datos: `tienda_anime`\n--\n\n-- --------------------------------------------------------\n\n--\n-- Estructura de tabla para la tabla `categoria`\n--\n\nCREATE TABLE `categoria` (\n `idcategoria` varchar(50) NOT NULL,\n `nombre` varchar(50) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n--\n-- Volcado de datos para la tabla `categoria`\n--\n\nINSERT INTO `categoria` (`idcategoria`, `nombre`) VALUES\n('20212614265800000058-2', 'nueva'),\n('2147483647', 'plastico');\n\n-- --------------------------------------------------------\n\n--\n-- Estructura de tabla para la tabla `detalleventa`\n--\n\nCREATE TABLE `detalleventa` (\n `iddetalle` varchar(50) NOT NULL,\n `idventa` varchar(50) DEFAULT NULL,\n `idproducto` varchar(50) DEFAULT NULL,\n `cantidad` int(20) DEFAULT NULL,\n `monto` double(8,2) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n--\n-- Volcado de datos para la tabla `detalleventa`\n--\n\nINSERT INTO `detalleventa` (`iddetalle`, `idventa`, `idproducto`, `cantidad`, `monto`) VALUES\n('20210020003700000037-5', '20210020003700000037-25', '20214714475100000051-1', 8, 8.00),</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>/*------------------------------------------------------------------------\n* (The MIT License)\n* \n* Copyright (c) 2008-2011 Rhomobile, Inc.\n* \n* Permission is hereby granted, free of charge, to any person obtaining a copy\n* of this software and associated documentation files (the \"Software\"), to deal\n* in the Software without restriction, including without limitation the rights\n* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n* copies of the Software, and to permit persons to whom the Software is\n* furnished to do so, subject to the following conditions:\n* \n* The above copyright notice and this permission notice shall be included in\n* all copies or substantial portions of the Software.\n* \n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n* THE SOFTWARE.\n* \n* http://rhomobile.com\n*------------------------------------------------------------------------*/\n\n#include \"stdafx.h\"\n\n#include \"RhoThreadImpl.h\"\n\n\nnamespace rho{\nnamespace common{\nIMPLEMENT_LOGCLASS(CRhoThreadImpl,\"RhoThreadWM\");\n\nCRhoThreadImpl::CRhoThreadImpl() : m_hAwakeEvent(0), m_hThread(0)\n{\n\tLOG(INFO) + \" JDP create CRhoThreadImpl(WM) object\";\n\tm_hAwakeEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL);\n}\n\nCRhoThreadImpl::~CRhoThreadImpl()\n{\n if ( m_hAwakeEvent )\n ::CloseHandle(m_hAwakeEvent);\n}\n\nstatic DWORD WINAPI runProc(void* pv) throw()\n{\n\tIRhoRunnable* p = static_cast<IRhoRunnable*>(pv);\n\tp->runObject();\n#if !defined(OS_WP8)\n ::ExitThread(0);\n#endif\n\treturn 0;\n}\n\nvoid CRhoThreadImpl::start(IRhoRunnable* pRunnable, IRhoRunnable::EPriority ePriority)\n{\n m_hThread = ::CreateThread(NULL, 0, runProc, pRunnable, 0, NULL);\n setThreadPriority(ePriority);\n}\n\nvoid CRhoThreadImpl::setThreadPriority(IRhoRunnable::EPriority ePriority)\n{\n int nPriority = THREAD_PRIORITY_NORMAL;\n if ( ePriority == IRhoRunnable::epHigh )\n nPriority = THREAD_PRIORITY_HIGHEST;\n else if (ePriority == IRhoRunnable::epLow)\n nPriority = THREAD_PRIORITY_LOWEST;\n\n ::SetThreadPriority(m_hThread,nPriority);\n}\n\nvoid CRhoThreadImpl::stop(unsigned int nTimeoutToKillMs)\n{\n stopWait();\n if ( m_hThread )\n {\n DWORD dwRes = ::WaitForSingleObject( m_hThread, nTimeoutToKillMs );\n if ( dwRes != WAIT_OBJECT_0 )\n {\n LOG(INFO) + \"Terminate thread. ID: \" + ::GetCurrentThreadId() + \"; Result: \" + dwRes;\n ::TerminateThread(m_hThread,0);\n }\n ::CloseHandle(m_hThread);\n m_hThread = null;\n }\n}\n\nint CRhoThreadImpl::wait(unsigned int nTimeoutMs)\n{\n DWORD dwRes = ::WaitForSingleObject( m_hAwakeEvent, nTimeoutMs );</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Kotlin_>// Automatically generated - do not modify!\n\n@file:JsModule(\"@mui/icons-material/AccessibleOutlined\")\n@file:JsNonModule\n\npackage mui.icons.material\n\n@JsName(\"default\")\nexternal val AccessibleOutlined: SvgIconComponent\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Go_>// Code generated by protoc-gen-gogo. DO NOT EDIT.\n// source: k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto\n\n/*\n\tPackage v1 is a generated protocol buffer package.\n\n\tIt is generated from these files:\n\t\tk8s.io/apimachinery/pkg/apis/meta/v1/generated.proto\n\n\tIt has these top-level messages:\n\t\tAPIGroup\n\t\tAPIGroupList\n\t\tAPIResource\n\t\tAPIResourceList\n\t\tAPIVersions\n\t\tCreateOptions\n\t\tDeleteOptions\n\t\tDuration\n\t\tExportOptions\n\t\tGetOptions\n\t\tGroupKind\n\t\tGroupResource\n\t\tGroupVersion\n\t\tGroupVersionForDiscovery\n\t\tGroupVersionKind\n\t\tGroupVersionResource\n\t\tInitializer\n\t\tInitializers\n\t\tLabelSelector\n\t\tLabelSelectorRequirement\n\t\tList\n\t\tListMeta\n\t\tListOptions\n\t\tMicroTime\n\t\tObjectMeta\n\t\tOwnerReference\n\t\tPatch\n\t\tPreconditions\n\t\tRootPaths\n\t\tServerAddressByClientCIDR\n\t\tStatus\n\t\tStatusCause\n\t\tStatusDetails\n\t\tTime\n\t\tTimestamp\n\t\tTypeMeta\n\t\tUpdateOptions\n\t\tVerbs\n\t\tWatchEvent\n*/\npackage v1\n\nimport proto \"github.com/golang/protobuf/proto\"\nimport fmt \"fmt\"\nimport math \"math\"\nimport k8s_io_apimachinery_pkg_runtime \"github.com/ericchiang/k8s/runtime\"\nimport _ \"github.com/ericchiang/k8s/runtime/schema\"\n\nimport io \"io\"\n\n// Reference imports to suppress errors if they are not otherwise used.\nvar _ = proto.Marshal\nvar _ = fmt.Errorf\nvar _ = math.Inf\n\n// This is a compile-time assertion to ensure that this generated file\n// is compatible with the proto package it is being compiled against.\n// A compilation error at this line likely means your copy of the\n// proto package needs to be updated.\nconst _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package\n\n// APIGroup contains the name, the supported versions, and the preferred version\n// of a group.\ntype APIGroup struct {\n\t// name is the name of the group.\n\tName *string `protobuf:\"bytes,1,opt,name=name\" json:\"name,omitempty\"`\n\t// versions are the versions supported in this group.\n\tVersions []*GroupVersionForDiscovery `protobuf:\"bytes,2,rep,name=versions\" json:\"versions,omitempty\"`\n\t// preferredVersion is the version preferred by the API server, which\n\t// probably is the storage version.\n\t// +optional\n\tPreferredVersion *GroupVersionForDiscovery `protobuf:\"bytes,3,opt,name=preferredVersion\" json:\"preferredVersion,omitempty\"`\n\t// a map of client CIDR to server address that is serving this group.\n\t// This is to help clients reach servers in the most network-efficient way possible.\n\t// Clients can use the appropriate server address as per the CIDR that they match.\n\t// In case of multiple matches, clients should use the longest matching CIDR.\n\t// The server returns only those CIDRs that it thinks that the client can match.\n\t// For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP.\n\t// Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.\n\t// +optional\n\tServerAddressByClientCIDRs []*ServerAddressByClientCIDR `protobuf:\"bytes,4,rep,name=serverAddressByClientCIDRs\" json:\"serverAddressByClientCIDRs,omitempty\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *APIGroup) Reset() { *m = APIGroup{} }\nfunc (m *APIGroup) String() string { return proto.CompactTextString(m) }\nfunc (*APIGroup) ProtoMessage() {}\nfunc (*APIGroup) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{0} }\n\nfunc (m *APIGroup) GetName() string {\n\tif m != nil && m.Name != nil {\n\t\treturn *m.Name\n\t}\n\treturn \"\"\n}\n\nfunc (m *APIGroup) GetVersions() []*GroupVersionForDiscovery {\n\tif m != nil {\n\t\treturn m.Versions\n\t}\n\treturn nil\n}\n\nfunc (m *APIGroup) GetPreferredVersion() *GroupVersionForDiscovery {\n\tif m != nil {\n\t\treturn m.PreferredVersion\n\t}\n\treturn nil\n}\n\nfunc (m *APIGroup) GetServerAddressByClientCIDRs() []*ServerAddressByClientCIDR {\n\tif m != nil {\n\t\treturn m.ServerAddressByClientCIDRs\n\t}\n\treturn nil\n}\n\n// APIGroupList is a list of APIGroup, to allow clients to discover the API at\n// /apis.\ntype APIGroupList struct {\n\t// groups is a list of APIGroup.\n\tGroups []*APIGroup `protobuf:\"bytes,1,rep,name=groups\" json:\"groups,omitempty\"`\n\tXXX_unrecognized []byte `json:\"-\"`\n}\n\nfunc (m *APIGroupList) Reset() { *m = APIGroupList{} }\nfunc (m *APIGroupList) String() string { return proto.CompactTextString(m) }\nfunc (*APIGroupList) ProtoMessage() {}\nfunc (*APIGroupList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} }\n\nfunc (m *APIGroupList) GetGroups() []*APIGroup {\n\tif m != nil {\n\t\treturn m.Groups\n\t}\n\treturn nil\n}\n\n// APIResource specifies the name of a resource and whether it is namespaced.\ntype APIResource struct {\n\t// name is the plural name of the resource.\n\tName *string `protobuf:\"bytes,1,opt,name=name\" json:\"name,omitempty\"`\n\t// singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely.\n\t// The singularName is more correct for reporting status on a single item and both singular and plural are allowed\n\t// from the kubectl CLI interface.\n\tSingularName *string `protobuf:\"bytes,6,opt,name=singularName\" json:\"singularName,omitempty\"`\n\t// namespaced indicates if a resource is namespaced or not.\n\tNamespaced *bool `protobuf:\"varint,2,opt,name=namespaced\" json:\"namespaced,omitempty\"`\n\t// group is the preferred group of the resource. Empty implies the group of the containing resource list.\n\t// For subresources, this may have a different value, for example: Scale\".\n\tGroup *string `protobuf:\"bytes,8,opt,name=group\" json:\"group,omitempty\"`\n\t// version is the preferred version of the resource. Empty implies the version of the containing resource list\n\t// For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".\n\tVersion *string `protobuf:\"bytes,9,opt,name=version\" json:\"version,omitempty\"`\n\t// kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')\n\tKind *string `protobuf:\"bytes,3,opt,name=kind\" json:\"kind,omitempty\"`\n\t// verbs is a list of supported kube verbs (this includes get, list, watch, create,\n\t// update, patch, delete, deletecollection, and proxy)\n\tVerbs *Verbs `protobuf:\"bytes,4,opt,name=verbs\" json:\"verbs,omitempty\"`\n\t// shortNames is a list of suggested short names of the resource.\n\tShortNames []string `protobuf:\"bytes,5,rep,name=shortNames\" json:\"shortNames,omitempty\"`</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C#_>using System;\nusing System.Collections.Generic;\n\nnamespace ITP1_8_B\n{\n class Program\n {\n static void Main(string[] args)\n {\n var result = new List<int>();\n string input;\n while ((input = Console.ReadLine()) != \"0\")\n {\n int sum = 0;\n foreach (var i in input) sum += int.Parse(i.ToString()); \n result.Add(sum);\n }\n foreach (var r in result) Console.WriteLine(r); \n }\n }\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_> *\n */\n void listen() {\n while (true) {\n auto recv_buffer = allocate_buffer();\n recv_buffer->resize(m_buffer_capacity); // TODO: does this clear?\n MPI_Status status;\n ASSERT_MPI(MPI_Recv(recv_buffer->data(), m_buffer_capacity, MPI_BYTE,\n MPI_ANY_SOURCE, MPI_ANY_TAG, m_comm_async, &status));\n int tag = status.MPI_TAG;\n\n if (tag == large_message_announce_tag) {\n // Determine size and source of message\n size_t size = *(reinterpret_cast<size_t *>(recv_buffer->data()));\n int src = status.MPI_SOURCE;\n\n // Allocate large buffer\n auto large_recv_buff = std::make_shared<std::vector<char>>(size);\n\n // Receive large message\n receive_large_message(large_recv_buff, src, size);\n\n // Add buffer to receive queue\n receive_queue_push_back(large_recv_buff, src);\n } else {\n int count;\n ASSERT_MPI(MPI_Get_count(&status, MPI_BYTE, &count))\n // std::cout << \"RANK: \" << rank() << \" received count: \" << count\n // << std::endl;\n // Resize buffer to cout MPI actually received\n recv_buffer->resize(count);\n\n // Check for kill signal\n if (status.MPI_SOURCE == m_comm_rank) break;\n\n // Add buffer to receive queue\n receive_queue_push_back(recv_buffer, status.MPI_SOURCE);\n }\n }\n }\n\n /*\n * @brief Send a large message\n *\n * @param dest Destination for message\n * @param msg Packed message to send\n */\n void send_large_message(const std::vector<char> &msg, const int dest) {\n // Announce the large message and its size\n size_t size = msg.size();\n ASSERT_MPI(MPI_Send(&size, 8, MPI_BYTE, dest, large_message_announce_tag,\n m_comm_async));\n\n // Send message\n ASSERT_MPI(MPI_Send(msg.data(), size, MPI_BYTE, dest, large_message_tag,\n m_comm_async));\n }\n\n /*\n * @brief Receive a large message that has been announced\n *\n * @param src Source of message\n * @param msg Buffer to hold message\n */\n void receive_large_message(std::shared_ptr<std::vector<char>> msg,\n const int src, const size_t size) {\n ASSERT_MPI(MPI_Recv(msg->data(), size, MPI_BYTE, src, large_message_tag,\n m_comm_async, MPI_STATUS_IGNORE));\n }\n\n /**\n * @brief Allocates buffer; checks free pool first.\n *\n * @return std::shared_ptr<std::vector<char>>\n */\n std::shared_ptr<std::vector<char>> allocate_buffer() {\n std::scoped_lock lock(m_vec_free_buffers_mutex);\n if (m_vec_free_buffers.empty()) {\n auto to_return = std::make_shared<std::vector<char>>();\n to_return->reserve(m_buffer_capacity);\n return to_return;\n } else {\n auto to_return = m_vec_free_buffers.back();\n m_vec_free_buffers.pop_back();\n return to_return;\n }\n }\n\n /**\n * @brief Frees a previously allocated buffer. Adds buffer to free pool.\n *\n * @param b buffer to free\n */\n void free_buffer(std::shared_ptr<std::vector<char>> b) {\n b->clear();\n std::scoped_lock lock(m_vec_free_buffers_mutex);\n m_vec_free_buffers.push_back(b);\n }\n\n size_t receive_queue_peek_size() const { return m_receive_queue.size(); }\n\n std::pair<std::shared_ptr<std::vector<char>>, int> receive_queue_try_pop() {\n std::scoped_lock lock(m_receive_queue_mutex);\n if (m_receive_queue.empty()) {\n return std::make_pair(std::shared_ptr<std::vector<char>>(), int(-1));\n } else {\n auto to_return = m_receive_queue.front();\n m_receive_queue.pop_front();\n return to_return;\n }\n }\n\n void receive_queue_push_back(std::shared_ptr<std::vector<char>> b, int from) {\n size_t current_size = 0;\n {\n std::scoped_lock lock(m_receive_queue_mutex);\n m_receive_queue.push_back(std::make_pair(b, from));\n current_size = m_receive_queue.size();\n }\n if (current_size > 16) {\n std::this_thread::sleep_for(std::chrono::microseconds(current_size - 16));\n }\n }\n\n // Used if dest = m_comm_rank\n template <typename Lambda, typename... Args>\n int32_t local_receive(Lambda l, const Args &... args) {\n ASSERT_DEBUG(sizeof(Lambda) == 1);\n // Question: should this be std::forward(...)\n // \\pp was: (l)(this, m_comm_rank, args...);\n ygm::meta::apply_optional(l, std::make_tuple(this, m_comm_rank), std::make_tuple(args...));\n return 1;\n }\n\n template <typename Lambda, typename... PackArgs>\n std::vector<char> pack_lambda(Lambda l, const PackArgs &... args) {\n std::vector<char> to_return;\n const std::tuple<PackArgs...> tuple_args(\n std::forward<const PackArgs>(args)...);\n ASSERT_DEBUG(sizeof(Lambda) == 1);\n\n void (*fun_ptr)(impl *, int, cereal::YGMInputArchive &) =\n [](impl *t, int from, cereal::YGMInputArchive &bia) {</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Dockerfile_>COPY --from=BUILDER /usr/bin/indexer /usr/bin/indexer\n\nWORKDIR /home/depscloud\nUSER 13490:13490\n\nENTRYPOINT [ \"/usr/bin/indexer\" ]\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_PHP_>@foreach ($messages as $message)\n <li>\n <a href=\"/messages/{{ $message->msgId }}/edit\">\n\n <div class=\"row message-container justify-content-center\">\n <h4>{{ ucwords($message->username) }}</h4>\n <span class=\"d-time\">{{ $message->email }} | {{ date('F d, Y | h:i:s a', strtotime($message->created_at)) }}</span>\n <span class=\"m-time\">{{ $message->email }} <br>{{ date('F d, Y | h:i:s a', strtotime($message->created_at)) }}</span>\n <div class=\"col-sm-10 col-md-10 col-lg-10 div_msg\">\n <p class=\"p_msg\">\n {{ $message->description }}\n </p>\n </div>\n </div>\n </a>\n </li>\n@endforeach\n@foreach ($read as $reads)\n <li>\n <a href=\"/messages/{{ $reads->msgId }}/edit\">\n <div class=\"row r-message-container justify-content-center\">\n <h4>{{ ucwords($reads->username) }}</h4>\n <span class=\"d-time\">{{ $reads->email }} | {{ date('F d, Y | h:i:s a', strtotime($message->created_at)) }}</span>\n <span class=\"m-time\">{{ $reads->email }} <br>{{ date('F d, Y | h:i:s a', strtotime($message->created_at)) }}</span>\n <div class=\"col-sm-10 col-md-10 col-lg-10 div_msg\">\n <p class=\"r-p_msg\">\n {{ $reads->description }}\n </p>\n </div>\n </div>\n </a>\n </li>\n@endforeach\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>/*\n * arch/arm/mach-mv78xx0/include/mach/mv78xx0.h\n *\n * Generic definitions for Marvell MV78xx0 SoC flavors:\n * MV781x0 and MV782x0.\n *\n * This file is licensed under the terms of the GNU General Public\n * License version 2. This program is licensed \"as is\" without any\n * warranty of any kind, whether express or implied.\n */\n\n#ifndef __ASM_ARCH_MV78XX0_H\n#define __ASM_ARCH_MV78XX0_H\n\n/*\n * Marvell MV78xx0 address maps.\n *\n * phys\n * c0000000\tPCIe Memory space</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Go_>package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&as[i])\n\t}\n\n\tnum := f(as[0])\n\n\tif n == 1 {\n\t\tfmt.Println(num)\n\t} else {\n\t\tfor i := 1; i < n; i++ {\n\t\t\ttmp := f(as[i])\n\t\t\tif tmp < num {\n\t\t\t\tnum = tmp\n\t\t\t}\n\t\t}\n\t\tfmt.Println(num)\n\t}\n}\n\nfunc f(n int) int {\n\tvar num int\n\ttmp := n\n\tfor tmp%2 == 0 {\n\t\ttmp /= 2\n\t\tnum++\n\t}\n\treturn num\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import base64\nimport io\nimport os\n\nfrom django.conf import settings\nfrom PIL import Image\n\nfrom core.utils import random_uuid4\nfrom projects.workers.base import Worker\nfrom projects.workers.exceptions import WorkerNoInputException\n\n\nclass GrayscaleImage(Worker):\n id = 'grayscale_image'\n name = 'grayscale_image'</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Dockerfile_># AUTOGENERATED FILE\nFROM balenalib/intel-nuc-ubuntu:bionic-build\n\nENV GO_VERSION 1.13.14\n\nRUN mkdir -p /usr/local/go \\\n\t&& curl -SLO \"https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz\" \\\n\t&& echo \"32617db984b18308f2b00279c763bff060d2739229cb8037217a49c9e691b46a go$GO_VERSION.linux-amd64.tar.gz\" | sha256sum -c - \\\n\t&& tar -xzf \"go$GO_VERSION.linux-amd64.tar.gz\" -C /usr/local/go --strip-components=1 \\\n\t&& rm -f go$GO_VERSION.linux-amd64.tar.gz\n\nENV GOROOT /usr/local/go\nENV GOPATH /go\nENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH\n\nRUN mkdir -p \"$GOPATH/src\" \"$GOPATH/bin\" && chmod -R 777 \"$GOPATH\"\nWORKDIR $GOPATH\n\nCMD [\"echo\",\"'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs\"]\n\n RUN curl -SLO \"https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@golang.sh\" \\\n && echo \"Running test-stack@golang\" \\\n && chmod +x test-stack@golang.sh \\\n && bash test-stack@golang.sh \\\n && rm -rf test-stack@golang.sh \n\nRUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \\nArchitecture: Intel 64-bit (x86-64) \\nOS: Ubuntu bionic \\nVariant: build variant \\nDefault variable(s): UDEV=off \\nThe following software stack is preinstalled: \\nGo v1.13.14 \\nExtra features: \\n- Easy way to install packages with `install_packages <package-name>` command \\n- Run anywhere with cross-build feature (for ARM only) \\n- Keep the container idling with `balena-idle` command \\n- Show base image details with `balena-info` command' > /.balena/messages/image-info\n\nRUN echo '#!/bin/sh.real\\nbalena-info\\nrm -f /bin/sh\\ncp /bin/sh.real /bin/sh\\n/bin/sh \"$@\"' > /bin/sh-shim \\\n\t&& chmod +x /bin/sh-shim \\\n\t&& cp /bin/sh /bin/sh.real \\\n\t&& mv /bin/sh-shim /bin/sh</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_> * not participate in collisions. Drawn on top of all other actors.\n */\nexport class ScreenElement extends Actor {\n /**\n * @param xOrConfig The starting x coordinate of the actor or the actor option bag\n * @param y The starting y coordinate of the actor\n * @param width The starting width of the actor\n * @param height The starting height of the actor\n */\n constructor(xOrConfig, y, width, height) {\n if (typeof xOrConfig !== 'object') {\n super(xOrConfig, y, width, height);\n }\n else {\n super(xOrConfig);\n }\n this.components.transform.coordPlane = CoordPlane.Screen;\n this.traits = [];\n this.traits.push(new Traits.CapturePointer());\n this.anchor.setTo(0, 0);\n this.body.collider.type = CollisionType.PreventCollision;\n this.body.collider.shape = Shape.Box(this.width, this.height, this.anchor);\n this.enableCapturePointer = true;\n }\n _initialize(engine) {\n this._engine = engine;\n super._initialize(engine);\n }\n contains(x, y, useWorld = true) {\n if (useWorld) {\n return super.contains(x, y);\n }\n const coords = this._engine.worldToScreenCoordinates(new Vector(x, y));\n return super.contains(coords.x, coords.y);\n }\n}\n//# sourceMappingURL=ScreenElement.js.map</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>#include <iostream>\n#include <cmath>\n\nusing namespace std;\n\ntypedef long long ll;\n\nvoid solve(ll a, ll b, ll v[], int m) {\n for (int i = 0; i < m; i++) {\n if ( a + b >= 0 && a - b >= 0 ) {\n cout << \"R\";\n a -= v[i];\n } else if ( a + b >= 0 && a - b < 0 ) {\n cout << \"U\";\n b -= v[i];\n } else if ( a + b < 0 && a - b >= 0 ) {\n cout << \"D\";\n b += v[i];\n } else {\n cout << \"L\";\n a += v[i];\n }\n }\n cout << endl;\n return;\n}\n\nint main() {\n int N, m = 34;\n ll X[1003], Y[1003];\n ll d[34];\n ll t = 1;\n for (int i = 0; i < 33; i++) {\n d[32-i] = t;\n t *= 2;\n }\n\n cin >> N;\n\n int even = 0, odd = 0;\n for (int i = 0; i < N; i++) {\n cin >> X[i] >> Y[i];\n if ( ( abs(X[i]) + abs(Y[i])) % 2 == 0) {\n even++;\n } else {\n odd++;\n }\n }\n if (even && odd) {\n cout << -1 << endl;\n return 0;\n }\n if (even) {\n for (int i = 0; i < 33; i++) {\n d[33-i] = d[32-i];\n }\n d[0] = 1;\n }\n if (odd) { m -= 1; }\n cout << m << endl;\n\n for (int i = 0; i < m; i++) {\n cout << d[i];\n if (i == m-1) { cout << endl; }\n else { cout << \" \"; }\n }\n\n for (int i = 0; i < N; i++) {\n solve(X[i], Y[i], d, m);\n }\n\n return 0;\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Bash_>#!/bin/bash\n#$ -hold_jid 539126,539127,539128,539129,539130,539131,539132,539133,539134,539135,539136,539137,539138,539139,539140,539141,539142,539143,539144,539145,539146,539147,539148,539149,539150,539151,539152,539153,539154,539155,539156,539157,539158,539159,539160,539161,539162,539163,539164,539165,539166,539167,539168,539169,539170,539171,539172,539173,539174,539175\nset -e\nset -o pipefail\numask 0002\n\n#### SET THE STAGE\nSCRATCH_DIR=/scratch/GATKv4DNAHaplotypeCaller_Reseq_low_301_350_on_A_2020-01-07--15-19-57_323_temp$$\nGSTORE_DIR=/srv/gstore/projects\nINPUT_DATASET=/srv/gstore/projects/p1634/GATKv4DNAHaplotypeCaller_Reseq_low_301_350_on_A_2020-01-07--15-19-57/input_dataset.tsv\nLAST_JOB=FALSE\necho \"Job runs on `hostname`\"\necho \"at $SCRATCH_DIR\"\nmkdir $SCRATCH_DIR || exit 1\ncd $SCRATCH_DIR || exit 1\nsource /usr/local/ngseq/etc/lmod_profile\nmodule add Tools/samtools/1.9 Variants/GATK/4.1.2.0 Tools/Picard/2.18.0\n\n#### NOW THE ACTUAL JOBS STARTS\nsamtools sort /srv/gstore/projects/p1634/EAGLERC_Reseq_low_301_350_2019-12-20--12-30-32/323_A_ref.bam -o 323_A_ref.sort.bam\ngatk AddOrReplaceReadGroups -I 323_A_ref.sort.bam -ID 323 -PU 323 -LB 323 -SM 323 -PL Illumina -O 323_A_ref.sort.rg.bam\nsamtools index 323_A_ref.sort.rg.bam\ngatk MarkDuplicates -I 323_A_ref.sort.rg.bam -O 323_A_ref.sort.rg.dup.bam -M 323_A_ref.sort.rg.dup.met\nsamtools index 323_A_ref.sort.rg.dup.bam\ngatk HaplotypeCaller -R /srv/GT/reference/Finger_millet/KEN/DENOVO_v2.0_A_subgenome/Sequence/WholeGenomeFasta/genome.fa -I 323_A_ref.sort.rg.dup.bam -O 323.g.vcf -ERC GVCF\ngzip 323.g.vcf\necho 'Supercalifragilisticexpialidocious!!' > 323_dummy.txt\n\n\n#### JOB IS DONE WE PUT THINGS IN PLACE AND CLEAN AUP\ng-req -w copy 323.g.vcf.gz /srv/gstore/projects/p1634/GATKv4DNAHaplotypeCaller_Reseq_low_301_350_on_A_2020-01-07--15-19-57\ng-req -w copy 323.g.vcf.idx /srv/gstore/projects/p1634/GATKv4DNAHaplotypeCaller_Reseq_low_301_350_on_A_2020-01-07--15-19-57\ng-req -w copy 323_dummy.txt /srv/gstore/projects/p1634/GATKv4DNAHaplotypeCaller_Reseq_low_301_350_on_A_2020-01-07--15-19-57\ncd /scratch\nrm -rf /scratch/GATKv4DNAHaplotypeCaller_Reseq_low_301_350_on_A_2020-01-07--15-19-57_323_temp$$ || exit 1\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_CSS_>#apply-gift-card {\r\n display: table-cell;\r\n white-space: nowrap;\r\n margin-left: 1em;\r\n}\r\n\r\n#gift-card-number {\r\n width: 70%;\r\n}\r\n\r\n#gift-card-pin {\r\n width: 26%;\r\n}\r\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>//=================================================================================================\n/*!\n// \\file src/mathtest/smatdmatsub/UCbHDa.cpp\n// \\brief Source file for the UCbHDa sparse matrix/dense matrix subtraction math test\n//\n// Copyright (C) 2012-2019 Klaus Iglberger - All Rights Reserved\n//\n// This file is part of the Blaze library. You can redistribute it and/or modify it under\n// the terms of the New (Revised) BSD License. Redistribution and use in source and binary\n// forms, with or without modification, are permitted provided that the following conditions\n// are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice, this list of\n// conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright notice, this list\n// of conditions and the following disclaimer in the documentation and/or other materials\n// provided with the distribution.\n// 3. Neither the names of the Blaze development group nor the names of its contributors\n// may be used to endorse or promote products derived from this software without specific\n// prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY\n// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\n// SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\n// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n// BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n// DAMAGE.\n*/\n//=================================================================================================\n\n\n//*************************************************************************************************\n// Includes\n//*************************************************************************************************\n\n#include <cstdlib>\n#include <iostream>\n#include <blaze/math/CompressedMatrix.h>\n#include <blaze/math/DynamicMatrix.h>\n#include <blaze/math/HermitianMatrix.h>\n#include <blaze/math/UpperMatrix.h>\n#include <blazetest/mathtest/Creator.h>\n#include <blazetest/mathtest/smatdmatsub/OperationTest.h>\n#include <blazetest/system/MathTest.h>\n\n#ifdef BLAZE_USE_HPX_THREADS\n# include <hpx/hpx_main.hpp>\n#endif\n\n\n//=================================================================================================\n//\n// MAIN FUNCTION\n//\n//=================================================================================================\n\n//*************************************************************************************************\nint main()\n{\n std::cout << \" Running 'UCbHDa'...\" << std::endl;\n\n using blazetest::mathtest::NumericA;\n using blazetest::mathtest::NumericB;\n\n try\n {\n // Matrix type definitions\n using UCb = blaze::UpperMatrix< blaze::CompressedMatrix<NumericB> >;\n using HDa = blaze::HermitianMatrix< blaze::DynamicMatrix<NumericA> >;\n\n // Creator type definitions\n using CUCb = blazetest::Creator<UCb>;\n using CHDa = blazetest::Creator<HDa>;\n\n // Running tests with small matrices\n for( size_t i=0UL; i<=6UL; ++i ) {\n for( size_t j=0UL; j<=UCb::maxNonZeros( i ); ++j ) {\n RUN_SMATDMATSUB_OPERATION_TEST( CUCb( i, j ), CHDa( i ) );\n }\n }\n\n // Running tests with large matrices\n RUN_SMATDMATSUB_OPERATION_TEST( CUCb( 67UL, 7UL ), CHDa( 67UL ) );\n RUN_SMATDMATSUB_OPERATION_TEST( CUCb( 128UL, 16UL ), CHDa( 128UL ) );\n }\n catch( std::exception& ex ) {\n std::cerr << \"\\n\\n ERROR DETECTED during sparse matrix/dense matrix subtraction:\\n\"\n << ex.what() << \"\\n\";\n return EXIT_FAILURE;\n }\n\n return EXIT_SUCCESS;\n}\n//*************************************************************************************************\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_YAML_>--- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/Matthww/ConnectedIP\nbranches:\n- master\nprojects:\n ConnectedIP:\n path: \"\"\n...\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>//\n// Copyright (C) 2014-2016 LunarG, Inc.\n// Copyright (C) 2015-2016 Google, Inc.\n// Copyright (C) 2017 ARM Limited.\n//\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\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//\n// Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following\n// disclaimer in the documentation and/or other materials provided\n// with the distribution.\n//\n// Neither the name of 3Dlabs Inc. Ltd. nor the names of its\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 HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Scala_>package typingsSlinky.awsSdk.inspectorMod\n\nimport org.scalablytyped.runtime.StObject\nimport scala.scalajs.js\nimport scala.scalajs.js.`|`\nimport scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}\n\ntrait _Severity extends StObject\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>import java.util.*;\n\npublic class Main {\n public static void main(String[] args) throws Exception {\n // Your code here!\n Scanner sc = new Scanner(System.in);\n int n = sc.nextInt();\n int[] array = new int[n];\n \n for (int i = 0; i < n; i++) {\n array[i] = sc.nextInt();\n }\n \n int now = 2;\n \n if (array[n - 2] != 2 && array[n - 2] != 3) {\n System.out.println(-1);\n return;\n }\n \n for (int i = n - 1; i >= 0; i--) {\n int l = array[i];\n int r = now;\n \n if (l == 2 && r == 2){\n now = 2;\n } else if (l == 3 && r == 2) {\n now = 3;\n } else {\n if (l == r) continue;\n if (l >= r * 2) {\n System.out.println(-1);\n return;\n } else {\n boolean ok = false;\n for (int j = l; j < 2000000000; j += l) {\n if (j < r) continue;\n if (j % r != 0) {\n now = j;\n ok = true;\n break;\n }\n }\n \n if (!ok) {\n System.out.println(-1);\n return;\n }\n }\n }\n }\n \n int min = now;\n int max = array[0] * ((now / array[0]) + 1) - 1;\n \n System.out.println(min + \" \" + max);\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Rust_>use std::env;\n\nuse futures::Stream;\nuse tokio::runtime::Runtime;\n\nuse hubcaps::branches::Protection;\nuse hubcaps::{Credentials, Github, Result};\n\nfn main() -> Result<()> {\n pretty_env_logger::init();\n match env::var(\"GITHUB_TOKEN\").ok() {\n Some(token) => {\n let mut rt = Runtime::new()?;\n let github = Github::new(\n concat!(env!(\"CARGO_PKG_NAME\"), \"/\", env!(\"CARGO_PKG_VERSION\")),\n Credentials::Token(token),\n );\n\n if let Err(err) = rt.block_on(\n github\n .repo(\"softprops\", \"hubcaps\")\n .branches()\n .iter()\n .for_each(|branch| {\n println!(\"{:#?}\", branch);\n Ok(())\n }),\n ) {\n println!(\"err {:#?}\", err)\n }\n\n match rt.block_on(github.repo(\"softprops\", \"hubcaps\").branches().get(\"master\")) {\n Ok(branch) => println!(\"{:#?}\", branch),\n Err(err) => println!(\"err {:#?}\", err),\n }\n\n // protect master branch\n match rt.block_on(github.repo(\"softprops\", \"hubcaps\").branches().protection(\n \"master\",\n &Protection {\n required_status_checks: None,\n enforce_admins: false,\n required_pull_request_reviews: None,\n restrictions: None,\n },\n )) {\n Ok(pro) => println!(\"{:#?}\", pro),\n Err(err) => println!(\"err {:#?}\", err),\n }\n Ok(())\n }\n _ => Err(\"example missing GITHUB_TOKEN\".into()),\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Nim_>#=== Template_Base =========================== {{{\n\nimport strutils, sequtils, math, algorithm, macros\nwhen (not (NimMajor <= 0)) or NimMinor >= 19:\n import sugar\nelse:\n import future\n\n# type\n# si = seq[int]\n# ssi = seq[seq[int]]\n# sf = seq[float]\n# ssf = seq[seq[float]]\n\n# proc r(): string = stdin.readLine\n# proc ri(): int = r().parseInt\n# proc rsi(): seq[int] = r().split.map(parseInt)\n# proc rf(): float = r().parseFloat\n# proc rsf(): seq[float] = r().split.map(parseFloat)\n# proc rn(n: int): seq[string] =\n# result = @[]\n# for i in 1..n:\n# result.add(r())\n# proc rin(n: int): seq[int] =\n# result = @[]\n# for i in 1..n:\n# result.add(ri())\n# proc rsin(n: int): seq[seq[int]] =\n# result = @[]\n# for i in 1..n:\n# result.add(rsi())\niterator range(x, y: int): int {.inline.} =\n var res = x\n while res < y:\n yield res\n inc(res)\niterator range(x: int): int {.inline.} =\n var res = 0\n while res < x:\n yield res\n inc(res)\nproc range(x, y: int): seq[int] {.inline.} =\n toSeq(x..y-1)\nproc range(x: int): seq[int] {.inline.} =\n toSeq(0..x-1)\nproc discardableId[T](x: T): T {.discardable.} =\n return x\ntemplate `:=`(x, y: untyped): untyped =\n when defined(x):\n (x = y; discardableId(x))\n else:\n (var x = y; discardableId(x))\nwhen NimMajor <= 0 and NimMinor <= 17:\n proc count[T](co: openArray[T]; obj: T): int =\n for itm in items(co):\n if itm == obj:\n inc result\nproc divmod(x, y: SomeInteger): (int, int) =\n (x div y, x mod y)\nproc `min=`[T](x: var T; y: T): bool {.discardable.} =\n if x > y:\n x = y\n return true\n else:\n return false\nproc `max=`[T](x: var T; y: T): bool {.discardable.} =\n if x < y:\n x = y\n return true\n else:\n return false\n\nwhen NimMajor <= 0 and NimMinor <= 17:\n iterator pairs(n: NimNode): (int, NimNode) {.inline.} =\n for i in 0 ..< n.len:\n yield (i, n[i])\n\nwhen NimMajor <= 0 and NimMinor <= 18:\n macro parseInnerType(x: NimNode): untyped =\n newIdentNode(\"parse\" & x[1][1].repr)\nelse:\n macro parseInnerType(x: typedesc): untyped =\n newIdentNode(\"parse\" & x.getType[1][1].repr)\n\nmacro inputAsTuple(ty: untyped): untyped =\n result = nnkStmtListExpr.newTree()\n t := genSym()\n result.add quote do: (let `t` = stdin.readLine.split)\n p := nnkPar.newTree()\n for i, typ in ty.pairs:\n let ece = nnkExprColonExpr.newTree(ident(\"f\" & $i))\n if typ.repr == \"string\":\n ece.add quote do: `t`[`i`]\n else:\n parsefn := newIdentNode(\"parse\" & typ.repr)\n ece.add quote do: `t`[`i`].`parsefn`\n p.add ece\n result.add p\n\ntemplate inputAsType(ty: static[typedesc]): auto =\n when ty is seq:\n when ty is seq[string]:\n stdin.readLine.split\n else:\n when NimMajor <= 0 and NimMinor <= 18:\n stdin.readLine.split.map(parseInnerType(ty.getType))\n else:\n stdin.readLine.split.map(parseInnerType(ty))\n elif ty is string:\n stdin.readLine\n elif ty is tuple:\n inputAsTuple(ty)\n else:\n stdin.readLine.`parse ty`\n\nmacro input(query: untyped): untyped =\n doAssert query.kind == nnkStmtList\n result = nnkStmtList.newTree()\n letSect := nnkLetSection.newTree()\n for defs in query:\n if defs[0].kind == nnkIdent:\n tmp := nnkIdentDefs.newTree(defs[0], newEmptyNode())\n typ := defs[1][0]\n var val: NimNode\n if typ.len <= 2:\n val = quote do: inputAsType(`typ`)\n else:\n op := typ[2]\n typ.del(2, 1)\n val = quote do: inputAsType(`typ`).mapIt(`op`)\n if defs[1].len > 1:\n op := defs[1][1]\n it := ident\"it\"\n tmp.add quote do:\n block:\n var `it` = `val`\n `op`\n else:\n tmp.add val\n letSect.add tmp\n elif defs[0].kind == nnkPar:\n vt := nnkVarTuple.newTree()\n for id in defs[0]:\n vt.add id\n vt.add newEmptyNode()\n sle := nnkStmtListExpr.newTree()\n t := genSym()\n sle.add quote do: (let `t` = stdin.readLine.split)\n p := nnkPar.newTree()\n if defs[1][0].kind == nnkPar:\n for i, typ in defs[1][0].pairs:\n if typ.repr == \"string\":\n p.add quote do: `t`[`i`]\n else:\n parsefn := newIdentNode(\"parse\" & typ.repr)\n p.add quote do: `t`[`i`].`parsefn`\n else:\n typ := defs[1][0]\n if typ.repr == \"string\":\n for i in 0..<defs[0].len:\n p.add quote do: `t`[`i`]\n else:\n parsefn := newIdentNode(\"parse\" & typ.repr)\n for i in 0..<defs[0].len:\n p.add quote do: `t`[`i`].`parsefn`\n sle.add p\n vt.add sle\n letSect.add vt\n elif defs[0].kind == nnkBracketExpr:\n ids := nnkIdentDefs.newTree(defs[0][0], newEmptyNode())\n cnt := defs[0][1]\n typ := defs[1][0]\n var input: NimNode\n if typ.kind == nnkBracketExpr and typ.len > 2:\n op := typ[2]\n typ.del(2, 1)\n input = quote do: inputAsType(`typ`).mapIt(`op`)\n else:\n input = quote do: inputAsType(`typ`)\n var val: NimNode\n if defs[0].len > 2:\n op := defs[0][2]\n it := ident\"it\"\n val = quote do:\n block:\n var `it` = `input`\n `op`\n else:\n val = input\n if defs[1].len > 1:\n op := defs[1][1]\n it := ident\"it\"\n ids.add(quote do:\n block:\n var `it` = newSeqWith(`cnt`, `val`)\n `op`)\n else:\n ids.add(quote do: newSeqWith(`cnt`, `val`))\n letSect.add ids\n result.add letSect\n\n#=== Template_Base =========================== }}}\n\ninput:\n N: int\n P[N]: (int, int); it.sorted((x, y) => cmp(x[0], y[0]))\n\nvar maxi, maxv = 0\nfor i in range(N):\n if (maxv.max = P[i][1]-P[i][0]+1):\n maxi = i\n\nvar\n res = P[maxi][1]-P[maxi][0]+1\n tmp = (0, 10^9)\n\nfor i in range(N):\n if i == maxi: continue\n tmp[0].max = P[i][0]\n tmp[1].min = P[i][1]\n\nres += max(0, tmp[1]-tmp[0]+1)\n\n\nvar\n acc0, acc1 = newSeq[(int, int)](N)\n\nacc0[0] = P[0]\nacc1[N-1] = P[N-1]\n\nfor i in range(1, N):\n acc0[i] = (max(acc0[i-1][0], P[i][0]), min(acc0[i-1][1], P[i][1]))\n\nfor i in countdown(N-2, 0):\n acc1[i] = (max(acc1[i+1][0], P[i][0]), min(acc1[i+1][1], P[i][1]))\n\nfor i in range(N-1):\n res.max = acc0[i][1]-acc0[i][0]+1 + acc1[i+1][1]-acc1[i+1][0]+1\n\necho res\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>ALTER TABLE `game_blocks` ADD `load_time` FLOAT NOT NULL DEFAULT '0' AFTER `num_transactions`, ADD `time_loaded` INT NULL DEFAULT NULL AFTER `load_time`;</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>const { ci, repo, branch, sha } = require('ci-env')\nconst fetch = require('node-fetch')\n\nlet API = 'https://bundlesize-cache.now.sh'\n// if (ci === 'custom') API = 'http://localhost:3001'\n\nconst api = {\n get: async ({ repo }) => {\n return await fetch(API + '?repo=' + repo, {\n method: 'get',\n headers: { 'Content-Type': 'application/json' },\n })\n .then(res => res.json())\n .then(json => {\n if (json.filesMatched && json.filesMatched.length) {\n return JSON.parse(json.filesMatched)\n } else return []\n })\n .catch(error => console.log(error))\n },\n put: async ({ repo, branch, sha, filesMatched }) => {\n return await fetch(API, {\n method: 'put',\n body: JSON.stringify({ repo, branch, sha, filesMatched }),\n headers: { 'Content-Type': 'application/json' },\n }).catch(error => {\n console.log('Could not cache values for ' + sha)\n console.log(error)\n })\n },\n}\n\nconst getFilesMatched = ({ files }) => {\n const filesMatched = []\n\n files.map(rule => {\n rule.filesMatched.map(file => {\n const { path, size } = file\n filesMatched.push({ path, size, rule: rule.path })\n })\n })\n\n return filesMatched\n}\n\nconst cache = {\n read: async () => {\n if (!repo) return\n\n const cachedResults = await api.get({ repo })\n return cachedResults\n },\n save: async ({ files }) => {</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_> This file is part of GAS, the GNU Assembler.\n\n GAS is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 3, or (at your option)\n any later version.\n\n GAS is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with GAS; see the file COPYING. If not, write to the Free\n Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA\n 02110-1301, USA. */\n\n#ifndef __TC_PRU__\n#define __TC_PRU__\n\n#define TARGET_BYTES_BIG_ENDIAN 0\n\n/* Words are big enough to hold addresses. */\n#define WORKING_DOT_WORD\t1\n\nextern const char *pru_target_format (void);\n#define TARGET_FORMAT pru_target_format ()\n#define TARGET_ARCH bfd_arch_pru\n\n/* A PRU instruction consists of tokens and separator characters\n the tokens are things like the instruction name (add, or jmp etc),\n the register indices ($5, $7 etc), and constant expressions. The\n separator characters are commas, brackets and space.\n The instruction name is always separated from other tokens by a space\n The maximum number of tokens in an instruction is 6 (the instruction name,\n 4 arguments, and a 4th string representing the expected instruction opcode\n after assembly. The latter is only used when the assemble is running in\n self test mode, otherwise its presence will generate an error. */\n#define PRU_MAX_INSN_TOKENS\t7\n\n/* There are no machine-specific operands so we #define this to nothing. */\n#define md_operand(x)\n\n/* Function prototypes exported to rest of GAS. */\nextern void md_assemble (char *op_str);\nextern void md_end (void);\nextern void md_begin (void);\n\n#define tc_fix_adjustable(fixp) pru_fix_adjustable (fixp)\nextern int pru_fix_adjustable (struct fix *);\n\n#define tc_frob_label(lab) pru_frob_label (lab)\nextern void pru_frob_label (symbolS *);\n\nextern void md_convert_frag (bfd * headers, segT sec, fragS * fragP);\n\n#define DIFF_EXPR_OK\n\n/* FIXME This seems appropriate, given that we intentionally prevent\n PRU's .text from being used in a DIFF expression with symbols from\n other sections. Revisit once GDB is ported. */\n#define CFI_DIFF_EXPR_OK 0\n\n#define TC_PARSE_CONS_RETURN_TYPE int\n#define TC_PARSE_CONS_RETURN_NONE 0\n\n#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \\\n\tpru_parse_cons_expression (EXP, NBYTES)\nextern int pru_parse_cons_expression (expressionS *exp, int size);\n\n#define TC_CONS_FIX_NEW pru_cons_fix_new\nextern void pru_cons_fix_new (struct frag *frag, int where,\n\t\t\t\tunsigned int nbytes, struct expressionS *exp,\n\t\t\t\tconst int is_pmem);\n\n/* If you define this macro, it means that `tc_gen_reloc' may return\n multiple relocation entries for a single fixup. In this case, the\n return value of `tc_gen_reloc' is a pointer to a null terminated\n array. */\n#undef RELOC_EXPANSION_POSSIBLE\n\n/* No shared lib support, so we don't need to ensure externally\n visible symbols can be overridden. */\n#define EXTERN_FORCE_RELOC 0\n\n/* If defined, this macro allows control over whether fixups for a\n given section will be processed when the linkrelax variable is\n set. Define it to zero and handle things in md_apply_fix instead. */\n#define TC_LINKRELAX_FIXUP(SEG) 0\n\n/* If this macro returns non-zero, it guarantees that a relocation will be\n emitted even when the value can be resolved locally. Do that if\n linkrelax is turned on. */\n#define TC_FORCE_RELOCATION(fix)\tpru_force_relocation (fix)\n#define TC_FORCE_RELOCATION_SUB_SAME(fix, seg) \\\n (GENERIC_FORCE_RELOCATION_SUB_SAME (fix, seg) || pru_force_relocation (fix))\nextern int pru_force_relocation (struct fix *);\n\n/* Do not use PC relative fixups and relocations for\n anything but real PCREL relocations. */\n#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) \\\n (((FIX)->fx_r_type != BFD_RELOC_PRU_S10_PCREL) \\\n && ((FIX)->fx_r_type != BFD_RELOC_PRU_U8_PCREL))\n\n/* Values passed to md_apply_fix don't include the symbol value. */\n#define MD_APPLY_SYM_VALUE(FIX) 0\n\n/* We don't want gas to fixup the following memory related relocations.\n We will need them in case that we want to do linker relaxation.\n We could in principle keep these fixups in gas when not relaxing.\n However, there is no serious performance penalty when making the linker\n make the fixup work. Check also that fx_addsy is not NULL, in order to\n make sure that the fixup refers to some sort of label. */\n#define TC_VALIDATE_FIX(FIXP,SEG,SKIP)\t\t\t \\\n if ((FIXP->fx_r_type == BFD_RELOC_PRU_LDI32\t\t \\\n || FIXP->fx_r_type == BFD_RELOC_PRU_U16\t\t \\</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_XML_><?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n xmlns:tools=\"http://schemas.android.com/tools\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:layout_centerHorizontal=\"true\"\n android:layout_centerVertical=\"true\"\n tools:context=\".MainActivity\" >\n\n <Button\n android:id=\"@+id/btn1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentTop=\"true\"\n android:layout_centerHorizontal=\"true\"\n android:text=\"Click Here\" />\n\n <TextView\n android:id=\"@+id/txt1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_below=\"@+id/btn1\"\n android:layout_alignStart=\"@+id/btn1\"\n android:layout_alignLeft=\"@+id/btn1\"\n android:layout_alignEnd=\"@+id/btn1\"\n android:layout_alignRight=\"@+id/btn1\"\n android:layout_marginStart=\"27dp\"\n android:layout_marginLeft=\"27dp\"\n android:layout_marginTop=\"7dp\"\n android:layout_marginEnd=\"1dp\"\n android:layout_marginRight=\"1dp\"\n android:text=\"Not Clicked\" />\n\n <LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_below=\"@+id/txt1\"\n android:layout_alignStart=\"@+id/btn1\"\n android:layout_alignLeft=\"@+id/btn1\"\n android:layout_alignEnd=\"@+id/btn1\"\n android:layout_alignRight=\"@+id/btn1\"\n android:layout_alignParentBottom=\"true\"\n android:layout_marginStart=\"-1dp\"\n android:layout_marginLeft=\"-1dp\"\n android:layout_marginTop=\"65dp\"\n android:layout_marginEnd=\"0dp\"\n android:layout_marginRight=\"0dp\"\n android:layout_marginBottom=\"10dp\"\n android:orientation=\"vertical\">\n\n <TextView\n android:id=\"@+id/textView3\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:layout_gravity=\"left\"\n android:gravity=\"left\"\n android:text=\"Not Clicked\" />\n\n <Button\n android:id=\"@+id/button3\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentStart=\"true\"\n android:layout_alignParentLeft=\"true\"\n android:layout_alignParentTop=\"true\"\n android:text=\"Click Here\" />\n\n </LinearLayout>\n\n</RelativeLayout></code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Scala_>import java.util.UUID\n\nimport scala.concurrent.Future\n\nimport com.outworkers.phantom.dsl._\n\nimport org.joda.time.Instant\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>import java.util.regex.Pattern\n\nfun main(args: Array<String>) {\n val charCount = readLine()!!.toInt()\n val text = readLine()!!\n val regex = Pattern.compile(\"ABC\")\n val matcher = regex.matcher(text)\n var i = 0\n while(matcher.find()) {\n i++\n }\n println(i)\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>/**\n * Copyright (c) 2018 - 2020, Nordic Semiconductor ASA\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form, except as embedded into a Nordic\n * Semiconductor ASA integrated circuit in a product or a software update for\n * such product, must reproduce the above copyright notice, this list of\n * conditions and the following disclaimer in the documentation and/or other\n * materials provided with the distribution.\n *\n * 3. Neither the name of Nordic Semiconductor ASA nor the names of its\n * contributors may be used to endorse or promote products derived from this\n * software without specific prior written permission.\n *\n * 4. This software, with or without modification, must only be used with a\n * Nordic Semiconductor ASA integrated circuit.\n *\n * 5. Any software provided in binary form under this license must not be reverse\n * engineered, decompiled, modified and/or disassembled.\n *\n * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA \"AS IS\" AND ANY EXPRESS\n * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n */\n\n#ifndef OPTIGA_BACKEND_ECC_H__\n#define OPTIGA_BACKEND_ECC_H__\n\n#include \"sdk_config.h\"\n#include \"nordic_common.h\"\n\n#if NRF_MODULE_ENABLED(NRF_CRYPTO) && NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_OPTIGA)\n\n#include <stdint.h>\n#include <stdbool.h>\n#include \"nrf_crypto_ecc.h\"\n\n/*lint -save -e????*/\n#include \"optiga/optiga_crypt.h\"\n/*lint -restore*/\n\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n/** @internal Magic OID that indicates a host supplied public key\n*/\n#define NRF_CRYPTO_INFINEON_PUBKEY_HOST_OID 0xFFFF\n\n/** @internal Magic OID that indicates to export the private key\n*/\n#define NRF_CRYPTO_INFINEON_PRIVKEY_HOST_OID 0xFFFE\n\n/** @internal @brief Common structure holding private key for the OPTIGA backend.\n */\ntypedef struct nrf_crypto_backend_optiga_ecc_private_key_t\n{\n nrf_crypto_internal_ecc_key_header_t header; /**< @internal @brief Common ECC key header */\n optiga_key_id_t oid; // OID where the private key is stored\n uint8_t raw_privkey[64+2]; // Private Key encoded as DER OCTET STRING\n} nrf_crypto_backend_optiga_ecc_private_key_t;\n\n#define NRF_CRYPTO_INFINEON_SECP256R1_PRIVATE_KEY_FROM_OID(oid_value) { \\\n .key_secp256r1 = { \\\n .header = { \\\n .init_value = NRF_CRYPTO_INTERNAL_ECC_PRIVATE_KEY_INIT_VALUE, \\\n .p_info = &g_nrf_crypto_ecc_secp256r1_curve_info \\\n }, \\\n .oid = (optiga_key_id_t)(oid_value) \\\n } \\\n}\n\n/** @internal @brief Common structure holding public key for the OPTIGA backend.\n */\ntypedef struct\n{\n nrf_crypto_internal_ecc_key_header_t header; /**< @internal @brief Common ECC key header */\n optiga_key_id_t oid; // OID where the public key is stored\n uint8_t raw_pubkey[64+4]; // Public Key encoded as DER BITSTRING with header\n} nrf_crypto_backend_secp256r1_public_key_t;\n\n#define NRF_CRYPTO_INFINEON_SECP256R1_PUBLIC_KEY_FROM_OID(oid_value) { \\\n .key_secp256r1 = { \\\n .header = { \\\n .init_value = NRF_CRYPTO_INTERNAL_ECC_PUBLIC_KEY_INIT_VALUE, \\\n .p_info = &g_nrf_crypto_ecc_secp256r1_curve_info \\\n }, \\\n .oid = (optiga_key_id_t)(oid_value) \\\n } \\\n}\n\n#define NRF_CRYPTO_INFINEON_SECP256R1_PUBLIC_KEY_RAW \\\n NRF_CRYPTO_INFINEON_SECP256R1_PUBLIC_KEY_FROM_OID(NRF_CRYPTO_INFINEON_PUBKEY_HOST_OID)\n\n\n/** @internal See @ref nrf_crypto_backend_ecc_key_pair_generate_fn_t.\n */\nret_code_t nrf_crypto_backend_optiga_key_pair_generate(\n void * p_context,\n void * p_private_key,\n void * p_public_key);\n\n\n/** @internal See @ref nrf_crypto_backend_ecc_public_key_calculate_fn_t.\n*/\nret_code_t nrf_crypto_backend_optiga_public_key_calculate(\n void * p_context,\n void const * p_private_key,\n void * p_public_key);\n\n\n/** @internal See @ref nrf_crypto_backend_ecc_private_key_from_raw_fn_t.\n*/\nret_code_t nrf_crypto_backend_optiga_private_key_from_raw(\n void * p_private_key,\n uint8_t const * p_raw_data);\n\n\n/** @internal See @ref nrf_crypto_backend_ecc_private_key_to_raw_fn_t.\n*/\nret_code_t nrf_crypto_backend_optiga_private_key_to_raw(\n void const * p_private_key,\n uint8_t * p_raw_data);\n\n\n/** @internal See @ref nrf_crypto_backend_ecc_public_key_from_raw_fn_t.\n*/\nret_code_t nrf_crypto_backend_optiga_public_key_from_raw(\n void * p_public_key,\n uint8_t const * p_raw_data);\n\n\n/** @internal See @ref nrf_crypto_backend_ecc_public_key_to_raw_fn_t.\n*/\nret_code_t nrf_crypto_backend_optiga_public_key_to_raw(\n void const * p_public_key,\n uint8_t * p_raw_data);\n\n\n/** @internal See @ref nrf_crypto_backend_ecc_key_free_fn_t.\n*/\nret_code_t nrf_crypto_backend_optiga_private_key_free(\n void * p_private_key);\n\n\n/** @internal See @ref nrf_crypto_backend_ecc_key_free_fn_t.\n*/\nret_code_t nrf_crypto_backend_optiga_public_key_free(\n void * p_public_key);\n\n#if NRF_MODULE_ENABLED(NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1)\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>\nconst babelrc = require('./babelrc.js');\n\nmodule.exports = {\n devtool: 'source-map',\n entry: __dirname + '/src/index',\n output: {\n path: __dirname + '/dist/assets/',\n publicPath: \"/assets/\",\n filename: \"dist.js\",\n },\n module: {\n rules: [{\n test: /\\.(js|ts|tsx)$/,\n use: [{\n loader: 'babel-loader',\n options: babelrc\n }],\n exclude: /node_modules/,\n }, {\n test: /\\.s[ac]ss$/,\n use: [\n 'style-loader',\n 'css-loader',\n 'sass-loader',\n ],\n }]\n },\n resolve: {\n extensions: ['.js', '.tsx', '.ts'],\n modules: [\n 'src',\n 'node_modules'\n ] \n },\n devServer: {\n contentBase: __dirname + '/dist',\n compress: true,\n port: 12345,\n historyApiFallback: true\n }\n};</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Kotlin_>package com.cheuwo.app\n\nimport android.view.LayoutInflater\nimport android.view.ViewGroup\nimport androidx.recyclerview.widget.RecyclerView\n\n/**\n * Handles data representation in the RecyclerView\n */\nclass OfferAdapterRV(private val list: List<Offer>,\n private val listener: (Offer) -> Unit) // Custom lambda based listener\n : RecyclerView.Adapter<OfferViewHolder>()\n{\n override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): OfferViewHolder\n {\n val inflater = LayoutInflater.from(parent.context)\n return OfferViewHolder(inflater, parent)\n }\n\n override fun getItemCount(): Int = list.size\n\n override fun onBindViewHolder(holder: OfferViewHolder, position: Int)\n {\n val offer = list[position]\n holder.bind(offer)\n holder.itemView.setOnClickListener { listener(offer) }\n }\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>}\n\n\nwchar_t * tinyfd_saveFileDialogW(\n wchar_t const * aTitle, /* NULL or \"\" */\n wchar_t const * aDefaultPathAndFile, /* NULL or \"\" */\n int aNumOfFilterPatterns, /* 0 */\n wchar_t const * const * aFilterPatterns, /* NULL or {\"*.jpg\",\"*.png\"} */\n wchar_t const * aSingleFilterDescription) /* NULL or \"image files\" */\n{\n static wchar_t lBuff[MAX_PATH_OR_CMD];\n wchar_t lDirname[MAX_PATH_OR_CMD];\n wchar_t lDialogString[MAX_PATH_OR_CMD];\n wchar_t lFilterPatterns[MAX_PATH_OR_CMD] = L\"\";\n wchar_t * p;\n wchar_t * lRetval;\n\t\twchar_t const * ldefExt = NULL;\n\t\tint i;\n HRESULT lHResult;\n OPENFILENAMEW ofn = {0};\n\n if (aTitle&&!wcscmp(aTitle, L\"tinyfd_query\")){ strcpy(tinyfd_response, \"windows_wchar\"); return (wchar_t *)1; }\n\n\t\tif (quoteDetectedW(aTitle)) return tinyfd_saveFileDialogW(L\"INVALID TITLE WITH QUOTES\", aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription);\n\t\tif (quoteDetectedW(aDefaultPathAndFile)) return tinyfd_saveFileDialogW(aTitle, L\"INVALID DEFAULT_PATH WITH QUOTES\", aNumOfFilterPatterns, aFilterPatterns, aSingleFilterDescription);\n\t\tif (quoteDetectedW(aSingleFilterDescription)) return tinyfd_saveFileDialogW(aTitle, aDefaultPathAndFile, aNumOfFilterPatterns, aFilterPatterns, L\"INVALID FILTER_DESCRIPTION WITH QUOTES\");\n\t\tfor (i = 0; i < aNumOfFilterPatterns; i++)\n\t\t{\n\t\t\tif (quoteDetectedW(aFilterPatterns[i])) return tinyfd_saveFileDialogW(L\"INVALID FILTER_PATTERN WITH QUOTES\", aDefaultPathAndFile, 0, NULL, NULL);\n\t\t}\n\n lHResult = CoInitializeEx(NULL, 0);\n\n getPathWithoutFinalSlashW(lDirname, aDefaultPathAndFile);\n getLastNameW(lBuff, aDefaultPathAndFile);\n\n if (aNumOfFilterPatterns > 0)\n {\n\t\t\tldefExt = aFilterPatterns[0];\n\n if (aSingleFilterDescription && wcslen(aSingleFilterDescription))\n {\n wcscpy(lFilterPatterns, aSingleFilterDescription);\n wcscat(lFilterPatterns, L\"\\n\");\n }\n wcscat(lFilterPatterns, aFilterPatterns[0]);\n for (i = 1; i < aNumOfFilterPatterns; i++)\n {\n wcscat(lFilterPatterns, L\";\");\n wcscat(lFilterPatterns, aFilterPatterns[i]);\n }\n wcscat(lFilterPatterns, L\"\\n\");\n if (!(aSingleFilterDescription && wcslen(aSingleFilterDescription)))\n {\n wcscpy(lDialogString, lFilterPatterns);\n wcscat(lFilterPatterns, lDialogString);\n }\n wcscat(lFilterPatterns, L\"All Files\\n*.*\\n\");\n p = lFilterPatterns;\n while ((p = wcschr(p, L'\\n')) != NULL)\n {\n *p = L'\\0';\n p++;\n }\n }\n\n ofn.lStructSize = sizeof(OPENFILENAMEW);\n ofn.hwndOwner = GetForegroundWindow();\n ofn.hInstance = 0;\n ofn.lpstrFilter = wcslen(lFilterPatterns) ? lFilterPatterns : NULL;\n ofn.lpstrCustomFilter = NULL;\n ofn.nMaxCustFilter = 0;\n ofn.nFilterIndex = 1;\n ofn.lpstrFile = lBuff;\n\n ofn.nMaxFile = MAX_PATH_OR_CMD;\n ofn.lpstrFileTitle = NULL;\n ofn.nMaxFileTitle = MAX_PATH_OR_CMD/2;\n ofn.lpstrInitialDir = wcslen(lDirname) ? lDirname : NULL;\n ofn.lpstrTitle = aTitle && wcslen(aTitle) ? aTitle : NULL;\n ofn.Flags = OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST ;\n ofn.nFileOffset = 0;\n ofn.nFileExtension = 0;\n\t\tofn.lpstrDefExt = ldefExt;\n ofn.lCustData = 0L;\n ofn.lpfnHook = NULL;\n ofn.lpTemplateName = NULL;\n\n if (GetSaveFileNameW(&ofn) == 0)\n {\n lRetval = NULL;\n }\n else\n {\n lRetval = lBuff;\n }\n\n if (lHResult == S_OK || lHResult == S_FALSE)\n {\n CoUninitialize();\n }\n return lRetval;\n}\n\n\nwchar_t * tinyfd_openFileDialogW(\n wchar_t const * aTitle, /* NULL or \"\" */\n\t\twchar_t const * aDefaultPathAndFile, /* NULL or \"\" */\n int aNumOfFilterPatterns, /* 0 */\n\t\twchar_t const * const * aFilterPatterns, /* NULL or {\"*.jpg\",\"*.png\"} */\n\t\twchar_t const * aSingleFilterDescription, /* NULL or \"image files\" */\n int aAllowMultipleSelects) /* 0 or 1 ; -1 to free allocated memory and return */\n{\n size_t lLengths[MAX_MULTIPLE_FILES];\n wchar_t lDirname[MAX_PATH_OR_CMD];\n wchar_t lFilterPatterns[MAX_PATH_OR_CMD] = L\"\";\n wchar_t lDialogString[MAX_PATH_OR_CMD];\n wchar_t * lPointers[MAX_MULTIPLE_FILES+1];\n wchar_t * p;\n int i, j;\n\t\tsize_t lBuffLen;\n\t\tDWORD lFullBuffLen;\n HRESULT lHResult;\n OPENFILENAMEW ofn = { 0 };\n\t\tstatic wchar_t * lBuff = NULL;\n\n\t\tfree(lBuff);</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>end\n\nGiven('there is one past scrum with invalid youtube id') do\n create(:event_instance,\n yt_video_id: nil,\n title: 'Invalid',\n category: 'Scrum',\n project_id: nil)\nend\n\nThen(\"video with youtube id nil shouldn't be clickable\") do\n event = EventInstance.find_by_title('Invalid')\n expect(page).not_to have_css(\"a##{event.id}\")\nend\n\nThen('wait {int} second') do |int|\n sleep int\nend\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_XML_><app-list>\n\n <application>\n <kb_color window=\"firefox\">yellow white blue</kb_color>\n </application>\n\n <application>\n <kb_color window=\"Google-chrome\">red blue yellow</kb_color>\n </application>\n\n <application>\n <kb_color window=\"sublime_text\">blue green red</kb_color>\n </application>\n\n <application></code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Lisp_>(eval-when (:compile-toplevel :load-toplevel :execute)\n (sb-int:defconstant-eqx OPT\n #+swank '(optimize (speed 3) (safety 2))\n #-swank '(optimize (speed 3) (safety 0) (debug 0))\n #'equal)\n #+swank (ql:quickload '(:cl-debug-print :fiveam) :silent t)\n #-swank (set-dispatch-macro-character\n ;; enclose the form with VALUES to avoid being captured by LOOP macro\n #\\# #\\> (lambda (s c p) (declare (ignore c p)) `(values ,(read s nil nil t)))))\n#+swank (cl-syntax:use-syntax cl-debug-print:debug-print-syntax)\n#-swank (disable-debugger) ; for CS Academy\n\n;; BEGIN_INSERTED_CONTENTS\n(macrolet ((def (name fname)\n `(define-modify-macro ,name (new-value) ,fname)))\n (def minf min)\n (def maxf max)\n (def mulf *)\n (def divf /)\n (def iorf logior)\n (def xorf logxor)\n (def andf logand))\n\n(declaim (ftype (function * (values fixnum &optional)) read-fixnum))\n(defun read-fixnum (&optional (in *standard-input*))\n \"NOTE: cannot read -2^62\"\n (macrolet ((%read-byte ()\n `(the (unsigned-byte 8)\n #+swank (char-code (read-char in nil #\\Nul))\n #-swank (sb-impl::ansi-stream-read-byte in nil #.(char-code #\\Nul) nil))))\n (let* ((minus nil)\n (result (loop (let ((byte (%read-byte)))\n (cond ((<= 48 byte 57)\n (return (- byte 48)))\n ((zerop byte) ; #\\Nul\n (error \"Read EOF or #\\Nul.\"))\n ((= byte #.(char-code #\\-))\n (setf minus t)))))))\n (declare ((integer 0 #.most-positive-fixnum) result))\n (loop\n (let* ((byte (%read-byte)))\n (if (<= 48 byte 57)\n (setq result (+ (- byte 48)\n (* 10 (the (integer 0 #.(floor most-positive-fixnum 10))\n result))))\n (return (if minus (- result) result))))))))\n\n(defmacro dbg (&rest forms)\n #+swank\n (if (= (length forms) 1)\n `(format *error-output* \"~A => ~A~%\" ',(car forms) ,(car forms))\n `(format *error-output* \"~A => ~A~%\" ',forms `(,,@forms)))\n #-swank (declare (ignore forms)))\n\n(defmacro define-int-types (&rest bits)\n `(progn\n ,@(mapcar (lambda (b) `(deftype ,(intern (format nil \"UINT~A\" b)) () '(unsigned-byte ,b))) bits)\n ,@(mapcar (lambda (b) `(deftype ,(intern (format nil \"INT~A\" b)) () '(signed-byte ,b))) bits)))\n(define-int-types 2 4 7 8 15 16 31 32 62 63 64)\n\n(declaim (inline println))\n(defun println (obj &optional (stream *standard-output*))\n (let ((*read-default-float-format* 'double-float))\n (prog1 (princ obj stream) (terpri stream))))\n\n(defconstant +mod+ 1000000007)\n\n;;;\n;;; Body\n;;;\n\n(declaim (inline solve))\n(defun solve (n xs ys cumul-xs cumul-ys l-num init-dir end-dir)\n (dbg n l-num init-dir end-dir)\n (let* ((r-num (- n l-num))\n (min-lap (min l-num r-num))\n (l-lap (if (and (eq init-dir :left)\n (eq end-dir :left))\n (+ min-lap 1)\n min-lap))\n (r-lap (if (and (eq init-dir :right)\n (eq end-dir :right))\n (+ min-lap 1)\n min-lap))\n (res 0))\n (declare (fixnum r-num min-lap l-lap r-lap res))\n (when (or (> l-lap l-num) (> r-lap r-num))\n (return-from solve 0))\n (incf res (* 2 (- (aref cumul-xs l-num)\n (aref cumul-xs (- l-num l-lap)))))\n (incf res (* 2 (- (aref cumul-ys r-num)\n (aref cumul-ys (- r-num r-lap)))))\n (if (eq end-dir :left)\n (decf res (aref xs l-num))\n (decf res (aref ys r-num)))\n res))\n\n(defun main ()\n (let* ((len (read))\n (n (read))\n (xs (make-array (+ n 1) :element-type 'uint31))\n (ys (make-array (+ n 1) :element-type 'uint31))\n (cumul-xs (make-array (+ n 1) :element-type 'uint62))\n (cumul-ys (make-array (+ n 1) :element-type 'uint62))\n (res 0))\n (declare (uint62 len n res))\n (dotimes (i n)\n (let* ((x (read-fixnum))\n (y (- len x)))\n (setf (aref xs (+ i 1)) x\n (aref ys (- n i)) y)))\n (dotimes (i n)\n (setf (aref cumul-xs (+ i 1))\n (+ (aref cumul-xs i) (aref xs (+ i 1)))\n (aref cumul-ys (+ i 1))\n (+ (aref cumul-ys i) (aref ys (+ i 1)))))\n (loop\n for l-num from 0 to n\n do (maxf res (solve n xs ys cumul-xs cumul-ys l-num :left :left))\n (maxf res (solve n xs ys cumul-xs cumul-ys l-num :left :right))\n (maxf res (solve n xs ys cumul-xs cumul-ys l-num :right :left))\n (maxf res (solve n xs ys cumul-xs cumul-ys l-num :right :right)))\n (println res)))\n\n#-swank (main)\n\n;;;\n;;; Test and benchmark\n;;;\n\n#+swank\n(defun io-equal (in-string out-string &key (function #'main) (test #'equal))\n \"Passes IN-STRING to *STANDARD-INPUT*, executes FUNCTION, and returns true if\nthe string output to *STANDARD-OUTPUT* is equal to OUT-STRING.\"\n (labels ((ensure-last-lf (s)\n (if (eql (uiop:last-char s) #\\Linefeed)\n s\n (uiop:strcat s uiop:+lf+))))\n (funcall test\n (ensure-last-lf out-string)\n (with-output-to-string (out)\n (let ((*standard-output* out))\n (with-input-from-string (*standard-input* (ensure-last-lf in-string))\n (funcall function)))))))\n\n#+swank\n(defun get-clipbrd ()\n (with-output-to-string (out)\n (run-program \"powershell.exe\" '(\"-Command\" \"Get-Clipboard\") :output out :search t)))\n\n#+swank (defparameter *this-pathname* (uiop:current-lisp-file-pathname))\n#+swank (defparameter *dat-pathname* (uiop:merge-pathnames* \"test.dat\" *this-pathname*))\n\n#+swank\n(defun run (&optional thing (out *standard-output*))\n \"THING := null | string | symbol | pathname\n\nnull: run #'MAIN using the text on clipboard as input.\nstring: run #'MAIN using the string as input.\nsymbol: alias of FIVEAM:RUN!.\npathname: run #'MAIN using the text file as input.\"\n (let ((*standard-output* out))\n (etypecase thing\n (null\n (with-input-from-string (*standard-input* (delete #\\Return (get-clipbrd)))\n (main)))\n (string\n (with-input-from-string (*standard-input* (delete #\\Return thing))\n (main)))\n (symbol (5am:run! thing))\n (pathname\n (with-open-file (*standard-input* thing)\n (main))))))\n\n#+swank\n(defun gen-dat ()\n (uiop:with-output-file (out *dat-pathname* :if-exists :supersede)\n (format out \"\")))\n\n#+swank\n(defun bench (&optional (out (make-broadcast-stream)))\n (time (run *dat-pathname* out)))\n\n;; To run: (5am:run! :sample)\n#+swank\n(it.bese.fiveam:test :sample\n (it.bese.fiveam:is\n (common-lisp-user::io-equal \"10 3\n2\n7\n9\n\"\n \"15\n\"))\n (it.bese.fiveam:is\n (common-lisp-user::io-equal \"10 6\n1\n2\n3\n6\n7\n9\n\"\n \"27\n\"))\n (it.bese.fiveam:is\n (common-lisp-user::io-equal \"314159265 7\n21662711\n77271666\n89022761\n156626166\n160332356\n166902656\n298992265\n\"\n \"1204124749\n\")))\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>#!/usr/bin/env python\nimport os\nimport time\nimport re\nimport numpy\nfrom pyscf import lib\nfrom pyscf import gto, scf, dft, mcscf, mp, cc, lo\n\ndef sort_mo(casscf, idx, mo_coeff):\n mol = casscf.mol\n corth = lo.orth.orth_ao(mol)\n casorb = corth[:,idx]\n\n nmo = mo_coeff.shape[1]\n ncore = casscf.ncore\n ncas = casscf.ncas\n nelecas = casscf.nelecas\n assert(ncas == casorb.shape[1])\n\n mo1 = reduce(numpy.dot, (casorb.T, casscf._scf.get_ovlp(), mo_coeff))\n sdiag = numpy.einsum('pi,pi->i', mo1, mo1)\n\n nocc = ncore + nelecas[0]\n casidx = numpy.hstack((numpy.argsort(sdiag[:nocc])[ncore:],\n nocc+numpy.argsort(-sdiag[nocc:])[:ncas-nelecas[0]]))\n notcas = [i for i in range(nmo) if i not in casidx]\n mo = numpy.hstack((mo_coeff[:,notcas[:ncore]],\n mo_coeff[:,casidx],\n mo_coeff[:,notcas[ncore:]]))\n return mo\n\nmol = gto.Mole()\nmol.verbose = 0\nlog = lib.logger.Logger(mol.stdout, 5)\nwith open('/proc/cpuinfo') as f:\n for line in f:\n if 'model name' in line:\n log.note(line[:-1])\n break\nwith open('/proc/meminfo') as f:\n log.note(f.readline()[:-1])\nlog.note('OMP_NUM_THREADS=%s\\n', os.environ.get('OMP_NUM_THREADS', None))\n\nfor bas in ('3-21g', '6-31g*', 'cc-pVTZ', 'ANO-Roos-TZ'):\n mol.atom = 'N 0 0 0; N 0 0 1.1'\n mol.basis = bas\n mol.build(0, 0)\n cpu0 = time.clock(), time.time()\n\n mf = scf.RHF(mol)\n mf.kernel()\n cpu0 = log.timer('N2 %s RHF'%bas, *cpu0)\n\n mymp2 = mp.MP2(mf)\n mymp2.kernel()\n cpu0 = log.timer('N2 %s MP2'%bas, *cpu0)\n\n mymc = mcscf.CASSCF(mf, 4, 4)\n idx = mol.search_ao_label('2p[xy]')\n mo = sort_mo(mymc, idx, mf.mo_coeff)\n mymc.kernel(mo)\n cpu0 = log.timer('N2 %s CASSCF'%bas, *cpu0)\n\n mycc = cc.CCSD(mf)\n mycc.kernel()\n cpu0 = log.timer('N2 %s CCSD'%bas, *cpu0)\n\n mf = dft.RKS(mol)\n mf.xc = 'b3lyp'\n mf.kernel()\n cpu0 = log.timer('N2 %s B3LYP'%bas, *cpu0)\n\n mf = scf.density_fit(mf)\n mf.kernel()\n cpu0 = log.timer('N2 %s density-fit RHF'%bas, *cpu0)\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_TypeScript_>import { Component, OnInit, ViewChild } from '@angular/core';\nimport { map } from 'rxjs/operators';\nimport { TaskMasterFacade } from '../+state/task-master';\nimport { ColumnType, TableComponent } from '@core/table';\nimport { Router } from '@angular/router';\n\n@Component({\n selector: 'anms-task-master',\n templateUrl: './task-master.component.html',\n styleUrls: ['./task-master.component.scss']\n})\nexport class TaskMasterComponent implements OnInit {\n @ViewChild(TableComponent, { static: false }) table: TableComponent;\n searchIcon = 'assets/icons/search-solid.svg';\n downloadBtn = 'assets/icons/download-solid.svg';\n showCustomFilter = false;\n filtersColumns = [];\n tableSetting = {\n name: 'workshop_taskMaster',\n columns: [\n {\n lable: 'tables.column.task_name',\n field: 'taskName',\n width: 100,\n type: 1,\n thumbField: '',\n renderer: ''\n },\n {\n lable: 'tables.column.time_estimate',\n field: 'timeEstimate',\n width: 100,\n type: 1,\n thumbField: '',\n renderer: ''\n },\n {\n lable: 'tables.column.instruction',\n field: 'instruction',\n width: 200,\n type: 1,\n thumbField: '',\n renderer: ''\n },\n {\n lable: 'tables.column.rate_per_hour',\n field: 'ratePerHour',\n width: 100,\n type: 1,\n thumbField: '',\n renderer: ''\n },\n {\n lable: 'tables.column.skill',\n field: 'skill',\n width: 100,\n type: 1,\n thumbField: '',\n renderer: ''\n },\n {\n lable: 'tables.column.part',\n field: 'part',\n width: 100,\n type: 1,\n thumbField: '',\n renderer: ''\n },\n {\n lable: '',\n field: 'floatButton',\n width: 0,\n type: ColumnType.lable,\n thumbField: '',\n renderer: 'floatButton'\n }\n ],\n data: [],\n rowSettings: {\n floatButton: [\n {\n button: 'edit',\n onClick: (col, data, button?) => {\n this.router\n .navigate(['/workshop/task-master/edit-task-master/' + data.id])\n .then();\n },\n permission: ['TASK_MASTER_UPDATE']\n }\n ]\n }\n };\n\n /*\n doesNeedParty: false\n id: 3\n instruction: \"something3\"\n name: \"something33\"\n ratePerHour: 20\n shopType: \"BODYSHOP\"\n skills: [{id: 3, name: \"fixing\"}]\n taskType: \"NORMAL\"\n timeEstimate: 1234\n */\n data$ = this._facade.taskMasters$.pipe(\n map((x) => {\n return x.map((y: any) => {\n const skills = y.skills;\n const skill =\n skills && skills instanceof Array && skills.length ? skills[0] : '';\n const row = {\n ...y,\n skill: skill ? skill.name : '',\n part: y.shopType,\n taskName: y.name\n };\n\n return row;\n });\n })\n );\n\n constructor(private _facade: TaskMasterFacade, private router: Router) {}\n\n ngOnInit(): void {\n this.setFiltersColumns();\n }\n\n eventPagination() {\n this._facade.loadAll();\n }\n\n exportTable() {\n let filter = {\n taskName: 'taskName',\n timeEstimate: 'timeEstimate',\n instruction: 'instruction',\n rate_per_hour: 'ratePerHour',\n skill: 'skill',\n part: 'part'\n };\n this.table.exportTable(this.tableSetting, 'TaskMaster', filter);\n }\n\n setFiltersColumns() {\n let removeField = [];\n let filtersColumns = Object.values({ ...this.tableSetting.columns });\n let addition = [];\n filtersColumns = filtersColumns.concat(addition);\n this.filtersColumns = filtersColumns.filter(\n (x) => !removeField.includes(x['field'])\n );\n }\n\n customFilterEvent(data: object[]) {\n this._facade.loadAll();\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_> }\n\n public void setMessage(String message) {\n this.message = message;\n }\n\n public String getRequestCode() {\n return requestCode;\n }\n\n public void setRequestCode(String requestCode) {\n this.requestCode = requestCode;\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_XML_></td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">0.458</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">0.832 <sup>+</sup></td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">0.645</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">0.274</td></tr><tr><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">TCh-b</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">0.875 <sup>+</sup></td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">&#x02212;0.078</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">&#x02212;0.165</td></tr><tr><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">TCh</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">0.303</td><td align=\"center\" valign=\"middle\" rowspan=\"1\" colspan=\"1\">0.047</td></tr><tr><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">TCA</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">\n</td><td align=\"center\" valign=\"middle\" style=\"border-bottom:solid thin\" rowspan=\"1\" colspan=\"1\">0.821 <sup>+</sup></td></tr></tbody></table><table-wrap-foot><fn><p>Correlation statistically significant at: <italic>++</italic>\n<italic>p</italic> &#x0003c; 0.001 level; <italic>+</italic></code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>#import <UIKit/UIKit.h>\n\n#include <UnityFramework/UnityFramework.h>\n#include <UnityFramework/NativeCallProxy.h>\n\nUnityFramework* UnityFrameworkLoad()\n{\n NSString* bundlePath = nil;\n bundlePath = [[NSBundle mainBundle] bundlePath];\n bundlePath = [bundlePath stringByAppendingString: @\"/Frameworks/UnityFramework.framework\"];\n \n NSBundle* bundle = [NSBundle bundleWithPath: bundlePath];\n if ([bundle isLoaded] == false) [bundle load];\n \n UnityFramework* ufw = [bundle.principalClass getInstance];\n if (![ufw appController])\n {\n // unity is not initialized\n [ufw setExecuteHeader: &_mh_execute_header];\n }\n return ufw;\n}\n\nvoid showAlert(NSString* title, NSString* msg) {\n UIAlertController* alert = [UIAlertController alertControllerWithTitle:title message:msg preferredStyle:UIAlertControllerStyleAlert];\n UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:@\"Ok\" style:UIAlertActionStyleDefault</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>a,b,c= map(int, input().split())\n\nm=max(a,b,c)\n\nif m==a:\n print((a+10)+b+c)\nelif:m==b:\n print((b+10)+a+c)\nelse:\n print((c+10)+a+b)</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_XML_><partInstance>\n<version>2.1</version>\n<targetInstances>\n<targetPart>\n\t<id>NPCT501</id>\n\t<type>chip-NPCT501</type>\n\t<is_root>true</is_root>\n\t<instance_name>NPCT501</instance_name>\n\t<position>-1</position>\n\t<parent>mrw-chip</parent>\n\t<parent_type>card-motherboard</parent_type>\n\t<parent_type>card-daughtercard</parent_type>\n\t<child_id>NPCT501.i2c-0</child_id>\n\t<child_id>NPCT501.gpio-slave-0</child_id>\n\t<child_id>NPCT501.gpio-master-1</child_id>\n\t<child_id>NPCT501.gpio-master-2</child_id>\n\t<attribute>\n\t\t<id>CCIN</id>\n\t\t<default/>\n\t</attribute>\n\t<attribute>\n\t\t<id>CLASS</id>\n\t\t<default>CHIP</default>\n\t</attribute>\n\t<attribute>\n\t\t<id>LOCATION_CODE</id>\n\t\t<default/>\n\t</attribute>\n\t<attribute>\n\t\t<id>LOCATION_CODE_TYPE</id>\n\t\t<default/>\n\t</attribute>\n\t<attribute>\n\t\t<id>MODEL</id>\n\t\t<default/>\n\t</attribute>\n\t<attribute>\n\t\t<id>MRU_ID</id>\n\t\t<default>0</default>\n\t</attribute>\n\t<attribute>\n\t\t<id>MRW_TYPE</id>\n\t\t<default>NA</default>\n\t</attribute>\n\t<attribute>\n\t\t<id>POSITION</id>\n\t\t<default/>\n\t</attribute>\n\t<attribute>\n\t\t<id>RESOURCE_IS_CRITICAL</id>\n\t\t<default>0</default>\n\t</attribute>\n\t<attribute>\n\t\t<id>TYPE</id>\n\t\t<default/>\n\t</attribute>\n</targetPart></code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_D_>import std.stdio;\n\nint main(string[] args){\nint n,k,max=0;\nint val[5004];\nint sumArray[5004];\n\n\nscanf(\"%d %d\",&n,&k);\n\nfor(int i=0;i<n;i++){\nscanf(\"%d\",&val[i]);\nif(i == 0)sumArray[i]=val[i];\nelse sumArray[i]=sumArray[i-1]+val[i];\n}\n\nmax = sumArray[k-1];\nfor(int i=k;i<n;i++){\nif(sumArray[i]-sumArray[i-k] > max)max=sumArray[i]-sumArray[i-k];\n}\n\nwriteln(max);\nreturn 0;\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>var express = require('express');\nvar router = express.Router();\nvar request = require('request');\n\nrouter.get('/', function(req, res, next) {\n var fs = require('fs');\n fs.access('./temp_files/temp.txt', error => {\n //if file exists\n if(!error) {\n fs.readFile('./temp_files/temp.txt', 'utf-8', function(err, data) {\n var split_data = data.split(\"\\n\");\n res.send(JSON.stringify(split_data));\n });\n } else {\n console.log(error);\n fs.writeFile('./temp_files/temp.txt', '', {flag : 'wx'}, function () {\n var empty_array = [];\n res.send(JSON.stringify((empty_array)));\n });\n }\n });\n});\n\nmodule.exports = router;</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Kotlin_>/*\n * Copyright 2020. Huawei Technologies Co., Ltd. All rights reserved.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\npackage com.huawei.image.render.sample.util\n\nimport android.content.Context\nimport android.util.Log\nimport org.json.JSONException\nimport org.json.JSONObject\nimport java.io.File\nimport java.io.FileOutputStream\nimport java.io.IOException\nimport java.io.InputStream\n\n/**\n * Function Description\n *\n * @since 2020-04-28\n */\nobject Utils {\n /**\n * TAG\n */\n private const val TAG = \"Utils\"\n\n /**\n * create demo dir\n *\n * @param dirPath dir path\n * @return result\n */\n fun createResourceDirs(dirPath: String?): Boolean {\n val dir = File(dirPath)\n return if (!dir.exists()) {\n if (dir.parentFile.mkdir()) {\n dir.mkdir()\n } else {\n dir.mkdir()\n }\n } else false\n }\n\n /**\n * copy assets folders to sdCard\n * @param context context\n * @param foldersName folderName\n * @param path path\n * @return result\n */\n fun copyAssetsFilesToDirs(\n context: Context,\n foldersName: String,\n path: String\n ): Boolean {\n try {\n val files = context.assets.list(foldersName)\n for (file in files) {\n if (!copyAssetsFileToDirs(\n context,\n foldersName + File.separator + file,\n path + File.separator + file\n )\n ) {\n Log.e(\n TAG,\n \"Copy resource file fail, please check permission\"\n )\n return false\n }\n }\n } catch (e: IOException) {\n Log.e(TAG, e.message)\n return false\n }\n return true\n }\n\n /**\n * copy resource file to sdCard\n *\n * @param context context\n * @param fileName fileName\n * @param path sdCard path\n * @return result\n */\n fun copyAssetsFileToDirs(\n context: Context,\n fileName: String?,\n path: String?\n ): Boolean {\n var inputStream: InputStream? = null\n var outputStream: FileOutputStream? = null\n try {\n inputStream = context.assets.open(fileName)\n val file = File(path)\n outputStream = FileOutputStream(file)\n val temp = ByteArray(4096)\n var n: Int\n while (-1 != inputStream.read(temp).also { n = it }) {\n outputStream.write(temp, 0, n)\n }\n } catch (e: IOException) {\n Log.e(TAG, e.message)\n return false\n } finally {\n try {\n inputStream?.close()\n } catch (e: IOException) {\n Log.e(TAG, e.message)\n } finally {\n if (outputStream != null) {\n try {\n outputStream.close()\n } catch (e: IOException) {\n Log.e(TAG, e.message)\n }\n }\n }\n }\n return true\n }\n\n /**\n * Add authentication parameters.\n *\n * @return JsonObject of Authentication parameters.\n */\n val authJson: JSONObject\n get() {\n val authJson = JSONObject()\n try {\n authJson.put(\"projectId\", \"projectId-test\")\n authJson.put(\"appId\", \"appId-test\")\n authJson.put(\"authApiKey\", \"authApiKey-test\")\n authJson.put(\"clientSecret\", \"clientSecret-test\")\n authJson.put(\"clientId\", \"clientId-test\")\n authJson.put(\"token\", \"token-test\")\n } catch (e: JSONException) {\n Log.w(\n TAG,\n \"Get authJson fail, please check auth info\"\n )\n }\n return authJson\n }\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_XML_><annotation>\n\t<folder>Train</folder>\n\t<filename>677.jpg</filename>\n\t<path>C:/Users/Buse/Desktop/Train/677.jpg</path>\n\t<source>\n\t\t<database>Unknown</database>\n\t</source>\n\t<size>\n\t\t<width>640</width>\n\t\t<height>426</height>\n\t\t<depth>3</depth>\n\t</size></code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import bisect\nans=0\n\nN,a,b,c=open(0).read().rstrip().split('\\n')\nN=int(N)\nA=[int(i) for i in a.split()]\nB=[int(i) for i in b.split()]\nC=[int(i) for i in c.split()]\nA.sort()\nB.sort()\nC.sort()\n\nfor i in A:\n if i>=B[-1]:\n break\n b_index=bisect.bisect_right(B,i)\n for j in B[b_index:]:\n if j>=C[-1]:\n break\n c_index=bisect.bisect_right(C,j)\n ans+=N-c_index\nprint(ans)</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>#include <bits/stdc++.h>\nusing namespace std;\n#define FOR(i,k,n) for(int i = (k); i < (n); i++)\n#define REP(i,n) FOR(i,0,n)\n#define ALL(a) begin(a),end(a)\n#define MS(m,v) memset(m,v,sizeof(m))\n#define D10 fixed<<setprecision(10)\ntypedef vector<int> vi;\ntypedef vector<string> vs;\ntypedef pair<int, int> pii;\ntypedef long long ll;\nconst int INF = 114514810;\nconst int MOD = 1000000007;\nconst double EPS = 1e-10;\ntypedef int weight;\nstruct edge\n{\n\tint to; weight cost;\n\tbool operator < (const edge& e) const { return cost < e.cost; }\n\tbool operator >(const edge& e) const { return cost > e.cost; }\n};\ntypedef vector<vector<edge>> Graph;\n//int dx[] = { -1, 0, 0, 1 }; int dy[] = { 0, -1, 1, 0 };\ntemplate<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }\ntemplate<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }\nbool valid(int x, int y, int h, int w) { return (x >= 0 && y >= 0 && x < h&&y < w); }\nint place(int x, int y, int w) { return w*x + y; }\n///*************************************************************************************///\n///*************************************************************************************///\n///*************************************************************************************///\n\ntypedef long double ld;\nconst double PI = acos(-1.0);\nbool eq(double a, double b) { return fabs(a - b) < EPS; }\ntypedef complex<double> Point;\ntypedef vector<Point> Polygon;\n\nnamespace std\n{\n\tbool operator < (const Point& a, const Point& b)\n\t{\n\t\treturn real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);\n\t}\n}\n\nstruct Line\n{\n\tPoint a, b;\n\tLine(Point p, Point q) :a(p), b(q) {};\n\tLine(double x1, double y1, double x2, double y2) :a(Point(x1, y1)), b(Point(x2, y2)) {};\n};\n\nstruct Circle\n{\n\tPoint p; double r;\n\tCircle(Point a, double b) :p(a), r(b) {};\n};\n\ndouble dot(Point a, Point b)\n{\n\treturn real(conj(a)*b);\n}\n\ndouble cross(Point a, Point b)\n{\n\treturn imag(conj(a)*b);\n}\n\nint ccw(Point a, Point b, Point c)\n{\n\tb -= a; c -= a;\n\tif (cross(b, c) > EPS) return 1; //counter cloclwise\n\tif (cross(b, c) < -EPS) return -1; //cloclwise\n\tif (dot(b, c) < 0) return 2; //c--a--b on line \n\tif (norm(b) < norm(c)) return -2; //a--b--c on line\n\treturn 0; //a--c--b on line\n}\n\nbool isis_ls(Line l, Line s)\n{\n\treturn cross(l.b - l.a, s.a - l.a)*cross(l.b - l.a, s.b - l.a) < -EPS;\n}\n\nint main()\n{\n\tint n;\n\tcin >> n;\n\tvector<Point> ps;\n\tREP(i, n)\n\t{\n\t\tdouble x, y;\n\t\tcin >> x >> y;\n\t\tps.push_back(Point{ x, y });\n\t}\n\tvector<Line> ls;\n\tREP(i, n - 1) ls.push_back(Line{ ps[i], ps[i + 1] });\n\tbool f = true;\n\tFOR(i, 1, n - 1)\n\t{\n\t\tPoint v1 = ps[i] - ps[i - 1];\n\t\tPoint v2 = ps[i] - ps[i + 1];\n\t\tif (dot(v1, v2) < -EPS) f = false;\n\t}\n\tREP(i, ls.size())\n\t{\n\t\tPoint v = ls[i].a - ls[i].b;\n\t\tPoint t(-v.imag(),v.real());\n\t\tLine l1(ls[i].a, ls[i].a + t);\n\t\tLine l2(ls[i].b, ls[i].b + t);\n\t\tREP(j, ls.size())\n\t\t{\n\t\t\tif (abs(i - j) <= 1) continue;\n\t\t\tif (isis_ls(l1, ls[j]) || isis_ls(l2, ls[j])) f = false;\n\t\t}\n\t}\n\tputs(f ? \"Possible\" : \"Impossible\");\n\treturn 0;\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>/*\n * This header is generated by classdump-dyld 1.5\n * on Tuesday, November 10, 2020 at 10:19:11 PM Mountain Standard Time\n * Operating System: Version 14.2 (Build 18K57)\n * Image Source: /System/Library/Frameworks/TVMLKit.framework/TVMLKit\n * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.\n */\n\n#import <TVMLKit/TVMLKit-Structs.h>\n#import <UIKitCore/UIView.h>\n\n@class NSAttributedString, NSString, UIColor;\n\n@interface _TVTextBadge : UIView {\n\n\tNSAttributedString* _text;\n\tNSString* _type;\n\tUIColor* _tintColor;\n\tdouble _cornerRadius;\n\tdouble _lineWidth;\n\n}\n\n@property (nonatomic,retain) NSAttributedString * text; //@synthesize text=_text - In the implementation block</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>//---------------------------------------------------------------------------//\n// Copyright (c) 2014 Roshan <thisisroshansmail@gmail.com>\n//\n// Distributed under the Boost Software License, Version 1.0\n// See accompanying file LICENSE_1_0.txt or copy at\n// http://www.boost.org/LICENSE_1_0.txt\n//\n// See http://boostorg.github.com/compute for more information.\n//---------------------------------------------------------------------------//\n\n#include <algorithm>\n#include <iostream>\n#include <numeric>\n#include <vector>\n#include <mimalloc.h>\n\n#include <boost/compute/system.hpp>\n#include <boost/compute/algorithm/unique_copy.hpp>\n#include <boost/compute/container/vector.hpp>\n\n#include \"perf.hpp\"\n\nint rand_int()\n{\n return static_cast<int>((rand() / double(RAND_MAX)) * 25.0);\n}\n\nint main(int argc, char *argv[])\n{\n perf_parse_args(argc, argv);\n std::cout << \"size: \" << PERF_N << std::endl;\n\n // setup context and queue for the default device\n boost::compute::device device = boost::compute::system::default_device();\n boost::compute::context context(device);\n boost::compute::command_queue queue(context, device);\n std::cout << \"device: \" << device.name() << std::endl;\n\n // create vector of random numbers on the host\n std::vector<int, mi_stl_allocator<int>> host_vector(PERF_N);\n std::generate(host_vector.begin(), host_vector.end(), rand_int);\n\n // create vector on the device and copy the data\n boost::compute::vector<int> device_vector(PERF_N, context);\n boost::compute::vector<int> device_vector2(PERF_N, context);\n\n perf_timer t;\n for (size_t trial = 0; trial < PERF_TRIALS; trial++)\n {\n boost::compute::copy(\n host_vector.begin(), host_vector.end(), device_vector.begin(), queue);\n t.start();\n boost::compute::unique_copy(\n device_vector.begin(), device_vector.end(), device_vector2.begin(), queue);\n queue.finish();\n t.stop();\n }</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>A, B, C, K = map(int, input().split())\nif K < A: print(K)\nelif A + B >= K: print(A)\nelse: print(A - (K - (A + B)))</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>\t\treturn 'POST'\n\n\tdef getapiname(self):\n\t\treturn 'dingtalk.oapi.live.grouplive.statistics'\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Pascal_>Turbo Pascal Optimization Contest # 51.\r\n\r\nNo tangible prizes, just some bragging rights, and a brain workout.\r\n\r\nAssignment: Write conversion routines similar to VAL and STR that can\r\n handle a radix (base) of any number. For example, below is\r\n a straight Pascal Procedure to convert a String of any base\r\n to a LongInt. Can you improve the speed of this routine,\r\n and Write a correspondingly fast routine to convert from a\r\n LongInt to a String of any base?\r\n\r\nRules: No rules. BAsm is allowed, as long as the Functions are\r\n readily Compilable without the use of TAsm.\r\n\r\nJudging: Code will be tested on a 386-40 on March 10th, by being\r\n placed into a loop With no output, like this:\r\n\r\n StartTiming;\r\n For Loop := 1 to 10000000 { ten million } do\r\n { Execute the test, no output }\r\n WriteLn(StopTiming);\r\n\r\nReady, set, code! Here's the sample...\r\n\r\n(* This Function converts an ASCIIZ String S in base Radix to LongInt I\r\n * With no verification of radix validity. The calling Programmer is\r\n * responsible For insuring that the radix range is 2 through 36. The\r\n * calling Programmer is also responsible For insuring that the passed\r\n * String contains only valid digits in the specified Radix. No checking\r\n * is done on the individual digits of a given String. For bases 11-36\r\n * the letters 'A'-'Z' represent the corresponding values.\r\n *)\r\n\r\nProcedure StrtoLong(Var I : LongInt; S : PChar; Radix : Integer);\r\n begin\r\n I := 0;\r\n While S[0] <> #0 do\r\n begin\r\n Case S[0] of '0'..'9' : I := I * Radix + (ord(S[0])-48);\r\n 'A'..'Z' : I := I * Radix + (ord(S[0])-54);\r\n 'a'..'z' : I := I * Radix + (ord(S[0])-86);\r\n Inc(s);\r\n end;\r\n end;\r\n\r\n\u001a</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>// Copyright (c) 2014-2015 Dropbox, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \"runtime/util.h\"\n\n#include \"core/options.h\"\n#include \"runtime/capi.h\"\n#include \"runtime/objmodel.h\"\n#include \"runtime/types.h\"\n\nnamespace pyston {\n\nvoid parseSlice(BoxedSlice* slice, int size, i64* out_start, i64* out_stop, i64* out_step, i64* out_length) {\n int ret = PySlice_GetIndicesEx((PySliceObject*)slice, size, out_start, out_stop, out_step, out_length);\n if (ret == -1)\n throwCAPIException();\n}\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>import React from 'react';\nimport { Button } from 'react-bootstrap';\nimport { FormattedMessage } from 'react-intl';\nimport { getCountries, getQualityLevel } from '../../../utils/utility';\nimport AppForm from '../../../components/form/AppForm';\nimport Field from '../../../components/form/Field';\n\nconst options = getQualityLevel();\n\nconst countries = getCountries();\n\ntype Props = {\n formType: string,\n initialValues: object,\n validationSchema: object,\n onSubmit: () => void\n};\n\nconst ThreatForm = (props: Props) => {\n const { onSubmit, formType, initialValues, validationSchema } = props;\n\n return (\n <AppForm\n onSubmit={onSubmit}\n initialValues={initialValues}\n schema={validationSchema}\n >\n <Field\n type=\"select\"\n name=\"country\"\n label={<FormattedMessage id=\"global.country\" />}\n options={countries}\n placeholder={<FormattedMessage id=\"global.select\" />}\n required\n />\n\n <Field\n type=\"select\"\n name=\"relationLevel\"\n label={<FormattedMessage id=\"global.relationLevel\" />}\n options={options}\n placeholder={<FormattedMessage id=\"global.select\" />}\n required\n />\n\n <Field\n type=\"editor\"\n name=\"moreInfo\"\n label={<FormattedMessage id=\"global.moreInfo\" />}\n />\n\n <div className=\"animated fadeIn fast animation-auto-delay\">\n <Button type=\"submit\">\n {formType === 'register' ? (\n <FormattedMessage id=\"global.addNew\" />\n ) : (\n <FormattedMessage id=\"global.update\" />\n )}\n </Button>\n </div>\n </AppForm>\n );\n};\n\nexport default ThreatForm;\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_>module One9\n class NoReportError < StandardError; end\n module Report\n extend self\n\n def list(*args)\n parse_options(args)\n meths, stacks = setup\n meths = query_methods(meths, args[0])\n print(meths, stacks)\n end\n\n def lines(*args)\n parse_options(args)\n meths, stacks = setup</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>-----------------------------------------------------------------------------------\n--Do not modify this file, instead use an alter proc to over-write the procedure.--\n--Make sure you follow the same expected interface of parameters, and resultsets.--\n-----------------------------------------------------------------------------------\n\nIF EXISTS(SELECT * FROM [dbo].[sysobjects] WHERE ID=object_id(N'[Data].[ElectionLevel_Exists]') AND OBJECTPROPERTY(id, N'IsProcedure')=1) DROP PROC [Data].[ElectionLevel_Exists]\nGO--\nCREATE PROCEDURE [Data].[ElectionLevel_Exists]\n\t\t\t@ElectionLevelId int\nAS --Generated--\nBEGIN\n\tSET NOCOUNT ON;\n\n\tIF EXISTS(\n\t\tSELECT * FROM [Data].[ElectionLevel]\n\t\tWHERE\t[ElectionLevelId] = @ElectionLevelId\n\t) BEGIN\n\t\tSELECT CAST(1 as bit) as [Exists]\n\tEND ELSE BEGIN</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>n,x=map(int,input().split())\nx=list(map(int,input().split()))\nx.sort()\ndef lcm(a,b):\n if b==0:\n return a \n return lcm(b,a%b)\nans=x[1]-x[0]\n\nfor i in range(n-1):\n sa=x[i+1]-x[i]\n ans=lcm(sa,ans)\nprint(ans)\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C#_> var match = regex.Match(titleText);\n\n if (match.Success)\n {\n var format = (BanlistType)Enum.Parse(typeof(BanlistType), match.Groups[1].Value, true);\n var startDate = DateTime.Parse($\"{match.Groups[2]} {match.Groups[3]}, {match.Groups[4]}\");\n\n var response = new BanlistArticleSummary\n {\n BanlistType = format,\n StartDate = startDate,\n ArticleId = articleId\n };\n\n\n return response;\n }\n\n return null;\n }\n }\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>--------------------------------------------------------\n-- DDL for Index PK_EQUIPE\n--------------------------------------------------------\n\n CREATE UNIQUE INDEX \"G11_FLIGHT\".\"PK_EQUIPE\" ON \"G11_FLIGHT\".\"EQUIPE\" (\"TOUR_ANNEE\", \"EQUIPE_NUM\") \n PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS \n STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645\n PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)\n TABLESPACE \"BD50_IND\" ;\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_># Generated by Django 3.0.8 on 2020-07-25 16:18\n\nfrom django.db import migrations, models\n\n\nclass Migration(migrations.Migration):\n\n initial = True\n\n dependencies = [\n ]\n\n operations = [\n migrations.CreateModel(\n name='Tweet',\n fields=[\n ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),\n ('content', models.TextField(blank=True, null=True)),\n ('image', models.FileField(blank=True, null=True, upload_to='images/')),\n ],\n ),\n ]\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>\tpublic void setClientPort(int clientPort) {\n\t\tthis.clientPort = clientPort;\n\t}\n\n\tpublic long getNodeId() {\n\t\treturn nodeId;\n\t}\n\n\tpublic void setNodeId(long nodeId) {\n\t\tthis.nodeId = nodeId;\n\t}\n\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package org.firstinspires.ftc.teamcode;\n\nimport com.qualcomm.robotcore.eventloop.opmode.Autonomous;\nimport com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;\nimport com.qualcomm.robotcore.hardware.DcMotor;\nimport com.qualcomm.robotcore.hardware.Servo;\n\n@Autonomous\npublic class MainAutonomous extends LinearOpMode {\n\n private DcMotor motor1;\n private DcMotor motor2;\n private DcMotor motor3;\n private DcMotor motor4;\n private DcMotor tableMotor;\n @Override\n public void runOpMode() throws InterruptedException {\n motor1 = hardwareMap.get(DcMotor.class, \"motor1\");\n motor2 = hardwareMap.get(DcMotor.class, \"motor2\");\n motor3 = hardwareMap.get(DcMotor.class, \"motor3\");\n motor4 = hardwareMap.get(DcMotor.class, \"motor4\");\n tableMotor = hardwareMap.get(DcMotor.class, \"motorT\");\n\n waitForStart();\n\n //sleep(23000);\n moveForward();\n distance(5);\n stopMotors();\n //turnRight();\n sleep(500);\n\n\n }\n public void stopMotors(){\n motor1.setPower(0);\n motor2.setPower(0);\n motor3.setPower(0);\n motor4.setPower(0);\n }\n public void moveForward(){\n motor1.setPower(forward(1));\n motor2.setPower(forward(2));\n motor3.setPower(forward(3));\n motor4.setPower(forward(4));\n }\n\n public void moveBackward(){\n motor1.setPower(backward(1));\n motor2.setPower(backward(2));\n motor3.setPower(backward(3));\n motor4.setPower(backward(4));\n }\n public void turnRight(){\n motor1.setPower(backward(1));\n motor2.setPower(backward(2));\n motor3.setPower(forward(3));\n motor4.setPower(forward(4));\n }\n public void turnLeft(){\n motor1.setPower(forward(1));\n motor2.setPower(forward(2));\n motor3.setPower(backward(3));\n motor4.setPower(backward(4));\n }\n public void distance(double feet){\n double constant = 7.5/1000;\n sleep((long) (feet/constant));\n }\n\n public int forward(int motor) {\n switch (motor) {\n case 1:\n return -1;\n case 2:\n return 1;\n case 3:\n return 1;\n case 4:\n return 1;\n default:\n return 0;\n }\n }\n public int backward(int motor) {\n switch (motor) {\n case 1:\n return 1;\n case 2:\n return -1;\n case 3:\n return -1;\n case 4:\n return -1;\n default:\n return 0;\n }\n }\n}\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>\tconst int FUNC_V_1 = 4;\n\tconst int FUNC_V_3 = 5;\n\n#pragma endregion\n\n}\n\nclass myGame::Actor : public Node {\n\tCC_SYNTHESIZE(int, type, Type);\n\tCC_SYNTHESIZE(int, func, Func);\n\n\tCC_SYNTHESIZE(pii, pos, Pos);\n\n\tCC_SYNTHESIZE_RETAIN(Sprite*, gem, Gem);\n\tCC_SYNTHESIZE_RETAIN(Sprite*, icon, Icon);\npublic:\n\tstatic Actor* create(int, int, pii);\n\tvoid allDo(Action*);\n\tvoid moveTo(pii);\n\tvoid moveToThenBack(pii);\n\tvoid dropTo(pii);\n\tvoid selfClose();\n};\n\nstruct myGame::ActorInfo {\n\tpii pos;\n\tint type;\n\tint func;\n\tActorInfo(pii pos, int type = -1, int func = -1) :pos(pos), type(type), func(func) {};\n\tActorInfo(int x, int y, int type = -1, int func = -1) :pos({x,y}), type(type), func(func) {};\n};\n\nstruct myGame::blockInfo {\n\tint type;\n\tint func;\n\tActor* actor;\n\tblockInfo(int type = -1, int func = -1, Actor * actor = NULL) :type(type), func(func), actor(actor) {};\n};\n\nstruct myGame::KillGroup {\n\tpii markPoint;\n\tint markValue;\n\tActorInfoList killInfo;\n\tActorInfoList newInfo;\n};\n\n\n#endif // !_MY_GAME_H_FILE_\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]