code large_string | generator large_string | language large_string | model_family large_string | label int64 | binary_label int64 |
|---|---|---|---|---|---|
python
def minSwapsCouples(row):
n = len(row) // 2
parent = list(range(n))
def find(x):
if parent[x] != x:
parent[x] = find(parent[x])
return parent[x]
for i in range(0, len(row), 2):
a, b = row[i] // 2, row[i + 1] // 2
parent[find(a)] = find(b)
... | microsoft/phi-3-medium-4k-instruct | Python | phi | 2 | 1 |
class Calculadora {
sumar(num1, num2) {
return num1 + num2;
}
restar(num1, num2) {
return num1 - num2;
}
multiplicar(num1, num2) {
return num1 * num2;
}
dividir(num1, num2) {
return num1 / num2;
}
} | qwen/qwq-32b | JavaScript | qwen | 1 | 1 |
cpp
#include <iostream>
#include <vector>
#include <algorithm>
std::vector<std::vector<int>> read_matrix(int n, int m) {
std::vector<std::vector<int>> matrix(n, std::vector<int>(m));
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j) {
std::cin >> matrix[i][j];
}
}
r... | qwen/qwen2.5-coder-1.5b | C++ | qwen | 1 | 1 |
import { openDB } from 'idb';
import { demoFoods, demoMeals } from './DemoData';
const dbConfigs = {
localFoods: {
dbName: 'localFoods',
config: { keyPath: 'id', autoIncrement: true},
addIdIndex: true,
dataPopulator: addDemoFoods
},
sfcdCache: {
dbName: 'sfcdFoods',
config: { keyPath: 'id' },
addIdInd... | human | JavaScript | human | 0 | 0 |
})
\item \textbf{\ ~/.bashrc}
\begin{python}
echoalias ll='ls -alt'
alias cat='bat'
alias psg='ps aux | grep'
alias lscd='ls -l | grep -i'
alias cd..='cd ..'
alias cls='printf "\033c"'
alias ls='ls --color=auto'
ls -I ".git"'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
\end{python}
\item \textbf{... | ibm-granite/granite-8b-code-instruct-4k | C | ibm-granite | 6 | 1 |
"""
import subprocess
class Solution:
def __init__(self):
pass
def stopDocker(self, name, cid, let_fail):
if cid:
val = '--cidfile '.split()
val.append(cid)
else:
val = '-a'.split()
sub = subprocess.call(('docker', 'stop')+tuple(val)+(name,), stderr = subprocess.STDOUT)
if let_f... | deepseek-ai/deepseek-coder-6.7b-instruct | Python | deepseek | 8 | 1 |
import re
from pathlib import Path
def extract_doc_comments(file_content):
doc_comments = {}
regex_pattern = (
r'/\*\*([^*]|[\*]+[^/])*\*/' + # Finds all block comments
r'([A-Z_][A-Z0-9_]*\s*(?:\(.*?\)\s*)*\(.*?\))' # Captures function/method signature
)
matches = re.finditer(regex_pa... | microsoft/phi-3-mini-4k-instruct | JavaScript | phi | 2 | 1 |
void TrieNode::insert(const IpAddress& dest, const uint32_t length, size_t position) {
if (length == 0) {
this->end = true;
}
if (position >= IpAddress::BLOCK_SIZE) {
return;
}
int next = getSignificantBit(dest, position);
if (next == 1) {
if (one == nullptr) {
... | ibm-granite/granite-8b-code-base-4k | C++ | ibm-granite | 6 | 1 |
from bisect import bisect_right
inp=open(input())
n=int(inp.readline())
k=int(inp.readline())
inp.readline()
#inp=inp.read().split()
r=inp.readline().split()
r=[int(_) for _ in r]
q=[]
for _ in range(k):
t=inp.readline().split()
t=[int(_) for _ in t]
q.append(t)
data=[]
for i in range(1,n+1):
bl=bisect... | microsoft/phi-2 | Python | phi | 2 | 1 |
import re
s = s.split()
words = [re.sub(r'[^\w\s]', '', word).lower() for word in s] # remove punctuation and convert to lowercase
unique_words = set(words) # get unique words
word_count = {word: words.count(word) for word in unique_words} # count occurrences of each word
print(word_count) # print the word count d... | qwen/qwen2.5-72b-instruct | Python | qwen | 1 | 1 |
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var pump = require('pump');
gulp.task('jsbuild', ['jsuglify']);
// var sourcemaps = require('gulp-sourcemaps');
// var minify = function (sources, destination) {
// return gulp... | human | JavaScript | human | 0 | 0 |
python
def can_kill(A, B, n, a, b):
dp = [True] * (B + 1)
for b in range(B, -1, -1):
if b >= a[n-1]:
dp[b] = dp[b] and dp[b - a[n-1]]
for a in reversed(a):
for b in range(B, -1, -1):
if b >= a:
dp[b] = dp[b] and dp[max(0, b - a)]
return dp[-1]
t =... | qwen/qwen2.5-coder-1.5b-instruct | Python | qwen | 1 | 1 |
n = int(input())
time = list(map(int,input().split()))
velocity = list(map(int,input().split()))
s = 0
for i in range(1,len(time)):
velocity[i-1], velocity[i] = max(velocity[i-1],velocity[i]), min(velocity[i-1],velocity[i])
velocity[-1] = min(velocity[-1],velocity[-2])
s = time[0]*velocity[0]
time = [0]+time
... | bigcode/starcoder2-15b | Python | bigcode | 7 | 1 |
#include <stddef.h>
// Assume MINIMAL_TUPLE_STRUCT is defined elsewhere
// and has the following structure:
// struct minimal_tuple {
// int tuple_size;
// union {
// float null_flts[N];
// // other fields
// } type;
// };
// These are function prototypes for MinimalTuple creation
MINIMAL_... | ibm-granite/granite-3.2-2b-instruct | C | ibm-granite | 6 | 1 |
public static void OnNavigationError(this Task<INavigationResult> navigationTask, Action<Exception> errorCallback)
{
navigationTask.Await(r =>
{
if (!r.Success)
errorCallback?.Invoke(r.Exception);
});
} | human | C# | human | 0 | 0 |
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(RequestTrafficView));
this._splitContainer = new System.Windows.Forms.SplitContainer();
this._r... | human | C# | human | 0 | 0 |
m = int(input())
a = []
for i in range(n):
a.append(int(input()))
a.sort()
print(a[n-1], a[n-1]+m) | bigcode/starcoder2-15b | Python | bigcode | 7 | 1 |
class Document:
def __init__(self):
self.click_count = 0
class ContentProvider:
def __init__(self):
self.id = id(self)
self.document_set = set()
def consume_document(self, document):
if document not in self.document_set:
document.click_count += 1
... | mistralai/mistral-small-24b-instruct-2501 | Python | mistral | 10 | 1 |
<?php
/**
* Vonage Client Library for PHP
*
* @copyright Copyright (c) 2016-2020 Vonage, Inc. (http://vonage.com)
* @license https://github.com/Vonage/vonage-php-sdk-core/blob/master/LICENSE.txt Apache License 2.0
*/
declare(strict_types=1);
namespace VonageTest\Insights;
use VonageTest\VonageTestCase;
use Von... | human | PHP | human | 0 | 0 |
def solve(a):
c = Counter(a)
return min(c.values())
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
print(solve(a)) | bigcode/starcoder2-15b | Python | bigcode | 7 | 1 |
public String sendFileMessage(String threemaId, File fileMessageFile, File thumbnailMessagePath) throws InvalidKeyException, IOException, NotAllowedException {
byte[] publicKey = this.apiConnector.lookupKey(threemaId);
if(publicKey == null) {
throw new InvalidKeyException("invalid threema id");
}
CapabilityR... | human | Java | human | 0 | 0 |
// Object must set the field when refill
// , otherwise, google protocol buffer will return a failure
// This is merged with another object
// MObject Proto Definition
// Proto Generated
// lastChange
/**
*
*/
long lastChange;
/**
* @param lastChange
*/
public MObject setLastChange(long ... | qwen/qwen2.5-7b-instruct | Java | qwen | 1 | 1 |
def over_the_road(address, n):
total_sum = n * (n + 1) // 2
left_sum = address + (address - 1) * address // 2
right_sum = total_sum - left_sum
return right_sum
| microsoft/phi-3-small-8k-instruct | Python | phi | 2 | 1 |
package main
import (
"fmt"
)
type TaskNode struct {
ID int
}
func ShiftOrder(nodes []TaskNode, step int, stride int) {
n := len(nodes)
if n == 0 {
return
}
shift := step
if stride > n {
shift *= n / stride
} else if stride < n {
shift = step
}
// Perform the rotation
shift = (shift % n + n) % n /... | microsoft/phi-4 | Go | phi | 2 | 1 |
#ifndef PAINTB_H
#define PAINTB_H
#define COMP_KEY 4826
#include
#include
class canvas;
class canvasCRS;
enum funcType { voidPtr, cnvVoidPtr};
struct func {
union {
void (*voidFunc) ();
void (canvasCRS::*cnvFunc) ();
};
funcType type;
};
class canvas {
protected:
typedef struct FS {
unsigned char *fr... | human | C | human | 0 | 0 |
import sys
def solve(x):
dp = [0] * (x + 1)
dp[1] = 3
for i in range(2, x + 1):
dp[i] = dp[i - 1] + 2 * (dp[i - 1] // 2 + 1)
return dp[x] + 1
x = int(sys.stdin.readline().strip())
print(solve(x)) | codellama/codellama-34b-instruct-hf | Python | meta-llama | 3 | 1 |
#Function to rearrange the array elements alternately.
def rearrange(self,arr, n):
temp = 0
max_index = n-1
min_index = 0
max_elem = arr[-1] + 1
for i in range(n):
if i%2 == 0:
arr[i] += (arr[max_index]%max_elem)*max_elem
... | deepseek-ai/deepseek-coder-6.7b-base | Python | deepseek | 8 | 1 |
# Letter to Future Self
def write_letter_to_future_self():
letter = """
Dear Future Me,
As I sit down to write this letter, I am filled with hopes and dreams for the next five years.
Here are some of the aspirations I wish to achieve and reflect upon the person I hope to become.
1. **Career Aspi... | gpt-4o-mini | Python | gpt | 9 | 1 |
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers, models
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report, confusion_matrix
from tensorflow.keras.preprocessing import image_dataset_from_directory
# Load and... | gpt-4o-mini | Python | gpt | 9 | 1 |
package main
import (
"encoding/json"
"errors"
"html/template"
"log"
"net/http"
"os"
"sync"
"github.com/gorilla/mux"
"github.com/gorilla/schema"
"github.com/qsheda/gochart" // hypothetical chart library
)
var (
decoder = schema.NewDecoder()
data = make(map[string]interface{})
mu sync.Mutex
)
co... | gpt-4o-mini | Go | gpt | 9 | 1 |
public string RenameFolder(string oldName, string newName, IMailDb.Folders folder)
{
try
{
if (!ProperNameCheck(oldName) || !ProperNameCheck(newName))
{
return "BAD";
}
if (!folder.FolderExists(oldName))
{
return "NO";
}
... | deepseek-ai/deepseek-coder-1.3b-instruct | C# | deepseek | 8 | 1 |
def min_operations_to_form_t(s, t):
# Create a dictionary to store the indices of each character in s
char_indices = {}
for idx, char in enumerate(s):
if char not in char_indices:
char_indices[char] = []
char_indices[char].append(idx)
# Edge case: if t cannot be formed b... | microsoft/phi-3-medium-4k-instruct | Python | phi | 2 | 1 |
/*
linphone, gtk-glade interface.
Copyright (C) 2009 (
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distr... | human | C | human | 0 | 0 |
public static List<int> BubbleSort(List<int> inputList)
{
int n = inputList.Count;
for (int i = 0; i < n - 1; i++)
{
for (int j = 0; j < n - i - 1; j++)
{
if (inputList[j] > inputList[j + 1])
{
int temp = inputList[j];
inputList[j] = in... | microsoft/phi-3-small-8k-instruct | C# | phi | 2 | 1 |
<?php
namespace Expose\Test\TestCase\Reverser;
use Cake\TestSuite\TestCase;
use Expose\Reverser\Reverser;
class ReverserTest extends TestCase {
/**
* @var \Expose\Reverser\Reverser
*/
protected $reverser;
/**
* @return void
*/
public function setUp(): void {
parent::setUp();
$this->reverser = new ... | human | PHP | human | 0 | 0 |
void
gtk_box_set_baseline_position (GtkBox *box,
GtkBaselinePosition position)
{
GtkBoxLayout *box_layout;
g_return_if_fail (GTK_IS_BOX (box));
box_layout = GTK_BOX_LAYOUT (gtk_widget_get_layout_manager (GTK_WIDGET (box)));
if (position == gtk_box_layout_get_baseline_p... | human | C | human | 0 | 0 |
function patternMatching(nums, pattern) {
let n = nums.length;
let m = pattern.length;
let count = 0;
for (let i = 0; i <= n - (m + 1); i++) {
let match = true;
for (let k = 0; k < m; k++) {
if (pattern[k] === 1 && nums[i + k + 1] <= nums[i + k]) {
match = fa... | microsoft/phi-3-medium-4k-instruct | JavaScript | phi | 2 | 1 |
import math
import string
import time
import io
import os
from collections import defaultdict
#from copy import deepcopy
from bisect import bisect_left
from heapq import *
import re
import sys
import random
import bisect
import math
sys.setrecursionlimit(100000)
f=open("11446.in","r")
sys.stdin=f
def readLine():
... | bigcode/starcoder | Python | bigcode | 7 | 1 |
public static List<string> GetDuplicateOutputFiles(string outputPath, string dbContextClassName, List<IEntityType> entityTypes)
{
var resultFiles = new List<string>();
// Filter for existing files which are read-only
var files = Directory.GetFiles(outputPath, "*.sql").Where(f => !File.GetAttributes(f).... | 01-ai/yi-coder-1.5b-chat | C# | 01-ai | 4 | 1 |
ddress', 'coder
English and aren't they beautifull?
-----Explanation-----
-- Sample Case 01 --
With the given S and S' as the input, he performs the following steps.
- W := None
- cnt := 0
- For i in range(0, |S'| - 5)
- if W = the string S', W = None
- if W does not exist
- if the subs... | bigcode/starcoder | Python | bigcode | 7 | 1 |
using System;
public class Program
{
public static void Main()
{
CheckCorrectOrNot(null, null);
}
/// <summary>
/// This subprogram opens the function subprogram CheckCorrectOrNot() to determine score changes for the user
/// </summary>
public static void CheckCorrectOrNot(object s... | 01-ai/yi-coder-1.5b-chat | C# | 01-ai | 4 | 1 |
totalCase = []
for _ in range(n):
string = input()
is_string = "" # string object
are_string = is_string + string[:] # string copy
count = 0
first_start = 0 # start index
last_end = len(string[-1])-1 # end index
for k, v in enumerate(string): # looping in the string value k = key v = va... | codellama/codellama-7b-hf | Python | meta-llama | 3 | 1 |
package com.example.application;
/**
* <p>This {@link IProcessor} implementation allows for simple equality-based
* filtering on top-level FoD vulnerability fields like severity and assignee.
* Any filters configured on this class will be appended as filter request
* parameters when requesting the list of vulnerab... | qwen/qwen2.5-coder-1.5b-instruct | Java | qwen | 1 | 1 |
public boolean handleTimeout(HandshakeResult result) {
if (!result.isHandshakeComplete()) {
return true;
}
return false;
}
| qwen/qwen2.5-coder-7b-instruct | Java | qwen | 1 | 1 |
class Solution {
tuple<int, string, string> parse(string &s) {
int dot = s.find('.');
if (dot == string::npos) {
return {stoi(s), string(), string()};
}
int intpart = stoi(s.substr(0, dot));
int left = s.find('(');
if (left == string::npos) {
r... | human | C++ | human | 0 | 0 |
char *x11_display(const char *display) {
char *ret;
if(!display || !*display) {
if((ret = platform_get_x_display())==0 || !*ret)
ret = dupstr(":0");
} else
ret = dupstr(display);
if(ret[0] == ':') {
char *s = dupcat(platform_x11_best_transport, ret, (char *)0);
sfree(ret);
return s;
} else... | human | C | human | 0 | 0 |
python
t = int(input())
for _ in range(t):
n0, n1, n2 = map(int, input().split())
s = ""
if n0 % 2 == 0:
s += '1' * (n0 // 2)
s += '0' * ((n0 + 1) // 2)
else:
s += '1' * ((n0 + 1) // 2)
s += '0' * (n0 // 2)
if n1 % 2 == 0:
s += '0' * (n1 // 2)
s += '1'... | qwen/qwen2.5-coder-1.5b-instruct | Python | qwen | 1 | 1 |
sys.setrecursionlimit(10000)
T = int(input())
for _ in range(T):
X = input()[::-1]
Y = input()[::-1]
min_k = 1
l_max = min(len(X), len(Y) + min_k)
while X[l_max] == '0' and min_k <= l_max:
min_k += 1
l_max = min(len(X), len(Y) + min_k)
for l in range(min_k, l_max + 1):
#... | bigcode/starcoder2-15b | Python | bigcode | 7 | 1 |
#include <iostream>
#include <bitset>
int subsetXORSum(int nums[], int size) {
int n = 1 << size;
long long res = 0;
for (int i = 0; i < n; i++) {
int xorTotal = 0;
for (int j = 0; j < size; j++) {
if (i & (1 << j)) {
xorTotal ^= nums[j];
}
}
... | meta-llama/llama-3.1-8b-instruct | C++ | meta-llama | 3 | 1 |
import sys
input = sys.stdin.read
data = input().split()
N = int(data[0])
S = int(data[1])
def can_win(N, S):
if N == 1:
if S < 1:
return False
return True, [S], S // 2
elif N == 2:
if S < 2:
return False
return True, [1, S - 1], S // 2
else:
... | qwen/qwen2.5-coder-7b-instruct | Python | qwen | 1 | 1 |
, no explanation.
import itertools
def is_good(s):
return len(set(s)) != 1
def find_min_cuts(s):
min_cuts = len(s)
min_cuts_sequence = [s]
for i in range(1, len(s)):
for j in range(i, len(s)):
s1, s2 = s[:i], s[i:j]
if is_good(s1) and is_good(s2):
... | microsoft/phi-3-mini-4k-instruct | Python | phi | 2 | 1 |
foreach (IAgStkObject thisMto in mtos)
{
TreeNode mtoNode = new TreeNode(thisMto.Name);
// get all MTO components
IAgStkObjectElementCollection components = thisMto.Children.GetElements(AgESTKObjectType.eMTOComponent);
if (components.Count > 0)
{
foreach (IAgStkObject component in compone... | meta-llama/meta-llama-3.1-8b-instruct | C# | meta-llama | 3 | 1 |
(no explanations necessary).
def smallest_operations(a, b, n):
operations = 0
while a <= n and b <= n:
temp = a
a += b
b = temp
operations += 1
return operations
t = int(input())
for _ in range(t):
a, b, n = map(int, input().split())
print(smallest_operations(a, b... | microsoft/phi-3.5-mini-instruct | Python | phi | 2 | 1 |
public static string PadOrCut(this string @string, ushort newlength, Position position, char paddingChar)
{
if (@string == null)
throw new ArgumentNullException(nameof(@string));
if (newlength == 0)
return string.Empty;
if (@string.Length == ne... | human | C# | human | 0 | 0 |
#define NUM 105
#define LEN 26
static inline int
mmax(int a, int b)
{ return a > b? a: b; }
static inline int
mmin(int a, int b)
{ return a < b? a: b; }
struct cpair {
char domain[NUM];
int cnt;
};
struct cpair pairs[4*NUM];
int tot;
static inline void proc(char *s)
{
int cnt, i=0, j, l;
char name[NUM];
sscanf(s,... | human | C | human | 0 | 0 |
MOS_STATUS MOS_utilities_close()
{
MOS_STATUS eStatus = MOS_STATUS_SUCCESS;
MOS_OS_FUNCTION_ENTER;
MosUtilUserInterfaceClose();
eStatus = MOS_OS_Utilities_Close();
MosSimulateRandomAllocMemoryFailFreq = 0;
return eStatus;
} | human | C | human | 0 | 0 |
import requests
from textblob import TextBlob
import pandas as pd
import matplotlib.pyplot as plt
from bs4 import BeautifulSoup
import time
import logging
logging.basicConfig(level=logging.INFO)
class SentimentAnalysisTool:
def __init__(self, keywords, platform):
self.keywords = keywords
self.plat... | gpt-4o-mini | Python | gpt | 9 | 1 |
namespace ExcelBot.Model
{
public enum ObjectType
{
Cell,
NamedItem,
Chart,
Table
}
} | microsoft/phi-4 | C# | phi | 2 | 1 |
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class ToolRental {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String toolName;
private Date rentalDate... | ibm-granite/granite-3.2-2b-instruct | Java | ibm-granite | 6 | 1 |
from typing import Dict
class BrainInfo:
def __init__(self, visual_observation, vector_observation, text_observations, memory=None,
reward=None, agents=None, local_done=None,
vector_action=None, text_action=None, max_reached=None, action_mask=None):
"""
Describes ... | human | Python | human | 0 | 0 |
static void dpa_make_private_pool(struct dpa_bp *dpa_bp)
{
int i;
dpa_bp->percpu_count = __alloc_percpu(sizeof(*dpa_bp->percpu_count),
__alignof__(*dpa_bp->percpu_count));
/* Give each cpu an allotment of "count" buffers */
for_each_online_cpu(i) {
int *thiscount;
int *countptr;
int j;
thiscount = per_... | human | C | human | 0 | 0 |
private static BreadcrumbLink GetLinkAtPosition(HtmlDocument htmlDom, int position)
{
var breadCrumbLink = new BreadcrumbLink();
var crumbElement = htmlDom.DocumentNode.Descendants("li").Skip(position).FirstOrDefault();
if (crumbElement != null)
{
... | human | C# | human | 0 | 0 |
k2, k3, k5, k6 = map(int, input().split())
sum = 0
while k5 > 0 and k2 > 1:
sum += 256
k5 -= 1
k2 -= 2
if k2 > 0 and k3 > 0:
sum += 32
k2 -= 1
k3 -= 1
print(sum) | codellama/codellama-34b-instruct-hf | Python | meta-llama | 3 | 1 |
python
def rearrange_array(n, a):
a.sort()
new_array = []
for i in range(0, n - 1, 2):
new_array.append(a[i])
new_array.append(a[i + 1])
if n % 2 != 0:
new_array.append(a[-1])
return new_array
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, inp... | microsoft/phi-3.5-mini-instruct | Python | phi | 2 | 1 |
#include <iostream>
#include <vector>
#include <cstdint>
// Define a structure to represent a mapping
struct Mapping {
uint32_t start; // DMA start position
uint32_t length; // Length of the mapping
uint32_t end; // DMA end position (calculated)
// Constructor to initialize start and length
Ma... | microsoft/phi-4 | C++ | phi | 2 | 1 |
I hope it is clear!
这是一个数字索引最大化的问题,并将搜索范围以列索引划分,然后从小到大扫描,Python与java风格相同。下面是Java代码:
```java
public int[] findRightInterval(int[][] intervals) {
int n = intervals.length;
int[][] starts = new int[n][2];
for (int i = 0; i < n; ++i) {
starts[i] = new int[] {intervals[i][0], i};
... | 01-ai/yi-coder-1.5b-chat | Java | 01-ai | 4 | 1 |
.
*/
public class MissingElementinAP {
public static long findMissing(long arr[], int n) {
// Your code here
long min = arr[0];
long max = arr[n-1];
long mid = (min + max)/2;
while(true){
if(arr[(int)mid] - arr[(int)mid-1] > 1){
System.out.print... | deepseek-ai/deepseek-coder-1.3b-base | Python | deepseek | 8 | 1 |
func CloseDevice(d Device) {
}
type Device interface {
Close() error
} | 01-ai/yi-coder-9b-chat | Go | 01-ai | 4 | 1 |
<!DOCTYPE html>
<html lang="ru">
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="
<meta property="og:title" content="
<meta property="og:type" content="si... | human | PHP | human | 0 | 0 |
struct extent_buffer *btrfs_root_node(struct btrfs_root *root)
{
struct extent_buffer *eb;
spin_lock(&root->node_lock);
eb = root->node;
extent_buffer_get(eb);
spin_unlock(&root->node_lock);
return eb;
} | human | C | human | 0 | 0 |
<?php
// Check if the form is submitted
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Retrieve form data
$name = isset($_POST['name']) ? htmlspecialchars($_POST['name'], ENT_QUOTES, 'UTF-8') : '';
$email = isset($_POST['email']) ? htmlspecialchars($_POST['email'], ENT_QUOTES, 'UTF-8') : '';
$message ... | microsoft/phi-4 | PHP | phi | 2 | 1 |
void stm32_spi_read_rxfifo(spi_handle_t *spi) {
uint32_t rx_bytes_left = spi->rx_bytes_left;
uint32_t *rx_buf = spi->rx_buf;
while (rx_bytes_left && spi->rxfifo_count) {
*rx_buf = SPI_ReadRXData(spi->spi_base);
rx_buf++;
spi->rxfifo_count--;
rx_bytes_left--;
}
/* Ensure we do not write beyond the end of ... | qwen/qwen2.5-coder-7b-instruct | C | qwen | 1 | 1 |
// project: 82a76d76c26f25285d4bc91f04a0065b
// vendor: github.com/ninjas-CAMO/gdk
// logger.go
package gdk
import (
"fmt"
"log"
)
// Logger represents a logging interface
type Logger struct{}
// NewLogger returns a new instance of a Logger
func NewLogger() *Logger {
return &Logger{}
}
func (l *Logger) Logf(fi... | meta-llama/llama-3.1-8b-instruct | Go | meta-llama | 3 | 1 |
func (c *Client) DetectLanguage(ctx context.Context, inputs []string) ([][]Detection, error) {
call := c.raw.Detections.List(inputs).Context(ctx)
setClientHeader(call.Header())
res, err := call.Do()
if err != nil {
return nil, err
}
var result [][]Detection
for _, raws := range res.Detections {
var ds []Dete... | human | Go | human | 0 | 0 |
import array
class DotStar:
def __init__(self, spi, n, brightness=1.0, auto_write=True, pixel_order=(0, 1, 2)):
self.spi = spi
self._n = n
self._brightness = brightness
self._auto_write = auto_write
self._pixel_order = pixel_order
self._buffer = array.array('H', [0] ... | mistralai/mistral-7b-instruct-v0.3 | Python | mistral | 10 | 1 |
def generate_ydl_opts(config, path):
if not config:
ydl_opts = {}
else:
ydl_opts = config
ydl_opts['outtmpl'] = path
return ydl_opts | microsoft/phi-4 | Python | phi | 2 | 1 |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
// Function to find the mex of a set of integers
int mex(const vector<int>& set) {
int mex = 0;
while (set.find(mex) != set.end()) {
mex++;
}
return mex;
}
// Function to perform the mex operation
void mexOperatio... | qwen/qwen2.5-coder-1.5b-instruct | C++ | qwen | 1 | 1 |
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <regex>
#include <map>
class CodeDocumentationGenerator {
public:
CodeDocumentationGenerator(const std::string& filename) : sourceFilename(filename) {}
void generateDocumentation() {
readSourceFile();
processCl... | gpt-4o-mini | C++ | gpt | 9 | 1 |
def hybrid_product(self, other, binary_op, filter_product=None,
nuclide_product=None, score_product=None):
if filter_product is None:
filter_product = 'entrywise'
elif filter_product == 'tensor':
msg = 'Unable to perform Tally arithmetic with a tensor produ... | human | Python | human | 0 | 0 |
char *dump_TimeInternal2(const char *st1, const TimeInternal * p1, const char *st2, const TimeInternal * p2)
{
static char buf[BUF_SIZE];
int n = 0;
if (st1) {
n += snprintf(buf + n, BUF_SIZE - n, "%s ", st1);
}
n += snprint_TimeInternal(buf + n, BUF_SIZE - n, p1);
n += snprintf(buf + n, BUF_SIZE - n, " ");
... | human | C | human | 0 | 0 |
python
from collections import defaultdict
def solve(strings, queries):
mem = defaultdict(int)
for s in strings:
mem[s] += 1
for q in queries:
found = False
for i in range(len(q)):
for c in 'abc':
if c != q[i]:
new_q = q[:i] + c + q[i... | 01-ai/yi-coder-9b-chat | Python | 01-ai | 4 | 1 |
using System.Security.Cryptography;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using System.Numerics;
using System;
class ShieldDisposal
{
// Simulates removing a shield and its effects
// Parameters:
// @totalShields: integer representing the total nu... | qwen/qwen2.5-coder-1.5b-instruct | C# | qwen | 1 | 1 |
, no extra text.
def can_distribute_cookies(a, b):
total_cookies = a + b
if total_cookies % 3 == 0: # Check if the total number of cookies is divisible by 3
return "Possible"
else:
return "Impossible"
# Example usage:
# print(can_distribute_cookies(4, 5)) | microsoft/phi-3-mini-4k-instruct | Python | phi | 2 | 1 |
import numpy as np
from scipy.optimize import linear_sum_assignment
from astropy.stats import sigma_clipped_stats
from astropy.stats import SigmaClip
from scipy.special import erfinv
def run_3_arm_search(arm0, arm1, arm2, T012, n_max_cands=10, sigma_arm=3, sigma_trigger=5):
"""
Run 3-arm search with sigma_arm ... | qwen/qwen2.5-coder-7b-instruct | Python | qwen | 1 | 1 |
python
def f(n):
if n % 2 == 0:
return n // 2
else:
return -((n + 1) // 2)
# Example usage:
n = int(input().strip())
print(f(n)) | microsoft/phi-3-medium-4k-instruct | Python | phi | 2 | 1 |
def f(x):
"""Apply function f to a given number x"""
x += 1
while x % 10 == 0:
x //= 10
return x
def count_reachable(n):
"""Count the number of different numbers reachable from n"""
seen = set()
reachable = {n}
stack = [n]
while stack:
num = stack.pop()
seen... | meta-llama/llama-3.3-70b-instruct | Python | meta-llama | 3 | 1 |
public override bool Equals(object obj)
{
var other = obj as WeddingReservation;
return other != null && other.Title.Equals(Title)
&& other.Name.Equals(Name)
&& other.PartySize.Equals(PartySize)
&& other.TableAssigned == TableAssigned
... | human | C# | human | 0 | 0 |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Brand extends MY_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('Brand_m');
}
public function index()
{
//load header and footer module
$header = $this->loaded_module_admin(0);
$footer ... | human | PHP | human | 0 | 0 |
import json
from datetime import datetime, timedelta
class IoTDevice:
def __init__(self, device_id, device_type):
self.device_id = device_id
self.device_type = device_type
def is_available(self):
# Assuming we have functionality to check device status
return True # Placeholder... | gpt-4o-mini | Python | gpt | 9 | 1 |
def solve(n, k, p, q):
from collections import defaultdict
# Convert permutations to 0-indexed
p = [x - 1 for x in p]
q = [x - 1 for x in q]
# Create adjacency lists for the permutations
p_next = [-1] * n
q_next = [-1] * n
for i in range(n - 1):
p_next[p[i]] = p[i ... | qwen/qwen2.5-coder-32b-instruct | Python | qwen | 1 | 1 |
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class EthicalComplianceChecker {
private static final String[] ETHICAL_STANDARDS = {
"Informed Consent Obtained",
"Minimal Risks to Participants",
"Data Privacy Measures in Place",
"Transparent Fundi... | gpt-4o-mini | Java | gpt | 9 | 1 |
python
from collections import deque
MOD = 10 ** 9 + 7
def count_ways_to_make_all_white(n, s):
# Find indices of black squares
black_indices = [i for i, char in enumerate(s) if char == 'B']
num_black = len(black_indices)
# If there's an odd number of black squares, it's impossible to make them all whi... | qwen/qwen2.5-coder-7b-instruct | Python | qwen | 1 | 1 |
/**
* Interface that represents a generic event in the Planner system.
* This interface should define the basic structure for all Planner events.
*/
public interface PlannerEvent {
// Define a generic event ID
String getEventId();
// Retrieve the description of the event
String getDescription();... | microsoft/phi-3-mini-4k-instruct | Java | phi | 2 | 1 |
To solve the problem of the princess escaping the dragon, we need to determine how many bijous are required to distract the dragon long enough for the princess to reach the castle safely.
Here's a breakdown of the necessary calculations and logic:
1. **Understand the Initial Setup:**
- The princess starts running ... | microsoft/phi-3-medium-4k-instruct | Python | phi | 2 | 1 |
/**
* TouchState() constructor keeps track of the touch state for a target:
* time of the last touchstart, the time of the last touchend,
* and if the target is touched now, i.e. in touch active state
*
* @param {EventTarget} target
* @return {TouchState}
*/ | 01-ai/yi-coder-1.5b-chat | JavaScript | 01-ai | 4 | 1 |
public class CameraFragment extends Fragment {
private OnFragmentInteractionListener mListener;
public CameraFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstan... | ibm-granite/granite-3b-code-instruct-128k | Java | ibm-granite | 6 | 1 |
class DebtCollectionCase:
def __init__(self, failed_on):
self.failed_on = failed_on
def get_failed_on_date(self):
"""
Retrieves the date when the debt collection case failed.
Returns:
datetime.date or None: The date when the case failed, or None if not appli... | qwen/qwen2.5-72b-instruct | Python | qwen | 1 | 1 |
import java.util.List;
import java.util.Map;
import com.oncrash.diagnostic.Fixture;
import com.oncrash.diagnostic.MapObject;
public class MainClass {
public static Fixture createFixture(MapObject mapObject, Body body) {
String message = null;
// Some complex logic where message can be set based on Ma... | deepseek-ai/deepseek-coder-1.3b-instruct | Java | deepseek | 8 | 1 |
package boardgame;
import java.util.*;
/**
* Given that a single diagonal move was made, it is determined
* whether or not a jump move was originally possible or not.
* @param gameID String representing key to unique board configuration
* @return True if there was no jump originally available.
* False ... | qwen/qwen2.5-72b-instruct | Java | qwen | 1 | 1 |
import os
import numpy as np
import scipy.fftpack as spfft
import librosa
import cv2
from sklearn.decomposition import PCA
from librosa.util import argrelextrema
def spectral_change(wav_fname, dest):
# Convert WAV to STFT
signal, sr = librosa.load(wav_fname, sr=22050)
music_transform = librosa.stft(signal)... | 01-ai/yi-coder-1.5b-chat | Python | 01-ai | 4 | 1 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 18