images
images listlengths
1
1
texts
listlengths
1
1
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_CSS_>/*---------------------------------------------------------------------------------------------\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\n.keybindings-editor {\n\tpadding: 11px 0px 0px 27px;\n}\n\n/* header styling */\n\n.keybindings-editor > .keybindings-header {\n\tpadding: 0px 10px 11px 0;\n}\n\n.keybindings-editor > .keybindings-header > .search-container {\n\tposition: relative;\n}\n\n.keybindings-editor > .keybindings-header > .search-container > .sort-by-precedence {\n\tposition: absolute;\n\ttop: 0;\n\tright: 10px;\n\tmargin-top: 5px;\n\tbackground: url('sort_precedence.svg') center center no-repeat;\n}\n\n.hc-black .keybindings-editor > .keybindings-header > .search-container > .sort-by-precedence,</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_YAML_>### YamlMime:PythonClass\nuid: azure.search.documents.indexes.models.MicrosoftLanguageStemmingTokenizer\nname: MicrosoftLanguageStemmingTokenizer\nfullName: azure.search.documents.indexes.models.MicrosoftLanguageStemmingTokenizer\nmodule: azure.search.documents.indexes.models\ninheritances:\n- azure.search.documents.indexes._internal._generated.models._models_py3.LexicalTokenizer\nsummary: 'Divides text using language-specific rules and reduces words to their base\n forms.\n\n\n All required parameters must be populated in order to send to Azure.'\nconstructor:\n syntax: 'MicrosoftLanguageStemmingTokenizer(*, name: str, max_token_length: typing.Union[int,\n NoneType] = 255, is_search_tokenizer: typing.Union[bool, NoneType] = False, language:\n typing.Union[str, _ForwardRef(''MicrosoftStemmingTokenizerLanguage''), NoneType]\n = None, **kwargs)'\n parameters:\n - name: odata_type\n description: 'Required. Identifies the concrete type of the tokenizer.Constant\n filled by\n\n server.'\n isRequired: true\n types:\n - <xref:str>\n - name: name\n description: 'Required. The name of the tokenizer. It must only contain letters,\n digits, spaces,\n\n dashes or underscores, can only start and end with alphanumeric characters,\n and is limited to\n\n 128 characters.'\n isRequired: true\n types:\n - <xref:str>\n - name: max_token_length\n description: 'The maximum token length. Tokens longer than the maximum length\n are\n\n split. Maximum token length that can be used is 300 characters. Tokens longer\n than 300\n\n characters are first split into tokens of length 300 and then each of those\n tokens is split\n\n based on the max token length set. Default is 255.'\n isRequired: true\n types:\n - <xref:int>\n - name: is_search_tokenizer\n description: 'A value indicating how the tokenizer is used. Set to true if used\n\n as the search tokenizer, set to false if used as the indexing tokenizer. Default\n is false.'\n isRequired: true\n types:\n - <xref:bool>\n - name: language\n description: 'The language to use. The default is English. Possible values include:\n\n \"arabic\", \"bangla\", \"bulgarian\", \"catalan\", \"croatian\", \"czech\", \"danish\", \"dutch\",\n \"english\",\n\n \"estonian\", \"finnish\", \"french\", \"german\", \"greek\", \"gujarati\", \"hebrew\", \"hindi\",\n \"hungarian\",\n\n \"icelandic\", \"indonesian\", \"italian\", \"kannada\", \"latvian\", \"lithuanian\", \"malay\",\n \"malayalam\",\n\n \"marathi\", \"norwegianBokmaal\", \"polish\", \"portuguese\", \"portugueseBrazilian\",\n \"punjabi\",\n\n \"romanian\", \"russian\", \"serbianCyrillic\", \"serbianLatin\", \"slovak\", \"slovenian\",\n \"spanish\",\n\n \"swedish\", \"tamil\", \"telugu\", \"turkish\", \"ukrainian\", \"urdu\".'\n isRequired: true\n types:\n - <xref:str>\n - <xref:azure.search.documents.indexes.models.MicrosoftStemmingTokenizerLanguage>\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>#ABC090-C\ndef IL(): return list(map(int,input().split()))\ndef SL(): return input().split()\ndef I(): return int(input())\ndef S(): return list(input())\nn,m=IL()\nif n==1 and m==1:\n print(1)\nelif n==1 or m==1:\n print(max(0,n-2,m-2))\nelse:\n print(max(0,(n-2)*(m-2)))</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>import numpy as np\nimport cv2\nimport math\n\n\ndef norm_image(img):\n \"\"\" normalize image input \"\"\"\n img = img.astype(np.float32)\n var = np.var(img, axis=(0, 1), keepdims=True)\n mean = np.mean(img, axis=(0, 1), keepdims=True)\n return (img - mean) / (np.sqrt(var) + 1e-7)\n\n\ndef mask_depth_image(depth_image, min_depth, max_depth):\n \"\"\" mask out-of-range pixel to zero \"\"\"\n # print ('mask min max', min_depth, max_depth)\n ret, depth_image = cv2.threshold(depth_image, min_depth, 100000, cv2.THRESH_TOZERO)\n ret, depth_image = cv2.threshold(depth_image, max_depth, 100000, cv2.THRESH_TOZERO_INV)\n depth_image = np.expand_dims(depth_image, 2)\n return depth_image\n\n\ndef scale_camera(cam, scale=1):\n \"\"\" resize input in order to produce sampled depth map \"\"\"\n new_cam = np.copy(cam)\n # focal:\n new_cam[1][0][0] = cam[1][0][0] * scale\n new_cam[1][1][1] = cam[1][1][1] * scale\n # principle point:\n new_cam[1][0][2] = cam[1][0][2] * scale\n new_cam[1][1][2] = cam[1][1][2] * scale\n return new_cam\n\n\ndef scale_image(image, scale=1, interpolation='linear'):\n \"\"\" resize image using cv2 \"\"\"\n if interpolation == 'linear':\n return cv2.resize(image, None, fx=scale, fy=scale, interpolation=cv2.INTER_LINEAR)\n if interpolation == 'nearest':\n return cv2.resize(image, None, fx=scale, fy=scale, interpolation=cv2.INTER_NEAREST)\n\n\ndef scale_dtu_input(images, cams, depth_image=None, scale=1):\n \"\"\" resize input to fit into the memory \"\"\"\n for view in range(len(images)):\n images[view] = scale_image(images[view], scale=scale)\n cams[view] = scale_camera(cams[view], scale=scale)\n\n if depth_image is None:\n return images, cams\n else:\n depth_image = scale_image(depth_image, scale=scale, interpolation='nearest')\n return images, cams, depth_image\n\n\ndef crop_dtu_input(images, cams, height, width, base_image_size, depth_image=None):\n \"\"\" resize images and cameras to fit the network (can be divided by base image size) \"\"\"\n\n # crop images and cameras\n for view in range(len(images)):\n h, w = images[view].shape[0:2]\n new_h = h\n new_w = w\n if new_h > height:\n new_h = height\n else:\n new_h = int(math.floor(h / base_image_size) * base_image_size)\n if new_w > width:\n new_w = width\n else:\n new_w = int(math.floor(w / base_image_size) * base_image_size)\n start_h = int(math.floor((h - new_h) / 2))\n start_w = int(math.floor((w - new_w) / 2))\n finish_h = start_h + new_h\n finish_w = start_w + new_w\n images[view] = images[view][start_h:finish_h, start_w:finish_w]\n cams[view][1][0][2] = cams[view][1][0][2] - start_w\n cams[view][1][1][2] = cams[view][1][1][2] - start_h\n\n # crop depth image\n if not depth_image is None:\n depth_image = depth_image[start_h:finish_h, start_w:finish_w]\n return images, cams, depth_image\n else:\n return images, cams\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_>n = int(input())\na = b = c = d = e = 0\nfor _ in range(n):\n s = input()\n if s[0] == 'M':\n a += 1\n elif s[0] == 'A':\n b += 1\n elif s[0] == 'R':\n c += 1\n elif s[0] == 'C':\n d += 1\n elif s[0] == 'H':\n e += 1\nprint(a * b * c + a * b * d + a * b * e + a * c * d + a * c * e + a * d * e +\n b * c * d + b * c * e + b * d * e + c * d * e)\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Cuda_>}\n\nCUDA_HOST_DEVICE Vector3 Random::PointOnUnitSphere()\n{\n double u1 = Double();\n double u2 = Double();\n double lambda = acos(2.0 * u1 - 1) - PI / 2.0;\n double phi = 2.0 * PI * u2;</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Cuda_>// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n// Part of the following code in this file refs to\n// https://github.com/msracver/Deformable-ConvNets/blob/master/faster_rcnn/operator_cxx/deformable_psroi_pooling.cu\n//\n// Copyright (c) 2017 Microsoft\n// Licensed under The Apache-2.0 License [see LICENSE for details]\n// \\file deformable_psroi_pooling.cu\n// \\brief\n// \\author Yi Li, Guodong Zhang, Jifeng Dai\n\n#pragma once\n#include <stdio.h>\n#include <algorithm>\n#include <iostream>\n#include <limits>\n#include <vector>\n#include \"paddle/fluid/framework/op_registry.h\"\n#include \"paddle/fluid/memory/malloc.h\"\n#include \"paddle/fluid/operators/deformable_psroi_pooling_op.h\"\n#include \"paddle/fluid/platform/device/gpu/gpu_primitives.h\"\n#include \"paddle/phi/kernels/funcs/blas/blas.h\"\n#include \"paddle/phi/kernels/funcs/math_function.h\"\n\nnamespace paddle {\nnamespace operators {\n\nusing Tensor = framework::Tensor;\nusing LoDTensor = framework::LoDTensor;\nusing paddle::platform::PADDLE_CUDA_NUM_THREADS;\n\nstatic inline int GET_BLOCKS(const int N) {\n return (N + PADDLE_CUDA_NUM_THREADS - 1) / PADDLE_CUDA_NUM_THREADS;\n}\n\ntemplate <typename T>\n__device__ T bilinear_interpolation(const T* data, const T x, const T y,\n const int width, const int height) {\n int x1 = floor(x);\n int x2 = ceil(x);\n int y1 = floor(y);\n int y2 = ceil(y);\n T dist_x = static_cast<T>(x - x1);\n T dist_y = static_cast<T>(y - y1);\n T value11 = data[y1 * width + x1];\n T value12 = data[y2 * width + x1];\n T value21 = data[y1 * width + x2];\n T value22 = data[y2 * width + x2];\n T value = (1 - dist_x) * (1 - dist_y) * value11 +\n (1 - dist_x) * dist_y * value12 + dist_x * (1 - dist_y) * value21 +\n dist_x * dist_y * value22;\n return value;\n}\n\ntemplate <typename T>\n__global__ void DeformablePSROIPoolForwardKernel(\n const int count, const T* bottom_data, const T spatial_scale,\n const int channels, const int height, const int width,\n const int pooled_height, const int pooled_width, const T* bottom_rois,\n const T* bottom_trans, const bool no_trans, const T trans_std,\n const int sample_per_part, const int output_dim, const int group_height,\n const int group_width, const int part_height, const int part_width,\n const int num_classes, const int channels_each_class, T* top_data,\n T* top_count, int* roi_batch_id_data) {\n CUDA_KERNEL_LOOP(index, count) {\n // The output is in order (n, ctop, ph, pw)</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Python_>\n @mock.patch.object(imagecache.images, 'fetch')\n def test_cache_rescue_image_bigger_than_flavor(self, mock_fetch):\n fake_rescue_image_id = 'fake_rescue_image_id'\n\n self.imagecache._vhdutils.get_vhd_info.return_value = {\n 'VirtualSize': (self.instance.flavor.root_gb + 1) * units.Gi}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_YAML_> path: /logout\nadmin_home:\n path: /admin/home\n defaults: { _controller: UserBundle:Default:adminhome }\nuser_home:\n path: /user/home\n defaults: { _controller: UserBundle:Default:userhome }</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_>#include <iostream>\n#include <vector>\n#include <cstdio>\nusing namespace std;\nvector <int> ami[100][100];\nint hi[1000];\nint n,m,a,mh;\n\n\nint kuji(int x,int h) {\n //cout << \"start kuji()\"<<endl;\n int t;\n int fl = 0;\n int i;\n // cout << \"h = \"<< h << endl;\n // cout << \"x = \" << x << endl;\n mh = -1;\n fl == 0;\n \n if(x > 0)\n for(i =0;i<ami[x][x-1].size();i++){\n if(h>= ami[x][x-1][i] && ami[x][x-1][i] > mh){\n\tfl = 1;\n\tmh = ami[x][x-1][i];\n\tt = i;\n }\n }\n\n \n if(x < n-1) {\n for(i=0;i<ami[x][x+1].size();i++) {\n if(h >= ami[x][x+1][i] && ami[x][x+1][i] > mh) {\n\tmh = ami[x][x+1][i];\n\tfl = 2;\n\tt = i;\n }\n }\n }\n\n if(fl == 1) {\n ami[x][x-1][t] = h+1;\n ami[x-1][x][t] = h+1;\n }else if(fl == 2) {\n ami[x][x+1][t] = h+1;\n ami[x+1][x][t] = h+1;\n }\n if(mh == -1) return x;\n // printf(\"mh = %d\\n\",mh);\n if(mh != x && fl == 1) kuji(x-1,mh);\n else if(mh !=x && fl == 2) kuji(x+1,mh);\n \n \n}\t\n\n\n\nint main() {\n \n\n \n cin >> n >> m >> a;\n \n mh = -1; \n while(1) {\n int h,p,q;\n cin >> h >> p >> q;\n if(h == 0 && p == 0 && q ==0) break;\n ami[p-1][q-1].push_back(h);\n ami[q-1][p-1].push_back(h);\n // cout << ami[q-1][p-1].back() << endl;\n if(mh < h) mh = h;\n }\n\n \n int ans = 0;\n ans = kuji(a-1,mh);\n \n cout << ans+1 << endl;\n\n for(int i=0;i<n;i++)\n for(int j=0;j<n;j++)\n ami[i][j].clear();\n \n \n \n return 0;\n \n}\nn;i++)\n for(int j=0;j<n;j++)\n\tami[i][j].clear();\n \n }\n \n return 0;\n \n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Rust_>use std::io::*;\nuse std::str::FromStr;\n\npub fn read<T: FromStr>() -> T {\n let stdin = stdin();\n let stdin = stdin.lock();\n let token: String = stdin\n .bytes()\n .map(|c| c.expect(\"failed to read char\") as char)\n .skip_while(|c| c.is_whitespace())\n .take_while(|c| !c.is_whitespace())\n .collect();\n token.parse().ok().expect(\"failed to parse token\")\n}\n\nfn main() {\n let x1: i64 = read();\n let y1: i64 = read();\n let x2: i64 = read();\n let y2: i64 = read();\n\n let xd = x2 - x1;\n let yd = y2 - y1;\n\n let x3 = x2 - yd;\n let y3 = y2 + xd;\n\n let x4 = x3 - xd;\n let y4 = y1 + xd;\n\n println!(\"{} {} {} {}\", x3, y3, x4, y4);\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_># -*- coding: utf-8 -*-\nfrom pygame import *\ntime.Clock()\nimport socket\nfrom toolbox.EasyGame import entry\nfrom toolbox.Menu import slidemenu\nimport threading\n \nclass Game(list,object):\n \n blanc = image.load('blanc.png')\n noir = image.load('noir.png')\n board = image.load('board.png')\n \n def __init__(self):\n self.scr = display.set_mode((570,570))\n self.choice = slidemenu(['Make Server','Join Server','Quit'],pos='center',color1=(100,100,100),color2=(200,200,200))[0]\n if self.choice != 'Quit':\n soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n soc.settimeout(5.0)\n ### tentatives de connection\n self.is_server = False\n ### si on est server\n if self.choice == 'Make Server':\n self.is_server = True\n soc.bind(('',50007))\n soc.listen(1)\n ### attend un client temps que l'on ne quitte pas\n while True:\n try:\n print('awaiting for player connection')\n self.conn = soc.accept()[0]\n break\n except:\n for ev in event.get():\n if ev.type == QUIT: exit()\n ### si on est client\n else:\n foo = True # pour break un double-while\n while foo:\n ### demande l'ip du server temps que celui-ci n'est pas valide ou jusqu'à ce qu'on exit()\n ip = entry('host ip : <15,15>',width = 280)\n if not ip or not ip[0]: print('exit');exit()\n while True:\n ### si l'ip est valide, attend la connection temps que l'on exit() pas\n try:\n print('try to connect...')\n soc.connect((ip[0],50007))\n foo = False\n print('connected')\n break\n except socket.timeout:\n print('good ip ... ?')\n break\n except socket.error:\n print('...refused')\n time.wait(1000)\n for ev in event.get():\n if ev.type == QUIT:\n print('exit game')\n exit()\n self.conn = soc\n soc.settimeout(None)\n ### à partir d'ici, les connections sont établies\n T = threading.Thread(target=self.read)\n T.start()\n self.player = 0\n replay = True\n self.game_over = False\n while replay:\n if self.is_server:\n playerorder = time.get_ticks()&1\n self.conn.send(str(playerorder).encode('UTF-8'))\n self.player = playerorder^1\n else:\n while not self.game_over:\n ev = event.wait()\n if ev.type == USEREVENT+1:\n if type(ev.data) == int:\n self.player = ev.data\n break</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_YAML_>ports:\n - port: 4000\n - port: 35729\ntasks:\n - before: cd ./gitbook\n init: yarn install\n command: yarn book\n openIn: bottom</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>/* {{{ module stuff */\nzend_module_entry readline_module_entry = {\n\tSTANDARD_MODULE_HEADER,\n\t\"readline\",\n\text_functions,\n\tPHP_MINIT(readline),\n\tPHP_MSHUTDOWN(readline),\n\tNULL,\n\tPHP_RSHUTDOWN(readline),\n\tPHP_MINFO(readline),\n\tPHP_READLINE_VERSION,\n\tSTANDARD_MODULE_PROPERTIES\n};\n\n#ifdef COMPILE_DL_READLINE\nZEND_GET_MODULE(readline)\n#endif\n\nPHP_MINIT_FUNCTION(readline)\n{\n#if HAVE_LIBREADLINE\n\t\t/* libedit don't need this call which set the tty in cooked mode */\n\tusing_history();\n#endif\n\tZVAL_UNDEF(&_readline_completion);</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_SQL_>CREATE TABLE categories\n(\n id int IDENTITY\n CONSTRAINT categories_pk PRIMARY KEY NONCLUSTERED,\n name varchar(100) NOT NULL\n)\n\ncreate table products\n(\n id int IDENTITY\n CONSTRAINT products_pk PRIMARY KEY NONCLUSTERED,\n name varchar(100) NOT NULL\n)\n\ncreate table categories_products\n(\n product_id int NOT NULL\n CONSTRAINT categories_products_products_id_fk REFERENCES products,\n category_id int NOT NULL\n CONSTRAINT categories_products_categories_id_fk REFERENCES categories,\n CONSTRAINT categories_products_pk\n PRIMARY KEY NONCLUSTERED (product_id, category_id)\n)\n\nINSERT INTO products (name) VALUES ('test1'),\n ('test2'),\n ('test3');\n\nINSERT INTO categories (name) VALUES ('test_c1'),\n ('test_c2');\n\nINSERT INTO categories_products (product_id, category_id) VALUES (2, 1),\n (2, 2),\n (3, 1);\n\nSELECT products.name AS product_name,\n categories.name AS category_name\nFROM products\n LEFT JOIN categories_products on products.id = categories_products.product_id\n LEFT JOIN categories on categories_products.category_id = categories.id</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_JavaScript_>\t})\n);\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_SQL_>CREATE TABLE produkte\n (p_id INTEGER NOT NULL, \n name VARCHAR(50), lagernr INTEGER, anzahl INTEGER,\n PRIMARY KEY (p_id));\n\n-- oder als Spaltenconstraint\n\n-- CREATE TABLE produkte\n-- (p_id PRIMARY KEY, \n-- name VARCHAR(50), lagernr INTEGER, anzahl INTEGER); \n\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>/* Copyright (C) 1991,95,96,97,2002 Free Software Foundation, Inc.\n This file is part of the GNU C Library.\n\n The GNU C Library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Dockerfile_>#\n# NOTE: THIS DOCKERFILE IS GENERATED VIA \"apply-templates.sh\"\n#\n# PLEASE DO NOT EDIT IT DIRECTLY.\n#\n\nFROM eclipse-temurin:11-jre-focal\n\nENV CATALINA_HOME /usr/local/tomcat\nENV PATH $CATALINA_HOME/bin:$PATH\nRUN mkdir -p \"$CATALINA_HOME\"\nWORKDIR $CATALINA_HOME\n\n# let \"Tomcat Native\" live somewhere isolated\nENV TOMCAT_NATIVE_LIBDIR $CATALINA_HOME/native-jni-lib\nENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$TOMCAT_NATIVE_LIBDIR\n\n# see https://www.apache.org/dist/tomcat/tomcat-10/KEYS\n# see also \"versions.sh\" (https://github.com/docker-library/tomcat/blob/master/versions.sh)\nENV GPG_KEYS A9C5DF4D22E99998D9875A5110C01C5A2F6059E7\n\nENV TOMCAT_MAJOR 10\nENV TOMCAT_VERSION 10.0.11\nENV TOMCAT_SHA512 16e1879490bb0e5843059e3a475558f1990b03f897a7d5cce5788d6983598ec30cbf3749e30c18fb799f5068cab8407d04e9e6e9705700b152f90a3dc8bc0cb5\n\nCOPY --from=tomcat:10.0.11-jdk11-temurin-focal $CATALINA_HOME $CATALINA_HOME\nRUN set -eux; \\\n\tapt-get update; \\\n\txargs -rt apt-get install -y --no-install-recommends < \"$TOMCAT_NATIVE_LIBDIR/.dependencies.txt\"; \\\n\trm -rf /var/lib/apt/lists/*\n\n# verify Tomcat Native is working properly\nRUN set -eux; \\\n\tnativeLines=\"$(catalina.sh configtest 2>&1)\"; \\\n\tnativeLines=\"$(echo \"$nativeLines\" | grep 'Apache Tomcat Native')\"; \\\n\tnativeLines=\"$(echo \"$nativeLines\" | sort -u)\"; \\\n\tif ! echo \"$nativeLines\" | grep -E 'INFO: Loaded( APR based)? Apache Tomcat Native library' >&2; then \\\n\t\techo >&2 \"$nativeLines\"; \\\n\t\texit 1; \\\n\tfi\n\nEXPOSE 8080\nCMD [\"catalina.sh\", \"run\"]\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Kotlin_>package dev.johnoreilly.fantasypremierleague.presentation.fixtures\n\nimport androidx.compose.foundation.Image\nimport androidx.compose.foundation.clickable\nimport androidx.compose.foundation.layout.*\nimport androidx.compose.foundation.shape.RoundedCornerShape\nimport androidx.compose.material.MaterialTheme\nimport androidx.compose.material.Surface\nimport androidx.compose.material.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.Alignment\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.text.font.FontWeight\nimport androidx.compose.ui.text.style.TextAlign\nimport androidx.compose.ui.text.style.TextOverflow\nimport androidx.compose.ui.unit.dp\nimport androidx.compose.ui.unit.sp\nimport coil.compose.rememberImagePainter\nimport dev.johnoreilly.common.domain.entities.GameFixture\n\n@Composable\nfun FixtureView(\n fixture: GameFixture,\n onFixtureSelected: (fixtureId: Int) -> Unit\n) {\n Surface(\n modifier = Modifier\n .fillMaxSize()\n .padding(start = 16.dp, top = 16.dp, end = 16.dp)\n .clickable { onFixtureSelected(fixture.id) },\n color = MaterialTheme.colors.surface,\n shape = RoundedCornerShape(10.dp)\n ) {\n Column(\n modifier = Modifier.fillMaxSize(),\n horizontalAlignment = Alignment.CenterHorizontally,\n verticalArrangement = Arrangement.SpaceEvenly\n ) {\n Row(\n modifier = Modifier\n .fillMaxWidth()\n .padding(top = 16.dp),\n verticalAlignment = Alignment.CenterVertically,\n horizontalArrangement = Arrangement.SpaceEvenly\n ) {\n ClubInFixtureView(\n fixture.homeTeam,\n fixture.homeTeamPhotoUrl\n )\n Text(\n text = \"(${fixture.homeTeamScore})\",\n fontWeight = FontWeight.Bold,\n fontSize = 25.sp,\n color = MaterialTheme.colors.onSurface\n )\n Text(\n text = \"vs\",\n fontWeight = FontWeight.Bold,\n fontSize = 25.sp\n )\n Text(\n text = \"(${fixture.awayTeamScore})\",\n fontWeight = FontWeight.Bold,\n fontSize = 25.sp,\n color = MaterialTheme.colors.onSurface\n )\n ClubInFixtureView(\n fixture.awayTeam,\n fixture.awayTeamPhotoUrl\n )\n }\n Text(\n modifier = Modifier.padding(top = 16.dp),\n text = fixture.localKickoffTime.date.toString(),\n fontWeight = FontWeight.Light,\n fontSize = 14.sp,\n color = MaterialTheme.colors.onSurface\n )\n\n fixture.localKickoffTime.let { localKickoffTime ->\n val formattedTime = \"%02d:%02d\".format(localKickoffTime.hour, localKickoffTime.minute)\n Text(\n modifier = Modifier.padding(bottom = 16.dp),\n text = formattedTime,\n fontWeight = FontWeight.Light,\n fontSize = 14.sp,\n color = MaterialTheme.colors.onSurface\n )\n }\n }\n }\n}\n\n@Composable\nfun ClubInFixtureView(\n teamName: String,\n teamPhotoUrl: String\n) {\n Column(horizontalAlignment = Alignment.CenterHorizontally) {\n Image(\n painter = rememberImagePainter(teamPhotoUrl),\n modifier = Modifier.size(60.dp),\n contentDescription = teamName\n )\n Text(\n modifier = Modifier\n .width(100.dp)\n .padding(top = 4.dp),\n text = teamName,\n textAlign = TextAlign.Center,\n maxLines = 1,\n overflow = TextOverflow.Ellipsis,\n color = MaterialTheme.colors.onSurface\n )\n }\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>/*\n * Copyright 2021 ThoughtWorks, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/*\n AngularJS v1.0.8\n (c) 2010-2012 Google, Inc. http://angularjs.org\n License: MIT\n*/</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>(window[\"webpackJsonp\"]=window[\"webpackJsonp\"]||[]).push([[135],{\"F/+k\":function(e,c,t){\"use strict\";t.r(c);var a=t(\"q1tI\"),n={icon:{tag:\"svg\",attrs:{viewBox:\"64 64 896 896\",focusable:\"false\"},children:[{tag:\"path\",attrs:{d:\"M697.8 481.4c33.6-35 54.2-82.3 54.2-134.3v-10.2C752 229.3 663.9 142 555.3 142H259.4c-15.1 0-27.4 12.3-27.4 27.4v679.1c0 16.3 13.2 29.5 29.5 29.5h318.7c117 0 211.8-94.2 211.8-210.5v-11c0-73-37.4-137.3-94.2-175.1zM328 238h224.7c57.1 0 103.3 44.4 103.3 99.3v9.5c0 54.8-46.3 99.3-103.3 99.3H328V238zm366.6 429.4c0 62.9-51.7 113.9-115.5 113.9H328V542.7h251.1c63.8 0 115.5 51 115.5 113.9v10.8z\"}}]},name:\"bold\",theme:\"outlined\"},o=n,i=t(\"6VBw\"),s=function(e,c){return a[\"createElement\"](i[\"a\"],Object.assign({},e,{ref:c,icon:o}))};s.displayName=\"BoldOutlined\";c[\"default\"]=a[\"forwardRef\"](s)}}]);</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_SQL_>-- This SQL code was generated by sklearn2sql (development version).\n-- Copyright 2018\n\n-- Model : KerasClassifier_LSTM\n-- Dataset : BinaryClass_10\n-- Database : sqlite\n\n\n-- This SQL code can contain one or more statements, to be executed in the order they appear in this file.\n\n\n\n-- Model deployment code\n\nWITH RECURSIVE keras_input AS \n(SELECT \"ADS\".\"KEY\" AS \"KEY\", \"ADS\".\"Feature_0\" AS \"Feature_0\", \"ADS\".\"Feature_1\" AS \"Feature_1\", \"ADS\".\"Feature_2\" AS \"Feature_2\", \"ADS\".\"Feature_3\" AS \"Feature_3\", \"ADS\".\"Feature_4\" AS \"Feature_4\", \"ADS\".\"Feature_5\" AS \"Feature_5\", \"ADS\".\"Feature_6\" AS \"Feature_6\", \"ADS\".\"Feature_7\" AS \"Feature_7\", \"ADS\".\"Feature_8\" AS \"Feature_8\", \"ADS\".\"Feature_9\" AS \"Feature_9\" \nFROM \"BinaryClass_10\" AS \"ADS\"), \nkeras_input_1 AS \n(SELECT keras_input.\"KEY\" AS \"KEY\", keras_input.\"Feature_0\" AS \"Feature_0\", keras_input.\"Feature_1\" AS \"Feature_1\", keras_input.\"Feature_2\" AS \"Feature_2\", keras_input.\"Feature_3\" AS \"Feature_3\", keras_input.\"Feature_4\" AS \"Feature_4\", keras_input.\"Feature_5\" AS \"Feature_5\", keras_input.\"Feature_6\" AS \"Feature_6\", keras_input.\"Feature_7\" AS \"Feature_7\", keras_input.\"Feature_8\" AS \"Feature_8\", keras_input.\"Feature_9\" AS \"Feature_9\" \nFROM keras_input), \nkeras_input_1_rn AS \n(SELECT (SELECT count(t.\"KEY\") AS count_1 </code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Rust_>// Copyright 2018 PingCAP, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nuse std::borrow::Cow;\n\nuse super::{EvalContext, Result, ScalarFunc};\nuse coprocessor::codec::Datum;\nuse crypto::{\n digest::Digest,\n md5::Md5,\n sha1::Sha1,\n sha2::{Sha224, Sha256, Sha384, Sha512},\n};\nuse hex;\n\nconst SHA0: i64 = 0;\nconst SHA224: i64 = 224;\nconst SHA256: i64 = 256;\nconst SHA384: i64 = 384;\nconst SHA512: i64 = 512;\n\nimpl ScalarFunc {\n pub fn md5<'a, 'b: 'a>(\n &'b self,\n ctx: &mut EvalContext,\n row: &[Datum],\n ) -> Result<Option<Cow<'a, [u8]>>> {\n let input = try_opt!(self.children[0].eval_string(ctx, row));\n let mut hasher = Md5::new();\n let mut buff: [u8; 16] = [0; 16];\n hasher.input(input.as_ref());\n hasher.result(&mut buff);\n let md5 = hex::encode(buff).into_bytes();\n Ok(Some(Cow::Owned(md5)))\n }\n\n pub fn sha1<'a, 'b: 'a>(\n &'b self,\n ctx: &mut EvalContext,\n row: &[Datum],\n ) -> Result<Option<Cow<'a, [u8]>>> {\n let input = try_opt!(self.children[0].eval_string(ctx, row));\n let mut hasher = Sha1::new();\n let mut buff: [u8; 20] = [0; 20];\n hasher.input(input.as_ref());\n hasher.result(&mut buff);\n let sha1 = hex::encode(buff).into_bytes();\n Ok(Some(Cow::Owned(sha1)))\n }\n\n pub fn sha2<'a, 'b: 'a>(\n &'b self,\n ctx: &mut EvalContext,\n row: &[Datum],\n ) -> Result<Option<Cow<'a, [u8]>>> {\n let input = try_opt!(self.children[0].eval_string(ctx, row));\n let hash_length = try_opt!(self.children[1].eval_int(ctx, row));\n\n let sha2 = match hash_length {\n SHA0 | SHA256 => {\n let mut hasher = Sha256::new();\n hasher.input(input.as_ref());\n hasher.result_str().into_bytes()\n }\n SHA224 => {\n let mut hasher = Sha224::new();\n hasher.input(input.as_ref());\n hasher.result_str().into_bytes()\n }\n SHA384 => {\n let mut hasher = Sha384::new();\n hasher.input(input.as_ref());\n hasher.result_str().into_bytes()\n }\n SHA512 => {\n let mut hasher = Sha512::new();\n hasher.input(input.as_ref());\n hasher.result_str().into_bytes()\n }\n _ => return Ok(None),\n };\n Ok(Some(Cow::Owned(sha2)))\n }\n}\n\n#[cfg(test)]\nmod tests {\n use coprocessor::codec::Datum;\n use coprocessor::dag::expr::tests::{datum_expr, scalar_func_expr};\n use coprocessor::dag::expr::{EvalContext, Expression};\n use tipb::expression::ScalarFuncSig;\n\n #[test]\n fn test_md5() {\n let cases = vec![\n (\"\", \"d41d8cd98f00b204e9800998ecf8427e\"),\n (\"a\", \"0cc175b9c0f1b6a831c399e269772661\"),\n (\"ab\", \"187ef4436122d1cc2f40dc2b92f0eba0\"),\n (\"abc\", \"900150983cd24fb0d6963f7d28e17f72\"),\n (\"123\", \"202cb962ac59075b964b07152d234b70\"),\n ];\n let mut ctx = EvalContext::default();\n\n for (input_str, exp_str) in cases {\n let input = datum_expr(Datum::Bytes(input_str.as_bytes().to_vec()));\n let op = scalar_func_expr(ScalarFuncSig::MD5, &[input]);\n let op = Expression::build(&mut ctx, op).unwrap();\n let got = op.eval(&mut ctx, &[]).unwrap();\n let exp = Datum::Bytes(exp_str.as_bytes().to_vec());\n assert_eq!(got, exp, \"md5('{:?}')\", input_str);\n }\n\n // test NULL case\n let input = datum_expr(Datum::Null);\n let op = scalar_func_expr(ScalarFuncSig::MD5, &[input]);\n let op = Expression::build(&mut ctx, op).unwrap();\n let got = op.eval(&mut ctx, &[]).unwrap();\n let exp = Datum::Null;\n assert_eq!(got, exp, \"md5(NULL)\");\n }\n\n #[test]\n fn test_sha1() {\n let cases = vec![\n (\"\", \"da39a3ee5e6b4b0d3255bfef95601890afd80709\"),\n (\"a\", \"86f7e437faa5a7fce15d1ddcb9eaeaea377667b8\"),\n (\"ab\", \"da23614e02469a0d7c7bd1bdab5c9c474b1904dc\"),\n (\"abc\", \"a9993e364706816aba3e25717850c26c9cd0d89d\"),\n (\"123\", \"40bd001563085fc35165329ea1ff5c5ecbdbbeef\"),\n ];\n let mut ctx = EvalContext::default();\n\n for (input_str, exp_str) in cases {\n let input = datum_expr(Datum::Bytes(input_str.as_bytes().to_vec()));\n let op = scalar_func_expr(ScalarFuncSig::SHA1, &[input]);\n let op = Expression::build(&mut ctx, op).unwrap();\n let got = op.eval(&mut ctx, &[]).unwrap();\n let exp = Datum::Bytes(exp_str.as_bytes().to_vec());\n assert_eq!(got, exp, \"sha1('{:?}')\", input_str);\n }\n\n // test NULL case\n let input = datum_expr(Datum::Null);\n let op = scalar_func_expr(ScalarFuncSig::SHA1, &[input]);\n let op = Expression::build(&mut ctx, op).unwrap();\n let got = op.eval(&mut ctx, &[]).unwrap();\n let exp = Datum::Null;\n assert_eq!(got, exp, \"sha1(NULL)\");\n }\n\n #[test]\n fn test_sha2() {\n let cases = vec![</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Ruby_>require 'enkrip/model'\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_CSS_>@charset \"UTF-8\";\r\n\r\n@font-face {\r\n font-family: \"untitled-font-1\";\r\n src:url(\"https://file.myfontastic.com/gC6yNbQq8CqvXgSqXQZAoH/fonts/1459824891.eot\");\r\n src:url(\"https://file.myfontastic.com/gC6yNbQq8CqvXgSqXQZAoH/fonts/1459824891.eot?#iefix\") format(\"embedded-opentype\"),\r\n url(\"https://file.myfontastic.com/gC6yNbQq8CqvXgSqXQZAoH/fonts/1459824891.woff\") format(\"woff\"),\r\n url(\"https://file.myfontastic.com/gC6yNbQq8CqvXgSqXQZAoH/fonts/1459824891.ttf\") format(\"truetype\"),\r\n url(\"https://file.myfontastic.com/gC6yNbQq8CqvXgSqXQZAoH/fonts/1459824891.svg#1459824891\") format(\"svg\");\r\n font-weight: normal;\r\n font-style: normal;\r\n}\r\n\r\n[data-icon]:before {\r\n font-family: \"untitled-font-1\" !important;\r\n content: attr(data-icon);\r\n font-style: normal !important;\r\n font-weight: normal !important;\r\n font-variant: normal !important;\r\n text-transform: none !important;\r\n speak: none;\r\n line-height: 1;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n}\r\n\r\n[class^=\"icon-\"]:before,\r\n[class*=\" icon-\"]:before {\r\n font-family: \"untitled-font-1\" !important;\r\n font-style: normal !important;\r\n font-weight: normal !important;\r\n font-variant: normal !important;\r\n text-transform: none !important;\r\n speak: none;\r\n line-height: 1;\r\n -webkit-font-smoothing: antialiased;\r\n -moz-osx-font-smoothing: grayscale;\r\n}\r\n\r\n.icon-handle-streamline-vector:before {\r\n content: \"\\61\";\r\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C_>// Copyright (c) 2011-2016 The Readercoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef READERCOIN_QT_WALLETFRAME_H\n#define READERCOIN_QT_WALLETFRAME_H\n\n#include <QFrame>\n#include <QMap>\n\nclass ReadercoinGUI;\nclass ClientModel;\nclass PlatformStyle;\nclass SendCoinsRecipient;\nclass WalletModel;\nclass WalletView;\n\nQT_BEGIN_NAMESPACE\nclass QStackedWidget;\nQT_END_NAMESPACE\n\n/**\n * A container for embedding all wallet-related\n * controls into ReadercoinGUI. The purpose of this class is to allow future\n * refinements of the wallet controls with minimal need for further\n * modifications to ReadercoinGUI, thus greatly simplifying merges while\n * reducing the risk of breaking top-level stuff.\n */\nclass WalletFrame : public QFrame\n{\n Q_OBJECT\n\npublic:\n explicit WalletFrame(const PlatformStyle *platformStyle, ReadercoinGUI *_gui = 0);\n ~WalletFrame();\n\n void setClientModel(ClientModel *clientModel);\n\n bool addWallet(const QString& name, WalletModel *walletModel);\n bool setCurrentWallet(const QString& name);\n bool removeWallet(const QString &name);\n void removeAllWallets();\n\n bool handlePaymentRequest(const SendCoinsRecipient& recipient);\n\n void showOutOfSyncWarning(bool fShow);\n\nQ_SIGNALS:\n /** Notify that the user has requested more information about the out-of-sync warning */\n void requestedSyncWarningInfo();\n\nprivate:\n QStackedWidget *walletStack;\n ReadercoinGUI *gui;\n ClientModel *clientModel;\n QMap<QString, WalletView*> mapWalletViews;\n\n bool bOutOfSync;\n\n const PlatformStyle *platformStyle;\n\n WalletView *currentWalletView();\n\npublic Q_SLOTS:\n /** Switch to overview (home) page */\n void gotoOverviewPage();\n /** Switch to history (transactions) page */\n void gotoHistoryPage();\n /** Switch to receive coins page */\n void gotoReceiveCoinsPage();\n /** Switch to send coins page */\n void gotoSendCoinsPage(QString addr = \"\");\n\n /** Show Sign/Verify Message dialog and switch to sign message tab */\n void gotoSignMessageTab(QString addr = \"\");\n /** Show Sign/Verify Message dialog and switch to verify message tab */\n void gotoVerifyMessageTab(QString addr = \"\");\n\n /** Encrypt the wallet */\n void encryptWallet(bool status);\n /** Backup the wallet */\n void backupWallet();\n /** Change encrypted wallet passphrase */\n void changePassphrase();\n /** Ask for passphrase to unlock wallet temporarily */\n void unlockWallet();\n\n /** Show used sending addresses */\n void usedSendingAddresses();\n /** Show used receiving addresses */\n void usedReceivingAddresses();\n /** Pass on signal over requested out-of-sync-warning information */\n void outOfSyncWarningClicked();\n};\n\n#endif // READERCOIN_QT_WALLETFRAME_H\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C#_>using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.AspNetCore.Identity;\nusing BakeryAuth.Models;\n\nnamespace BakeryAuth\n{\n public class Startup\n {\n public Startup(IHostingEnvironment env)\n {\n var builder = new ConfigurationBuilder()\n .SetBasePath(env.ContentRootPath)\n .AddJsonFile(\"appsettings.json\");\n Configuration = builder.Build();\n }\n\n public IConfigurationRoot Configuration { get; set; }\n\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddMvc();\n\n services.AddEntityFrameworkMySql()\n .AddDbContext<BakeryAuthContext>(options => options\n .UseMySql(Configuration[\"ConnectionStrings:DefaultConnection\"]));\n\n services.AddIdentity<ApplicationUser, IdentityRole>()\n .AddEntityFrameworkStores<BakeryAuthContext>()\n .AddDefaultTokenProviders();\n\n services.Configure<IdentityOptions>(options =>\n {\n options.Password.RequireDigit = false;\n options.Password.RequiredLength = 0;\n options.Password.RequireLowercase = false;\n options.Password.RequireNonAlphanumeric = false;\n options.Password.RequireUppercase = false;\n options.Password.RequiredUniqueChars = 0;\n });\n }\n\n public void Configure(IApplicationBuilder app)\n {\n app.UseStaticFiles();\n\n app.UseDeveloperExceptionPage();\n\n app.UseAuthentication();\n\n app.UseMvc(routes =>\n {\n routes.MapRoute(\n name: \"default\",\n template: \"{controller=Home}/{action=Index}/{id?}\");\n });\n\n app.Run(async (context) =>\n {\n await context.Response.WriteAsync(\"Oopsie Doodle!\");\n });\n }\n }\n}</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_C++_> bgp_server_->database()->FindTable(\"bgp.l3vpn.0\"));\n ASSERT_TRUE(inetvpn_table != NULL);\n inetvpn_table->Enqueue(&request);\n }\n\n void DeleteInetVpnRoute(IPeer *peer, const string &instance_name,\n const string &prefix) {\n BgpTable *table = static_cast<BgpTable *>(\n bgp_server_->database()->FindTable(instance_name + \".inet.0\"));\n ASSERT_TRUE(table != NULL);\n const RoutingInstance *rtinstance = table->routing_instance();\n ASSERT_TRUE(rtinstance != NULL);\n int rti_index = rtinstance->index();\n\n string vpn_prefix;\n if (peer) {\n vpn_prefix = peer->ToString() + \":\" + integerToString(rti_index) +\n \":\" + prefix;\n } else {\n vpn_prefix = \"7.7.7.7:\" + integerToString(rti_index) + \":\" + prefix;\n }\n\n boost::system::error_code error;\n InetVpnPrefix nlri = InetVpnPrefix::FromString(vpn_prefix, &error);\n EXPECT_FALSE(error);\n\n DBRequest request;\n request.oper = DBRequest::DB_ENTRY_DELETE;\n request.key.reset(new InetVpnTable::RequestKey(nlri, peer));\n\n InetVpnTable *inetvpn_table = dynamic_cast<InetVpnTable *>(\n bgp_server_->database()->FindTable(\"bgp.l3vpn.0\"));\n ASSERT_TRUE(inetvpn_table != NULL);\n inetvpn_table->Enqueue(&request);\n }\n\n void AddConnectedRoute(IPeer *peer, const string &prefix,\n int localpref, string nexthop = \"7.8.9.1\",\n uint32_t flags = 0, int label = 0,\n vector<uint32_t> sglist = vector<uint32_t>(),\n set<string> encap = set<string>()) {\n string connected_table = service_is_transparent_ ? \"blue-i1\" : \"blue\";\n if (connected_rt_is_inetvpn_) {\n AddInetVpnRoute(peer, connected_table, prefix, localpref,\n sglist, encap, nexthop, flags, label);\n } else {\n AddInetRoute(peer, connected_table, prefix, localpref,\n vector<uint32_t>(), sglist, encap, SiteOfOrigin(), nexthop,\n flags, label);\n }\n task_util::WaitForIdle();\n }\n\n void AddConnectedRoute(int chain_idx, IPeer *peer, const string &prefix,</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_HTML_>{% include base_path %}\n\n<div class=\"masthead\">\n <div class=\"masthead__inner-wrap\">\n <div class=\"masthead__menu\">\n <nav id=\"site-nav\" class=\"greedy-nav\">\n <button><div class=\"navicon\"></div></button>\n <ul class=\"visible-links\">\n <li class=\"masthead__menu-item masthead__menu-item--lg masthead_pad\"><a href=\"{{ base_path }}/\">{{ <!-- site.title --> }}</a></li>\n {% for link in site.data.navigation.main %}\n {% if link.url contains 'http' %}\n {% assign domain = '' %}\n {% else %}\n {% assign domain = base_path %}\n {% endif %}\n <li class=\"masthead__menu-item\"><a href=\"{{ domain }}{{ link.url }}\">{{ link.title }}</a></li>\n {% endfor %}\n </ul>\n <ul class=\"hidden-links hidden\"></ul>\n </nav>\n </div>\n </div>\n</div></code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_SQL_>ALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `lastGps`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `numSessions`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `userAge`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `numCocktailsPrep`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `numCocktailsPurch`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `numPoints`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `userFBAgeGroup`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `userFBCountry`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `userEmail`;\nALTER TABLE `cocktail_dev`.`coctail_user` DROP COLUMN `userPushId`;\n\n\nALTER TABLE `cocktail_dev`.`coctail_user` ADD COLUMN `registrationType` VARCHAR(45) NULL AFTER `userFBLanguage`;\n\nUPDATE `coctail_user` SET `registrationType`= CASE WHEN char_length(`coctail_user`.`userID`) = 21 THEN \"Google\" ELSE \"FB\" END;</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_Ruby_>class User < ApplicationRecord\n\n VALID_EMAIL_REGEX = /\\A[\\w+\\-.]+@[a-z\\d\\-]+(\\.[a-z\\d\\-]+)*\\.[a-z]+\\z/i\n\n attr_accessor :remember_token, :activation_token, :reset_token\n\n has_many :microposts, dependent: :destroy\n has_many :active_relationships, class_name: \"Relationship\", foreign_key: \"follower_id\", dependent: :destroy\n has_many :passive_relationships, class_name: \"Relationship\", foreign_key: \"followed_id\", dependent: :destroy\n has_many :following, through: :active_relationships, source: :followed\n has_many :followers, through: :passive_relationships, source: :follower\n\n\n validates :name, presence: true, length: { maximum: 50 }\n validates :email, presence: true, length: { maximum: 255 }, \n format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false }\n validates :password, presence: true, length: { minimum: 6 }, allow_nil: true\n\n before_save :downcase_email\n before_create :create_activation_digest\n\n has_secure_password\n\n def User.digest(string)\n cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST : BCrypt::Engine.cost\n BCrypt::Password.create(string, cost: cost)\n end\n\n def User.new_token\n SecureRandom.urlsafe_base64\n end\n\n def remember\n self.remember_token = User.new_token\n update_attribute(:remember_digest, User.digest(remember_token))\n end\n\n def authenticated?(attribute, token)\n digest = send(\"#{attribute}_digest\")\n return false if digest.nil?\n BCrypt::Password.new(digest).is_password?(token)\n end\n\n def forget\n update_attribute(:remember_digest, nil)\n end\n\n def activate\n update_columns(activated: true, activated_at: Time.zone.now)\n end\n\n def send_activation_email\n UserMailer.account_activation(self).deliver_now\n end\n\n def create_reset_digest\n self.reset_token = User.new_token\n update_attribute(:reset_digest, User.digest(reset_token))\n update_attribute(:reset_sent_at, Time.zone.now)\n end\n\n def send_password_reset_email\n UserMailer.password_reset(self).deliver_now\n end\n\n def password_reset_expired?\n reset_sent_at < 2.hours.ago\n end\n\n def feed\n # Micropost.where(\"user_id = ?\", id) # temp feed\n following_ids = \"SELECT followed_id FROM relationships WHERE follower_id = :user_id\"\n Micropost.where(\"user_id IN (#{following_ids}) OR user_id = :user_id\", user_id: id)\n end\n\n # follows a user\n def follow(other_user)\n following << other_user\n end\n\n # unfollows a user\n def unfollow(other_user)\n following.delete(other_user)\n end\n\n # returns true if the current user is following the other user\n def following?(other_user)\n following.include?(other_user)\n end\n\n private\n\n def downcase_email\n self.email.downcase!\n end\n\n def create_activation_digest\n self.activation_token = User.new_token\n self.activation_digest = User.digest(activation_token)\n end\n\nend</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>\n\t/* Remove other source */\n\tif (fd == context->p1[0]) {\n\t\twl_event_source_remove(context->source2);\n\t\tcontext->source2 = NULL;\n\t} else if (fd == context->p2[0]) {\n\t\twl_event_source_remove(context->source1);\n\t\tcontext->source1 = NULL;\n\t} else {\n\t\tassert(0);\n\t}\n\n\treturn 1;\n}\n\nTEST(event_loop_free_source_with_data)\n{\n\tstruct wl_event_loop *loop = wl_event_loop_create();\n\tstruct free_source_context context;\n\tint data;\n\n\t/* This test is a little tricky to get right, since we don't\n\t * have any guarantee from the event loop (ie epoll) on the\n\t * order of which it reports events. We want to have one\n\t * source free the other, but we don't know which one is going\n\t * to run first. So we add two fd sources with a callback\n\t * that frees the other source and check that only one of them\n\t * run (and that we don't crash, of course).\n\t */\n\n\tassert(loop);\n\n\tcontext.count = 0;\n\tassert(pipe(context.p1) == 0);\n\tassert(pipe(context.p2) == 0);\n\tcontext.source1 =\n\t\twl_event_loop_add_fd(loop, context.p1[0], WL_EVENT_READABLE,\n\t\t\t\t free_source_callback, &context);\n\tassert(context.source1);\n\tcontext.source2 =\n\t\twl_event_loop_add_fd(loop, context.p2[0], WL_EVENT_READABLE,\n\t\t\t\t free_source_callback, &context);\n\tassert(context.source2);\n\n\tdata = 5;\n\tassert(write(context.p1[1], &data, sizeof data) == sizeof data);\n\tassert(write(context.p2[1], &data, sizeof data) == sizeof data);\n\n\twl_event_loop_dispatch(loop, 0);\n\n\tassert(context.count == 1);\n\n\tif (context.source1)\n\t\twl_event_source_remove(context.source1);\n\tif (context.source2)\n\t\twl_event_source_remove(context.source2);\n\twl_event_loop_destroy(loop);\n\n\tassert(close(context.p1[0]) == 0);\n\tassert(close(context.p1[1]) == 0);\n\tassert(close(context.p2[0]) == 0);\n\tassert(close(context.p2[1]) == 0);\n}\n\nstatic int\nsignal_callback(int signal_number, void *data)\n{\n\tint *got_it = data;\n\n\tassert(signal_number == SIGUSR1);\n\t++(*got_it);\n\n\treturn 1;\n}\n\nTEST(event_loop_signal)\n{\n\tstruct wl_event_loop *loop = wl_event_loop_create();\n\tstruct wl_event_source *source;\n\tint got_it = 0;\n\n\tsource = wl_event_loop_add_signal(loop, SIGUSR1,\n\t\t\t\t\t signal_callback, &got_it);\n\tassert(source);\n\n\twl_event_loop_dispatch(loop, 0);\n\tassert(!got_it);\n\tkill(getpid(), SIGUSR1);\n\twl_event_loop_dispatch(loop, 0);\n\tassert(got_it == 1);\n\n\twl_event_source_remove(source);\n\twl_event_loop_destroy(loop);\n}\n\nTEST(event_loop_multiple_same_signals)\n{\n\tstruct wl_event_loop *loop = wl_event_loop_create();\n\tstruct wl_event_source *s1, *s2;\n\tint calls_no = 0;\n\tint i;\n\n\ts1 = wl_event_loop_add_signal(loop, SIGUSR1,\n\t\t\t\t signal_callback, &calls_no);\n\tassert(s1);\n\n\ts2 = wl_event_loop_add_signal(loop, SIGUSR1,\n\t\t\t\t signal_callback, &calls_no);\n\tassert(s2);\n\n\tassert(wl_event_loop_dispatch(loop, 0) == 0);\n\tassert(!calls_no);\n\n\t/* Try it more times */\n\tfor (i = 0; i < 5; ++i) {\n\t\tcalls_no = 0;\n\t\tkill(getpid(), SIGUSR1);\n\t\tassert(wl_event_loop_dispatch(loop, 0) == 0);\n\t\tassert(calls_no == 2);\n\t}\n\n\twl_event_source_remove(s1);\n\n\t/* Try it again with one source */\n\tcalls_no = 0;\n\tkill(getpid(), SIGUSR1);\n\tassert(wl_event_loop_dispatch(loop, 0) == 0);\n\tassert(calls_no == 1);\n\n\twl_event_source_remove(s2);\n\n\twl_event_loop_destroy(loop);\n}\n\nstatic int\ntimer_callback(void *data)\n{\n\tint *got_it = data;\n\n\t++(*got_it);\n\n\treturn 1;\n}\n\nTEST(event_loop_timer)\n{\n\tstruct wl_event_loop *loop = wl_event_loop_create();\n\tstruct wl_event_source *source;\n\tint got_it = 0;\n\n\tsource = wl_event_loop_add_timer(loop, timer_callback, &got_it);\n\tassert(source);\n\twl_event_source_timer_update(source, 10);\n\twl_event_loop_dispatch(loop, 0);\n\tassert(!got_it);\n\twl_event_loop_dispatch(loop, 20);\n\tassert(got_it == 1);\n\n\twl_event_source_remove(source);\n\twl_event_loop_destroy(loop);\n}\n\n#define MSEC_TO_USEC(msec) ((msec) * 1000)\n\nstruct timer_update_context {\n\tstruct wl_event_source *source1, *source2;\n\tint count;\n};\n\nstatic int\ntimer_update_callback_1(void *data)\n{\n\tstruct timer_update_context *context = data;\n\n\tcontext->count++;\n\twl_event_source_timer_update(context->source2, 1000);\n\treturn 1;\n}\n\nstatic int\ntimer_update_callback_2(void *data)\n{\n\tstruct timer_update_context *context = data;\n\n\tcontext->count++;\n\twl_event_source_timer_update(context->source1, 1000);\n\treturn 1;\n}\n\nTEST(event_loop_timer_updates)\n{\n\tstruct wl_event_loop *loop = wl_event_loop_create();\n\tstruct timer_update_context context;\n\tstruct timeval start_time, end_time, interval;\n\n\t/* Create two timers that should expire at the same time (after 10ms).\n\t * The first timer to receive its expiry callback updates the other timer\n\t * with a much larger timeout (1s). This highlights a bug where\n\t * wl_event_source_timer_dispatch would block for this larger timeout\n\t * when reading from the timer fd, before calling the second timer's\n\t * callback.\n\t */\n\n\tcontext.source1 = wl_event_loop_add_timer(loop, timer_update_callback_1,\n\t\t\t\t\t\t &context);\n\tassert(context.source1);\n\tassert(wl_event_source_timer_update(context.source1, 10) == 0);\n\n\tcontext.source2 = wl_event_loop_add_timer(loop, timer_update_callback_2,\n\t\t\t\t\t\t &context);\n\tassert(context.source2);\n\tassert(wl_event_source_timer_update(context.source2, 10) == 0);\n\n\tcontext.count = 0;\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Java_>\t\tparticles.add(particle);\n\t}\n\n\tprivate void updateVBO(Matrix4 view, Matrix4 projection) {\n\t\tbuffer.clear();\n\n\t\tfor (Particle p : particles) {\n\t\t\tbuffer.put(p.color.r).put(p.color.g).put(p.color.b).put(p.color.a);\n\t\t\tprojection.mul(p.getModelView(view)).toBuffer(buffer);\n\t\t}\n\n\t\tbuffer.flip();\n\n\t\tglBufferSubData(GL_ARRAY_BUFFER, 0, buffer);\n\t}\n\n\tpublic void render(Matrix4 view, Matrix4 projection) {\n\t\tif (particles.size() != 0) {\n\t\t\tshader.bind();\n\n\t\t\tglBindVertexArray(vao);\n\t\t\tglBindBuffer(GL_ARRAY_BUFFER, streamVBO);\n\n\t\t\tupdateVBO(view, projection);\n\n\t\t\tglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo);\n\n\t\t\tglDrawElementsInstanced(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0, particles.size());\n\n\t\t\tglBindBuffer(GL_ARRAY_BUFFER, 0);\n\t\t\tglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);\n\t\t\tglBindVertexArray(0);\n\n\t\t\tshader.release();\n\t\t}\n\t}\n\n\t@Override\n\tpublic void onRemove() {\n\t\tshader.dispose();\n\t}\n\n\tpublic Vector3 getGravity() {\n\t\treturn gravity;\n\t}\n\n\tpublic void setGravity(Vector3 gravity) {\n\t\tthis.gravity = gravity;\n\t}\n\n\tpublic Shader getShader() {\n\t\treturn shader;\n\t}\n\n\tpublic List<Particle> getParticles() {\n\t\treturn particles;\n\t}\n\n\tpublic BlendMode getBlendMode() {\n\t\treturn blendMode;\n\t}\n\n\tpublic void setBlendMode(BlendMode blendMode) {\n\t\tthis.blendMode = blendMode;\n\t}\n\n\tpublic SortMode getSortMode() {\n\t\treturn sortMode;\n\t}\n\n\tpublic void setSortMode(SortMode sortMode) {\n\t\tthis.sortMode = sortMode;\n\t}\n\n\tpublic Color getStartColor() {\n\t\treturn startColor;\n\t}\n\n\tpublic void setStartColor(Color startColor) {\n\t\tthis.startColor = startColor;\n\t}\n\n\tpublic Color getEndColor() {\n\t\treturn endColor;\n\t}\n\n\tpublic void setEndColor(Color endColor) {\n\t\tthis.endColor = endColor;\n\t}\n\n\tpublic void setRotationSpeed(float rotationSpeed) {\n\t\tthis.rotationSpeed = rotationSpeed;\n\t}\n\n\tpublic Filter getFilter() {\n\t\treturn filter;\n\t}\n\n\tpublic void setFilter(Filter filter) {\n\t\tthis.filter = filter;\n\t}\n\n\tpublic static class Particle {\n\n\t\tprivate Vector3 position;\n\t\tprivate Vector3 velocity;\n\t\tprivate float gravity;\n\t\tprivate float lifetime;\n\t\tprivate float rotation;\n\t\tprivate float scale;\n\t\tprivate float age;\n\t\tprivate float distance;\n\t\tprivate Color color;\n\n\t\tpublic Particle() {\n\t\t\tposition = new Vector3();\n\t\t\tvelocity = new Vector3();\n\t\t\tcolor = Color.createWhite();\n\t\t\tgravity = 1.0f;\n\t\t\tscale = 1.0f;\n\t\t}\n\n\t\tpublic void setPosition(Vector3 position) {\n\t\t\tthis.position = position;\n\t\t}\n\n\t\tpublic void setVelocity(Vector3 velocity) {\n\t\t\tthis.velocity = velocity;\n\t\t}\n\n\t\tpublic void setLifetime(float lifetime) {\n\t\t\tthis.lifetime = lifetime;\n\t\t}\n\n\t\tpublic void setScale(float scale) {\n\t\t\tthis.scale = scale;\n\t\t}\n\n\t\tpublic void setRotation(float rotation) {\n\t\t\tthis.rotation = rotation;\n\t\t}\n\n\t\tpublic void setGravity(float gravity) {\n\t\t\tthis.gravity = gravity;\n\t\t}\n\n\t\tpublic Matrix4 getModelView(Matrix4 view) {\n\t\t\tMatrix4 model = Matrix4.createTranslation(position);\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_Python_># 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\n\"\"\"oslo_i18n integration module.\n\nSee http://docs.openstack.org/developer/oslo_i18n/usage.html\n\n\"\"\"\n\ntry:\n import oslo_i18n\n\n # NOTE(dhellmann): This reference to o-s-l-o will be replaced by the\n # application name when this module is synced into the separate\n # repository. It is OK to have more than one translation function\n # using the same domain, since there will still only be one message\n # catalog.\n _translators = oslo_i18n.TranslatorFactory(domain='iotronic')\n\n # The primary translation function using the well-known name \"_\"\n _ = _translators.primary\n\n # Translators for log levels.\n #\n # The abbreviated names are meant to reflect the usual use of a short\n # name like '_'. The \"L\" is for \"log\" and the other letter comes from\n # the level.\n _LI = _translators.log_info\n _LW = _translators.log_warning\n _LE = _translators.log_error\n _LC = _translators.log_critical\nexcept ImportError:\n # NOTE(dims): Support for cases where a project wants to use\n # code from oslo_incubator, but is not ready to be internationalized\n # (like tempest)\n _ = _LI = _LW = _LE = _LC = lambda x: x\n</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_C_>#include <stdio.h>\n\nint main()\n{\n int a=0,b=0,d=0,r=0;\n float f=0;\n \n scanf(\"%d %d\\n\",&a,&b);\n \n d=a/b;\n r=a%b;\n f=1.0*a/b;\n \n printf(\"%d %d %f\\n\",d,r,f);\n \n return 0;\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]
[ { "assistant": "<loc_0><loc_0><loc_500><loc_500><_JavaScript_>'use strict';\n\n/**\n * Module dependencies.\n */\nvar mongoose = require('mongoose'),\n crypto = require('crypto'),\n\t Schema = mongoose.Schema;\n\n/**\n * AccessToken Schema\n */\nvar AccessTokenSchema = new Schema({\n user: {\n type: Schema.ObjectId,\n ref: 'User',\n required: true\n },\n token: {\n type: String,\n unique: true,\n required: true\n },\n created: {\n type: Date,\n default: Date.now\n }\n});\n\nAccessTokenSchema.methods.isExpired = function isExpired() {\n return Math.round((Date.now() - this.created) / 1000) > 5184000;\n};\n\nAccessTokenSchema.statics.newToken = function newToken(user) {\n return new this({\n user: user,\n token: crypto.randomBytes(32).toString('base64')\n });\n};\n\nmongoose.model('AccessToken', AccessTokenSchema);</code>", "source": "SynthCodeNetNoImageTag", "user": "<code>" } ]
[ { "assistant": "<code><loc_0><loc_0><loc_500><loc_500><_PHP_> * If you did not receive a copy of the license and are unable to\n * obtain it through the world-wide-web, please send an email\n * to license@zend.com so we can send you a copy immediately.\n *\n * @category Zend\n * @package Zend_Dojo\n * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)\n * @license http://framework.zend.com/license/new-bsd New BSD License\n * @version $Id$\n */\n\n/**\n * @namespace\n */\nnamespace Zend\\Dojo;\n\n/**\n * Exception class for Zend_Dojo\n *\n * @uses \\Zend\\Exception\n * @package Zend_Dojo\n * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)\n * @license http://framework.zend.com/license/new-bsd New BSD License\n */\nclass Exception extends \\Zend\\Exception\n{\n}\n</code>", "source": "SynthCodeNetNoImageTag", "user": "Convert code to text." } ]