images
images listlengths 1
1
| texts
listlengths 1
1
|
---|---|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>package com.genedev.retinalclassifierfull.Activities;\n\nimport android.app.Dialog;</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>from __future__ import absolute_import, unicode_literals\n\nimport os\n\nfrom setuptools import find_packages, setup\n\nfrom wagtailcaptcha import __version__\n\nwith open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:\n README = readme.read()\n\n# allow setup.py to be run from any path\nos.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))\n\n# Testing dependencies\ntesting_extras = [\n # Required for running the tests\n 'tox>=2.3.1,<2.4',\n\n # For coverage and PEP8 linting\n 'coverage>=4.1.0,<4.2',\n 'flake8>=3.2.0,<3.3',\n 'isort==4.2.5',\n\n # For test site\n 'wagtail==2.0',\n]\n\n# Documentation dependencies\ndocumentation_extras = [\n\n]\n\nsetup(\n name='wagtail-django-recaptcha',\n version=__version__,\n packages=find_packages(),\n include_package_data=True,\n license='MIT',\n description='A simple recaptcha field for Wagtail Form Pages.',\n long_description=README,\n url='http://github.com/springload/wagtail-django-recaptcha',\n author='Springload',\n author_email='hello@springload.co.nz',\n classifiers=[\n 'Environment :: Web Environment',\n 'Framework :: Django',\n 'Intended Audience :: Developers',\n 'License :: OSI Approved :: MIT License',\n 'Operating System :: OS Independent',\n 'Programming Language :: Python',\n 'Programming Language :: Python :: 2',\n 'Programming Language :: Python :: 2.7',\n 'Programming Language :: Python :: 3',\n 'Programming Language :: Python :: 3.4',\n 'Programming Language :: Python :: 3.5',\n 'Programming Language :: Python :: 3.6',\n 'Topic :: Internet :: WWW/HTTP',\n 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',\n ],\n install_requires=['django-recaptcha'],\n extras_require={\n 'testing': testing_extras,\n 'docs': documentation_extras,\n },\n zip_safe=False\n)\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_XML_><?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ui version=\"4.0\">\n <class>OverviewPage</class>\n <widget class=\"QWidget\" name=\"OverviewPage\">\n <property name=\"geometry\">\n <rect>\n <x>0</x>\n <y>0</y>\n <width>573</width>\n <height>342</height>\n </rect>\n </property>\n <property name=\"windowTitle\">\n <string>Form</string>\n </property>\n <layout class=\"QVBoxLayout\" name=\"topLayout\">\n <item>\n <widget class=\"QLabel\" name=\"labelAlerts\">\n <property name=\"visible\">\n <bool>false</bool>\n </property>\n <property name=\"styleSheet\">\n <string notr=\"true\">background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0, stop:0 #F0D0A0, stop:1 #F8D488); color:#000000;</string>\n </property>\n <property name=\"wordWrap\">\n <bool>true</bool>\n </property>\n <property name=\"margin\">\n <number>3</number>\n </property>\n </widget>\n </item>\n <item>\n <layout class=\"QHBoxLayout\" name=\"horizontalLayout\" stretch=\"1,1\">\n <item>\n <layout class=\"QVBoxLayout\" name=\"verticalLayout_2\">\n <item>\n <widget class=\"QFrame\" name=\"frame\">\n <property name=\"frameShape\">\n <enum>QFrame::StyledPanel</enum>\n </property>\n <property name=\"frameShadow\">\n <enum>QFrame::Raised</enum>\n </property>\n <layout class=\"QVBoxLayout\" name=\"verticalLayout_4\">\n <item>\n <layout class=\"QHBoxLayout\" name=\"horizontalLayout_4\">\n <item>\n <widget class=\"QLabel\" name=\"label_5\">\n <property name=\"font\">\n <font>\n <weight>75</weight>\n <bold>true</bold>\n </font>\n </property>\n <property name=\"text\">\n <string>Wallet</string>\n </property>\n </widget>\n </item>\n <item>\n <widget class=\"QLabel\" name=\"labelWalletStatus\">\n <property name=\"toolTip\">\n <string>The displayed information may be out of date. Your wallet automatically synchronizes with the AnarchistsPrime network after a connection is established, but this process has not completed yet.</string>\n </property>\n <property name=\"styleSheet\">\n <string notr=\"true\">QLabel { color: red; }</string>\n </property>\n <property name=\"text\">\n <string notr=\"true\">(out of sync)</string>\n </property>\n <property name=\"alignment\">\n <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>\n </property>\n </widget>\n </item>\n <item>\n <spacer name=\"horizontalSpacer_2\">\n <property name=\"orientation\">\n <enum>Qt::Horizontal</enum>\n </property>\n <property name=\"sizeHint\" stdset=\"0\">\n <size>\n <width>40</width>\n <height>20</height>\n </size>\n </property>\n </spacer>\n </item>\n </layout>\n </item>\n <item>\n <layout class=\"QFormLayout\" name=\"formLayout_2\">\n <property name=\"fieldGrowthPolicy\">\n <enum>QFormLayout::AllNonFixedFieldsGrow</enum>\n </property>\n <property name=\"horizontalSpacing\">\n <number>12</number>\n </property>\n <property name=\"verticalSpacing\">\n <number>12</number>\n </property>\n <item row=\"0\" column=\"0\">\n <widget class=\"QLabel\" name=\"label\">\n <property name=\"text\">\n <string>Balance:</string>\n </property>\n </widget>\n </item>\n <item row=\"0\" column=\"1\">\n <widget class=\"QLabel\" name=\"labelBalance\">\n <property name=\"font\">\n <font>\n <weight>75</weight>\n <bold>true</bold>\n </font>\n </property>\n <property name=\"cursor\">\n <cursorShape>IBeamCursor</cursorShape>\n </property>\n <property name=\"toolTip\">\n <string>Your current balance</string>\n </property>\n <property name=\"text\">\n <string notr=\"true\">0 ACP</string>\n </property>\n <property name=\"textInteractionFlags\">\n <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n </property>\n </widget>\n </item>\n <item row=\"1\" column=\"0\">\n <widget class=\"QLabel\" name=\"label_3\">\n <property name=\"text\">\n <string>Unconfirmed:</string>\n </property>\n </widget>\n </item>\n <item row=\"1\" column=\"1\">\n <widget class=\"QLabel\" name=\"labelUnconfirmed\">\n <property name=\"font\">\n <font>\n <weight>75</weight>\n <bold>true</bold>\n </font>\n </property>\n <property name=\"cursor\">\n <cursorShape>IBeamCursor</cursorShape>\n </property>\n <property name=\"toolTip\">\n <string>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</string>\n </property>\n <property name=\"text\">\n <string notr=\"true\">0 ACP</string>\n </property>\n <property name=\"textInteractionFlags\">\n <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n </property>\n </widget>\n </item>\n <item row=\"2\" column=\"0\">\n <widget class=\"QLabel\" name=\"labelImmatureText\">\n <property name=\"text\">\n <string>Immature:</string>\n </property>\n </widget>\n </item>\n <item row=\"2\" column=\"1\">\n <widget class=\"QLabel\" name=\"labelImmature\">\n <property name=\"font\">\n <font>\n <weight>75</weight>\n <bold>true</bold>\n </font>\n </property>\n <property name=\"toolTip\">\n <string>Mined balance that has not yet matured</string>\n </property>\n <property name=\"text\">\n <string notr=\"true\">0 ACP</string>\n </property>\n <property name=\"textInteractionFlags\">\n <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>\n </property>\n </widget>\n </item>\n </layout>\n </item>\n </layout>\n </widget>\n </item>\n <item>\n <spacer name=\"verticalSpacer\">\n <property name=\"orientation\">\n <enum>Qt::Vertical</enum>\n </property>\n <property name=\"sizeHint\" stdset=\"0\">\n <size>\n <width>20</width>\n <height>40</height>\n </size>\n </property>\n </spacer>\n </item>\n <item>\n <widget class=\"QLabel\" name=\"coinimage\">\n <property name=\"text\">\n <string/>\n </property>\n <property name=\"pixmap\">\n <pixmap resource=\"../bitcoin.qrc\">:/icons/bitcoin</pixmap>\n </property>\n <property name=\"scaledContents\">\n <bool>false</bool>\n </property>\n <property name=\"alignment\">\n <set>Qt::AlignCenter</set></code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_PHP_> <section id=\"main-content\">\n \t<section class=\"wrapper site-min-height\">\n \t<div id=\"page-wrapper\"> \t\n \t\t<div class=\"panel panel-default\"></code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>CREATE VIEW viewGIAMDOC AS\nSELECT DA.mada, DA.tenda, DA.kinhphi, PB.tenphong, CN.tencn, NV.hoten, sum(CT.soTien) as tongchi\nFROM dbaDuAn.duan DA, dbaDuAn.nhanvien NV, dbaDuAn.phongban PB, dbaDuAn.chinhanh CN, dbaDuAn.chitieu CT\nWHERE DA.phongchutri = PB.maphong\n AND PB.chinhanh = CN.macn\n AND DA.truongda = NV.manv\n AND CT.duAn = DA.maDA\nGROUP BY DA.maDA, DA.tenDA, DA.kinhPhi, PB.tenPhong, CN.tenCN, NV.hoTen;\n \nCREATE SYNONYM GD001.viewGIAMDOC FOR dbaDuAn.viewGIAMDOC;\nCREATE SYNONYM GD002.viewGIAMDOC FOR dbaDuAn.viewGIAMDOC;\nCREATE SYNONYM GD003.viewGIAMDOC FOR dbaDuAn.viewGIAMDOC;\nCREATE SYNONYM GD004.viewGIAMDOC FOR dbaDuAn.viewGIAMDOC;\nCREATE SYNONYM GD005.viewGIAMDOC FOR dbaDuAn.viewGIAMDOC;\n\nGRANT SELECT ON viewGIAMDOC TO GD001;\nGRANT SELECT ON viewGIAMDOC TO GD002;\nGRANT SELECT ON viewGIAMDOC TO GD003;\nGRANT SELECT ON viewGIAMDOC TO GD004;\nGRANT SELECT ON viewGIAMDOC TO GD005;\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Rust_> })\n } else {\n None\n }\n },\n ExprKind::MethodCall(path, _, args, _) => {\n if_chain! {\n if let [obj, _] = args;\n if cx.typeck_results().expr_ty(obj).is_floating_point() || match_trait_method(cx, expr, &paths::ORD);\n then {\n if path.ident.name == sym!(max) {\n fetch_const(cx, args, MinMax::Max)\n } else if path.ident.name == sym!(min) {\n fetch_const(cx, args, MinMax::Min)\n } else {\n None\n }\n } else {\n None\n }\n }\n },\n _ => None,\n }\n}\n\nfn fetch_const<'a>(cx: &LateContext<'_>, args: &'a [Expr<'a>], m: MinMax) -> Option<(MinMax, Constant, &'a Expr<'a>)> {\n if args.len() != 2 {\n return None;\n }\n constant_simple(cx, cx.typeck_results(), &args[0]).map_or_else(\n || constant_simple(cx, cx.typeck_results(), &args[1]).map(|c| (m, c, &args[0])),\n |c| {\n if constant_simple(cx, cx.typeck_results(), &args[1]).is_none() {\n // otherwise ignore\n Some((m, c, &args[1]))\n } else {\n None\n }\n },\n )\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>files.each do |file|\n describe file(\"#{file}\") do\n it { should be_file }\n it { should be_mode 644 }\n it { should be_owned_by 'root' }\n end\nend\n\nservices.each do |service|\n describe service(\"#{service}\") do\n it { should be_running }\n end\nend\n\ndescribe port(4646) do\n it { should be_listening }\nend\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Cuda_>#pragma once\n#include <tuple>\n#include <algorithm>\n#include <random>\n#include <type_traits>\n#include <vector>\n#include <map>\n\n#include <cudf/types.h>\n\nnamespace without_agg {\n\ntemplate <typename... T>\nusing VTuple = std::tuple<std::vector<T>...>;\n\n\nenum struct GroupByOutType\n{\n PANDAS,//0\n SQL//1\n};\n\n\ntemplate<GroupByOutType,\n typename>\nstruct\nTestParameters {};\n\n\n\n// helper function to tuple_each a tuple of any size\ntemplate <class Tuple, typename Func, std::size_t N>\nstruct TupleEach {\n static void tuple_each(Tuple &t, Func &f) {\n TupleEach<Tuple, Func, N - 1>::tuple_each(t, f);\n f(std::get<N - 1>(t));\n }\n};\n\ntemplate <class Tuple, typename Func>\nstruct TupleEach<Tuple, Func, 1> {\n static void tuple_each(Tuple &t, Func &f) { f(std::get<0>(t)); }\n};\n\ntemplate <typename Tuple, typename Func>\nvoid tuple_each(Tuple &t, Func &&f) {\n TupleEach<Tuple, Func, std::tuple_size<Tuple>::value>::tuple_each(t, f);\n}\n// end helper function\n\n// This structure is used to nest the group operations, group method and\n// number/types of columns for use with Google Test type-parameterized\n// tests. Here agg_operation refers to the type of aggregation eg. min,\n// max etc. and group_method refers to the underlying group algorithm\n//that performs it eg. GDF_HASH or GDF_SORT. VTuple<K...> expects a\n//tuple of datatypes that specify the column types to be tested.\n//AggOutput specifies the output type of the aggregated column.\ntemplate<GroupByOutType group_output_method, typename... K>\nstruct\nTestParameters<group_output_method,\n VTuple<K...>>\n{\n // // The method to use for the groupby\n const static GroupByOutType group_output_type {group_output_method};\n\n using multi_column_t = std::tuple<std::vector<K>...>;\n using vector_tuple_t = std::vector<std::tuple<K...>>;\n // The method to use for the groupby\n const static gdf_method group_type{GDF_SORT};\n\n using output_type = cudf::size_type;\n\n using tuple_t = std::tuple<K...>;\n\n using ref_map_type = std::multimap<std::tuple<K...>, output_type>;\n};\n\ntypedef ::testing::Types<\n TestParameters< GroupByOutType::SQL, VTuple<int16_t > >,\n TestParameters< GroupByOutType::SQL, VTuple<int32_t > >,\n TestParameters< GroupByOutType::SQL, VTuple<int64_t > >,\n TestParameters< GroupByOutType::SQL, VTuple<float> >,\n TestParameters< GroupByOutType::SQL, VTuple<double> >,\n TestParameters< GroupByOutType::SQL, VTuple<int32_t, int64_t > >,\n TestParameters< GroupByOutType::SQL, VTuple<int16_t, float > >,\n TestParameters< GroupByOutType::PANDAS, VTuple<int16_t > >,\n TestParameters< GroupByOutType::PANDAS, VTuple<int32_t > >,\n TestParameters< GroupByOutType::PANDAS, VTuple<int64_t > >,\n TestParameters< GroupByOutType::PANDAS, VTuple<float> >,\n TestParameters< GroupByOutType::PANDAS, VTuple<double> >,\n TestParameters< GroupByOutType::PANDAS, VTuple<int32_t, int64_t > >,\n TestParameters< GroupByOutType::PANDAS, VTuple<int16_t, float > >\n \n > Implementations;\n\ntypedef ::testing::Types<\n TestParameters< GroupByOutType::SQL, VTuple<int16_t >>,\n TestParameters< GroupByOutType::SQL, VTuple<int32_t >>,\n TestParameters< GroupByOutType::SQL, VTuple<int64_t >>,\n TestParameters< GroupByOutType::SQL, VTuple<double >>, \n TestParameters< GroupByOutType::SQL, VTuple<int32_t, int64_t >>,\n TestParameters< GroupByOutType::SQL, VTuple<int64_t, float >>,\n TestParameters< GroupByOutType::PANDAS, VTuple<int16_t >>,\n TestParameters< GroupByOutType::PANDAS, VTuple<int32_t >>,\n TestParameters< GroupByOutType::PANDAS, VTuple<int64_t >>,\n TestParameters< GroupByOutType::PANDAS, VTuple<double >>, </code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_> model = models.Trapezoid1D(amplitude=4.2, x_0=2.0, width=1.0, slope=3)\n xx = np.linspace(0, 4, 8)\n yy = model(xx)\n yy_ref = [0., 1.41428571, 3.12857143, 4.2, 4.2, 3.12857143, 1.41428571, 0.]\n assert_allclose(yy, yy_ref, rtol=0, atol=1e-6)\n\n\ndef test_Gaussian2D():\n \"\"\"\n Test rotated elliptical Gaussian2D model.\n https://github.com/astropy/astropy/pull/2038\n \"\"\"\n\n model = models.Gaussian2D(4.2, 1.7, 3.1, x_stddev=5.1, y_stddev=3.3,\n theta=np.pi/6.)\n y, x = np.mgrid[0:5, 0:5]\n g = model(x, y)\n g_ref = [[3.01907812, 2.99051889, 2.81271552, 2.5119566, 2.13012709],\n [3.55982239, 3.6086023, 3.4734158, 3.17454575, 2.75494838],\n [3.88059142, 4.0257528, 3.96554926, 3.70908389, 3.29410187],\n [3.91095768, 4.15212857, 4.18567526, 4.00652015, 3.64146544],\n [3.6440466, 3.95922417, 4.08454159, 4.00113878, 3.72161094]]\n assert_allclose(g, g_ref, rtol=0, atol=1e-6)\n assert_allclose([model.x_fwhm, model.y_fwhm],\n [12.009582229657841, 7.7709061486021325])\n\n\ndef test_Gaussian2DCovariance():\n \"\"\"\n Test rotated elliptical Gaussian2D model when cov_matrix is input.\n https://github.com/astropy/astropy/pull/2199\n \"\"\"\n\n cov_matrix = [[49., -16.], [-16., 9.]]\n model = models.Gaussian2D(17., 2.0, 2.5, cov_matrix=cov_matrix)\n y, x = np.mgrid[0:5, 0:5]\n g = model(x, y)\n g_ref = [[4.3744505, 5.8413977, 7.42988694, 9.00160175, 10.38794269],\n [8.83290201, 10.81772851, 12.61946384, 14.02225593, 14.84113227],\n [13.68528889, 15.37184621, 16.44637743, 16.76048705, 16.26953638],\n [16.26953638, 16.76048705, 16.44637743, 15.37184621, 13.68528889],\n [14.84113227, 14.02225593, 12.61946384, 10.81772851, 8.83290201]]\n assert_allclose(g, g_ref, rtol=0, atol=1e-6)\n\n\ndef test_Gaussian2DRotation():\n amplitude = 42\n x_mean, y_mean = 0, 0\n x_stddev, y_stddev = 2, 3\n theta = Angle(10, 'deg')\n pars = dict(amplitude=amplitude, x_mean=x_mean, y_mean=y_mean,\n x_stddev=x_stddev, y_stddev=y_stddev)\n rotation = models.Rotation2D(angle=theta.degree)\n point1 = (x_mean + 2 * x_stddev, y_mean + 2 * y_stddev)\n point2 = rotation(*point1)\n g1 = models.Gaussian2D(theta=0, **pars)\n g2 = models.Gaussian2D(theta=theta.radian, **pars)\n value1 = g1(*point1)\n value2 = g2(*point2)\n assert_allclose(value1, value2)\n\n\ndef test_Gaussian2D_invalid_inputs():\n x_stddev = 5.1\n y_stddev = 3.3\n theta = 10\n cov_matrix = [[49., -16.], [-16., 9.]]\n\n # first make sure the valid ones are OK\n models.Gaussian2D()\n models.Gaussian2D(x_stddev=x_stddev, y_stddev=y_stddev, theta=theta)\n models.Gaussian2D(x_stddev=None, y_stddev=y_stddev, theta=theta)\n models.Gaussian2D(x_stddev=x_stddev, y_stddev=None, theta=theta)\n models.Gaussian2D(x_stddev=x_stddev, y_stddev=y_stddev, theta=None)\n models.Gaussian2D(cov_matrix=cov_matrix)\n\n with pytest.raises(InputParameterError):\n models.Gaussian2D(x_stddev=0, cov_matrix=cov_matrix)\n with pytest.raises(InputParameterError):\n models.Gaussian2D(y_stddev=0, cov_matrix=cov_matrix)\n with pytest.raises(InputParameterError):\n models.Gaussian2D(theta=0, cov_matrix=cov_matrix)\n\n\n@pytest.mark.parametrize('gamma', (10, -10))\ndef test_moffat_fwhm(gamma):\n ans = 34.641016151377542\n kwargs = {'gamma': gamma, 'alpha': 0.5}\n m1 = models.Moffat1D(**kwargs)\n m2 = models.Moffat2D(**kwargs)</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<!DOCTYPE cref SYSTEM \"cref.dtd\">\n\n<cref>\n <header>\n <copyright>\n <year>1996</year><year>2016</year>\n <holder>Ericsson AB. All Rights Reserved.</holder>\n </copyright>\n <legalnotice>\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 </legalnotice>\n\n <title>erl_malloc</title>\n <prepared>Torbjörn Törnkvist</prepared>\n <responsible>Torbjörn Törnkvist</responsible>\n <docno></docno>\n <approved>Bjarne Däcker</approved>\n <checked>Torbjörn Törnkvist</checked>\n <date>980703</date>\n <rev>A</rev>\n <file>erl_malloc.sgml</file>\n </header>\n <lib>erl_malloc</lib>\n <libsummary>Memory Allocation Functions</libsummary>\n <description>\n <p>This module provides functions for allocating and deallocating\n memory.</p>\n </description>\n <funcs>\n <func>\n <name><ret>ETERM *</ret><nametext>erl_alloc_eterm(etype)</nametext></name>\n <fsummary>Allocates an ETERM structure</fsummary>\n <type>\n <v>unsigned char etype;</v>\n </type>\n <desc>\n <p>This function allocates an <c><![CDATA[(ETERM)]]></c> structure.\n Specify <c><![CDATA[etype]]></c> as one of the following constants:</p>\n <list type=\"bulleted\">\n <item>\n <p>ERL_INTEGER</p>\n </item>\n <item>\n <p>ERL_U_INTEGER <c><![CDATA[/* unsigned integer */]]></c></p>\n </item>\n <item>\n <p>ERL_ATOM</p>\n </item>\n <item>\n <p>ERL_PID <c><![CDATA[/* Erlang process identifier */]]></c></p>\n </item>\n <item>\n <p>ERL_PORT</p>\n </item>\n <item>\n <p>ERL_REF <c><![CDATA[/* Erlang reference */]]></c></p>\n </item>\n <item>\n <p>ERL_LIST</p>\n </item>\n <item>\n <p>ERL_EMPTY_LIST</p>\n </item>\n <item>\n <p>ERL_TUPLE</p>\n </item>\n <item>\n <p>ERL_BINARY</p>\n </item>\n <item>\n <p>ERL_FLOAT</p>\n </item>\n <item>\n <p>ERL_VARIABLE</p>\n </item>\n <item>\n <p>ERL_SMALL_BIG <c><![CDATA[/* bignum */]]></c></p>\n </item>\n <item>\n <p>ERL_U_SMALL_BIG <c><![CDATA[/* bignum */]]></c></p>\n </item>\n </list>\n <p><c><![CDATA[ERL_SMALL_BIG]]></c> and <c><![CDATA[ERL_U_SMALL_BIG]]></c> are for\n creating Erlang <c><![CDATA[bignums]]></c>, which can contain integers of\n arbitrary size. The size of an integer in Erlang is machine\n dependent, but in general any integer larger than 2^28\n requires a bignum.</p>\n </desc>\n </func>\n <func>\n <name><ret>void</ret><nametext>erl_eterm_release(void)</nametext></name>\n <fsummary>Clears the ETERM freelist</fsummary>\n <desc>\n <p>Clears the \n freelist, where blocks are placed when they are\n released by <c><![CDATA[erl_free_term()]]></c> and\n <c><![CDATA[erl_free_compound()]]></c>. </p>\n </desc>\n </func>\n <func>\n <name><ret>void</ret><nametext>erl_eterm_statistics(allocated, freed)</nametext></name>\n <fsummary>Reports term allocation statistics</fsummary>\n <type>\n <v>long *allocated;</v>\n <v>long *freed;</v></code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>import java.util.Arrays;\nimport java.util.HashSet;\nimport java.util.Scanner;\nimport java.util.Set;\n\npublic class Main {\n\tfinal int INF = 1 << 28;\n\n\tvoid run() {\n\t\tScanner sc = new Scanner(System.in);\n\t\twhile (true) {\n\t\t\tDice[][] ds = new Dice[8][24];\n\t\t\tString str = sc.next();\n\t\t\tif (str.equals(\"0\"))\n\t\t\t\tbreak;\n\t\t\tfor (int i = 0; i < 8; i++) {\n\t\t\t\tif (i != 0) {\n\t\t\t\t\tstr = sc.next();\n\t\t\t\t}\n\t\t\t\tDice d = new Dice(str);\n\t\t\t\tSet<Dice> set = new HashSet<Dice>();\n\t\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\t\td = d.North();\n\t\t\t\t\tfor (int k = 0; k < 4; k++) {\n\t\t\t\t\t\td = d.Right();\n\t\t\t\t\t\tset.add(d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\td = d.East();\n\t\t\t\tfor (int k = 0; k < 4; k++) {\n\t\t\t\t\td = d.Right();\n\t\t\t\t\tset.add(d);\n\t\t\t\t}\n\t\t\t\td = d.East().East();\n\t\t\t\tfor (int k = 0; k < 4; k++) {\n\t\t\t\t\td = d.Right();\n\t\t\t\t\tset.add(d);\n\t\t\t\t}\n\t\t\t\tds[i] = set.toArray(ds[i]);\n\t\t\t}\n\t\t\tboolean yes = false;\n\t\t\tfor (int a = 0; a < 8; a++) {\n\t\t\t\tDice da = ds[a][0];\n\t\t\t\tfor (int b = 0; b < 8; b++) {\n\t\t\t\t\tif (b == a)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tDice db = ds[b][0];\n\t\t\t\t\tboolean f1 = true;\n\t\t\t\t\tfor (int i = 1; i <= 6; i++) {\n\t\t\t\t\t\tfor (int j = 1; j <= 6; j++) {\n\t\t\t\t\t\t\tif (abs(da.cs[i] - db.cs[j]) == 32) {\n\t\t\t\t\t\t\t\tf1 = false;\n\t\t\t\t\t\t\t\ti = INF;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (f1)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tfor (int c = 0; c < 8; c++) {\n\t\t\t\t\t\tif (a == c || b == c)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tDice dc = ds[c][0];\n\t\t\t\t\t\tboolean f2 = true;\n\t\t\t\t\t\tfor (int i = 1; i <= 6; i++) {\n\t\t\t\t\t\t\tfor (int j = 1; j <= 6; j++) {\n\t\t\t\t\t\t\t\tif (abs(dc.cs[i] - db.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\tf2 = false;\n\t\t\t\t\t\t\t\t\ti = INF;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (f2)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tfor (int d = 0; d < 8; d++) {\n\t\t\t\t\t\t\tif (a == d || b == d || c == d)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tDice dd = ds[d][0];\n\t\t\t\t\t\t\tboolean f3 = true;\n\t\t\t\t\t\t\tboolean f4 = true;\n\t\t\t\t\t\t\tfor (int i = 1; i <= 6; i++) {\n\t\t\t\t\t\t\t\tfor (int j = 1; j <= 6; j++) {\n\t\t\t\t\t\t\t\t\tif (abs(dd.cs[i] - dc.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\tf3 = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (abs(dd.cs[i] - da.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\tf4 = false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (f3 || f4)\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tfor (int e = 0; e < 8; e++) {\n\t\t\t\t\t\t\t\tif (a == e || b == e || c == e || d == e)\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\tDice de = ds[e][0];\n\t\t\t\t\t\t\t\tboolean f5 = true;\n\t\t\t\t\t\t\t\tfor (int i = 1; i <= 6; i++) {\n\t\t\t\t\t\t\t\t\tfor (int j = 1; j <= 6; j++) {\n\t\t\t\t\t\t\t\t\t\tif (abs(de.cs[i] - da.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\t\tf5 = false;\n\t\t\t\t\t\t\t\t\t\t\ti = INF;\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (f5)\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\tfor (int f = 0; f < 8; f++) {\n\t\t\t\t\t\t\t\t\tif (a == f || b == f || c == f || d == f\n\t\t\t\t\t\t\t\t\t\t\t|| e == f)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\tDice df = ds[f][0];\n\t\t\t\t\t\t\t\t\tboolean f6 = true;\n\t\t\t\t\t\t\t\t\tboolean f7 = true;\n\t\t\t\t\t\t\t\t\tfor (int i = 1; i <= 6; i++) {\n\t\t\t\t\t\t\t\t\t\tfor (int j = 1; j <= 6; j++) {\n\t\t\t\t\t\t\t\t\t\t\tif (abs(de.cs[i] - df.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\t\t\tf6 = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif (abs(df.cs[i] - db.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\t\t\tf7 = false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (f6 || f7)\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\tfor (int g = 0; g < 8; g++) {\n\t\t\t\t\t\t\t\t\t\tif (a == g || b == g || c == g\n\t\t\t\t\t\t\t\t\t\t\t\t|| d == g || e == g || f == g)\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\tDice dg = ds[g][0];\n\t\t\t\t\t\t\t\t\t\tboolean f8 = true;\n\t\t\t\t\t\t\t\t\t\tboolean f9 = true;\n\t\t\t\t\t\t\t\t\t\tfor (int i = 1; i <= 6; i++) {\n\t\t\t\t\t\t\t\t\t\t\tfor (int j = 1; j <= 6; j++) {\n\t\t\t\t\t\t\t\t\t\t\t\tif (abs(dg.cs[i] - df.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tf8 = false;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif (abs(dg.cs[i] - dc.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tf9 = false;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (f8 || f9)\n\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\tfor (int h = 0; h < 8; h++) {\n\t\t\t\t\t\t\t\t\t\t\tif (a == h || b == h || c == h\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| d == h || e == h\n\t\t\t\t\t\t\t\t\t\t\t\t\t|| f == h || g == h)\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\tDice dh = ds[h][0];\n\t\t\t\t\t\t\t\t\t\t\tboolean f10 = true;\n\t\t\t\t\t\t\t\t\t\t\tboolean f11 = true;\n\t\t\t\t\t\t\t\t\t\t\tboolean f12 = true;\n\t\t\t\t\t\t\t\t\t\t\tfor (int i = 1; i <= 6; i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int j = 1; j <= 6; j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(dg.cs[i] - dh.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tf10 = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(dh.cs[i] - dd.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tf11 = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(dh.cs[i] - de.cs[j]) == 32) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tf12 = false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif (f10 || f11 | f12)\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\tDice[] pos = new Dice[8];\n\t\t\t\t\t\t\t\t\t\t\tfor (int i = 0; i <=12; i++) {\n\t\t\t\t\t\t\t\t\t\t\t\tpos[0] = ds[a][i];\n\t\t\t\t\t\t\t\t\t\t\t\tfor (int j = 0; j < 24; j++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpos[1] = ds[b][j];\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(pos[0].cs[5]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[1].cs[2]) != 32)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\tfor (int k = 0; k < 24; k++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpos[2] = ds[c][k];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(pos[1].cs[3]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[2].cs[4]) != 32)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (int p = 0; p < 24; p++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpos[3] = ds[d][p];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(pos[2].cs[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[3].cs[5]) != 32\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| abs(pos[0].cs[3]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[3].cs[4]) != 32)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (int q = 0; q < 24; q++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpos[4] = ds[e][q];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(pos[0].cs[6]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[4].cs[1]) != 32)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (int r = 0; r < 24; r++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpos[5] = ds[f][r];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(pos[5].cs[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[4].cs[5]) != 32\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| abs(pos[1].cs[6]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[5].cs[1]) != 32)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (int s = 0; s < 24; s++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpos[6] = ds[g][s];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(pos[5].cs[3]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[6].cs[4]) != 32\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| abs(pos[6].cs[1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[2].cs[6]) != 32)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor (int t = 0; t < 24; t++) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpos[7] = ds[h][t];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (abs(pos[4].cs[3]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[7].cs[4]) != 32\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| abs(pos[6].cs[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[7].cs[5]) != 32\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| abs(pos[7].cs[1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t- pos[3].cs[6]) != 32)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tyes = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ta = b = c = d = e = f = g = h = i = j = k = p = q = r = s = INF;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(yes ? \"YES\" : \"NO\");\n\t\t}\n\t}\n\n\tint abs(int n) {\n\t\treturn n > 0 ? n : -n;\n\t}\n\n\tpublic static void main(String[] args) throws Exception {\n\t\tnew Main().run();\n\t}\n\n}\n\nclass Dice {\n\tchar cs[] = new char[7];\n\n\tDice(char c1, char c2, char c3, char c4, char c5, char c6) {\n\t\tcs[1] = c1;\n\t\tcs[2] = c2;\n\t\tcs[3] = c3;\n\t\tcs[4] = c4;\n\t\tcs[5] = c5;\n\t\tcs[6] = c6;\n\t}\n\n\tDice(String str) {\n\t\tchar[] tmp = str.toCharArray();\n\t\tfor (int i = 0; i < 6; i++) {\n\t\t\tcs[i + 1] = tmp[i];\n\t\t}\n\t}\n\n\tpublic Dice North() {\n\t\treturn new Dice(cs[2], cs[6], cs[3], cs[4], cs[1], cs[5]);\n\t}\n\n\tpublic Dice East() {\n\t\treturn new Dice(cs[4], cs[2], cs[1], cs[6], cs[5], cs[3]);\n\t}\n\n\tpublic Dice Right() {\n\t\treturn new Dice(cs[1], cs[4], cs[2], cs[5], cs[3], cs[6]);\n\t}\n\n\tpublic String toString() {\n\t\treturn Arrays.toString(cs);\n\t}\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>select\n id\n, datetime_columns\n, timestamp_columns\n, nil_datetime_columns\nFROM\n goma_date_types\nWHERE\n id = :id\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_CSS_>@font-face {\n font-family: 'iconfont'; /* project id 2062009 */\n src: url('//at.alicdn.com/t/font_2062009_7vczhza48qo.eot');\n src: url('//at.alicdn.com/t/font_2062009_7vczhza48qo.eot?#iefix') format('embedded-opentype'),\n url('//at.alicdn.com/t/font_2062009_7vczhza48qo.woff2') format('woff2'),\n url('//at.alicdn.com/t/font_2062009_7vczhza48qo.woff') format('woff'),\n url('//at.alicdn.com/t/font_2062009_7vczhza48qo.ttf') format('truetype'),\n url('//at.alicdn.com/t/font_2062009_7vczhza48qo.svg#iconfont') format('svg');\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C#_>using System;\n\nnamespace AOJ.Volume1\n{\n public class ExitSurvey\n {\n public static int Main()\n {\n int n = int.Parse(Console.ReadLine());\n ulong sum = 0;\n for (int p = 0; p < n; p++)\n {\n sum += ulong.Parse(Console.ReadLine());\n }\n ulong ans = (ulong)Math.Floor((double)sum / n);\n Console.WriteLine(ans);\n return 0;\n }\n }\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>import java.util.Scanner;\n\npublic class Main {\n\tpublic static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint K = sc.nextInt();\n\t\tint S = sc.nextInt();\n\t\tint count = 0;\n\t\tfor (int x = 0; x <= K; x++) {\n\t\t\tfor (int y = 0; y <= K; y++) {\n\t\t\t\tint z = S - (x + y);\n\t\t\t\tif(0 <= z && z <= K) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.print(count);\t\t\n\t}\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_SQL_>CREATE DATABASE IF NOT EXISTS `algernon_cloud` /*!40100 DEFAULT CHARACTER SET latin1 */;\r\nUSE `algernon_cloud`;\r\n-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)\r\n--\r\n-- Host: 52.202.170.133 Database: algernon_cloud\r\n-- ------------------------------------------------------\r\n-- Server version\t5.6.27-log\r\n\r\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\r\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\r\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\r\n/*!40101 SET NAMES utf8 */;\r\n/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\r\n/*!40103 SET TIME_ZONE='+00:00' */;\r\n/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\r\n/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\r\n/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\r\n/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\r\n\r\n--\r\n-- Table structure for table `AppQueryChanges`\r\n--\r\n\r\nDROP TABLE IF EXISTS `AppQueryChanges`;\r\n/*!40101 SET @saved_cs_client = @@character_set_client */;\r\n/*!40101 SET character_set_client = utf8 */;\r\nCREATE TABLE `AppQueryChanges` (\r\n `alter_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',\r\n `query_name` varchar(100) NOT NULL DEFAULT '',\r\n `query_statement` varchar(500) DEFAULT NULL,\r\n PRIMARY KEY (`alter_date`,`query_name`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n/*!40101 SET character_set_client = @saved_cs_client */;\r\n/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\r\n\r\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\r\n/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\r\n/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\r\n/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\r\n/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\r\n/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\r\n/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\r\n\r\n-- Dump completed on 2017-01-31 11:30:22\r\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>-- 2021-12-21T13:36:06.857Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Element_Trl SET Name='Asynchrone Verarbeitung erzwingen', PrintName='Asynchrone Verarbeitung erzwingen',Updated=TO_TIMESTAMP('2021-12-21 15:36:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=580404 AND AD_Language='de_CH'\n;\n\n-- 2021-12-21T13:36:06.894Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\n/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(580404,'de_CH') \n;\n\n-- 2021-12-21T13:36:09.867Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Element_Trl SET Name='Asynchrone Verarbeitung erzwingen', PrintName='Asynchrone Verarbeitung erzwingen',Updated=TO_TIMESTAMP('2021-12-21 15:36:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=580404 AND AD_Language='de_DE'\n;\n\n-- 2021-12-21T13:36:09.869Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\n/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(580404,'de_DE') \n;\n\n-- 2021-12-21T13:36:09.901Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\n/* DDL */ select update_ad_element_on_ad_element_trl_update(580404,'de_DE') \n;\n\n-- 2021-12-21T13:36:09.904Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Column SET ColumnName='IsForceProcessedAsync', Name='Asynchrone Verarbeitung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID=580404\n;\n\n-- 2021-12-21T13:36:09.906Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Process_Para SET ColumnName='IsForceProcessedAsync', Name='Asynchrone Verarbeitung erzwingen', Description=NULL, Help=NULL, AD_Element_ID=580404 WHERE UPPER(ColumnName)='ISFORCEPROCESSEDASYNC' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL\n;\n\n-- 2021-12-21T13:36:09.908Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Process_Para SET ColumnName='IsForceProcessedAsync', Name='Asynchrone Verarbeitung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID=580404 AND IsCentrallyMaintained='Y'\n;\n\n-- 2021-12-21T13:36:09.909Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Field SET Name='Asynchrone Verarbeitung erzwingen', Description=NULL, Help=NULL WHERE (AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=580404) AND AD_Name_ID IS NULL ) OR (AD_Name_ID = 580404)\n;\n\n-- 2021-12-21T13:36:09.934Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_PrintFormatItem pi SET PrintName='Asynchrone Verarbeitung erzwingen', Name='Asynchrone Verarbeitung erzwingen' WHERE IsCentrallyMaintained='Y' AND EXISTS (SELECT * FROM AD_Column c WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=580404)\n;\n\n-- 2021-12-21T13:36:09.935Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Tab SET Name='Asynchrone Verarbeitung erzwingen', Description=NULL, Help=NULL, CommitWarning = NULL WHERE AD_Element_ID = 580404\n;\n\n-- 2021-12-21T13:36:09.937Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_WINDOW SET Name='Asynchrone Verarbeitung erzwingen', Description=NULL, Help=NULL WHERE AD_Element_ID = 580404\n;\n\n-- 2021-12-21T13:36:09.938Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Menu SET Name = 'Asynchrone Verarbeitung erzwingen', Description = NULL, WEBUI_NameBrowse = NULL, WEBUI_NameNew = NULL, WEBUI_NameNewBreadcrumb = NULL WHERE AD_Element_ID = 580404\n;\n\n-- 2021-12-21T13:36:15.174Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\nUPDATE AD_Element_Trl SET Name='Asynchrone Verarbeitung erzwingen', PrintName='Asynchrone Verarbeitung erzwingen',Updated=TO_TIMESTAMP('2021-12-21 15:36:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=580404 AND AD_Language='nl_NL'\n;\n\n-- 2021-12-21T13:36:15.175Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator\n/* DDL */ select update_TRL_Tables_On_AD_Element_TRL_Update(580404,'nl_NL') \n;\n\n-- 2021-12-21T13:42:27.154Z\n-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_XML_> </resource>\n <resource id=\"Magento_Backend::stores\">\n <resource id=\"Magento_Backend::stores_settings\">\n <resource id=\"Magento_Config::config\">\n <resource id=\"Straitv_DynamicProduct::straitv_config\" title=\"Solar Calculator\"/>\n </resource>\n </resource>\n </resource>\n </resource>\n </resources>\n </acl>\n</config></code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_YAML_>### YamlMime:UniversalReference\napi_name: []\nitems:\n- children: []\n class: azure.mgmt.compute.v2019_12_01.models.InnerError\n fullName: azure.mgmt.compute.v2019_12_01.models.InnerError\n inheritance:\n - inheritance:\n - type: builtins.object\n type: msrest.serialization.Model\n langs:\n - python\n module: azure.mgmt.compute.v2019_12_01.models\n name: InnerError\n summary: Inner error details.\n syntax:\n content: 'InnerError(*, exceptiontype: str = None, errordetail: str = None, **kwargs)\n -> None'\n parameters:\n - description: The exception type.\n id: exceptiontype\n type:\n - str\n - description: The internal error message or exception dump.\n id: errordetail\n type:\n - str\n type: class\n uid: azure.mgmt.compute.v2019_12_01.models.InnerError\nreferences: []\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_># Copyright 2020 CS Systemes d'Information, http://www.c-s.fr\n#\n# This file is part of pytest-executable\n# https://www.github.com/CS-SI/pytest-executable\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\"\"\"Tests for the settings container.\"\"\"\n\nimport pytest\nfrom jsonschema import ValidationError\n\nfrom pytest_executable.plugin import SETTINGS_PATH as DEFAULT_SETTINGS_FILE\nfrom pytest_executable.settings import Settings, Tolerances\n\n\n@pytest.fixture\ndef default_settings():\n \"\"\"Fixture that returns a hand made default Settings object.\"\"\"\n return Settings(nproc=1, marks=set(), references=set(), tolerances={})\n\n\ndef _test_merge(tmp_path, yaml_str, ref_settings):\n # helper function\n settings_file = tmp_path / \"settings.yaml\"\n settings_file.write_text(yaml_str)\n assert (\n Settings.from_local_file(DEFAULT_SETTINGS_FILE, settings_file) == ref_settings\n )\n\n\ndef test_defaults(tmp_path, default_settings):\n \"\"\"Test yaml merge with default settings.\"\"\"\n # default settings merged with itself\n yaml_str = \"\"\n _test_merge(tmp_path, yaml_str, default_settings)\n\n\ndef test_merge(tmp_path):\n \"\"\"Test yaml merge with default settings.\"\"\"\n # default settings merged with itself\n yaml_str = \"\"\n ref_settings = Settings.from_local_file(\n DEFAULT_SETTINGS_FILE, DEFAULT_SETTINGS_FILE\n )\n _test_merge(tmp_path, yaml_str, ref_settings)\n\n\ndef test_merge_0(tmp_path, default_settings):\n \"\"\"Test merge existing dict item.\"\"\"\n yaml_str = \"\"\"\ntolerances:\n Velocity:\n rel: 1.\n \"\"\"\n default_settings.tolerances[\"Velocity\"] = Tolerances()\n default_settings.tolerances[\"Velocity\"].rel = 1\n _test_merge(tmp_path, yaml_str, default_settings)\n\n\ndef test_merge_1(tmp_path, default_settings):\n \"\"\"Test merge new dict item.\"\"\"\n yaml_str = \"\"\"\ntolerances:\n X:\n rel: 1.\n \"\"\"\n default_settings.tolerances[\"X\"] = Tolerances(rel=1.0, abs=0.0)\n _test_merge(tmp_path, yaml_str, default_settings)\n\n\ndef test_merge_2(tmp_path, default_settings):\n \"\"\"Test merge new dict item.\"\"\"\n yaml_str = \"\"\"\nmarks:\n - mark\n \"\"\"\n default_settings.marks = {\"mark\"}\n _test_merge(tmp_path, yaml_str, default_settings)\n\n\n@pytest.mark.parametrize(\n \"yaml_str\",\n ( # marks shall be unique\n \"\"\"\nmarks:\n - x\n - x\n \"\"\",\n # references shall be unique\n \"\"\"\nreferences:\n - x\n - x\n \"\"\",\n # alien key\n \"\"\"\nX: x\n \"\"\",\n # nproc shall be strictly positive\n \"\"\"\nnproc: 0\n \"\"\",\n # tolerances shall be rel or abs\n \"\"\"\ntolerances:\n Velocity:\n X: 1.\n \"\"\",\n # rel shall be number\n \"\"\"\ntolerances:\n Velocity:\n rel: x\n \"\"\",\n # rel shall be positive\n \"\"\"\ntolerances:\n Velocity:\n rel: -1.\n \"\"\",\n ),\n)\ndef test_yaml_validation(tmp_path, yaml_str):\n \"\"\"Test yaml schema validation.\"\"\"\n settings_file = tmp_path / \"settings.yaml\"\n settings_file.write_text(yaml_str)\n with pytest.raises(ValidationError):\n Settings.from_local_file(DEFAULT_SETTINGS_FILE, settings_file)\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C_> *\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 * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * $FreeBSD: head/sys/dev/nand/nfc_at91.h 260885 2014-01-19 17:53:51Z imp $\n */\n\n/*\n * Atmel at91-family integrated NAND controller driver.\n *\n * Interface to board setup code to set parameters.\n */\n\n#ifndef\tDEV_NAND_NFC_AT91_H\n#define\tDEV_NAND_NFC_AT91_H 1\n\nstruct at91_nand_params \n{\n\tuint32_t\tale;\t\t/* Address for ALE (address) NAND cycles */\n\tuint32_t\tcle;\t\t/* Address for CLE (command) NAND cycles */\n\tuint32_t\twidth;\t\t/* 8 or 16 bits (specify in bits) */\n\tuint32_t\tcs;\t\t/* Chip Select NAND is connected to */\n\tuint32_t\trnb_pin;\t/* GPIO pin # for Read/notBusy */\n\tuint32_t\tnce_pin;\t/* GPIO pin # for CE (active low) */\n};\n\nvoid at91_enable_nand(const struct at91_nand_params *);\n\n#endif /* DEV_NAND_NFC_AT91_H */\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import itertools\nk=int(input())\ndef solve(a,b,c):\n\tif a==0 or b==0 or c==0:\n\t\treturn max(a,b,c)\n\tif a==b and b==c:\n\t\treturn a\n\tif a<=b<=c:\n\t\treturn solve(a,b%a,c%a)\n\telif b<=a<=c:\n\t\treturn solve(a%b,b,c%b)\n\telse:\n\t\treturn solve(a%c,b%c,c)\narr=[i+1 for i in range(k)]\n\nl = [p for p in itertools.product(arr, repeat=3)]\ns=0\nfor i in l:\n\ta,b,c=i\n\ts+=solve(a,b,c)\nprint(s)</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_> task :marks => :environment do\n puts 'Assign Marks for Assignments'\n\n #Function used to create marks for both criterias\n def create_mark(result_id, markable_type, markable)\n Mark.create(\n result_id: result_id,\n mark: rand(0..4),\n markable_type: markable_type,\n markable: markable)\n end\n\n #Right now, only generate marks for two assignments\n Grouping.where(assignment_id: [1, 2]).each do |grouping|\n time = grouping.assignment.submission_rule.calculate_collection_time.localtime\n new_submission = Submission.create_by_timestamp(grouping, time)\n result = new_submission.results.first\n grouping.is_collected = true\n grouping.save\n\n #Automate marks for assignment using flexible criteria\n if grouping.assignment.marking_scheme_type == Assignment::MARKING_SCHEME_TYPE[:flexible]\n grouping.assignment.flexible_criteria.each do |flexible|\n mark = create_mark(result.id, grouping.assignment.marking_scheme_type, flexible)\n result.marks.push(mark)\n result.save\n end\n end\n\n #Automate marks for assignment using rubric criteria\n if grouping.assignment.marking_scheme_type == Assignment::MARKING_SCHEME_TYPE[:rubric]\n grouping.assignment.rubric_criteria.each do |rubric|\n mark = create_mark(result.id, grouping.assignment.marking_scheme_type, rubric)\n result.marks.push(mark)\n result.save\n end\n end\n end\n\n #Release the marks after they have been inputed into the assignments\n Result.all.each do |result|\n result.marking_state = 'complete'\n result.released_to_students = true\n result.save\n end\n\n Assignment.find([1, 2]).each { |a| a.update_results_stats }\n\n puts 'Assign Marks for Spreadsheets'\n grade_entry_form = GradeEntryForm.find(1)\n # Add marks to every student\n Student.find_each do |student|\n out_of_total = 0\n grade_entry_form_total = 0\n # For each question, assign a random mark based on its out_of value\n grade_entry_form.grade_entry_items.each do |grade_entry_item|\n random_grade = 1 + rand(0...Integer(grade_entry_item.out_of))\n out_of_total += grade_entry_item.out_of\n Grade.create(grade_entry_student_id: student.id,\n grade_entry_item_id: grade_entry_item.id,\n grade: random_grade)\n grade_entry_form_total += random_grade\n end\n # Create grade entry student row with total mark\n GradeEntryStudent.create(user_id: student.id,\n grade_entry_form_id: grade_entry_form.id,\n released_to_student: true,\n total_grade: grade_entry_form_total)\n end\n end\nend\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_XML_>\t<parent>\n\t\t<groupId>org.leapframework</groupId>\n\t\t<artifactId>tests</artifactId>\n\t\t<version>0.7.14b-SNAPSHOT</version>\n\t\t<relativePath>../pom.xml</relativePath>\n\t</parent>\n\t<artifactId>webunit-test1</artifactId>\n\t<packaging>war</packaging>\n\n\t<dependencies>\n\t\t<dependency>\n\t\t\t<groupId>org.leapframework</groupId>\n\t\t\t<artifactId>leap-web</artifactId>\n\t\t\t<version>${project.version}</version>\n\t\t</dependency>\n\t\t<dependency>\n\t\t\t<groupId>org.leapframework</groupId>\n\t\t\t<artifactId>leap-webunit</artifactId>\n\t\t\t<version>${project.version}</version>\n\t\t\t<scope>test</scope>\n\t\t</dependency>\n\t</dependencies>\n</project>\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Go_>package agent\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"strconv\"\n\t\"strings\"\n\t\"time\"\n\n\t\"github.com/fnproject/fn/api/agent/drivers\"\n\t\"github.com/fnproject/fn/api/common\"\n\t\"github.com/fnproject/fn/api/id\"\n\t\"github.com/fnproject/fn/api/models\"\n\t\"github.com/go-openapi/strfmt\"\n\t\"github.com/opentracing/opentracing-go\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype Call interface {\n\t// Model will return the underlying models.Call configuration for this call.\n\t// TODO we could respond to async correctly from agent but layering, this\n\t// is only because the front end has different responses based on call type.\n\t// try to discourage use elsewhere until this gets pushed down more...\n\tModel() *models.Call\n\n\t// Start will be called before this call is executed, it may be used to\n\t// guarantee mutual exclusion, check docker permissions, update timestamps,\n\t// etc.\n\t// TODO Start and End can likely be unexported as they are only used in the agent,\n\t// and on a type which is constructed in a specific agent. meh.\n\tStart(ctx context.Context) error\n\n\t// End will be called immediately after attempting a call execution,\n\t// regardless of whether the execution failed or not. An error will be passed\n\t// to End, which if nil indicates a successful execution. Any error returned\n\t// from End will be returned as the error from Submit.\n\tEnd(ctx context.Context, err error) error\n}\n\n// TODO build w/o closures... lazy\ntype CallOpt func(a *agent, c *call) error\n\ntype Param struct {\n\tKey string\n\tValue string\n}\ntype Params []Param\n\nfunc FromRequest(appName, path string, req *http.Request, params Params) CallOpt {\n\treturn func(a *agent, c *call) error {\n\t\tapp, err := a.da.GetApp(req.Context(), appName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\troute, err := a.da.GetRoute(req.Context(), appName, path)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif route.Format == \"\" {\n\t\t\troute.Format = \"default\"\n\t\t}\n\n\t\tid := id.New().String()\n\n\t\t// baseVars are the vars on the route & app, not on this specific request [for hot functions]\n\t\tbaseVars := make(map[string]string, len(app.Config)+len(route.Config)+3)\n\n\t\t// add app & route config before our standard additions\n\t\tfor k, v := range app.Config {\n\t\t\tk = toEnvName(\"\", k)\n\t\t\tbaseVars[k] = v\n\t\t}\n\t\tfor k, v := range route.Config {\n\t\t\tk = toEnvName(\"\", k)\n\t\t\tbaseVars[k] = v\n\t\t}\n\n\t\tbaseVars[\"FN_FORMAT\"] = route.Format\n\t\tbaseVars[\"FN_APP_NAME\"] = appName\n\t\tbaseVars[\"FN_PATH\"] = route.Path\n\t\t// TODO: might be a good idea to pass in: envVars[\"FN_BASE_PATH\"] = fmt.Sprintf(\"/r/%s\", appName) || \"/\" if using DNS entries per app\n\t\tbaseVars[\"FN_MEMORY\"] = fmt.Sprintf(\"%d\", route.Memory)\n\t\tbaseVars[\"FN_TYPE\"] = route.Type\n\n\t\t// envVars contains the full set of env vars, per request + base\n\t\tenvVars := make(map[string]string, len(baseVars)+len(params)+len(req.Header)+3)\n\n\t\tfor k, v := range baseVars {\n\t\t\tenvVars[k] = v\n\t\t}\n\n\t\tenvVars[\"FN_CALL_ID\"] = id\n\t\tenvVars[\"FN_METHOD\"] = req.Method\n\t\tenvVars[\"FN_REQUEST_URL\"] = func() string {\n\t\t\tif req.URL.Scheme == \"\" {\n\t\t\t\tif req.TLS == nil {\n\t\t\t\t\treq.URL.Scheme = \"http\"\n\t\t\t\t} else {\n\t\t\t\t\treq.URL.Scheme = \"https\"\n\t\t\t\t}\n\t\t\t}\n\t\t\tif req.URL.Host == \"\" {\n\t\t\t\treq.URL.Host = req.Host\n\t\t\t}\n\t\t\treturn req.URL.String()\n\t\t}()\n\n\t\t// params\n\t\tfor _, param := range params {\n\t\t\tenvVars[toEnvName(\"FN_PARAM\", param.Key)] = param.Value\n\t\t}\n\n\t\theaderVars := make(map[string]string, len(req.Header))\n\n\t\tfor k, v := range req.Header {\n\t\t\tif !noOverrideVars(k) { // NOTE if we don't do this, they'll leak in (don't want people relying on this behavior)\n\t\t\t\theaderVars[toEnvName(\"FN_HEADER\", k)] = strings.Join(v, \", \")\n\t\t\t}\n\t\t}\n\n\t\t// add all the env vars we build to the request headers\n\t\tfor k, v := range envVars {\n\t\t\tif noOverrideVars(k) {\n\t\t\t\t// overwrite the passed in request headers explicitly with the generated ones\n\t\t\t\treq.Header.Set(k, v)\n\t\t\t} else {\n\t\t\t\treq.Header.Add(k, v)\n\t\t\t}\n\t\t}\n\n\t\tfor k, v := range headerVars {\n\t\t\tenvVars[k] = v\n\t\t}\n\n\t\t// TODO this relies on ordering of opts, but tests make sure it works, probably re-plumb/destroy headers\n\t\t// TODO async should probably supply an http.ResponseWriter that records the logs, to attach response headers to\n\t\tif rw, ok := c.w.(http.ResponseWriter); ok {\n\t\t\trw.Header().Add(\"FN_CALL_ID\", id)\n\t\t\tfor k, vs := range route.Headers {\n\t\t\t\tfor _, v := range vs {\n\t\t\t\t\t// pre-write in these headers to response\n\t\t\t\t\trw.Header().Add(k, v)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// this ensures that there is an image, path, timeouts, memory, etc are valid.\n\t\t// NOTE: this means assign any changes above into route's fields\n\t\terr = route.Validate()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tc.Call = &models.Call{\n\t\t\tID: id,\n\t\t\tAppName: appName,\n\t\t\tPath: route.Path,\n\t\t\tImage: route.Image,\n\t\t\t// Delay: 0,\n\t\t\tType: route.Type,\n\t\t\tFormat: route.Format,\n\t\t\t// Payload: TODO,\n\t\t\tPriority: new(int32), // TODO this is crucial, apparently\n\t\t\tTimeout: route.Timeout,\n\t\t\tIdleTimeout: route.IdleTimeout,\n\t\t\tMemory: route.Memory,\n\t\t\tBaseEnv: baseVars,\n\t\t\tEnvVars: envVars,\n\t\t\tCreatedAt: strfmt.DateTime(time.Now()),\n\t\t\tURL: req.URL.String(), // TODO we should probably strip host/port\n\t\t\tMethod: req.Method,\n\t\t}\n\n\t\tc.req = req\n\t\treturn nil\n\t}\n}\n\nfunc noOverrideVars(key string) bool {\n\t// descrepency in casing b/w req headers and env vars, force matches\n\treturn overrideVars[strings.ToUpper(key)]\n}\n\n// overrideVars means that the app config, route config or header vars\n// must not overwrite the generated values in call construction.\nvar overrideVars = map[string]bool{\n\t\"FN_FORMAT\": true,\n\t\"FN_APP_NAME\": true,\n\t\"FN_PATH\": true,\n\t\"FN_MEMORY\": true,\n\t\"FN_TYPE\": true,\n\t\"FN_CALL_ID\": true,\n\t\"FN_METHOD\": true,\n\t\"FN_REQUEST_URL\": true,\n}\n\n// TODO this currently relies on FromRequest having happened before to create the model</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_> -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)\r\n--\r\n-- Host: 127.0.0.1 Database: grandmalifev2\r\n-- ------------------------------------------------------\r\n-- Server version\t5.5.5-10.1.19-MariaDB\r\n\r\n/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\r\n/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\r\n/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\r\n/*!40101 SET NAMES utf8 */;\r\n/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\r\n/*!40103 SET TIME_ZONE='+00:00' */;\r\n/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\r\n/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\r\n/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\r\n/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\r\n\r\n--\r\n-- Table structure for table `blogmembers`\r\n--\r\n\r\nDROP TABLE IF EXISTS `blogmembers`;\r\n/*!40101 SET @saved_cs_client = @@character_set_client */;\r\n/*!40101 SET character_set_client = utf8 */;\r\nCREATE TABLE `blogmembers` (\r\n `memberID` int(10) NOT NULL AUTO_INCREMENT,\r\n `username` varchar(255) NOT NULL,\r\n `password` varchar(255) DEFAULT NULL,\r\n `email` text NOT NULL,\r\n PRIMARY KEY (`memberID`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\r\n/*!40101 SET character_set_client = @saved_cs_client */;\r\n\r\n--\r\n-- Dumping data for table `blogmembers`\r\n--\r\n\r\nLOCK TABLES `blogmembers` WRITE;\r\n/*!40000 ALTER TABLE `blogmembers` DISABLE KEYS */;\r\n/*!40000 ALTER TABLE `blogmembers` ENABLE KEYS */;\r\nUNLOCK TABLES;\r\n\r\n--\r\n-- Table structure for table `blogposts`\r\n--\r\n\r\nDROP TABLE IF EXISTS `blogposts`;\r\n/*!40101 SET @saved_cs_client = @@character_set_client */;\r\n/*!40101 SET character_set_client = utf8 */;\r\nCREATE TABLE `blogposts` (\r\n `postID` int(10) NOT NULL AUTO_INCREMENT,\r\n `postTitle` varchar(255) NOT NULL,\r\n `postDesc` text NOT NULL,\r\n `postCont` text NOT NULL,\r\n `postDate` datetime NOT NULL,\r\n `username` varchar(100) DEFAULT NULL,\r\n PRIMARY KEY (`postID`)\r\n) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;\r\n/*!40101 SET character_set_client = @saved_cs_client */;\r\n\r\n--\r\n-- Dumping data for table `blogposts`\r\n--\r\n\r\nLOCK TABLES `blogposts` WRITE;\r\n/*!40000 ALTER TABLE `blogposts` DISABLE KEYS */;\r</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_> figure_saver.save_figure(fig, \"__\".join(features), sub_directory=\"pdp_2d\")\n\n X_train, X_test, y_train, y_test = data_split_cache.load()\n rf = get_model()\n columns_list = list(combinations(X_train.columns, 2))\n</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<jcr:root xmlns:sling=\"http://sling.apache.org/jcr/sling/1.0\" xmlns:cq=\"http://www.day.com/jcr/cq/1.0\" xmlns:jcr=\"http://www.jcp.org/jcr/1.0\"\n jcr:primaryType=\"cq:Page\">\n <jcr:content\n cq:allowedTemplates=\"[/conf/core-components/settings/wcm/templates/core-components,/conf/core-components/settings/wcm/templates/responsive-template,/conf/core-components/settings/wcm/templates/simple-template]\"\n cq:template=\"/conf/core-components/settings/wcm/templates/core-components\"\n jcr:primaryType=\"cq:PageContent\"\n jcr:title=\"Core Components\"\n sling:configRef=\"/conf/core-components\"\n sling:resourceType=\"core/wcm/tests/components/test-page\"/>\n</jcr:root>\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C#_>using System;\nusing System.Linq;\nusing System.Collections.Generic;\n\nclass Program\n{\n static void Main(string[] args)\n {\n var N = int.Parse(Console.ReadLine());\n var sum = 180 * (N - 2);\n Console.WriteLine(sum);\n }\n}\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_XML_><project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n <modelVersion>4.0.0</modelVersion></code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_SQL_>PRIMARY KEY (ID)\n/\n\n\n\n\n\n\n\n-----------------------------------------------------------------------------\n-- KRIM_ENTITY_T\n-----------------------------------------------------------------------------\nDECLARE temp NUMBER;\nBEGIN\n SELECT COUNT(*) INTO temp FROM user_tables WHERE table_name = 'KRIM_ENTITY_T';\n IF temp > 0 THEN EXECUTE IMMEDIATE 'DROP TABLE KRIM_ENTITY_T CASCADE CONSTRAINTS PURGE'; END IF;\nEND;\n/\n\nCREATE TABLE KRIM_ENTITY_T\n(\n ENTITY_ID VARCHAR2(40)\n , OBJ_ID VARCHAR2(36) NOT NULL\n , VER_NBR NUMBER(8) default 1 NOT NULL\n , ACTV_IND VARCHAR2(1) default 'Y'\n , LAST_UPDT_DT DATE default SYSDATE\n \n , CONSTRAINT KRIM_ENTITY_TC0 UNIQUE (OBJ_ID)\n\n)\n/\n\nALTER TABLE KRIM_ENTITY_T\n ADD CONSTRAINT KRIM_ENTITY_TP1\nPRIMARY KEY (ENTITY_ID)\n/\n\n\n\n\n\n\n\n-----------------------------------------------------------------------------\n-- KRIM_ENTITY_VISA_T\n-----------------------------------------------------------------------------\nDECLARE temp NUMBER;\nBEGIN\n SELECT COUNT(*) INTO temp FROM user_tables WHERE table_name = 'KRIM_ENTITY_VISA_T';\n IF temp > 0 THEN EXECUTE IMMEDIATE 'DROP TABLE KRIM_ENTITY_VISA_T CASCADE CONSTRAINTS PURGE'; END IF;\nEND;\n/\n\nCREATE TABLE KRIM_ENTITY_VISA_T\n(\n ID VARCHAR2(40)\n , ENTITY_ID VARCHAR2(40)\n , VISA_TYPE_KEY VARCHAR2(40)\n , VISA_ENTRY VARCHAR2(40)\n , VISA_ID VARCHAR2(40)\n , VER_NBR NUMBER(8) default 1 NOT NULL\n , OBJ_ID VARCHAR2(36) NOT NULL\n \n , CONSTRAINT KRIM_ENTITY_VISA_TC0 UNIQUE (OBJ_ID)\n\n)\n/\n\nALTER TABLE KRIM_ENTITY_VISA_T\n ADD CONSTRAINT KRIM_ENTITY_VISA_TP1\nPRIMARY KEY (ID)\n/\n\n\n\n\n\n\n\n-----------------------------------------------------------------------------\n-- KRIM_ENT_NM_TYP_T\n-----------------------------------------------------------------------------\nDECLARE temp NUMBER;\nBEGIN\n SELECT COUNT(*) INTO temp FROM user_tables WHERE table_name = 'KRIM_ENT_NM_TYP_T';\n IF temp > 0 THEN EXECUTE IMMEDIATE 'DROP TABLE KRIM_ENT_NM_TYP_T CASCADE CONSTRAINTS PURGE'; END IF;\nEND;\n/\n\nCREATE TABLE KRIM_ENT_NM_TYP_T\n(\n ENT_NM_TYP_CD VARCHAR2(40)\n , OBJ_ID VARCHAR2(36) NOT NULL\n , VER_NBR NUMBER(8) default 1 NOT NULL\n , NM VARCHAR2(40)\n , ACTV_IND VARCHAR2(1) default 'Y'\n , DISPLAY_SORT_CD VARCHAR2(2)\n , LAST_UPDT_DT DATE default SYSDATE\n \n , CONSTRAINT KRIM_ENT_NM_TYP_TC0 UNIQUE (OBJ_ID)\n , CONSTRAINT KRIM_ENT_NM_TYP_TC1 UNIQUE (NM)\n\n)\n/\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>\nvoid SimpleSpecies::setName(string name){\n\tthis->name = name;\n}\n\nvoid SimpleSpecies::setPopulation(double newPopulation){\n\tthis->population = newPopulation;\n}\n\nvoid SimpleSpecies::changePopulation(double deltaPopulation){\n\tthis->population += deltaPopulation;\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>n=str(input())\n\nif n[-1]==3:\n print('bon')\nelif n[-1]==0 or n[-1]==1 or n[-1]==6 or n[-1]==8:\n print('pon')\nelse:\n print('hon')</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>import java.util.*;\nimport java.math.*;\n\npublic class Main {\n public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n int A = sc.nextInt();\n int B = sc.nextInt();\n int C = sc.nextInt();\n sc.close();\n \n Set<Integer> set = new HashSet<>();\n set.add(A);\n set.add(B);\n set.add(C);\n System.out.println(set.size() == 2 ? \"Yes\" : \"No\");\n }\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package com.example.ebapigateway;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.springframework.boot.test.context.SpringBootTest;\nimport org.springframework.test.context.junit4.SpringRunner;\n\n@RunWith(SpringRunner.class)\n@SpringBootTest\npublic class EbApiGatewayApplicationTests {\n\n\t@Test\n\tpublic void contextLoads() {\n\t}\n\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_SML_> next (! (prev b)) := Null\n );\n next f := b;\n prev b := f\n )\n \n fun insertFront (f, b) x =\n let\n val curr = ! (next f)\n val new = Node (x, ref f, ref curr)\n in\n next f := new;\n prev curr := new\n end\n\n fun insertBack (f, b) x =\n let\n val curr = ! (prev b)\n val new = Node (x, ref curr, ref b)\n in\n prev b := new;\n next curr := new\n end\n\n exception Empty\n\n fun front (f, b) =\n (case !(next f) of\n End _ => raise Empty\n | Null => raise (Fail \"invariant\")\n | Node (x, _, _) => x)\n\n fun back (f, b) =\n (case !(prev b) of\n End _ => raise Empty\n | Null => raise (Fail \"invariant\")\n | Node (x, _, _) => x)\n\n fun removeFront (f, b) =\n (case !(next f) of\n End _ => raise Empty\n | Null => raise (Fail \"invariant\")\n | Node (x, bwd, fwd) =>\n (\n next f := !fwd;\n prev (!fwd) := f;\n bwd := Null;\n fwd := Null;\n x\n ))\n\n fun removeBack (f, b) =\n (case !(prev b) of\n End _ => raise Empty\n | Null => raise (Fail \"invariant\")\n | Node (x, bwd, fwd) =>\n (\n prev b := !bwd;\n next (!bwd) := b;\n bwd := Null;\n fwd := Null;\n x\n ))\n\n\n fun doDelete bwd fwd () =\n (\n next (!bwd) := !fwd;\n prev (!fwd) := !bwd;\n bwd := Null;\n fwd := Null\n )\n\n fun doOrphan bwd fwd () =\n (case !bwd of\n Null => true\n | _ => (case !fwd of\n Null => true\n | _ => false))\n\n fun insertFrontNode (f, b) x =\n let\n val curr = ! (next f)\n val bwd = ref f\n val fwd = ref curr\n val new = Node (x, bwd, fwd)\n in\n next f := new;\n prev curr := new;\n (doDelete bwd fwd, doOrphan bwd fwd)\n end\n\n fun insertBackNode (f, b) x =\n let\n val curr = ! (prev b)\n val bwd = ref curr\n val fwd = ref b\n val new = Node (x, bwd, fwd)\n in\n prev b := new;\n next curr := new;\n (doDelete bwd fwd, doOrphan bwd fwd)\n end\n\n fun delete (f, _) = f ()\n\n fun orphan (_, f) = f ()\n\n val dummy = ((fn () => raise Orphan), (fn () => true))\n\n end\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>var GET = (function () {function f(s) {return new g(s);}function g(s) {this._s = s.trim().split(\"\\n\");}g.prototype.getValue = function (n) {return this._s[n];};g.prototype.getArray = function (n) {return this.stoa(this._s[n]);};g.prototype.slice = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stox(v));};g.prototype.sliceArray = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stoa(v));};g.prototype.stoa = function (s) {return s.split(\" \").map(v => this.stox(v));};g.prototype.stox = function (v) {var i = +v;return (i === i) ? i : v;};return f;})();\nvar o = GET(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var N = o.getValue(0);\n var Bs = o.getArray(1);\n\n var As = [Bs[0]];\n for(var i = 0; N - 2 > i; i++) {\n As.push(Math.min(Bs[i], Bs[i + 1]))\n }\n\n As.push(Bs[N - 2]);\n return As.reduce((a, c) => {\n return a + c;\n }, 0)\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>/**\n * netzhaut - Web Browser Engine\n * Copyright (C) 2021 The netzhaut Authors\n * Published under MIT\n */\n\n#include \"../../UI/Message.h\"\n#include \"../Result.h\"\n\n#undef NH_MAKE_CHECK\n#define NH_MAKE_CHECK(checkReturn, checkable) \\\n{ \\\n NH_MAKE_RESULT checkResult = checkable; \\\n if (checkResult != NH_MAKE_SUCCESS) { \\\n nh_make_messagef(\"-> \\e[1;31mERROR\\e[0m %s\", NH_MAKE_RESULTS_PP[checkResult]); \\\n return checkReturn; \\\n } \\\n}\n\n#undef NH_MAKE_CHECK_NULL\n#define NH_MAKE_CHECK_NULL(checkReturn, checkable) \\\n{ \\\n void *checkResult_p = checkable; \\\n if (checkResult_p == NULL) { \\\n nh_make_messagef(\"-> \\e[1;31mERROR\\e[0m %s\", NH_MAKE_RESULTS_PP[NH_MAKE_ERROR_NULL_POINTER]); \\\n return checkReturn; \\\n } \\\n}\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>n,k,q=map(int,input().split());a={i+1:k for i in range(n)}\nfor _ in range(q):\n m=int(input())\n for i in range(1,n+1):\n if i==m: continue\n a[i]-=1\nprint(*['Yes' if a[i]>0 else 'No' for i in range(1,n+1)],sep='\\n')</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>#include <signal.h>\n\nint sigandset(sigset_t *dest, const sigset_t *left, const sigset_t *right)\n{\n\tunsigned long i = 0, *d = (void*) dest, *l = (void*) left, *r = (void*) right;\n\tfor(; i < _SIGSET_SIZE; i++) d[i] = l[i] & r[i];\n\treturn 0;\n}\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>function toggleSection(sectionId) {\n const toggle = document.getElementById(sectionId).querySelector(\".toggle-section\");\n const upArrow = document.getElementById(sectionId).querySelector(\"#up-arrow\");\n const downArrow = document.getElementById(sectionId).querySelector(\"#down-arrow\");\n console.log(toggle.style.display);\n if ((toggle.style.display === \"none\") | (toggle.style.display === \"\")) {\n toggle.style.display = \"block\";\n upArrow.style.display = \"inline\";\n downArrow.style.display = \"none\";\n } else {\n toggle.style.display = \"none\";\n upArrow.style.display = \"none\";\n downArrow.style.display = \"inline\";\n }\n}\n\nfunction copyURL() {\n const url = window.location.href;\n const input = document.createElement(\"input\");\n document.body.appendChild(input);\n input.value = url;\n input.select();\n document.execCommand(\"copy\", false);\n input.remove();\n // change button text, wait 5 seconds and then change back\n const button = document.getElementById(\"copy-link-button\");\n button.textContent = \"Copied!\";\n setTimeout(function () {\n button.textContent = \"Share link\";\n }, 4000);\n}\n\n// Twitter SDK\nwindow.twttr = (function (d, s, id) {\n var js,\n fjs = d.getElementsByTagName(s)[0],\n t = window.twttr || {};\n if (d.getElementById(id)) return t;\n js = d.createElement(s);\n js.id = id;\n js.src = \"https://platform.twitter.com/widgets.js\";\n fjs.parentNode.insertBefore(js, fjs);\n\n t._e = [];\n t.ready = function (f) {\n t._e.push(f);\n };\n\n return t;\n})(document, \"script\", \"twitter-wjs\");\n\n// Facebook SDK\n(function (d, s, id) {\n var js,\n fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s);\n js.id = id;\n js.src = \"https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0\";\n fjs.parentNode.insertBefore(js, fjs);\n})(document, \"script\", \"facebook-jssdk\");\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>/**\r\n * Copyright (c) 2018, hiwepy (https://github.com/hiwepy).\r\n *\r\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n * use this file except in compliance with the License. You may obtain a copy of\r\n * the License at\r\n *\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n * License for the specific language governing permissions and limitations under\r\n * the License.\r\n */\r\npackage com.github.hiwepy.calibre.invoker.command;\r\n\r\nimport java.io.File;\r\nimport java.io.IOException;\r\n\r\nimport org.codehaus.plexus.util.Os;\r\nimport org.codehaus.plexus.util.cli.Commandline;\r\n\r\nimport com.github.hiwepy.calibre.invoker.exception.CommandLineConfigurationException;\r\nimport com.github.hiwepy.calibre.invoker.request.InvocationRequest;\r\nimport com.github.hiwepy.calibre.invoker.request.Lrs2lrfInvocationRequest;\r\n\r\n/**\r\n * Compile an LRS file into an LRF file.\r\n */\r\npublic class Lrs2lrfCommandLineBuilder extends AbstractCommandLineBuilder {\r\n\r\n\t@Override\r\n\tprotected void doCommandInternal(InvocationRequest request, Commandline cli)\r\n\t\t\tthrows CommandLineConfigurationException {\r\n\t\t\r\n\t\tif(request instanceof Lrs2lrfInvocationRequest) {\r\n\r\n\t\t\tLrs2lrfInvocationRequest lrs2lrfRequest = ( Lrs2lrfInvocationRequest) request;\r\n\t\t\t\r\n\t\t\tsetLrs(lrs2lrfRequest, cli);\r\n\t\t\tsetOutputDirectory(lrs2lrfRequest, cli);\r\n\t\t\t// LRS file path. file.lrs\r\n\t\t\tcli.createArg().setValue(lrs2lrfRequest.getLrsFile().getAbsolutePath());\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}\r\n\r\n\t@Override\r\n\tprotected File findCalibreExecutable() throws CommandLineConfigurationException, IOException {\r\n\t\t\r\n\t\tif (calibreHome == null) {\r\n\t\t\tfindCalibreHome();\r\n\t\t}\r\n\r\n\t\tlogger.debug(\"Using ${calibre.home} of: \\'\" + calibreHome + \"\\'.\");\r\n\r\n\t\tif (calibreExecutable == null || !calibreExecutable.isAbsolute()) {\r\n\t\t\tString executable;\r\n\t\t\tif (calibreExecutable != null) {\r\n\t\t\t\texecutable = calibreExecutable.getPath();\r\n\t\t\t} else if (Os.isFamily(\"windows\")) {\r\n\t\t\t\texecutable = \"lrs2lrf.exe\";\r\n\t\t\t} else {\r\n\t\t\t\texecutable = \"lrs2lrf\";\r\n\t\t\t}\r\n\r\n\t\t\tcalibreExecutable = new File(calibreHome, executable);\r\n\r\n\t\t\ttry {\r\n\t\t\t\tFile canonicalMvn = calibreExecutable.getCanonicalFile();\r\n\t\t\t\tcalibreExecutable = canonicalMvn;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tlogger.debug(\"Failed to canonicalize maven executable: \" + calibreExecutable + \". Using as-is.\", e);\r\n\t\t\t}\r\n\r\n\t\t\tif (!calibreExecutable.isFile()) {\r\n\t\t\t\tthrow new CommandLineConfigurationException(\"Calibre executable not found at: \" + calibreExecutable);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn calibreExecutable;\r\n\t}\r\n\t\r\n\tprotected void setLrs(Lrs2lrfInvocationRequest request, Commandline cli) {\r\n\t\tif(request.isLrs()) {\r\n\t\t\tcli.createArg().setValue(\"--lrs\");\r\n\t\t}\r\n\t}\r\n\r\n\tprotected void setOutputDirectory(Lrs2lrfInvocationRequest request, Commandline cli) {\r\n\t\t\r\n\t\tFile outputDirectory = request.getOutputDirectory();\r\n\t\tif (outputDirectory != null) {\r\n\t\t\ttry {\r\n\t\t\t\tFile canSet = outputDirectory.getCanonicalFile();\r\n\t\t\t\toutputDirectory = canSet;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tlogger.debug(\"Failed to canonicalize output path: \" + outputDirectory.getAbsolutePath() + \".\", e);\r\n\t\t\t}\r\n\r\n\t\t\tcli.createArg().setValue(\"-o\");\r\n\t\t\tcli.createArg().setValue(outputDirectory.getPath());\r\n\t\t}\r\n \r\n\t}\r\n\r\n\t\r\n\t \r\n\t\r\n\r\n}\r\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>'use strict';\n\nvar path = require('path');\nvar conf = require('./gulp/conf');\n\nvar _ = require('lodash');\nvar wiredep = require('wiredep');\n\nvar pathSrcHtml = [\n path.join(conf.paths.src, '/**/*.html')\n];\n\nfunction listFiles() {\n var wiredepOptions = _.extend({}, conf.wiredep, {\n dependencies: true,\n devDependencies: true\n });\n\n var patterns = wiredep(wiredepOptions).js\n .concat([\n path.join(conf.paths.src, '/app/**/*.module.js'),\n path.join(conf.paths.src, '/app/**/*.js'),\n path.join(conf.paths.src, '/**/*.spec.js'),\n path.join(conf.paths.src, '/**/*.mock.js'),\n ])\n .concat(pathSrcHtml);\n\n var files = patterns.map(function(pattern) {\n return {\n pattern: pattern\n };\n });\n files.push({\n pattern: path.join(conf.paths.src, '/assets/**/*'),\n included: false,\n served: true,\n watched: false\n });\n return files;\n}\n\nmodule.exports = function(config) {\n\n var configuration = {\n files: listFiles(),\n\n singleRun: true,\n\n autoWatch: false,\n\n ngHtml2JsPreprocessor: {\n stripPrefix: conf.paths.src + '/',\n moduleName: 'portfolio'\n },\n\n logLevel: 'WARN',\n\n frameworks: ['jasmine', 'angular-filesort'],\n\n angularFilesort: {\n whitelist: [path.join(conf.paths.src, '/**/!(*.html|*.spec|*.mock).js')]\n },\n\n browsers : ['PhantomJS'],\n\n plugins : [\n 'karma-phantomjs-launcher',\n 'karma-angular-filesort',\n 'karma-coverage',\n 'karma-jasmine',\n 'karma-ng-html2js-preprocessor'\n ],\n\n coverageReporter: {\n type : 'html',\n dir : 'coverage/'\n },\n\n reporters: ['progress'],\n\n proxies: {\n '/assets/': path.join('/base/', conf.paths.src, '/assets/')</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>// Copyright (c) 2018, The Monero Project\n//\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without modification, are\n// permitted provided that the following conditions 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//\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\n// materials provided with the distribution.\n//\n// 3. Neither the name of the copyright holder nor the names of its contributors may be\n// 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 OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL\n// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n#include <string.h>\n#include \"net/buffer.h\"\n\n#undef WALLSTREETBETS_DEFAULT_LOG_CATEGORY\n#define WALLSTREETBETS_DEFAULT_LOG_CATEGORY \"net.buffer\"\n\nnamespace epee\n{\nnamespace net_utils\n{\n\nvoid buffer::append(const void *data, size_t sz)\n{\n const size_t capacity = storage.capacity();\n const size_t avail = capacity - storage.size();\n\n CHECK_AND_ASSERT_THROW_MES(storage.size() < std::numeric_limits<size_t>::max() - sz, \"Too much data to append\");\n\n // decide when to move\n if (sz > avail)\n {\n // we have to reallocate or move\n const bool move = size() + sz <= capacity;\n if (move)\n {\n const size_t bytes = storage.size() - offset;\n NET_BUFFER_LOG(\"appending \" << sz << \" from \" << size() << \" by moving \" << bytes << \" from offset \" << offset << \" first (forced)\");\n memmove(storage.data(), storage.data() + offset, bytes);\n storage.resize(bytes);\n offset = 0;\n }\n else\n {\n NET_BUFFER_LOG(\"appending \" << sz << \" from \" << size() << \" by reallocating\");\n std::vector<uint8_t> new_storage;\n size_t reserve = (((size() + sz) * 3 / 2) + 4095) & ~4095;\n new_storage.reserve(reserve);\n new_storage.resize(size());\n memcpy(new_storage.data(), storage.data() + offset, storage.size() - offset);\n offset = 0;\n std::swap(storage, new_storage);\n }\n }\n else\n {\n // we have space already\n if (size() <= 4096 && offset > 4096 * 16 && offset >= capacity / 2)\n {\n // we have little to move, and we're far enough into the buffer that it's probably a win to move anyway\n const size_t pos = storage.size() - offset;\n NET_BUFFER_LOG(\"appending \" << sz << \" from \" << size() << \" by moving \" << pos << \" from offset \" << offset << \" first (unforced)\");\n memmove(storage.data(), storage.data() + offset, storage.size() - offset);\n storage.resize(pos);\n offset = 0;\n }\n else\n {\n NET_BUFFER_LOG(\"appending \" << sz << \" from \" << size() << \" by writing to existing capacity\");\n }\n }\n\n // add the new data\n storage.insert(storage.end(), (const uint8_t*)data, (const uint8_t*)data + sz);\n\n NET_BUFFER_LOG(\"storage now \" << offset << \"/\" << storage.size() << \"/\" << storage.capacity());\n}\n\n}\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>r, g, b = input().split()\nprint('YES' if int(r + g + b) % 4 == 0 else 'NO')</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_YAML_>name: LoT - Lot of Things\ndescription: Organize and search things via custom properties.\nwebsite: https://jisco.me/lot\ncategory: Utilities\nrepository: https://github.com/Jisco/LotOfThings\nkeywords:\n - things\n - organize\n - search\n - find\n - custom\n - stuff\n - manage\n - reminder\nscreenshots:\n - imageUrl: 'https://downloads.jisco.me/lot/images/themes.png'\n caption: 'Two different themes are available.'\n - imageUrl: 'https://downloads.jisco.me/lot/images/customResults.png'\n caption:\n 'Decide for yourself which properties should be displayed in the search\n results.'\n - imageUrl: 'https://downloads.jisco.me/lot/images/multipleFields.png'\n caption:\n 'Create individual fields with multiple settings for each thing or share\n one or more fields via tags.'\n - imageUrl: 'https://downloads.jisco.me/lot/images/fieldTypes.png'\n caption:\n 'Many different field types in order to be able to depict very different\n properties of things.'\n - imageUrl: 'https://downloads.jisco.me/lot/images/fieldTypeSettings.png'\n caption:\n 'Each field type offers different settings. Many of these properties can\n be included or excluded in the search.'\n - imageUrl: 'https://downloads.jisco.me/lot/images/tags.png'\n caption:\n 'If several properties occur repeatedly in things, it is possible to\n summarize these properites withing tags.'\n - imageUrl: 'https://downloads.jisco.me/lot/images/remindMe.png'\n caption:\n 'An individual reminder can be set for each field. Let yourself be\n reminded!'\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import plotly.graph_objects as go\n\n\ndef plotly_interactive_paths(turn_points: dict,\n central_port: tuple,\n knot: tuple = None,\n title: str = 'Wire paths',\n central_port_size: int = 10\n ):\n fig = go.Figure()\n\n # Plot the wire paths\n for wire_id in turn_points.keys():\n path = turn_points[wire_id]\n\n fig.add_trace(\n go.Scatter(\n x=path['x'],\n y=path['y'],\n name=wire_id,))\n\n fig.update_layout(\n title=title,\n xaxis_title='X',\n yaxis_title='Y',\n )\n\n # Add the central port\n fig.add_trace(\n go.Scatter(\n mode='markers',\n x=[central_port[0]],\n y=[central_port[0]],\n marker=dict(size=central_port_size),\n showlegend=False\n )\n )\n\n # Add extra point if required\n if knot is not None:\n fig.add_trace(\n go.Scatter(\n mode='markers',\n x=[knot[0]],\n y=[knot[1]],\n marker=dict(size=central_port_size),\n name='Closest knot'\n )\n )\n\n return fig\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Perl_><NO YES>[words.sum==15].say</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>a = set(map(int,input()))\nprint(len(a))</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Go_>package ax25\n\nimport (\n\t\"fmt\"\n)\n\ntype Address struct {\n\tCallsign string\n\tSSID int // Secondary Station ID\n}\n\nfunc (a Address) String() string {\n\treturn fmt.Sprintf(\"%s-%d\", a.Callsign, a.SSID)\n}\n\ntype Frame struct {\n\tSource Address\n\tDestination Address\n\tRepeaters []Address\n\tV1 bool\n\tCommand bool // command=true, response=false\n\tType FrameType\n\tSendSeq, RecvSeq int\n\tPollFinal bool // P/F of 1 is true, 0 is false\n\tUnnumberedType UnnumberedType\n\tSupervisoryType SupervisoryType\n\tPID PID // Protocol Identifier\n\tInfo []byte\n}\n\ntype AX25 struct {\n\tbitstream byte\n\tinFrame bool\n\trxBitI int\n\trxBits byte\n\trxBuf []byte\n\tmaxBufferSize int\n}\n\nfunc NewDecoder() *AX25 {\n\treturn &AX25{\n\t\trxBuf: make([]byte, 0, 512),\n\t\tmaxBufferSize: 512,\n\t}\n}\n\nfunc parseAddress(buf []byte) Address {\n\ti := 0\n\tfor ; i < 6; i++ {\n\t\tbuf[i] >>= 1\n\t\tif buf[i] == 0x20 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn Address{Callsign: string(buf[:i]), SSID: int((buf[6] >> 1) & 0xf)}\n}\n\nfunc (ax *AX25) processFrame() *Frame {\n\tif len(ax.rxBuf) < 10 {\n\t\treturn nil\n\t}\n\n\tif !checkCrcCcitt(ax.rxBuf) {\n\t\treturn nil\n\t}\n\n\tbuf := ax.rxBuf[:len(ax.rxBuf)-2]\n\n\t// for i, b := range buf {\n\t// \tfmt.Printf(\"%d %08b\\n\", i, b)\n\t// }\n\n\tframe := Frame{\n\t\tV1: true,\n\t\tCommand: false, // command (true) or response (false)\n\t}\n\n\tif buf[1]&1 > 0 {\n\t\t// FlexNet Header Compression\n\t\tframe.V1 = false\n\t\tframe.Command = (buf[1] & 2) != 0\n\t\tvar dest []byte\n\t\tif i := (buf[2] >> 2) & 0x2f; i != 0 {\n\t\t\tdest = append(dest, i+0x20)\n\t\t}\n\t\tif i := (buf[2] << 4) | ((buf[3]>>4)&0xf)&0x3f; i != 0 {\n\t\t\tdest = append(dest, i+0x20)\n\t\t}\n\t\tif i := (buf[3] << 2) | ((buf[4]>>6)&3)&0x3f; i != 0 {\n\t\t\tdest = append(dest, i+0x20)\n\t\t}\n\t\tif i := buf[4] & 0x3f; i != 0 {\n\t\t\tdest = append(dest, i+0x20)\n\t\t}\n\t\tif i := (buf[5] >> 2) & 0x3f; i != 0 {\n\t\t\tdest = append(dest, i+0x20)\n\t\t}\n\t\tif i := ((buf[5] << 4) | ((buf[6] >> 4) & 0xf)) & 0x3f; i != 0 {\n\t\t\tdest = append(dest, i+0x20)\n\t\t}\n\t\tif dest != nil {\n\t\t\tframe.Destination = Address{\n\t\t\t\tCallsign: string(dest),\n\t\t\t\tSSID: int(buf[6] & 0xf),\n\t\t\t}\n\t\t}\n\t\t// TODO\n\t\t// fmt.Printf(\"%s QSO Nr %u\", frame.Destination, (buf[0]<<6)|(buf[1]>>2))\n\t\tbuf = buf[7:]\n\t} else {\n\t\t// Normal Header\n\t\tif len(buf) < 15 {\n\t\t\treturn nil\n\t\t}\n\n\t\t// 6.1.2. Command/Response Procedure\n\t\t// dest SSID high bit : buf[6]&0x80 -> C bit of AX.25 frame\n\t\t// src SSID high bit : buf[13]&0x80 -> C bit of LA PA frame\n\t\tif buf[6]&0x80 != buf[13]&0x80 {\n\t\t\tframe.V1 = false\n\t\t\tframe.Command = int(ax.rxBuf[6]&0x80) != 0\n\t\t}\n\n\t\tframe.Destination = parseAddress(buf[:7])\n\t\tframe.Source = parseAddress(buf[7:14])\n\n\t\to := 14\n\t\tfor ; buf[o-1]&1 == 0 && len(buf)-o > 7; o += 7 {\n\t\t\tframe.Repeaters = append(frame.Repeaters, parseAddress(buf[o:]))\n\t\t}\n\t\tbuf = buf[o:]\n\t}\n\n\tif len(buf) == 0 {\n\t\treturn &frame\n\t}\n\n\t// 4.2 Control-Field\n\n\tcontrolField := buf[0]\n\tbuf = buf[1:]\n\n\t// 4.2.1 & 6.2 Poll/Final bit\n\tframe.PollFinal = controlField&0x10 != 0\n\n\tif controlField&1 == 0 {\n\t\t// Info frame\n\t\tframe.Type = IFrame\n\t\t// 0 : 0\n\t\t// 1-3: N(S)\n\t\t// 4 : P\n\t\t// 5-7: N(R)\n\t\tframe.SendSeq = int((controlField >> 1) & 7)\n\t\tframe.RecvSeq = int((controlField >> 5) & 7)\n\t} else if controlField&2 != 0 {\n\t\t// Unnumbered frame\n\t\tframe.Type = UFrame\n\t\t// 4.3.3 Unnumbered Frame Control Fields\n\t\tframe.UnnumberedType = UnnumberedType(controlField & ^byte(0x10))\n\t} else {\n\t\t// Supervisory frame\n\t\tframe.Type = SFrame\n\t\tframe.SupervisoryType = SupervisoryType(controlField & 0x0f)\n\t\tframe.RecvSeq = int((controlField >> 5) & 7)\n\t}\n\tif len(buf) == 0 {\n\t\treturn &frame\n\t}\n\n\tif frame.Type == IFrame || (frame.Type == UFrame && frame.UnnumberedType == UI) {\n\t\tframe.PID = PID(buf[0])\n\t\tframe.Info = buf[1:]\n\t}\n\treturn &frame\n}\n\n// Return a frame when a full one has been received. Otherwise return nil.\nfunc (ax *AX25) Feed(bit int) *Frame {\n\tax.bitstream <<= 1\n\tax.bitstream |= byte(bit)\n\t// Watch for flag\n\tif ax.bitstream&0xff == 0x7e {\n\t\tvar frame *Frame\n\t\tif ax.inFrame && len(ax.rxBuf) > 2 {\n\t\t\tframe = ax.processFrame()\n\t\t}\n\t\tax.inFrame = true\n\t\tax.rxBuf = ax.rxBuf[:0]\n\t\tax.rxBits = 0\n\t\tax.rxBitI = 0\n\t\treturn frame\n\t}\n\t// Frame abort</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>'use strict'\n\nfunction main(s) {\n\n s = s.split('\\n')[0].split(' ').map(n => Number(n));\n\n const w = s[0];\n const a = s[1];\n const b = s[2];\n\n let ans = 0;\n\n if ((b + w) < a) ans = a - (b + w);\n if (b > (a + w)) ans = b - (a + w);\n\n console.log(ans);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>N, M = map(int, input().split())\nnodes = [[] for i in range(N)]\n\nfor i in range(M):\n u, v = map(int, input().split())\n u -= 1\n v -= 1\n nodes[u].append(v)\n\ns, t = map(int, input().split())\ns -= 1\nt -= 1\n\nnum = s\nstep = 0\nq = [[num, step]]\ncheck = [[False for i in range(N)] for j in range(3)]\nok = False\nwhile len(q) > 0:\n num, step = q.pop(0)\n tmp = step % 3\n if check[tmp][num]:\n continue\n if tmp == 0 and num == t:\n print(step//3)\n ok = True\n break\n for next in nodes[num]:\n check[tmp][num] = True\n q.append([next, step+1])\nif not ok:\n print(-1)\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Go_>package sizing\n\nimport (\n\t\"testing\"\n\n\t\"github.com/bivas/rivi/pkg/mocks\"\n\t\"github.com/bivas/rivi/pkg/util/log\"\n\t\"github.com/bivas/rivi/pkg/util/state\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc buildRule(name, label string, changedFiles int) *sizingRule {\n\tresult := &sizingRule{Name: name, Label: label, ChangedFilesThreshold: changedFiles, Comment: name}\n\tresult.Defaults()\n\treturn result\n}\n\nfunc buildRules(withDefault bool) *action {\n\tresult := &action{items: rules{</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C#_>using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace ConsoleApplication9\n{\n class Program\n {\n static void Main(string[] args)\n {\n String[] str = Console.ReadLine().Split(' ');\n int a = int.Parse(str[0]);\n int b = int.Parse(str[1]);\n int c = int.Parse(str[2]);\n if (a < b && b < c)\n {\n Console.WriteLine(\"Yes\");\n }\n else\n {\n Console.WriteLine(\"No\");\n }\n\n \n \n \n\n }\n }\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_YAML_>build:\n languages:\n - go\n\nrun:\nweb: go-trophy\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>a,b = map(int,input().split())\nlis = []\nfor i in range(50):\n\tg = []\n\tfor m in range(100):\n\t\tg.append(\".\")\n\tlis.append(g)\nfor i in range(50):\n\tg = []\n\tfor m in range(100):\n\t\tg.append(\"#\")\n\tlis.append(g)\ncou = 0\nco = 0\nfor k in range(a-1):\n\tlis[cou][co] = \"#\"\n\tco += 2\n\tif co >= 100:\n\t\tco = 0\n\t\tcou += 2\ncou = 51\nco = 0\nfor h in range(b-1):\n\tlis[cou][co] = \".\"\n\tco += 2\n\tif co >= 100:\n\t\tco = 0\n\t\tcou += 2\nfor m in range(100):\n\tprint(\"\".join(lis[m]))</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_> 'crashpad_client_win_test.cc',\n 'prune_crash_reports_test.cc',\n 'settings_test.cc',\n 'simple_address_range_bag_test.cc',\n 'simple_string_dictionary_test.cc',\n 'simulate_crash_mac_test.cc',\n ],\n },\n ],\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>n = int(input())\na_ar = list(map(int, input().split()))\ntotal = 0\nseven = (10 ** 9)+ 7\na_ar = list(map(lambda x: x % seven, a_ar))\nfor i in range(len(a_ar) - 1):\n for j in range(i+1, len(a_ar)):\n ans = a_ar[i] * a_ar[j]\n total += ans\nprint(total % seven)\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_> return (Criteria) this;\n }\n\n public Criteria andVipCountNotBetween(Integer value1, Integer value2) {\n addCriterion(\"vip_count not between\", value1, value2, \"vipCount\");\n return (Criteria) this;\n }\n\n public Criteria andDiscountIsNull() {\n addCriterion(\"discount is null\");\n return (Criteria) this;\n }\n\n public Criteria andDiscountIsNotNull() {\n addCriterion(\"discount is not null\");\n return (Criteria) this;\n }\n\n public Criteria andDiscountEqualTo(String value) {\n addCriterion(\"discount =\", value, \"discount\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andDiscountEqualToColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"discount = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andDiscountNotEqualTo(String value) {\n addCriterion(\"discount <>\", value, \"discount\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andDiscountNotEqualToColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"discount <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andDiscountGreaterThan(String value) {\n addCriterion(\"discount >\", value, \"discount\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andDiscountGreaterThanColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"discount > \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andDiscountGreaterThanOrEqualTo(String value) {\n addCriterion(\"discount >=\", value, \"discount\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andDiscountGreaterThanOrEqualToColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"discount >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andDiscountLessThan(String value) {\n addCriterion(\"discount <\", value, \"discount\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andDiscountLessThanColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"discount < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andDiscountLessThanOrEqualTo(String value) {\n addCriterion(\"discount <=\", value, \"discount\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andDiscountLessThanOrEqualToColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"discount <= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andDiscountLike(String value) {\n addCriterion(\"discount like\", value, \"discount\");\n return (Criteria) this;\n }\n\n public Criteria andDiscountNotLike(String value) {\n addCriterion(\"discount not like\", value, \"discount\");\n return (Criteria) this;\n }\n\n public Criteria andDiscountIn(List<String> values) {\n addCriterion(\"discount in\", values, \"discount\");\n return (Criteria) this;\n }\n\n public Criteria andDiscountNotIn(List<String> values) {\n addCriterion(\"discount not in\", values, \"discount\");\n return (Criteria) this;\n }\n\n public Criteria andDiscountBetween(String value1, String value2) {\n addCriterion(\"discount between\", value1, value2, \"discount\");\n return (Criteria) this;\n }\n\n public Criteria andDiscountNotBetween(String value1, String value2) {\n addCriterion(\"discount not between\", value1, value2, \"discount\");\n return (Criteria) this;\n }\n\n public Criteria andRatioIsNull() {\n addCriterion(\"ratio is null\");\n return (Criteria) this;\n }\n\n public Criteria andRatioIsNotNull() {\n addCriterion(\"ratio is not null\");\n return (Criteria) this;\n }\n\n public Criteria andRatioEqualTo(String value) {\n addCriterion(\"ratio =\", value, \"ratio\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andRatioEqualToColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"ratio = \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andRatioNotEqualTo(String value) {\n addCriterion(\"ratio <>\", value, \"ratio\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andRatioNotEqualToColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"ratio <> \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andRatioGreaterThan(String value) {\n addCriterion(\"ratio >\", value, \"ratio\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andRatioGreaterThanColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"ratio > \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andRatioGreaterThanOrEqualTo(String value) {\n addCriterion(\"ratio >=\", value, \"ratio\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andRatioGreaterThanOrEqualToColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"ratio >= \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andRatioLessThan(String value) {\n addCriterion(\"ratio <\", value, \"ratio\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andRatioLessThanColumn(LitemallViplevel.Column column) {\n addCriterion(new StringBuilder(\"ratio < \").append(column.getEscapedColumnName()).toString());\n return (Criteria) this;\n }\n\n public Criteria andRatioLessThanOrEqualTo(String value) {\n addCriterion(\"ratio <=\", value, \"ratio\");\n return (Criteria) this;\n }\n\n /**\n * This method was generated by MyBatis Generator.\n * This method corresponds to the database table litemall_viplevel\n *\n * @mbg.generated\n * @project https://github.com/itfsw/mybatis-generator-plugin\n */\n public Criteria andRatioLessThanOrEqualToColumn(LitemallViplevel.Column column) {</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_TypeScript_> * Do not edit the class manually.\n *\n * Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.\n * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.\n */\n\nimport * as model from \"../model\";\nimport common = require(\"oci-common\");\n\nexport interface UpdateVolumeKmsKeyDetails {\n /**\n * The OCID of the new Key Management key to assign to protect the specified volume.\n * This key has to be a valid Key Management key, and policies must exist to allow the user and the Block Volume service to access this key.\n * If you specify the same OCID as the previous key's OCID, the Block Volume service will use it to regenerate a volume encryption key.\n *\n */\n \"kmsKeyId\"?: string;\n}\n\nexport namespace UpdateVolumeKmsKeyDetails {\n export function getJsonObj(obj: UpdateVolumeKmsKeyDetails): object {\n const jsonObj = { ...obj, ...{} };\n\n return jsonObj;\n }\n export function getDeserializedJsonObj(obj: UpdateVolumeKmsKeyDetails): object {\n const jsonObj = { ...obj, ...{} };\n\n return jsonObj;\n }\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>n,m = map(int,input().split())\ndp = [0]*n\n\nfor i in range(m):\n dp[int(input())-1] = 10**12\n \nif dp[0] == 10**12:\n dp[0] = 0\nelse:\n dp[0] = 1\n\nif dp[1] == 10**12:\n dp[1] = 0\nelse:\n dp[1] = 1+ dp[0]\n\nmod = 1000000007\n\nfor i in range(2,n):\n if dp[i] == 10**12:\n dp[i] = 0\n else:\n dp[i] = dp[i-1] + dp[i-2]\n dp[i] %= mod\nprint(dp[-1])</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n==============================================================================*/\n#include \"absl/memory/memory.h\"\n#include \"tensorflow/core/profiler/backends/gpu/cupti_error_manager.h\"\n#include \"tensorflow/core/profiler/backends/gpu/cupti_interface.h\"\n#include \"tensorflow/core/profiler/backends/gpu/cupti_wrapper.h\"\n\nnamespace tensorflow {\nnamespace profiler {\n\nCuptiInterface* GetCuptiInterface() {\n static CuptiInterface* cupti_interface =\n new CuptiErrorManager(absl::make_unique<CuptiWrapper>());\n return cupti_interface;\n}\n\n} // namespace profiler\n} // namespace tensorflow\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Cython_>)\n\n# Single precision\ncdef int ssmoothed_estimators_measurement_alternative(sKalmanSmoother smoother, sKalmanFilter kfilter, sStatespace model) except *\ncdef int ssmoothed_estimators_time_alternative(sKalmanSmoother smoother, sKalmanFilter kfilter, sStatespace model)\ncdef int ssmoothed_state_alternative(sKalmanSmoother smoother, sKalmanFilter kfilter, sStatespace model)\ncdef int ssmoothed_disturbances_alternative(sKalmanSmoother smoother, sKalmanFilter kfilter, sStatespace model)\n\n# Double precision\ncdef int dsmoothed_estimators_measurement_alternative(dKalmanSmoother smoother, dKalmanFilter kfilter, dStatespace model) except *\ncdef int dsmoothed_estimators_time_alternative(dKalmanSmoother smoother, dKalmanFilter kfilter, dStatespace model)\ncdef int dsmoothed_state_alternative(dKalmanSmoother smoother, dKalmanFilter kfilter, dStatespace model)\ncdef int dsmoothed_disturbances_alternative(dKalmanSmoother smoother, dKalmanFilter kfilter, dStatespace model)\n\n# Single precision complex\ncdef int csmoothed_estimators_measurement_alternative(cKalmanSmoother smoother, cKalmanFilter kfilter, cStatespace model) except *\ncdef int csmoothed_estimators_time_alternative(cKalmanSmoother smoother, cKalmanFilter kfilter, cStatespace model)\ncdef int csmoothed_state_alternative(cKalmanSmoother smoother, cKalmanFilter kfilter, cStatespace model)\ncdef int csmoothed_disturbances_alternative(cKalmanSmoother smoother, cKalmanFilter kfilter, cStatespace model)\n\n# Double precision complex\ncdef int zsmoothed_estimators_measurement_alternative(zKalmanSmoother smoother, zKalmanFilter kfilter, zStatespace model) except *\ncdef int zsmoothed_estimators_time_alternative(zKalmanSmoother smoother, zKalmanFilter kfilter, zStatespace model)\ncdef int zsmoothed_state_alternative(zKalmanSmoother smoother, zKalmanFilter kfilter, zStatespace model)\ncdef int zsmoothed_disturbances_alternative(zKalmanSmoother smoother, zKalmanFilter kfilter, zStatespace model)\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_CSS_>@font-face {\r\n font-family: 'BebasNeueRegular';\r\n \r\n src: \r\n url('fonts/BebasNeue-webfont.woff') format('woff'),\r\n url('fonts/BebasNeue-webfont.svg#BebasNeueRegular') format('svg'); \r\n}\r\n\r\n/* CSS reset */\r\nbody,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { \r\n\tmargin:0;\r\n\tpadding:0;\r\n}\r\n\r\n/* General Demo Style */\r\nbody{\r\n\t\tbackground: #fff url(../images/bg.jpg) repeat top left;\r\n\t}\r\na{\r\n\tcolor: red;\r\n\ttext-decoration: none;\r\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>'''\nzip\nlambda\nset\ndict\nlist \nsum\ntuple\n'''\n\na = [1, 2, 3, 1, 2, 4, 5]\nb = set()\nfor i in a:\n\tb.add(i)\nb = list(b)\nprint(b)\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>/*\n * Copyright 2015 Rockchip Electronics Co. LTD\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#define MODULE_TAG \"mpp_allocator\"\n\n#include \"mpp_log.h\"\n#include \"mpp_mem.h\"\n#include \"mpp_allocator.h\"\n#include \"mpp_allocator_impl.h\"\n\n#include \"os_allocator.h\"\n\n#include <linux/drm.h>\n\n#define MPP_ALLOCATOR_LOCK(p) pthread_mutex_lock(&(p)->lock);\n#define MPP_ALLOCATOR_UNLOCK(p) pthread_mutex_unlock(&(p)->lock);\n\ntypedef enum OsAllocatorApiId_e {\n ALLOC_API_ALLOC,\n ALLOC_API_FREE,\n ALLOC_API_IMPORT,\n ALLOC_API_RELEASE,\n ALLOC_API_MMAP,\n ALLOC_API_BUTT,\n} OsAllocatorApiId;\n\nstatic MPP_RET mpp_allocator_api_wrapper(MppAllocator allocator,\n MppBufferInfo *info,\n OsAllocatorApiId id)\n{\n if (NULL == allocator || NULL == info || id >= ALLOC_API_BUTT) {\n mpp_err_f(\"invalid input: allocator %p info %p id %d\\n\",\n allocator, info, id);\n return MPP_ERR_UNKNOW;\n }\n\n MPP_RET ret = MPP_NOK;\n MppAllocatorImpl *p = (MppAllocatorImpl *)allocator;\n OsAllocatorFunc func;\n\n MPP_ALLOCATOR_LOCK(p);\n switch (id) {\n case ALLOC_API_ALLOC : {\n func = p->os_api.alloc;\n } break;\n case ALLOC_API_FREE : {\n func = p->os_api.free;\n } break;\n case ALLOC_API_IMPORT : {\n func = p->os_api.import;\n } break;\n case ALLOC_API_RELEASE : {\n func = p->os_api.release;\n } break;\n case ALLOC_API_MMAP : {\n func = p->os_api.mmap;\n } break;\n default : {\n func = NULL;\n } break;\n }\n\n if (func && p->ctx)\n ret = func(p->ctx, info);\n\n MPP_ALLOCATOR_UNLOCK(p);\n\n return ret;\n}\n\nstatic MPP_RET mpp_allocator_alloc(MppAllocator allocator, MppBufferInfo *info)\n{\n return mpp_allocator_api_wrapper(allocator, info, ALLOC_API_ALLOC);\n}\n\nstatic MPP_RET mpp_allocator_free(MppAllocator allocator, MppBufferInfo *info)\n{\n return mpp_allocator_api_wrapper(allocator, info, ALLOC_API_FREE);\n}\n\nstatic MPP_RET mpp_allocator_import(MppAllocator allocator, MppBufferInfo *info)\n{\n return mpp_allocator_api_wrapper(allocator, info, ALLOC_API_IMPORT);\n}\n\nstatic MPP_RET mpp_allocator_release(MppAllocator allocator,\n MppBufferInfo *info)\n{\n return mpp_allocator_api_wrapper(allocator, info, ALLOC_API_RELEASE);\n}\n\nstatic MPP_RET mpp_allocator_mmap(MppAllocator allocator, MppBufferInfo *info)\n{\n return mpp_allocator_api_wrapper(allocator, info, ALLOC_API_MMAP);\n}\n\nstatic MppAllocatorApi mpp_allocator_api = {\n .size = sizeof(mpp_allocator_api),\n .version = 1,\n .alloc = mpp_allocator_alloc,</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package io.rtcore.sip.channels;\n\nimport java.util.concurrent.Flow;\n\n/**\n * SipFlowTube is an I/O abstraction that allows reading from and writing to a destination\n * asynchronously. This is not a {@link Flow.Processor Flow.Processor<SipMessage,\n * SipMessage>}, but rather models a publisher source and a subscriber sink in a bidirectional\n * flow.\n * <p>\n * The {@code connectFlows} method should be called to connect the bidirectional flow. A SipFlowTube\n * supports handing over the same read subscription to different sequential read SipFlowTube over\n * time. When {@code connectFlows(writePublisher, readSubscriber} is called, the SipFlowTube will\n * call {@code dropSubscription} on its former readSubscriber, and {@code onSubscribe} on its new\n * readSubscriber.\n */\n\npublic interface SipFlowTube<OutT, InT> extends Flow.Publisher<InT>, Flow.Subscriber<OutT> {\n\n /**\n * A subscriber for reading from the bidirectional flow. A TubeSubscriber is a\n * {@code Flow.Subscriber} that can be canceled by calling {@code dropSubscription()}. Once\n * {@code dropSubscription()} is called, the {@code TubeSubscriber} should stop calling any method\n * on its subscription.\n */\n\n interface TubeSubscriber<T> extends Flow.Subscriber<T> {\n\n /**\n * Called when the flow is connected again, and the subscription is handed over to a new\n * subscriber. Once {@code dropSubscription()} is called, the {@code TubeSubscriber} should stop\n * calling any method on its subscription.\n */\n\n default void dropSubscription() {\n }\n\n }\n\n /**\n * A publisher for writing to the bidirectional flow.\n */\n\n interface TubePublisher<T> extends Flow.Publisher<T> {\n }\n\n /**\n * Connects the bidirectional flows to a write {@code Publisher} and a read {@code Subscriber}.\n * This method can be called sequentially several times to switch existing publishers and\n * subscribers to a new pair of write subscriber and read publisher.\n *\n * @param writePublisher\n * A new publisher for writing to the bidirectional flow.\n * @param readSubscriber\n * A new subscriber for reading from the bidirectional flow.\n */\n\n default void connectFlows(final TubePublisher<OutT> writePublisher, final TubeSubscriber<InT> readSubscriber) {\n this.subscribe(readSubscriber);\n writePublisher.subscribe(this);\n }\n\n /**\n * Returns true if this flow was completed, either exceptionally or normally (EOF reached).\n *\n * @return true if the flow is finished\n */\n\n boolean isFinished();\n\n /**\n * Returns {@code s} if {@code s} is a {@code TubeSubscriber}, otherwise wraps it in a\n * {@code TubeSubscriber}. Using the wrapper is only appropriate in the case where\n * {@code dropSubscription} doesn't need to be implemented, and the {@code TubeSubscriber} is\n * subscribed only once.\n *\n * @param s\n * a subscriber for reading.\n * @return a {@code TubeSubscriber}: either {@code s} if {@code s} is a {@code TubeSubscriber},\n * otherwise a {@code TubeSubscriber} wrapper that delegates to {@code s}\n */\n\n static <T> TubeSubscriber<T> asTubeSubscriber(final Flow.Subscriber<? super T> s) {\n if (s instanceof TubeSubscriber) {\n return (TubeSubscriber<T>) s;\n }\n return new AbstractTubeSubscriber.TubeSubscriberWrapper<>(s);\n }\n\n /**\n * Returns {@code s} if {@code s} is a {@code TubePublisher}, otherwise wraps it in a\n * {@code TubePublisher}.\n *\n * @param p\n * a publisher for writing.\n * @return a {@code TubePublisher}: either {@code s} if {@code s} is a {@code TubePublisher},\n * otherwise a {@code TubePublisher} wrapper that delegates to {@code s}\n */\n\n static <T> TubePublisher<T> asTubePublisher(final Flow.Publisher<T> p) {\n if (p instanceof TubePublisher) {\n return (TubePublisher<T>) p;\n }\n return new AbstractTubePublisher.TubePublisherWrapper<>(p);\n }\n\n /**\n * Convenience abstract class for {@code TubePublisher} implementations. It is not required that a\n * {@code TubePublisher} implementation extends this class.\n */\n\n static abstract class AbstractTubePublisher<T> implements TubePublisher<T> {\n\n static final class TubePublisherWrapper<T> extends AbstractTubePublisher<T> {\n\n final Flow.Publisher<T> delegate;\n\n public TubePublisherWrapper(final Flow.Publisher<T> delegate) {\n this.delegate = delegate;\n }\n\n @Override\n public void subscribe(final Flow.Subscriber<? super T> subscriber) {\n this.delegate.subscribe(subscriber);\n }\n\n }\n\n }\n\n /**\n * Convenience abstract class for {@code TubeSubscriber} implementations. It is not required that\n * a {@code TubeSubscriber} implementation extends this class.\n */\n\n static abstract class AbstractTubeSubscriber<T> implements TubeSubscriber<T> {\n\n static final class TubeSubscriberWrapper<T> extends AbstractTubeSubscriber<T> {\n\n final Flow.Subscriber<? super T> delegate;\n\n TubeSubscriberWrapper(final Flow.Subscriber<? super T> delegate) {\n this.delegate = delegate;\n }\n\n @Override\n public void dropSubscription() {\n }\n\n @Override\n public void onSubscribe(final Flow.Subscription subscription) {\n this.delegate.onSubscribe(subscription);\n }\n\n @Override\n public void onNext(final T item) {\n this.delegate.onNext(item);\n }\n\n @Override\n public void onError(final Throwable throwable) {\n this.delegate.onError(throwable);\n }\n\n @Override\n public void onComplete() {\n this.delegate.onComplete();\n }\n\n }\n\n }\n\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_>while line = gets\n\tputs \"#{gcd(a,b)},#{lcm(a,b)}\"\nend\n\ndef gcd(a,b)\n\ta,b = b,a if b>a\n\tif a % b == 0\n\t\treturn b\n\telse\n\t\treturn gcd(a,a%b)\n\tend\nend\n\ndef lcm(a,b)\n\treturn a*b/gcd(a,b)\nend</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>package com.github.czyzby.lml.vis.parser.impl.tag;\n\nimport com.badlogic.gdx.scenes.scene2d.Actor;\nimport com.github.czyzby.lml.parser.LmlParser;\nimport com.github.czyzby.lml.parser.impl.tag.builder.TextLmlActorBuilder;\nimport com.github.czyzby.lml.parser.tag.LmlActorBuilder;\nimport com.github.czyzby.lml.parser.tag.LmlTag;\nimport com.kotcrab.vis.ui.widget.Menu;\nimport com.kotcrab.vis.ui.widget.MenuItem;\n\n/** Handles {@link Menu} widget. Typically used inside a {@link MenuBarLmlTag}. Although technically Menu extends Table\n * class, cell attributes CANNOT be present in its children's tags, as Menus have custom children appending methods.\n * Converts text lines to {@link MenuItem}s with default style. Can handle only {@link MenuItemLmlTag} children. Mapped\n * to \"menu\".\n *\n * @author MJ */\npublic class MenuLmlTag extends MenuPopupLmlTag {\n public MenuLmlTag(final LmlParser parser, final LmlTag parentTag, final String rawTagData) {\n super(parser, parentTag, rawTagData);\n }\n\n @Override\n protected LmlActorBuilder getNewInstanceOfBuilder() {\n return new TextLmlActorBuilder();\n }\n\n @Override\n protected Actor getNewInstanceOfActor(final LmlActorBuilder builder) {\n return new Menu(((TextLmlActorBuilder) builder).getText(), builder.getStyleName());\n }\n\n @Override\n public boolean isAttachable() {\n return false;\n }\n\n @Override\n public void attachTo(final LmlTag tag) {\n // Only sub-menus are attachable. Throwing exception if anyone tries to attach a regular menu.\n getParser().throwError(\"Regular menus are not attachable.\");\n }\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_D_>import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;\nimport std.math, std.random, std.bigint, std.datetime, std.format;\nvoid main(string[] args){ if(args.length > 1) if(args[1] == \"-debug\") DEBUG = 1; solve(); }\nvoid log()(){ writeln(\"\"); } void log(T, A ...)(T t, lazy A a){ if(DEBUG) write(t, \" \"), log(a); } bool DEBUG = 0;\nstring read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }\nT rtype(T)(){ return read.to!T; } alias rint = rtype!int, rlong = rtype!long, rreal = rtype!real;\nT[] rtypes(T)(int n){ return n.iota.map!(i => rtype!T()).array; } alias rint = rtypes!int, rlong = rtypes!long, rreal = rtype!real;\n// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- //\nvoid solve(){\n int a = rint;\n int b = rint;\n int c = rint;\n \n int d = (b + c) - a;\n if(d >= 0) d.writeln;\n else 0.writeln;\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Cuda_>/* \n * ------------------------------------------------------------------------------\n *\n * MIT License\n *\n * Copyright (c) 2021 Parallel Applications Modelling Group - GMAP\n * GMAP website: https://gmap.pucrs.br\n *\n * Pontifical Catholic University of Rio Grande do Sul (PUCRS)\n * Av. Ipiranga, 6681, Porto Alegre - Brazil, 90619-900\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * ------------------------------------------------------------------------------\n *\n * The original NPB 3.4 version was written in Fortran and belongs to:\n * http://www.nas.nasa.gov/Software/NPB/\n *\n * Authors of the Fortran code:\n * E. Barszcz\n * P. Frederickson\n * A. Woo\n * M. Yarrow\n *\n * ------------------------------------------------------------------------------\n *\n * The serial C++ version is a translation of the original NPB 3.4\n * Serial C++ version: https://github.com/GMAP/NPB-CPP/tree/master/NPB-SER\n *\n * Authors of the C++ code:\n * Dalvan Griebler <dalvangriebler@gmail.com>\n * Gabriell Araujo <hexenoften@gmail.com>\n * Júnior Löff <loffjh@gmail.com>\n *\n * ------------------------------------------------------------------------------\n *\n * The CUDA version is a parallel implementation of the serial C++ version\n * CUDA version: https://github.com/GMAP/NPB-GPU/tree/master/CUDA\n *\n * Authors of the CUDA code:\n * Gabriell Araujo <hexenoften@gmail.com>\n *\n * ------------------------------------------------------------------------------\n */\n\n /* NO CAST VERSION 2 */\n\n#include <cuda.h>\n#include \"../common/npb-CPP.hpp\"\n#include \"npbparams.hpp\"\n\n#define NM (2+(1<<LM)) /* actual dimension including ghost cells for communications */\n#define NV (ONE*(2+(1<<NDIM1))*(2+(1<<NDIM2))*(2+(1<<NDIM3))) /* size of rhs array */\n#define NR (((NV+NM*NM+5*NM+7*LM+6)/7)*8) /* size of residual array */\n#define MAXLEVEL (LT_DEFAULT+1) /* maximum number of levels */\n#define M (NM+1) /* set at m=1024, can handle cases up to 1024^3 case */\n#define MM (10)\n#define\tA (pow(5.0,13.0))\n#define\tX (314159265.0)\n#define T_INIT (0)\n#define T_BENCH (1)\n#define T_MG3P (2)\n#define T_PSINV (3)\n#define T_RESID (4)\n#define T_RESID2 (5)\n#define T_RPRJ3 (6)\n#define T_INTERP (7)\n#define T_NORM2 (8)\n#define T_COMM3 (9)\n#define T_LAST (10)\n#define THREADS_PER_BLOCK (1024) //1024\n#define THREADS_PER_BLOCK_ON_NORM2U3 (128) //128\n#define THREADS_PER_BLOCK_ON_COMM3 (32) //32\n#define THREADS_PER_BLOCK_ON_ZERO3 (1024) //1024\n//#define SHARED_2_M (2*M*sizeof(double))\n//#define SHARED_3_M (3*M*sizeof(double))\n//#define SHARED_2_NORM (2*THREADS_PER_BLOCK_ON_NORM2U3*sizeof(double))\n\n/* global variables */\n#if defined(DO_NOT_ALLOCATE_ARRAYS_WITH_DYNAMIC_MEMORY_AND_AS_SINGLE_DIMENSION)\nstatic int nx[MAXLEVEL+1];\nstatic int ny[MAXLEVEL+1];\nstatic int nz[MAXLEVEL+1];\nstatic int m1[MAXLEVEL+1];\nstatic int m2[MAXLEVEL+1];\nstatic int m3[MAXLEVEL+1];\nstatic int ir[MAXLEVEL+1];\nstatic int debug_vec[8];\nstatic double u[NR];\nstatic double v[NV];\nstatic double r[NR];\n#else\nstatic int (*nx)=(int*)malloc(sizeof(int)*(MAXLEVEL+1));\nstatic int (*ny)=(int*)malloc(sizeof(int)*(MAXLEVEL+1));\nstatic int (*nz)=(int*)malloc(sizeof(int)*(MAXLEVEL+1));\nstatic int (*m1)=(int*)malloc(sizeof(int)*(MAXLEVEL+1));\nstatic int (*m2)=(int*)malloc(sizeof(int)*(MAXLEVEL+1));\nstatic int (*m3)=(int*)malloc(sizeof(int)*(MAXLEVEL+1));\nstatic int (*ir)=(int*)malloc(sizeof(int)*(MAXLEVEL+1));\nstatic int (*debug_vec)=(int*)malloc(sizeof(int)*(8));\nstatic double (*u)=(double*)malloc(sizeof(double)*(NR));\nstatic double (*v)=(double*)malloc(sizeof(double)*(NV));\nstatic double (*r)=(double*)malloc(sizeof(double)*(NR));\n#endif\nstatic int is1, is2, is3, ie1, ie2, ie3, lt, lb;\nstatic boolean timeron;\n/* gpu variables */\nint threads_per_block;\nint blocks_per_grid;\nint amount_of_work;\nsize_t size_a_device;\nsize_t size_c_device;\nsize_t size_u_device;\nsize_t size_v_device;\nsize_t size_r_device;\ndouble* a_device;\ndouble* c_device;\ndouble* u_device;\ndouble* v_device;\ndouble* r_device;\n//extern __shared__ double extern_share_data[];\n\n/* function prototypes */\nstatic void bubble(double ten[][MM], \n\t\tint j1[][MM], \n\t\tint j2[][MM], \n\t\tint j3[][MM], \n\t\tint m, \n\t\tint ind);\nstatic void comm3(void* pointer_u, \n\t\tint n1, \n\t\tint n2, \n\t\tint n3, \n\t\tint kk);\nstatic void comm3_gpu(double* u_device, \n\t\tint n1, \n\t\tint n2, \n\t\tint n3, \n\t\tint kk);</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Racket_>#lang scribble/doc\n@(require scribble/manual\n scribble/bnf \n \"common.rkt\"\n (for-label racket/base\n racket/contract\n setup/link\n setup/dirs))\n\n@title[#:tag \"link\"]{@exec{raco link}: Library Collection Links}\n\nThe @exec{raco link} command inspects and modifies a @tech[#:doc\nreference-doc]{collection links file} to display, add, or remove\nmappings from collection names to filesystem directories.\n\nManaging links directly is somewhat discouraged. Instead, use the\npackage manager (see @other-manual['(lib\n\"pkg/scribblings/pkg.scrbl\")]), which installs and manages links\n(i.e., it builds on @exec{raco link}) in a way that more gracefully\nleads to sharing collections with others. Nevertheless, @exec{raco\nlink} is available for direct use.\n\nFor example, the command\n\n@commandline{raco link maze}\n\ninstalls a user-specific and version-specific link for the @racket[\"maze\"] collection,\nmapping it to the @filepath{maze} subdirectory of the current\ndirectory. Supply multiple directory paths to create multiple links at\nonce, especially with a command-shell wildcard:\n\n@commandline{raco link *}\n\nBy default, the linked collection name is the same as each directory's\nname, but the collection name can be set separately for a single\ndirectory with the @DFlag{name} flag.\n\nTo remove the link created by the first example above, use\n\n@commandline{raco link --remove maze}\n\nor \n\n@commandline{raco link -r maze}\n\nLike link-adding mode, removing mode accepts multiple directory paths to\nremove multiple links, and all links that match any directory are\nremoved. If @DFlag{name} is used with @DFlag{remove}, then only\nlinks matching both the collection name and directory are removed.\n\nFull command-line options:\n\n@itemlist[\n\n @item{@Flag{l} or @DFlag{list} --- Shows the current link table. If\n any other command-line arguments are provided that modify the\n link table, the table is shown after modifications. If no\n directory arguments are provided, and if none of @Flag{u},\n @DFlag{user}, @Flag{i}, @DFlag{installation}, @Flag{f}, or\n @DFlag{file} are specified, then the link table is shown for\n all user-specific and installation-wide @tech[#:doc\n reference-doc]{collection links files}.}\n\n @item{@Flag{n} @nonterm{name} or @DFlag{name} @nonterm{name} --- Sets\n the collection name for adding a single link or removing\n matching links. By default, the collection name for an added\n link is derived from the directory name. When the @Flag{r} or\n @DFlag{remove} flag is also used, only links with a collection\n name matching @nonterm{name} are removed, and if no directory\n arguments are provided, all links with a match to\n @nonterm{name} are removed. This flag is mutually exclusive with\n @Flag{d} and @DFlag{root}.}\n\n @item{@Flag{d} or @DFlag{root} --- Treats each directory as a\n collection root that contains collection directories, instead of\n a directory for a specific collection. When the @Flag{r} or\n @DFlag{remove} flag is also used, only collection-root links\n that match a directory are removed. This flag is mutually\n exclusive with @Flag{n} and @DFlag{name}.}\n\n @item{@Flag{D} or @DFlag{static-root} --- Like @Flag{d} or\n @DFlag{root}, but each directory is assumed to have a constant\n set of subdirectories (to improve the use of collection-search\n caches) as long as the links file itself does not change.}\n\n @item{@Flag{x} @nonterm{regexp} or @DFlag{version-regexp}\n @nonterm{regexp} --- Sets a version regexp that limits the link\n to use only by Racket versions (as reported by\n @racket[version]) matching @nonterm{regexp}. This flag\n is normally used with @Flag{u} or @DFlag{user} with installations\n that have different versions but the same installation name. When the @Flag{r}\n or @DFlag{remove} flag is also used, only links with a\n version regexp matching @nonterm{regexp} are removed.}\n\n @item{@Flag{r} or @DFlag{remove} --- Selects remove mode instead\n of add mode.}\n\n @item{@Flag{u} or @DFlag{user} --- Limits listing and removal\n of links to the user-specific @tech[#:doc\n reference-doc]{collection links file} and not the\n installation-wide @tech[#:doc reference-doc]{collection links\n file}. This flag is mutually exclusive with @Flag{i},\n @DFlag{installation}, @Flag{f}, and @DFlag{file}.}\n\n @item{@Flag{i} or @DFlag{installation} --- Reads and writes links in\n installation-wide @tech[#:doc reference-doc]{collection links\n file} and not the user-specific @tech[#:doc\n reference-doc]{collection links file}. This flag is mutually\n exclusive with @Flag{u}, @DFlag{user}, @Flag{f}, and\n @DFlag{file}.}\n\n @item{@Flag{f} @nonterm{file} or @DFlag{file} @nonterm{file} ---\n Reads and writes links in @nonterm{file} instead of the\n user-specific @tech[#:doc reference-doc]{collection links\n file}. This flag is mutually exclusive with @Flag{u},\n @DFlag{user}, @Flag{s}, @DFlag{shared}, @Flag{i}, and @DFlag{installation}.}\n\n @item{@Flag{v} @nonterm{vers} or @DFlag{version} @nonterm{vers} ---\n Selects @nonterm{vers} as relevant installation name for\n operations on the user-specific @tech[#:doc\n reference-doc]{collection links file}.}\n\n @item{@DFlag{repair} --- Enables repairs to the existing file content\n when the content is erroneous. The file is repaired by deleting\n individual links when possible.}\n\n]\n\n@; ----------------------------------------\n\n@section{API for Collection Links}\n\n@defmodule[setup/link]\n\n@defproc[(links [dir path?] ...\n [#:user? user? any/c #t]\n [#:user-version user-version string? (get-installation-name)]\n [#:file file (or/c path-string? #f) #f]\n [#:name name (or/c string? #f) #f]\n [#:root? root? any/c #f]\n [#:static-root? static-root? any/c #f]\n [#:version-regexp version-regexp (or/c regexp? #f) #f]\n [#:error error-proc (symbol? string? any/c ... . -> . any) error]\n [#:remove? remove? any/c #f]\n [#:show? show? any/c #f]\n [#:repair? repair? any/c #f]\n [#:with-path? with-path? any/c #f])\n list?]{\n\nA function version of the @exec{raco link} command that always works\non a single file---either @racket[file] if it is a path string, the\nuser--specific @tech[#:doc reference-doc]{collection links file} if\n@racket[user?] is true, or the installation-wide @tech[#:doc\nreference-doc]{collection links file} otherwise. If @racket[user?]\nis true, then @racket[user-version] determines the relevant\ninstallation name (defaulting to the current installation's name).\n\nThe @racket[static-root?] flag value is ignored unless @racket[root?]\nis true and @racket[remove?] is false, in which case each given\n@racket[dir] is added as a static root if @racket[static-root?] is true.\n\nThe @racket[error-proc] argument is called to raise exceptions that\nwould be fatal to the @exec{raco link} command.\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Go_>package crypto\n\nimport (\n\t\"errors\"\n\n\t\"github.com/elastos/Elastos.ELA/common\"\n)\n\nconst (\n\tPUSH1 = 0x51\n\n\t// encoded public key length 0x21 || encoded public key (33 bytes) || OP_CHECKSIG(0xac)\n\tPublicKeyScriptLength = 35\n\n\t// signature length(0x40) || 64 bytes signature\n\tSignatureScriptLength = 65\n\n\t// 1byte m || 3 encoded public keys with leading 0x40 (34 bytes * 3) ||\n\t// 1byte n + 1byte OP_CHECKMULTISIG\n\tMinMultiSignCodeLength = 71\n)\n\nfunc ParseMultisigScript(code []byte) ([][]byte, error) {\n\tif len(code) < MinMultiSignCodeLength || code[len(code)-1] != common.MULTISIG {\n\t\treturn nil, errors.New(\"not a valid multi sign transaction code, length not enough\")\n\t}\n\treturn parsePublicKeys(code)\n}\n\nfunc ParseCrossChainScript(code []byte) ([][]byte, error) {\n\tif len(code) < MinMultiSignCodeLength || code[len(code)-1] != common.CROSSCHAIN {\n\t\treturn nil, errors.New(\"not a valid cross chain transaction code, length not enough\")\n\t}\n\treturn parsePublicKeys(code)\n}\n\nfunc parsePublicKeys(code []byte) ([][]byte, error) {\n\t// remove last byte MULTISIG\n\tcode = code[:len(code)-1]</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Rust_>//=============================================================================\n//\n// WARNING: This file is AUTO-GENERATED\n//\n// Do not make changes directly to this file.\n//\n// If you would like to make a change to the library, please update the schema\n// definitions at https://github.com/slack-rs/slack-api-schemas\n//\n// If you would like to make a change how the library was generated,\n// please edit https://github.com/slack-rs/slack-rs-api/tree/master/codegen\n//\n//=============================================================================\n\n#![allow(unused_imports)]\n#![allow(clippy::match_single_binding)]\n#![allow(clippy::blacklisted_name)]\n\nuse std::borrow::Cow;\nuse std::convert::From;\nuse std::error::Error;\nuse std::fmt;\n\n#[derive(Clone, Default, Debug)]\npub struct ExchangeRequest<'a> {\n /// Specify team_id starts with `T` in case of Org Token\n pub team_id: Option<Cow<'a, str>>,\n /// Specify `true` to convert `W` global user IDs to workspace-specific `U` IDs. Defaults to `false`.\n pub to_old: Option<bool>,\n /// A comma-separated list of user ids, up to 400 per request\n pub users: Cow<'a, str>,\n}\n\n#[derive(Clone, Debug, Deserialize)]\npub struct ExchangeResponse {\n pub callstack: Option<String>,\n pub enterprise_id: String,\n error: Option<String>,\n pub invalid_user_ids: Option<Vec<String>>,\n #[serde(default)]\n ok: bool,\n pub team_id: String,\n pub user_id_map: Option<serde_json::Value>,\n}\n\nimpl<E: Error> Into<Result<ExchangeResponse, ExchangeError<E>>> for ExchangeResponse {\n fn into(self) -> Result<ExchangeResponse, ExchangeError<E>> {\n if self.ok {\n Ok(self)\n } else {\n Err(self.error.as_ref().map(String::as_ref).unwrap_or(\"\").into())\n }\n }\n}\n\n#[derive(Debug)]\npub enum ExchangeError<E: Error> {\n AccountInactive,\n FatalError,\n InvalidArgName,\n InvalidArrayArg,\n InvalidAuth,\n InvalidCharset,\n InvalidFormData,\n InvalidJson,\n InvalidPostType,\n JsonNotObject,\n MissingPostType,\n NoPermission,\n NotAuthed,\n NotEnterpriseTeam,\n OrgLoginRequired,\n RequestTimeout,\n TeamAddedToOrg,\n TokenRevoked,\n TooManyUsers,\n UpgradeRequired,\n /// The response was not parseable as the expected object\n MalformedResponse(String, serde_json::error::Error),\n /// The response returned an error that was unknown to the library\n Unknown(String),\n /// The client had an error sending the request to Slack\n Client(E),\n}\n\nimpl<'a, E: Error> From<&'a str> for ExchangeError<E> {\n fn from(s: &'a str) -> Self {\n match s {\n \"account_inactive\" => ExchangeError::AccountInactive,\n \"fatal_error\" => ExchangeError::FatalError,\n \"invalid_arg_name\" => ExchangeError::InvalidArgName,\n \"invalid_array_arg\" => ExchangeError::InvalidArrayArg,\n \"invalid_auth\" => ExchangeError::InvalidAuth,\n \"invalid_charset\" => ExchangeError::InvalidCharset,\n \"invalid_form_data\" => ExchangeError::InvalidFormData,\n \"invalid_json\" => ExchangeError::InvalidJson,\n \"invalid_post_type\" => ExchangeError::InvalidPostType,\n \"json_not_object\" => ExchangeError::JsonNotObject,\n \"missing_post_type\" => ExchangeError::MissingPostType,\n \"no_permission\" => ExchangeError::NoPermission,\n \"not_authed\" => ExchangeError::NotAuthed,\n \"not_enterprise_team\" => ExchangeError::NotEnterpriseTeam,\n \"org_login_required\" => ExchangeError::OrgLoginRequired,\n \"request_timeout\" => ExchangeError::RequestTimeout,\n \"team_added_to_org\" => ExchangeError::TeamAddedToOrg,\n \"token_revoked\" => ExchangeError::TokenRevoked,\n \"too_many_users\" => ExchangeError::TooManyUsers,\n \"upgrade_required\" => ExchangeError::UpgradeRequired,\n _ => ExchangeError::Unknown(s.to_owned()),\n }\n }\n}\n\nimpl<E: Error> fmt::Display for ExchangeError<E> {\n fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n match *self {\n ExchangeError::AccountInactive => write!(f, \"Server returned error account_inactive\"),\n ExchangeError::FatalError => write!(f, \"Server returned error fatal_error\"),\n ExchangeError::InvalidArgName => write!(f, \"Server returned error invalid_arg_name\"),\n ExchangeError::InvalidArrayArg => write!(f, \"Server returned error invalid_array_arg\"),\n ExchangeError::InvalidAuth => write!(f, \"Server returned error invalid_auth\"),\n ExchangeError::InvalidCharset => write!(f, \"Server returned error invalid_charset\"),\n ExchangeError::InvalidFormData => write!(f, \"Server returned error invalid_form_data\"),\n ExchangeError::InvalidJson => write!(f, \"Server returned error invalid_json\"),\n ExchangeError::InvalidPostType => write!(f, \"Server returned error invalid_post_type\"),</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>/***************************\n * @eonRenderRenderer\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports)\n : typeof define === 'function' && define.amd ? define(['exports'], factory)\n : (factory((global.eonRenderRenderer = global.eonRenderRenderer || {})))\n}(this, function (exports) {\n 'use strict'\n\n async function eonitem (__eo = {}) {\n let eonRenderSvg = __eo('eonRenderSvg')\n let eonRenderWebgl = __eo('eonRenderWebgl')\n\n if (!eonRenderSvg && !eonRenderWebgl) {\n console.info('r.renderer no renderers')\n }\n // ............................. render\n const render = function (featurecollection, elapsed) {\n if (eonRenderSvg) eonRenderSvg.render(featurecollection)\n if (eonRenderWebgl) eonRenderWebgl.render(featurecollection)\n }\n\n // ............................. enty\n let enty = function () {}\n enty.render = render\n return enty\n }\n\n exports.eonRenderRenderer = eonitem\n}))\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>function Main(input) {\n input = input.trim()\nvar a = input*800\na-=math.floor(input/15)*200;\nconsole.log(a);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Elixir_>defmodule Mix do\n @moduledoc ~S\"\"\"\n Mix is a build tool that provides tasks for creating, compiling,\n and testing Elixir projects, managing its dependencies, and more.\n\n ## Mix.Project\n\n The foundation of Mix is a project. A project can be defined by using\n `Mix.Project` in a module, usually placed in a file named `mix.exs`:\n\n defmodule MyApp.MixProject do\n use Mix.Project\n\n def project do\n [\n app: :my_app,\n version: \"1.0.0\"\n ]\n end\n end\n\n See the `Mix.Project` module for detailed documentation on Mix projects.\n\n Once the project is defined, a number of default Mix tasks can be run\n directly from the command line:\n\n * `mix compile` - compiles the current project\n * `mix test` - runs tests for the given project\n * `mix run` - runs a particular command inside the project\n\n Each task has its own options and sometimes specific configuration\n to be defined in the `project/0` function. You can use `mix help`\n to list all available tasks and `mix help NAME` to show help for\n a particular task.\n\n The best way to get started with your first project is by calling\n `mix new my_project` from the command line.\n\n ## Mix.Task\n\n Tasks are what make Mix extensible.\n\n Projects can extend Mix behaviour by adding their own tasks. For\n example, adding the task below inside your project will\n make it available to everyone that uses your project:\n\n defmodule Mix.Tasks.Hello do\n use Mix.Task\n\n def run(_) do\n Mix.shell().info(\"Hello world\")\n end\n end\n\n The task can now be invoked with `mix hello`.\n\n See the `Mix.Task` behaviour for detailed documentation on Mix tasks.\n\n ## Dependencies\n\n Mix also manages your dependencies and integrates nicely with the [Hex package\n manager](https://hex.pm).\n\n In order to use dependencies, you need to add a `:deps` key\n to your project configuration. We often extract the list of dependencies\n into its own function:\n\n defmodule MyApp.MixProject do\n use Mix.Project\n\n def project do\n [\n app: :my_app,\n version: \"1.0.0\",\n deps: deps()\n ]\n end\n\n defp deps do\n [\n {:ecto, \"~> 2.0\"},\n {:plug, github: \"elixir-lang/plug\"}\n ]\n end\n end\n\n You can run `mix help deps` to learn more about dependencies in Mix.\n\n ## Environments\n\n Mix supports different environments. Environments allow developers\n to prepare and organize their project specifically for different\n scenarios. By default, Mix provides three environments:\n\n * `:dev` - the default environment\n * `:test` - the environment `mix test` runs on\n * `:prod` - the environment your dependencies run on\n\n The environment can be changed via the command line by setting\n the `MIX_ENV` environment variable, for example:\n\n $ MIX_ENV=prod mix run server.exs\n\n You can also specify that certain dependencies are available only for\n certain environments:\n\n {:some_test_dependency, \"~> 1.0\", only: :test}\n\n The environment can be read via `Mix.env/0`.\n\n ## Targets\n\n Besides environments, Mix supports targets. Targets are useful when a\n project needs to compile to different architectures and some of the\n dependencies are only available to some of them. By default, the target\n is `:host` but it can be set via the `MIX_TARGET` environment variable.\n The target can be read via `Mix.target/0`.\n\n This feature is considered experimental and may change in future releases.\n\n ## Aliases\n\n Aliases are shortcuts or tasks specific to the current project.\n\n In the \"Mix.Task\" section, we have defined a task that would be\n available to everyone using our project as a dependency. What if\n we wanted the task to only be available for our project? Just\n define an alias:\n\n defmodule MyApp.MixProject do\n use Mix.Project\n\n def project do\n [\n app: :my_app,\n version: \"1.0.0\",\n aliases: aliases()\n ]\n end\n\n defp aliases do\n [\n c: \"compile\",\n hello: &hello/1\n ]\n end\n\n defp hello(_) do\n Mix.shell().info(\"Hello world\")\n end\n end\n\n In the example above, we have defined two aliases. One is `mix c`\n which is a shortcut for `mix compile`. The other is named\n `mix hello`, which is the equivalent to the `Mix.Tasks.Hello`\n we have defined in the \"Mix.Task\" section.\n\n Aliases may also be lists, specifying multiple tasks to be run\n consecutively:\n\n [all: [&hello/1, \"deps.get --only #{Mix.env()}\", \"compile\"]]\n\n In the example above, we have defined an alias named `mix all`,\n that prints \"Hello world\", then fetches dependencies specific\n to the current environment, and compiles the project.\n\n Aliases can also be used to augment existing tasks. Let's suppose\n you want to augment `mix clean` to clean another directory Mix does\n not know about:\n\n [clean: [\"clean\", &clean_extra/1]]\n\n Where `&clean_extra/1` would be a function in your `mix.exs`\n with extra cleanup logic.\n\n Arguments given to the alias will be appended to the arguments of\n the last task in the list. Except when overriding an existing task.\n In this case, the arguments will be given to the original task,\n in order to preserve semantics. For example, in the `:clean` alias\n above, the arguments given to the alias will be passed to \"clean\"\n and not to `clean_extra/1`.\n\n Aliases defined in the current project do not affect its dependencies\n and aliases defined in dependencies are not accessible from the\n current project.\n\n Aliases can be used very powerfully to also run Elixir scripts and\n shell commands, for example:\n\n # priv/hello1.exs\n IO.puts(\"Hello One\")\n\n # priv/hello2.exs\n IO.puts(\"Hello Two\")\n\n # priv/world.sh\n #!/bin/sh\n echo \"world!\"\n\n # mix.exs\n defp aliases do\n [\n some_alias: [\"hex.info\", \"run priv/hello1.exs\", \"cmd priv/world.sh\"]\n ]\n end\n\n In the example above we have created the alias `some_alias` that will\n run the task `mix hex.info`, then `mix run` to run an Elixir script,\n then `mix cmd` to execute a command line shell script. This shows how\n powerful aliases mixed with Mix tasks can be.\n\n Mix tasks are designed to run only once. This prevents the same task\n to be executed multiple times. For example, if there are several tasks\n depending on `mix compile`, the code will be compiled once. Tasks can\n be executed again if they are explicitly reenabled using `Mix.Task.reenable/1`:\n\n another_alias: [\n \"format --check-formatted priv/hello1.exs\",\n \"cmd priv/world.sh\",\n fn _ -> Mix.Task.reenable(\"format\") end,\n \"format --check-formatted priv/hello2.exs\"\n ]\n\n Some tasks are automatically reenabled though, as they are expected to\n be invoked multiple times. They are: `mix cmd`, `mix do`, `mix loadconfig`,\n `mix profile.cprof`, `mix profile.eprof`, `mix profile.fprof`, `mix run`,\n and `mix xref`.\n\n It is worth mentioning that some tasks, such as in the case of the\n `mix format` command in the example above, can accept multiple files so it\n could be rewritten as:\n\n another_alias: [\"format --check-formatted priv/hello1.exs priv/hello2.exs\"]\n\n ## Environment variables\n\n Several environment variables can be used to modify Mix's behaviour.\n\n Mix responds to the following variables:\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>\r\n#ifndef BOOST_MPL_SET_SET30_HPP_INCLUDED\r\n#define BOOST_MPL_SET_SET30_HPP_INCLUDED\r\n\r\n// Copyright Aleksey Gurtovoy 2000-2004\r\n// Copyright David Abrahams 2003-2004\r\n//\r\n// Distributed under the Boost Software License, Version 1.0. \r\n// (See accompanying file LICENSE_1_0.txt or copy at \r\n// http://www.boost.org/LICENSE_1_0.txt)\r\n//\r\n// See http://www.boost.org/libs/mpl for documentation.\r\n\r\n// $Source$\r\n// $Date: 2004-09-02 11:41:37 -0400 (Thu, 02 Sep 2004) $\r\n// $Revision: 24874 $\r\n\r\n#if !defined(BOOST_MPL_PREPROCESSING_MODE)\r\n# include <boost/mpl/set/set20.hpp>\r\n#endif\r\n\r\n#include <boost/mpl/aux_/config/use_preprocessed.hpp>\r\n\r\n#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \\\r\n && !defined(BOOST_MPL_PREPROCESSING_MODE)\r\n\r\n# define BOOST_MPL_PREPROCESSED_HEADER set30.hpp\r\n# include <boost/mpl/set/aux_/include_preprocessed.hpp>\r\n\r\n#else\r\n\r\n# include <boost/preprocessor/iterate.hpp>\r\n\r\nnamespace boost { namespace mpl {\r\n\r\n# define BOOST_PP_ITERATION_PARAMS_1 \\\r\n (3,(21, 30, <boost/mpl/set/aux_/numbered.hpp>))\r\n# include BOOST_PP_ITERATE()\r\n\r\n}}\r\n\r\n#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS\r\n\r\n#endif // BOOST_MPL_SET_SET30_HPP_INCLUDED\r\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>#include<stdio.h>\n#include<stdlib.h>\n#include<string.h>\n\nint sort(int N, int *a, int *b) {\n\tint neat;\n\tint i;\n\tint temp;\n\twhile(neat < N - 1) {\n\t\tneat = 0;\n\t\tfor(i = 0; i < N - 1; i += 1) {\n\t\t\tif(a[i] > a[i + 1]) {\n\t\t\t\ttemp = a[i];\n\t\t\t\ta[i] = a[i + 1];\n\t\t\t\ta[i + 1] = temp;\n\t\t\t\ttemp = b[i];\n\t\t\t\tb[i] = b[i + 1];\n\t\t\t\tb[i + 1] = temp;\n\t\t\t} else {\n\t\t\t\tneat += 1;\n\t\t\t}\n\t\t}\n\t}\n\treturn 0;\n}\n\nint main(void) {\n\tint N;\n\tlong long int K;\n\tint *a, *b;\n\tint i;\n\tlong long int num_terms;\n\tchar buf[128], *ch;\n\t//FILE *file;\n\n\t//file = fopen(\"input.txt\", \"r\");\n\n\tfgets(buf, sizeof(buf), stdin);\n\t//fgets(buf, sizeof(buf), file);\n\tch = strtok(buf, \" \");\n\tN = atoi(ch);\n\tch = strtok(NULL, \" \");\n\tK = atoll(ch);\n\n\ta = (int *)calloc(N, sizeof(int));\n\tb = (int *)calloc(N, sizeof(int));\n\n\tfor(i = 0; i < N; i += 1) {\n\t\tfgets(buf, sizeof(buf), stdin);\n\t\t//fgets(buf, sizeof(buf), file);\n\t\tch = strtok(buf, \" \");\n\t\ta[i] = atoi(ch);\n\t\tch = strtok(NULL, \" \");\n\t\tb[i] = atoi(ch);\n\t}\n\tsort(N, a, b);\n\n\tnum_terms = 0;\n\tfor(i = 0; i < N; i += 1) {\n\t\tnum_terms += b[i];\n\t\tif(num_terms >= K) {\n\t\t\tprintf(\"%d\\n\", a[i]);\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tfree(a);\n\tfree(b);\n\t//fclose(file);\n\treturn 0;\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_HTML_><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc -->\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>PriorityBlockingQueue (Dracula Javadoc Sample)</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../dracula-javadoc8.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../script.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"PriorityBlockingQueue (Dracula Javadoc Sample)\";\n }\n }\n catch(err) {\n }\n//-->\nvar methods = {\"i0\":10,\"i1\":10,\"i2\":10,\"i3\":10,\"i4\":10,\"i5\":10,\"i6\":10,\"i7\":10,\"i8\":10,\"i9\":10,\"i10\":10,\"i11\":10,\"i12\":10,\"i13\":10,\"i14\":10,\"i15\":10,\"i16\":10,\"i17\":10,\"i18\":10,\"i19\":10,\"i20\":10};\nvar tabs = {65535:[\"t0\",\"All Methods\"],2:[\"t2\",\"Instance Methods\"],8:[\"t4\",\"Concrete Methods\"]};\nvar altColor = \"altColor\";\nvar rowColor = \"rowColor\";\nvar tableTab = \"tableTab\";\nvar activeTableTab = \"activeTableTab\";\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../java/util/concurrent/Phaser.html\" title=\"class in java.util.concurrent\"><span class=\"typeNameLink\">Prev Class</span></a></li>\n<li><a href=\"../../../java/util/concurrent/RecursiveAction.html\" title=\"class in java.util.concurrent\"><span class=\"typeNameLink\">Next Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../index.html?java/util/concurrent/PriorityBlockingQueue.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"PriorityBlockingQueue.html\" target=\"_top\">No Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../allclasses-noframe.html\">All Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary: </li>\n<li>Nested | </li>\n<li>Field | </li>\n<li><a href=\"#constructor.summary\">Constr</a> | </li>\n<li><a href=\"#method.summary\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail: </li>\n<li>Field | </li>\n<li><a href=\"#constructor.detail\">Constr</a> | </li>\n<li><a href=\"#method.detail\">Method</a></li>\n</ul>\n</div>\n<a name=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">java.util.concurrent</div>\n<h2 title=\"Class PriorityBlockingQueue\" class=\"title\">Class PriorityBlockingQueue<E></h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li><a href=\"../../../java/lang/Object.html\" title=\"class in java.lang\">java.lang.Object</a></li>\n<li>\n<ul class=\"inheritance\">\n<li><a href=\"../../../java/util/AbstractCollection.html\" title=\"class in java.util\">java.util.AbstractCollection</a><E></li>\n<li>\n<ul class=\"inheritance\">\n<li><a href=\"../../../java/util/AbstractQueue.html\" title=\"class in java.util\">java.util.AbstractQueue</a><E></li>\n<li>\n<ul class=\"inheritance\">\n<li>java.util.concurrent.PriorityBlockingQueue<E></li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<div class=\"description\">\n<ul class=\"blockList\">\n<li class=\"blockList\">\n<dl>\n<dt><span class=\"paramLabel\">Type Parameters:</span></dt>\n<dd><code>E</code> - the type of elements held in this collection</dd>\n</dl>\n<dl>\n<dt>All Implemented Interfaces:</dt></code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>package com.aoshenfengyu.testamazingtalker.constant\n\nobject Constant {\n const val CALENDAR_COLUMN_COUNT = 7\n const val CALENDAR_TIME_INTERVAL_MINUTE = 30\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>\npath = 'data/api_keys.json'\n\n\ndef load_key(keyName):\n try:\n with open(path, 'r') as f:\n j = json.load(f)\n\n if keyName in j:\n return j[keyName]\n else:\n j[keyName] = None\n with open(path, 'w') as f:\n json.dump(j, f)\n\n except IOError:\n j = {keyName: None}\n with open(path, 'w') as f:\n json.dump(j, f)\n\n return None\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>/// wa ^3^\n\n#pragma GCC optimize(\"O3\")\n\n#include<bits/stdc++.h>\n \n#define x first\n#define y second\n#define pb push_back\n#define sz(x) (int) x.size()\n \nusing namespace std;\n \nusing ll = long long;\nusing pii = pair<int, int>; \n\nconst int MOD = 1e9 + 7;\nconst int INF32 = 1e9 + 1e2;\n\nvoid stndrtn() {\n#ifdef accepted\n freopen(\".in\", \"r\", stdin);\n#endif \n}\n\nbool f(string s) {\n string t = s;\n reverse(t.begin(), t.end());\n return s == t;\n}\n\nint main() {\n ios_base::sync_with_stdio(0);\n cin.tie(nullptr), stndrtn();\n string s;\n cin >> s;\n int n = sz(s);\n string r = s.substr(0, (n-1)/2);\n string t = s.substr((n+3)/2-1, n-(n+3)/2+1);\n if (f(r) && f(t) && f(s))\n cout << \"Yes\";\n else\n cout << \"No\";\n return 0;\n}\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>package com.kylecorry.andromeda.pdf\n\nimport java.io.BufferedReader\nimport java.io.InputStream\nimport java.io.InputStreamReader\n\nclass PDFParser {\n\n fun parse(pdf: InputStream, ignoreStreams: Boolean = false): List<PDFObject> {\n val properties = mutableMapOf<String, MutableList<String>>()\n val streams = mutableMapOf<String, MutableList<String>>()\n var lastObject: String? = null\n var streamIndex = -1\n var inStream = false\n val objectStart = Regex(\"(\\\\d+ \\\\d+) obj\")\n val objectEnd = Regex(\"endobj\")\n val streamStart = Regex(\"stream\")\n val streamEnd = Regex(\"endstream\")\n BufferedReader(InputStreamReader(pdf)).use { reader ->\n while (true) {\n val line = reader.readLine() ?: break\n if (line.matches(objectStart)) {\n val matches = objectStart.find(line) ?: continue\n val key = matches.groupValues[1]\n properties[key] = mutableListOf()\n lastObject = key\n streamIndex = -1\n inStream = false\n continue\n }\n\n if (line.matches(objectEnd)) {\n lastObject = null\n inStream = false\n continue\n }\n\n if (line.matches(streamStart)) {\n inStream = true\n streamIndex++\n continue\n }\n\n if (line.matches(streamEnd)) {\n inStream = false\n continue\n }\n\n if (line.startsWith(\">>\") || line.startsWith(\"<<\")) {\n continue\n }\n\n\n if (!inStream) {\n lastObject?.let {\n properties[it]!!.add(line)\n }\n }\n\n if (!ignoreStreams && inStream) {\n lastObject?.let {\n if (!streams.containsKey(it)) {\n streams[it] = mutableListOf()\n }\n\n if (streams[it]!!.size <= streamIndex) {\n streams[it]!!.add(\"\")\n }\n\n streams[it]!![streamIndex] += line\n }\n }\n }\n }\n\n val objects = mutableListOf<PDFObject>()\n for (key in properties.keys) {\n objects.add(PDFObject(key, properties[key]!!, streams[key] ?: emptyList()))\n }\n\n return objects.sortedBy { it.id }\n }\n\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>package experiments.set2;\n\nimport AMSPlayground.*;\nimport Group12.Group12AI;\nimport game.Game;\nimport game.types.state.GameType;\nimport main.collections.FastArrayList;\nimport mcts.*;\nimport util.*;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * A simple tutorial that demonstrates a variety of useful methods provided\n * by the Ludii general game system.\n *\n * @author Dennis Soemers\n */\npublic class FinalExperiments20 {\n\n public static void main(final String[] args) {</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import httplib2\nimport urllib\nimport huxt as H\nimport os\nfrom pyhdf.SD import SD, SDC \nimport numpy as np\nimport astropy.units as u\nfrom scipy.io import netcdf\n\n\ndef get_MAS_boundary_conditions(cr=np.NaN, observatory='', runtype='', runnumber=''):\n \"\"\"\n A function to grab the Vr and Br boundary conditions from MHDweb. An order\n of preference for observatories is given in the function. Checks first if\n the data already exists in the HUXt boundary condition folder\n\n Parameters\n ----------\n cr : INT\n Carrington rotation number \n observatory : STRING\n Name of preferred observatory (e.g., 'hmi','mdi','solis',\n 'gong','mwo','wso','kpo'). Empty if no preference and automatically selected \n runtype : STRING\n Name of preferred MAS run type (e.g., 'mas','mast','masp').\n Empty if no preference and automatically selected \n runnumber : STRING\n Name of preferred MAS run number (e.g., '0101','0201').\n Empty if no preference and automatically selected \n\n Returns\n -------\n flag : INT\n 1 = successful download. 0 = files exist, -1 = no file found.\n\n \"\"\"\n \n assert(np.isnan(cr) == False)\n \n # The order of preference for different MAS run results\n overwrite = False\n if not observatory:\n observatories_order = ['hmi', 'mdi', 'solis', 'gong', 'mwo', 'wso', 'kpo']\n else:\n observatories_order = [str(observatory)]\n overwrite = True # If the user wants a specific observatory, overwrite what's already downloaded\n \n if not runtype:\n runtype_order = ['masp', 'mas', 'mast']\n else:\n runtype_order = [str(runtype)]\n overwrite = True\n \n if not runnumber:\n runnumber_order = ['0201', '0101']\n else:\n runnumber_order = [str(runnumber)]\n overwrite = True\n \n # Get the HUXt boundary condition directory\n dirs = H._setup_dirs_()\n _boundary_dir_ = dirs['boundary_conditions'] \n \n # Example URL: http://www.predsci.com/data/runs/cr2010-medium/mdi_mas_mas_std_0101/helio/br_r0.hdf\n heliomas_url_front = 'http://www.predsci.com/data/runs/cr'\n heliomas_url_end = '_r0.hdf'\n \n vrfilename = 'HelioMAS_CR'+str(int(cr)) + '_vr'+heliomas_url_end\n brfilename = 'HelioMAS_CR'+str(int(cr)) + '_br'+heliomas_url_end\n \n if (os.path.exists(os.path.join(_boundary_dir_, brfilename)) == False or\n os.path.exists(os.path.join(_boundary_dir_, vrfilename)) == False or\n overwrite == True): # Check if the files already exist\n\n # Search MHDweb for a HelioMAS run, in order of preference\n h = httplib2.Http()\n foundfile = False\n for masob in observatories_order:\n for masrun in runtype_order:\n for masnum in runnumber_order:\n urlbase = (heliomas_url_front + str(int(cr)) + '-medium/' + masob + '_' +\n masrun + '_mas_std_' + masnum + '/helio/')\n url = urlbase + 'br' + heliomas_url_end\n\n # See if this br file exists\n resp = h.request(url, 'HEAD')\n if int(resp[0]['status']) < 400:\n foundfile = True\n \n # Exit all the loops - clumsy, but works\n if foundfile: \n break\n if foundfile:\n break\n if foundfile:\n break\n \n if foundfile == False:\n print('No data available for given CR and observatory preferences')\n return -1\n \n # Download teh vr and br files\n print('Downloading from: ', urlbase)\n urllib.request.urlretrieve(urlbase + 'br' + heliomas_url_end,\n os.path.join(_boundary_dir_, brfilename))\n urllib.request.urlretrieve(urlbase+'vr'+heliomas_url_end,\n os.path.join(_boundary_dir_, vrfilename))\n \n return 1\n else:\n print('Files already exist for CR' + str(int(cr)))\n return 0\n\n \ndef read_MAS_vr_br(cr):\n \"\"\"\n A function to read in the MAS coundary conditions for a given CR\n\n Parameters\n ----------\n cr : INT\n Carrington rotation number\n\n Returns\n -------\n MAS_vr : NP ARRAY (NDIM = 2)\n Solar wind speed at 30rS, in km/s\n MAS_vr_Xa : NP ARRAY (NDIM = 1)\n Carrington longitude of Vr map, in rad\n MAS_vr_Xm : NP ARRAY (NDIM = 1)</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_CSS_>@import url('https://fonts.googleapis.com/css?family=Lato');\n\nhtml, body {\nheight: 100%;\n margin: 0px; \n}\n\n\n.wrapper {\n display: flex;\n height: 100%;\n}\n\n.side {\n flex: 1;\n}\n\n.font{\n width: 100%;\n margin: 0px;\n}\n\n\n.side:last-of-type {\n display: flex;</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import math\nA, B = map(int, input().split())\nprint(A * B / gcd(A, B))\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_XML_><?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd\">\n <modelVersion>4.0.0</modelVersion>\n\n <parent>\n <groupId>com.makimenko.fs</groupId>\n <artifactId>fs-bff-parent</artifactId>\n <version>1.0.0</version>\n </parent>\n\n <artifactId>fs-bff-persistence</artifactId>\n <version>1.0.0</version>\n <name>FS BFF - Persistence (MongoDB)</name>\n <packaging>jar</packaging>\n\n <dependencies>\n <dependency>\n <groupId>com.makimenko.fs</groupId>\n <artifactId>fs-bff-domain</artifactId>\n <version>${project.version}</version>\n </dependency>\n <dependency>\n <groupId>org.projectlombok</groupId>\n <artifactId>lombok</artifactId>\n </dependency>\n <dependency>\n <groupId>org.springframework</groupId>\n <artifactId>spring-context</artifactId>\n </dependency>\n <dependency>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-data-mongodb</artifactId>\n </dependency>\n <dependency>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-cache</artifactId>\n </dependency>\n <dependency>\n <groupId>junit</groupId>\n <artifactId>junit</artifactId>\n <scope>test</scope>\n </dependency>\n <dependency>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-starter-test</artifactId>\n <scope>test</scope>\n </dependency>\n\n <dependency>\n <groupId>de.flapdoodle.embed</groupId>\n <artifactId>de.flapdoodle.embed.mongo</artifactId>\n <scope>test</scope>\n </dependency>\n <dependency>\n <groupId>cz.jirutka.spring</groupId>\n <artifactId>embedmongo-spring</artifactId>\n <scope>test</scope>\n </dependency>\n </dependencies>\n\n <build>\n <plugins>\n <plugin>\n <groupId>org.springframework.boot</groupId>\n <artifactId>spring-boot-maven-plugin</artifactId>\n </plugin>\n </plugins>\n </build>\n\n</project>\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import _plotly_utils.basevalidators\n\n\nclass BgcolorValidator(_plotly_utils.basevalidators.ColorValidator):\n def __init__(self, plotly_name=\"bgcolor\", parent_name=\"layout.scene\", **kwargs):\n super(BgcolorValidator, self).__init__(\n plotly_name=plotly_name,\n parent_name=parent_name,\n edit_type=kwargs.pop(\"edit_type\", \"plot\"),\n role=kwargs.pop(\"role\", \"style\"),\n **kwargs\n )\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>\n\nclass CaptionReadError(Exception):\n \"\"\"\n Generic error raised when the reading of the caption file failed.\n \"\"\"\n def __str__(self):\n return \"%s(%s)\" % (self.__class__.__name__, self.args)\n\n\nclass CaptionReadNoCaptions(CaptionReadError):\n \"\"\"\n Error raised when the provided caption file was not containing any\n actual captions.\n \"\"\"\n\n\nclass CaptionReadSyntaxError(CaptionReadError):\n \"\"\"\n Error raised when the provided caption file has syntax errors and could\n not be parsed.\n \"\"\"\n\n\nclass CaptionReadTimingError(CaptionReadError):\n \"\"\"\n Error raised when a Caption is initialized with invalid timings.\n \"\"\"\n\n\nclass RelativizationError(Exception):\n \"\"\"\n Error raised when absolute positioning cannot be converted to\n percentage\n \"\"\"\n\n\nclass InvalidInputError(RuntimeError):\n \"\"\" Error raised when the input is invalid (i.e. a unicode string)\n \"\"\"\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>N,K=map(int,input().split())\nprint(N-K+1)</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>__all__ = [\"ModelAdapter\"]\n\nfrom icevision.models.mmdet.lightning.model_adapter import MMDetModelAdapter\nfrom icevision.models.mmdet.common.mask import convert_raw_predictions\n\n\nclass ModelAdapter(MMDetModelAdapter):\n def convert_raw_predictions(self, batch, raw_preds, records):\n return convert_raw_predictions(\n batch=batch, raw_preds=raw_preds, records=records, detection_threshold=0.0\n )\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>#include <iostream>\n#include <fstream>\n#include <iomanip>\n#include <climits>\n#include <limits>\n#include <algorithm>\n#include <vector>\n#include <deque>\n#include <queue>\n#include <list>\n#include <stack>\n#include <string>\n#include <functional>\n#include <numeric>\n#include <map>\n#include <set>\n#include <cstdlib>\n#include <bitset>\n#include <unordered_map>\n#include <random>\n#include <cmath>\n#include <complex>\n\nusing namespace std;\n\nusing vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;\nusing ll = long long int;\nusing vll = vector<ll>; using vvll = vector<vll>; using vvvll = vector<vvll>;\nusing vd = vector<double>; using vvd = vector<vd>; using vvvd = vector<vvd>;\nusing P = pair<int, int>;\nusing Pll = pair<ll, ll>;\nusing cdouble = complex<double>;\n\nconst double eps = 1e-9;\nconst double INFD = numeric_limits<double>::infinity();\nconst double PI = 3.14159265358979323846;\n#define Loop(i, n) for(int i = 0; i < (int)n; i++)\n#define Loopll(i, n) for(ll i = 0; i < (ll)n; i++)\n#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)\n#define Loopll1(i, n) for(ll i = 1; i <= (ll)n; i++)\n#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)\n#define Looprll(i, n) for(ll i = (ll)n - 1; i >= 0; i--)\n#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)\n#define Looprll1(i, n) for(ll i = (ll)n; i >= 1; i--)\n#define Foreach(buf, container) for(auto buf : container)\n#define Loopdiag(i, j, h, w, sum) for(int i = ((sum) >= (h) ? (h) - 1 : (sum)), j = (sum) - i; i >= 0 && j < (w); i--, j++)\n#define Loopdiagr(i, j, h, w, sum) for(int j = ((sum) >= (w) ? (w) - 1 : (sum)), i = (sum) - j; j >= 0 && i < (h); j--, i++)\n#define Loopdiagsym(i, j, h, w, gap) for (int i = ((gap) >= 0 ? (gap) : 0), j = i - (gap); i < (h) && j < (w); i++, j++)\n#define Loopdiagsymr(i, j, h, w, gap) for (int i = ((gap) > (h) - (w) - 1 ? (h) - 1 : (w) - 1 + (gap)), j = i - (gap); i >= 0 && j >= 0; i--, j--)\n#define Loopitr(itr, container) for(auto itr = container.begin(); itr != container.end(); itr++)\n#define printv(vector) Loop(ex_i, vector.size()) { cout << vector[ex_i] << \" \"; } cout << endl;\n#define printmx(matrix) Loop(ex_i, matrix.size()) { Loop(ex_j, matrix[ex_i].size()) { cout << matrix[ex_i][ex_j] << \" \"; } cout << endl; }\n#define quickio() ios::sync_with_stdio(false); cin.tie(0);\n#define bitmanip(m,val) static_cast<bitset<(int)m>>(val)\n#define Comp(type_t) bool operator<(const type_t &another) const\n#define fst first\n#define snd second\nbool nearlyeq(double x, double y) { return abs(x - y) < eps; }\nbool inrange(ll x, ll t) { return x >= 0 && x < t; }\nbool inrange(vll xs, ll t) { Foreach(x, xs) if (!(x >= 0 && x < t)) return false; return true; }\nint ceillog2(ll x) { int ret = 0;\tx--; while (x > 0) { ret++; x >>= 1; } return ret; }\nll rndf(double x) { return (ll)(x + (x >= 0 ? 0.5 : -0.5)); }\nll floorsqrt(ll x) { ll m = (ll)sqrt((double)x); return m + (m * m <= x ? 0 : -1); }\nll ceilsqrt(ll x) { ll m = (ll)sqrt((double)x); return m + (x <= m * m ? 0 : 1); }\nll rnddiv(ll a, ll b) { return (a / b + (a % b * 2 >= b ? 1 : 0)); }\nll ceildiv(ll a, ll b) { return (a / b + (a % b == 0 ? 0 : 1)); }\nll gcd(ll m, ll n) { if (n == 0) return m; else return gcd(n, m % n); }\nll lcm(ll m, ll n) { return m * n / gcd(m, n); }\n\n/*******************************************************/\n\nint main() {\n\tint a, b, c; cin >> a >> b >> c;\n\tif (a == b && b == c) {\n\t\tcout << \"Yes\" << endl;\n\t}\n\telse {\n\t\tcout << \"No\" << endl;\n\t}\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_># Generated by the protocol buffer compiler. DO NOT EDIT!\n# source: google/ads/googleads/v7/enums/lead_form_desired_intent.proto\n\nrequire 'google/protobuf'\n\nrequire 'google/api/annotations_pb'\nGoogle::Protobuf::DescriptorPool.generated_pool.build do\n add_file(\"google/ads/googleads/v7/enums/lead_form_desired_intent.proto\", :syntax => :proto3) do\n add_message \"google.ads.googleads.v7.enums.LeadFormDesiredIntentEnum\" do\n end\n add_enum \"google.ads.googleads.v7.enums.LeadFormDesiredIntentEnum.LeadFormDesiredIntent\" do\n value :UNSPECIFIED, 0\n value :UNKNOWN, 1\n value :LOW_INTENT, 2\n value :HIGH_INTENT, 3\n end\n end\nend\n\nmodule Google\n module Ads\n module GoogleAds\n module V7\n module Enums\n LeadFormDesiredIntentEnum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup(\"google.ads.googleads.v7.enums.LeadFormDesiredIntentEnum\").msgclass\n LeadFormDesiredIntentEnum::LeadFormDesiredIntent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup(\"google.ads.googleads.v7.enums.LeadFormDesiredIntentEnum.LeadFormDesiredIntent\").enummodule\n end\n end\n end\n end\nend\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_OCaml_>open Printf open Scanf\nmodule MyInt = struct let (+) = (+) let (-) = (-) let (/) = (/) let ( * ) = ( * ) let (mod) = (mod) let (%) = (mod) let (+=) r v = r := !r + v let (-=) r v = r := !r - v let ( *=) r v= r := !r * v let (/=) r v = r := !r / v let abs v = abs v let (land),(lor),(lxor),lnot,(lsl),(lsr),(asr) = (land),(lor),(lxor),lnot,(lsl),(lsr),(asr) let min_int,max_int = min_int,max_int end\nmodule MyInt64 = struct\n\tlet (+$) = (+) let (-$) = (-) let (/$) = (/) let ( *$) = ( * ) let (+) p q = Int64.add p q let (-) p q = Int64.sub p q let ( * ) p q = Int64.mul p q let (/) p q = Int64.div p q let (+=) r v = r := !r + v let (-=) r v = r := !r - v let ( *=) r v= r := !r * v let (/=) r v = r := !r / v let labs p = if p < 0L then -1L*p else p let (~|) p = Int64.to_int p let (~~|) p = Int64.of_int p let input_i64_array n = Array.init (~| n) (fun _ -> Scanf.scanf \" %Ld\" (fun v -> v)) let get_i64 _ = Scanf.scanf \" %Ld\" (fun v -> v) let get_2_i64 _ = Scanf.scanf \" %Ld %Ld\" (fun u v -> u,v) let get_3_i64 _ = Scanf.scanf \" %Ld %Ld %Ld\" (fun u v w -> u,v,w) let get_4_i64 _ = Scanf.scanf \" %Ld %Ld %Ld %Ld\" (fun u v w x -> u,v,w,x) let get_5_i64 _ = Scanf.scanf \" %Ld %Ld %Ld %Ld %Ld\" (fun u v w x y -> u,v,w,x,y) let print_i64_endline n = n |> Int64.to_string |> print_endline let (mod) m n = m - (m/n) * n let (%) = (mod) let rec gcd m n = match m,n with | m,0L -> m | m,n -> gcd n (m mod n) let lcm m n = (m*n) / gcd m n let rep from_ to_ fbod = let i,f = ref ~|from_,ref true in while !i <= ~|to_ && !f do match fbod ~~| !i with | `Break -> f := false | _ -> i := !i +$ 1; done let repb from_ to_ fbod = let i,f = ref ~|from_,ref true in while !i <= ~|to_ && !f do match fbod (~~| !i) with | `Break -> f := false | _ -> i := !i +$ 1 done; !f let repm from_ to_ m_init fbod = let i,f,m = ref ~|from_,ref true,ref m_init in while !i <= ~|to_ && !f do match fbod !m (~~| !i) with | `Break -> f := false | `Break_m m' -> (f := false; m := m') | `Ok m' -> (i := !i +$ 1; m := m') done; !m let repmb from_ to_ m_init fbod = let i,f,m = ref ~|from_,ref true,ref m_init in while !i <= ~|to_ && !f do match fbod (~~| !i) !m with | `Break -> f := false | `Break_m m' -> (f := false; m := m') | `Ok m' -> (i := !i +$ 1; m := m') done; (!m,!f) let string_of_list ?(separator=\" \") f ls = let rec f0 a s = match a with | [] -> s | [h] -> s ^ (f h) ^ separator | h::t -> f0 t (s ^ (f h) ^ separator) in f0 ls \"\" let char_list_of_string str = let rec f0 i a = if i<0 then a else f0 (i-$1) (str.[i]::a) in f0 (String.length str -$ 1) [] let string_of_char_list ls = List.fold_left (fun u v -> u ^ (String.make 1 v)) \"\" ls\n\tlet (@@@) = (@) let (@) a i = a.(~|i) let (<@) a (i,v) = a.(~|i) <- v\n\tlet ceildiv m n = (m+n-1L) / n\n\tlet abs v = Int64.abs v let (land),(lor),(lxor),lnot,(lsl),(lsr),(asr) = let open Int64 in (logand),(logor),(logxor),lognot,(fun u v -> shift_left u (~|v)),(fun u v -> shift_right u (~|v)),(fun u v -> shift_right_logical u (~|v)) let min_int,max_int = Int64.min_int,Int64.max_int let get_string _ = scanf \" %s\" (fun v -> v)\n\tlet i32,i64 = Int64.to_int,Int64.of_int let alen a = i64 @@ Array.length a\n\tlet dump_array a = a |> Array.to_list |> string_of_list Int64.to_string |> print_endline let i32_get_int _ = Scanf.scanf \" %d\" (fun v -> v) let i32_get_2_ints _ = Scanf.scanf \" %d %d\" (fun u v -> u,v) let i32_get_3_ints _ = Scanf.scanf \" %d %d %d\" (fun u v w -> u,v,w) let i32_get_4_ints _ = Scanf.scanf \" %d %d %d %d\" (fun u v w x -> u,v,w,x) let i32_get_5_ints _ = Scanf.scanf \" %d %d %d %d %d\" (fun u v w x y -> u,v,w,x,y) let repi from_ to_ fbod = let i,f = ref from_,ref true in while !i <= to_ && !f do match fbod !i with | `Break -> f := false | _ -> i := !i +$ 1 done\nend open MyInt64\n\nmodule ISet = Set.Make(struct type t = int64 * int64 let compare = compare end)\nlet n = get_i64 0\nlet dat = Array.init (i32 n) (fun _ -> get_3_i64 0) \nlet ff = ref false \nlet xx,yy,hh = ref 0L,ref 0L,ref 0L \n\nlet cartesian_product a b =\n let open List in\n let mk_tuple l n = map (fun x -> (n,x)) l in \n a |> map (mk_tuple b) |> fold_left append []\nlet r a b =\n\tlet l = ref [] in for i=a to b do l := i :: !l done;!l\n\nlet () =\n\tlet l = r 0 100 in\n\tlet a = cartesian_product l l |> Array.of_list in\n\tArray.sort (fun _ _ -> (Random.int 3) -$ 1) a;\n\t(* Array.iter (fun (x,y) -> printf \"%d %d\\n\" x y) a; *)\n\tArray.iter (fun (x,y) ->\n\t\tlet x,y = i64 x, i64 y in\n\t\t\tlet h,f = Array.fold_left (fun (h,f) (p,q,r) ->\n\t\t\tlet d = labs (p-x) + labs (q-y) in\n\t\t\tlet h2 = r + d in\n\t\t\t(* printf \" %Ld %Ld\\n\" h h2; *)\n\t\t\tif r = 0L then (\n\t\t\t\tif h - d > 0L then (\n\t\t\t\t\t(h,false)\n\t\t\t\t) else (h,f)\n\t\t\t)else if h = -1L then (\n\t\t\t\t(h2,f)\n\t\t\t) else if h <> h2 then (\n\t\t\t\t(h,false)\n\t\t\t) else (\n\t\t\t\t(h,f)\n\t\t\t)\n\t\t) (-1L,true) dat in\n\t\tif h > 0L && f then (\n\t\t\tprintf \"%Ld %Ld %Ld\\n\" x y h; exit 0;\n\t\t)\n\t) a</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Go_>func (hs *HelmSuite) TestRookInstallViaHelm() {\n\tcheckIfRookClusterIsInstalled(hs.Suite, hs.kh, hs.namespace, hs.namespace, 1)\n}\n\n//Test BlockCreation on Rook that was installed via Helm\nfunc (hs *HelmSuite) TestBlockStoreOnRookInstalledViaHelm() {\n\trunBlockE2ETestLite(hs.helper, hs.kh, hs.Suite, hs.namespace)\n}\n\n//Test File System Creation on Rook that was installed via helm\nfunc (hs *HelmSuite) TestFileStoreOnRookInstalledViaHelm() {\n\trunFileE2ETestLite(hs.helper, hs.kh, hs.Suite, hs.namespace, \"testfs\")\n}\n\n//Test Object StoreCreation on Rook that was installed via helm\nfunc (hs *HelmSuite) TestObjectStoreOnRookInstalledViaHelm() {\n\trunObjectE2ETestLite(hs.helper, hs.kh, hs.Suite, hs.namespace, \"default\", 3)\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Nim_>import hashes\n\ntype\n # the bits of a primitive numerical (signed, unsigned or floating) type\n BitsKind* = enum\n bitsWord\n bitsCustom\n Bits* = object\n case kind*: BitsKind\n of bitsWord: discard\n of bitsCustom: bits*: uint8\n\nproc toBits*(bits: uint8): Bits =\n return Bits(kind: bitsCustom, bits: bits)\n\nproc `==`*(lhs: Bits, rhs: Bits): bool =\n case lhs.kind\n of bitsWord: return rhs.kind == bitsWord\n of bitsCustom: return rhs.kind == bitsCustom and lhs.bits == rhs.bits\n\nproc hash*(bits: Bits): Hash =\n var h: Hash = 0\n h = h !& bits.kind.int\n case bits.kind\n of bitsWord:\n discard\n of bitsCustom:\n h = h !& bits.bits.int\n result = !$h\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C#_>// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing Microsoft.Build.Framework;\nusing NuGet.Frameworks;\nusing System;\nusing System.IO;\nusing System.Reflection.Metadata;\nusing System.Reflection.PortableExecutable;\n\nnamespace Microsoft.DotNet.Build.Tasks.Packaging\n{\n public class PackageItem\n {\n public PackageItem(ITaskItem item)\n {\n OriginalItem = item;\n SourcePath = item.GetMetadata(\"FullPath\");\n SourceProject = GetMetadata(\"MSBuildSourceProjectFile\");\n string value = GetMetadata(\"TargetFramework\");\n if (!String.IsNullOrWhiteSpace(value))\n {\n TargetFramework = NuGetFramework.Parse(value);\n }\n TargetPath = item.GetMetadata(nameof(TargetPath));\n AdditionalProperties = GetMetadata(nameof(AdditionalProperties));\n UndefineProperties = GetMetadata(nameof(UndefineProperties));\n HarvestedFrom = GetMetadata(nameof(HarvestedFrom));\n Package = GetMetadata(\"PackageId\");\n PackageVersion = GetMetadata(\"PackageVersion\");\n IsDll = Path.GetExtension(SourcePath).Equals(\".dll\", StringComparison.OrdinalIgnoreCase);\n IsPlaceholder = NuGetAssetResolver.IsPlaceholder(SourcePath);\n IsRef = TargetPath.StartsWith(\"ref/\", StringComparison.OrdinalIgnoreCase);\n\n // determine if we need to append filename to TargetPath\n // see https://docs.nuget.org/create/nuspec-reference#specifying-files-to-include-in-the-package\n // SourcePath specifies file and target specifies file - do nothing\n // SourcePath specifies file and Target specifies directory - copy filename\n // SourcePath specifies wildcard files - copy wildcard\n // SourcePath specifies recursive wildcard - do not allow, recursive directory may impact asset selection\n // we don't want to attempt to expand the wildcard since the build may not yet be complete.\n\n if (SourcePath.Contains(\"**\"))\n {\n throw new ArgumentException($\"Recursive wildcards \\\"**\\\" are not permitted in source paths for packages: {SourcePath}. Recursive directory may impact asset selection and we don't want to attempt to expand the wildcard since the build may not yet be complete.\");\n }\n\n string sourceFile = Path.GetFileName(SourcePath);\n if (!Path.GetExtension(TargetPath).Equals(Path.GetExtension(sourceFile), StringComparison.OrdinalIgnoreCase) ||\n sourceFile.Contains(\"*\"))\n {\n TargetPath = Path.Combine(TargetPath, sourceFile);\n }\n\n // standardize to /\n TargetPath = TargetPath.Replace('\\\\', '/');\n\n int dirLength = TargetPath.LastIndexOf('/');\n TargetDirectory = (dirLength > 0) ? TargetPath.Substring(0, dirLength) : String.Empty;\n }\n\n private Version _version;\n public Version Version\n {\n get\n {\n if (_version == null)\n {\n string versionString = OriginalItem.GetMetadata(\"AssemblyVersion\");\n\n if (!String.IsNullOrWhiteSpace(versionString))\n {\n Version.TryParse(versionString, out _version);\n }\n\n if (_version == null && IsDll && File.Exists(SourcePath))\n {\n _version = VersionUtility.GetAssemblyVersion(SourcePath);\n }\n }\n\n return _version;\n }\n }\n\n public bool IsDll { get; }\n public bool IsPlaceholder { get; }\n public bool IsRef { get; }\n public ITaskItem OriginalItem { get; }\n public string SourcePath { get; }\n public string SourceProject { get; }\n public string AdditionalProperties { get; }\n public string UndefineProperties { get; }\n public string HarvestedFrom { get; }\n public NuGetFramework TargetFramework { get; }\n public string TargetDirectory { get; }\n public string TargetPath { get; }\n public string Package { get; }\n public string PackageVersion { get; }\n\n private string GetMetadata(string name)\n {\n var value = OriginalItem.GetMetadata(name);\n return (value?.Length > 0) ? value : null;\n }\n }\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_> t.timestamps\n end\n end\nend\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.