Dataset Viewer
Auto-converted to Parquet Duplicate
code
stringlengths
0
29.6k
language
stringclasses
9 values
AST_depth
int64
3
30
alphanumeric_fraction
float64
0.2
0.86
max_line_length
int64
13
399
avg_line_length
float64
5.02
139
num_lines
int64
7
299
source
stringclasses
4 values
// Copyright (c) ( All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ using BootstrapBlazor.Components; using Microsoft.AspNetCore.Components; using Microsoft.Extensio...
c#
19
0.630016
111
25.362319
69
starcoderdata
private void Update() { if (listen) { loudness = LevelMax() * 100;//for volume before speech Debug.Log("Loudness : " + loudness); if (loudness > 8) { Microphone.End(MicDeviceName); Debug.Log("Sent Record"); ...
c#
19
0.471849
112
31.918033
61
inline
<?php $__env->startSection('content'); ?> <div class="row"> <div class="row"> <?php if(auth()->user()->hasRole('administrator')): ?> <button type="button " class="btn btn-primary fa fa-home" data-toggle="modal" data-target=".bs-example-modal-lg"> <?ph...
php
18
0.347466
201
52.275862
290
starcoderdata
package net.dodogang.marbles.mixin.world.gen; import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.source.BiomeAccess; import net.minecraft.world.biome.source.HorizontalVoronoiBiomeAccessType; import net.minecraft.world.biome.source.VoronoiBiomeAccessType; import org.spongepowered.asm.mixin.M...
java
9
0.764319
121
44.347826
23
starcoderdata
""" XmitMsgHandler defines a handler function to call for messages from a particular service. Create new instance with: self.h = xmit_msg.XmitMsgHandler(size) where "size" is the number of handlers you will add. The list will be appended to if you add more handlers than siz...
python
16
0.588919
87
33.262712
118
starcoderdata
#include "buzzer.h" #include "debug.h" #ifndef __TACT_BUZZER_MULTIPLEXER__ #include #endif namespace tact { #ifdef __TACT_BUZZER_MULTIPLEXER__ Buzzer::Buzzer() { // default configuration pin_ = config::kBuzzerID; address_ = 0x40; frequency_ = 800; PCA9685_ = new Adafruit_PWMServoDriver(address_); } Buzz...
c++
13
0.62395
69
19.505556
180
starcoderdata
void DroneNode::height_callback(const sensor_msgs::msg::Range::SharedPtr msg) const { // Read the system boot time. (Is this a hack?) std::pair< mavsdk::Info::Result, mavsdk::Info::FlightInfo > information = _info->get_flight_information(); // Pass the height to the flight controller to ease landing ma...
c++
10
0.541128
159
68.83871
31
inline
public int insert( Map x ) { int result = 0; // sanity checks if ( x == null || x.size() == 0 ) return result; if ( mConnection == null ) throw new RuntimeException( c_error ); // FIXME: Create a true bulk mode. This is inefficient, but will // get the job done (for now). Set lfns = x.ke...
java
16
0.520833
72
29.041667
24
inline
/* Copyright (C) 2002 Dept. of Computer Science, Univ. of Massachusetts, Amherst This file is part of "MALLET" (MAchine Learning for LanguagE Toolkit). http://www.cs.umass.edu/~mccallum/mallet This program toolkit free software; you can redistribute it and/or modify it under the terms of the GNU General P...
java
14
0.71829
118
30.752294
109
starcoderdata
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework.Input; namespace RobotShootans.Engine { /// /// For future use to help make it easier to work cross platform /// public class Controls { //Keys _jumpKey; //Buttons ...
c#
5
0.609792
68
22.241379
29
starcoderdata
module.exports = (function() { var self = {}; var crypt = require("crypt/api"); function getPath(isMakeFile){ if( OS_ANDROID ){ var newDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, "save"); if( newDir == null || !newDir.exists() ) newDir.createDirectory(); var file = Ti.Filesys...
javascript
22
0.62674
117
27.34507
142
starcoderdata
package edu.jhu.privtext.test; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.NoSuchProviderException; import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; import javax.crypto.NoSuchPaddingException; import javax.crypto....
java
10
0.813885
85
28.456522
46
starcoderdata
using System; using System.Windows; namespace Sample.RouteEventTest { /// /// 需要引用PresentationCore.dll、Windowsbase.dll /// public class MyRouteEvent : UIElement { //第一步:定义路由事件 public static readonly RoutedEvent SayHelloEvent; //第二步:注册SayHello事件 static MyRouteEven...
c#
14
0.641026
157
25.419355
31
starcoderdata
var _ = require('lodash'); var keystone = require('keystone'); /** Initialises the standard view locals */ exports.initLocals = function(req, res, next) { var locals = res.locals; locals.tenet = req.session.tenet || req.tenet || null; locals.user = req.user; locals.brand = keystone.get('brand'); next(); ...
javascript
12
0.644781
74
18.16129
62
starcoderdata
#include <stdio.h> #include <stdlib.h> #define LL long long #define MAXDIV(a, b) ((a)/(b) + (((a)%(b) != 0)? 1 : 0) ) LL digit_sum(LL num) { LL sum = 0, divide, digit = 1; while((divide = num/digit) != 0) { sum += (divide % 10); digit *= 10; } return sum; } LL most_digit(LL num) { //何...
c
12
0.479646
57
18.842105
57
codenet
'use strict'; //Testing modules const chai = require('chai'), chaiAsPromised = require('chai-as-promised'); chai.should(); chai.use(chaiAsPromised); const Sinon = require('sinon'); //Module to test const Board = require('../../../src/model/Board.js'); const Thread = require('../../../src/model/Thread.js'); const P...
javascript
30
0.587208
87
22.368231
277
starcoderdata
/* * (C) Copyright Itude Mobile B.V., The Netherlands * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
java
18
0.693276
101
27.612
250
starcoderdata
package cz.ackee.androidskeleton.event; /** * Event that is fired when issue is modified * Created by on {3. 7. 2015} **/ public class IssueModifiedEvent { public static final String TAG = IssueModifiedEvent.class.getName(); }
java
7
0.760218
114
32.363636
11
starcoderdata
package solutions.tveit.nissanconnect; public class NissanConnectException extends RuntimeException { public NissanConnectException(String message) { super(message); } public NissanConnectException(Exception e) { super(e); } }
java
7
0.737705
62
22.461538
13
starcoderdata
package com.incloud.hcp.jco.distribucionflota.dto; public class TercerosDto { private String CodPlanta; private String DescPlanta; private double PescDeclProp; private double EmbaPescProp; private double CbodProp; public double getPescDeclProp() { return PescDeclProp; } public...
java
7
0.655042
54
19.803922
51
starcoderdata
public void generateAPIs() { // Start code generation of the application developer files APIGenerator apiGen = new APIGenerator(systemModel.getSystemModel(), systemModel.getToolConfig(), containerOutputDir); apiGen.generate(); // Generate build files BuildGeneratorAPI buildGen = new BuildGeneratorAPI(systemM...
java
9
0.778004
120
36.846154
13
inline
/* SDL C++ Classes Copyright (C) 2017-2018 This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including co...
c++
13
0.675959
76
25.688
125
starcoderdata
package com.photo.bas.core.service.common; import com.photo.bas.core.dao.common.AbsZoneRepository; import com.photo.bas.core.model.common.AbsZone; import com.photo.bas.core.service.entity.AbsMaintenanceService; import com.photo.bas.core.utils.PageInfo; /** * @author FengYu * */ public abstract class AbsZone...
java
8
0.755064
115
28.166667
18
starcoderdata
<?php /** * | --------------------------------------------------------------------------------------------------- * | ProjectName: ticket * | --------------------------------------------------------------------------------------------------- * | Author:johnxu * | --------------------------------------------------...
php
20
0.372601
109
28.912037
216
starcoderdata
#!/usr/bin/python ## Download files from Amazon S3 (e.g. raw photos for 3D models) ## 15-Jun-2014, updated 21-Nov-2014 __author__ = 'ahb108' ## Currently for Python 2.7.5 (tested on MacOSX 10.9.2) launched in a virtual environment: from PIL import Image # Pillow with libjpeg support from PIL import ImageDraw import ...
python
16
0.596822
140
39.358696
92
starcoderdata
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
python
11
0.631812
79
33.863636
110
starcoderdata
public static void test_settings() { // Choose setting configuration ad load the data setting.crypt = true; setting.SetLocation(SettLocation.PROGDATA, "ProgramName/"); setting.Load(); // Change a some values setting.data.Uses += ...
c#
10
0.523139
71
30.125
16
inline
void ReversiScene::CreateStone(bool stoneColor, int xcor, int ycor)//0 black 1 white { if(stones[ycor][xcor]==nullptr){ stones[ycor][xcor] = new Stone(stoneColor,this); stones[ycor][xcor]->setPos(X0+xcor*Xdif, Y0+ycor*Ydif); this->addItem(stones[ycor][xcor]); } }
c++
11
0.647458
84
36
8
inline
Trick::JobData * Trick::ScheduledJobQueue::find_next_job(long long time_tics ) { JobData * curr_job ; long long next_call ; /* Search through the rest of the queue starting at curr_index looking for the next job with it's next execution time is equal to the current simulation time. */ while (cu...
c++
15
0.530067
120
41.785714
42
inline
package _206_reverse_linked_list import "github.com/yigenshutiao/Golang-algorithm-template/util" type ListNode = util.ListNode func reverseList(head *ListNode) *ListNode { // 这里不能声明为 pre := &ListNode{}, 因为会初始化,这里只需要声明,不需要初始化 var pre *ListNode // 当前值要声明到head上... cur := head // head不会动,这里的变量是游标cur, 判断时应用cur进行判断 ...
go
8
0.717622
63
21.428571
21
starcoderdata
#include #include "include/vpc.h" #include "include/ops.h" int main(int argc, const char* argv[]) { vpc::registers_t registers{0}; vpc::operations_t operations = vpc::make_instructions(); vpc::memory_t memory{0}; int i = 0; auto next = [&i](){return i++;}; // DATA memory[240] = vpc::cr...
c++
9
0.620617
67
30.711111
45
starcoderdata
# -*- coding: utf-8 -*- import ast def get_content_files(file_names): """ Получает контент списка файлов @param file_names: список файлов (итерируемый объект) @return: генератор """ for file_name in file_names: with open(file_name, 'r', encoding='utf-8') as attempt_handler: ...
python
13
0.661379
100
28.015873
63
starcoderdata
import maf_iterate from intervaltree import Interval, IntervalTree import logging # start with finding indels between hg19 and mm10. args = maf_iterate.get_args() anchor = 'hg19' source = 'mm10' flank5k = 'chr1_hg19_mm10_5k.maf' exact = 'chr1_hg19_mm10_0.maf' flanking = 5000 curr_insertion = {} curr_deletion = {} in...
python
17
0.58
104
44.454545
66
starcoderdata
import requests class WebApi(object): def __init__(self, url_base): self.url_base = url_base def _endpoint(self, path): return self.url_base + path def request(self, path): response = requests.get(self._endpoint(path)) if response.status_code != 200: raise Exc...
python
14
0.571749
72
25.235294
17
starcoderdata
private static void applyR2Rml(List<String> mappingFiles, String scenario) throws Exception { SesameAdapter eval = SesameAdapter.getInstance(RepoType.EVALUATION); // execute mappings (db2triples): Connection jdbc = RdbmsUtil.getConnection(); try { for (String r2rmlFile : mappingFiles) { SesameDataSet ...
java
14
0.698601
99
33.444444
27
inline
<?php $sjbg =array( "1" => "https://cdn.9yo.cc/sjbg1.jpg", "2" => "https://cdn.9yo.cc/sjbg2.jpg", "3" => "https://cdn.9yo.cc/sjbg3.jpg", "4" => "https://cdn.9yo.cc/sjbg4.jpg", "5" => "https://cdn.9yo.cc/sjbg5.jpg", "6" => "https://cdn.9yo.cc/sjbg6.jpg", "7" => "https://cdn.9yo.cc/sjbg7.jpg", "8" => "https://cdn.9yo.cc/...
php
10
0.581854
40
32.8
30
starcoderdata
function first(callback) { setTimeout(function () { console.log("I GO FIRST"); callback(); }, 1000); } function second() { console.log("I GO SECOND"); } // first(second); // console.log("A GO THIRD"); // let prom = new Promise(function (resolve, reject) { // let res = 1 + 1; // if (res === 2) { // ...
javascript
19
0.611508
104
25.149533
214
starcoderdata
@extends('guest/template/index') @section('content') @if(Auth::check()) @section('content') <div class="main"> <div class="wrapper"> <!-- left --> <article class="col-left"> <ul class="list-group"> <li class="bg-primary" style="text-align:center;">Thông tin ngư...
php
5
0.404324
209
49.463636
110
starcoderdata
/* * Copyright (c) 2010, * All rights reserved. * * Made available under the BSD license - see the LICENSE file */ package sim.components; import sim.Config; public class OutputPort extends Port { private Credit m_inputCredit; private OutputVC[] m_vcs; public OutputPort(Console console, int nodeId, ...
java
21
0.640675
113
30.229008
131
starcoderdata
<?php /** * WasabiLib http://www.wasabilib.org * * @link https://github.com/WasabilibOrg/wasabilib * @license The MIT License (MIT) Copyright (c) 2015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR...
php
18
0.642254
116
28.840336
119
starcoderdata
module.exports = { root: true, parser: "@typescript-eslint/parser", parserOptions: { tsconfigRootDir: __dirname, project: ["./packages/**/tsconfig.json"], }, plugins: ["@typescript-eslint", "eslint-plugin-jsdoc", "node", "import"], extends: [ // Core eslint recommended rules. "eslint:recomme...
javascript
12
0.640436
83
36.123596
89
starcoderdata
mai=men=0 lista=[] for c in range (0,5): lista.append(int(input(f'digite um numero na posição {c} :'))) if c==0: mai=men=lista[c] else: if lista[c] > mai: mai=lista[c] if lista[c] < men: men = lista[c] print(f'\033[34mo maior numero é {mai} nas posiçoes :',end...
python
12
0.550079
66
28.952381
21
starcoderdata
namespace Clockwise { public enum CircuitBreakerState { /// /// Closed state meansthe circuit is available for work /// Closed = 0, /// /// Open state means the circuit is unavailable for work /// Open, /// /// HalfOpen state ...
c#
6
0.564103
81
27.789474
19
starcoderdata
package com.github.kwoin.kgate.core.command.chain; import com.github.kwoin.kgate.core.command.ICommand; import com.github.kwoin.kgate.core.message.Message; import com.github.kwoin.kgate.core.session.Session; import java.io.IOException; /** * @author */ public class Chain<T extends Message> implements ICommand { ...
java
13
0.59369
62
18.018182
55
starcoderdata
def create(self): """Create the network graph.""" # 1st Layer: Conv -> norm -> ReLu conv1 = conv(self.X, 3, 3, 64, 1, 1, padding='SAME', name='conv1') norm1 = lrn(conv1, 2, 1e-04, 0.75, name='norm1', phase=self.phase) # Apply relu function relu1 = tf.nn.relu(norm1) ...
python
9
0.499545
74
41.326923
52
inline
#include "sys.h" #include "usart.h" #if SYSTEM_SUPPORT_OS #include "includes.h" #endif #if 1 #pragma import(__use_no_semihosting) struct __FILE { int handle; }; FILE __stdout; void _sys_exit(int x) { x = x; } int fputc(int ch, FILE *f) { while((USART1->SR&0X40)==0); USAR...
c
10
0.644559
61
19.706667
75
starcoderdata
<?php /** * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * @package fusionLib * @copyright Copyright (c) 2018 fusionLib. All rights reserved. * @link http://fu...
php
13
0.647754
71
20.508475
118
starcoderdata
import argparse import mxnet as mx from mxnet import gluon from rcnn import FasterRCNN from rcnn.metrics.voc_detection import VOC07MApMetric from dataset import VOCDetection from utils.logger import logger from utils.config import default, generate_config from dataset.dataloader import DetectionDataLoader from rcnn.tra...
python
17
0.613098
120
43.175573
131
starcoderdata
"""Slack bot that grabs the source of Slack posts.""" import hmac import json import os from hashlib import sha256 from http import HTTPStatus from sys import stderr from time import time, perf_counter from typing import Any, Dict, Tuple import flask from requests import Session TIMEOUT_POST_MESSAGE = float(os.gete...
python
15
0.660634
111
35.919283
223
starcoderdata
import pygame from population import Population from pre_game_state import PreGameState def life_game(width, height): pygame.init() screen_scale = 4 screen = pygame.display.set_mode((width * screen_scale, height * screen_scale)) population = Population(width, height) clock = pygame.time.Clock() ...
python
9
0.641654
83
22.321429
28
starcoderdata
[NoTrace] private async Task<string> ReadRequestAsync(HttpRequest request) { if (request.ContentLength == null || request.ContentLength == 0) { return string.Empty; } // Allows streams to be read multiple times. request.EnableR...
c#
13
0.585366
103
32.238095
21
inline
namespace Twining { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Input; using Twining.Commands; using Twining.Commands.Window; public static class WindowCommands { static WindowC...
c#
9
0.652653
72
28.382353
34
starcoderdata
/* * nimbus-jose-jwt * * Copyright 2012-2016, Connect2id Ltd and contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use * this file except in compliance with the License. You may obtain a copy of the * License at * * http://www.apache.org/licenses/LICENSE-2.0 * *...
java
13
0.721906
133
33.398496
133
starcoderdata
package net.robinfriedli.botify.entities.xml; import javax.annotation.Nullable; import net.robinfriedli.botify.discord.property.AbstractGuildProperty; import net.robinfriedli.jxp.collections.NodeList; import net.robinfriedli.jxp.persist.Context; import org.w3c.dom.Element; public class GuildPropertyContribution exte...
java
10
0.713352
96
25.121951
41
starcoderdata
public class Help { public static void printHelp() { System.out.println("***********************************************************************************************"); System.out.println(" HttpRequest [URL] Information and Examples: "); S...
java
9
0.456059
126
89.083333
12
starcoderdata
#ifndef GAMEFUNCTIONS_H #define GAMEFUNCTIONS_H #include "PlaceClass.hpp" int getNumberOfPlayers(string N); void initializeChance(unordered_map<int, string> &Chance); void initializeCommunityChest(unordered_map<int, string> &CommunityChest); void initializePlaces(vector &board); void constructBoard(vector &AJ, ve...
c++
12
0.775221
135
30.444444
18
starcoderdata
package test.db; /** * Created by Drapegnik on 5/25/17. */ import test.config.Options; import test.models.Student; import java.sql.*; import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Random; /** * for connecting to database * * @autho...
java
25
0.517772
117
28.422053
263
starcoderdata
"""This module contains a video specific speech-to-text-converter for large video files""" import wave import math import contextlib import speech_recognition as sr from moviepy.editor import AudioFileClip banner = r''' `-ohdy- ...
python
13
0.506643
198
38.952607
211
starcoderdata
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include "connectionstate.h" #include "controller.h" #include #include class ConnectionDialog; class Controller; class QAction; class QSlider; class QWidget; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~Main...
c
10
0.71199
50
17.813953
43
starcoderdata
package static import ( "github.com/gofiber/fiber/v2" ) // Status . func Status(ctx *fiber.Ctx) (err error) { ctx.SendStatus(200) return } // String . func String(ctx *fiber.Ctx) (err error) { ctx.SendString("Hello, World 👋!") return } // JSON . type JSON struct { Name string `json:"name" validate:"min=6,max...
go
12
0.643426
71
15.733333
30
starcoderdata
import pyodbc as sql import pandas as pd import sqlalchemy as sa from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String, DateTime, Boolean from sqlalchemy.sql.expression import insert, update, delete from datetime import date class SQL: def __init__(self, query, conn): self.query...
python
11
0.658106
97
23.96
25
starcoderdata
/* * File: AbstractRepetitionSGMStructureFeature.java * Authors: zobenz * Company: Sandia National Laboratories * Project: Analogy LDRD * * Copyright Dec 6, 2007, Sandia Corporation. Under the terms of Contract * DE-AC04-94AL85000, there is a non-exclusive li...
java
16
0.672958
280
42.675676
148
starcoderdata
func (fc *FakeClient) Put(ctx context.Context, project string, content *cpb.Chunk) (string, error) { if err := validateProject(project); err != nil { return "", err } _, err := proto.Marshal(content) if err != nil { return "", errors.Annotate(err, "marhsalling chunk").Err() } objID, err := generateObjectID() ...
go
12
0.658416
100
29.35
20
inline
<?php class Changepass_model extends CI_Model{ function checking_old_password($user_id,$old_pass){ $this->db->where('id_user', $user_id); $this->db->where('password_user', $old_pass); $query = $this->db->get('user'); return $query; } function change_password($user_id,$new_pass){ $this->db->set('password...
php
11
0.676529
92
28.882353
17
starcoderdata
import React, { Fragment, useState } from "react"; import { connect } from "react-redux"; import { Link, Redirect } from "react-router-dom"; import { setAlert } from "../../actions/alert"; // import { register } from '../../actions/auth'; change this import PropTypes from "prop-types"; import ReCAPTCHA from "react-goog...
javascript
22
0.423277
161
27.44335
203
starcoderdata
End of preview. Expand in Data Studio

This dataset contains deduplicated data from StarCoder, The-Vault-inline and Project_CodeNet.

Cleaning:

  • We removed the metadata tags (file-name, number of stars etc) from starcoder split of the dataset

We filtered the data by:

  • AST parsability: we extracted only the AST parsable codes
  • AST Depth: only samples with depth from 2.0 to 31.0
  • Maximum Line Length: only samples with a maximum of 12.0 to 400.0 characters
  • Average Line Length: only samples with 5.0 to 140.0 characters on average
  • Alphanumeric Fraction of samples is greater than 0.2 and less than 0.9
  • Number of Lines: from 6.0 to 300.0
Downloads last month
16