images
images listlengths
1
1
texts
listlengths
1
1
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_ObjectiveC_> struct {\n Entity camera;\n } _entities;\n\n MaterialProvider* _materialProvider;\n AssetLoader* _assetLoader;\n ResourceLoader* _resourceLoader;\n\n Manipulator<float>* _manipulator;\n\n FilamentAsset* _asset;\n\n UIPanGestureRecognizer* _panRecognizer;\n UIPinchGestureRecognizer* _pinchRecognizer;\n CGFloat _previousScale;\n}\n\n- (instancetype)initWithFrame:(CGRect)frame {\n if (self = [super initWithFrame:frame]) {\n [self initCommon];\n }\n return self;\n}\n\n- (instancetype)initWithCoder:(NSCoder*)coder {\n if (self = [super initWithCoder:coder]) {\n [self initCommon];\n }\n return self;\n}\n\n- (void)initCommon {</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_> message_type=None, enum_type=None, containing_type=None,\n is_extension=False, extension_scope=None,\n serialized_options=None, file=DESCRIPTOR),\n _descriptor.FieldDescriptor(\n name='host', full_name='container.Probe.HttpGet.host', index=2,\n number=3, type=9, cpp_type=9, label=1,\n has_default_value=False, default_value=_b(\"\").decode('utf-8'),\n message_type=None, enum_type=None, containing_type=None,\n is_extension=False, extension_scope=None,\n serialized_options=None, file=DESCRIPTOR),\n _descriptor.FieldDescriptor(\n name='schema', full_name='container.Probe.HttpGet.schema', index=3,\n number=4, type=9, cpp_type=9, label=1,</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_CSS_>\nhtml {\n -webkit-filter: url(#tritanopia) !important;\n filter: url(#tritanopia) !important;\n}\n\n#wds-colorBlindnessFilter {\n display: none !important; \n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import bpy\nfrom . import utils as ut\n\nerror_bdx_not_installed = \"BDX add-on not installed!\"\nerror_bdx_project_missing = \"BDX project missing!\"\nerror_bdx_java_pack = \"Java packages are not in sync with BDX project!\"\n\nclass JavaPackageSynchronizer(bpy.types.Operator):\n\t\n\tbl_description = \"Sychronizes package names of java classes with BDX project\"\n\tbl_idname = \"bdx.java_package_synchronizer\"\n\tbl_label = \"BDX-Tools: Java Package Synchronizer\"\n\tbl_options = {\"REGISTER\", \"UNDO\"}\n\t\n\terror = \"\"\n\t\n\tdef invoke(self, context, event):\n\t\t\n\t\tif not hasattr(context.scene, \"bdx\"):\n\t\t\tself.error = error_bdx_not_installed\n\t\t\t\n\t\telif not ut.src_root():\n\t\t\tself.error = error_bdx_project_missing\n\t\t\t\n\t\tsystem_dpi = bpy.context.user_preferences.system.dpi\n\t\t\n\t\treturn context.window_manager.invoke_props_dialog(self, width=system_dpi*5)\n\t\t\n\tdef draw(self, context):\n\t\tlayout = self.layout\n\t\tbox = layout.box()\n\t\trow = box.row\n\t\t\n\t\tif self.error:\n\t\t\trow().label(self.error, icon=\"ERROR\")\n\t\t\treturn\n\t\t\t\n\t\tif ut.java_pack_error():\n\t\t\trow().label(error_bdx_java_pack, icon=\"ERROR\")\n\t\t\trow().prop(context.scene.bdx_tools, \"java_pack_sync\")\n\t\telse:\n\t\t\trow().label(\"Java packages synced with BDX project: \" + ut.java_pack_name())\n\t\t\t\n\tdef execute(self, context):\n\t\tif self.error:\n\t\t\treturn {\"CANCELLED\"}\n\t\t\t\n\t\tif context.scene.bdx_tools.java_pack_sync:\n\t\t\tut.java_pack_sync();\n\t\t\t\n\t\treturn {\"PASS_THROUGH\"}\n\t\t\ndef register():\n\tbpy.utils.register_class(JavaPackageSynchronizer)\n\t\ndef unregister():\n\tbpy.utils.unregister_class(JavaPackageSynchronizer)\n\t\nif __name__ == \"__main__\":\n\tregister()\n\t</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_>n, a, b = gets.split(\" \").map(&:to_i)\n \nif n % (a + b) == 0\n puts (n / (a + b)) * a\nelse\n if n % (a + b) > a\n puts (n / (a + b)) * a + a\n else\n puts (n / (a + b)) * a + n % (a + b)\n end\nend</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Rust_> ///\n /// A simulation run can be repeated with the exact same sequence of\n /// iterations/generations, by providing the same seed as for a previous\n /// run.\n fn build_with_seed(self, seed: Seed) -> S;\n}\n\n/// The `State` struct holds the state of the `Simulation`.\n#[derive(Debug, PartialEq)]\npub struct State<A>\nwhere\n A: Algorithm,\n{\n /// The local time when this simulation started.\n pub started_at: DateTime<Local>,\n /// The number of the iteration that this state represents. Iterations\n /// are counted from 1 and increased by 1 on each iteration of the\n /// simulation loop.\n pub iteration: u64,\n /// Duration of processing the current iteration. This is the time it\n /// took to process one iteration of the algorithm.\n pub duration: Duration,\n /// Accumulated time spent by each thread in case of parallel processing.\n /// In case of sequential processing this time is nearly the same as the\n /// `duration` value. In case of parallel processing this time is usually\n /// a multitude of the `duration`.\n pub processing_time: ProcessingTime,\n /// The result of this iteration.\n pub result: <A as Algorithm>::Output,\n}\n\n/// The result of running a step in the `Simulation`.\n#[derive(Debug, PartialEq)]\npub enum SimResult<A>\nwhere\n A: Algorithm,\n{\n /// The step was successful, but the simulation has not finished.\n ///\n /// The `State` contains the result of the last processed generation.\n Intermediate(State<A>),\n /// The simulation is finished, and this is the final result.\n ///\n /// The parameters are:\n /// * The `State` of last processed generation.\n /// * The total processing time of the simulation.\n /// * The `StopReason` is the matching criteria why the simulation stopped.\n Final(State<A>, ProcessingTime, Duration, StopReason),\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>N, A, B = map(int, input().split())\nif A*N>=B:\n print(B)\nelse:\n print(A*N)</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_TypeScript_>\r\n if (!this._idbFactory || !(this._enableSceneOffline || this._enableTexturesOffline)) {\r\n // Your browser doesn't support IndexedDB\r\n this._isSupported = false;\r\n if (errorCallback) { errorCallback(); }\r\n }\r\n else {\r\n // If the DB hasn't been opened or created yet\r\n if (!this._db) {\r\n this._hasReachedQuota = false;\r\n this._isSupported = true;\r\n\r\n var request: IDBOpenDBRequest = this._idbFactory.open(\"babylonjs\", 1);\r\n\r\n // Could occur if user is blocking the quota for the DB and/or doesn't grant access to IndexedDB\r\n request.onerror = (event) => {\r\n handleError();\r\n };\r\n\r\n // executes when a version change transaction cannot complete due to other active transactions\r\n request.onblocked = (event) => {\r\n Tools.Error(\"IDB request blocked. Please reload the page.\");\r\n handleError();\r\n };\r\n\r\n // DB has been opened successfully\r\n request.onsuccess = (event) => {\r\n this._db = request.result;\r\n successCallback();\r\n };\r\n\r\n // Initialization of the DB. Creating Scenes & Textures stores\r\n request.onupgradeneeded = (event: IDBVersionChangeEvent) => {\r\n this._db = (<any>(event.target)).result;\r\n if (this._db) {\r\n try {\r\n this._db.createObjectStore(\"scenes\", { keyPath: \"sceneUrl\" });\r\n this._db.createObjectStore(\"versions\", { keyPath: \"sceneUrl\" });\r\n this._db.createObjectStore(\"textures\", { keyPath: \"textureUrl\" });\r\n }\r\n catch (ex) {\r\n Tools.Error(\"Error while creating object stores. Exception: \" + ex.message);\r\n handleError();\r\n }\r\n }\r\n };\r\n }\r\n // DB has already been created and opened\r\n else {\r\n if (successCallback) { successCallback(); }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Loads an image from the database\r\n * @param url defines the url to load from\r\n * @param image defines the target DOM image\r\n */\r\n public loadImage(url: string, image: HTMLImageElement) {\r\n var completeURL = Database._ReturnFullUrlLocation(url);\r\n\r\n var saveAndLoadImage = () => {\r\n if (!this._hasReachedQuota && this._db !== null) {\r\n // the texture is not yet in the DB, let's try to save it\r\n this._saveImageIntoDBAsync(completeURL, image);\r\n }\r\n // If the texture is not in the DB and we've reached the DB quota limit\r\n // let's load it directly from the web\r\n else {\r\n image.src = url;\r\n }\r\n };\r\n\r\n if (!this._mustUpdateRessources) {\r\n this._loadImageFromDBAsync(completeURL, image, saveAndLoadImage);\r\n }\r\n // First time we're download the images or update requested in the manifest file by a version change\r\n else {\r\n saveAndLoadImage();\r\n }\r\n }\r\n\r</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Go_>// Copyright 2022 The go-exactonline AUTHORS. All rights reserved.\n//\n// Use of this source code is governed by a MIT\n// license that can be found in the LICENSE file.\n// Code generated by gen-services.go; DO NOT EDIT.\npackage inventory\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stack11/go-exactonline/api\"\n\t\"github.com/stack11/go-exactonline/types\"\n)\n\nfunc StockCountLinesPrimaryPropertySample() *types.GUID {\n\tv := types.NewGUID()\n\treturn &v\n}\n\nfunc StockCountLinesEntityWithPopulatedPrimaryProperty() *StockCountLines {\n\treturn &StockCountLines{ID: StockCountLinesPrimaryPropertySample()}\n}\n\nfunc StockCountLinesStringOfPrimaryProperty(v *types.GUID) string {\n\treturn v.String()\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>s=input()\nk=int(input())\ncnt=0\nfor ss in s:\n if ss=='1':\n cnt+=1\n else:\n break\nif cnt==0:\n print(s[0])\n exit()\nif k<=cnt:\n print(1)\nelse:\n print(s[cnt])</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>/**\n ******************************************************************************\n * @file stm32f0xx_syscfg.c\n * @author MCD Application Team\n * @version V1.0.0\n * @date 23-March-2012\n * @brief This file provides firmware functions to manage the following \n * functionalities of the SYSCFG peripheral:\n * + Remapping the memory mapped at 0x00000000 \n * + Remapping the DMA channels\n * + Enabling I2C fast mode plus driving capability for I2C pins </code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Scheme_>;;;;METACIRCULAR EVALUATOR FROM CHAPTER 4 (SECTIONS 4.1.1-4.1.4) of\n;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS\n\n;;;;Matches code in ch4.scm\n\n;;;;This file can be loaded into Scheme as a whole.\n;;;;Then you can initialize and start the evaluator by evaluating\n;;;; the expression (mce).\n\n;;;from section 4.1.4 -- must precede def of metacircular apply\n(define apply-in-underlying-scheme apply)\n\n;;;SECTION 4.1.1\n\n(define (mc-eval exp env)\n (cond ((self-evaluating? exp) exp)\n\t((variable? exp) (lookup-variable-value exp env))\n\t((quoted? exp) (text-of-quotation exp))\n\t((assignment? exp) (eval-assignment exp env))\n\t((definition? exp) (eval-definition exp env))\n\t((if? exp) (eval-if exp env))\n\t((lambda? exp)\n\t (make-procedure (lambda-parameters exp)\n\t\t\t (lambda-body exp)\n\t\t\t env))\n\t((begin? exp) \n\t (eval-sequence (begin-actions exp) env))\n\t((cond? exp) (mc-eval (cond->if exp) env))\n\t((application? exp)\n\t (mc-apply (mc-eval (operator exp) env)\n\t\t (list-of-values (operands exp) env)))\n\t(else\n\t (error \"Unknown expression type -- EVAL\" exp))))\n\n(define (mc-apply procedure arguments)\n (cond ((primitive-procedure? procedure)\n (apply-primitive-procedure procedure arguments))\n ((compound-procedure? procedure)\n (eval-sequence\n (procedure-body procedure)\n (extend-environment\n (procedure-parameters procedure)\n arguments\n (procedure-environment procedure))))\n (else\n (error\n \"Unknown procedure type -- APPLY\" procedure))))\n\n\n(define (list-of-values exps env)\n (if (no-operands? exps)\n '()\n (cons (mc-eval (first-operand exps) env)\n (list-of-values (rest-operands exps) env))))\n\n(define (eval-if exp env)\n (if (true? (mc-eval (if-predicate exp) env))\n (mc-eval (if-consequent exp) env)\n (mc-eval (if-alternative exp) env)))\n\n(define (eval-sequence exps env)\n (cond ((last-exp? exps) (mc-eval (first-exp exps) env))\n (else (mc-eval (first-exp exps) env)\n (eval-sequence (rest-exps exps) env))))\n\n(define (eval-assignment exp env)\n (set-variable-value! (assignment-variable exp)\n (mc-eval (assignment-value exp) env)\n env)\n 'ok)\n\n(define (eval-definition exp env)\n (define-variable! (definition-variable exp)\n (mc-eval (definition-value exp) env)\n env)\n 'ok)\n\n;;;SECTION 4.1.2\n\n(define (self-evaluating? exp)\n (cond ((number? exp) true)\n ((string? exp) true)\n\t((boolean? exp) true)\n\t(else false)))\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_TypeScript_>import { MakeStylesReducedDefinitions } from './types';\n\n/** @internal */\nexport const HASH_PREFIX = 'f';\n\n/** @internal */\nexport const HASH_LENGTH = 7;\n\n/**\n * A prefix that identifies that classname string is defined for RTL.\n * @internal\n */\nexport const RTL_PREFIX = 'r';\n\n/** @internal */\nexport const SEQUENCE_PREFIX = '__';\n\n/** @internal */\nexport type LookupItem = [/* definitions: */ MakeStylesReducedDefinitions, /* dir: */ 'rtl' | 'ltr'];\n\n/** @internal */\nexport const DEFINITION_LOOKUP_TABLE: Record<string, LookupItem> = {};\n\n// indexes for values in LookupItem tuple\n\n/** @internal */\nexport const LOOKUP_DEFINITIONS_INDEX = 0;\n\n/** @internal */\nexport const LOOKUP_DIR_INDEX = 1;\n\n/* indexes for values in MakeStylesResolvedRule tuple */\n\n/** @internal */\nexport const RULE_STYLE_BUCKET_INDEX = 0;\n\n/** @internal */\nexport const RULE_CLASSNAME_INDEX = 1;\n\n/** @internal */\nexport const RULE_CSS_INDEX = 2;\n\n/** @internal */\nexport const RULE_RTL_CSS_INDEX = 3;\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>/*\n *\n * Copyright (c) 2021 Project CHIP Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// THIS FILE IS GENERATED BY ZAP\n\n#include \"callback.h\"\n\n#include <app/common/gen/cluster-id.h>\n#include <lib/support/Span.h>\n\nusing namespace chip;\n\n// Cluster Init Functions\nvoid emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId)\n{\n switch (clusterId)\n {\n case ZCL_ACCOUNT_LOGIN_CLUSTER_ID:\n emberAfAccountLoginClusterInitCallback(endpoint);\n break;\n case ZCL_APPLICATION_BASIC_CLUSTER_ID:\n emberAfApplicationBasicClusterInitCallback(endpoint);\n break;\n case ZCL_APPLICATION_LAUNCHER_CLUSTER_ID:\n emberAfApplicationLauncherClusterInitCallback(endpoint);\n break;\n case ZCL_AUDIO_OUTPUT_CLUSTER_ID:\n emberAfAudioOutputClusterInitCallback(endpoint);\n break;\n case ZCL_BASIC_CLUSTER_ID:\n emberAfBasicClusterInitCallback(endpoint);\n break;\n case ZCL_BINDING_CLUSTER_ID:\n emberAfBindingClusterInitCallback(endpoint);\n break;\n case ZCL_CONTENT_LAUNCH_CLUSTER_ID:\n emberAfContentLauncherClusterInitCallback(endpoint);\n break;\n case ZCL_DESCRIPTOR_CLUSTER_ID:\n emberAfDescriptorClusterInitCallback(endpoint);\n break;\n case ZCL_ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER_ID:\n emberAfEthernetNetworkDiagnosticsClusterInitCallback(endpoint);\n break;</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_CSS_>/*!\n Copyright (c) 2020 - present, DITDOT Ltd. - MIT Licence\n https://github.com/ditdot-dev/vue-flow-form\n https://www.ditdot.hr/en\n*/\n\n/*\n basic theme color and font styles\n*/\n\n:root {\n --vff-bg-color: #e1366a;\n --vff-main-text-color: #e1366a;\n --vff-secondary-text-color: #e1366a;\n --vff-tertiary-text-color: #ffdada;\n --vff-main-accent-color: #e1366a;\n --vff-secondary-accent-color: #e1366a;\n --vff-tertiary-accent-color: #8e44ad;\n --vff-header-color: #fff;\n --vff-header-border-color: transparent;\n --vff-button-color: #e1366a;\n --vff-button-hover-color: #ffdada;\n --vff-button-text-color: #fff;\n --vff-main-form-bg-color: #ffdada;</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>#pragma once\n\n#include \"Size.h\"\n#include <AK/RetainPtr.h>\n#include <AK/Retainable.h>\n\nclass CharacterBitmap : public Retainable<CharacterBitmap> {\npublic:\n static Retained<CharacterBitmap> create_from_ascii(const char* asciiData, unsigned width, unsigned height);\n ~CharacterBitmap();\n\n bool bit_at(unsigned x, unsigned y) const { return m_bits[y * width() + x] == '#'; }\n const char* bits() const { return m_bits; }\n\n Size size() const { return m_size; }\n unsigned width() const { return m_size.width(); }\n unsigned height() const { return m_size.height(); }\n\nprivate:\n CharacterBitmap(const char* b, unsigned w, unsigned h);\n\n const char* m_bits { nullptr };\n Size m_size;\n};\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>\"\"\"\nName: pySudoku.py\nAuthor: Paul Moon\nDate: December 2012\nModified by: Nitro963\nModification Date: December 2020\n\n\nDescription:\nSolves Sudoku puzzles.\n\nFirst try to solve by filling in the cells with only one possibility.\nIf it cannot go any further, use a backtracking DFS (depth-first search)\nalgorithm to try the possible solutions. As soon as a solution is found,\nit terminates the algorithm and prints it out.\n\nThe algorithm assumes that empty cells are denoted with a 0.\n\"\"\"\n\nimport fileinput\nimport time\n\n\ndef print_sudoku(s):\n \"\"\"\n Formats the Sudoku puzzle currently in a 2D list into\n a grid with lines separating the blocks for readability\n \"\"\"\n for row in range(9):\n for col in range(9):\n print(s[row][col], end=' ')\n if col + 1 == 3 or col + 1 == 6:\n print(\" | \", end=' ')\n if row + 1 == 3 or row + 1 == 6:\n print(\"\\n\" + \"-\" * 25, end=' ')\n print()\n print()\n\n\ndef test_cell(s, row, col):\n \"\"\"\n Given a Sudoku puzzle s, row, and column number, return a list which represents\n the valid numbers that can go in that cell. 0 = possible, 1 = not possible\n \"\"\"\n used = [0] * 10\n used[0] = 1\n block_row = row // 3\n block_col = col // 3\n\n # Row and Column\n for m in range(9):\n used[s[m][col]] = 1\n used[s[row][m]] = 1\n\n # Square\n for m in range(3):\n for n in range(3):</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>// Auto-generated by GenerateSteppedRangesCodegenTestData. Do not edit!\n// WITH_STDLIB\nimport kotlin.test.*\n\nfun zero() = 0\n\nfun box(): String {\n assertFailsWith<IllegalArgumentException> {\n val uintProgression = 1u until 7u\n for (i in uintProgression step zero()) {\n }\n }\n\n assertFailsWith<IllegalArgumentException> {\n val ulongProgression = 1uL until 7uL\n for (i in ulongProgression step zero().toLong()) {\n }\n }\n\n return \"OK\"\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Bash_>#!/usr/bin/env bash\n\nls\n -al\n\nbin/phpunit\n --debug\n --verbose</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import unittest\nimport os\nfrom pathlib import Path\nimport shutil\n\nfrom equit_ease.parser.parse import UserConfigParser\n\nuser_home_dir = str(Path.home())\nequit_ease_dir = os.path.join(user_home_dir, \".equit_ease\")\nos_agnostic_path = Path(equit_ease_dir)\nlists_file_path = Path(os.path.join(equit_ease_dir, \"lists\"))\n\n\ndef remove_equit_ease_dir():\n \"\"\"remove the directory structure for unit tests.\"\"\"\n shutil.rmtree(equit_ease_dir)\n\n\ndef setup_equit_ease_dir():\n \"\"\"create the directory structure for unit tests.\"\"\"\n os_agnostic_path.mkdir()\n with open(lists_file_path, \"w\") as f:\n f.writelines([\"[Test]\\n\", \"equity_names = CRM,AAPL,GME,MSFT,AXP\"])\n\n\nclass TestUserConfigParser(unittest.TestCase):\n \"\"\"Testing methods from the UserConfigParser class.\"\"\"\n\n if os.path.exists(lists_file_path):\n remove_equit_ease_dir()\n setup_equit_ease_dir()\n else:\n setup_equit_ease_dir()\n\n def setUp(self):\n self.list_name = \"Test\"\n self.list_file_contents = open(lists_file_path, \"r\").read().splitlines()\n self.parser = UserConfigParser(self.list_name, self.list_file_contents)\n self.equities, _ = self.parser.format_equity_lists()\n\n def tearDown(self):\n self.list_name = None\n self.list_file_contents = None\n self.parser = UserConfigParser</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_HTML_><!DOCTYPE html>\n<!--\n Licensed to the Apache Software Foundation (ASF) under one or more\n contributor license agreements. See the NOTICE file distributed with\n this work for additional information regarding copyright ownership.\n The ASF licenses this file to You under the Apache License, Version 2.0\n (the \"License\"); you may not use this file except in compliance with\n the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<html lang=\"en\">\n\n <head>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"../stylesheets/style.css\">\n <title>MacroDef Task</title>\n </head>\n\n <body>\n\n <h2 id=\"macrodef\">MacroDef</h2>\n <p><em>Since Apache Ant 1.6</em></p>\n <h3>Description</h3>\n <p>This defines a new task using a <code>&lt;sequential&gt;</code> nested task as a\n template. Nested elements <code>&lt;attribute&gt;</code> and <code>&lt;element&gt;</code> are\n used to specify attributes and elements of the new task. These get substituted into\n the <code>&lt;sequential&gt;</code> task when the new task is run.</p>\n <h3>Note</h3></code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>n,x = map(int, input().split())\nlist = list(map(int, input().split()))\n\na = 0\ni = 0\n\nlist.sort()\n\nif list[0] > x:\n print(0)\n\nelif x > sum(list):\n print(n-1)\n\nelse:\n while x > 0 and x >= list[i]:\n x -= list[i]\n i += 1\n a += 1\n if i == n:\n break\n\n print(a)</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>/*\n* Copyright (c) 2017 Sprint\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n#ifndef __DIACONST_H\n#define __DIACONST_H\n\n#define DIAMETER_SUCCESS 2001\n\n#define DIAMETER_UNKNOWN_SESSION_ID 5002\n#define DIAMETER_INVALID_AVP_VALUE 5004\n#define DIAMETER_MISSING_AVP 5005\n#define DIAMETER_UNABLE_TO_COMPLY 5012\n\n#define DIAMETER_ERROR_INITIAL_PARAMETERS 5140\n#define DIAMETER_PCC_RULE_EVENT 5142\n\n#define VEND_3GPP 10415\n\n#define BEARER_CTL_MODE_UE_ONLY 0\n#define BEARER_CTL_MODE_UE_NETWORK 2\n\n#define NETWORK_REQUEST_SUPPORT_NOT_SUPPORTED 0\n#define NETWORK_REQUEST_SUPPORT_SUPPORTED 1\n\n#define RESULTCODE( __msg__, __resultcode__ ) \\\n{ \\\n __msg__.add( getDict().avpResultCode(), __resultcode__ ); \\\n}\n\n#define EXP_RESULTCODE( __msg__, __vendorid__, __resultcode__ ) \\\n{ \\\n FDAvp __erc( getDict().avpExperimentalResult() ); \\\n if ( __vendorid__ != 0 ) \\\n __erc.add( getDict().avpVendorId(), __vendorid__ ); \\\n __erc.add( getDict().avpExperimentalResultCode(), __resultcode__ ); \\\n __msg__.add( __erc ); \\\n}\n\n#define RESULTCODE_WITH_FAILEDAVP1( __msg__, __resultcode__, __avp__ ) \\\n{ \\\n FDAvp failedAvp( getDict().avpFailedAvp() ); \\\n failedAvp.add( __avp__ ); \\\n RESULTCODE( __msg__, __resultcode__ ); \\\n __msg__.add( failedAvp ); \\\n}\n\n#define RESULTCODE_WITH_FAILEDAVP2( __msg__, __resultcode__, __avpde__, __value__ ) \\\n{ \\\n FDAvp failedAvp( getDict().avpFailedAvp() ); \\\n failedAvp.add( getDict().__avpde__, __value__ ); \\\n RESULTCODE( __msg__, __resultcode__ ); \\\n __msg__.add( failedAvp ); \\\n}\n\n#define EXP_RESULTCODE_WITH_FAILEDAVP1( __msg__, __vendorid__, __resultcode__, __avp__ ) \\\n{ \\\n FDAvp failedAvp( getDict().avpFailedAvp() ); \\\n failedAvp.add( __avp__ ); \\\n EXP_RESULTCODE( __msg__, __vendorid__, __resultcode__ ); \\\n __msg__.add( failedAvp ); \\\n}\n\n#define EXP_RESULTCODE_WITH_FAILEDAVP2( __msg__, __vendorid__, __resultcode__, __avpde__, __value__ ) \\\n{ \\\n FDAvp failedAvp( getDict().avpFailedAvp() ); \\\n failedAvp.add( getDict().__avpde__, __value__ ); \\</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>import { all } from 'redux-saga/effects'\nimport user from './user/sagas'\nimport clients from './clients/sagas'\n\nexport default function* rootSaga() {\n yield all([user(), clients()])\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>k=int(input())\nimport fractions\nimport itertools\nsum_g=0\nl=list(itertools.product([i for i in range(1,k+1)], repeat=3))\nfor p,q,r in l:\n ans=p\n ans = fractions.gcd(ans, q)\n ans = fractions.gcd(ans, r)\n sum_g+=ans\n ans=0\nprint(sum_g)\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_YAML_>- name: Clone the netbox docker-compose repository\n git: \n repo: https://github.com/netbox-community/netbox-docker.git\n version: release\n dest: \"{{ netbox_root }}\"\n\n- name: Override some docker-compose.yml configuration\n template:\n src: netbox-docker-compose.override.yml.j2\n dest: \"{{ netbox_root }}/docker-compose.override.yml\"\n\n- name: Build and run Netbox containers using docker-compose\n community.general.docker_compose: \n project_src: \"{{ netbox_root }}\"\n pull: yes\n build: yes\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C#_>/* ========================================================================\r\n * Copyright (c) 2005-2021 The OPC Foundation, Inc. All rights reserved.\r\n *\r\n * OPC Foundation MIT License 1.00\r\n *\r\n * Permission is hereby granted, free of charge, to any person\r\n * obtaining a copy of this software and associated documentation\r\n * files (the \"Software\"), to deal in the Software without\r\n * restriction, including without limitation the rights to use,\r\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the\r\n * Software is furnished to do so, subject to the following\r\n * conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be\r\n * included in all copies or substantial portions of the Software.\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\r\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\r\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\r\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\r\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\r\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\r\n * OTHER DEALINGS IN THE SOFTWARE.\r\n *\r\n * The complete license agreement can be found here:\r\n * http://opcfoundation.org/License/MIT/1.00/\r\n * ======================================================================*/\r\n\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Text;\r\nusing System.Xml;\r\nusing System.IO;\r\n\r\nnamespace CodeGenerator\r\n{\r\n /// <summary>\r\n /// Contains the current context to use for serialization.\r\n /// </summary>\r\n public class Context\r\n {\r\n #region Constructors\r\n /// <summary>\r\n /// The default constructor.\r\n /// </summary>\r\n public Context()\r\n {\r\n Initialize();\r\n }\r\n\r\n /// <summary>\r\n /// Sets private members to default values.\r\n /// </summary>\r\n private void Initialize()\r\n {\r\n m_prefix = String.Empty;\r\n m_token = String.Empty;\r\n m_index = -1;\r\n m_firstInList = true;\r\n m_blankLine = true;\r\n }\r\n #endregion\r\n\r\n #region Public Properties\r\n /// <summary>\r\n /// The path of the template being processed.\r\n /// </summary>\r\n public string TemplatePath\r\n {\r\n get { return m_templatePath; }\r\n set { m_templatePath = value; }\r\n }\r\n\r\n /// <summary>\r\n /// The container for the object being processed.\r\n /// </summary>\r\n public object Container\r\n {\r\n get { return m_container; }\r\n set { m_container = value; }\r\n }\r\n\r\n /// <summary>\r\n /// The current object being processed.\r\n /// </summary>\r\n public object Target\r\n {\r\n get { return m_target; }\r\n set { m_target = value; }\r\n }\r\n\r\n /// <summary>\r\n /// The prefix to prepend to every line of output.\r\n /// </summary>\r\n public string Prefix\r\n {\r\n get { return m_prefix; }\r\n set { m_prefix = value; }\r\n }\r\n\r\n /// <summary>\r\n /// The token current being processed.\r\n /// </summary>\r\n public string Token\r\n {\r\n get { return m_token; }\r\n set { m_token = value; }\r\n }\r\n\r\n /// <summary>\r\n /// The index of the current target within the list being processed.\r\n /// </summary>\r\n public int Index\r\n {\r\n get { return m_index; }\r\n set { m_index = value; }\r\n }\r\n\r\n /// <summary>\r\n /// Whether the current target being processed is the first in the list.\r\n /// </summary>>\r\n public bool FirstInList\r\n {\r\n get { return m_firstInList; }\r\n set { m_firstInList = value; }\r\n }\r\n\r\n /// <summary>\r\n /// Whether a blank line seperates entries in the list.\r\n /// </summary>>\r\n public bool BlankLine\r\n {\r\n get { return m_blankLine; }\r\n set { m_blankLine = value; }\r\n }\r\n #endregion\r\n\r\n #region Private Members\r\n private string m_templatePath;\r\n private object m_container;\r\n private object m_target;\r\n private string m_prefix;\r\n private string m_token;\r\n private int m_index;\r\n private bool m_firstInList;\r\n private bool m_blankLine;\r\n #endregion\r\n }\r\n}\r\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package com.anonymoushacker1279.immersiveweapons.item.projectile.bullet;\n\nimport com.anonymoushacker1279.immersiveweapons.entity.projectile.BulletEntity.GoldBulletEntity;\nimport com.anonymoushacker1279.immersiveweapons.init.DeferredRegistryHandler;\nimport com.anonymoushacker1279.immersiveweapons.item.projectile.arrow.AbstractArrowItem;\nimport net.minecraft.world.entity.LivingEntity;\nimport net.minecraft.world.entity.projectile.AbstractArrow.Pickup;\nimport net.minecraft.world.item.ItemStack;\nimport net.minecraft.world.level.Level;\nimport org.jetbrains.annotations.NotNull;\n\npublic class GoldBulletItem extends AbstractArrowItem {\n\n\t/**\n\t * Constructor for GoldBulletItem.\n\t * @param properties the <code>Properties</code> for the item\n\t * @param damageIn the damage to deal on impact\n\t */\n\tpublic GoldBulletItem(Properties properties, double damageIn) {\n\t\tsuper(properties, damageIn);\n\t\tdamage = damageIn;\n\t}\n\n\t/**\n\t * Create an arrow item.\n\t * @param level the <code>Level</code> the shooter is in\n\t * @param stack the <code>ItemStack</code> being shot\n\t * @param shooter the <code>LivingEntity</code> shooting the arrow\n\t * @return GoldBulletEntity\n\t */\n\t@Override\n\tpublic @NotNull GoldBulletEntity createArrow(@NotNull Level level, @NotNull ItemStack stack, @NotNull LivingEntity shooter) {\n\t\tGoldBulletEntity bulletEntity = new GoldBulletEntity(shooter, level, ref.get().asItem());\n\t\tbulletEntity.setBaseDamage(damage);\n\t\tbulletEntity.pickup = Pickup.DISALLOWED;\n\t\tbulletEntity.setSoundEvent(DeferredRegistryHandler.BULLET_WHIZZ.get());\n\t\treturn bulletEntity;\n\t}\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package com.github.natanbc.reliqua.limiter;\n\nimport javax.annotation.CheckReturnValue;\nimport javax.annotation.Nonnegative;\nimport javax.annotation.Nonnull;\n\n@SuppressWarnings(\"unused\")\npublic abstract class RateLimiter {\n /**\n * Callback to be notified about rate limits.\n *\n * <br>The routes given to the callbacks might be null in case of a global rate limit.\n */\n public interface Callback {\n /**\n * Called when an attempted request is rate limited. Might be called more than once per request\n */\n void requestRateLimited();\n\n /**\n * Called when the rate limit is reset.\n */\n void rateLimitReset();\n }\n\n /**\n * Queue a task to be handled at a future time, respecting rate limits.\n *\n * @param task Task to be executed.\n */\n public abstract void queue(@Nonnull Runnable task);\n\n /**\n * Get how many requests may still be done before the rate limit is hit and no more requests can be made.\n *\n * @return Remaining requests.\n */\n @Nonnegative\n @CheckReturnValue\n public abstract int getRemainingRequests();\n\n /**\n * Get how much time, in milliseconds, is left until the rate limit is reset.\n *\n * @return Remaining cooldown time.\n */\n @CheckReturnValue\n public abstract long getTimeUntilReset();\n\n /**\n * Creates a child rate limiter, whose requests increase this limiter's counter, but have a separate cooldown.\n *\n * @param requests Requests that can be done before needing a cooldown.\n * @param cooldown Cooldown time, in milliseconds.\n * @param callback Callback to be notified about rate limits.\n *\n * @return A new child rate limiter.\n */\n @CheckReturnValue\n @Nonnull\n public RateLimiter createChildLimiter(int requests, long cooldown, Callback callback) {\n throw new UnsupportedOperationException();\n }\n\n /**\n * Creates a child rate limiter, whose requests increase this limiter's counter, but have a separate cooldown.\n *\n * @param requests Requests that can be done before needing a cooldown.\n * @param cooldown Cooldown time, in milliseconds.\n *\n * @return A new child rate limiter.\n */\n @CheckReturnValue\n @Nonnull\n public RateLimiter createChildLimiter(int requests, long cooldown) {\n return createChildLimiter(requests, cooldown, null);\n }\n\n /**\n * Creates a new rate limiter that does no handling of rate limits, useful for situations where few requests are made.\n *\n * <br>When using this method, you are responsible for handling rate limits.\n *\n * @return A direct rate limiter.\n */\n @Nonnull\n @CheckReturnValue\n public static RateLimiter directLimiter() {\n return DirectLimiter.INSTANCE;\n }\n\n private static class DirectLimiter extends RateLimiter {\n static final DirectLimiter INSTANCE = new DirectLimiter();\n\n private DirectLimiter() {}\n\n @Override\n public void queue(@Nonnull Runnable task) {\n task.run();\n }\n\n @Override\n public int getRemainingRequests() {\n return Integer.MAX_VALUE;\n }\n\n @Override\n public long getTimeUntilReset() {\n return 0;\n }\n\n @Nonnull\n @Override\n public RateLimiter createChildLimiter(int requests, long cooldown) {\n return this;\n }\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>N,K = map(int,input().split())\nS = input()\n\nif S[N-1] == '1':\n S += '0'\nelse:\n S += '1'\n\nmemo = []\nnow = S[0]\ncnt = 1\nfor i in range(N):\n if S[i+1] == now:\n cnt += 1\n else:\n memo.append(cnt)\n cnt = 1\n now = S[i+1]\n\nm = 0\nl = []\nif S[0] == '1':\n for i in range(len(memo)):\n if i%2 == 0:\n s = sum(memo[i:i+2*K+1])\n l.append(s)\n else:\n s = sum(memo[i:i+2*K])\n l.append(s)\n\n\n\n # if s > m:\n # m = s\nelse:\n for i in range(len(memo)):\n if i%2 == 1:\n s = sum(memo[i:i+2*K+1])\n l.append(s)\n else:\n s = sum(memo[i:i+2*K])\n l.append(s)\n\n\n # if s > m:\n # m = s\n\nprint(max(l))\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Rust_>fn main() {\n proconio::input! {\n n: usize,\n ds: [usize; n],\n }\n const M: usize = 998244353;\n if ds[0] != 0 || ds.iter().skip(1).any(|d| *d == 0) {\n println!(\"0\");\n return;\n }\n let mut count = 1usize;\n let mut m = std::collections::BTreeMap::new();\n for d in ds.into_iter().skip(1) {\n *m.entry(d).or_default() += 1;\n }\n let mut distance = 0;\n let mut prev = 1usize;\n for (d, num) in m.iter() {\n if distance + 1 != *d {\n println!(\"0\");\n return;\n }\n count *= prev.checked_pow(*num as u32).unwrap() % M;\n count %= M;\n distance = *d;\n prev = *num;\n }\n println!(\"{}\", count);\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Dockerfile_>\n\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>/*\n * Copyright 2018 Google\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \"Firestore/core/src/firebase/firestore/local/leveldb_transaction.h\"\n\n#import <XCTest/XCTest.h>\n#include <absl/strings/string_view.h>\n#include <leveldb/db.h>\n#import \"Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h\"\n#import \"Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h\"\n#import \"Firestore/Protos/objc/firestore/local/Target.pbobjc.h\"\n#include \"Firestore/core/src/firebase/firestore/local/leveldb_key.h\"\n\nNS_ASSUME_NONNULL_BEGIN\n\nusing leveldb::DB;\nusing leveldb::Options;\nusing leveldb::ReadOptions;\nusing leveldb::WriteOptions;\nusing leveldb::Status;\nusing firebase::firestore::local::LevelDbMutationKey;\nusing firebase::firestore::local::LevelDbTransaction;\n\n@interface FSTLevelDBTransactionTests : XCTestCase\n@end\n\n@implementation FSTLevelDBTransactionTests {\n std::shared_ptr<DB> _db;\n}\n\n- (void)setUp {\n Options options;\n options.error_if_exists = true;\n options.create_if_missing = true;\n\n NSString *dir = [FSTPersistenceTestHelpers levelDBDir];\n DB *db;\n Status status = DB::Open(options, [dir UTF8String], &db);\n XCTAssert(status.ok(), @\"Failed to create db: %s\", status.ToString().c_str());\n _db.reset(db);\n}\n\n- (void)tearDown {\n _db.reset();\n}\n\n- (void)testCreateTransaction {\n LevelDbTransaction transaction(_db.get());\n std::string key = \"key1\";\n\n transaction.Put(key, \"value\");\n auto iter = transaction.NewIterator();\n iter->Seek(key);\n XCTAssertEqual(key, iter->key());\n iter->Next();\n XCTAssertFalse(iter->Valid());\n}\n\n- (void)testCanReadCommittedAndMutations {\n const std::string committed_key1 = \"c_key1\";\n const std::string committed_value1 = \"c_value1\";\n const WriteOptions &writeOptions = LevelDbTransaction::DefaultWriteOptions();\n // add two things committed, mutate one, add another mutation\n // verify you can get the original committed, the mutation, and the addition\n Status status = _db->Put(writeOptions, committed_key1, committed_value1);\n XCTAssertTrue(status.ok());\n\n const std::string committed_key2 = \"c_key2\";\n const std::string committed_value2 = \"c_value2\";\n status = _db->Put(writeOptions, committed_key2, committed_value2);\n XCTAssertTrue(status.ok());\n\n LevelDbTransaction transaction(_db.get());\n const std::string mutation_key1 = \"m_key1\";</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Awk_>#\n# $Id: update_slave_catalog.awk,v 1.1 2003/10/31 16:18:00 nivit Exp $\n#\n# Update slave nls catalog file\n#\n# Add new lines, delete missing lines in master file,\n# update message number line in slave file.\n#\n\nBEGIN {\n\n\tif (master == \"\" || slave == \"\") usage();\n\n\tif (master == slave) usage();\n\n\tret = make_md5_file();\n\n\tif (ret != 0) {\n\t\tprint \"\\\"update_slave_catalogs.awk\\\"\", \\\n\t\t\t\"can not make MD5 files\";\n\t\texit 1;\n\t}\n\n\t# required by find_new_messages()\n\tnew_message_file = \"new_messages.txt\"\n\n\tret = find_new_messages(new_message_file);\n\tif (ret != 0) {\n\t\tprintf \"\\\"update_slave_catalogs.awk\\\" \" \\\n\t\t\t\"can not compare \" \\\n\t\t\t\"%s.md5 and %s.md5 files\\n\", \\\n\t\t\tmaster, slave;\n\t\texit 1;\n\t}\n\n\tclose(master);\n\tclose(slave);\n\n}\n\n# print any comment, statement...\n/^\\$.*/ {\n\tprint $0;\n}\n\n#/^\\$ MD5\\(\\\".*\\\"\\) = [[:alnum:]]*/ {\n/^\\$ MD5.*/ {\n\n\tmesg = is_new($0);\n\n\tchecksum = sprintf(\"%s\", $0);\n\n\tclose(new_message_file);\n\n\tgetline;\n\n\tif (mesg == 0) {\n\t\tprint_old_message($0, checksum);\n\t} else \n\tprint;\n}\n\n# prints usage information and exit\nfunction usage() {\n\n\tprint \"usage: awk -f update_slave_catalogs.awk\", \\\n\t\t\"-v master=MASTER_FILE\", \\\n\t\t\"-v slave=SLAVE_FILE\",\n\t\t\"MASTER_FILE\";\n\t\texit 1;\n}\n\n\n# extract all lines starting with $ MD5 from \"master\" and \"slave\"\n# files; sort them, and save the lines in separated files.\nfunction make_md5_file () {\n\n\tmaster_md5_cmd = sprintf(\"grep -e '^$ MD5 ' %s > %s.md5\",\n\t master, master);\n\terror = system(master_md5_cmd);\n\n\tif (error > 0) {\n\t\tprint master_md5_cmd;\n\t\treturn 1;\n\t}\n\n\tmaster_sort_cmd = sprintf(\"sort %s.md5 > %s.sort\",\n\t master, master);\n\terror = system(master_sort_cmd);\n\n\tif (error > 1) return error;\n\n\tslave_md5_cmd = sprintf(\"grep -e '^$ MD5 ' %s > %s.md5\",\n\t slave, slave);\n\terror = system(slave_md5_cmd);\n\n\tif (error > 0) return error;\n\n\tslave_sort_cmd = sprintf(\"sort %s.md5 > %s.sort\",\n\t slave, slave);\n\terror = system(slave_sort_cmd);\n\n\tif (error > 1) return error;\n\n\treturn 0;\n}\n\n\n# This function calls simply the comm(1) utility\n# with `master`.md5 and `slave`.md5 files as\n# arguments.\nfunction find_new_messages(new_messages_file) {\n\n\tfind_cmd = sprintf(\"comm -23 %s.sort %s.sort > %s\",\n\t master, slave, new_messages_file);\n\n\tfind_ret = system(find_cmd);\n\n\treturn find_ret;\n}\n\n# check if the message is been already translated\nfunction is_new(line_checksum, new_message, checksum) {\n\n\t# new_message = 0;\n\n\twhile ((getline checksum < new_message_file) > 0) {\n\t\tif (checksum == line_checksum) {\n\t\t\t# is a new message\n\t\t\tnew_message = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn new_message;\n}\n\nfunction print_old_message(new_mesg, old_checksum, found, old_message, number_line) {\n\tnumber_line = $1;\n\n\twhile ((getline old_message < slave) > 0) {\n\n\t\tif (old_message == old_checksum) {\n\t\t\t# the next line is the message\n\t\t\tgetline < slave; # errors?\n\t\t\t$1 = \"\"\n\t\t\tprint number_line $0;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tclose(slave);\n}\n\nEND {\n\n\t# remove temporary files\n\trm_cmd = sprintf(\"rm -f *.sort *.md5 new_messages.txt\");\n\tsystem(rm_cmd);\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Rust_> \"quotedblleft\",\n \"quotedblright\",\n \"quoteleft\",\n \"quoteright\",\n \"divide\",\n \"lozenge\",\n \"ydieresis\",\n \"Ydieresis\",\n \"fraction\",\n \"currency\",\n \"guilsinglleft\",\n \"guilsinglright\",\n \"fi\",\n \"fl\",\n \"daggerdbl\",\n \"periodcentered\",\n \"quotesinglbase\",\n \"quotedblbase\",\n \"perthousand\",\n \"Acircumflex\",\n \"Ecircumflex\",\n \"Aacute\",\n \"Edieresis\",\n \"Egrave\",\n \"Iacute\",\n \"Icircumflex\",\n \"Idieresis\",\n \"Igrave\",\n \"Oacute\",\n \"Ocircumflex\",\n \"apple\",\n \"Ograve\",\n \"Uacute\",\n \"Ucircumflex\",\n \"Ugrave\",\n \"dotlessi\",\n \"circumflex\",\n \"tilde\",\n \"macron\",\n \"breve\",\n \"dotaccent\",\n \"ring\",\n \"cedilla\",\n \"hungarumlaut\",\n \"ogonek\",\n \"caron\",\n \"Lslash\",</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Scheme_>(define (adjoin-term order coeff term-list)\n (let ((len (length term-list)))\n (cond\n ((=zero? coeff) term-list)\n ((> order len) (error \"xxx\"))\n ((= order len) (cons coeff term-list))\n ((= order (- len 1)) (cons (add coeff (first-term term-list))\n (rest-terms term-list)))\n (else (cons (first-term term-list)\n (adjoin-term order coeff (rest-terms term-list)))))))\n(define (the-empty-termlist) '())\n(define (first-term term-list) (car term-list))\n(define (rest-terms term-list) (cdr term-list))\n(define (empty-termlist? term-list) (null? term-list))\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>/////////////////////////////////////////////////////////////////////////////\n// Name: cocoa/scrolbar.mm\n// Purpose: wxScrollBar\n// Author: David Elliott\n// Modified by:\n// Created: 2004/04/25\n// RCS-ID: $Id: scrolbar.mm,v 1.1 2004/06/23 15:26:38 DE Exp $\n// Copyright: (c) 2004 David Elliott\n// Licence: \twxWindows licence\n/////////////////////////////////////////////////////////////////////////////\n\n#include \"wx/wxprec.h\"\n#if wxUSE_SCROLLBAR\n\n#ifndef WX_PRECOMP\n #include \"wx/app.h\"\n #include \"wx/scrolbar.h\"\n#endif //WX_PRECOMP\n\n#import <AppKit/NSScroller.h>\n\nIMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)\nBEGIN_EVENT_TABLE(wxScrollBar, wxScrollBarBase)\nEND_EVENT_TABLE()\nWX_IMPLEMENT_COCOA_OWNER(wxScrollBar,NSScroller,NSControl,NSView)\n\nbool wxScrollBar::Create(wxWindow *parent, wxWindowID winid,\n const wxPoint& pos, const wxSize& size, long style,\n const wxValidator& validator, const wxString& name)\n{\n if(!CreateControl(parent,winid,pos,size,style,validator,name))\n return false;\n SetNSScroller([[NSScroller alloc] initWithFrame: MakeDefaultNSRect(size)]);\n [m_cocoaNSView release];\n if(m_parent)\n m_parent->CocoaAddChild(this);\n SetInitialFrameRect(pos,size);\n\n return true;\n}\n\nwxScrollBar::~wxScrollBar()\n{\n DisassociateNSScroller(GetNSScroller());\n}\n\n/* A word about NSScroller vs. wxScrollbar:\n\nNSScroller uses two float values to represent the state of the scroller.</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>/*\n * Copyright 2015 The WebRTC project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree. An additional intellectual property rights grant can be found\n * in the file PATENTS. All contributing project authors may\n * be found in the AUTHORS file in the root of the source tree.\n */\n\n#import \"RTCVideoTrack+Private.h\"\n\n#import \"NSString+StdString.h\"\n#import \"RTCMediaStreamTrack+Private.h\"\n#import \"RTCPeerConnectionFactory+Private.h\"\n#import \"RTCVideoRendererAdapter+Private.h\"\n#import \"RTCVideoSource+Private.h\"\n\n@implementation RTCVideoTrack {\n NSMutableArray *_adapters;\n}\n\n@synthesize source = _source;\n\n- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory\n source:(RTCVideoSource *)source\n trackId:(NSString *)trackId {\n NSParameterAssert(factory);\n NSParameterAssert(source);\n NSParameterAssert(trackId.length);\n std::string nativeId = [NSString stdStringForString:trackId];\n rtc::scoped_refptr<webrtc::VideoTrackInterface> track =\n factory.nativeFactory->CreateVideoTrack(nativeId,\n source.nativeVideoSource);\n if (self = [self initWithFactory:factory nativeTrack:track type:RTCMediaStreamTrackTypeVideo]) {\n _source = source;\n }\n return self;\n}\n\n- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory\n nativeTrack:\n (rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)nativeMediaTrack\n type:(RTCMediaStreamTrackType)type {\n NSParameterAssert(factory);\n NSParameterAssert(nativeMediaTrack);\n NSParameterAssert(type == RTCMediaStreamTrackTypeVideo);\n if (self = [super initWithFactory:factory nativeTrack:nativeMediaTrack type:type]) {\n _adapters = [NSMutableArray array];\n }\n return self;\n}\n\n- (void)dealloc {\n for (RTCVideoRendererAdapter *adapter in _adapters) {\n self.nativeVideoTrack->RemoveSink(adapter.nativeVideoRenderer);\n }\n}\n\n- (RTCVideoSource *)source {\n if (!_source) {\n rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> source =\n self.nativeVideoTrack->GetSource();\n if (source) {\n _source =\n [[RTCVideoSource alloc] initWithFactory:self.factory nativeVideoSource:source.get()];\n }\n }\n return _source;\n}\n\n- (void)addRenderer:(id<RTCVideoRenderer>)renderer {\n // Make sure we don't have this renderer yet.\n for (RTCVideoRendererAdapter *adapter in _adapters) {\n if (adapter.videoRenderer == renderer) {\n NSAssert(NO, @\"|renderer| is already attached to this track\");\n return;\n }\n }\n // Create a wrapper that provides a native pointer for us.\n RTCVideoRendererAdapter* adapter =\n [[RTCVideoRendererAdapter alloc] initWithNativeRenderer:renderer];\n [_adapters addObject:adapter];\n self.nativeVideoTrack->AddOrUpdateSink(adapter.nativeVideoRenderer,\n rtc::VideoSinkWants());\n}\n\n- (void)removeRenderer:(id<RTCVideoRenderer>)renderer {\n __block NSUInteger indexToRemove = NSNotFound;\n [_adapters enumerateObjectsUsingBlock:^(RTCVideoRendererAdapter *adapter,\n NSUInteger idx,\n BOOL *stop) {\n if (adapter.videoRenderer == renderer) {\n indexToRemove = idx;\n *stop = YES;\n }\n }];\n if (indexToRemove == NSNotFound) {\n return;\n }\n RTCVideoRendererAdapter *adapterToRemove =\n [_adapters objectAtIndex:indexToRemove];\n self.nativeVideoTrack->RemoveSink(adapterToRemove.nativeVideoRenderer);\n [_adapters removeObjectAtIndex:indexToRemove];\n}\n\n#pragma mark - Private\n\n- (rtc::scoped_refptr<webrtc::VideoTrackInterface>)nativeVideoTrack {\n return static_cast<webrtc::VideoTrackInterface *>(self.nativeTrack.get());\n}\n\n@end\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_SQL_>\t\t`PARKIF` = CASE WHEN new_version = \"1\" THEN NULL WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN -8 END,\n\t\t`STROKE` = CASE WHEN new_version = \"1\" THEN NULL WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN -8 END,\n\t\t`STROKIF` = CASE WHEN new_version = \"1\" THEN NULL WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN -8 END,\n\t\t`COGOTH2` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN NULL END,\n\t\t`COGOTH2IF` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN NULL END,\n\t\t`COGOTH2X` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN NULL END,\n\t\t`COGOTH3` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN NULL END,\n\t\t`COGOTH3IF` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN NULL END,\n\t\t`COGOTH3X` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN NULL WHEN new_version = \"3\" THEN NULL END,\n\t\t`DXMETHOD` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,\n\t\t`AMNDEM` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,\n\t\t`PCA` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,\n\t\t`PPASYN` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,\n\t\t`PPASYNT` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,\n\t\t`FTDSYN` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,\n\t\t`LBDSYN` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,\n\t\t`NAMNDEM` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,\n\t\t`AMYLPET` = CASE WHEN new_version = \"1\" THEN -8 WHEN new_version = \"2\" THEN -8 WHEN new_version = \"3\" THEN NULL END,</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_> expect(message.errors[:base]).to include(\"Unknown query parameter(s): 'current'\")\n end\n end\n end\n\n it 'validates organization_guids is an array' do\n message = DropletsListMessage.from_params organization_guids: 'tricked you, not an array'\n expect(message).to be_invalid\n expect(message.errors[:organization_guids].length).to eq 1\n end\n\n it 'validates space_guids is an array' do\n message = DropletsListMessage.from_params space_guids: 'tricked you, not an array'\n expect(message).to be_invalid\n expect(message.errors[:space_guids].length).to eq 1\n end\n\n it 'validates app_guids is an array' do\n message = DropletsListMessage.from_params app_guids: 'tricked you, not an array'\n expect(message).to be_invalid\n expect(message.errors[:app_guids].length).to eq 1\n end\n\n it 'validates states is an array' do\n message = DropletsListMessage.from_params states: 'not array at all'\n expect(message).to be_invalid\n expect(message.errors[:states].length).to eq 1\n end\n end\n end\n\n describe '#to_param_hash' do\n it 'excludes app_guid' do\n expect(DropletsListMessage.from_params({ app_guid: '24234' }).to_param_hash.keys).to match_array([])\n end\n\n it 'excludes package_guid' do\n expect(DropletsListMessage.from_params({ package_guid: '24234' }).to_param_hash.keys).to match_array([])\n end\n end\n\n describe 'validations' do\n it 'validates label_selector' do\n message = SpacesListMessage.from_params('label_selector' => '')\n\n expect_any_instance_of(Validators::LabelSelectorRequirementValidator).to receive(:validate).with(message).and_call_original\n message.valid?\n end\n end\n end\nend\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>from __future__ import absolute_import, division, print_function\n\nimport numpy as np\nfrom arrow import StochasticSystem\n\n\nfrom vivarium.core.process import Process\nfrom vivarium.core.composition import simulate_process_in_experiment\n\nfrom vivarium.library.dict_utils import keys_list\nfrom vivarium_cell.data.molecular_weight import molecular_weight\nfrom vivarium_cell.data.chromosomes.flagella_chromosome import FlagellaChromosome\n\nchromosome = FlagellaChromosome()\n\ndef build_complexation_stoichiometry(\n stoichiometry,\n rates,\n reaction_ids,\n monomer_ids,\n complex_ids):\n\n molecule_ids = monomer_ids + complex_ids\n matrix = np.zeros((len(stoichiometry), len(molecule_ids)), dtype=np.int64)\n rates_array = np.zeros(len(stoichiometry))\n\n reverse_index = {\n molecule_id: index\n for index, molecule_id in enumerate(molecule_ids)}\n\n for reaction_index, reaction_id in enumerate(reaction_ids):\n reaction = stoichiometry[reaction_id]\n rates_array[reaction_index] = rates[reaction_id]\n for molecule_id, level in reaction.items():\n matrix[reaction_index][reverse_index[molecule_id]] = level\n\n return matrix, rates_array\n\n\nclass Complexation(Process):\n\n name = 'complexation'\n defaults = {\n 'monomer_ids': chromosome.complexation_monomer_ids,\n 'complex_ids': chromosome.complexation_complex_ids,\n 'stoichiometry': chromosome.complexation_stoichiometry,\n 'rates': chromosome.complexation_rates,\n 'mass_deriver_key': 'mass_deriver',\n 'time_step': 1.0,\n }\n\n def __init__(self, initial_parameters=None):\n if not initial_parameters:\n initial_parameters = {}\n\n super(Complexation, self).__init__(initial_parameters)\n\n self.derive_defaults('stoichiometry', 'reaction_ids', keys_list)\n\n self.monomer_ids = self.parameters['monomer_ids']\n self.complex_ids = self.parameters['complex_ids']\n self.reaction_ids = self.parameters['reaction_ids']\n\n self.stoichiometry = self.parameters['stoichiometry']\n self.rates = self.parameters['rates']\n\n self.complexation_stoichiometry, self.complexation_rates = build_complexation_stoichiometry(\n self.stoichiometry,\n self.rates,\n self.reaction_ids,\n self.monomer_ids,\n self.complex_ids)\n\n self.complexation = StochasticSystem(self.complexation_stoichiometry)\n\n self.mass_deriver_key = self.or_default(initial_parameters, 'mass_deriver_key')\n\n\n def ports_schema(self):\n return {\n 'monomers': {\n monomer: {\n '_default': 0,\n '_emit': True,\n '_divider': 'split',\n '_properties': {\n 'mw': molecular_weight[\n monomer]} if monomer in molecular_weight else {}}\n for monomer in self.monomer_ids},\n 'complexes': {\n complex: {\n '_default': 0,</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import random\nimport pickle\nimport itertools\nimport os\n\nfrom streams.generators.__init__ import *\n\n\ndef get_parameter_list(equal_concept_length, equal_transition_length, max_num_drifts):\n\n \"\"\"Gets the list of parameter dictionaries for generating streams.\n\n Parameters:\n equal_concept_lenth (bool): If true, each parameter configuration will have concepts of equal length. Otherwise, each configuration will have a random combination of the possible lengths.\"\n equal_transition_lenth (bool): If true, each parameter configuration will have transitions of equal length. Otherwise, each configuration will have a random combination of the possible lengths.\"\n max_num_drifts (int): the maximum number of drifts that can occur per stream.\n\n Returns:\n list of dictionaries: A list of dictionaries of parameters for generating streams.\n\n \"\"\"\n parameter_list = []\n\n concept_length_list = [1000,10000,25000]\n transition_length_list = [500,1000,10000]\n noise_ratio_list = [0.0,0.1,0.2,0.3]\n magnitude_list = [1,2,3,4,5,6,7]\n\n\n for num_drifts in range(1, max_num_drifts + 1):\n for magnitude_combination in itertools.combinations(magnitude_list, num_drifts + 1): \n for concept_len in concept_length_list: #if equal_concept_length is false, don't necessarily have to go through this loop, but it does limit iterations\n for transition_len in transition_length_list: #if equal_transition_length is false, don't necessarily have to go through this loop, but it does limit iterations\n for noise_ratio in noise_ratio_list:\n parameter_list.append({'concept_length':[concept_len]*(num_drifts + 1) if equal_concept_length else list(random.choice(list(itertools.combinations_with_replacement(concept_length_list, num_drifts + 1)))), #the duration of the concept, for each concept in the stream\n 'led_attr_drift': list(magnitude_combination), #the number of attributes which drift within each concept\n 'transition_length':[transition_len]*num_drifts if equal_concept_length else list(random.choice(list(itertools.combinations_with_replacement(transition_length_list, num_drifts)))), #the length of the transition period from one concept to another (shorter is more abrupt, longer is gradual)\n 'noise_rate':noise_ratio, #the ratio of rows that will include a flipped bit on one of the relevant attributes and/or an incorrect class label\n 'num_irr_attr': 17, #the number of irrelevant attributes to add\n 'led_attr_noise': list(range(0, 7)), #the indices of the attributes which can take on noise (defualt is all relevant attributes)\n 'led_target_noise': False, #a flag indicating whether or not noise should be injected into the target attribute\n 'random_seed': random.choice(list(range(0,1000))) #the random seed for the stream\n })\n #print(parameter_list)\n #exit()\n\n #print(len(parameter_list))\n #exit()\n\n return parameter_list\n\ndef generate_stream(parameter_dict, file_path):\n\n \"\"\"Generates a synthetic stream and saves it.\n\n Parameters:\n parameter_dict (dictionary): The dictionary holding all parameters for stream generation.\n file_path (string): The path where the stream file should be saved.\n\n Returns:\n LEDConceptDrift object: The stream generator object.\n\n \"\"\"\n\n #generate the stream\n stream_generator = LEDConceptDrift(parameter_dict['concept_length'], \n parameter_dict['num_irr_attr'], \n parameter_dict['led_attr_drift'],\n parameter_dict['transition_length'],\n parameter_dict['noise_rate'],\n parameter_dict['led_attr_noise'],\n parameter_dict['led_target_noise'],\n parameter_dict['random_seed'])\n\n #save the stream as arff file\n stream_generator.generate(file_path)\n\n return stream_generator\n\ndef save_metadata(stream_generator, parameter_dict, meta_path):\n\n \"\"\"Saves the metadata of the stream. Includes all generation parameters plus some computed meta data.\n\n Parameters:\n stream_generator (LEDConceptDrift onject): The generator object for the stream.\n parameter_dict (dictionary): The dictionary holding all parameters for stream generation.\n meta_path (string): The path where the meta data should be saved.\n\n \"\"\"\n\n #compute the stream's meta data\n drift_locations = []\n pointer = 0\n for concept_len, transition_len in zip(parameter_dict['concept_length'][:-1],parameter_dict['transition_length']):\n start = pointer + concept_len</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_ObjectiveC_>// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#import \"chrome/browser/ui/cocoa/bookmarks/bookmark_button.h\"\n\n#include <cmath>\n\n#include \"base/logging.h\"\n#include \"base/mac/foundation_util.h\"\n#import \"base/mac/scoped_nsobject.h\"\n#include \"chrome/browser/bookmarks/bookmark_model.h\"\n#import \"chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_window.h\"\n#import \"chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h\"\n#import \"chrome/browser/ui/cocoa/browser_window_controller.h\"\n#import \"chrome/browser/ui/cocoa/view_id_util.h\"\n#include \"content/public/browser/user_metrics.h\"\n#include \"ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h\"\n\nusing base::UserMetricsAction;\n\n// The opacity of the bookmark button drag image.\nstatic const CGFloat kDragImageOpacity = 0.7;\n\n\nnamespace bookmark_button {\n\nNSString* const kPulseBookmarkButtonNotification =\n @\"PulseBookmarkButtonNotification\";</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>{{ config(\n materialized = 'view',\n persist_docs ={ \"relation\": true,\n \"columns\": true }\n) }}\n\nSELECT\n blockchain,\n creator,\n address,\n address_name,\n label_type,\n label_subtype,\n label\nFROM\n {{ source(\n 'flipside_gold_ethereum',\n 'labels'\n ) }}\nWHERE\n blockchain = 'ethereum'\n AND address LIKE '0x%'\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Rust_>#![allow(unused_imports)]\n\nuse std::cmp::{max, min, Ordering};\nuse std::collections::*;\nuse std::iter::once;\n#[cfg(debug_assertions)]\ninclude! {\"./debug.rs\"}\n\n#[cfg(not(debug_assertions))]\nmacro_rules! debug {\n ($($arg:expr),*) => {};\n}\n\nmacro_rules! read {\n ([$t:ident] ; $n:expr) =>\n ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());\n ([$t:ident]) =>\n (rl().split_whitespace().map(|w| read_type!(w, $t)).collect::<Vec<_>>());\n (_, [$t:ident] ; $n:expr) =>\n ((0..$n).map(|_| read!(_, [$t])).collect::<Vec<_>>());\n (_, [$t:ident]) =>\n (rl().split_whitespace().skip(1).map(|w| read_type!(w, $t)).collect::<Vec<_>>());\n ($($t:ident),+ ; $n:expr) =>\n ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());\n ($t:ident) => (read_type!(rl(), $t));\n ($($t:ident),*) => {{\n let buf = rl();\n let mut w = buf.split_whitespace();\n ($(read_type!(w.next().unwrap(), $t)),*)\n }};\n}\n\nmacro_rules! read_type {\n ($s:expr, chars) => {\n $s.chars().collect::<Vec<char>>()\n };\n ($s:expr, usize1) => {\n read_type!($s, usize) - 1\n };\n ($s:expr, $t:ty) => {\n $s.parse::<$t>().unwrap()\n };\n}\n\nfn rl() -> String {\n let mut buf = String::new();\n std::io::stdin().read_line(&mut buf).unwrap();\n buf.trim_right().to_owned()\n}\n\ntrait IteratorExt: Iterator + Sized {\n fn vec(self) -> Vec<Self::Item> {\n self.collect()\n }\n}\n\nimpl<T: Iterator> IteratorExt for T {}\n\n////////////////////////////////////////////////////////////////////////////////\n\nfn main() {\n let (n, c) = read!(usize, i64);\n let mut xc = read!(i64, i64; n);\n xc.insert(0, (0, 0));\n xc.push((c, 0));\n debug!(xc);\n\n let mut l = xc\n .windows(2)\n .map(|s| (s[1].0 - s[0].0, s[1].1))\n .map(|(x, c)| c - x)\n .vec();\n debug!(l);\n for i in 1..l.len() {\n l[i] = l[i - 1] + l[i];\n }\n debug!(l);\n for i in 1..l.len() {\n l[i] = max(l[i - 1], l[i]);\n }\n debug!(l);\n\n let mut r = xc\n .windows(2)\n .map(|s| (s[1].0 - s[0].0, s[0].1))\n .map(|(x, c)| c - x)\n .rev()\n .vec();\n debug!(r);\n for i in 1..r.len() {\n r[i] = r[i - 1] + r[i];\n }\n debug!(r);\n for i in 1..r.len() {\n r[i] = max(r[i - 1], r[i]);\n }\n debug!(r);\n\n let mut ans: i64 = 0;\n ans = max(*l.iter().max().unwrap(), ans);\n ans = max(*r.iter().max().unwrap(), ans);\n debug!(ans);\n\n for i in 0..n - 1 {\n let a = l[i] - xc[i + 1].0 + r[n - 2 - i];\n debug!(xc[i + 1].0, a);\n ans = max(a, ans);\n }\n\n for i in 0..n - 1 {\n let a = r[i] - (c - xc[n - i].0) + l[n - 2 - i];\n debug!(c - xc[n - i].0, a);\n ans = max(a, ans);\n }\n\n println!(\"{}\", ans);\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_MoonScript_> \"test_path\"\n \"test_cart2\"\n \"test_cart\"\n \"test_chop\"\n}\nT = TK.module.submodules me, members\nM[name] = () -> TK.test.self T\nreturn M</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Bash_># osm0sis @ xda-developers\n\n## AnyKernel setup\n# begin properties\nproperties() { '\nkernel.string=IceCold R6 EAS by PrimoDev23\ndo.devicecheck=1\ndo.modules=0\ndo.systemless=1\ndo.cleanup=1\ndo.cleanuponabort=0\ndevice.name1=whyred\ndevice.name2=\ndevice.name3=\ndevice.name4=\ndevice.name5=\nsupported.versions=\nsupported.patchlevels=\n'; } # end properties\n\n# shell variables\nblock=/dev/block/bootdevice/by-name/boot;\nis_slot_device=0;\nramdisk_compression=auto;\n\n\n## AnyKernel methods (DO NOT CHANGE)\n# import patching functions/variables - see for reference\n. tools/ak3-core.sh;\n\n\n## AnyKernel file attributes\n# set permissions/ownership for included ramdisk files\nchmod -R 750 $ramdisk/*;\nchown -R root:root $ramdisk/*;\n\n## AnyKernel install\ndump_boot;\n\n# begin ramdisk changes\n\n# end ramdisk changes\n\nwrite_boot;\n## end install\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Kotlin_>package materialui.icons.components.controlcamera\n\nimport kotlinx.html.SVG\nimport kotlinx.html.Tag\nimport kotlinx.html.TagConsumer\nimport materialui.components.svgicon.enums.SvgIconStyle\nimport materialui.icons.ControlCamera\nimport materialui.icons.components.svgicon.SvgIconElementBuilder\nimport react.RBuilder\n\nfun RBuilder.controlCamera(vararg classMap: Pair<SvgIconStyle, String>, block: SvgIconElementBuilder<SVG>.() -> Unit) =\n child(SvgIconElementBuilder(ControlCamera, classMap.toList()) { SVG(mapOf(), it) }.apply(block).create())\n\nfun <T : Tag> RBuilder.controlCamera(\n vararg classMap: Pair<SvgIconStyle, String>,\n factory: (TagConsumer<Unit>) -> T,\n block: SvgIconElementBuilder<T>.() -> Unit\n) = child(SvgIconElementBuilder(ControlCamera, classMap.toList(), factory).apply(block).create())\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>// eslint-disable-next-line\nexport default function(Vue) {\n\n return {\n state: {\n configSiteBase: {},\n configSite: {},\n languages: {},\n },\n getters: {\n },\n mutations: {\n setConfigSiteBase(state, { atomClass, configSiteBase }) {\n const atomClassNameFull = `${atomClass.module}:${atomClass.atomClassName}`;\n state.configSiteBase = {\n ...state.configSiteBase,\n [atomClassNameFull]: configSiteBase,\n };\n },\n setConfigSite(state, { atomClass, configSite }) {\n const atomClassNameFull = `${atomClass.module}:${atomClass.atomClassName}`;\n state.configSite = {\n ...state.configSite,\n [atomClassNameFull]: configSite,\n };\n },\n setLanguages(state, { atomClass, languages }) {\n const atomClassNameFull = `${atomClass.module}:${atomClass.atomClassName}`;\n state.languages = {\n ...state.languages,\n [atomClassNameFull]: languages,\n };\n },\n },\n actions: {\n getConfigSiteBase({ state, commit }, { atomClass }) {\n return new Promise((resolve, reject) => {\n const atomClassNameFull = `${atomClass.module}:${atomClass.atomClassName}`;\n const _configSiteBase = state.configSiteBase[atomClassNameFull];\n if (_configSiteBase) return resolve(_configSiteBase);\n Vue.prototype.$meta.api.post('/a/cms/site/getConfigSiteBase', { atomClass }).then(res => {\n const configSiteBase = res.data || {};\n commit('setConfigSiteBase', { atomClass, configSiteBase });\n resolve(configSiteBase);\n }).catch(err => reject(err));\n });\n },\n getConfigSite({ state, commit }, { atomClass }) {\n return new Promise((resolve, reject) => {\n const atomClassNameFull = `${atomClass.module}:${atomClass.atomClassName}`;\n const _configSite = state.configSite[atomClassNameFull];\n if (_configSite) return resolve(_configSite);\n Vue.prototype.$meta.api.post('/a/cms/site/getConfigSite', { atomClass }).then(res => {\n const configSite = res.data || {};\n commit('setConfigSite', { atomClass, configSite });\n resolve(configSite);\n }).catch(err => reject(err));\n });\n },\n getLanguages({ state, commit }, { atomClass }) {\n return new Promise((resolve, reject) => {\n const atomClassNameFull = `${atomClass.module}:${atomClass.atomClassName}`;\n const _languages = state.languages[atomClassNameFull];\n if (_languages) return resolve(_languages);\n Vue.prototype.$meta.api.post('/a/cms/site/getLanguages', { atomClass }).then(res => {\n const languages = res || [];\n commit('setLanguages', { atomClass, languages });\n resolve(languages);\n }).catch(err => reject(err));\n });\n },\n },\n };\n\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.apache.lucene.spatial.util;\n\nimport java.io.IOException;\n\nimport org.apache.lucene.index.LeafReaderContext;\nimport org.apache.lucene.search.DocIdSetIterator;\nimport org.apache.lucene.search.SegmentCacheable;\nimport org.apache.lucene.search.TwoPhaseIterator;\nimport org.apache.lucene.spatial.ShapeValues;\nimport org.apache.lucene.spatial.ShapeValuesSource;\nimport org.apache.lucene.spatial.query.SpatialOperation;\nimport org.locationtech.spatial4j.shape.Shape;\n\n/**\n * Compares a shape from a provided {@link ShapeValuesSource} with a given Shape and sees\n * if it matches a given {@link SpatialOperation} (the predicate).\n *\n * Consumers should call {@link #iterator(LeafReaderContext, DocIdSetIterator)} to obtain a\n * {@link TwoPhaseIterator} over a particular {@link DocIdSetIterator}. The initial DocIdSetIterator\n * will be used as the approximation, and the {@link SpatialOperation} comparison will only be\n * performed in {@link TwoPhaseIterator#matches()}\n *\n * @lucene.experimental\n */\npublic class ShapeValuesPredicate implements SegmentCacheable {\n private final ShapeValuesSource shapeValuesource;//the left hand side\n private final SpatialOperation op;\n private final Shape queryShape;//the right hand side (constant)\n\n /**\n *\n * @param shapeValuesource Must yield {@link Shape} instances from its objectVal(doc). If null\n * then the result is false. This is the left-hand (indexed) side.\n * @param op the predicate\n * @param queryShape The shape on the right-hand (query) side.\n */\n public ShapeValuesPredicate(ShapeValuesSource shapeValuesource, SpatialOperation op, Shape queryShape) {\n this.shapeValuesource = shapeValuesource;\n this.op = op;\n this.queryShape = queryShape;\n }\n\n @Override\n public String toString() {\n return shapeValuesource + \" \" + op + \" \" + queryShape;\n }\n\n public TwoPhaseIterator iterator(LeafReaderContext ctx, DocIdSetIterator approximation) throws IOException {\n final ShapeValues shapeValues = shapeValuesource.getValues(ctx);\n return new TwoPhaseIterator(approximation) {\n @Override\n public boolean matches() throws IOException {\n return shapeValues.advanceExact(approximation.docID()) && op.evaluate(shapeValues.value(), queryShape);\n }\n\n @Override\n public float matchCost() {\n return 100; // is this necessary?\n }\n };\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n ShapeValuesPredicate that = (ShapeValuesPredicate) o;\n\n if (!shapeValuesource.equals(that.shapeValuesource)) return false;\n if (!op.equals(that.op)) return false;\n if (!queryShape.equals(that.queryShape)) return false;\n\n return true;\n }\n\n @Override\n public int hashCode() {\n int result = shapeValuesource.hashCode();\n result = 31 * result + op.hashCode();\n result = 31 * result + queryShape.hashCode();\n return result;\n }\n\n @Override\n public boolean isCacheable(LeafReaderContext ctx) {\n return shapeValuesource.isCacheable(ctx);\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>(1, 'Student 1', 1, 'female', '[email protected]', 'BA'),\n(2, 'DK Student ', 4, 'male', '[email protected]', 'B.Tech'),\n(3, 'Steve Harry', 3, 'male', '[email protected]', 'Java'),\n(4, 'RaghuStudent', 6, 'male', 'raghu1234@gmail', 'PMCS'),\n(5, 'Alison mary', 3, 'female', '[email protected]', 'Java'),\n(7, 'Priyanshu_Sharama', 2, 'male', '[email protected]', 'Computer'),\n(8, 'Pavani Shah', 2, 'female', '[email protected]', 'IT Engineering'),\n(9, 'Bhawesh', 7, 'male', '[email protected]', 'Mechanical'),\n(10, 'Sowmiya Jain', 3, 'female', '[email protected]', 'Electronics'),\n(11, 'test_college1_branch1_student1', 5, 'male', '[email protected]', 'test_college1_branch1_course1'),\n(12, 'RaghuStudent2', 6, 'male', '[email protected]', 'CBZ'),\n(13, 'Jacky', 9, 'male', '[email protected]', 'Java'),\n(14, 'Mike', 9, 'male', '[email protected]', 'Hadoop'),\n(15, 'Rashid khan', 9, 'male', '[email protected]', 'Computer Engineering'),\n(16, 'Rahul', 8, 'male', '[email protected]', 'Civil'),\n(17, 'Shashi.Student', 10, 'male', '[email protected]', 'Cloud.Test.1'),\n(18, 'Shankar', 8, 'male', '[email protected]', 'CSE'),\n(19, 'Aditya', 8, 'male', '[email protected]', 'Civil'),\n(20, 'Akansha', 8, 'female', '[email protected]', 'Electrical'),\n(21, 'Sowmiya Jain', 2, 'female', '[email protected]', 'Electronics'),\n(22, 'DK Student 2', 4, 'male', '[email protected]', 'MCA');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `tbl_users`\n--\n\nCREATE TABLE `tbl_users` (\n `user_id` int(11) NOT NULL,\n `username` varchar(255) NOT NULL,\n `college_id` int(11) NOT NULL,\n `email` varchar(255) NOT NULL,\n `gender` varchar(255) NOT NULL,\n `role_id` int(11) NOT NULL,\n `password` varchar(255) NOT NULL,\n `confpwd` varchar(255) NOT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n--\n-- Dumping data for table `tbl_users`\n--\n\nINSERT INTO `tbl_users` (`user_id`, `username`, `college_id`, `email`, `gender`, `role_id`, `password`, `confpwd`) VALUES\n(1, 'Verity Admin', 0, '[email protected]', 'male', 1, '7c4a8d09ca3762af61e59520943dc26494f8941b', '7c4a8d09ca3762af61e59520943dc26494f8941b'),\n(5, 'Moderator1', 1, '[email protected]', 'male', 2, '7c4a8d09ca3762af61e59520943dc26494f8941b', '7c4a8d09ca3762af61e59520943dc26494f8941b'),\n(6, 'Moderator Admin', 1, '[email protected]', 'female', 1, '7c4a8d09ca3762af61e59520943dc26494f8941b', '7c4a8d09ca3762af61e59520943dc26494f8941b'),\n(7, '[email protected]', 3, '[email protected]', 'male', 1, '7c4a8d09ca3762af61e59520943dc26494f8941b', '7c4a8d09ca3762af61e59520943dc26494f8941b'),\n(8, 'DK', 4, '[email protected]', 'male', 2, '7c4a8d09ca3762af61e59520943dc26494f8941b', '7c4a8d09ca3762af61e59520943dc26494f8941b'),\n(9, 'RaghuModerator', 1, '[email protected]', 'male', 1, 'f865b53623b121fd34ee5426c792e5c33af8c227', 'f865b53623b121fd34ee5426c792e5c33af8c227'),\n(10, 'Shashi_Admin', 0, '[email protected]', 'male', 1, 'b2c86d880e546515ca2a3bda85922eb24c11837f', 'b2c86d880e546515ca2a3bda85922eb24c11837f'),\n(11, 'Trupti', 2, '[email protected]', 'female', 1, 'd9c4e99a174c9471bbbff15488d37a5f4f3607ea', 'd9c4e99a174c9471bbbff15488d37a5f4f3607ea'),</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nbool Expression::process( const std::string& expression )\n{\n\tstd::string::size_type curr, next;\n\tOperator::Mode mode = Operator::UNARY;\n\n\tm_tokens.clear();\n\n\twhile( !m_stack.empty() )\n\t\tm_stack.pop();\n\n\tfor( curr = 0; curr < expression.length(); curr = next )\n\t{\n\t\tnext = curr+1;\n\n\t\tif( ((expression[curr] >= '0') && (expression[curr] <= '9')) || (expression[curr] == '.') )\n\t\t{\n\t\t\t// operand\n\n\t\t\tbool hasPeriod = (expression[curr] == '.');\n\t\t\tbool hasExponent = false;\n\t\t\tstd::string::size_type exponent = curr;\n\n\t\t\tfor( ; next < expression.length(); ++next )\n\t\t\t{\n\t\t\t\tif( ('.' == expression[next]) )\n\t\t\t\t{\n\t\t\t\t\tif( hasPeriod )\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\thasPeriod = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif( ('e' == expression[next]) || ('E' == expression[next]) )\n\t\t\t\t{\n\t\t\t\t\tif( exponent != curr )\n\t\t\t\t\t\treturn false;\n\n\t\t\t\t\thasExponent = true;\n\t\t\t\t\texponent = next;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif( ('+' == expression[next]) || ('-' == expression[next]) )\n\t\t\t\t{\n\t\t\t\t\tif( (exponent != (next-1)) && hasExponent )\n\t\t\t\t\t\treturn false;\n\t\t\t\t\telse if( !hasExponent )\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif( !((expression[next] >= '0') && (expression[next] <= '9')) )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tstd::istringstream os(expression.substr( curr, next-curr ).c_str());\n\t\t\tdouble value;\n\n\t\t\tos >> value;\n\t\t\tif( os.fail() )\n\t\t\t\treturn false;\n\n\t\t\tm_tokens.push_back( Node( value ) );\n\n\t\t\tmode = Operator::BINARY;\n\t\t}\n\t\telse if( ')' == expression[curr] )\n\t\t{\n\t\t\tif( !flushParenthesis() )\n\t\t\t\treturn false;\n\t\t\tmode = Operator::BINARY;\n\t\t}\n\t\telse if( '(' == expression[curr] )\n\t\t{\n\t\t\tm_stack.push( &ms_opParenthesis );\n\t\t\tmode = Operator::UNARY;\n\t\t}\n\t\telse if( ' ' != expression[curr] )\n\t\t{\n\t\t\t// operator\n\n\t\t\tOperator* lastMatch = NULL;\n\n\t\t\tfor( next = curr; next < expression.length(); next++ )\n\t\t\t{\n\t\t\t\tconst OperatorEntry* activeOperators = ms_operators;\n\t\t\t\tconst OperatorEntry* customOperators = m_customOperators;\n\n\t\t\t\tconst OperatorEntry* currEntry;\n\t\t\t\tdo\n\t\t\t\t{\n\t\t\t\t\tfor( currEntry = activeOperators; currEntry->m_operator; currEntry++ )\n\t\t\t\t\t{\n\t\t\t\t\t\tif( !expression.compare( curr, (next-curr)+1, currEntry->m_operator->name(), 0, (next-curr)+1 ) && (currEntry->m_mode & mode) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlastMatch = currEntry->m_operator;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tactiveOperators = customOperators;\n\t\t\t\t\tcustomOperators = NULL;\n\t\t\t\t}\n\t\t\t\twhile( activeOperators && !currEntry->m_operator );\n\n\t\t\t\tif( !currEntry->m_operator )\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\t\tif( !lastMatch || expression.compare( curr, lastMatch->name().length(), lastMatch->name() ) )\n\t\t\t\treturn false;\n\n\t\t\tpushOperator( lastMatch );\n\t\t\tmode = Operator::UNARY;\n\t\t}\n\t}\n\n\t// apply remaining operators\n\n\twhile( !m_stack.empty() )\n\t{\n\t\tOperator* op = m_stack.top();\n\t\tm_stack.pop();\n\n\t\t// unbalanced parentheses?\n\t\tif( op == &ms_opParenthesis )\n\t\t\treturn false;\n\n\t\tm_tokens.push_back( Node( op ) );\n\t}\n\n\treturn true;\n}\n\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nbool Expression::solve()\n{\n\tstd::stack<double> arguments;\n\n\tfor( std::vector<Node>::iterator i = m_tokens.begin(); i != m_tokens.end(); ++i )\n\t{\n\t\tNode& node = (*i);\n\n\t\tif( node.type() == Node::OPERAND )\n\t\t{\n\t\t\targuments.push( node.value() );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tOperator* op = node.op();\n\t\t\tassert( op );\n\n\t\t\tif( arguments.size() < op->parameters() )\n\t\t\t\treturn false;\n\n\t\t\targuments.push( op->execute( arguments ) );\n\t\t}\n\t}\n\n\tif( arguments.size() != 1 )\n\t\treturn false;\n\n\tm_result = arguments.top();\n\n\treturn true;\n}\n\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\nbool Expression::flushParenthesis()\n{\n\twhile( !m_stack.empty() )\n\t{\n\t\tOperator* op = m_stack.top();\n\t\tm_stack.pop();\n\n\t\tif( op == &ms_opParenthesis )\n\t\t\treturn true;\n\n\t\tm_tokens.push_back( Node( op ) );\n\t}\n\n\treturn false;\n}\n\n///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>n = gets.to_i\nw = gets.split.map(&:to_i)\nans = (n-1).times.map {|i| w[0..i].inject(:+) - w[i+1..n].inject(:+)}.map{|n| n.abs}\np ans.min</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>/*\n * Copyright 2000-2009 JetBrains s.r.o.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage git4idea.commands;\n\nimport com.intellij.openapi.diagnostic.Logger;\nimport com.intellij.openapi.progress.ProgressIndicator;\nimport com.intellij.openapi.progress.ProgressManager;\nimport com.intellij.openapi.progress.Task;\nimport com.intellij.openapi.util.Key;\nimport com.intellij.openapi.vcs.VcsException;\nimport com.intellij.openapi.vfs.VirtualFile;\nimport git4idea.i18n.GitBundle;\nimport git4idea.util.GitUIUtil;\nimport org.jetbrains.annotations.NonNls;\nimport org.jetbrains.annotations.NotNull;\nimport org.jetbrains.annotations.Nullable;\n\nimport java.awt.EventQueue;\nimport java.util.Collection;\n\n/**\n * Handler utilities that allow running handlers with progress indicators\n */\npublic class GitHandlerUtil {\n /**\n * The logger instance\n */\n private static final Logger LOG = Logger.getInstance(GitHandlerUtil.class.getName());\n\n /**\n * a private constructor for utility class\n */\n private GitHandlerUtil() {\n }\n\n /**\n * Execute simple process synchronously with progress\n *\n * @param handler a handler</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>a,b =map(int,input().split())\ns = input()\n\nif str.isnumeric(s[:a]) and \\\n str.isnumeric(s[a+1:a+b+1]) and \\\n s[a]=='-': \n print('Yes')\nelse:\n print('No')</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>module Deface\n module Actions\n class SetAttributes < AttributeAction\n def execute_for_attribute(target_element, name, value)\n target_element.remove_attribute(name)\n target_element.remove_attribute(\"data-erb-#{name}\")\n\n target_element.set_attribute(\"data-erb-#{name}\", value.to_s)\n end\n end\n end\nend\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_># Copyright 2011 OpenStack Foundation\n# Copyright 2011 Grid Dynamics\n# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\nimport webob\n\nfrom nova.api.openstack import common\nfrom nova.api.openstack.compute.schemas.v3 import console_output\nfrom nova.api.openstack import extensions\nfrom nova.api.openstack import wsgi\nfrom nova.api import validation\nfrom nova import compute\nfrom nova import exception\nfrom nova.i18n import _\n\nALIAS = \"os-console-output\"\nauthorize = extensions.extension_authorizer('compute', \"v3:\" + ALIAS)\n\n\nclass ConsoleOutputController(wsgi.Controller):\n def __init__(self, *args, **kwargs):\n super(ConsoleOutputController, self).__init__(*args, **kwargs)\n self.compute_api = compute.API()\n\n @extensions.expected_errors((400, 404, 409, 501))\n @wsgi.action('get_console_output')\n @validation.schema(console_output.get_console_output)\n def get_console_output(self, req, id, body):\n \"\"\"Get text console output.\"\"\"\n context = req.environ['nova.context']\n authorize(context)\n\n instance = common.get_instance(self.compute_api, context, id,\n want_objects=True)\n length = body['get_console_output'].get('length')\n if length is not None and int(length) == -1:\n # NOTE: -1 means an unlimited length. So here translates it to None\n # which also means an unlimited in the internal implementation.\n length = None\n\n try:\n output = self.compute_api.get_console_output(context,\n instance,\n length)\n except exception.InstanceNotReady as e:\n raise webob.exc.HTTPConflict(explanation=e.format_message())\n except NotImplementedError:\n msg = _(\"Unable to get console log, functionality not implemented\")\n raise webob.exc.HTTPNotImplemented(explanation=msg)\n\n return {'output': output}\n\n\nclass ConsoleOutput(extensions.V3APIExtensionBase):\n \"\"\"Console log output support, with tailing ability.\"\"\"\n\n name = \"ConsoleOutput\"\n alias = ALIAS\n version = 1\n\n def get_controller_extensions(self):\n controller = ConsoleOutputController()\n extension = extensions.ControllerExtension(self, 'servers', controller)\n return [extension]\n\n def get_resources(self):\n return []\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>/** @file\n\n A brief file description\n\n @section license License\n\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See the NOTICE file\n distributed with this work for additional information\n regarding copyright ownership. The ASF licenses this file\n to you under the Apache License, Version 2.0 (the\n \"License\"); you may not use this file except in compliance\n with the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n */\n\n/****************************************************************************\n \n ink_string.c\n \n String and text processing routines for libinktomi.a.\n \n ****************************************************************************/\n\n#include <assert.h>\n#include <stdarg.h>\n#include <stdlib.h></code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Dockerfile_># AUTOGENERATED FILE\nFROM balenalib/artik5-fedora:26-run\n\nENV NODE_VERSION 6.16.0\nENV YARN_VERSION 1.12.3\n\nRUN for key in \\\n\t6A010C5166006599AA17F08146C2130DFD2497F5 \\\n\t; do \\\n\t\tgpg --keyserver pgp.mit.edu --recv-keys \"$key\" || \\\n\t\tgpg --keyserver keyserver.pgp.com --recv-keys \"$key\" || \\</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>from numpy import zeros\n \nN = int(input())\nA = zeros((10,10))\n \nfor i in range(1,N+1):\n a = int(str(i)[0])\n b = int(str(i)[-1])\n A[a][b] += 1\n \ncnt = 0\nfor _ in range(1,N+1):\n a = int(str(_)[0])\n b = int(str(_)[-1])\n cnt += A[b][a]\n \nprint(cnt)</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_PHP_> protected $fillable = MenuContract::FILLABLE;\n\n public function organization()\n {\n return $this->belongsTo(Organization::class,MenuContract::ORGANIZATION_ID,MenuContract::ID);\n }\n\n public function setImageAttribute($value)\n {\n $disk = config('backpack.base.root_disk_name');\n $destination_path = 'public/uploads';\n if (is_null($value)) {\n Storage::disk($disk)->delete($this->{MenuContract::IMAGE});\n $this->attributes[MenuContract::IMAGE] = null;\n }\n if (Str::startsWith($value, 'data:image'))\n {\n $image = Image::make($value)->encode('jpg', 90);\n $filename = md5($value.time()).'.jpg';\n Storage::disk($disk)->put($destination_path.'/'.$filename, $image->stream());\n Storage::disk($disk)->delete($this->{MenuContract::IMAGE});\n $public_destination_path = Str::replaceFirst('public/', '', $destination_path);\n $this->attributes[MenuContract::IMAGE] = '/'.$public_destination_path.'/'.$filename;\n }\n }\n\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>#include <stdio.h>\n#include <stdbool.h>\n#include <unistd.h>\n#pragma GCC optimize (\"O3\")\n\ninline static long gl(void){\n long x = 0;\n for(;;){\n unsigned int c = getchar_unlocked() - 48;\n if(c < 10){\n x = x*10 + c;\n }else{\n break;\n }\n }\n return x;\n}\n\ninline static void pl(unsigned int s){\n char str[10];\n int pos=9;\n if(s==0){\n putchar_unlocked('0');\n return;\n }\n str[pos] = '\\n';\n do{\n pos--;\n str[pos]=s%10+48;\n s/=10;\n }while(s!=0);\n write(1, str+pos, 10-pos);\n}\n\ninline static int sp(unsigned char* str, unsigned short i){\n if(i>99){\n str[2] = i%10+48; i/=10;\n str[1] = i%10+48;\n str[0] = i/10+48;\n return 3;\n }else if(i>9){\n str[1] = i%10+48;\n str[0] = i/10+48;\n return 2;\n }else{\n str[0] = i+48;\n return 1;\n }\n}\n\nunsigned char a[1000];\nunsigned char buffer[8*1024*1024];\n\nint main(void){\n const unsigned long h=gl(), w=gl();\n unsigned long p=0, pos=0;\n {\n bool haveCoin = false;\n unsigned short old_y, old_x;\n for(unsigned long i=1; i<=h; i++){\n fread(a, 1, 2*w, stdin);\n if(i%2==1){\n for(unsigned long j=1; j<=w; j++){\n if(haveCoin){\n pos++;\n p += sp(buffer+p, old_y)+1; buffer[p-1] = ' '; \n p += sp(buffer+p, old_x)+1; buffer[p-1] = ' '; \n p += sp(buffer+p, i)+1; buffer[p-1] = ' '; \n p += sp(buffer+p, j)+1; buffer[p-1] = '\\n';\n }\n haveCoin = a[2*(j-1)]&1 ? !haveCoin : haveCoin;\n old_y = i;\n old_x = j;\n }\n }else{\n for(long j=w; j>0; j--){\n if(haveCoin){\n pos++;\n p += sp(buffer+p, old_y)+1; buffer[p-1] = ' '; \n p += sp(buffer+p, old_x)+1; buffer[p-1] = ' '; \n p += sp(buffer+p, i)+1; buffer[p-1] = ' '; \n p += sp(buffer+p, j)+1; buffer[p-1] = '\\n';\n }\n haveCoin = a[2*(j-1)]&1 ? !haveCoin : haveCoin;\n old_y = i;\n old_x = j;\n }\n }\n }\n }\n pl(pos);\n write(1, buffer, p);\n return 0;\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>\"\"\"\nWSGI config for zenatix project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/\n\"\"\"\n\nimport os\n\nfrom django.core.wsgi import get_wsgi_application\n\nos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'zenatix.settings')\n\napplication = get_wsgi_application()\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Go_>package vfs\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"sync\"\n\n\t\"github.com/beyondstorage/go-storage/v4/types\"\n\t\"github.com/panjf2000/ants/v2\"\n\t\"go.uber.org/zap\"\n)\n\ntype op struct {\n\tfd uint64\n\tsize int64\n}\n\ntype chunk struct {\n\tlock sync.Mutex\n\twg *sync.WaitGroup\n\n\t// The path for the chunk.\n\tfd uint64\n\tpath string\n\tpersistedIdx uint64\n\tpersistedSize int64\n\tnextIdx uint64\n\tcurrentSize int64\n\n\t// If we have CreateMultipart or CreateAppend, we will store the object here.\n\t// So we can check if object == nil to decide use CompleteMultipart or call Write.\n\tobject *types.Object\n\n\t// Only valid if we have already called CreateMultipart.\n\tparts map[int]*types.Part\n\tnextPartNumber int\n}\n\nfunc newChunk(fd uint64, path string) *chunk {\n\treturn &chunk{\n\t\twg: &sync.WaitGroup{},</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Rust_>fn main() {\n\n let lines = [\"day of Christmas my true love sent to me\",\n \"Twelve drummers drumming,\",\n \"Eleven pipers piping,\",\n \"Ten lords a-leaping,\",\n \"Nine ladies dancing,\",\n \"Eight maids a-milking,\",\n \"Seven swans a-swimming,\",\n \"Six geese a-laying,\",\n \"Five golden rings...,\",\n \"Four calling birds,\",\n \"Three french hens,\",\n \"Two turtle doves, and\",\n \"A partridge in a pear tree.\"];\n\n let days = [\"zeroth\", \"first\", \"second\", \"third\", \"forth\", \"fifth\", \"sixth\",\n \"seventh\", \"eighth\", \"ninth\", \"tenth\", \"eleventh\", \"twelfth\"];\n\n for ii in 1..13 {\n if ii != 1 { println!(); }\n println!(\"On the {} {}\", days[ii], lines[0]);\n for jj in (13 - ii)..13 {\n println!(\"{}\", lines[jj]);\n }\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Go_>package linux\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/k0sproject/k0sctl/configurer\"\n\t\"github.com/k0sproject/rig\"\n\t\"github.com/k0sproject/rig/os\"\n\t\"github.com/k0sproject/rig/os/registry\"\n)\n\n// Slackware provides OS support for Slackware Linux\ntype Slackware struct {\n\tBaseLinux\n\tos.Linux\n}\n\nfunc init() {\n\tregistry.RegisterOSModule(\n\t\tfunc(os rig.OSVersion) bool {\n\t\t\treturn os.ID == \"slackware\"\n\t\t},\n\t\tfunc() interface{} {\n\t\t\tlinuxType := &Slackware{}\n\t\t\tlinuxType.PathFuncs = interface{}(linuxType).(configurer.PathFuncs)\n\t\t\treturn linuxType\n\t\t},\n\t)\n}\n\n// InstallPackage installs packages via slackpkg\nfunc (l Slackware) InstallPackage(h os.Host, pkg ...string) error {\n\tupdatecmd, err := h.Sudo(\"slackpkg update\")\n\tif err != nil {\n\t\treturn err\n\t}\n\tinstallcmd, err := h.Sudo(fmt.Sprintf(\"slackpkg install --priority ADD %s\", strings.Join(pkg, \" \")))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn h.Execf(\"%s && %s\", updatecmd, installcmd)\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_CSS_>* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nhtml {\n font-family: \"Roboto\", \"Noto Sans\", \"Helvetica\", sans-serif;\n font-size: 14px;\n background-color: #3498DB;\n height: 100%;\n}\n\n.calculator {\n width: 350px;\n height: auto;\n margin: 70px auto 0;\n overflow: hidden;\n box-shadow: 4px 4px rgba(0, 0, 0, 0.2);\n}\n\n.calculator span {\n -moz-user-select: none;\n user-select: none;\n}\n\n.top {\n position: relative;\n height: 150px;\n background-color: white;\n}\n\n.top .unit {\n text-transform: uppercase;\n position: absolute;\n top: 10px;\n left: 10px;\n font-weight: 700;\n color: #757575;\n}\n\n.top .screen {\n position: relative;\n width: 100%;\n top: 20%;\n height: 80%;\n}\n\n.screen > div {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n width: 100%;\n padding: 5px;\n text-align: right;\n}\n\n.screen .input {\n color: #757575;\n height: 60%;\n font-size: 35px;\n}\n\n.screen .result {\n color: #9e9e9e;\n font-size: 20px;\n height: 40%;\n}\n\n.bottom {\n background-color: #2D2D2D;\n height: 300px;\n color: #fff;\n cursor: pointer;\n}\n\n.bottom section {\n position: relative;\n height: 100%;\n float: left;\n display: flex;\n}\n\n.keys {\n width: 80%;\n}\n\n\n.keys .column {\n display: flex;\n flex-grow: 1;\n}\n\n.keys .column, .operators {\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.keys .column span, .operators span {\n position: relative;\n overflow: hidden;\n flex-grow: 1;\n width: 100%;\n line-height: 1;\n padding: 10px;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.5s;\n}\n\n.keys .column span {\n font-size: 25px;\n}\n\n.keys .column span:hover, .operators span:hover {\n background-color: rgba(0, 0, 0, 0.2);\n}\n\n.operators {\n width: 20%;\n font-size: 18px;\n background-color: #434343;\n}\n\n.delete {\n font-size: 16px;\n text-transform: uppercase;\n}\n\n.credit {\n display: block;\n text-align: center;\n width: 100%;\n position: absolute;\n bottom: 20px;\n margin: 0 auto;\n}\n\n.credit a, .error {\n color: #C2185B;\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>\n # Create 5 subfiles\n for i in xrange(0, 5):\n open(self.temp_dir + \"/subfolder\" + '/file_' + str(i), 'a').close()\n\n def tearDown(self):\n shutil.rmtree(self.temp_dir)\n\n def test_directory_metrics(self):\n \"\"\"\n Directory metric coverage\n \"\"\"\n config_stubs = self.get_config_stubs(self.temp_dir)\n countonly_stubs = self.get_config_stubs(self.temp_dir)\n\n # Try all the configurations in countonly mode as well\n for stub in countonly_stubs:\n stub['countonly'] = True\n\n config = {\n 'instances': config_stubs + countonly_stubs\n }\n\n self.run_check(config)\n\n for config in config_stubs:\n dirtagname = config.get('dirtagname', \"name\")\n name = config.get('name', self.temp_dir)\n dir_tags = [dirtagname + \":%s\" % name]\n\n # Directory metrics\n for mname in (self.DIRECTORY_METRICS + self.COMMON_METRICS):\n self.assertMetric(mname, tags=dir_tags, count=1)\n\n # 'recursive' and 'pattern' parameters\n if config.get('pattern') == \"*.log\":\n # 2 '*.log' files in 'temp_dir'\n self.assertMetric(\"system.disk.directory.files\", tags=dir_tags, count=1, value=2)\n elif config.get('pattern') == \"file_*\":\n # 10 'file_*' files in 'temp_dir'\n self.assertMetric(\"system.disk.directory.files\", tags=dir_tags, count=1, value=10)\n elif config.get('recursive'):\n # 12 files in 'temp_dir' + 5 files in 'tempdir/subfolder'\n self.assertMetric(\"system.disk.directory.files\", tags=dir_tags, count=1, value=17)\n else:\n # 12 files in 'temp_dir'\n self.assertMetric(\"system.disk.directory.files\", tags=dir_tags, count=1, value=12)\n\n # Raises when coverage < 100%\n self.coverage_report()\n\n def test_file_metrics(self):\n \"\"\"\n File metric coverage\n \"\"\"\n config_stubs = self.get_config_stubs(self.temp_dir, filegauges=True)\n\n config = {\n 'instances': config_stubs\n }\n\n self.run_check(config)\n\n for config in config_stubs:\n dirtagname = config.get('dirtagname', \"name\")\n name = config.get('name', self.temp_dir)\n filetagname = config.get('filetagname', \"filename\")\n dir_tags = [dirtagname + \":%s\" % name]\n\n # File metrics\n for mname in self.FILE_METRICS:\n if config.get('pattern') != \"file_*\":\n # 2 '*.log' files in 'temp_dir'\n for i in xrange(1, 3):\n file_tag = [filetagname + \":%s\" % os.path.normpath(self.temp_dir + \"/log_\" + str(i) + \".log\")]\n self.assertMetric(mname, tags=dir_tags + file_tag, count=1)\n\n if config.get('pattern') != \"*.log\":\n # Files in 'temp_dir'\n for i in xrange(0, 10):\n file_tag = [filetagname + \":%s\" % os.path.normpath(self.temp_dir + \"/file_\" + str(i))]\n self.assertMetric(mname, tags=dir_tags + file_tag, count=1)\n\n if not config.get('pattern'):\n # Files in 'temp_dir/subfolder'\n if config.get('recursive'):\n for i in xrange(0, 5):\n file_tag = [filetagname + \":%s\" % os.path.normpath(self.temp_dir + \"/subfolder\" + \"/file_\" + str(i))]\n self.assertMetric(mname, tags=dir_tags + file_tag, count=1)\n\n # Common metrics\n for mname in self.COMMON_METRICS:\n self.assertMetric(mname, tags=dir_tags, count=1)\n\n # Raises when coverage < 100%\n self.coverage_report()\n\n def test_non_existent_directory(self):\n \"\"\"\n Missing or inaccessible directory coverage.\n \"\"\"\n config = {'instances': [{'directory': '/non-existent/directory'}]}\n self.assertRaises(Exception, lambda: self.run_check(config))\n\n def test_non_existent_directory_ignore_missing(self):\n config = {\n 'instances': [\n {'directory': '/non-existent/directory',\n 'ignore_missing': True}\n ]\n }\n self.run_check(config)\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_TypeScript_> left: {\n type: 'Identifier',\n name: 'x',\n },\n right: {\n type: 'NumericLiteral',\n value: 10,\n },\n },\n body: {\n type: 'BlockStatement',\n body: [\n {\n type: 'ExpressionStatement',\n expression: {\n type: 'AssignmentExpression',\n operator: '-=',\n left: {\n type: 'Identifier',\n name: 'x',\n },\n right: {\n type: 'NumericLiteral',\n value: 1,\n },\n },\n },\n ],\n },\n },\n ],\n },\n );\n};</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>/*\r\n * Ext JS Library 2.2\r\n * Copyright(c) 2006-2008, Ext JS, LLC.\r\n * [email protected]\r\n * \r\n * http://extjs.com/license\r\n */\r\n\r\nExt.onReady(function(){\n\n var ds = new Ext.data.Store({\n proxy: new Ext.data.ScriptTagProxy({\n url: 'http://extjs.com/forum/topics-remote.php'\n }),\n reader: new Ext.data.JsonReader({\n root: 'topics',\n totalProperty: 'totalCount',\n id: 'post_id'\n }, [\n {name: 'title', mapping: 'topic_title'},\n {name: 'topicId', mapping: 'topic_id'},\n {name: 'author', mapping: 'author'},\n {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},\n {name: 'excerpt', mapping: 'post_text'}\n ])\n });\n\n // Custom rendering Template\n var resultTpl = new Ext.XTemplate(\n '<tpl for=\".\"><div class=\"search-item\">',\n '<h3><span>{lastPost:date(\"M j, Y\")}<br />by {author}</span>{title}</h3>',\n '{excerpt}',\n '</div></tpl>'\n );\n \n var search = new Ext.form.ComboBox({\n store: ds,\n displayField:'title',\n typeAhead: false,\n loadingText: 'Searching...',\n width: 570,\n pageSize:10,\n hideTrigger:true,\n tpl: resultTpl,\n applyTo: 'search',\n itemSelector: 'div.search-item',\n onSelect: function(record){ // override default onSelect to do redirect\n window.location =\n String.format('http://extjs.com/forum/showthread.php?t={0}&p={1}', record.data.topicId, record.id);\n }\n });\n});</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_TypeScript_>import { Injectable } from \"@nestjs/common\";\nimport { User } from \"../../entities/User\";\nimport { GenericService } from \"../../util/generic/generic.service\";\nimport { UserRepository } from \"../../repository/user.repository\";\nimport { ChangePasswordDto } from \"../../dto/ChangePasswordDto\";\n\n@Injectable()\nexport class UserService extends GenericService<User> {\n constructor(private userRepository: UserRepository) {\n super(userRepository, []);\n }\n\n async changePassword(changePasswordDto: ChangePasswordDto): Promise<void> {\n await this.userRepository.update(changePasswordDto.username, {\n password: changePasswordDto.password,\n });\n }\n\n async findByUsername(username: string): Promise<User> {\n return await this.userRepository.findOne({ username });\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>#define hp48_green_gx_width 29\n#define hp48_green_gx_height 57\nstatic unsigned char hp48_green_gx_bits[] = {\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e,\n 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00};\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_># Alfresco Enterprise ACS Deployment AWS\n# Copyright (C) 2005 - 2018 Alfresco Software Limited\n# License rights for this program may be obtained from Alfresco Software, Ltd.\n# pursuant to a written agreement and any use of this program without such an\n# agreement is prohibited.\n\nBastion = attribute('BastionInstanceName', default: '', description: 'K8s BastionInstanceName')\nS3BucketName = attribute('S3BucketName', default: '', description: 'K8s S3BucketName')\n\ndescribe aws_ec2_instance(name: Bastion) do\n it { should be_running }\nend\n\ndescribe aws_s3_bucket(bucket_name: S3BucketName) do\n it { should exist }\n it { should_not be_public }\nend</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>/*\n* This header is generated by classdump-dyld 1.0\n* on Sunday, September 27, 2020 at 11:52:27 AM Mountain Standard Time\n* Operating System: Version 14.0 (Build 18A373)\n* Image Source: /System/Library/PrivateFrameworks/CloudKitDaemon.framework/CloudKitDaemon\n* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.\n*/\n\n#import <CloudKitDaemon/CloudKitDaemon-Structs.h>\n#import <ProtocolBuffer/PBCodable.h>\n#import <libobjc.A.dylib/NSCopying.h>\n\n@class CKDPRecord;\n\n@interface CKDPUserRetrieveResponse : PBCodable <NSCopying> {\n\n\tCKDPRecord* _user;\n\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_SQL_>use VipunenTK_SA\ngo\n\nDROP TABLE VipunenTK_DW.dbo.[_sa_K3_9_Tutk_suor_osuus_aloittaneista_toinen_aste_nykytila]\n\nSelect top 0 * into VipunenTK_DW.dbo.[_sa_K3_9_Tutk_suor_osuus_aloittaneista_toinen_aste_nykytila] \nfrom VipunenTK_SA.dbo.[v_sa_K3_9_Tutk_suor_osuus_aloittaneista_toinen_aste_nykytila]\n\ngo</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_> self.tester.cleanup_artifacts()\n self.tester.delete_keypair(self.keypair)\n self.tester.local(\"rm \" + self.keypair.name + \".pem\")\n shutil.rmtree(self.tester.credpath)\n\n def runSysCmd(self, cmd):\n self.source = 'export EUCALYPTUS=' + self.tester.eucapath + \" && source \" + self.tester.credpath + \"/eucarc && \" + self.tester.eucapath + \"/usr/sbin/\"\n self.out = self.tester.sys(self.source + cmd)\n\n def doAuth(self):\n self.keypair = self.tester.add_keypair()\n self.group = self.tester.add_group()\n self.tester.authorize_group(self.group)\n\n def test(self):\n self.clc_ip = str(self.tester.clc.hostname)\n os.system('scp euca5876.lic root@' + self.clc_ip + ':euca5876.lic')\n self.runSysCmd('euca-modify-property --property-to-reset authentication.ldap_integration_configuration')\n self.runSysCmd('euca-lictool --password password --custom euca5876.lic --out euca5876.lic --nocomment')\n self.runSysCmd('euca-modify-property -f authentication.ldap_integration_configuration=euca5876.lic')\n # Wait for LDAP to sync\n self.tester.sleep(20)\n # Count the numbers of access in the euca5876 group and make sure it is over 100\n self.out = str(self.tester.sys('euare-grouplistusers -g euca5876 --as-account account-euca5876')).count('arn:aws:iam::')\n print self.OK + 'Number of access created = ' + str(self.out) + self.ENDC\n assert self.out > 100\nif __name__ == \"__main__\":\n unittest.main()</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>package cz.cuni.gamedev.nail123.roguelike.entities.enemies\n\nimport cz.cuni.gamedev.nail123.roguelike.entities.attributes.HasSmell\nimport cz.cuni.gamedev.nail123.roguelike.entities.items.Sword\nimport cz.cuni.gamedev.nail123.roguelike.mechanics.Pathfinding\nimport cz.cuni.gamedev.nail123.roguelike.mechanics.goBlindlyTowards\nimport cz.cuni.gamedev.nail123.roguelike.tiles.GameTiles\n\nclass Rat: Enemy(GameTiles.RAT), HasSmell {\n override val blocksMovement = true\n override val blocksVision = false\n override val smellingRadius = 7\n\n override val maxHitpoints = 10\n override var hitpoints = 6\n override var attack = 3\n override var defense = 0\n\n override fun update() {\n if (Pathfinding.chebyshev(position, area.player.position) <= smellingRadius) {\n goBlindlyTowards(area.player.position)\n }\n }\n\n override fun die() {\n super.die()\n // Drop a sword\n this.block.entities.add(Sword(2))\n }\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>#!/usr/bin/env python\n\"\"\"\nClient code for server setup for nlp.\nScript will connect to the server that we setup to reduce the nlp time stuff.\n\"\"\"\n\nimport csv\nimport requests\n\ndef send__receive_data(new_Qs, old_Qs):\n stuff_to_give = {\"new_ques\": new_Qs, \"old_ques\": old_Qs}\n\n res = requests.post('https://nlp-hosty.appspot.com/receive', json=stuff_to_give, verify=False)\n if res.ok:\n return res.json()\n else:\n print(res.reason)\n\nif __name__ == \"__main__\":\n old = []\n new = []\n with open('Q & A - Haobo.csv') as test_att_csv:\n csv_reader = csv.reader(test_att_csv, delimiter=',')\n for row in csv_reader:\n old.append(row)\n with open('test_att.csv') as turdy:\n csv_reader = csv.reader(turdy, delimiter=',')\n for row in csv_reader:\n new.append(row)\n try:\n print(send__receive_data(new, old))\n\n\n except ConnectionRefusedError:\n print(\"CHECK IF SERVER IS RUNNING !!\")\n\n print(\"Run complete\")\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>model9_overlaps = pd.read_csv(os.path.join('../run_13_fcResVGG16_092120/results', 'overlapratios', 'cfold_ratios.csv'))\n\nfig, ax = plt.subplots(num=None, figsize=(15, 12), facecolor='w', edgecolor='k')\nsns.lineplot(x=\"fold\", y=\"overlap_ratio\", data=model1_overlaps, label=\"2D shallow CRNN + Spectrogram input\", legend=\"brief\", err_style=\"bars\", ax=ax)\nsns.lineplot(x=\"fold\", y=\"overlap_ratio\", data=model2_overlaps, label=\"1D shallow CRNN + Raw signals input\", legend=\"brief\", err_style=\"bars\", ax=ax)\nsns.lineplot(x=\"fold\", y=\"overlap_ratio\", data=model3_overlaps, label=\"5-layer NN + Spectrogram input\", legend=\"brief\", err_style=\"bars\", ax=ax)\nplt.ylim(-0.3,1.2)\nplt.xlabel(\"Fold\", fontsize='xx-large')\nplt.ylabel(\"Overlap Ratio\", fontsize='xx-large')\nplt.legend(loc=1, fontsize='x-large')\nax.xaxis.grid(False)\nplt.savefig(os.path.join(voutput_prepath, 'testing_overlapping_full.png'), format='png', dpi=600, bbox_inches='tight')\nplt.show()</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>#include <bits/stdc++.h>\n#include <array>\nusing namespace std;\n#define len(_x) (sizeof((_x)) / sizeof(_x)[0])\n#define ll long long\n#define fastIO ios_base::sync_with_stdio(false); cin.tie(0); \n#define iT(_t,_x) _t _x;std::cin >> _x; \n#define iInt(_x) int _x;in(_x); \n#define ill(_x) ll _x;in(_x); \ntemplate<typename T> void in(T &x) { x = 0; bool neg = false; register T c = getchar(); if (c == '-')neg = true, c = getchar(); while ((c < 48) || (c > 57))c = getchar(); for (; c < 48 || c > 57; c = getchar()); for (; c > 47 && c < 58; c = getchar())x = (x << 3) + (x << 1) + (c & 15); if (neg) x *= -1; }\n\n\n\nint main() {\n\tiInt(n);\n\tll sum = 0;\n\twhile (n--)\n\t{\n\t\tint a, b;\n\t\tstd::cin >> a >> b;\n\t\tsum += b - a + 1;\n\t}\n\tstd::cout << sum;\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C++_>#include <iostream>\n#include <algorithm>\n#include <vector>\nusing namespace std;\nint main(){\n int n;\n cin >> n;\n vector<int> u(n);\n vector<int> d(n);\n int i,j;\n for(i=0;i<n;i++) cin >> u[i];\n for(i=0;i<n;i++) cin >> d[i];\n int max = 0;\n for(i=0;i<n;i++){\n int uu = 0;\n int dd = 0;\n for(j=0;j<=i;j++) uu += u[j];\n for(j=i;j<n;j++) dd += d[j];\n if(max<uu+dd) max = uu+dd;\n }\n cout << max << \"\\n\";\n return 0;\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>import asyncio\n\nimport h2\nimport h11\nimport pytest\nimport wsproto\n\nfrom hypercorn.asyncio.tcp_server import TCPServer\nfrom hypercorn.config import Config\nfrom .helpers import MemoryReader, MemoryWriter\nfrom ..helpers import SANITY_BODY, sanity_framework\n\n\[email protected]\nasync def test_http1_request(event_loop: asyncio.AbstractEventLoop) -> None:\n server = TCPServer(\n sanity_framework, event_loop, Config(), MemoryReader(), MemoryWriter() # type: ignore\n )\n asyncio.ensure_future(server.run())\n client = h11.Connection(h11.CLIENT)\n await server.reader.send( # type: ignore\n client.send(\n h11.Request(\n method=\"POST\",\n target=\"/\",\n headers=[\n (b\"host\", b\"hypercorn\"),\n (b\"connection\", b\"close\"),\n (b\"content-length\", b\"%d\" % len(SANITY_BODY)),\n ],\n )\n )\n )\n await server.reader.send(client.send(h11.Data(data=SANITY_BODY))) # type: ignore\n await server.reader.send(client.send(h11.EndOfMessage())) # type: ignore\n events = []\n while True:\n event = client.next_event()\n if event == h11.NEED_DATA:\n data = await server.writer.receive() # type: ignore\n client.receive_data(data)\n elif isinstance(event, h11.ConnectionClosed):\n break\n else:\n events.append(event)\n\n assert events == [\n h11.Response(\n status_code=200,\n headers=[\n (b\"content-length\", b\"15\"),\n (b\"date\", b\"Thu, 01 Jan 1970 01:23:20 GMT\"),\n (b\"server\", b\"hypercorn-h11\"),\n (b\"connection\", b\"close\"),\n ],\n http_version=b\"1.1\",\n reason=b\"\",\n ),\n h11.Data(data=b\"Hello & Goodbye\"),\n h11.EndOfMessage(headers=[]),\n ]\n\n\[email protected]\nasync def test_http1_websocket(event_loop: asyncio.AbstractEventLoop) -> None:\n server = TCPServer(\n sanity_framework, event_loop, Config(), MemoryReader(), MemoryWriter() # type: ignore\n )\n asyncio.ensure_future(server.run())\n client = wsproto.WSConnection(wsproto.ConnectionType.CLIENT)\n await server.reader.send( # type: ignore\n client.send(wsproto.events.Request(host=\"hypercorn\", target=\"/\"))\n )\n client.receive_data(await server.writer.receive()) # type: ignore\n assert list(client.events()) == [\n wsproto.events.AcceptConnection(\n extra_headers=[\n (b\"date\", b\"Thu, 01 Jan 1970 01:23:20 GMT\"),\n (b\"server\", b\"hypercorn-h11\"),\n ]\n )\n ]\n await server.reader.send( # type: ignore\n client.send(wsproto.events.BytesMessage(data=SANITY_BODY))\n )\n client.receive_data(await server.writer.receive()) # type: ignore\n assert list(client.events()) == [wsproto.events.TextMessage(data=\"Hello & Goodbye\")]\n await server.reader.send(client.send(wsproto.events.CloseConnection(code=1000))) # type: ignore\n client.receive_data(await server.writer.receive()) # type: ignore\n assert list(client.events()) == [wsproto.events.CloseConnection(code=1000, reason=\"\")]\n assert server.writer.is_closed # type: ignore\n\n\[email protected]\nasync def test_http2_request(event_loop: asyncio.AbstractEventLoop) -> None:\n server = TCPServer(\n sanity_framework,\n event_loop,\n Config(),\n MemoryReader(), # type: ignore\n MemoryWriter(http2=True), # type: ignore\n )\n asyncio.ensure_future(server.run())\n client = h2.connection.H2Connection()\n client.initiate_connection()\n await server.reader.send(client.data_to_send()) # type: ignore\n stream_id = client.get_next_available_stream_id()\n client.send_headers(\n stream_id,\n [\n (\":method\", \"POST\"),\n (\":path\", \"/\"),\n (\":authority\", \"hypercorn\"),\n (\":scheme\", \"https\"),\n (\"content-length\", \"%d\" % len(SANITY_BODY)),\n ],\n )\n client.send_data(stream_id, SANITY_BODY)\n client.end_stream(stream_id)\n await server.reader.send(client.data_to_send()) # type: ignore\n events = []\n open_ = True\n while open_:\n data = await server.writer.receive() # type: ignore\n if data == b\"\":\n open_ = False\n\n h2_events = client.receive_data(data)\n for event in h2_events:\n if isinstance(event, h2.events.DataReceived):\n client.acknowledge_received_data(event.flow_controlled_length, event.stream_id)\n elif isinstance(\n event,\n (h2.events.ConnectionTerminated, h2.events.StreamEnded, h2.events.StreamReset),\n ):\n open_ = False\n break\n else:\n events.append(event)\n await server.reader.send(client.data_to_send()) # type: ignore\n assert isinstance(events[2], h2.events.ResponseReceived)\n assert events[2].headers == [\n (b\":status\", b\"200\"),\n (b\"content-length\", b\"15\"),\n (b\"date\", b\"Thu, 01 Jan 1970 01:23:20 GMT\"),\n (b\"server\", b\"hypercorn-h2\"),\n ]\n\n\[email protected]\nasync def test_http2_websocket(event_loop: asyncio.AbstractEventLoop) -> None:\n server = TCPServer(\n sanity_framework,\n event_loop,\n Config(),\n MemoryReader(), # type: ignore\n MemoryWriter(http2=True), # type: ignore\n )\n asyncio.ensure_future(server.run())\n h2_client = h2.connection.H2Connection()\n h2_client.initiate_connection()\n await server.reader.send(h2_client.data_to_send()) # type: ignore\n stream_id = h2_client.get_next_available_stream_id()</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>package io.jvaas.dsl.html.attribute\n\n// generated by HtmlDslGenerator.kt\n\ninterface AttrSpan : Attr {\n\tvar span: String?\n\t\tget() = attributes[\"span\"]\n\t\tset(value) {\n\t\t\tvalue?.let {\n\t\t\t\tattributes[\"span\"] = it\n\t\t\t}\n\t\t}\n}\t\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Java_>package ru.job4j.dao;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport javax.persistence.EntityManager;\nimport javax.persistence.PersistenceContext;\nimport javax.persistence.TypedQuery;\nimport javax.persistence.criteria.CriteriaBuilder;\nimport javax.persistence.criteria.CriteriaQuery;\nimport javax.persistence.criteria.Predicate;\nimport javax.persistence.criteria.Root;\n\n\nimport ru.job4j.domain.Car;\nimport ru.job4j.domain.CarFilter;\n\npublic class CustomizedCarRepoImpl implements CustomizedCarRepo {\n\n\t@PersistenceContext\n private EntityManager em;\n\n\t@Override\n\tpublic List findByCarFilter(CarFilter filter) {\n\t\tList<Car> rst = new ArrayList<>();\n\t \n\t\tCriteriaBuilder builder = em.getCriteriaBuilder();\n CriteriaQuery<Car> query = builder.createQuery(Car.class);\n Root<Car> root = query.from(Car.class);\n List<Predicate> predicates = filter.getFilterList(builder, root);\n query.select(root).where(predicates.toArray(new Predicate[]{}));\n\t\tquery.orderBy(builder.asc(root.get(\"created\")));\n\t\trst = em.createQuery(query)\n \t\t.setFirstResult(filter.getPage() * filter.getMaxResultSize())\n \t\t.setMaxResults(filter.getMaxResultSize())\n \t\t.getResultList();\n\t\treturn rst;\n\t}\n\n\t@Override\n\tpublic Long getPagesCount(CarFilter filter) {\n\t\tLong result = 0L;\n\t\tCriteriaBuilder builder = em.getCriteriaBuilder();\n\t\tCriteriaQuery<Long> query = builder.createQuery(Long.class);\n\t\tRoot<Car> root = query.from(Car.class);\n\t\tCriteriaQuery<Long> select = query.select(builder.count(root));\n\t\tList<Predicate> predicates = filter.getFilterList(builder, root);\n\t\tselect.where(predicates.toArray(new Predicate[] {}));\n\t\tTypedQuery<Long> typedQuery = em.createQuery(select);\n\t\tLong rows = typedQuery.getSingleResult();\n\t\tint rowInPage = filter.getMaxResultSize();\n\t\tresult = rows % rowInPage > 0 ? (rows / rowInPage) + 1 : rows / rowInPage;\n\t\treturn result;\n\t}\n\t\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>x = int(input())\ny = int(input())\nz = int(input())\nprint(int((x+y)*z/2))\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>'use strict';\n\nfunction main(stdin) {\n const input = stdin.split('\\n');\n const N = Number(input.shift());\n const params = input.map(p => p.split(' ').map(v => parseInt(v, 10)));\n\n const A = params[0];\n const B = params[1];\n const C = params[2];\n \n let ans = 0;\n\n ans += B[A[0] - 1];\n\n A.reduce((a, b) => {\n ans += B[b - 1];\n if (b - a === 1) ans += C[a - 1];\n return b;\n });\n \n console.log(ans);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim());</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_TypeScript_>/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as nls from 'vs/nls';\nimport { IMenubarMenu, IMenubarMenuItemAction, IMenubarMenuItemSubmenu, IMenubarKeybinding, IMenubarService, IMenubarData, MenubarMenuItem } from 'vs/platform/menubar/common/menubar';\nimport { IMenuService, MenuId, IMenu, SubmenuItemAction } from 'vs/platform/actions/common/actions';\nimport { registerThemingParticipant, ITheme, ICssStyleCollector, IThemeService } from 'vs/platform/theme/common/themeService';\nimport { IWindowService, MenuBarVisibility, IWindowsService, getTitleBarStyle, URIType } from 'vs/platform/windows/common/windows';\nimport { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';\nimport { IAction, Action } from 'vs/base/common/actions';\nimport { Separator } from 'vs/base/browser/ui/actionbar/actionbar';\nimport * as DOM from 'vs/base/browser/dom';\nimport { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';\nimport { isMacintosh, isLinux } from 'vs/base/common/platform';\nimport { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';\nimport { Event, Emitter } from 'vs/base/common/event';\nimport { Disposable } from 'vs/base/common/lifecycle';\nimport { IRecentlyOpened } from 'vs/platform/history/common/history';\nimport { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces';\nimport { RunOnceScheduler } from 'vs/base/common/async';\nimport { MENUBAR_SELECTION_FOREGROUND, MENUBAR_SELECTION_BACKGROUND, MENUBAR_SELECTION_BORDER, TITLE_BAR_ACTIVE_FOREGROUND, TITLE_BAR_INACTIVE_FOREGROUND } from 'vs/workbench/common/theme';\nimport { URI } from 'vs/base/common/uri';\nimport { ILabelService } from 'vs/platform/label/common/label';\nimport { IUpdateService, StateType } from 'vs/platform/update/common/update';\nimport { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';\nimport { INotificationService, Severity } from 'vs/platform/notification/common/notification';\nimport { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';\nimport { IEnvironmentService } from 'vs/platform/environment/common/environment';\nimport { MenuBar } from 'vs/base/browser/ui/menu/menubar';\nimport { SubmenuAction } from 'vs/base/browser/ui/menu/menu';\nimport { attachMenuStyler } from 'vs/platform/theme/common/styler';\nimport { assign } from 'vs/base/common/objects';</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package com.swanky.commandbus;\r\n\r\nimport org.testng.Assert;\r\nimport org.testng.annotations.Test;\r\n\r\nimport static org.testng.Assert.assertFalse;\r\nimport static org.testng.Assert.assertTrue;\r\n\r\n@Test\r\npublic class CommandBusTests {\r\n private CommandBus commandBus;\r\n private SampleCommandHandler commandHandler;\r\n\r\n public void oneClassCanSubscribeToMultipleCommands(){\r\n given.aCommandHandler().and.aSubscribedSampleCommandHandler()\r\n .when.aSampleCommandIsPublished().and.aDifferentSampleCommandIsPublished()\r\n .then.bothCommandsWereHandledByTheCommandHandler();\r\n }\r\n\r\n private void bothCommandsWereHandledByTheCommandHandler() {\r\n Assert.assertTrue(commandHandler.isHandled());\r\n Assert.assertTrue(commandHandler.isOtherHandled());\r\n }\r\n\r\n private CommandBusTests aDifferentSampleCommandIsPublished() {\r\n commandBus.publish(new ADifferentSampleCommand());\r\n return this;\r\n }\r\n\r\n public void whenAnCommandHandlerHasNotSubscribedToTheCommandHandlerTheCommandIsNotHandled() {\r\n given.aCommandHandler().and.aUnsubscribedSampleCommandHandler().\r\n when.aSampleCommandIsPublished().then.theCommandHasNotBeenHandled();\r\n }\r\n\r\n public void whenAnCommandHandlerHasUnsubscribedFromTheCommandHandlerTheCommandIsNotHandled() {\r\n given.aCommandHandler().and.aSubscribedSampleCommandHandler().\r\n and.aSampleCommandIsPublished().then.theCommandHasBeenHandled().\r\n when.TheCommandHandlerUnsubscribes().and.aSampleCommandIsPublished().\r\n then.theCommandHasNotBeenHandled();\r\n }\r\n\r\n\r\n public void testThatWhenAnCommandIsPublishedTheSubscriberHandlesIt() {\r\n given.aCommandHandler().and.aSubscribedSampleCommandHandler().\r\n when.aSampleCommandIsPublished().then.theCommandHasBeenHandled();\r\n }\r\n\r\n private CommandBusTests TheCommandHandlerUnsubscribes() {\r\n commandHandler.unSubscribe();\r\n return this;\r\n }\r\n\r\n private CommandBusTests theCommandHasBeenHandled() {\r\n assertTrue(commandHandler.isHandled());\r\n return this;\r\n }\r\n\r\n private CommandBusTests theCommandHasNotBeenHandled() {\r\n assertFalse(commandHandler.isHandled());\r\n return this;\r\n }\r\n\r\n private CommandBusTests aSubscribedSampleCommandHandler() {\r\n commandHandler = new SampleCommandHandler(commandBus);\r\n commandHandler.subscribeToCommandHandler();\r\n return this;\r\n }\r\n\r\n private CommandBusTests aUnsubscribedSampleCommandHandler() {\r\n commandHandler = new SampleCommandHandler(commandBus);\r\n return this;\r\n }\r\n\r\n private CommandBusTests aSampleCommandIsPublished() {\r\n commandBus.publish(new SampleCommand());\r\n return this;\r\n }\r\n\r\n private CommandBusTests aCommandHandler() {\r\n commandBus = new SimpleCommandBus();\r\n return this;\r\n }\r\n\r\n private CommandBusTests given = this;\r\n private CommandBusTests when = this;\r\n private CommandBusTests then = this;\r\n private CommandBusTests and = this;\r\n\r\n}\r\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>from collections import deque\n\nMOD = 10 ** 9 + 7\nans = 1\n\nn, k = map(int, input().split())\na = list(map(int, input().split()))\n\nif n == k:\n for x in a:\n ans *= x\n ans %= MOD\n print(ans % MOD)\n exit()\n\np = []\nm = []\n\nfor x in a:\n if x >= 0:\n p.append(x)\n else:\n m.append(x)\n\np.sort(reverse=True)\nm.sort()\n\npos = deque(p)\nneg = deque(m)\n\nif len(p) == 0:\n for i in range(k):\n ans *= neg[-1]\n neg.pop()\n ans %= MOD\n print(ans % MOD)\n exit()\n\nif k % 2:\n ans *= pos.popleft()\n k -= 1\n\nwhile k > 0:\n if len(pos) >= 2:\n sp = pos[0] * pos[1]\n else:\n sp = 0\n \n if len(neg) >= 2:\n sn = neg[0] * neg[1]\n else:\n sn = 0\n \n if sp > sn:\n ans *= sp\n pos.popleft()\n pos.popleft()\n else:\n ans *= sn\n neg.popleft()\n neg.popleft()\n \n ans %= MOD\n k -= 2\n\nprint(ans % MOD)\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_PHP_><?php\n\nnamespace App;\n\nuse Illuminate\\Contracts\\Auth\\MustVerifyEmail;\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\nuse Illuminate\\Notifications\\Notifiable;\n\nclass User extends Authenticatable\n{\n use Notifiable;\n\n /**\n * The attributes that are mass assignable.\n *\n * @var array\n */\n protected $fillable = [\n 'name', 'email', 'password','identity','mobile'\n ];\n\n /**\n * The attributes that should be hidden for arrays.\n *\n * @var array\n */\n protected $hidden = [\n 'password', 'remember_token',\n ];\n\n /**\n * The attributes that should be cast to native types.\n *\n * @var array\n */\n protected $casts = [\n 'email_verified_at' => 'datetime',\n ];\n\n public function answers(){\n\n return $this->hasMany('App\\User');\n }\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>N = int(input())\nD = [int(input()) for i in range(N)]\nprint(len(set(D)))</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\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<!-- NewPage -->\n<html lang=\"en\">\n<head>\n<!-- Generated by javadoc -->\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>NotAllMetaRegionsOnlineException (Apache HBase 3.0.0-SNAPSHOT API)</title>\n<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../../stylesheet.css\" title=\"Style\">\n<script type=\"text/javascript\" src=\"../../../../script.js\"></script>\n</head>\n<body>\n<script type=\"text/javascript\"><!--\n try {\n if (location.href.indexOf('is-external=true') == -1) {\n parent.document.title=\"NotAllMetaRegionsOnlineException (Apache HBase 3.0.0-SNAPSHOT API)\";\n }\n }\n catch(err) {\n }\n//-->\n</script>\n<noscript>\n<div>JavaScript is disabled on your browser.</div>\n</noscript>\n<!-- ========= START OF TOP NAVBAR ======= -->\n<div class=\"topNav\"><a name=\"navbar.top\">\n<!-- -->\n</a>\n<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n<a name=\"navbar.top.firstrow\">\n<!-- -->\n</a>\n<ul class=\"navList\" title=\"Navigation\">\n<li><a href=\"../../../../overview-summary.html\">Overview</a></li>\n<li><a href=\"package-summary.html\">Package</a></li>\n<li class=\"navBarCell1Rev\">Class</li>\n<li><a href=\"class-use/NotAllMetaRegionsOnlineException.html\">Use</a></li>\n<li><a href=\"package-tree.html\">Tree</a></li>\n<li><a href=\"../../../../deprecated-list.html\">Deprecated</a></li>\n<li><a href=\"../../../../index-all.html\">Index</a></li>\n<li><a href=\"../../../../help-doc.html\">Help</a></li>\n</ul>\n</div>\n<div class=\"subNav\">\n<ul class=\"navList\">\n<li><a href=\"../../../../org/apache/hadoop/hbase/NoTagsKeyValue.html\" title=\"class in org.apache.hadoop.hbase\"><span class=\"typeNameLink\">Prev&nbsp;Class</span></a></li>\n<li><a href=\"../../../../org/apache/hadoop/hbase/NotServingRegionException.html\" title=\"class in org.apache.hadoop.hbase\"><span class=\"typeNameLink\">Next&nbsp;Class</span></a></li>\n</ul>\n<ul class=\"navList\">\n<li><a href=\"../../../../index.html?org/apache/hadoop/hbase/NotAllMetaRegionsOnlineException.html\" target=\"_top\">Frames</a></li>\n<li><a href=\"NotAllMetaRegionsOnlineException.html\" target=\"_top\">No&nbsp;Frames</a></li>\n</ul>\n<ul class=\"navList\" id=\"allclasses_navbar_top\">\n<li><a href=\"../../../../allclasses-noframe.html\">All&nbsp;Classes</a></li>\n</ul>\n<div>\n<script type=\"text/javascript\"><!--\n allClassesLink = document.getElementById(\"allclasses_navbar_top\");\n if(window==top) {\n allClassesLink.style.display = \"block\";\n }\n else {\n allClassesLink.style.display = \"none\";\n }\n //-->\n</script>\n</div>\n<div>\n<ul class=\"subNavList\">\n<li>Summary:&nbsp;</li>\n<li>Nested&nbsp;|&nbsp;</li>\n<li><a href=\"#field.summary\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor.summary\">Constr</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#methods.inherited.from.class.java.lang.Throwable\">Method</a></li>\n</ul>\n<ul class=\"subNavList\">\n<li>Detail:&nbsp;</li>\n<li><a href=\"#field.detail\">Field</a>&nbsp;|&nbsp;</li>\n<li><a href=\"#constructor.detail\">Constr</a>&nbsp;|&nbsp;</li>\n<li>Method</li>\n</ul>\n</div>\n<a name=\"skip.navbar.top\">\n<!-- -->\n</a></div>\n<!-- ========= END OF TOP NAVBAR ========= -->\n<!-- ======== START OF CLASS DATA ======== -->\n<div class=\"header\">\n<div class=\"subTitle\">org.apache.hadoop.hbase</div>\n<h2 title=\"Class NotAllMetaRegionsOnlineException\" class=\"title\">Class NotAllMetaRegionsOnlineException</h2>\n</div>\n<div class=\"contentContainer\">\n<ul class=\"inheritance\">\n<li><a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">java.lang.Object</a></li>\n<li>\n<ul class=\"inheritance\">\n<li><a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Throwable.html?is-external=true\" title=\"class or interface in java.lang\">java.lang.Throwable</a></li>\n<li>\n<ul class=\"inheritance\">\n<li><a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Exception.html?is-external=true\" title=\"class or interface in java.lang\">java.lang.Exception</a></li>\n<li>\n<ul class=\"inheritance\"></code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C#_>\t\tpublic float Speed;\n\n\t\t[SuffixLabel(\"radians\", Overlay = true)]\n\t\tpublic float Angle;\n\n\t\t[Space(15)]\n\t\t[InfoBox(\"The SuffixAttribute also supports referencing a member string field, property, or method by using $.\")]\n\t\t[SuffixLabel(\"$Suffix\", Overlay = true)]\n\t\tpublic string Suffix = \"Dynamic suffix label\";\n\t}\n}\n#endif\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_TypeScript_>export const LaunchFontIcon = forwardRef<HTMLElement, FontIconProps>(\n function LaunchFontIcon(props, ref) {\n return (\n <FontIcon {...props} ref={ref}>\n launch\n </FontIcon>\n );\n }\n);\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>package hudson.plugins.promoted_builds;\n\nimport antlr.ANTLRException;\nimport edu.umd.cs.findbugs.annotations.SuppressFBWarnings;\nimport hudson.BulkChange;\nimport hudson.EnvVars;\nimport hudson.Extension;\nimport hudson.Util;\nimport hudson.model.AbstractBuild;\nimport hudson.model.AbstractProject;\nimport hudson.model.Action;\nimport hudson.model.AutoCompletionCandidates;\nimport hudson.model.ParameterValue;\nimport hudson.model.BuildableItemWithBuildWrappers;\nimport hudson.model.Cause;\nimport hudson.model.Cause.UserCause;\nimport hudson.model.DependencyGraph;\nimport hudson.model.Describable;\nimport hudson.model.Descriptor;\nimport hudson.model.Descriptor.FormException;\nimport hudson.model.Failure;\nimport hudson.model.FreeStyleProject;\nimport hudson.model.ItemGroup;\nimport hudson.model.JDK;\nimport hudson.model.Job;\nimport hudson.model.Label;\nimport hudson.model.ParameterDefinition;\nimport hudson.model.ParametersDefinitionProperty;\nimport hudson.model.PermalinkProjectAction.Permalink;\nimport hudson.model.Queue.Item;\nimport hudson.model.Run;\nimport hudson.model.Saveable;\nimport hudson.model.StringParameterValue;\nimport hudson.model.labels.LabelAtom;\nimport hudson.model.labels.LabelExpression;\nimport hudson.plugins.promoted_builds.conditions.ManualCondition.ManualApproval;\nimport hudson.security.ACL;\nimport hudson.tasks.BuildStep;\nimport hudson.tasks.BuildStepDescriptor;\nimport hudson.tasks.Builder;\nimport hudson.tasks.BuildWrapper;\nimport hudson.tasks.BuildWrappers;\nimport hudson.tasks.Publisher;\nimport hudson.util.DescribableList;\nimport hudson.util.FormValidation;\nimport jenkins.model.Jenkins;\nimport jenkins.util.TimeDuration;\nimport net.sf.json.JSONObject;\nimport org.kohsuke.stapler.HttpResponses;\nimport org.kohsuke.stapler.QueryParameter;\nimport org.kohsuke.stapler.StaplerRequest;\nimport org.kohsuke.stapler.StaplerResponse;\n\nimport javax.servlet.ServletException;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Set;\nimport java.util.concurrent.Future;\nimport java.util.concurrent.atomic.AtomicReferenceFieldUpdater;\nimport java.util.logging.Logger;\nimport javax.annotation.CheckForNull;\nimport javax.annotation.Nonnull;\n\n/**\n * A dummy {@link AbstractProject} to carry out promotion operations.\n *\n * @author Kohsuke Kawaguchi\n */\n // BuildableItem, LazyBuildMixIn.LazyLoadingJob<P,R>, ParameterizedJobMixIn.ParameterizedJob<P, R>\npublic final class PromotionProcess extends AbstractProject<PromotionProcess,Promotion> implements Saveable, Describable<PromotionProcess>, BuildableItemWithBuildWrappers {\n\n /**\n * {@link PromotionCondition}s. All have to be met for a build to be promoted.\n */\n public final DescribableList<PromotionCondition,PromotionConditionDescriptor> conditions =\n new DescribableList<PromotionCondition, PromotionConditionDescriptor>(this);\n /**\n * The icon that represents this promotion process. This is the name of\n * the GIF icon that can be found in ${rootURL}/plugin/promoted-builds/icons/16x16/\n * and ${rootURL}/plugin/promoted-builds/icons/32x32/, e.g. <code>\"star-gold\"</code>.\n */\n public String icon;\n\n /**\n * The label that promotion process can be run on.\n */\n public String assignedLabel;\n /**\n * Tells if this promotion should be hidden.\n */\n public String isVisible;\n\n private List<BuildStep> buildSteps = new ArrayList<BuildStep>();\n\n private volatile DescribableList<BuildWrapper, Descriptor<BuildWrapper>> buildWrappers;\n private static final AtomicReferenceFieldUpdater<PromotionProcess,DescribableList> buildWrappersSetter\n = AtomicReferenceFieldUpdater.newUpdater(PromotionProcess.class,DescribableList.class,\"buildWrappers\");\n\n /*package*/ PromotionProcess(JobPropertyImpl property, String name) {\n super(property, name);\n }\n\n /*package*/ PromotionProcess(ItemGroup parent, String name) {\n super(parent, name);\n }\n\n /**\n * Creates unconnected {@link PromotionProcess} instance from the JSON configuration.\n * This is mostly only useful for capturing its configuration in XML format.\n * @param req Request\n * @param o JSON object with source data\n * @throws FormException form submission issue, includes form validation\n * @throws IOException {@link PromotionProcess} creation issue\n * @return Parsed promotion process\n */\n public static PromotionProcess fromJson(StaplerRequest req, JSONObject o) throws FormException, IOException {\n String name = o.getString(\"name\");\n try {\n Jenkins.checkGoodName(name);\n } catch (Failure f) {\n throw new Descriptor.FormException(f.getMessage(), name);\n }\n PromotionProcess p = new PromotionProcess(null,name);\n BulkChange bc = new BulkChange(p);\n try {\n p.configure(req, o); // apply configuration. prevent it from trying to save to disk while we do this\n } finally {\n bc.abort();\n }\n return p;\n }\n\n @Override\n public void doSetName(String name) {\n super.doSetName(name);\n }\n\n /*package*/ void configure(StaplerRequest req, JSONObject c) throws Descriptor.FormException, IOException {\n // apply configuration\n conditions.rebuild(req,c.optJSONObject(\"conditions\"), PromotionCondition.all());\n\n buildSteps = (List)Descriptor.newInstancesFromHeteroList(\n req, c, \"buildStep\", (List) PromotionProcess.getAll());\n getBuildWrappersList().rebuild(req, c, BuildWrappers.getFor(this));\n icon = c.getString(\"icon\");\n if (c.optBoolean(\"hasAssignedLabel\")) {\n assignedLabel = Util.fixEmptyAndTrim(c.optString(\"assignedLabelString\"));\n } else {\n assignedLabel = null;\n }\n isVisible = c.getString(\"isVisible\");\n save();\n }\n\n /**\n * Returns the root project value.\n *\n * @return the root project value.\n */\n @Override\n public AbstractProject getRootProject() {\n return getParent().getOwner().getRootProject();\n }\n\n @Override\n public JobPropertyImpl getParent() {\n return (JobPropertyImpl)super.getParent();\n }\n\n /**\n * Gets the owner {@link AbstractProject} that configured {@link JobPropertyImpl} as\n * a job property.\n * @return Current owner project\n */\n public AbstractProject<?,?> getOwner() {\n return getParent().getOwner();\n }\n\n @Override public ACL getACL() {</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>-(BOOL)isAppleMediaAccessory;\n-(BOOL)requiresHomePodPairing;\n-(id)createUnassociatedAppleMediaAccessory:(id)arg1 name:(id)arg2 category:(id)arg3 messageDispatcher:(id)arg4;\n-(id)createUnassociatedHomePodAccessory:(id)arg1 name:(id)arg2 category:(id)arg3 messageDispatcher:(id)arg4;\n-(NSString *)currentAccessoryMediaRouteIdentifier;\n\n@end\n\n\n@class NSString, HMFSystemInfo;\n\n@interface HMDMediaBrowserDataSource : HMFObject <HMDMediaBrowserDataSource>\n\n@property (readonly) NSString * currentAccessoryMediaRouteIdentifier; \n@property (readonly) BOOL isAppleMediaAccessory; \n@property (readonly) BOOL requiresHomePodPairing; \n@property (readonly) HMFSystemInfo * systemInfo; \n+(id)shortDescription;\n-(HMFSystemInfo *)systemInfo;\n-(BOOL)isAppleMediaAccessory;\n-(BOOL)requiresHomePodPairing;\n-(id)createUnassociatedAppleMediaAccessory:(id)arg1 name:(id)arg2 category:(id)arg3 messageDispatcher:(id)arg4 ;\n-(id)createUnassociatedHomePodAccessory:(id)arg1 name:(id)arg2 category:(id)arg3 messageDispatcher:(id)arg4 ;\n-(NSString *)currentAccessoryMediaRouteIdentifier;\n@end\n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_>H, W = gets.split.map(&:to_i)\na = []\nH.times do |i|\n a << gets.split.map { |c| c.to_i.even? }\nend\n\nroutes = []\nH.times do |h|\n w_vec = h.odd? ? :left : :right\n w_range = (0...W).to_a\n w_range.reverse! if h.odd?\n w_range.each do |w|\n next if a[h][w]\n\n if h < H - 1 && (w == W - 1 && w_vec == :right || w == 0 && w_vec == :left)\n routes << [h, w, h + 1, w]\n a[h+1][w] = !a[h+1][w]\n elsif w_vec == :right && w < W - 1\n routes << [h, w, h, w + 1]\n a[h][w+1] = !a[h][w+1]\n elsif w_vec == :left && w > 0\n routes << [h, w, h, w - 1]\n a[h][w-1] = !a[h][w-1]\n end\n end\nend\n\nputs routes.size\nroutes.each do |route|\n puts route.map(&:next).join(' ')\nend</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>lines = readlines(chomp: true).map{|line| line.split(' ').map(&:to_i)}\n\nanswer = lines[0][0]\nm = lines[0][1]\n\nfor i in 1..m\n answer = answer - lines[1][i-1]\nend\n\nif answer < 0 then\n answer = -1\nend\n print answer</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import collections\nS = input()\ncnt = 0\n\nmod = [0]\nreverse_S = S[::-1]\nfor i in range(len(reverse_S)):\n now = int(reverse_S[i]) * pow(10,i,2019)\n mod.append((now + mod[i]) % 2019)\n\nc = collections.Counter(mod)\nhindo = sorted(c.values(),reverse=True)\n\nfor i in range(hindo.index(1)):\n n = hindo[i]\n cnt += n*(n-1)//2\n\nprint(cnt)</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>N = int(input())\nX = input().split()\nX = [int(s) for s in X]\n\nX = sorted(X)\nrange_X = X[-1] - X [0]\n\nE_min = 10000000000000\nfor p in range(range_X):\n E = 0\n for x in X:\n E += (x-p)**2\n if E < E_min:\n E_min = E\nprint(E_min)</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]