images
images listlengths 1
1
| texts
listlengths 1
1
|
|---|---|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>N = int(input())\na = list(map(int, input().split()))\ncount = 0\nfor i in range(N):\n if ((i + 1) % 2 == 1 and a[i] % 2 == 1):\n count += 1\nprint(count)</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>#include<iostream>\n#include<cmath>\n#include<cstdio>\nusing namespace std;\n\nstruct edge{\n\tint city1,city2,cost1to2,cost2to1;\n};\n\n\n\nint main(){\n\tint n=0,m=0,start=0,goal=0,budget=0,treecost=0;\n\tcin>>n>>m;\n\tedge node[m+1];\n\tfor(int i=1;i<=m;i++){\n\t\tscanf(\"%d,%d,%d,%d\",&node[i].city1,&node[i].city2,&node[i].cost1to2,&node[i].cost2to1);\n\t}\n\tscanf(\"%d,%d,%d,%d\",&start,&goal,&budget,&treecost);\n\tint dp[n+1][n+1];\n\tfor(int i=1;i<=n;i++){\n\t\tfor(int j=1;j<=n;j++){\n\t\t\tdp[i][j]=10000;\n\t\t}\n\t}\n\tfor(int i=1;i<=m;i++){\n\t\tdp[node[i].city1][node[i].city2]=node[i].cost1to2;\n\t\tdp[node[i].city2][node[i].city1]=node[i].cost2to1;\n\t}\n\tfor(int j=1;j<=n;j++){\n\t\tfor(int k=1;k<=n;k++){\n\t\t\tfor(int l=1;l<=n;l++){\n\t\t\t\tif(!(j==k || k==l || l==j))dp[j][k]=min(dp[j][k],dp[j][l]+dp[l][k]);\n\t\t\t}\n\t\t}\n\t}\n\tfor(int j=1;j<=n;j++){\n\t\tfor(int k=1;k<=n;k++){\n\t\t\tfor(int l=1;l<=n;l++){\n\t\t\t\tif(!(j==k || k==l || l==j))dp[j][k]=min(dp[j][k],dp[j][l]+dp[l][k]);\n\t\t\t}\n\t\t}\n\t}\n\tcout<<dp[start][goal]<<endl;\n\tcout<<budget-treecost-dp[start][goal]-dp[goal][start]<<endl;\n\treturn 0;\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>\n var rememberCurrent = function(_collection, _document, _arguments) {\n currentCollection = _collection;\n currentDocument = _document;\n currentArguments = _arguments;\n };\n\n var logAction = function(_action) {\n if (!annotationLoggingOn) {\n // logging not requested for current collection\n return false;\n } else {\n dispatcher.post('ajax', [ {\n action: 'logAnnotatorAction',\n collection: currentCollection,\n 'document': currentDocument,\n log: _action,\n }, null]);\n }\n }\n\n dispatcher.\n on('collectionLoaded', rememberLoggingState).\n on('current', rememberCurrent).\n on('logAction', logAction);\n }\n\n return AnnotationLog;\n})(window);\n\nmodule.exports = AnnotationLog;</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_XML_> <Script file=\"Locales\\enUS.lua\"/>\n\n <Script file=\"Currency.lua\"/>\n</Ui></code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C#_> cb.Tag = new cbTag(es.group, tb);\n if (CurrentGroup != es.group)\n {\n cb.Checked = true;\n }\n else\n {\n tb.Enabled = false;\n }\n\n cb.CheckedChanged += this.CheckBox_CheckedChanged;\n }\n\n if (es.optional > 0 || es.repeat > 0 && this.repeatcount > 0)\n {\n var cb = new CheckBox();\n cb.Text = \"Use this value?\";\n panel1.Controls.Add(cb);\n cb.Location = new Point(10, ypos);\n ypos += 24;\n cb.Tag = new repeatCbTag(tb, this.elements.Count);\n if (data == null)\n {\n tb.Enabled = false;\n }\n else\n {\n cb.Checked = true;\n }\n\n cb.CheckedChanged += this.RepeatCheckBox_CheckedChanged;\n }\n\n if ((CurrentGroup == 0 && es.group != 0) || (CurrentGroup != 0 && es.group != 0 && CurrentGroup != es.group))\n {\n CurrentGroup = es.group;\n groupOffset = offset;\n }\n else if (CurrentGroup != 0 && es.group == 0)\n {\n CurrentGroup = 0;\n }\n else if (CurrentGroup != 0 && CurrentGroup == es.group)\n {\n offset = groupOffset;\n }\n\n this.valueTypes.Add(es.type);\n if (data != null)\n {\n switch (es.type)\n {\n case ElementValueType.UInt:\n {\n var v = TypeConverter.h2i(data[offset], data[offset + 1], data[offset + 2], data[offset + 3]);\n flagValue = v;\n flagSize = 4;\n tb.Text = hasFlags || es.hexview ? \"0x\" + v.ToString(\"X8\") : v.ToString();\n offset += 4;\n }\n\n break;\n case ElementValueType.Int:\n {\n var v = TypeConverter.h2si(data[offset], data[offset + 1], data[offset + 2], data[offset + 3]);\n flagValue = (uint)v;\n flagSize = 4;\n tb.Text = hasFlags || es.hexview ? \"0x\" + v.ToString(\"X8\") : v.ToString();\n offset += 4;\n }\n\n break;\n case ElementValueType.FormID:\n tb.Text = TypeConverter.h2i(data[offset], data[offset + 1], data[offset + 2], data[offset + 3]).ToString(\"X8\");\n offset += 4;\n break;\n case ElementValueType.Float:\n tb.Text = TypeConverter.h2f(data[offset], data[offset + 1], data[offset + 2], data[offset + 3]).ToString();\n offset += 4;\n break;\n case ElementValueType.UShort:\n {\n var v = TypeConverter.h2s(data[offset], data[offset + 1]);\n flagValue = v;\n flagSize = 2;\n tb.Text = hasFlags || es.hexview ? \"0x\" + v.ToString(\"X4\") : v.ToString();\n offset += 2;\n }\n\n break;\n case ElementValueType.Short:\n {\n var v = TypeConverter.h2ss(data[offset], data[offset + 1]);\n flagValue = (uint)v;\n flagSize = 2;\n tb.Text = hasFlags || es.hexview ? \"0x\" + v.ToString(\"X4\") : v.ToString();\n offset += 2;\n }\n\n break;\n case ElementValueType.Byte:\n {\n var v = data[offset];\n flagValue = v;\n flagSize = 1;\n tb.Text = hasFlags || es.hexview ? \"0x\" + v.ToString(\"X2\") : v.ToString();\n offset++;\n }\n\n break;\n case ElementValueType.SByte:\n {\n var v = (sbyte)data[offset];\n flagValue = (uint)v;\n flagSize = 1;\n tb.Text = hasFlags || es.hexview ? \"0x\" + v.ToString(\"X2\") : v.ToString();\n offset++;\n }\n\n break;\n case ElementValueType.String:\n {\n string s = string.Empty;\n while (data[offset] != 0)\n {\n s += (char)data[offset++];\n }\n\n offset++;\n tb.Text = s;\n tb.Width += 200;\n }\n\n break;\n case ElementValueType.BString:\n {\n int len = TypeConverter.h2s(data[offset], data[offset + 1]);\n string s = Encoding.Instance.GetString(data, offset + 2, len);\n offset = offset + (2 + len);\n tb.Text = s;\n tb.Width += 200;\n }\n\n break;\n case ElementValueType.IString:\n {\n int len = TypeConverter.h2si(data[offset], data[offset + 1], data[offset + 2], data[offset + 3]);\n string s = Encoding.Instance.GetString(data, offset + 4, len);\n offset = offset + (4 + len);\n tb.Text = s;\n tb.Width += 200;\n }\n\n break;\n case ElementValueType.LString:\n {\n int left = data.Length - offset;\n uint id = (left < 4) ? 0 : TypeConverter.h2i(data[offset], data[offset + 1], data[offset + 2], data[offset + 3]);\n bool isString = TypeConverter.IsLikelyString(new ArraySegment<byte>(data, offset, left));\n int strOffset = offset;\n string s = null;\n if (isString)\n {\n s = TypeConverter.GetString(new ArraySegment<byte>(data, offset, data.Length - offset));\n tb.Text = 0.ToString(\"X8\");\n offset += s.Length;\n }\n else\n {\n offset += 4;\n tb.Text = id.ToString(\"X8\");\n if (this.strIDLookup != null)\n {\n s = this.strIDLookup(id);\n }\n }\n\n tb.Tag = new lTag(tb, s, data, strOffset, isString);\n }\n\n break;\n case ElementValueType.Str4:\n {\n string s = Encoding.Instance.GetString(data, offset, 4);\n offset += 4;\n tb.MaxLength = 4;\n tb.Text = s;\n }\n\n break;\n default:\n throw new ApplicationException();\n }\n }\n else\n {\n if (es.type == ElementValueType.String || es.type == ElementValueType.BString || es.type == ElementValueType.LString || es.type == ElementValueType.IString)\n {\n tb.Width += 200;\n }\n\n if (this.removedStrings.ContainsKey(this.boxes.Count - 1))\n {\n tb.Text = this.removedStrings[this.boxes.Count - 1];\n }\n }\n\n var l = new Label();</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import pygame\r\nclass buton:\r\n def __init__(self , rect , color , text = ''):\r\n self.rect = rect\r\n self.color = color\r\n self.text = text\r\n def draw(self , Surface , functie):\r\n pygame.draw.rect(Surface , self.color , self.rect)\r\n if not (self.text == ''):\r\n fonttype = pygame.font.SysFont('Arial' , 20)\r\n textsurface = fonttype.render(self.text , False , (0,0,0))\r\n Surface.blit(textsurface , (self.rect[0] + 10 , self.rect[1] + 5))\r\n for event in pygame.event.get():\r\n if event.type == pygame.MOUSEBUTTONDOWN:\r\n if event.button == 1:\r\n if event.pos[0] > self.rect[0] and event.pos[0] < self.rect[0]+self.rect[2] and event.pos[1] > self.rect[1] and event.pos[1] < self.rect[1] + self.rect[3]:\r\n return functie()\r\n if event.type == pygame.QUIT:\r\n exit()\r\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Rust_>use cargo_test_support::compare::assert;\nuse cargo_test_support::prelude::*;\nuse cargo_test_support::Project;\n\nuse crate::cargo_add::init_registry;\nuse cargo_test_support::curr_dir;\n\n#[cargo_test]\nfn overwrite_no_optional() {\n init_registry();\n let project = Project::from_template(curr_dir!().join(\"in\"));\n let project_root = project.root();\n let cwd = &project_root;\n\n snapbox::cmd::Command::cargo()\n .arg(\"add\")\n .arg_line(\"my-package1 my-package2@0.4.1 --no-optional\")\n .current_dir(cwd)\n .assert()\n .success()\n .stdout_matches_path(curr_dir!().join(\"stdout.log\"))\n .stderr_matches_path(curr_dir!().join(\"stderr.log\"));\n\n assert().subset_matches(curr_dir!().join(\"out\"), &project_root);\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import math\na, b= map( int,input().split() )\n\nprint( math.floor( a * b ) )</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>// AUTOGENERATED FILE - DO NOT MODIFY!\n// This file generated by Djinni from example.djinni\n\n#import \"TXSSortOrderTranslator+Private.h\"\n#import <Foundation/Foundation.h>\n\nstatic_assert(__has_feature(objc_arc), \"Djinni requires ARC to be enabled for this file\");\n\n@implementation TXSSortOrderTranslator\n\n+ (TXSSortOrder)cppSortOrderToObjcSortOrder:(::textsort::sort_order)sortOrder\n{\n return static_cast<TXSSortOrder>(sortOrder);\n}\n\n+ (::textsort::sort_order)objcSortOrderToCppSortOrder:(TXSSortOrder)sortOrder\n{\n return static_cast<enum ::textsort::sort_order>(sortOrder);\n}\n\n@end\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>StartTest(function(t) {\n \n\tt.plan(18)\n \n var async0 = t.beginAsync()\n\t\n use('JooseX.CPS', function () {\n \n //======================================================================================================================================================================================================================================================\n t.diag('Sanity')\n \n t.ok(JooseX.CPS, \"JooseX.CPS is here\")\n t.ok(JooseX.CPS.Builder, \"JooseX.CPS.Builder is here\")\n t.ok(JooseX.CPS.Continuation, \"JooseX.CPS.Continuation is here\")\n\n //======================================================================================================================================================================================================================================================\n t.diag('Class creation')\n \n </code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>// Copyright (c) 2011-2013 The Bitcoin Core developers\n// Copyright (c) 2015-2017 The PIVX developers \n// Copyright (c) 2015-2017 The ALQO developers\n// Copyright (c) 2017-2018 The nood developers\n// Distributed under the MIT/X11 software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include \"macnotificationhandler.h\"\n\n#undef slots\n#import <objc/runtime.h>\n#include <Cocoa/Cocoa.h>\n\n// Add an obj-c category (extension) to return the expected bundle identifier\n@implementation NSBundle(returnCorrectIdentifier)\n- (NSString *)__bundleIdentifier\n{\n if (self == [NSBundle mainBundle]) {\n return @\"org.noodcoin.nood-Qt\";\n } else {\n return [self __bundleIdentifier];\n }\n}\n@end\n\nvoid MacNotificationHandler::showNotification(const QString &title, const QString &text)\n{\n // check if users OS has support for NSUserNotification\n if(this->hasUserNotificationCenterSupport()) {\n // okay, seems like 10.8+\n QByteArray utf8 = title.toUtf8();\n char* cString = (char *)utf8.constData();\n NSString *titleMac = [[NSString alloc] initWithUTF8String:cString];\n\n utf8 = text.toUtf8();\n cString = (char *)utf8.constData();\n NSString *textMac = [[NSString alloc] initWithUTF8String:cString];\n\n // do everything weak linked (because we will keep <10.8 compatibility)\n id userNotification = [[NSClassFromString(@\"NSUserNotification\") alloc] init];\n [userNotification performSelector:@selector(setTitle:) withObject:titleMac];\n [userNotification performSelector:@selector(setInformativeText:) withObject:textMac];\n\n id notificationCenterInstance = [NSClassFromString(@\"NSUserNotificationCenter\") performSelector:@selector(defaultUserNotificationCenter)];\n [notificationCenterInstance performSelector:@selector(deliverNotification:) withObject:userNotification];\n\n [titleMac release];\n [textMac release];\n [userNotification release];\n }\n}\n\n// sendAppleScript just take a QString and executes it as apple script\nvoid MacNotificationHandler::sendAppleScript(const QString &script)\n{\n QByteArray utf8 = script.toUtf8();\n char* cString = (char *)utf8.constData();\n NSString *scriptApple = [[NSString alloc] initWithUTF8String:cString];\n\n NSAppleScript *as = [[NSAppleScript alloc] initWithSource:scriptApple];\n NSDictionary *err = nil;\n [as executeAndReturnError:&err];\n [as release];\n [scriptApple release];\n}\n\nbool MacNotificationHandler::hasUserNotificationCenterSupport(void)\n{\n Class possibleClass = NSClassFromString(@\"NSUserNotificationCenter\");\n\n // check if users OS has support for NSUserNotification\n if(possibleClass!=nil) {\n return true;\n }\n return false;\n}\n\n\nMacNotificationHandler *MacNotificationHandler::instance()\n{\n static MacNotificationHandler *s_instance = NULL;\n if (!s_instance) {\n s_instance = new MacNotificationHandler();\n \n Class aPossibleClass = objc_getClass(\"NSBundle\");\n if (aPossibleClass) {\n // change NSBundle -bundleIdentifier method to return a correct bundle identifier\n // a bundle identifier is required to use OSXs User Notification Center\n method_exchangeImplementations(class_getInstanceMethod(aPossibleClass, @selector(bundleIdentifier)),\n class_getInstanceMethod(aPossibleClass, @selector(__bundleIdentifier)));\n }\n }\n return s_instance;\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C#_>using System;\nusing System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Threading;\nusing System.Threading.Tasks;\nusing System.Windows.Forms;\n\nclass Program\n{\n static public void Main(string[] args)\n {\n //\"C:\\Program Files (x86)\\Notepad++\\plugins\\CSScriptNpp\\npp_jit.exe\" /css.attach:9248\n string argsFile = Path.GetTempFileName() + \"npp.args\";\n try\n {\n File.WriteAllLines(argsFile, args);\n string dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);\n string npp = Path.Combine(dir, @\"..\\..\\notepad++.exe\");\n Process.Start(npp, \"\\\"\" + argsFile + \"\\\"\");\n }\n catch\n {\n\n }\n }\n}\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_OCaml_>(**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the \"hack\" directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n *)\n\n\n(*****************************************************************************)\n(* Handling where our temporary files go *)\n(*****************************************************************************)\n\nlet temp_dir_name =\n let dir = Filename.temp_dir_name in\n if dir.[String.length dir - 1] <> '/' then dir ^ \"/\" else dir\n\nlet get_dir () =\n let tmp_dir = temp_dir_name ^ SysConfig.temp_base in\n (* Emulate \"mkdir -p\", i.e., no error if already exists. *)\n let old_umask = Unix.umask 0 in\n (* Don't set sticky bit since the socket opening code wants to remove any\n * old sockets it finds, which may be owned by a different user. *)\n (try Unix.mkdir tmp_dir 0o777 with Unix.Unix_error (Unix.EEXIST, _, _) -> ());\n ignore (Unix.umask old_umask);\n tmp_dir\n\n(* The missing counterpart to Filename.temp_file. Put in a random location\n * under get_dir() above. *)\nlet temp_dir prefix =\n let tmpdir =\n Printf.sprintf \"%s/%s_%06x\" (get_dir ()) prefix (Random.bits ()) in\n Unix.mkdir tmpdir 0o755;\n tmpdir\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>require \"open-uri\"\nrequire \"nokogiri\"\nrequire \"pry\"\nrequire_relative \"./champions_league/version\"\nrequire_relative './champions_league/cli'\nrequire_relative './champions_league/teams'\n\n\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_TypeScript_> config.headers = {\n ...((config.method === 'patch')\n ? {'Content-Type': 'application/merge-patch+json'}\n : {}\n ),\n ...config.headers\n };\n\n if (methods[config.method][2] && !config.data) { throw new VaultInvalidConfigError(config); }\n\n config.requestData = (config.method === 'write')\n ? {data: config.data, options: config.options}\n : config.data;\n}\n\nexport function postRequest(config: RequestConfig): void {\n config.response = {\n ...config.response.data,\n ...((config.method === 'read') ? config.response.data.data : {}),\n ...((config.method === 'read') ? config.response.data.metadata : {}),\n statusCode: config.response.status\n };\n}\n\nexport default {\n preRequest,\n postRequest\n};\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>/****************************************************************************\n**\n** Copyright (C) 2016 The Qt Company Ltd.\n** Contact: http://www.qt.io/licensing/\n**\n** This file is part of the Qt3D module of the Qt Toolkit.\n**\n** $QT_BEGIN_LICENSE:LGPL3$\n** Commercial License Usage\n** Licensees holding valid commercial Qt licenses may use this file in\n** accordance with the commercial license agreement provided with the\n** Software or, alternatively, in accordance with the terms contained in\n** a written agreement between you and The Qt Company. For licensing terms\n** and conditions see http://www.qt.io/terms-conditions. For further\n** information use the contact form at http://www.qt.io/contact-us.\n**\n** GNU Lesser General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU Lesser\n** General Public License version 3 as published by the Free Software\n** Foundation and appearing in the file LICENSE.LGPLv3 included in the\n** packaging of this file. Please review the following information to\n** ensure the GNU Lesser General Public License version 3 requirements\n** will be met: https://www.gnu.org/licenses/lgpl.html.\n**\n** GNU General Public License Usage\n** Alternatively, this file may be used under the terms of the GNU\n** General Public License version 2.0 or later as published by the Free\n** Software Foundation and appearing in the file LICENSE.GPL included in\n** the packaging of this file. Please review the following information to\n** ensure the GNU General Public License version 2.0 requirements will be\n** met: http://www.gnu.org/licenses/gpl-2.0.html.\n**\n** $QT_END_LICENSE$\n**\n****************************************************************************/\n\n#ifndef QRENDERCAPTURE_H\n#define QRENDERCAPTURE_H\n\n#include <Qt3DRender/QFrameGraphNode>\n#include <QtGui/QImage>\n\nQT_BEGIN_NAMESPACE\n\nnamespace Qt3DRender {\n\nclass QRenderCapturePrivate;\nclass QRenderCaptureReplyPrivate;\n\nclass QT3DRENDERSHARED_EXPORT QRenderCaptureReply : public QObject\n{\n Q_OBJECT\n Q_PROPERTY(QImage image READ image CONSTANT)\n Q_PROPERTY(int captureId READ captureId CONSTANT)\n Q_PROPERTY(bool complete READ isComplete NOTIFY completed)\n\npublic:\n\n QImage image() const;\n Q_DECL_DEPRECATED int captureId() const;\n bool isComplete() const;\n\n Q_INVOKABLE bool saveImage(const QString &fileName) const;</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C#_>using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\n//ITP1_11-A\n\nnamespace ConsoleApplication24\n{\n class Dice\n {\n string[] D;\n\n public Dice(string[] DArray)\n {\n D = DArray;\n }\n\n public string DiceRoll(string roll)\n {\n for (int i = 0; i < roll.Length; ++i)\n {\n string D0 = D[0];\n string D1 = D[1];\n string D2 = D[2];\n string D3 = D[3];\n string D4 = D[4];\n string D5 = D[5];\n\n switch (roll[i])\n {\n case 'E':\n D[0] = D3;\n D[2] = D0;\n D[3] = D5;\n D[5] = D2;\n\n break;\n\n case 'N':\n D[0] = D1;\n D[1] = D5;\n D[4] = D0;\n D[5] = D4;\n\n break;\n\n case 'S':\n D[0] = D4;\n D[1] = D0;\n D[4] = D5;\n D[5] = D1;\n break;\n\n case 'W':\n D[0] = D2;\n D[2] = D5;\n D[3] = D0;\n D[5] = D3;\n break;\n }\n }\n return D[0];\n }\n }\n\n\n class Program\n {\n static void Main()\n {\n string[] DiceArray = Console.ReadLine().Split(' ');\n string str = Console.ReadLine();\n\n Dice DClass = new Dice(DiceArray);\n\n string top = DClass.DiceRoll(str);\n\n Console.WriteLine(top);\n }\n }\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_HTML_><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/xhtml;charset=UTF-8\"/>\n<meta http-equiv=\"X-UA-Compatible\" content=\"IE=9\"/>\n<meta name=\"generator\" content=\"Doxygen 1.8.14\"/>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n<title>PxAggregate.h Source File</title>\n<link href=\"tabs.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"jquery.js\"></script>\n<script type=\"text/javascript\" src=\"dynsections.js\"></script>\n<link href=\"navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"resize.js\"></script>\n<script type=\"text/javascript\" src=\"navtreedata.js\"></script>\n<script type=\"text/javascript\" src=\"navtree.js\"></script>\n<script type=\"text/javascript\">\n/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n $(document).ready(initResizable);\n/* @license-end */</script>\n<link href=\"search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n<script type=\"text/javascript\" src=\"search/searchdata.js\"></script>\n<script type=\"text/javascript\" src=\"search/search.js\"></script>\n<link href=\"doxygen.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n<div id=\"top\"><!-- do not remove this div, it is closed by doxygen! -->\n<div id=\"titlearea\">\n<table cellspacing=\"0\" cellpadding=\"0\">\n <tbody>\n <tr style=\"height: 56px;\">\n <td id=\"projectlogo\"><img alt=\"Logo\" src=\"PhysXLogoBlack.png\"/></td>\n </tr>\n </tbody>\n</table>\n</div>\n<!-- end header part -->\n<!-- Generated by Doxygen 1.8.14 -->\n<script type=\"text/javascript\">\n/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\nvar searchBox = new SearchBox(\"searchBox\", \"search\",false,'Search');\n/* @license-end */\n</script>\n<script type=\"text/javascript\" src=\"menudata.js\"></script>\n<script type=\"text/javascript\" src=\"menu.js\"></script>\n<script type=\"text/javascript\">\n/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n$(function() {\n initMenu('',true,false,'search.php','Search');\n $(document).ready(function() { init_search(); });\n});\n/* @license-end */</script>\n<div id=\"main-nav\"></div>\n</div><!-- top -->\n<div id=\"side-nav\" class=\"ui-resizable side-nav-resizable\">\n <div id=\"nav-tree\">\n <div id=\"nav-tree-contents\">\n <div id=\"nav-sync\" class=\"sync\"></div>\n </div>\n </div>\n <div id=\"splitbar\" style=\"-moz-user-select:none;\" \n class=\"ui-resizable-handle\">\n </div>\n</div>\n<script type=\"text/javascript\">\n/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */\n$(document).ready(function(){initNavTree('PxAggregate_8h_source.html','');});\n/* @license-end */\n</script>\n<div id=\"doc-content\">\n<!-- window showing the filter options -->\n<div id=\"MSearchSelectWindow\"\n onmouseover=\"return searchBox.OnSearchSelectShow()\"\n onmouseout=\"return searchBox.OnSearchSelectHide()\"\n onkeydown=\"return searchBox.OnSearchSelectKey(event)\">\n</div>\n\n<!-- iframe showing the search results (closed by default) -->\n<div id=\"MSearchResultsWindow\"></code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_XML_> <artifactId>littleproxy</artifactId>\n <version>1.1.2</version>\n <scope>test</scope>\n </dependency>\n </dependencies>\n <profiles>\n <profile>\n <!-- This profile, activating when compiling on Java versions above 1.8, provides configuration changes to\n allow NiFi to be compiled on those JDKs. -->\n <id>jigsaw</id>\n <activation>\n <jdk>(1.8,)</jdk>\n </activation>\n <properties>\n <httpclient.group>org.apache.httpcomponents.client5</httpclient.group>\n <httpclient.artifact>httpclient5</httpclient.artifact>\n <httpclient.version>5.0-beta4</httpclient.version>\n </properties>\n <dependencies>\n <dependency>\n <groupId>javax.xml.bind</groupId>\n <artifactId>jaxb-api</artifactId>\n </dependency>\n <dependency>\n <groupId>com.sun.xml.bind</groupId>\n <artifactId>jaxb-core</artifactId>\n </dependency>\n <dependency>\n <groupId>com.sun.xml.bind</groupId>\n <artifactId>jaxb-impl</artifactId>\n </dependency>\n </dependencies>\n </profile>\n </profiles>\n</project>\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>#include<iostream>\n#include<math.h>\n#include<iomanip>\n#include<vector>\n#include<algorithm>\n#include<queue>\n#include<string>\n#include<stdlib.h>\n#include <set>\ntypedef long long ll;\nusing namespace std;\n#define rep(i,n) for(int i=0;i<n;i++)\n\n\nint main(void)\n{\n\n\tint n;\n\tcin >> n;\n\n\tcout << pow(n, 3)<< endl;\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>//\n// LFStreamRTPTCPSocket.h\n// Pods\n//\n// Created by hyq on 16/10/20.\n//\n//\n\n#import \"LFStreamSocket.h\"\n\n@interface LFStreamRTPTCPSocket : NSObject<LFStreamSocket>\n\n#pragma mark - Initializer\n///=============================================================================\n/// @name Initializer\n///=============================================================================\n- (nullable instancetype)init UNAVAILABLE_ATTRIBUTE;\n+ (nullable instancetype)new UNAVAILABLE_ATTRIBUTE;\n\n@property(nonatomic, assign) NSUInteger uid;\n@end\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Scala_>import org.scalajs.linker.interface.ModuleInitializer\n\nval check = taskKey[Unit](\"Run checks of this test\")\n\nversion := scalaJSVersion\nscalaVersion := \"2.12.15\"\n\nenablePlugins(ScalaJSPlugin)\n\nscalaJSUseMainModuleInitializer := true\nscalaJSModuleInitializers +=\n ModuleInitializer.mainMethod(\"org.scalajs.sbtplugin.test\", \"foo\")\nscalaJSModuleInitializers in Test +=\n ModuleInitializer.mainMethod(\"org.scalajs.sbtplugin.test\", \"bar\")\n\ncheck := {\n // Compile should have main module init and Main.foo\n assert((scalaJSModuleInitializers in Compile).value.size == 2,\n \"Bad number of scalaJSModuleInitializers in Compile\")\n\n // Test should have test module init, Main.foo and Main.bar\n assert((scalaJSModuleInitializers in Test).value.size == 3,\n \"Bad number of scalaJSModuleInitializers in Test\")\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_># Generated by Django 3.2 on 2021-04-18 07:43\n\nimport django.db.models.deletion\nimport django.utils.timezone\nfrom django.db import migrations, models\n\nimport alert.models\n\n\nclass Migration(migrations.Migration):\n\n dependencies = [\n (\"courses\", \"0032_auto_20210418_0343\"),\n (\"alert\", \"0011_auto_20201108_1535\"),\n ]\n\n operations = [\n migrations.CreateModel(\n name=\"AddDropPeriod\",\n fields=[\n (\n \"id\",\n models.AutoField(\n auto_created=True, primary_key=True, serialize=False, verbose_name=\"ID\"\n ),\n ),\n (\n \"semester\",\n models.CharField(\n db_index=True,\n help_text=\"\\nThe semester of this add drop period (of the form YYYYx where x is\\nA [for spring], or C [fall]), e.g. `2019C` for fall 2019.\\n\",\n max_length=5,\n unique=True,\n validators=[alert.models.validate_add_drop_semester],\n ),\n ),\n (\n \"start\",\n models.DateTimeField(\n blank=True,\n help_text=\"The datetime at which the add drop period started.\",\n null=True,\n ),\n ),\n (\n \"end\",\n models.DateTimeField(\n blank=True,\n help_text=\"The datetime at which the add drop period ended.\",\n null=True,\n ),\n ),\n (\n \"estimated_start\",\n models.DateTimeField(\n blank=True,\n help_text=\"\\nThis field estimates the start of the add/drop period based on the semester\\nand historical data, even if the start field hasn't been filled in yet.\\nIt equals the start of the add/drop period for this semester if it is explicitly set,\\notherwise the most recent non-null start to an add/drop period, otherwise\\n(if none exist), estimate as April 5 @ 7:00am ET of the same year (for a fall semester),\\nor November 16 @ 7:00am ET of the previous year (for a spring semester).\\n\",\n null=True,\n ),\n ),\n (\n \"estimated_end\",\n models.DateTimeField(\n blank=True,\n help_text=\"\\n This field estimates the end of the add/drop period based on the semester\\n and historical data, even if the end field hasn't been filled in yet.\\n The end of the add/drop period for this semester, if it is explicitly set, otherwise\\nthe most recent non-null end to an add/drop period, otherwise (if none exist),\\nestimate as October 12 @ 11:59pm ET (for a fall semester),\\nor February 22 @ 11:59pm ET (for a spring semester),\\nof the same year.\\n\",\n null=True,\n ),\n ),\n ],\n ),\n migrations.AlterField(\n model_name=\"registration\",\n name=\"section\",\n field=models.ForeignKey(\n help_text=\"The section that the user registered to be notified about.\",\n on_delete=django.db.models.deletion.CASCADE,\n related_name=\"registrations\",\n to=\"courses.section\",\n ),\n ),\n migrations.AlterField(\n model_name=\"registration\",\n name=\"source\",\n field=models.CharField(\n choices=[\n (\"PCA\", \"Penn Course Alert\"),\n (\"API\", \"3rd Party Integration\"),\n (\"PCP\", \"Penn Course Plan\"),\n (\"PCR\", \"Penn Course Review\"),\n (\"PM\", \"Penn Mobile\"),\n (\"SCRIPT_PCN\", \"The loadregistrations_pcn shell command\"),\n (\"SCRIPT_PCA\", \"The loadregistrations_pca shell command\"),\n ],\n help_text='Where did the registration come from? Options and meanings: <table width=100%><tr><td>\"PCA\"</td><td>\"Penn Course Alert\"</td></tr><tr><td>\"API\"</td><td>\"3rd Party Integration\"</td></tr><tr><td>\"PCP\"</td><td>\"Penn Course Plan\"</td></tr><tr><td>\"PCR\"</td><td>\"Penn Course Review\"</td></tr><tr><td>\"PM\"</td><td>\"Penn Mobile\"</td></tr><tr><td>\"SCRIPT_PCN\"</td><td>\"The loadregistrations_pcn shell command\"</td></tr><tr><td>\"SCRIPT_PCA\"</td><td>\"The loadregistrations_pca shell command\"</td></tr></table>',\n max_length=16,\n ),\n ),\n migrations.CreateModel(\n name=\"PcaDemandDistributionEstimate\",\n fields=[\n (\n \"id\",\n models.AutoField(\n auto_created=True, primary_key=True, serialize=False, verbose_name=\"ID\"\n ),\n ),\n (\n \"semester\",\n models.CharField(\n db_index=True,\n help_text=\"\\nThe semester of this demand distribution estimate (of the form YYYYx where x is\\nA [for spring], B [summer], or C [fall]), e.g. `2019C` for fall 2019.\\n\",\n max_length=5,\n ),\n ),\n (\n \"created_at\",\n models.DateTimeField(\n db_index=True,\n default=django.utils.timezone.now,\n help_text=\"The datetime at which the distribution estimates were updated.\",\n ),\n ),\n (\n \"percent_through_add_drop_period\",\n models.FloatField(\n default=0,\n help_text=\"The percentage through the add/drop period at which this demand distribution estimate change occurred. This percentage is constrained within the range [0,1].\",\n ),\n ),\n (\n \"in_add_drop_period\",\n models.BooleanField(\n default=False,\n help_text=\"Was this demand distribution estimate created during the add/drop period?\",\n ),\n ),\n (\n \"highest_demand_section_volume\",\n models.IntegerField(\n help_text=\"The registration volume of the highest_demand_section at this time.\"\n ),\n ),\n (\n \"lowest_demand_section_volume\",\n models.IntegerField(\n help_text=\"The registration volume of the lowest_demand_section at this time.\"\n ),\n ),\n (\n \"csdv_gamma_param_alpha\",\n models.FloatField(\n blank=True,\n help_text=\"The fitted gamma distribution alpha parameter of all closed sections' raw demand values at this time. The abbreviation 'csdv' stands for 'closed section demand values'; this is a collection of the raw demand values of each closed section at this time.\",\n null=True,\n ),\n ),\n (\n \"csdv_gamma_param_loc\",\n models.FloatField(\n blank=True,\n help_text=\"The fitted gamma distribution loc parameter of all closed sections' raw demand values at this time. The abbreviation 'csdv' stands for 'closed section demand values'; this is a collection of the raw demand values of each closed section at this time.\",\n null=True,\n ),\n ),\n (\n \"csdv_gamma_param_scale\",\n models.FloatField(\n blank=True,\n help_text=\"The fitted gamma distribution beta parameter of all closed sections' raw demand values at this time. The abbreviation 'csdv' stands for 'closed section demand values'; this is a collection of the raw demand values of each closed section at this time.\",\n null=True,\n ),\n ),\n (\n \"csdv_mean\",\n models.FloatField(\n blank=True,\n help_text=\"The mean of all closed sections' raw demand values at this time. The abbreviation 'csdv' stands for 'closed section demand values'; this is a collection of the raw demand values of each closed section at this time.\",\n null=True,\n ),\n ),\n (\n \"csdv_median\",\n models.FloatField(\n blank=True,\n help_text=\"The median of all closed sections' raw demand values at this time. The abbreviation 'csdv' stands for 'closed section demand values'; this is a collection of the raw demand values of each closed section at this time.\",</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>import test from 'ava';\nimport bindable from './';\n\ntest('calculate sum', t => {\n\tconst reduce = bindable(function ({reducer, initialValue, array}) {</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>// Copyright Carl Philipp Reh 2009 - 2018.\n// Distributed under the Boost Software License, Version 1.0.\n// (See accompanying file LICENSE_1_0.txt or copy at\n// http://www.boost.org/LICENSE_1_0.txt)\n\n\n#ifndef FCPPT_C_DELETER_FWD_HPP_INCLUDED\n#define FCPPT_C_DELETER_FWD_HPP_INCLUDED\n\n\nnamespace fcppt\n{\n\nstruct c_deleter;\n\n}\n\n#endif\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>#pragma once\n\nclass IClientEntity;\n\nclass IMoveHelper\n{\npublic:\n\tvirtual\tvoid _vpad() = 0;\n\tvirtual void SetHost(IClientEntity* host) = 0;\n};\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Dockerfile_>FROM svenruppert/adopt:1.11.0-2\nMAINTAINER sven.ruppert@gmail.com\n\nARG MAVEN_VERSION=3.2.5\nARG USER_HOME_DIR=\"/root\"\nARG BASE_URL=http://mirror.dkd.de/apache/maven/binaries/\n\nRUN mkdir -p /usr/share/maven /usr/share/maven/ref \\\n && curl -o /tmp/apache-maven.tar.gz http://mirror.dkd.de/apache/maven/binaries/apache-maven-3.2.5-bin.tar.gz \\\n && tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \\\n && rm -f /tmp/apache-maven.tar.gz \\\n && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn\n\nENV MAVEN_HOME /usr/share/maven\nENV MAVEN_CONFIG \"$USER_HOME_DIR/.m2\"\n\nCMD [\"mvn\"]</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Scala_>package mesosphere.marathon\npackage state\n\nimport mesosphere.UnitTest\nimport mesosphere.marathon.Protos.ServiceDefinition\nimport mesosphere.marathon.core.pod.{BridgeNetwork, ContainerNetwork}\nimport mesosphere.marathon.raml.Resources\nimport mesosphere.marathon.state.EnvVarValue._\nimport scala.jdk.CollectionConverters._\nimport org.apache.mesos.{Protos => mesos}\n\nimport scala.concurrent.duration._\n\nclass AppDefinitionTest extends UnitTest {\n\n val fullVersion = VersionInfo.forNewConfig(Timestamp(1))\n val runSpecId = AbsolutePathId(\"/test\")\n\n \"AppDefinition\" should {\n \"ToProto with port definitions\" in {\n val app1 = AppDefinition(\n id = AbsolutePathId(\"/play\"),\n role = \"*\",\n cmd = Some(\"bash foo-*/start -Dhttp.port=$PORT\"),\n resources = Resources(cpus = 4.0, mem = 256.0),\n instances = 5,\n portDefinitions = PortDefinitions(8080, 8081),\n executor = \"//cmd\",\n acceptedResourceRoles = Set(\"a\", \"b\")\n )\n\n val proto1 = app1.toProto\n assert(\"/play\" == proto1.getId)\n assert(proto1.getCmd.hasValue)\n assert(proto1.getCmd.getShell)\n assert(\"bash foo-*/start -Dhttp.port=$PORT\" == proto1.getCmd.getValue)\n assert(5 == proto1.getInstances)\n assert(Seq(8080, 8081) == proto1.getPortDefinitionsList.asScala.map(_.getNumber))\n assert(\"//cmd\" == proto1.getExecutor)\n assert(4 == getScalarResourceValue(proto1, \"cpus\"), 1e-6)\n assert(256 == getScalarResourceValue(proto1, \"mem\"), 1e-6)\n assert(\"bash foo-*/start -Dhttp.port=$PORT\" == proto1.getCmd.getValue)\n assert(!proto1.hasContainer)\n assert(1.0 == proto1.getUpgradeStrategy.getMinimumHealthCapacity)\n assert(1.0 == proto1.getUpgradeStrategy.getMaximumOverCapacity)\n assert(proto1.hasAcceptedResourceRoles)\n assert(proto1.getAcceptedResourceRoles == Protos.ResourceRoles.newBuilder().addRole(\"a\").addRole(\"b\").build())\n\n val app2 = AppDefinition(\n id = AbsolutePathId(\"/play\"),\n role = \"*\",\n cmd = None,\n args = Seq(\"a\", \"b\", \"c\"),\n container = Some(Container.Docker(image = \"group/image\")),\n resources = Resources(cpus = 4.0, mem = 256.0),\n instances = 5,\n portDefinitions = PortDefinitions(8080, 8081),\n executor = \"//cmd\",\n upgradeStrategy = UpgradeStrategy(0.7, 0.4)\n )\n\n val proto2 = app2.toProto\n assert(\"/play\" == proto2.getId)\n assert(!proto2.getCmd.hasValue)\n assert(!proto2.getCmd.getShell)\n proto2.getCmd.getArgumentsList should contain theSameElementsInOrderAs Seq(\"a\", \"b\", \"c\")\n assert(5 == proto2.getInstances)\n assert(Seq(8080, 8081) == proto2.getPortDefinitionsList.asScala.map(_.getNumber))\n assert(\"//cmd\" == proto2.getExecutor)\n assert(4 == getScalarResourceValue(proto2, \"cpus\"), 1e-6)\n assert(256 == getScalarResourceValue(proto2, \"mem\"), 1e-6)\n assert(proto2.hasContainer)\n assert(0.7 == proto2.getUpgradeStrategy.getMinimumHealthCapacity)\n assert(0.4 == proto2.getUpgradeStrategy.getMaximumOverCapacity)\n assert(0 == proto2.getAcceptedResourceRoles.getRoleCount)\n }\n\n \"CMD to proto and back again\" in {\n val app = AppDefinition(\n id = AbsolutePathId(\"/play\"),\n role = \"*\",\n cmd = Some(\"bash foo-*/start -Dhttp.port=$PORT\"),\n versionInfo = fullVersion\n )\n\n val proto = app.toProto\n proto.getId should be(\"/play\")\n proto.getCmd.hasValue should be(true)\n proto.getCmd.getShell should be(true)\n proto.getCmd.getValue should be(\"bash foo-*/start -Dhttp.port=$PORT\")\n\n val read = AppDefinition(id = runSpecId, role = \"*\").mergeFromProto(proto)\n read should be(app)\n }\n\n \"ARGS to proto and back again\" in {\n val app = AppDefinition(\n id = AbsolutePathId(\"/play\"),\n role = \"*\",\n args = Seq(\"bash\", \"foo-*/start\", \"-Dhttp.port=$PORT\"),</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package com.cyberlink.cosmetic.modules.circle.dao.hibernate;\n\nimport java.util.Collections;\nimport java.util.List;\n\nimport org.hibernate.criterion.DetachedCriteria;\nimport org.hibernate.criterion.Restrictions;\n\nimport com.cyberlink.core.dao.hibernate.AbstractDaoCosmetic;\nimport com.cyberlink.core.web.view.page.PageResult;\nimport com.cyberlink.cosmetic.modules.circle.dao.CircleUserDao;\nimport com.cyberlink.cosmetic.modules.circle.model.CircleUser;\n\npublic class CircleUserDaoHibernate extends AbstractDaoCosmetic<CircleUser, Long> implements CircleUserDao{\n\tprivate String regionOffindByUserId = \"com.cyberlink.cosmetic.modules.circle.model.CircleUser.query.findByUserId\";\n\tprivate String regionOffindByCircleId = \"com.cyberlink.cosmetic.modules.circle.model.CircleUser.query.findByCircleId\";\n\t\n @Override\n public List<CircleUser> findByIds(Long... ids) {</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_># -*- coding: utf-8 -*-\n#\n# Copyright (c) 2016 NORDUnet A/S\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or\n# without modification, are permitted provided that the following\n# conditions are met:\n#\n# 1. Redistributions of source code must retain the above copyright\n# notice, this list of conditions and the following disclaimer.\n# 2. Redistributions in binary form must reproduce the above</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_PHP_><?php\r\nnamespace Modules\\User;\r\n\r\nuse Modules\\Core\\Abstracts\\BaseSettingsClass;\r\n\r\nclass SettingClass extends BaseSettingsClass\r\n{\r\n public static function getSettingPages()\r\n {\r\n return [\r\n [\r\n 'id' => 'user',\r\n 'title' => __(\"User Settings\"),\r\n 'position'=>50,\r\n 'view'=>\"User::admin.settings.user\",\r\n \"keys\"=>[\r\n 'user_enable_login_recaptcha',\r\n 'user_enable_register_recaptcha',\r\n 'enable_mail_user_registered',\r\n 'user_content_email_registered',\r\n 'admin_enable_mail_user_registered',\r\n 'admin_content_email_user_registered',\r\n 'user_content_email_forget_password',\r\n 'inbox_enable',\r\n 'subject_email_verify_register_user',\r\n 'content_email_verify_register_user',\r\n ],\r\n 'html_keys'=>[\r\n\r\n ]\r\n ]\r\n ];\r\n }\r\n}\r\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>/*\n * Copyright (C) 2014 Saravan Pantham\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.jams.music.player.Dialogs;\n\nimport android.app.AlertDialog;\nimport android.app.Dialog;\nimport android.content.DialogInterface;\nimport android.content.DialogInterface.OnClickListener;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.support.v4.app.DialogFragment;\n\nimport com.melodicloud.R;\nimport com.jams.music.player.BlacklistManagerActivity.BlacklistManagerActivity;\n\n/*******************************************************\n * Allows the user to select the type of elements that \n * he/she wants to manage a blacklist for.\n * \n * @author Saravan Pantham\n *******************************************************/\npublic class BlacklistManagerDialog extends DialogFragment { \n\t\n\t@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\t\t\n\t\tString[] blacklistManagerChoices = { getActivity().getResources().getString(R.string.manage_blacklisted_artists),\n\t\t\t\t\t\t\t\t\t\t\t getActivity().getResources().getString(R.string.manage_blacklisted_albums), \n\t\t\t\t\t\t\t\t\t\t\t getActivity().getResources().getString(R.string.manage_blacklisted_songs), \n\t\t\t\t\t\t\t\t\t\t\t getActivity().getResources().getString(R.string.manage_blacklisted_playlists) };\n\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n //Set the dialog title.\n builder.setTitle(R.string.blacklist_manager);\n builder.setItems(blacklistManagerChoices, new OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\t\n\t\t\t\tif (which==0) {\n\t\t\t\t\tbundle.putString(\"MANAGER_TYPE\", \"ARTISTS\");\n\t\t\t\t} else if (which==1) {\n\t\t\t\t\tbundle.putString(\"MANAGER_TYPE\", \"ALBUMS\");\n\t\t\t\t} else if (which==2) {\n\t\t\t\t\tbundle.putString(\"MANAGER_TYPE\", \"SONGS\");\n\t\t\t\t} else if (which==3) {\n\t\t\t\t\tbundle.putString(\"MANAGER_TYPE\", \"PLAYLISTS\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdialog.dismiss();\n\t\t\t\tIntent intent = new Intent(getActivity(), BlacklistManagerActivity.class);\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t\t\n\t\t\t}\n \t\n });\n\n return builder.create();\n }\n\t\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>/*\n * Copyright 2015-2016 USEF Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage energy.usef.time;\n\nimport javax.annotation.PostConstruct;\nimport javax.annotation.PreDestroy;\nimport javax.ejb.Singleton;\nimport javax.ejb.Startup;\nimport java.io.IOException;\nimport java.net.SocketException;\nimport java.util.concurrent.ExecutorService;\nimport java.util.concurrent.Executors;\n\n/**\n * Startup Bean to initiate UDP Server to send the USEF time where needed.\n */\n@Startup\n@Singleton\npublic class TimeServer {\n\n private ExecutorService timeServerThreadPool = Executors.newSingleThreadExecutor();\n private TimeServerThread timeServerThread;\n public static final String CONFIG_FILE_NAME = \"time-config.properties\";\n\n /**\n * Starts the TimeServer with the chosen properties.\n * \n * @throws IOException\n */\n @PostConstruct\n public void startTimeServer() throws IOException {\n try {\n Config config = new Config();\n Integer serverPort = config.getIntegerProperty(ConfigParam.SERVER_PORT);\n Long timeFactor = config.getLongProperty(ConfigParam.TIME_FACTOR);\n timeServerThread = new TimeServerThread(timeFactor, serverPort);\n timeServerThreadPool.execute(timeServerThread);\n } catch (SocketException e) {\n throw new RuntimeException(\"Unable to start timeServer: \" + e.getMessage(), e);\n }\n }\n\n /**\n * Stop's the timeServerThread.\n */\n @PreDestroy\n public void stopTimeServer() {\n timeServerThread.shutdown();\n timeServerThreadPool.shutdownNow();\n }\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_YAML_>principais:\n - relevance: 'lead'\n cls: 'xs12 md6'\n preloaded:\n prop: \"centralindicadores\"\n function: \"slice\"\n id: \"06_05_02_99\"\n year: 'max'\n args:\n - prop: \"value\"\n named_prop: 'vl_indicador'\n format: 'inteiro'\n collapse:\n format: 'real'\n precision: 1\n default: \"Sem Registros\"\n - prop: \"description\"\n fixed: \"Notificações do SINAN - Acidentes de Trabalho Grave (5 a 17 anos)\"\n - prop: 'comment'\n template: \"Ministério da Saúde/SVS - SINAN, {0}\"\n args:\n - named_prop: \"nu_competencia\"\n - relevance: 'lead'\n cls: 'xs12 md6'\n preloaded:\n prop: \"centralindicadores\"\n function: \"slice\"\n id: \"06_05_10_99\"\n year: \"max\"\n args:\n - prop: \"value\"\n named_prop: 'vl_indicador'\n format: 'inteiro'\n collapse:\n format: 'real'\n default: \"Sem Registros\"\n - prop: \"description\"\n fixed: \"Notificações do SINAN - Total de Notificações Relacionadas ao Trabalho (5 a 17 anos)\"\n - prop: 'comment'\n template: \"Ministério da Saúde/SVS - SINAN, {0}\"\n args:\n - named_prop: \"nu_competencia\"\n# ===================================================\nsecoes:\n - id: \"perfil_sinan\"\n name: \"Notificações Relacionadas ao Trabalho - Sistema de Informação de Agravos de Notificação (SINAN)\"\n cards:\n\n# ==================================================== \n - id: \"mapa_sinan_grave_notif\"\n title: \n fixed: \"Notificações do SINAN - Acidentes de Trabalho Grave (5 a 17 anos)\"\n title_comment:\n template: \"Brasil, de {0} a {1}\"\n preloaded:\n prop: \"centralindicadores\"\n function: \"slice\"\n id: \"06_05_02_99\"\n year: \"max\"\n args:\n - named_prop: \"nu_competencia_min\"\n - named_prop: \"nu_competencia_max\"\n info:\n - type: \"text\"\n title: \"Sobre a métrica\"\n content:</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>/*\n * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n * \n * http://aws.amazon.com/apache2.0\n * \n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\npackage com.amazonaws.services.codeguruprofiler.model;\n\nimport java.io.Serializable;\nimport javax.annotation.Generated;\nimport com.amazonaws.protocol.StructuredPojo;\nimport com.amazonaws.protocol.ProtocolMarshaller;\n\n/**\n * <p>\n * Information about a frame metric and its values.\n * </p>\n * \n * @see <a href=\"http://docs.aws.amazon.com/goto/WebAPI/codeguruprofiler-2019-07-18/FrameMetricDatum\" target=\"_top\">AWS\n * API Documentation</a>\n */\n@Generated(\"com.amazonaws:aws-java-sdk-code-generator\")\npublic class FrameMetricDatum implements Serializable, Cloneable, StructuredPojo {\n\n private FrameMetric frameMetric;\n /**\n * <p>\n * A list of values that are associated with a frame metric.\n * </p>\n */\n private java.util.List<Double> values;\n\n /**\n * @param frameMetric\n */\n\n public void setFrameMetric(FrameMetric frameMetric) {\n this.frameMetric = frameMetric;\n }\n\n /**\n * @return\n */\n\n public FrameMetric getFrameMetric() {\n return this.frameMetric;\n }\n\n /**\n * @param frameMetric\n * @return Returns a reference to this object so that method calls can be chained together.\n */\n\n public FrameMetricDatum withFrameMetric(FrameMetric frameMetric) {\n setFrameMetric(frameMetric);\n return this;\n }\n\n /**\n * <p>\n * A list of values that are associated with a frame metric.\n * </p>\n * \n * @return A list of values that are associated with a frame metric.\n */\n\n public java.util.List<Double> getValues() {\n return values;\n }\n\n /**\n * <p>\n * A list of values that are associated with a frame metric.\n * </p>\n * \n * @param values\n * A list of values that are associated with a frame metric.\n */\n\n public void setValues(java.util.Collection<Double> values) {\n if (values == null) {\n this.values = null;\n return;\n }\n\n this.values = new java.util.ArrayList<Double>(values);\n }\n\n /**\n * <p>\n * A list of values that are associated with a frame metric.\n * </p>\n * <p>\n * <b>NOTE:</b> This method appends the values to the existing list (if any). Use\n * {@link #setValues(java.util.Collection)} or {@link #withValues(java.util.Collection)} if you want to override the\n * existing values.\n * </p>\n * \n * @param values\n * A list of values that are associated with a frame metric.\n * @return Returns a reference to this object so that method calls can be chained together.\n */\n\n public FrameMetricDatum withValues(Double... values) {\n if (this.values == null) {\n setValues(new java.util.ArrayList<Double>(values.length));\n }\n for (Double ele : values) {\n this.values.add(ele);\n }\n return this;\n }\n\n /**\n * <p>\n * A list of values that are associated with a frame metric.\n * </p>\n * \n * @param values\n * A list of values that are associated with a frame metric.\n * @return Returns a reference to this object so that method calls can be chained together.\n */\n\n public FrameMetricDatum withValues(java.util.Collection<Double> values) {\n setValues(values);\n return this;\n }\n\n /**\n * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be\n * redacted from this string using a placeholder value.\n *\n * @return A string representation of this object.\n *\n * @see java.lang.Object#toString()\n */\n @Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getFrameMetric() != null)\n sb.append(\"FrameMetric: \").append(getFrameMetric()).append(\",\");\n if (getValues() != null)\n sb.append(\"Values: \").append(getValues());\n sb.append(\"}\");\n return sb.toString();\n }\n\n @Override\n public boolean equals(Object obj) {\n if (this == obj)\n return true;\n if (obj == null)\n return false;\n\n if (obj instanceof FrameMetricDatum == false)\n return false;\n FrameMetricDatum other = (FrameMetricDatum) obj;\n if (other.getFrameMetric() == null ^ this.getFrameMetric() == null)\n return false;\n if (other.getFrameMetric() != null && other.getFrameMetric().equals(this.getFrameMetric()) == false)\n return false;\n if (other.getValues() == null ^ this.getValues() == null)\n return false;\n if (other.getValues() != null && other.getValues().equals(this.getValues()) == false)\n return false;\n return true;\n }\n\n @Override\n public int hashCode() {\n final int prime = 31;\n int hashCode = 1;\n\n hashCode = prime * hashCode + ((getFrameMetric() == null) ? 0 : getFrameMetric().hashCode());\n hashCode = prime * hashCode + ((getValues() == null) ? 0 : getValues().hashCode());\n return hashCode;\n }\n\n @Override\n public FrameMetricDatum clone() {\n try {\n return (FrameMetricDatum) super.clone();\n } catch (CloneNotSupportedException e) {\n throw new IllegalStateException(\"Got a CloneNotSupportedException from Object.clone() \" + \"even though we're Cloneable!\", e);\n }\n }\n\n @com.amazonaws.annotation.SdkInternalApi\n @Override\n public void marshall(ProtocolMarshaller protocolMarshaller) {\n com.amazonaws.services.codeguruprofiler.model.transform.FrameMetricDatumMarshaller.getInstance().marshall(this, protocolMarshaller);\n }\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>print(\"Ankit\" in d)\r\nd.clear()\r\nprint(d)\r\npoint = (5,6)\r\nprint(point[0])\r\nprint(point[1])\r\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_HTML_><!DOCTYPE html>\n<html>\n<head>\n\t<meta charset=\"utf-8\">\n\t<title>SeleniumQuery Selectors Parser Test Page</title>\n</head>\n<body lang=\"pt-BR\">\n\t<p id=\"brazilian-p\">Eu sou brasileiro.</p></code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_># orm/base.py\n# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors\n# <see AUTHORS file>\n#\n# This module is part of SQLAlchemy and is released under\n# the MIT License: http://www.opensource.org/licenses/mit-license.php\n\n\"\"\"Constants and rudimental functions used throughout the ORM.\n\n\"\"\"\n\nfrom .. import util, inspection, exc as sa_exc\nfrom ..sql import expression\nfrom . import exc\nimport operator\n\nPASSIVE_NO_RESULT = util.symbol(\n 'PASSIVE_NO_RESULT',\n \"\"\"Symbol returned by a loader callable or other attribute/history\n retrieval operation when a value could not be determined, based\n on loader callable flags.\n \"\"\"\n)\n\nATTR_WAS_SET = util.symbol(\n 'ATTR_WAS_SET',\n \"\"\"Symbol returned by a loader callable to indicate the\n retrieved value, or values, were assigned to their attributes\n on the target object.\n \"\"\"\n)\n\nATTR_EMPTY = util.symbol(\n 'ATTR_EMPTY',\n \"\"\"Symbol used internally to indicate an attribute had no callable.\"\"\"\n)\n\nNO_VALUE = util.symbol(\n 'NO_VALUE',\n \"\"\"Symbol which may be placed as the 'previous' value of an attribute,\n indicating no value was loaded for an attribute when it was modified,\n and flags indicated we were not to load it.\n \"\"\"\n)\n\nNEVER_SET = util.symbol(\n 'NEVER_SET',\n \"\"\"Symbol which may be placed as the 'previous' value of an attribute\n indicating that the attribute had not been assigned to previously.\n \"\"\"\n)\n\nNO_CHANGE = util.symbol(</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>CLASS_TEMPLATE = \"\"\"\\\nclass {}(Model):\n\t{}\n\\tclass Meta:\n\\t\\tdatabase = db\n\nmodelList['{}'] = {}\n\"\"\"</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>#include <sys/types.h>\n#include <sys/param.h>\n#include <sys/bitstring.h>\n#include <sys/conf.h>\n#include <sys/endian.h>\n#include <sys/lock.h>\n#include <sys/pcpu.h>\n#include <sys/proc.h>\n#include <sys/queue.h>\n#include <sys/rwlock.h>\n\n#include <vm/vm.h>\n#include <vm/pmap.h>\n#include <vm/uma.h>\n#include <vm/vm_extern.h>\n#include <vm/vm_map.h>\n#include <vm/vm_object.h>\n#include <vm/vm_page.h>\n#include <vm/vm_param.h>\n#include <vm/vm_radix.h>\n\n#include <machine/pmap.h>\n\n#include \"debug.h\"\n#include \"sls_internal.h\"\n#include \"sls_kv.h\"\n#include \"sls_pager.h\"\n#include \"sls_vm.h\"\n\nint sls_objprotect = 0;\nSDT_PROBE_DEFINE(sls, , , procset_loop);\n\n#define SLS_PRECOPY_MAX (64)\n\n/*\n * Preemptively create private copies of writable pages for the\n * new application. The new pages are inserted in the shadows,\n * and the page tables of the processes themselves.\n */\nvoid\nslsvm_object_precopy(vm_object_t object, vm_object_t parent)\n{\n\tvm_page_t ma[SLS_PRECOPY_MAX];\n\tvm_page_t mb[SLS_PRECOPY_MAX];\n\tvm_pindex_t offset, pstart;\n\tint count, npages;\n\tbitstr_t *bitmap;\n\tvm_page_t m;\n\tint error;\n\tint i;\n\n\terror = slskv_find(\n\t slsm.slsm_prefault, parent->objid, (uintptr_t *)&bitmap);\n\tif (error != 0)\n\t\treturn;\n\n\tKASSERT(</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>SELECT * FROM film\nWHERE replacement_cost BETWEEN 12.99 AND 16.99;</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_PHP_> 'Symfony\\\\Component\\\\VarDumper\\\\' => array($vendorDir . '/symfony/var-dumper'),\n 'Symfony\\\\Component\\\\Translation\\\\' => array($vendorDir . '/symfony/translation'),\n 'Symfony\\\\Component\\\\Routing\\\\' => array($vendorDir . '/symfony/routing'),\n 'Symfony\\\\Component\\\\Process\\\\' => array($vendorDir . '/symfony/process'),\n 'Symfony\\\\Component\\\\HttpKernel\\\\' => array($vendorDir . '/symfony/http-kernel'),\n 'Symfony\\\\Component\\\\HttpFoundation\\\\' => array($vendorDir . '/symfony/http-foundation'),\n 'Symfony\\\\Component\\\\Finder\\\\' => array($vendorDir . '/symfony/finder'),\n 'Symfony\\\\Component\\\\EventDispatcher\\\\' => array($vendorDir . '/symfony/event-dispatcher'),\n 'Symfony\\\\Component\\\\DomCrawler\\\\' => array($vendorDir . '/symfony/dom-crawler'),\n 'Symfony\\\\Component\\\\Debug\\\\' => array($vendorDir . '/symfony/debug'),\n 'Symfony\\\\Component\\\\CssSelector\\\\' => array($vendorDir . '/symfony/css-selector'),\n 'Symfony\\\\Component\\\\Console\\\\' => array($vendorDir . '/symfony/console'),\n 'SuperClosure\\\\' => array($vendorDir . '/jeremeamia/SuperClosure/src'),\n 'Psy\\\\' => array($vendorDir . '/psy/psysh/src/Psy'),\n 'Psr\\\\Log\\\\' => array($vendorDir . '/psr/log/Psr/Log'),\n 'PhpParser\\\\' => array($vendorDir . '/nikic/php-parser/lib/PhpParser'),</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_> this.facets = facets;\n }\n\n public long totalRows() {\n return totalRows;\n }\n\n public double maxScore() {\n return maxScore;\n }\n\n public long took() {\n return took;</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>A = input()\nA = int(A)\nB = input()\nB = int(B)\nsum = 0\n\nfor i in range(2):\n if A > B:\n sum = A + sum\n A = A - 1\n else:\n sum = B + sum\n B = B -1 \n\nprint(sum)</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_HTML_><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<title>com.zrlog.util.ZrLogUtil.getExecSqlList(java.lang.String,java.lang.String):java.util.List.17b60f12dfaefe604691e887a56e3e4f_node25</title>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n<style type=\"text/css\">\nbody { background-color:#fff; color:#000; font-family:Helvetica, sans-serif; font-size:10pt }\nh1 { font-size:14pt }\n.code { border-collapse:collapse; width:100%; font-family: \"Andale Mono\", monospace; font-size:10pt; line-height: 1.2em }\n.color_black { color: black }\n.color_blue { color: blue }\n.color_green { color: green }\n.color_orange { color: orange }\n.color_red { color: red }\n.line { border-left: 3px solid #ccc; padding-left: 1ex; white-space: pre; }\n.msg { background-color:#fff8b4; color:#000; float:left; font-family:Helvetica, sans-serif; font-size: smaller; font-weight: bold; margin-bottom:10px; margin-top:10px; max-width:60em; padding:0.5em 1ex 0.5em 1ex; -webkit-border-radius:5px; -webkit-box-shadow:1px 1px 7px #000; white-space: pre-wrap; word-wrap: break-word; }\n.num { background-color:#eee; color:#444; font-size: smaller; padding-right:2ex; text-align:right; width:2.5em; }\n.dangling { background-color:white; color: gray; }\n.visited { background-color:LemonChiffon; color: darkmagenta; }\n.tooltip { display: none; background-color:#FFF0F0; border: 2px solid #F00; font-weight: normal; left:10em; padding: 2px; position: absolute; top: -1em; -webkit-border-radius:5px; -webkit-box-shadow:1px 1px 7px #000; z-index: 1}\n.with_tooltip { position: relative; }\n.with_tooltip:hover .tooltip, .visited:hover .tooltip { display: block; }\n</style>\n</head>\n<body>\n<center><h1>Cfg Node <a href=\"./../../ZrLogUtil.java.337e30ea96785103e9ef6aacf5eebc60.html#LINE192\">25</a></h1></center>PROC: <a href=\"./../com.zrlog.util.ZrLogUtil.getExecSqlList%28java.lang.String%2Cjava.lang.String%29%3Ajava.util.List.17b60f12dfaefe604691e887a56e3e4f.html\">List ZrLogUtil.getExecSqlList(String,String)</a> LINE: <a href=\"./../../ZrLogUtil.java.337e30ea96785103e9ef6aacf5eebc60.html#LINE192\">192</a>\n<br>PREDS:\n<a href=\"./../nodes/com.zrlog.util.ZrLogUtil.getExecSqlList%28java.lang.String%2Cjava.lang.String%29%3Ajava.util.List.17b60f12dfaefe604691e887a56e3e4f_node22.html\"><span class='visited with_tooltip'>N_22<span class='tooltip'>node22 preds:24 succs:25 exn:42 </span></span></a><br>SUCCS:\n<a href=\"./../nodes/com.zrlog.util.ZrLogUtil.getExecSqlList%28java.lang.String%2Cjava.lang.String%29%3Ajava.util.List.17b60f12dfaefe604691e887a56e3e4f_node26.html\"><span class='visited with_tooltip'>N_26<span class='tooltip'>node26 preds:25 succs:27 exn:42 </span></span></a><br>EXN:\n<a href=\"./../nodes/com.zrlog.util.ZrLogUtil.getExecSqlList%28java.lang.String%2Cjava.lang.String%29%3Ajava.util.List.17b60f12dfaefe604691e887a56e3e4f_node42.html\"><span class='visited with_tooltip'>N_42<span class='tooltip'>node42 preds: succs:40 41 exn:3 </span></span></a><br>\n<LISTING class='color_green'>n$40=*&#GB<>$com.zrlog.util.ZrLogUtil.LOGGER:org.slf4j.Logger*(root com.zrlog.util.ZrLogUtil) [line 192];\n*&$irvar7:org.slf4j.Logger*=n$40 [line 192];\n</LISTING>\n<hr width=\"100%\">\n<a name=\"session96\" href=\"./../nodes/com.zrlog.util.ZrLogUtil.getExecSqlList%28java.lang.String%2Cjava.lang.String%29%3Ajava.util.List.17b60f12dfaefe604691e887a56e3e4f_node25.html#session96\">node25#session96</a>(<a href=\"./../../ZrLogUtil.java.337e30ea96785103e9ef6aacf5eebc60.html#LINE192\">192</a>) [compute pre] liveness 25\n<LISTING class='color_black'>JOIN\n\nLEFT: { $bcvar4, f, $irvar7, fileVersion, sqlList, return, util.ZrLogUtil }\nRIGHT: { $bcvar4, return, util.ZrLogUtil }\nRESULT: { $bcvar4, f, $irvar7, fileVersion, sqlList, return, util.ZrLogUtil }\n\n</LISTING>\n<hr width=\"100%\"></code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>#!/usr/bin/python\n#\n# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.\n#\n# Copyright (c) 2013-2014 The Bitcoin developers\n# Distributed under the MIT/X11 software license, see the accompanying\n# file COPYING or http://www.opensource.org/licenses/mit-license.php.\n#\n\nfrom __future__ import print_function\nimport json\nimport struct\nimport re\nimport base64\nimport httplib\nimport sys\n\nsettings = {}\n\nclass BitcoinRPC:\n\tdef __init__(self, host, port, username, password):\n\t\tauthpair = \"%s:%s\" % (username, password)\n\t\tself.authhdr = \"Basic %s\" % (base64.b64encode(authpair))\n\t\tself.conn = httplib.HTTPConnection(host, port, False, 30)\n\n\tdef execute(self, obj):\n\t\tself.conn.request('POST', '/', json.dumps(obj),\n\t\t\t{ 'Authorization' : self.authhdr,\n\t\t\t 'Content-type' : 'application/json' })\n\n\t\tresp = self.conn.getresponse()\n\t\tif resp is None:\n\t\t\tprint(\"JSON-RPC: no response\", file=sys.stderr)\n\t\t\treturn None\n\n\t\tbody = resp.read()\n\t\tresp_obj = json.loads(body)\n\t\treturn resp_obj\n\n\t@staticmethod\n\tdef build_request(idx, method, params):\n\t\tobj = { 'version' : '1.1',\n\t\t\t'method' : method,\n\t\t\t'id' : idx }\n\t\tif params is None:\n\t\t\tobj['params'] = []\n\t\telse:\n\t\t\tobj['params'] = params\n\t\treturn obj\n\n\t@staticmethod\n\tdef response_is_error(resp_obj):\n\t\treturn 'error' in resp_obj and resp_obj['error'] is not None\n\ndef get_block_hashes(settings, max_blocks_per_call=10000):\n\trpc = BitcoinRPC(settings['host'], settings['port'],\n\t\t\t settings['rpcuser'], settings['rpcpassword'])\n\n\theight = settings['min_height']\n\twhile height < settings['max_height']+1:\n\t\tnum_blocks = min(settings['max_height']+1-height, max_blocks_per_call)\n\t\tbatch = []\n\t\tfor x in range(num_blocks):\n\t\t\tbatch.append(rpc.build_request(x, 'getblockhash', [height + x]))\n\n\t\treply = rpc.execute(batch)\n\n\t\tfor x,resp_obj in enumerate(reply):\n\t\t\tif rpc.response_is_error(resp_obj):\n\t\t\t\tprint('JSON-RPC: error at height', height+x, ': ', resp_obj['error'], file=sys.stderr)\n\t\t\t\texit(1)\n\t\t\tassert(resp_obj['id'] == x) # assume replies are in-sequence\n\t\t\tprint(resp_obj['result'])\n\n\t\theight += num_blocks\n\nif __name__ == '__main__':\n\tif len(sys.argv) != 2:\n\t\tprint(\"Usage: linearize-hashes.py CONFIG-FILE\")\n\t\tsys.exit(1)\n\n\tf = open(sys.argv[1])\n\tfor line in f:\n\t\t# skip comment lines\n\t\tm = re.search('^\\s*#', line)\n\t\tif m:\n\t\t\tcontinue\n\n\t\t# parse key=value lines\n\t\tm = re.search('^(\\w+)\\s*=\\s*(\\S.*)$', line)\n\t\tif m is None:\n\t\t\tcontinue\n\t\tsettings[m.group(1)] = m.group(2)\n\tf.close()\n\n\tif 'host' not in settings:\n\t\tsettings['host'] = '127.0.0.1'\n\tif 'port' not in settings:\n\t\tsettings['port'] = 50163\n\tif 'min_height' not in settings:\n\t\tsettings['min_height'] = 0\n\tif 'max_height' not in settings:\n\t\tsettings['max_height'] = 313000\n\tif 'rpcuser' not in settings or 'rpcpassword' not in settings:\n\t\tprint(\"Missing username and/or password in cfg file\", file=stderr)\n\t\tsys.exit(1)\n\n\tsettings['port'] = int(settings['port'])\n\tsettings['min_height'] = int(settings['min_height'])\n\tsettings['max_height'] = int(settings['max_height'])\n\n\tget_block_hashes(settings)\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Cuda_>#include <dmlc/filesystem.h>\n#include <gtest/gtest.h>\n\n#include <algorithm>\n#include <cmath>\n\n\n#include <thrust/device_vector.h>\n#include <thrust/iterator/counting_iterator.h>\n\n#include \"xgboost/c_api.h\"\n\n#include \"../../../src/common/device_helpers.cuh\"\n#include \"../../../src/common/hist_util.h\"\n\n#include \"../helpers.h\"\n\nnamespace xgboost {\nnamespace common {\n\nvoid TestDeviceSketch(bool use_external_memory) {\n // create the data\n int nrows = 10001;\n std::shared_ptr<xgboost::DMatrix> *dmat = nullptr;\n\n size_t num_cols = 1;\n dmlc::TemporaryDirectory tmpdir;\n std::string file = tmpdir.path + \"/big.libsvm\";\n if (use_external_memory) {\n auto sp_dmat = CreateSparsePageDMatrix(nrows * 3, 128UL, file); // 3 entries/row\n dmat = new std::shared_ptr<xgboost::DMatrix>(std::move(sp_dmat));\n num_cols = 5;\n } else {\n std::vector<float> test_data(nrows);\n auto count_iter = thrust::make_counting_iterator(0);\n // fill in reverse order\n std::copy(count_iter, count_iter + nrows, test_data.rbegin());\n\n // create the DMatrix\n DMatrixHandle dmat_handle;\n XGDMatrixCreateFromMat(test_data.data(), nrows, 1, -1,\n &dmat_handle);\n dmat = static_cast<std::shared_ptr<xgboost::DMatrix> *>(dmat_handle);\n }\n\n int device{0};\n int max_bin{20};\n int gpu_batch_nrows{0};\n\n // find quantiles on the CPU\n HistogramCuts hmat_cpu;\n hmat_cpu.Build((*dmat).get(), max_bin);\n\n // find the cuts on the GPU\n HistogramCuts hmat_gpu;\n size_t row_stride = DeviceSketch(device, max_bin, gpu_batch_nrows, dmat->get(), &hmat_gpu);\n\n // compare the row stride with the one obtained from the dmatrix\n size_t expected_row_stride = 0;\n for (const auto &batch : dmat->get()->GetBatches<xgboost::SparsePage>()) {\n const auto &offset_vec = batch.offset.ConstHostVector();\n for (int i = 1; i <= offset_vec.size() -1; ++i) {\n expected_row_stride = std::max(expected_row_stride, offset_vec[i] - offset_vec[i-1]);\n }\n }\n\n ASSERT_EQ(expected_row_stride, row_stride);\n\n // compare the cuts\n double eps = 1e-2;\n ASSERT_EQ(hmat_gpu.MinValues().size(), num_cols);\n ASSERT_EQ(hmat_gpu.Ptrs().size(), num_cols + 1);\n ASSERT_EQ(hmat_gpu.Values().size(), hmat_cpu.Values().size());\n ASSERT_LT(fabs(hmat_cpu.MinValues()[0] - hmat_gpu.MinValues()[0]), eps * nrows);\n for (int i = 0; i < hmat_gpu.Values().size(); ++i) {\n ASSERT_LT(fabs(hmat_cpu.Values()[i] - hmat_gpu.Values()[i]), eps * nrows);\n }\n\n delete dmat;\n}\n\nTEST(gpu_hist_util, DeviceSketch) {\n TestDeviceSketch(false);\n}\n\nTEST(gpu_hist_util, DeviceSketch_ExternalMemory) {\n TestDeviceSketch(true);\n}\n\n} // namespace common\n} // namespace xgboost\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Rust_>use anchor_lang::prelude::*;\n\nuse crate::state::*;\n\n#[derive(Accounts)]\npub struct UpdateFarm<'info> {\n // farm\n #[account(mut, has_one = farm_manager)]\n pub farm: Box<Account<'info, Farm>>,\n pub farm_manager: Signer<'info>,\n}\n\npub fn handler(\n ctx: Context<UpdateFarm>,\n config: Option<FarmConfig>,\n manager: Option<Pubkey>,\n max_counts: Option<MaxCounts>,\n) -> Result<()> {\n let farm = &mut ctx.accounts.farm;\n\n if let Some(config) = config {\n farm.config = config;\n }\n\n if let Some(manager) = manager {\n farm.farm_manager = manager;\n }\n\n if let Some(max_counts) = max_counts {\n farm.max_counts = max_counts;\n }\n\n msg!(\"updated farm\");\n Ok(())\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_TypeScript_> */\r\nexport type MotionOrderTypes = 'order' | 'random' | 'unique-random';\r\n\r\n/**\r\n * Motion setting of the model.\r\n */\r\nexport interface Motion {\r\n /**\r\n * Type of the order of motion.\r\n *\r\n * - `order`: According to the order of the array.\r\n * - `random`: Random.\r\n * - `unique-random`: Like \"box-gacha\".\r\n */\r\n order: MotionOrderTypes;\r\n /**\r\n * Names of the motion assets. It refers to `assets` name in [[AssetModel]].\r\n */\r\n values: string[];\r\n}\r\n\r\n/**\r\n * [[Motion]] settings of the model.\r\n */\r\nexport interface MotionSetting {\r\n /**\r\n * Basic [[Motion]] setting of the model.\r\n */\r\n basic: Motion;\r\n /**\r\n * Click [[Motion]] setting of the model.\r\n */\r\n click: Motion;\r\n}\r\n\r\n/**\r\n * Asset data of a model.\r\n */\r\nexport interface AssetModel {\r\n /**\r\n * Identifer of the model.\r\n *\r\n * It intended for debugging. You can give it any string.\r\n */\r\n id: string;\r\n /**\r\n * X position of the model in the component.\r\n */\r\n x: number;\r\n /**\r\n * Y position of the model in the component.\r\n */\r\n y: number;\r\n /**\r\n * Urls of the model.\r\n *\r\n * It contains both of model data and motions.\r\n */\r\n assets: {\r\n model3: string;\r\n [assetname: string]: string;\r\n };\r\n /**\r\n * [[MotionSetting]]s of the model.\r\n */\r\n motions: MotionSetting;\r\n}\r\n\r\n/**\r\n * Asset data of models.\r\n *\r\n * A component can contain multiple [[AssetModel]]s.\r\n */\r\nexport interface AssetModels {\r\n /**\r\n * [[AssetModel]]s to append to a component.\r\n */\r\n models: AssetModel[];\r\n}\r\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>/// @file\r\n/// @author David Pilger <dpilger26@gmail.com>\r\n/// [GitHub Repository](https://github.com/dpilger26/NumCpp)\r\n///\r\n/// License\r\n/// Copyright 2020 David Pilger\r\n///\r\n/// Permission is hereby granted, free of charge, to any person obtaining a copy of this\r</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_> * 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 * %CopyrightEnd%\n */\n/*\n * hipe_mode_switch.h\n */\n#ifndef HIPE_MODE_SWITCH_H\n#define HIPE_MODE_SWITCH_H\n\n/* command codes for beam_emu -> hipe_mode_switch() call */\n#define HIPE_MODE_SWITCH_CMD_CALL\t\t0\n#define HIPE_MODE_SWITCH_CMD_RETURN\t\t1\n#define HIPE_MODE_SWITCH_CMD_THROW\t\t2\n#define HIPE_MODE_SWITCH_CMD_RESUME\t\t3\n\n/* result codes for beam_emu <- hipe_mode_switch() return */\n#define HIPE_MODE_SWITCH_RES_RETURN\t\t4\n#define HIPE_MODE_SWITCH_RES_CALL_EXPORTED\t5\n#define HIPE_MODE_SWITCH_RES_THROW\t\t6\n\n/* additional result codes for hipe_mode_switch() <- native return */\n#define HIPE_MODE_SWITCH_RES_SUSPEND\t\t7\n#define HIPE_MODE_SWITCH_RES_WAIT\t\t8\n#define HIPE_MODE_SWITCH_RES_WAIT_TIMEOUT\t9\n#define HIPE_MODE_SWITCH_RES_TRAP\t\t10\n\n#define HIPE_MODE_SWITCH_CMD_CALL_CLOSURE\t11 /* BEAM -> mode_switch */\n#define HIPE_MODE_SWITCH_RES_CALL_CLOSURE\t12 /* mode_switch <- native */\n\n#define HIPE_MODE_SWITCH_RES_APPLY\t\t13 /* mode_switch <- native */\n\n#define HIPE_MODE_SWITCH_RES_CALL_BEAM\t 14\n\n#ifndef ASM\n\n#include \"error.h\"\n\nextern int hipe_modeswitch_debug;\n\nvoid hipe_mode_switch_init(void);\nvoid hipe_set_call_trap(Uint *bfun, void *nfun, int is_closure);\nProcess *hipe_mode_switch(Process*, unsigned, Eterm*);\nvoid hipe_inc_nstack(Process *p);\nvoid hipe_empty_nstack(Process *p);\nvoid hipe_set_closure_stub(ErlFunEntry *fe);\nEterm hipe_build_stacktrace(Process *p, struct StackTrace *s);\n\nERTS_GLB_INLINE void hipe_reserve_beam_trap_frame(Process*, Eterm reg[], unsigned arity);\nERTS_GLB_INLINE void hipe_unreserve_beam_trap_frame(Process*);\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>#include<iostream>\nusing namespace std;\nint main(){\n double a[2],b[2],c[2],x[2],m[2][2],ans[2],inv[2][2],det,s,t;\n while(cin >>a[0]>>a[1]>>b[0]>>b[1]>>c[0]>>c[1]>>x[0]>>x[1]){\n m[0][0] = b[0]-a[0];\n m[1][0] = b[1]-a[1];\n m[0][1] = c[0]-a[0];\n m[1][1] = c[1]-a[1];\n ans[0] = x[0]-a[0];\n ans[1] = x[1]-a[1];\n det = m[0][0]*m[1][1]-m[0][1]*m[1][0];\n inv[0][0] = m[1][1]/det;\n inv[0][1] = -m[0][1]/det;\n inv[1][0] = -m[1][0]/det;\n inv[1][1] = m[0][0]/det;\n s = ans[0]*inv[0][0]+ans[1]*inv[0][1];\n t = ans[0]*inv[1][0]+ans[1]*inv[1][1];\n if(s>0 && t>0 && s+t<1){cout <<\"YES\"<<endl;}\n else{cout <<\"NO\"<<endl;}\n }\n return 0;\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_CSS_> padding: 0;\n margin: 0;\n list-style: none;\n}\n#mobile-nav ul li {\n position: relative;\n}\n#mobile-nav ul li a {\n color: #fff;\n font-size: 13px;\n /* text-transform: uppercase; */\n overflow: hidden;\n padding: 10px 22px 10px 15px;\n position: relative;\n text-decoration: none;\n width: 100%;\n display: block;\n outline: none;\n font-weight: 700;\n font-family: \"Montserrat\", sans-serif;\n}\n#mobile-nav ul .menu-has-children i.fa-chevron-up {\n color: #18d26e;\n}\n#mobile-nav ul .menu-has-children i {\n position: absolute;\n right: 0;\n z-index: 99;\n padding: 15px;\n cursor: pointer;\n color: #fff;\n}\n#mobile-nav ul .menu-item-active {\n color: #18d26e;\n}\n#mobile-nav ul li li {\n padding-left: 30px;\n}\n\n.menu-has-children ul\n{display: none;}\n\n.sf-arrows .sf-with-ul {\n padding-right: 30px;\n}\n\n.sf-arrows .sf-with-ul:after {\n content: \"\\f107\";\n position: absolute;\n right: 15px;\n font-family: FontAwesome;\n font-style: normal;\n font-weight: normal;\n color:black;\n}\n\n.sf-arrows ul .sf-with-ul:after {\n content: \"\\f105\";\n}\n\n\n.nav-menu li:hover > ul,\n.nav-menu li.sfHover > ul {\n display: block;\n}\n.nav-menu ul {\n margin: 4px 0 0 0;\n padding: 10px;\n box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);\n background: #fff;\n}\n.nav-menu ul {\n position: absolute;\n display: none;\n top: 100%;\n left: 0;\n z-index: 99;\n}\n\n.sf-arrows .sf-with-ul {\n padding-right: 30px;\n}\n.nav-menu li {\n position: relative;\n white-space: nowrap;\n}\n.scrollto img {\n width: 132px;\n height: 64px;\n margin-top: -22px;\n margin-left: -30px;\n}\n.scrollto1 img{\n height: 15px;\n}\n.text-center1{\n margin-top: 4px;\n padding: 1px;\n}\n.image-res{\n height: 20px;\n margin-top: -5px;\n}\n\n@media (max-width: 768px){\n#nav-menu-container {\n display: none;\n}\n\n#mobile-nav-toggle {\n display: inline;\n}\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_XML_><annotation verified=\"yes\">\n\t<folder>test_turbines</folder>\n\t<filename>44506878.jpg</filename>\n\t<path>C:\\Users\\dylan\\Documents\\Senior Design\\ME 71\\Project Files\\test_turbines\\44506878.jpg</path>\n\t<source>\n\t\t<database>Unknown</database>\n\t</source>\n\t<size>\n\t\t<width>512</width>\n\t\t<height>512</height>\n\t\t<depth>3</depth>\n\t</size>\n\t<segmented>0</segmented>\n\t<object>\n\t\t<name>wind turbine</name>\n\t\t<pose>Unspecified</pose>\n\t\t<truncated>0</truncated>\n\t\t<difficult>0</difficult>\n\t\t<bndbox>\n\t\t\t<xmin>73</xmin>\n\t\t\t<ymin>91</ymin>\n\t\t\t<xmax>208</xmax>\n\t\t\t<ymax>445</ymax>\n\t\t</bndbox>\n\t</object>\n</annotation>\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Pascal_>// ----------------------------------------------------------------------------\r\n// Unit : PxRemoteStream.pas - a part of PxLib\r\n// Author : Matthias Hryniszak\r\n// Date : 2005-02-01\r\n// Version : 1.0\r\n// Description : Remote stream - client part\r\n// Changes log : 2005-02-01 - initial version\r\n// 2005-03-04 - added SendTimeout and RecvTimeout properties\r\n// 2006-02-24 - added compatibility with Delphi 6\r\n// ToDo : Testing, comments in code.\r\n// ----------------------------------------------------------------------------\r\n\r\nunit PxRemoteStream;\r\n\r\n{$I PxDefines.inc}\r\n\r\ninterface\r\n\r\nuses\r\n Windows, Winsock, Classes, SysUtils,\r\n{$IFDEF VER130}\r\n PxDelphi5,\r\n{$ENDIF} \r\n PxBase, PxUtils, PxResources, PxRemoteStreamDefs;\r\n\r\ntype\r\n TPxRemoteStream = class (TStream)\r\n private\r\n FSocket: TSocket;\r\n FSendTimeout: Integer;\r\n FRecvTimeout: Integer;\r\n function Open(FileName: String; Mode: Word; MakeBackup: Boolean): Boolean;\r\n procedure SetSendTimeout(Value: Integer);\r\n procedure SetRecvTimeout(Value: Integer);\r\n protected\r\n function Connect(URL: string; Mode: Word; MakeBackup: Boolean; ASendTimeout, ARecvTimeout: Integer): Boolean;\r\n{$IFDEF VER130}\r\n procedure SetSize(NewSize: Integer); override;\r\n{$ENDIF}\r\n{$IFDEF VER140}\r\n procedure SetSize(const NewSize: Int64); override;\r\n{$ENDIF}\r\n{$IFDEF VER150}\r\n procedure SetSize(const NewSize: Int64); override;\r\n{$ENDIF}\r\n{$IFDEF FPC}\r\n procedure SetSize(const NewSize: Int64); override;\r\n{$ENDIF}\r\n public\r\n constructor Create(URL: string; Mode: Word; MakeBackup: Boolean = True; ASendTimeout: Integer = -1; ARecvTimeout: Integer = -1);\r\n destructor Destroy; override;\r\n class function Delete(URL: string; MakeBackup: Boolean = True; ASendTimeout: Integer = -1; ARecvTimeout: Integer = -1): Boolean;\r\n function FileAge: TDateTime;\r\n function Read(var Buffer; Count: Longint): Longint; override;\r\n{$IFDEF VER130}\r\n function Seek(Offset: Longint; Origin: Word): Longint; override;\r\n{$ENDIF}\r\n{$IFDEF VER140}\r\n function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;\r\n{$ENDIF}\r\n{$IFDEF VER150}\r\n function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;\r\n{$ENDIF}\r\n{$IFDEF FPC}\r\n function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; override;\r\n{$ENDIF}\r\n function Write(const Buffer; Count: Longint): Longint; override;\r\n property SendTimeout: Integer read FSendTimeout write SetSendTimeout;\r\n property RecvTimeout: Integer read FRecvTimeout write SetRecvTimeout;\r\n end;\r\n\r\nimplementation\r\n\r\nuses\r\n SysConst;\r\n\r\n{ TPxRemoteStream }\r\n\r\n{ Private declarations }\r\n\r\nfunction TPxRemoteStream.Open(FileName: String; Mode: Word; MakeBackup: Boolean): Boolean;\r\nvar\r\n Request: TPxRemoteStreamOpenFilePacket;\r\n Response: TPxRemoteStreamResponse;\r\nbegin\r\n Result := False;\r\n Request.Header.Command := PX_CMD_OPEN;\r\n Request.Mode := Mode;\r\n if MakeBackup then\r\n Request.Backup := 1\r\n else\r\n Request.Backup := 0;\r\n StrPCopy(@Request.FileName, FileName);\r\n Winsock.send(FSocket, Request, SizeOf(Request), 0);\r\n if (Winsock.recv(FSocket, Response, SizeOf(Response), 0) <> SizeOf(Response)) or (Response.Header.Command <> PX_RES_OK) then\r\n begin\r\n closesocket(FSocket);\r\n FSocket := TSocket(INVALID_SOCKET);\r\n SetLastError(Response.Header.Command);\r\n Exit;\r\n end;\r\n Result := True;\r\nend;\r\n\r\nprocedure TPxRemoteStream.SetSendTimeout(Value: Integer);\r\nbegin\r\n FSendTimeout := SendTimeout;\r\n if setsockopt(FSocket, SOL_SOCKET, SO_SNDTIMEO, @SendTimeout, SizeOf(SendTimeout)) <> S_OK then\r\n Beep;\r\nend;\r\n\r\nprocedure TPxRemoteStream.SetRecvTimeout(Value: Integer);\r\nbegin\r\n FRecvTimeout := RecvTimeout;\r\n if setsockopt(FSocket, SOL_SOCKET, SO_RCVTIMEO, @RecvTimeout, SizeOf(RecvTimeout)) <> S_OK then\r\n Beep;\r\nend;\r\n\r\n{ Protected declarations }\r\n\r\nfunction TPxRemoteStream.Connect(URL: string; Mode: Word; MakeBackup: Boolean; ASendTimeout, ARecvTimeout: Integer): Boolean;\r\nvar\r\n P, Port: Integer;\r\n Host, FileName: string;\r\n Addr: TSockAddrIn;\r\nbegin\r\n Result := False;\r\n\r\n // decode URL\r\n P := Pos('pxrs://', LowerCase(URL));\r\n if P <> 1 then\r\n Exit;\r\n System.Delete(URL, 1, 7);\r\n P := Pos(':', URL);\r\n if P <> 0 then\r\n begin\r\n Host := Copy(URL, 1, P - 1);\r\n System.Delete(URL, 1, P);\r\n P := Pos('/', URL);\r\n if P = 0 then\r\n Exit;\r\n if not TryStrToInt(Copy(URL, 1, P - 1), Port) then\r\n Exit;\r</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Cuda_>\n#pragma once\n\n#include <ATen/jit_macros.h>\n#include <ATen/detail/FunctionTraits.h>\n#include <ATen/native/TensorIterator.h>\n#include <ATen/native/TensorIteratorDynamicCasting.h>\n#include <ATen/cuda/detail/OffsetCalculator.cuh>\n#include <ATen/OpMathType.h>\n#include <ATen/native/cuda/thread_constants.h>\n\n#include <thrust/tuple.h>\n\n#include <ATen/native/cuda/MemoryAccess.cuh>\n\n\nnamespace at { namespace native {\n\ntemplate<int N>\nstatic OffsetCalculator<N> make_input_offset_calculator(const TensorIteratorBase& iter) {\n // array size can not be 0, this happens when N == 0\n constexpr int array_size = std::max<int>(N, 1);\n TORCH_INTERNAL_ASSERT(N == iter.ntensors() - iter.noutputs());\n std::array<const int64_t*, array_size> strides;\n int64_t element_sizes[array_size];\n for (int i = 0; i < N; i++) {\n strides[i] = iter.strides(i + iter.noutputs()).data();\n element_sizes[i] = iter.element_size(i + iter.noutputs());\n }\n return OffsetCalculator<N>(iter.ndim(), iter.shape().data(), strides.data(), element_sizes);\n}\n\ntemplate <int num_outputs = 1>\nstatic OffsetCalculator<num_outputs> make_output_offset_calculator(const TensorIteratorBase& iter) {\n TORCH_INTERNAL_ASSERT(num_outputs == iter.noutputs());\n std::array<const int64_t*, num_outputs> strides;\n int64_t element_sizes[num_outputs];\n for (int i = 0; i < num_outputs; i++) {\n strides[i] = iter.strides(i).data();\n element_sizes[i] = iter.element_size(i);\n }\n return OffsetCalculator<num_outputs>(iter.ndim(), iter.shape().data(), strides.data(), element_sizes);\n}\n\ntemplate<typename func_t, typename policy_t>\n__device__ inline void elementwise_kernel_helper(func_t f, policy_t policy) {\n using traits = function_traits<func_t>;\n using return_t = typename traits::result_type;\n using args_t = typename traits::ArgsTuple;\n\n int idx = blockIdx.x;\n\n return_t results[thread_work_size()];\n args_t args[thread_work_size()];\n\n // load\n policy.load(args, idx);\n\n // compute\n #pragma unroll\n for (int i = 0; i < thread_work_size(); i++) {\n if (policy.check_inbounds(i)) {\n results[i] = c10::guts::apply(f, args[i]);\n }\n }\n\n // store\n policy.store(results, idx);\n}\n\n}} // namespace at::native\n\n// Note:\n// CUDA and ROCm get diverged in this PR:\n// https://github.com/pytorch/pytorch/pull/32383\n// Because for some reason trying to enable vectorized\n// memory access introduce regression on ROCm.\n\n#if !defined(USE_ROCM)\n #include <ATen/native/cuda/CUDALoops.cuh>\n#else\n #include <ATen/native/cuda/ROCmLoops.cuh>\n#endif\n\nnamespace at { namespace native {\n\n#ifdef USE_JITERATOR\n/* Note [Jiterator]\nThe \"jiterator\" simply just-in-time compiles the same kernels that\nLoops.cuh (and CUDALoops.cuh) usually build. This reduces build time,\nbuild size, and initial CUDA context size.\n\nBy default on non-Windows systems, it also caches compiled kernels in ~/.cache/torch/kernels.\nThis behavior is controlled with two environment variables:\n - USE_PYTORCH_KERNEL_CACHE, if set to zero then this will disable all cache use\n - PYTORCH_KERNEL_CACHE_PATH, if set specifies the folder to use for cached kernels\n\nThe jiterator currently has some limitations, however. It cannot:\n - handle math on complex datatypes\n - handle kernels with scalar parameters\n\nThese improvements will likely come soon.\n\nFor examples of how to use the jiterator see the i1 and gcd kernel\nimplementations, which pass jittable strings implementing their\noperations instead of the typical CUDA functors.\n\nTo pass a runtime argument (similar to lambda captures in non-JIT kernels),\nwe need to pass to additional arguments to `jitted_gpu_kernel` by value.\nCurrently only primitive C++ types used for computation are valid.\nThe order of these extra arguments should be same as the order they appear\nin kernel's function signature. (look at polygamma for example)\n\nNOTE: One big restriction being that these arguments should be after the\narguments provided by TensorIterator. Eg. While capturing `n`, where\n`scalar_t x` and `scalar_t y` are provided by TensorIterator,\n* foo(scalar_t x, scalar_t y, int n) works!\n* foo(int n, scalar_t x, scalar_y) doesn't work\n* foo(scalar_t x, int n, scalar_y) doesn't work\n\n*/\n\n// Entrypoint for jitted GPU kernels.\n// Only handles elementwise unary and binary kernels with a\n// common dtype and a single output.\n// NOTE: this assumes the op's iterator has a common_dtype.\n// NOTE: We use std::tuple instead of parameter pack\n// for `extra_args` due to following\n// bug on older versions of clang\n// https://bugs.llvm.org/show_bug.cgi?id=23029\ntemplate <\n char const* name,\n typename return_type,\n typename f_inputs_type,\n int arity,\n typename... Args>\nvoid jitted_gpu_kernel(\n TensorIteratorBase& iter,\n const std::string& f,\n at::cuda::jit::BinaryFuncVariant scalar_pos =</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package geneticEngine;\n\nimport java.util.Random;\n\n/**\n * An abstract class that represents some characteristic of a Chromosome object. \n *\n * @author Sam Ragusa\n * @param <V> An object to store (and manipulate if appropriate) whatever information\n * that the Gene object is supposed to store. \n */\npublic abstract class Gene<V>\n{\n\t/**\n\t * The information that the Gene stores.\n\t */\n\tpublic V info;\n\t\n\t/**\n\t * A Random object to be used in implementations of this abstract class.\n\t */\n\tpublic Random rand = new Random();\n\t\n\t/**\n\t * A constructor to create a Gene containing random information.\n\t */\n\tpublic Gene() \n\t{\n\t\tsetDataRandomly();\n\t}\n\t\n\t\n\t/**\n\t * Gets and returns the instance variable info.\n\t * \n\t * @return The object contained within the instance variable \"info\".\n\t */\n\tpublic V getInfo()\n\t{\n\t\treturn info;\n\t}\n\t\n\t\n\t/**\n\t * Replace the information contained within the gene by new, random information.\n\t */\n\tabstract public void mutate();\n\n\t\n\t/**\n\t * Set the info contained within the Gene to random\n\t * values. This is used when initializing the population.\n\t */\n\tabstract public void setDataRandomly();\n\t\n\t\n\t/**\n\t * Gets and returns the String representation of the info contained within\n\t * the Gene.\n\t * \n\t * @return The String representation of the info instance variable.\n\t */\n\tpublic String toString()\n\t{\n\t\treturn info.toString();\n\t}\n\t\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Scala_> if (hasNext) {\n val r = array(i).asInstanceOf[A]\n i += 1\n r\n } else Iterator.empty.next()\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import numpy as np\nn = int(input())\nA = np.array(list(map(int, list(input()))))\n\nfor _ in range(n-1):\n A = np.abs(np.diff(A))\nprint(A[0])</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Nim_>## ! relative to its anchor.\n\ntype\n Graphic3dVerticalTextAlignment* {.size: sizeof(cint), importcpp: \"Graphic3d_VerticalTextAlignment\", header: \"Graphic3d_VerticalTextAlignment.hxx\".} = enum\n Graphic3dVTA_BOTTOM, ## !< The anchor lies on the last line of the text.\n Graphic3dVTA_CENTER, ## !< The anchor lies on the center of the text (not bounding box).\n Graphic3dVTA_TOP, ## !< The anchor lies on the line preceding to the first line of the text.\n Graphic3dVTA_TOPFIRSTLINE ## !< The anchor lies on the first line of the text.\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>/*\n * Copyright 2018-2021 KMath contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage space.kscience.kmath.multik\n\nimport org.jetbrains.kotlinx.multik.ndarray.data.DataType\nimport space.kscience.kmath.nd.StructureND\nimport space.kscience.kmath.operations.DoubleField\nimport space.kscience.kmath.operations.ExponentialOperations\nimport space.kscience.kmath.operations.TrigonometricOperations\n\npublic object MultikDoubleAlgebra : MultikDivisionTensorAlgebra<Double, DoubleField>(),\n TrigonometricOperations<StructureND<Double>>, ExponentialOperations<StructureND<Double>> {\n override val elementAlgebra: DoubleField get() = DoubleField\n override val type: DataType get() = DataType.DoubleDataType\n\n override fun sin(arg: StructureND<Double>): MultikTensor<Double> = multikMath.mathEx.sin(arg.asMultik().array).wrap()\n\n override fun cos(arg: StructureND<Double>): MultikTensor<Double> = multikMath.mathEx.cos(arg.asMultik().array).wrap()\n\n override fun tan(arg: StructureND<Double>): MultikTensor<Double> = sin(arg) / cos(arg)\n\n override fun asin(arg: StructureND<Double>): MultikTensor<Double> = arg.map { asin(it) }\n\n override fun acos(arg: StructureND<Double>): MultikTensor<Double> = arg.map { acos(it) }\n\n override fun atan(arg: StructureND<Double>): MultikTensor<Double> = arg.map { atan(it) }\n\n override fun exp(arg: StructureND<Double>): MultikTensor<Double> = multikMath.mathEx.exp(arg.asMultik().array).wrap()\n\n override fun ln(arg: StructureND<Double>): MultikTensor<Double> = multikMath.mathEx.log(arg.asMultik().array).wrap()\n\n override fun sinh(arg: StructureND<Double>): MultikTensor<Double> = (exp(arg) - exp(-arg)) / 2.0\n\n override fun cosh(arg: StructureND<Double>): MultikTensor<Double> = (exp(arg) + exp(-arg)) / 2.0\n\n override fun tanh(arg: StructureND<Double>): MultikTensor<Double> {\n val expPlus = exp(arg)\n val expMinus = exp(-arg)\n return (expPlus - expMinus) / (expPlus + expMinus)\n }\n\n override fun asinh(arg: StructureND<Double>): MultikTensor<Double> = arg.map { asinh(it) }\n\n override fun acosh(arg: StructureND<Double>): MultikTensor<Double> = arg.map { acosh(it) }\n\n override fun atanh(arg: StructureND<Double>): MultikTensor<Double> = arg.map { atanh(it) }\n}\n\npublic val Double.Companion.multikAlgebra: MultikTensorAlgebra<Double, DoubleField> get() = MultikDoubleAlgebra\npublic val DoubleField.multikAlgebra: MultikTensorAlgebra<Double, DoubleField> get() = MultikDoubleAlgebra\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Rust_> ).unwrap_or(false);\n\n if delete {\n Some(idx)\n } else {\n None\n }\n }\n );</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_> def setUp(self) -> None:\n self.assembler = Assembler()\n\n def test_bpl_relative(self):\n code = \"BPL *+$10\"\n results = self.assembler.assemble(code, add_entry=False)\n self.assertEqual([\n (0x0000, [0x10, 0x0E]),\n ], results)\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>// Copyright (c) 2014-2016, The Monero Project\n// Copyright (c) 2017-2018, The Bixbite 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 <atomic>\n#include <cstdio>\n#include <algorithm>\n#include <fstream>\n#include <vector>\n\n#include <boost/filesystem.hpp>\n#include \"bootstrap_file.h\"\n#include \"bootstrap_serialization.h\"\n#include \"cryptonote_core/cryptonote_format_utils.h\"\n#include \"serialization/binary_utils.h\" // dump_binary(), parse_binary()\n#include \"serialization/json_utils.h\" // dump_json()\n#include \"include_base_utils.h\"\n#include \"blockchain_db/db_types.h\"\n\n#include <lmdb.h> // for db flag arguments\n\n#include \"fake_core.h\"\n\nnamespace\n{\n// CONFIG\nbool opt_batch = true;\nbool opt_verify = true; // use add_new_block, which does verification before calling add_block\nbool opt_resume = true;\nbool opt_testnet = true;\n\n// number of blocks per batch transaction\n// adjustable through command-line argument according to available RAM\n#if ARCH_WIDTH != 32\nuint64_t db_batch_size = 20000;\n#else\n// set a lower default batch size, pending possible LMDB issue with large transaction size\nuint64_t db_batch_size = 100;\n#endif\n\n// when verifying, use a smaller default batch size so progress is more\n// frequently saved\nuint64_t db_batch_size_verify = 5000;\n\nstd::string refresh_string = \"\\r \\r\";\n}\n\n\n\nnamespace po = boost::program_options;\n\nusing namespace cryptonote;\nusing namespace epee;\n\n\nstd::string join_set_strings(const std::unordered_set<std::string>& db_types_all, const char* delim)\n{\n std::string result;\n std::ostringstream s;\n std::copy(db_types_all.begin(), db_types_all.end(), std::ostream_iterator<std::string>(s, delim));\n result = s.str();\n if (result.length() > 0)\n result.erase(result.end()-strlen(delim), result.end());\n return result;\n}\n\n// db_type: lmdb, berkeley\n// db_mode: safe, fast, fastest</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>\t[TPS65911_IRQ_GPIO3_R] = {\n\t\t.mask = INT_MSK2_GPIO3_R_IT_MSK_MASK,\n\t\t.reg_offset = 1,\n\t},\n\t[TPS65911_IRQ_GPIO3_F] = {\n\t\t.mask = INT_MSK2_GPIO3_F_IT_MSK_MASK,\n\t\t.reg_offset = 1,\n\t},\n\n\t/* INT_STS2 */\n\t[TPS65911_IRQ_GPIO4_R] = {\n\t\t.mask = INT_MSK3_GPIO4_R_IT_MSK_MASK,\n\t\t.reg_offset = 2,\n\t},\n\t[TPS65911_IRQ_GPIO4_F] = {\n\t\t.mask = INT_MSK3_GPIO4_F_IT_MSK_MASK,\n\t\t.reg_offset = 2,\n\t},\n\t[TPS65911_IRQ_GPIO5_R] = {\n\t\t.mask = INT_MSK3_GPIO5_R_IT_MSK_MASK,\n\t\t.reg_offset = 2,\n\t},\n\t[TPS65911_IRQ_GPIO5_F] = {\n\t\t.mask = INT_MSK3_GPIO5_F_IT_MSK_MASK,\n\t\t.reg_offset = 2,\n\t},\n\t[TPS65911_IRQ_WTCHDG] = {\n\t\t.mask = INT_MSK3_WTCHDG_IT_MSK_MASK,\n\t\t.reg_offset = 2,\n\t},\n\t[TPS65911_IRQ_VMBCH2_H] = {\n\t\t.mask = INT_MSK3_VMBCH2_H_IT_MSK_MASK,\n\t\t.reg_offset = 2,\n\t},\n\t[TPS65911_IRQ_VMBCH2_L] = {\n\t\t.mask = INT_MSK3_VMBCH2_L_IT_MSK_MASK,</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>n = int(input())\na = int(input())\n\nx = n%500\n\nif x <= a:\n print('Yes')\nelse:\n print('No')</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"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 scanner = new Scanner(System.in);\n\t\twhile (true) {\n\t\t\tint w = scanner.nextInt(), h = scanner.nextInt();\n\t\t\tif (w == 0 && h == 0)\n\t\t\t\tbreak;\n\t\t\tfor (int i = 0; i < w; ++i) {\n\t\t\t\tfor (int j = 0; j < h; ++j) {\n\t\t\t\t\tSystem.out.print((i + j) % 2 == 0 ? '#' : '.');\n\t\t\t\t}\n\t\t\t\tSystem.out.print('\\n');\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}\n}\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Rust_> let result = self.poll(events, timeout);\n\n if result == 0 {\n if self.is_empty() {\n Ok(())\n } else {\n Err(io::ErrorKind::TimedOut.into())\n }\n } else if result > 0 {\n events.count = result as usize;\n Ok(())\n } else {\n Err(io::Error::last_os_error())\n }\n }\n\n /// Wait for readiness events on the given list of sources, or until the call\n /// is interrupted.\n pub fn wait(&mut self, events: &mut Events<K>) -> Result<(), io::Error> {\n events.initialize(&self);\n\n let result = self.poll(events, -1);\n\n if result < 0 {\n Err(io::Error::last_os_error())\n } else {\n events.count = result as usize;\n // As far as I know, `poll` should never return `0` if the timeout\n // value is `-1`.\n Ok(())\n }\n }\n\n fn poll(&mut self, events: &mut Events<K>, timeout: i32) -> i32 {\n unsafe {\n libc::poll(\n events.sources.list.as_mut_ptr() as *mut libc::pollfd,\n events.sources.list.len() as libc::nfds_t,\n timeout,\n )\n }\n }\n\n fn find(&self, key: &K) -> Option<usize> {\n self.index.iter().position(|k| k == key)\n }\n\n fn insert(&mut self, key: K, source: Source) {\n self.index.push(key);\n self.list.push(source);\n }\n}\n/// Custom wrapper added by gautham to make it compile\nstruct Fd(RawFd);\nimpl AsRawFd for Fd {\n fn as_raw_fd(&self) -> RawFd {\n self.0\n }\n}\n\n\n/// Wakers are used to wake up `wait`.\npub struct Waker {\n reader: UnixStream,\n writer: UnixStream,\n}\n\nimpl Waker {\n /// Create a new `Waker`.\n ///\n /// # Examples\n ///\n /// Wake a `wait` call from another thread.\n ///\n /// ```\n /// fn main() -> Result<(), Box<dyn std::error::Error>> {\n /// use std::thread;\n /// use std::time::Duration;\n /// use std::sync::Arc;\n ///\n /// use popol::{Sources, Events, Waker};\n ///\n /// const WAKER: &'static str = \"waker\";\n ///\n /// let mut events = Events::new();\n /// let mut sources = Sources::new();\n ///\n /// // Create a waker and keep it alive until the end of the program, so that\n /// // the reading end doesn't get closed.\n /// let waker = Arc::new(Waker::new(&mut sources, WAKER)?);\n /// let _waker = waker.clone();\n ///\n /// let handle = thread::spawn(move || {\n /// thread::sleep(Duration::from_millis(160));\n ///\n /// // Wake up popol on the main thread.\n /// _waker.wake().expect(\"waking shouldn't fail\");\n /// });\n ///\n /// // Wait to be woken up by the other thread. Otherwise, time out.\n /// sources.wait_timeout(&mut events, Duration::from_secs(1))?;\n ///\n /// assert!(!events.is_empty(), \"There should be at least one event selected\");\n ///\n /// let mut events = events.iter();\n /// let (key, event) = events.next().unwrap();\n ///\n /// assert!(key == &WAKER, \"The event is triggered by the waker\");\n /// assert!(event.readable, \"The event is readable\");</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_> [ -0.222222222222222, -0.666666666666667, -0.444444444444444, 0.514536992829256 ],\n [ -0.222222222222222, -0.444444444444444, -0.666666666666667, 0.514536992829256 ],\n [ -0.222222222222222, -0.222222222222222, -0.888888888888889, 0.514536992829256 ],\n [ 0.000000000000000, -0.888888888888889, -0.444444444444444, 0.514536992829256 ],\n [ 0.000000000000000, -0.666666666666667, -0.666666666666667, 0.514536992829256 ],\n [ 0.000000000000000, -0.444444444444444, -0.888888888888889, 0.514536992829256 ],\n [ 0.222222222222222, -0.888888888888889, -0.666666666666667, 0.514536992829256 ],\n [ 0.222222222222222, -0.666666666666667, -0.888888888888889, 0.514536992829256 ],\n [ 0.444444444444444, -0.888888888888889, -0.888888888888889, 0.514536992829256 ],\n [ -0.888888888888889, -0.888888888888889, 0.222222222222222, 0.514536992829256 ],\n [ -0.888888888888889, -0.666666666666667, 0.000000000000000, 0.514536992829256 ],\n [ -0.888888888888889, -0.444444444444444, -0.222222222222222, 0.514536992829256 ],\n [ -0.888888888888889, -0.222222222222222, -0.444444444444444, 0.514536992829256 ],\n [ -0.888888888888889, 0.000000000000000, -0.666666666666667, 0.514536992829256 ],\n [ -0.888888888888889, 0.222222222222222, -0.888888888888889, 0.514536992829256 ],\n [ -0.666666666666667, -0.888888888888889, 0.000000000000000, 0.514536992829256 ],</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>//******************************************************************************\n//\n// Copyright (c) 2015 Microsoft Corporation. All rights reserved.\n//\n// This code is licensed under the MIT License (MIT).\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n//******************************************************************************\n\n#include <TestFramework.h>\n#import <Foundation/Foundation.h>\n#import <CoreFoundation/CoreFoundation.h>\n#import <Security/SecItem.h>\n#import \"Frameworks/Security/GenericPasswordItemHandler.h\"\n\n@interface MockVault : NSObject\n\n+ (instancetype)create ACTIVATOR;\n- (void)add:(WSCPasswordCredential*)credential;\n- (void)remove:(WSCPasswordCredential*)credential;\n- (WSCPasswordCredential*)retrieve:(NSString*)resource userName:(NSString*)userName;\n- (NSArray*)findAllByResource:(NSString*)resource;\n- (NSArray*)findAllByUserName:(NSString*)userName;\n- (NSArray*)retrieveAll;\n- (instancetype)init;\n\n@end\n\n@implementation MockVault {\n NSMutableArray* credentialList;\n}\n\n+ (instancetype)create {\n return nil;\n}\n\n- (void)add:(WSCPasswordCredential*)credential {\n [credentialList addObject:credential];\n}\n\n- (void)remove:(WSCPasswordCredential*)credential {\n [credentialList removeObject:credential];\n}\n\n- (WSCPasswordCredential*)retrieve:(NSString*)resource userName:(NSString*)userName {\n return nil;\n}\n\n- (NSArray*)findAllByResource:(NSString*)resource {\n return nil;\n}\n\n- (NSArray*)findAllByUserName:(NSString*)userName {\n return nil;\n}\n\n- (NSArray*)retrieveAll {\n return credentialList;\n}\n\n- (void)dealloc {\n [credentialList release];\n credentialList = nil;\n\n [super dealloc];\n}\n\n- (instancetype)init {\n if (self = [super init]) {\n credentialList = [NSMutableArray new];\n }\n return self;\n}\n\n@end\n\nTEST(Security, GenericPasswordHandler_Add) {\n MockVault* mockVault = [MockVault new];\n GenericPasswordItemHandler* handler = [[GenericPasswordItemHandler alloc] initWithVault:reinterpret_cast<WSCPasswordVault*>(mockVault)];\n\n // First try to add the credential.\n NSString* mockPassword = @\"fak3Passw0rd\";\n\n NSDictionary* dictionary = @{\n (__bridge id)(kSecClass) : (__bridge id)(kSecClassGenericPassword),\n (__bridge id)(kSecAttrAccount) : @\"fakeAccount@fakeEmail.com\",\n (__bridge id)(kSecAttrService) : @\"www.fakeWebService.com\",\n (__bridge id)(kSecValueData) : [mockPassword dataUsingEncoding:NSUTF8StringEncoding],\n (__bridge id)(kSecReturnAttributes) : (__bridge id)kCFBooleanTrue,\n };\n\n id idOutDictionary;\n [handler add:dictionary withResult:&idOutDictionary];\n\n NSDictionary* outDictionary = static_cast<NSDictionary*>(idOutDictionary);\n\n // Make sure that the returned attributes match what is set. NOTE: normally\n // extra read only attributes like creation time would have been added. This\n // is not possible with the current WinRT apis.\n ASSERT_OBJCEQ((__bridge id)(kSecClassGenericPassword), [outDictionary objectForKey:(__bridge id)(kSecClass)]);\n ASSERT_OBJCEQ(@\"fakeAccount@fakeEmail.com\", [outDictionary objectForKey:(__bridge id)(kSecAttrAccount)]);\n ASSERT_OBJCEQ(@\"www.fakeWebService.com\", [outDictionary objectForKey:(__bridge id)(kSecAttrService)]);\n\n [outDictionary release];\n [mockVault release];\n [handler release];\n}\n\nTEST(Security, GenericPasswordHandler_AddEmpty) {\n MockVault* mockVault = [MockVault new];\n GenericPasswordItemHandler* handler = [[GenericPasswordItemHandler alloc] initWithVault:reinterpret_cast<WSCPasswordVault*>(mockVault)];\n\n // First try to add the credential.\n NSString* mockPassword = @\"fak3Passw0rd\";\n\n // Go Crazy and have empty username and service.\n NSDictionary* dictionary = @{\n (__bridge id)(kSecClass) : (__bridge id)(kSecClassGenericPassword),\n (__bridge id)(kSecAttrService) : @\"\",\n (__bridge id)(kSecValueData) : [mockPassword dataUsingEncoding:NSUTF8StringEncoding],\n (__bridge id)(kSecReturnAttributes) : (__bridge id)kCFBooleanTrue,\n };\n\n id idOutDictionary;\n [handler add:dictionary withResult:&idOutDictionary];\n\n NSDictionary* outDictionary = static_cast<NSDictionary*>(idOutDictionary);\n\n // Make sure that the returned attributes match what is set. NOTE: normally\n // extra read only attributes like creation time would have been added. This\n // is not possible with the current WinRT apis.\n // Note that its a little weird that @\"\" doesn't come back but there is no way for us to tell.\n ASSERT_EQ(1, [outDictionary count]);\n ASSERT_OBJCEQ((__bridge id)(kSecClassGenericPassword), [outDictionary objectForKey:(__bridge id)(kSecClass)]);\n\n [outDictionary release];\n [mockVault release];\n [handler release];\n}\n\nTEST(Security, GenericPasswordHandler_Query) {\n MockVault* mockVault = [MockVault new];\n GenericPasswordItemHandler* handler = [[GenericPasswordItemHandler alloc] initWithVault:reinterpret_cast<WSCPasswordVault*>(mockVault)];\n\n // First try to add the credentials.\n NSString* mockPassword1 = @\"fak3Passw0rd1\";</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Dockerfile_>FROM postgres:11\nCOPY main.sh /data/main.sh\nRUN chmod +x /data/main.sh\nCOPY prerequirements.sh /data/prerequirements.sh\nRUN chmod +x /data/prerequirements.sh\nRUN /data/prerequirements.sh \nENTRYPOINT [ \"/data/main.sh\" ]</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_> value.size = size;\r\n value.offset = offset;\r\n resultData->handle =\r\n mProcs.graphBuilderConstantWithGpuBuffer(graphBuilder->handle, desc, &value);\r\n#endif\r\n return true;\r\n }\r\n\r\n bool Server::DoGraphBuilderGruInternal(ObjectId graphBuilderId,\r\n ObjectId inputId,\r\n ObjectId weightId,\r\n ObjectId recurrentWeightId,\r\n int32_t steps,\r\n int32_t hiddenSize,\r\n WNNGruOptions const* options,\r\n ObjectHandle result) {\r\n auto* graphBuilder = GraphBuilderObjects().Get(graphBuilderId);\r\n auto* input = OperandObjects().Get(inputId);\r\n auto* weight = OperandObjects().Get(weightId);\r\n auto* recurrentWeight = OperandObjects().Get(recurrentWeightId);\r\n if (graphBuilder == nullptr || input == nullptr || weight == nullptr ||\r\n recurrentWeight == nullptr) {\r\n return false;\r\n }\r\n\r\n // Create and register the operandArray object.\r\n auto* resultData = OperandArrayObjects().Allocate(result.id);\r\n if (resultData == nullptr) {\r\n return false;\r\n }\r\n resultData->generation = result.generation;\r\n resultData->contextInfo = graphBuilder->contextInfo;\r\n if (resultData->contextInfo != nullptr) {\r\n if (!TrackContextChild(resultData->contextInfo, ObjectType::OperandArray, result.id)) {\r\n return false;\r\n }\r\n }\r\n resultData->handle =\r\n mProcs.graphBuilderGru(graphBuilder->handle, input->handle, weight->handle,\r\n recurrentWeight->handle, steps, hiddenSize, options);\r\n return true;\r\n }\r\n\r\n bool Server::DoGraphBuilderSplitInternal(ObjectId graphBuilderId,\r\n ObjectId inputId,\r\n uint32_t const* splits,\r\n uint32_t splitsCount,\r\n WNNSplitOptions const* options,\r\n ObjectHandle result) {\r\n auto* graphBuilder = GraphBuilderObjects().Get(graphBuilderId);\r\n auto* input = OperandObjects().Get(inputId);\r\n if (graphBuilder == nullptr || input == nullptr) {\r\n return false;\r</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>#include <iostream>\n\nusing namespace std;\n\nint main()\n{\n int i=4;\n double d=4.0;\n string s=\"hackerRank \";\n\n\n // Declare second integer, double, and String variables.\n int a;\n double b;\n // Read and save an integer, double, and String to your variables.\n cin>>a;\n cin>>b;\n string inputString; // declare a variable to hold our input\n\n /*\n cin.get(); /// to eat whitespace\n getline(cin,inputString);\n*/\n/// a better ways is:\n/// ws : white spaces\n if(getline(cin>>ws, inputString))\n {\n getline(cin,inputString);\n }\n\n // Print the sum of both integer variables on a new line.\n cout<<(i+a)<<\"\\n\";\n cout.precision(1);\n // Print the sum of the double variables on a new line.\n cout<<fixed<<(b+d)<<\"\\n\";\n // Concatenate and print the String variables on a new line\n cout<<s<<inputString;\n // The 's' variable above should be printed first.\n\n return 0;\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_ObjectiveC_> }\n \n UIImage *image = nil;\n if (auto layerBackground = dynamic_cast<MapboxVectorLayerBackground*>(layer.get())) {\n if (layerBackground->paint.color) {\n image = [self imageForPolygon:[UIColor colorFromRGBA:layerBackground->paint.color->colorForZoom(0.0)] size:imageSize];\n }\n } else if (auto layerSymbol = dynamic_cast<MapboxVectorLayerSymbol*>(layer.get())) {\n if (layerSymbol->layout.iconImageField) {\n MapboxRegexField textField = layerSymbol->layout.iconImageField->textForZoom(0.0);\n if (!textField.chunks.empty()) {\n image = [self imageForSymbol:textField.chunks[0].str size:imageSize];\n }\n } else if (layerSymbol->paint.textColor) {\n image = [self imageForText:[UIColor colorFromRGBA:layerSymbol->paint.textColor->colorForZoom(0.0)] size:imageSize];\n }\n } else if (auto layerCircle = dynamic_cast<MapboxVectorLayerCircle*>(layer.get())) {\n if (const auto &color = layerCircle->paint.fillColor) {\n image = [self imageForCircle:[UIColor colorFromRGBA:*color] size:imageSize];\n }\n } else if (auto layerLine = dynamic_cast<MapboxVectorLayerLine*>(layer.get())) {\n if (const auto &color = layerLine->paint.color) {\n image = [self imageForLinear:[UIColor colorFromRGBA:color->colorForZoom(0.0)] size:imageSize];\n }\n } else if (auto layerFill = dynamic_cast<MapboxVectorLayerFill*>(layer.get())) {\n if (const auto &color = layerFill->paint.color) {\n image = [self imageForPolygon:[UIColor colorFromRGBA:color->colorForZoom(0.0)] size:imageSize];\n }\n }\n\n if (!layer->ident.empty()) {\n std::string groupName;\n std::string name = layer->ident;\n if (useGroups) {\n // Parse the name apart\n const auto pos = layer->ident.find_first_of('_');\n if (pos != std::string::npos) {\n groupName = layer->ident.substr(0,pos);\n name = layer->ident.substr(pos+1);\n }\n }\n if (NSString *nameStr = [NSString stringWithUTF8String:name.c_str()]) {\n MaplyLegendEntry *entry = [[MaplyLegendEntry alloc] init];\n entry.name = nameStr;\n entry.image = image;\n\n if (!groupName.empty()) {\n if (NSString *groupNameStr = [NSString stringWithUTF8String:groupName.c_str()]) {\n MaplyLegendEntry *group = groups[groupNameStr];\n if (!group) {\n group = [[MaplyLegendEntry alloc] init];\n group.name = groupNameStr;\n group.entries = [NSMutableArray array];\n groups[groupNameStr] = group;\n [legend addObject:group];\n }\n \n [group.entries addObject:entry];\n }\n } else {\n [legend addObject:entry];\n }\n }\n }\n }\n \n return legend;\n}\n\n// These wrap the style if someone is using a non-standard path to call it\n// We do that in at least one place\n\n- (nullable NSArray *)stylesForFeatureWithAttributes:(NSDictionary *__nonnull)attributes\n onTile:(MaplyTileID)tileID\n inLayer:(NSString *__nonnull)layer\n viewC:(NSObject<MaplyRenderControllerProtocol> *__nonnull)viewC\n{\n MutableDictionaryCRef dictWrap = [attributes toDictionaryC];\n const QuadTreeIdentifier tileIDc(tileID.x,tileID.y,tileID.level);\n const std::string layerName = [layer cStringUsingEncoding:NSUTF8StringEncoding];\n \n auto styles = style->stylesForFeature(nil, *(dictWrap.get()), tileIDc, layerName);\n \n // Build up a wrapper for each one\n NSMutableArray *retStyles = [NSMutableArray array];\n for (auto theStyle: styles) {\n [retStyles addObject:[[MaplyVectorStyleReverseWrapper alloc] initWithCStyle:theStyle]];\n }\n\n return retStyles;\n}\n\n- (BOOL)layerShouldDisplay:(NSString *__nonnull)layer tile:(MaplyTileID)tileID\n{</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>A,B,N = map(int, input().split())\nprint(int(A*(N-1)/B)-A*int((N-1)/B))</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>class RoadTrip < Oracle\n def choices #override the choices method in superclass\n [\"visit Vegas\", \"fly to Fiji\", \"romp in Rome\"]\n end\nend\n# What is the result of the following:\n\ntrip = RoadTrip.new\np trip.predict_the_future\n# \"You will visit Vegas/ any other choices from RoadTrip class\"\n# Since we are calling #predict_the_future on an isntance of RoadTrip, it will call choices method in RoadTrip. Ruby will look for a definition of choices in the calling object.\n# Every time Ruby tries to resolve a method name, it will start with the methods defined on the class you are calling.</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_XML_> android:theme=\"@style/AppTheme\">\n <activity android:name=\".MainActivity\">\n <intent-filter>\n <action android:name=\"android.intent.action.MAIN\" />\n\n <category android:name=\"android.intent.category.LAUNCHER\" />\n </intent-filter>\n </activity>\n </application>\n\n</manifest></code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Bash_>#!/bin/sh\n\n# If a command fails then the deploy stops\nset -e\nGITROOT=\"$HOME/git/www-xltech-static\"\n\ncd $GITROOT\n\nPUBLISH=\"NO\"\n\ncase $1 in\n -h|-\\?|--help) # Call a \"show_help\" function to display a synopsis, then exit.\n ##show_help\n exit\n ;;\n -p|--publish|-y|--yes|-l|--live)\n PUBLISH=\"YES\"\n break\n ;;\n -np|--nopublish|--no-publish|-d|--draft|--no|-t|--test)\n PUBLISH=\"NO\"\n break\n ;;\n *)\n PUBLISH=\"NO\"\n ;;\nesac\n\ncase $PUBLISH in\n YES)\n printf \"\\t *** Publishing to Live Website\\n\"\n if [ -e no.publish ]; then\n rm no.publish\n fi\n if [ -e content/no.publish ]; then\n rm content/no.publish\n fi\n touch yes.publish\n touch content/yes.publish\n break\n ;;\n *) # Default case: If no more options then break out of the loop.\n printf \"\\t *** NOT Publishing to Live Website - Test/Draft Mode \\n\"\n if [ -e yes.publish ]; then\n rm yes.publish\n fi\n if [ -e content/yes.publish ]; then\n rm content/yes.publish\n fi\n touch no.publish\n touch content/no.publish\n break\nesac\n\nprintf \"\\033[0;32mDeploying updates to GitHub...\\033[0m\\n\"\n\n# Add changes to git.\ngit add .\n\n# Commit changes.\nmsg=\"rebuilding site $(date)\"\nif [ -n \"$*\" ]; then\n msg=\"$msg - $*\"\nfi\ngit commit -m \"$msg\"\n\n# Push source and build repos.\ngit push origin master\n\nprintf \"\\033[0;32mDeleting old public build files...\\033[0m\\n\"\n\nmkdir -p $GITROOT/public\n\nif [ -d $GITROOT/public ]; then\n cd $GITROOT/public\n if [[ \" $(uname -a) \" != *\"Linux\"* ]]; then # Assume MacOS/BSD\n find -Esd . -not -iregex \".*\\.git.*\" -delete\n else\n find . -not -iregex \".*\\.git.*\" -delete\n fi\n cd $GITROOT\nfi\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Lisp_>(cl:in-package #:sicl-method-combination)\n\n(defun make-method-combination (variant-signature template)\n (make-instance 'method-combination\n :variant-signature variant-signature\n :template template))\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>/******************************************************************************\n\n This source file is part of the tomviz project.\n\n Copyright Kitware, Inc.\n\n This source code is released under the New BSD License, (the \"License\").\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#ifndef tomvizDataPropertiesPanel_h\n#define tomvizDataPropertiesPanel_h\n\n#include <QWidget>\n#include <QScopedPointer>\n\nnamespace tomviz\n{\n\nclass DataSource;\n\n/// DataPropertiesPanel is the panel that shows information (and other controls)\n/// for a DataSource. It monitors tomviz::ActiveObjects instance and shows\n/// information about the active data source, as well allow the user to edit\n/// configurable options, such as color map.\nclass DataPropertiesPanel : public QWidget\n{\n Q_OBJECT\n typedef QWidget Superclass;\npublic:\n DataPropertiesPanel(QWidget* parent=0);\n virtual ~DataPropertiesPanel();\n\nprivate slots:\n void setDataSource(DataSource*);\n void update();\n void render();\n\nprivate:\n Q_DISABLE_COPY(DataPropertiesPanel)\n\n class DPPInternals;\n const QScopedPointer<DPPInternals> Internals;\n};\n\n}\n\n#endif\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Go_>package clearbit\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/dghubble/sling\"\n)\n\nconst (\n\tprospectorBase = \"https://prospector.clearbit.com\"\n)\n\n// ProspectorItem represents each of the items returned by a call to Search\ntype ProspectorItem struct {\n\tID string `json:\"id\"`\n\tName struct {\n\t\tFullName string `json:\"fullName\"`\n\t\tGivenName string `json:\"givenName\"`\n\t\tFamilyName string `json:\"familyName\"`\n\t} `json:\"name\"`\n\tTitle string `json:\"title\"`\n\tEmail string `json:\"email\"`\n}\n\n// ProspectorSearchParams wraps the parameters needed to interact with the\n// Prospector API\ntype ProspectorSearchParams struct {\n\tDomain string `url:\"domain,omitempty\"`\n\tRole string `url:\"role,omitempty\"`\n\tRoles []string `url:\"roles[],omitempty\"`\n\tSeniority string `url:\"seniority,omitempty\"`\n\tSeniorities []string `url:\"seniorities[],omitempty\"`\n\tTitle string `url:\"title,omitempty\"`\n\tTitles []string `url:\"titles[],omitempty\"`\n\tName string `url:\"name,omitempty\"`\n\tLimit int `url:\"limit,omitempty\"`\n}\n\n// ProspectorService gives access to the Prospector API.\n//\n// The Prospector API lets you fetch contacts and emails associated with a\n// company, employment role, seniority, and job title.\ntype ProspectorService struct {\n\tbaseSling *sling.Sling\n\tsling *sling.Sling\n}\n\nfunc newProspectorService(sling *sling.Sling) *ProspectorService {\n\treturn &ProspectorService{\n\t\tbaseSling: sling.New(),\n\t\tsling: sling.Base(prospectorBase).Path(\"/v1/people/\"),\n\t}\n}\n\n// Search lets you fetch contacts and emails associated with a company,\n// employment role, seniority, and job title.\nfunc (s *ProspectorService) Search(params ProspectorSearchParams) ([]ProspectorItem, *http.Response, error) {\n\titems := new([]ProspectorItem)\n\tae := new(apiError)\n\tresp, err := s.sling.New().Get(\"search\").QueryStruct(params).Receive(items, ae)\n\treturn *items, resp, relevantError(err, *ae)\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_XML_></listAttribute>\n<listAttribute key=\"org.eclipse.debug.core.MAPPED_RESOURCE_TYPES\">\n<listEntry value=\"1\"/>\n</listAttribute>\n<stringAttribute key=\"org.eclipse.jdt.launching.MAIN_TYPE\" value=\"com.ibm.js.team.workitem.commandline.WorkitemCommandLine\"/>\n<stringAttribute key=\"org.eclipse.jdt.launching.PROGRAM_ARGUMENTS\" value=\"-exportworkitems /ignoreErrors repository="https://clm.example.com:9443/ccm" user=ralph password=ralph projectArea="JKE Banking (Change Management)" exportFile="C:\\aaTemp\\Export\\Test.csv" query="All" delimiter=";" /allColumns /suppressAttributeExceptions\"/>\n<stringAttribute key=\"org.eclipse.jdt.launching.PROJECT_ATTR\" value=\"com.ibm.js.team.workitem.commandline\"/>\n</launchConfiguration></code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Scala_>/*\n * ProbEvidenceTest.scala\n * Probability of evidence computation tests.\n * \n * Created By: Avi Pfeffer (apfeffer@cra.com)\n * Creation Date: Jan 1, 2009\n * \n * Copyright 2013 Avrom J. Pfeffer and Charles River Analytics, Inc.\n * See http://www.cra.com or email figaro@cra.com for information.\n * \n * See http://www.github.com/p2t2/figaro for a copy of the software license.\n */\n\npackage com.cra.figaro.test.algorithm.factored\n\nimport org.scalatest.Matchers\nimport org.scalatest.WordSpec\nimport com.cra.figaro.algorithm.sampling._\nimport com.cra.figaro.language._\nimport com.cra.figaro.library.atomic.continuous._\nimport com.cra.figaro.test._\nimport com.cra.figaro.algorithm.factored.beliefpropagation.BeliefPropagation\n\nclass ProbEvidenceTest extends WordSpec with Matchers {\n\n \"Computing probability of evidence\" when {\n \"given a vanilla model with one condition\" should {\n \"return the probability the condition is satisfied\" in {\n val universe = Universe.createNew()\n val f = Flip(0.7)(\"f\", universe)\n sampleTest(0.7, List(NamedEvidence(\"f\", Observation(true))), universe)\n }\n }\n\n \"given a vanilla model with two independent conditions\" should {\n \"return the probability both conditions are satisfied\" in {\n val universe = Universe.createNew()\n val f1 = Flip(0.7)(\"f1\", universe)\n val f2 = Flip(0.4)(\"f2\", universe)\n sampleTest(0.7 * 0.4, List(NamedEvidence(\"f1\", Observation(true)), NamedEvidence(\"f2\", Observation(true))), universe)\n }\n }\n\n \"given a vanilla mode with two dependent conditions\" should {\n \"return the probability both conditions are jointly satisfied\" in {\n val universe = Universe.createNew()\n val d = Select(0.2 -> 0.6, 0.8 -> 0.9)\n val f1 = Flip(d)(\"f1\", universe)\n val f2 = Flip(d)(\"f2\", universe)\n sampleTest(0.2 * 0.6 * 0.6 + 0.8 * 0.9 * 0.9, List(NamedEvidence(\"f1\", Observation(true)), NamedEvidence(\"f2\", Observation(true))), universe)\n }\n }\n\n \"given a vanilla model with two dependent conditions and a constraint\" should {\n \"return the probability both conditions are satisfied, taking into account the constraint\" in {\n val universe = Universe.createNew()\n val d = Select(0.5 -> 0.6, 0.5 -> 0.9)(\"d\", universe)\n val f1 = Flip(d)(\"f1\", universe)\n val f2 = Flip(d)(\"f2\", universe)\n sampleTest(0.2 * 0.6 * 0.6*0.5 + 0.8 * 0.9 * 0.9*0.5, \n List(NamedEvidence(\"f1\", Observation(true)), NamedEvidence(\"f2\", Observation(true)), NamedEvidence(\"d\", Constraint((d: Double) => if (d > 0.7) 0.8; else 0.2))), \n universe)\n }\n }\n\n \"given a constant whose condition is not satisfied\" should {\n \"return 0\" in {\n val universe = Universe.createNew()\n val c = Constant(8)(\"c\", universe)\n sampleTest(0, List(NamedEvidence(\"c\", Observation(7))), universe)\n }\n }\n\n \"given a simple dist with a condition on the result\" should {\n \"return the expectation over the clauses of the probability the result satisfies the condition\" in {\n val universe = Universe.createNew()\n val d = Dist(0.3 -> Flip(0.6), 0.7 -> Flip(0.9))(\"d\", universe)\n sampleTest(0.3 * 0.6 + 0.7 * 0.9, List(NamedEvidence(\"d\", Observation(true))), universe)\n }\n }\n\n \"given a complex dist with a condition on the result\" should {\n \"return the expectation over the clauses of the probability the result satisfies the condition\" in {\n val universe = Universe.createNew()\n val p1 = Select(0.2 -> 0.4, 0.8 -> 0.6)\n val p2 = Constant(0.4)\n val d = Dist(p1 -> Flip(0.6), p2 -> Flip(0.9))(\"d\", universe)\n sampleTest(0.2 * (0.5 * 0.6 + 0.5 * 0.9) + 0.8 * (0.6 * 0.6 + 0.4 * 0.9), List(NamedEvidence(\"d\", Observation(true))), universe)\n }\n }\n\n\n \"given a caching chain with a condition on the result\" should {\n \"return the expectation over the parent of the probability the result satisfies the condition\" in {\n val universe = Universe.createNew()\n val p1 = Select(0.4 -> 0.3, 0.6 -> 0.9)\n val c = CachingChain(p1, (d: Double) => if (d < 0.4) Flip(0.3); else Flip(0.8))(\"c\", universe)\n sampleTest(0.4 * 0.3 + 0.6 * 0.8, List(NamedEvidence(\"c\", Observation(true))), universe)\n }\n }\n\n }\n\n \n\n def sampleTest(prob: Double, evidence: List[NamedEvidence[_]], universe: Universe) {\n universe.assertEvidence(evidence)\n val alg = BeliefPropagation(100, universe.activeElements.toList:_*)\n alg.start\n alg.computeEvidence should be(prob +- 0.01)\n \n alg.kill\n }\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_># frozen_string_literal: true\n\n# Copyright 2021 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://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# Auto-generated by gapic-generator-ruby. DO NOT EDIT!\n\n\nmodule Google\n module Ads\n module GoogleAds\n module V8\n module Common\n # Represents a filter on locations in a feed item set.\n # Only applicable if the parent Feed of the FeedItemSet is a LOCATION feed.\n # @!attribute [rw] labels\n # @return [::Array<::String>]\n # If multiple labels are set, then only feeditems marked with all the labels\n # will be added to the FeedItemSet.\n # @!attribute [rw] business_name_filter\n # @return [::Google::Ads::GoogleAds::V8::Common::BusinessNameFilter]\n # Business name filter.\n class DynamicLocationSetFilter\n include ::Google::Protobuf::MessageExts\n extend ::Google::Protobuf::MessageExts::ClassMethods\n end\n\n # Represents a business name filter on locations in a FeedItemSet.\n # @!attribute [rw] business_name\n # @return [::String]\n # Business name string to use for filtering.\n # @!attribute [rw] filter_type\n # @return [::Google::Ads::GoogleAds::V8::Enums::FeedItemSetStringFilterTypeEnum::FeedItemSetStringFilterType]\n # The type of string matching to use when filtering with business_name.\n class BusinessNameFilter\n include ::Google::Protobuf::MessageExts\n extend ::Google::Protobuf::MessageExts::ClassMethods\n end\n\n # Represents a filter on affiliate locations in a FeedItemSet.\n # Only applicable if the parent Feed of the FeedItemSet is an\n # AFFILIATE_LOCATION feed.\n # @!attribute [rw] chain_ids\n # @return [::Array<::Integer>]\n # Used to filter affiliate locations by chain ids. Only affiliate locations\n # that belong to the specified chain(s) will be added to the FeedItemSet.\n class DynamicAffiliateLocationSetFilter\n include ::Google::Protobuf::MessageExts\n extend ::Google::Protobuf::MessageExts::ClassMethods\n end\n end\n end\n end\n end\nend\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Haskell_>maybeAll :: (a -> Bool)\n -> Maybe a\n -> Bool\nmaybeAll = all\n\neitherAll :: (a -> Bool)\n -> Either b a\n -> Bool\neitherAll = all\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import numpy as np\nimport sys\n\ninput = sys.stdin.readline\n\na,b = input().split()\n\nc = int(a+b)\n\nfor i in range(1,100):\n if c//i == i:\n print(\"Yes\")\n exit()\n\nprint(\"No\")\n\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_SQL_>CREATE DATABASE pc_parts;\n\\c pc_parts;\nCREATE TABLE parts(id SERIAL PRIMARY KEY, manufacturer VARCHAR, series VARCHAR, price DECIMAL);\nCREATE TABLE types(id SERIAL PRIMARY KEY, name VARCHAR);\nCREATE TABLE reviews(id SERIAL PRIMARY KEY, writtenby VARCHAR, rating VARCHAR, content VARCHAR, partid INTEGER, createdat BIGINT);\nCREATE TABLE parts_types(id SERIAL PRIMARY KEY, partid INTEGER, typeid INTEGER);\nCREATE DATABASE pc_parts_test WITH TEMPLATE pc_parts;</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_C_> norm_sec = (double)tv.tv_sec - gtod_ref_time_sec;\n the_time = norm_sec + tv.tv_usec * 1.0e-6;\n return the_time;\n}\n\nint chol(double *A, unsigned int n)\n{\n register unsigned i, j, k;\n register double tmp;\n\n for (j = 0; j < n; j++)\n {\n for (i = j; i < n; i++)\n {\n tmp = A[IDX(i, j, n)];\n for (k = 0; k < j;)\n {\n if (k < max(j - BLKSIZE, 0))\n {\n tmp -= A[IDX(i, k, n)] * A[IDX(j, k, n)] +\n A[IDX(i, k + 1, n)] * A[IDX(j, k + 1, n)] +\n A[IDX(i, k + 2, n)] * A[IDX(j, k + 2, n)] +\n A[IDX(i, k + 3, n)] * A[IDX(j, k + 3, n)] +\n A[IDX(i, k + 4, n)] * A[IDX(j, k + 4, n)] +\n A[IDX(i, k + 5, n)] * A[IDX(j, k + 5, n)] +\n A[IDX(i, k + 6, n)] * A[IDX(j, k + 6, n)] +\n A[IDX(i, k + 7, n)] * A[IDX(j, k + 7, n)];\n k += BLKSIZE;\n }\n else\n {\n tmp -= A[IDX(i, k, n)] * A[IDX(j, k, n)];\n k++;\n }\n }\n A[IDX(i, j, n)] = tmp;\n }\n\n if (tmp < 0.0)\n {\n return (1);\n }\n\n A[IDX(j, j, n)] = sqrt(A[IDX(j, j, n)]);\n tmp = A[IDX(j, j, n)];\n for (i = j + 1; i < n; i++)\n {\n A[IDX(i, j, n)] /= tmp;\n }\n }\n\n return (0);\n}\n\nint main(int argc, char **argv)\n{\n double *A;\n double t1, t2;\n int i, j, n, ret;\n double dtime;\n\n n = atoi(argv[1]);\n A = malloc(n * n * sizeof(double));\n assert(A != NULL);\n\n for (i = 0; i < n; i++)\n {\n A[IDX(i, i, n)] = 1.0;\n }\n\n dtime = dclock();\n if (chol(A, n))\n {\n fprintf(stderr, \"Matrix is not symmetric or not positive definite\\n\");\n }\n dtime = dclock() - dtime;\n printf(\"Time: %le \\n\", dtime);\n\n fflush(stdout);\n\n free(A);\n return 0;\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>import styled from 'styled-components';\nimport { COLOR_GRAY_3, COLOR_ERROR } from '../../../styles/colors';\n\nconst IconContainer = styled.span`\n fill: ${COLOR_GRAY_3};\n height: 100%;\n width: 22px;\n top: 0;\n position: absolute;\n line-height: 1;\n border: 0;\n z-index: 2;\n display: flex;\n align-items: center;\n justify-content: center;\n\n svg {\n width: 16px !important;\n height: 16px !important;\n font-size: 16px !important;\n }\n\n :not(button) {\n pointer-events: none;\n }\n\n ${props =>\n props.iconPosition === 'left' &&\n `\n left: ${props.readOnly ? 0 : '0.8rem'};\n `}\n ${props =>\n props.iconPosition === 'right' &&\n `\n right: ${props.readOnly ? 0 : '0.8rem'};\n `}\n ${props =>\n props.error &&\n `\n fill: ${COLOR_ERROR};\n color: ${COLOR_ERROR};\n `}\n`;\n\nexport default IconContainer;\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>#!/usr/bin/env ruby\n# frozen_string_literal: true\n\n# Check RabbitMQ consumers\n# ===\n#\n# DESCRIPTION:\n# This plugin checks the number of consumers on the RabbitMQ server\n#\n# PLATFORMS:\n# Linux, BSD, Solaris\n#\n# DEPENDENCIES:\n# RabbitMQ rabbitmq_management plugin\n# gem: sensu-plugin\n# gem: carrot-top\n#\n# LICENSE:\n# Copyright 2014 Daniel Kerwin <d.kerwin@gini.net>\n# Copyright 2014 Tim Smith <tim@cozy.co>\n# Copyright 2018 Mike Murray <37150283+monkey670@users.noreply.github.com>\n#\n# Released under the same terms as Sensu (the MIT license); see LICENSE\n# for details.\n\nrequire 'sensu-plugins-rabbitmq'\nrequire 'sensu-plugins-rabbitmq/check'\n\n# main plugin class\nclass CheckRabbitMQConsumers < Sensu::Plugin::RabbitMQ::Check\n option :regex,\n description: 'Treat the --queue flag as a regular expression.',\n long: '--regex',\n boolean: true,\n default: false\n\n option :queue,\n description: 'Comma separated list of RabbitMQ queues to monitor.',\n long: '--queue queue_name'\n\n option :exclude,\n description: 'Comma separated list of RabbitMQ queues to NOT monitor. All others will be monitored.',\n long: '--exclude queue_name'\n\n option :warn,\n short: '-w NUM_CONSUMERS',\n long: '--warn NUM_CONSUMERS',\n proc: proc(&:to_i),\n description: 'WARNING consumer count threshold',\n default: 5\n\n option :critical,\n short: '-c NUM_CONSUMERS',\n long: '--critical NUM_CONSUMERS',\n description: 'CRITICAL consumer count threshold',\n proc: proc(&:to_i),\n default: 2\n\n option :single_consumer,\n short: '-s SINGLE_CONSUMER',\n long: '--single SINGLE_CONSUMER',\n description: 'CRITICAL single consumer queue'\n\n def return_condition(missing, critical, warning)\n if critical.count > 0 || missing.count > 0\n message = []\n message << \"Queues in critical state: #{critical.join(', ')}. \" if critical.count > 0\n message << \"Queues missing: #{missing.join(', ')}\" if missing.count > 0\n critical(message.join(\"\\n\"))\n elsif warning.count > 0\n warning(\"Queues in warning state: #{warning.join(', ')}\")\n else</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import sys\ninput=sys.stdin.readline\nH, W = [int(x) for x in input().split()]\nboard = []\nfor _ in range(H):\n board.append(input())\n\nL = [[0]*W for _ in range(H)]\nR = [[0]*W for _ in range(H)]\nU = [[0]*W for _ in range(H)]\nD = [[0]*W for _ in range(H)]\nfor i in range(H):\n for j in range(W):\n if board[i][j] == '.':\n if j == 0:\n L[i][j] = 1\n else:\n L[i][j] = L[i][j - 1] + 1\n\nfor i in range(H):\n for j in reversed(range(W)):\n if board[i][j] == '.':\n if j == W - 1:\n R[i][j] = 1\n else:\n R[i][j] = R[i][j + 1] + 1\n\nfor j in range(W):\n for i in range(H):\n if board[i][j] == '.':\n if i == 0:\n U[i][j] = 1\n else:\n U[i][j] = U[i - 1][j] + 1\n\nfor j in range(W):\n for i in reversed(range(H)):\n if board[i][j] == '.':\n if i == H - 1:\n D[i][j] = 1\n else:\n D[i][j] = D[i + 1][j] + 1\n\nans = 0\nfor i in range(H):\n for j in range(W):\n cand = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3\n ans = max(ans, cand)\n \nprint(ans)</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Julia_>ParseInt(x) = parse(Int,x)\nparseMap(x::Array{SubString{String},1}) = map(ParseInt,x)\nfunction main()\n dict = Dict{Int64,Int64}()\n set = Set{Int64}()\n n = ParseInt(readline())\n b = parseMap(split(readline()))\n ans::Int64 = 0\n sums = [x for x = 1:n + 1]\n sums[1] = 0\n dict[0] = get(dict,0,1)\n push!(set, 0)\n for i in 1:n \n sums[i + 1] = (sums[i] + b[i]) \n dict[sums[i + 1]] = get(dict,sums[i + 1],0)\n dict[sums[i + 1]] += 1\n push!(set,sums[i + 1])\n end\n for i in set\n ans += dict[i] * (dict[i] - 1) / 2 \n end\n println(ans)\nend\nmain()</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_> * Stores the username.\n */\n @Column(name = \"username\")\n private String username;\n\n /**\n * Get the id.\n * \n * @return the id.\n */\n public BigInteger getId() {\n return id;\n }\n \n /**\n * Get the name.\n * \n * @return the name.\n */\n public String getName() {\n return name;\n }\n \n /**\n * Get the username.\n * \n * @return the username.\n */\n public String getUsername() {\n return username;\n }\n\n /**\n * Set the id.\n * \n * @param id the id.\n */\n public void setId(BigInteger id) {\n this.id = id;\n }\n \n /**\n * Set the name.\n * \n * @param name the name.\n */\n public void setName(String name) {\n this.name = name;\n }\n \n /**\n * Set the username.\n * \n * @param username the username.\n */\n public void setUsername(String username) {\n this.username = username;\n }\n}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Kotlin_>package de.lgohlke.streamutils\n\nimport org.assertj.core.api.Assertions.assertThat\nimport org.junit.jupiter.api.RepeatedTest\nimport org.slf4j.LoggerFactory\nimport java.io.ByteArrayInputStream\nimport java.io.ByteArrayOutputStream\nimport java.io.OutputStream\nimport java.io.PrintStream\n\n\nclass MergingStreamFascadeTest {\n companion object {\n @Suppress(\"JAVA_CLASS_ON_COMPANION\")\n private val log = LoggerFactory.getLogger(javaClass.enclosingClass)\n\n init {\n System.setProperty(\"org.slf4j.simpleLogger.log.de.lgohlke.streamutils.MergingStreamFascade\", \"DEBUG\")\n System.setProperty(\"org.slf4j.simpleLogger.log.de.lgohlke.streamutils.NotifyWaiter\", \"DEBUG\")\n\n System.setProperty(\"org.slf4j.simpleLogger.showDateTime\", \"true\")\n System.setProperty(\"org.slf4j.simpleLogger.showShortLogName\", \"true\")\n System.setProperty(\"org.slf4j.simpleLogger.dateTimeFormat\", \"HH:mm:ss:SSS\")\n }\n }\n\n private val stdoutIntern = ByteArrayOutputStream()\n private val stdout = PrintStream(stdoutIntern, true)\n private val fileOutputStream = ByteArrayOutputStream()\n\n @RepeatedTest(10)\n fun `should have STDOUT output collected in file`() {\n val inputStreams = createInputStreams(\"ok\", \"\")\n\n installFascade(inputStreams, System.out, arrayOf(fileOutputStream))\n\n val content = String(fileOutputStream.toByteArray())\n assertThat(content).contains(\"STDOUT ok\")\n }\n\n @RepeatedTest(10)\n fun `should have STDOUT output printed to System out`() {\n val inputStreams = createInputStreams(\"ok\", \"\")\n\n installFascade(inputStreams, stdout, arrayOf())\n\n val content = String(stdoutIntern.toByteArray())\n assertThat(content).contains(\"[test] STDOUT ok\")\n }\n\n private fun installFascade(inputStreams: Array<PrefixedInputStream>,\n stdout: PrintStream,\n outputStreams: Array<OutputStream>): MergingStreamFascade {\n val fascade2 = MergingStreamFascade(\"test\", inputStreams, stdout, outputStreams)\n fascade2.install()\n return fascade2\n }\n\n @RepeatedTest(10)\n fun `should have STDERR output printed to SystemOut`() {\n val inputStreams = createInputStreams(\"\", \"err\")\n\n installFascade(inputStreams, stdout, arrayOf())\n\n val content = String(stdoutIntern.toByteArray())\n assertThat(content).contains(\"[test] STDERR err\")\n }\n\n @RepeatedTest(10)\n fun `should have STDERR output collected in filestream`() {\n val inputStreams = createInputStreams(\"\", \"err\")\n\n installFascade(inputStreams, stdout, arrayOf(fileOutputStream))\n\n val content = String(fileOutputStream.toByteArray())\n assertThat(content).contains(\"STDERR err\")\n }\n\n private fun createInputStreams(stdout: String,\n stderr: String): Array<PrefixedInputStream> {\n val out = PrefixedInputStream(ByteArrayInputStream(stdout.toByteArray()), \"STDOUT\")\n val err = PrefixedInputStream(ByteArrayInputStream(stderr.toByteArray()), \"STDERR\")\n return arrayOf(out, err)\n }\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_> \"\"\"\n\n if isinstance(config, str):\n config = mmcv.Config.fromfile(config)\n elif not isinstance(config, mmcv.Config):\n raise TypeError('config must be a filename or Config object, '\n f'but got {type(config)}')\n if cfg_options is not None:\n config.merge_from_dict(cfg_options)\n\n model = build_model(\n config.model, train_cfg=config.train_cfg, test_cfg=config.test_cfg)\n\n if checkpoint is not None:\n load_checkpoint(model, checkpoint, map_location='cpu')\n\n model._cfg = config # save the config in the model for convenience\n model.to(device)\n model.eval()\n\n return model\n\n\n@torch.no_grad()\ndef sample_uncoditional_model(model,\n num_samples=16,\n num_batches=4,\n sample_model='ema',\n **kwargs):\n \"\"\"Sampling from unconditional models.\n\n Args:\n model (nn.Module): Unconditional models in MMGeneration.\n num_samples (int, optional): The total number of samples.\n Defaults to 16.\n num_batches (int, optional): The number of batch size for inference.\n Defaults to 4.\n sample_model (str, optional): Which model you want to use. ['ema',\n 'orig']. Defaults to 'ema'.\n\n Returns:\n Tensor: Generated image tensor.\n \"\"\"\n # set eval mode\n model.eval()\n # constrcut sampling list for batches\n n_repeat = num_samples // num_batches\n batches_list = [num_batches] * n_repeat\n\n if num_samples % num_batches > 0:\n batches_list.append(num_samples % num_batches)\n res_list = []\n\n # inference\n for batches in batches_list:\n res = model.sample_from_noise(\n None, num_batches=batches, sample_model=sample_model, **kwargs)\n res_list.append(res.cpu())\n\n results = torch.cat(res_list, dim=0)\n\n return results\n\n\n@torch.no_grad()\ndef sample_conditional_model(model,\n num_samples=16,\n num_batches=4,\n sample_model='ema',\n label=None,\n **kwargs):\n \"\"\"Sampling from conditional models.\n\n Args:\n model (nn.Module): Conditional models in MMGeneration.\n num_samples (int, optional): The total number of samples.\n Defaults to 16.\n num_batches (int, optional): The number of batch size for inference.\n Defaults to 4.\n sample_model (str, optional): Which model you want to use. ['ema',\n 'orig']. Defaults to 'ema'.\n label (int | torch.Tensor | list[int], optional): Labels used to\n generate images. Default to None.,\n\n Returns:\n Tensor: Generated image tensor.\n \"\"\"\n # set eval mode\n model.eval()\n # constrcut sampling list for batches\n n_repeat = num_samples // num_batches\n batches_list = [num_batches] * n_repeat\n\n # check and convert the input labels\n if isinstance(label, int):</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>module ViewSourceMap\n class Railtie < Rails::Railtie\n initializer \"render_with_path_comment.initialize\" do\n if !ENV[\"DISABLE_VIEW_SOURCE_MAP\"] && Rails.env.development?\n ViewSourceMap.attach\n end\n end\n end\n\n def self.attach\n ActionView::PartialRenderer.class_eval do\n def render_with_path_comment(context, options, block)\n content = render_without_path_comment(context, options, block)\n\n if @lookup_context.rendered_format == :html\n if options[:layout]\n name = \"#{options[:layout]}(layout)\"\n else\n path = Pathname.new(@template.identifier)\n name = path.relative_path_from(Rails.root)\n end\n \"<!-- BEGIN #{name} -->#{content}<!-- END #{name} -->\".html_safe\n else\n content\n end\n end\n alias_method_chain :render, :path_comment\n end\n\n ActionView::TemplateRenderer.class_eval do\n def render_template_with_path_comment(template, layout_name = nil, locals = {})\n view, locals = @view, locals || {}\n\n render_with_layout(layout_name, locals) do |layout|\n instrument(:template, :identifier => template.identifier, :layout => layout.try(:virtual_path)) do\n content = template.render(view, locals) { |*name| view._layout_for(*name) }\n if @lookup_context.rendered_format == :html and template.class != ActionView::Template::Text\n path = Pathname.new(template.identifier)\n name = path.relative_path_from(Rails.root)\n \"<!-- BEGIN #{name} -->#{content}<!-- END #{name} -->\".html_safe\n else\n content\n end\n end\n end\n end\n alias_method_chain :render_template, :path_comment\n end\n end\n\n def self.detach\n ActionView::PartialRenderer.class_eval do\n undef_method :render_with_path_comment\n alias_method :render, :render_without_path_comment\n end\n\n ActionView::TemplateRenderer.class_eval do\n undef_method :render_template_with_path_comment\n alias_method :render_template, :render_template_without_path_comment\n end\n end\nend\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Rust_>#[test]\nfn {}() {{\n\tlet input_url = iri!(\"{}\");\n\tlet base_url = iri!(\"{}\");\n\tlet output_url = iri!(\"{}\");\n\tprintln!(\"{}\");{}\n\tpositive_test(\n\t\tOptions {{\n\t\t\tprocessing_mode: ProcessingMode::{:?},\n\t\t\tcontext: {}\n\t\t}},\n\t\tinput_url,\n\t\tbase_url,\n\t\toutput_url\n\t)\n}}\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>import javax.transaction.Transactional;\nimport java.util.List;\n\npublic interface GroupRepository extends JpaRepository<Group,Integer> {\n Group findGroupById(Integer id);\n List<Group> findGroupByGroupNameContaining(String groupName);\n}</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>'use strict'\n\nfunction main(s) {\n\n const N = Number(s);\n let answer = 10000000000;\n\n for (let i = 1; i <= Math.sqrt(N); i++) {\n if (Number.isInteger(N / i)) {\n const max = Math.max(String(i).length, String(N / i).length);\n answer = Math.min(answer, max);\n }\n }\n\n console.log(answer);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n</code>",
"source": "SynthCodeNetNoImageTag",
"user": "Convert code to text."
}
] |
|
[
{
"assistant": "<loc_0><loc_0><loc_500><loc_500><_HTML_><?lsmb INCLUDE \"ui-header.html\";\n PROCESS \"report_base.html\";\n PROCESS \"elements.html\" ?>\n<body class=\"lsmb <?lsmb dojo_theme ?>\">\n<div class=\"listtop\"><?lsmb text('Search Goods and Services') ?></div>\n<form data-dojo-type=\"lsmb/lib/Form\" action=\"goods.pl\" method=\"GET\">\n<table>\n<tr>\n <th><?lsmb text('Part Number') ?></th>\n <td><?lsmb PROCESS input element_data = {\n name = 'partnumber'\n class = 'control_code'\n type = 'text'\n value = partnumber\n size = 16\n } ?></td>\n</tr>\n<tr>\n <th><?lsmb text('Description') ?></th>\n <td colspan=\"3\"><?lsmb PROCESS input element_data = {\n name = 'description'\n class = 'description'\n type = 'text'\n value = description\n size = 32\n } ?></td>\n</tr>\n<tr>\n <th><?lsmb text('Part Group') ?></th>\n <td><?lsmb PROCESS select element_data = {\n name = 'partsgroup_id'\n class = 'partsgroup'\ndefault_values = [partsgroup_id]\n text_attr = 'partsgroup'\n value_attr = 'id'\n } ?></td>\n <th><?lsmb text('Serial Number') ?></th>\n <td><?lsmb PROCESS input element_data = {\n name = 'serialnumber'\n class = 'control_code'\n type = 'text'\n value = serialnumber\n size = 16\n } ?></td>\n</tr>\n<tr>\n <th><?lsmb text('Make') ?></th>\n <td><?lsmb PROCESS input element_data = {\n name = 'make'\n class = 'control_code'\n type = 'text'\n value = make\n size = 16\n } ?></td>\n <th><?lsmb text('Model') ?></th>\n <td><?lsmb PROCESS input element_data = {\n name = 'model'\n class = 'control_code'\n type = 'text'\n value = model\n size = 16\n } ?></td>\n</tr>\n<tr>\n <th><?lsmb text('Drawing') ?></th>\n <td><?lsmb PROCESS input element_data = {\n name = 'drawing'\n class = 'control_code'\n type = 'text'\n value = make\n size = 16\n } ?></td>\n <th><?lsmb text('Microfiche') ?></th>\n <td><?lsmb PROCESS input element_data = {\n name = 'microfiche'\n class = 'control_code'\n type = 'text'\n value = model\n size = 16\n } ?></td>\n</tr>\n<tr><th> </th>\n <td colspan=\"3\"><?lsmb\n old_label_pos = label_pos;\n label_pos = -1;\n PROCESS input element_data = {\n name = \"status\"\n id = 'status-active'\n type = 'radio'\n checked = 'CHECKED'\n value = 'active'\n label = text('Active')\n };\n PROCESS input element_data = {\n name = \"status\"\n id = 'status-onhand'\n type = 'radio'\n value = 'onhand'\n label = text('On Hand') #'\n };\n PROCESS input element_data = {\n name = \"status\"\n id = 'status-short'\n type = 'radio'\n value = 'short'\n label = text('Short')\n };\n PROCESS input element_data = {\n name = \"status\"\n id = 'status-obsolete'\n type = 'radio'\n value = 'obsolete'\n label = text('Obsolete')\n };\n PROCESS input element_data = {\n name = \"status\"\n id = 'status-unused'\n type = 'radio'\n value = 'unused'\n label = text('Unused')\n };\n label_pos = old_label_pos;\n ?></td>\n</tr>\n<tr><th> </th><td colspan=\"3\"><hr /></td></tr>\n<tr>\n <th> </th>\n <th class=\"centered\" colspan=\"3\"><?lsmb text('Items Found In') ?></td>\n</tr>\n<?lsmb PROCESS date_row ?>\n<tr><th rowspan=\"2\"> </th>\n <td><?lsmb label_pos = 1;\n PROCESS input element_data = {\n type = \"checkbox\"\n name = \"inc_is\"\n value = 1\n label = text('AR Invoices') #'\n } ?></td>\n <td><?lsmb \n PROCESS input element_data = {\n type = \"checkbox\"\n name = \"inc_so\"\n value = 1\n label = text('Sales Orders') #'\n } ?></td>\n <td><?lsmb\n PROCESS input element_data = {\n type = \"checkbox\"\n name = \"inc_quo\"\n value = 1\n label = text('Quotations') \n } ?></td>\n</tr>\n<tr>\n <td><?lsmb\n PROCESS input element_data = {\n type = \"checkbox\"\n name = \"inc_ir\"\n value = 1\n label = text('AP Invoices') #'\n } ?></td>\n <td><?lsmb \n PROCESS input element_data = {\n type = \"checkbox\"\n name = \"inc_po\"\n value = 1\n label = text('Purchase Orders') #'\n } ?></td>\n <td><?lsmb\n PROCESS input element_data = {\n type = \"checkbox\"\n name = \"inc_rfq\"\n value = 1\n label = text('RFQs') \n } ?></td>\n</tr>\n<tr><th> </th><td colspan=\"3\"><hr /></td></tr>\n<tr>\n <th rowspan=\"2\"> </th>\n <th class=\"centered\" colspan=\"3\"><?lsmb text('Include in Report') ?></td>\n</tr>\n<tr><td colspan=\"4\">\n <table>\n <tr><td>\n <?lsmb PROCESS input element_data = {\n name = 'col_running_number'\n type = 'checkbox'\n value = '1'\n label = text('No.')\n } ?></td>\n <td>\n <?lsmb PROCESS input element_data = {\n name = 'col_partnumber'\n type = 'checkbox'\n value = '1'\n checked = 'CHECKED'\n label = text('Part Number') #'\n } ?></td>\n <td>\n <?lsmb PROCESS input element_data = {\n name = 'col_description'\n type = 'checkbox'\n value = '1'\n checked = 'CHECKED'\n label = text('Description') \n } ?></td>\n <td>\n <?lsmb PROCESS input element_data = {\n name = 'col_onhand'\n type = 'checkbox'\n value = '1'\n checked = 'CHECKED'\n label = text('On hand') \n } ?></td>\n <td>\n <?lsmb PROCESS input element_data = {\n name = 'col_unit'\n type = 'checkbox'\n value = '1'\n checked = 'CHECKED'\n label = text('Unit') \n } ?></td>\n </tr>\n <tr><td>\n <?lsmb PROCESS input element_data = {\n name = 'col_priceupdate'\n type = 'checkbox'\n value = '1'\n label = text('Price Updated') #'\n } ?></td>\n <td>\n <?lsmb PROCESS input element_data = {\n name = 'col_partgroup'\n type = 'checkbox'\n value = '1'\n label = text('Part Group') #'\n } ?></td>\n <td>\n <?lsmb PROCESS input element_data = {\n name = 'col_listprice'\n type = 'checkbox'\n value = '1'\n label = text('List Price') #'\n } ?></td>\n <td></code>",
"source": "SynthCodeNetNoImageTag",
"user": "<code>"
}
] |