class_name
stringlengths
3
26
id
stringlengths
29
52
original_code
stringlengths
1.08k
59.8k
num_file
int64
2
14
num_lines
int64
32
1.88k
programming_language
stringclasses
3 values
Actor_relationship_game
./MultiFileTest/Java/Actor_relationship_game.java
// ./Actor_relationship_game/Actor.java package projecteval.Actor_relationship_game; import java.io.Serializable; import java.util.HashSet; import java.util.Set; public class Actor implements Serializable{ private static final long serialVersionUID=1L; private String id; private String name; private S...
7
479
Java
CalculatorOOPS
./MultiFileTest/Java/CalculatorOOPS.java
// ./CalculatorOOPS/Add.java package projecteval.CalculatorOOPS; public class Add implements Operate{ @Override public Double getResult(Double... numbers){ Double sum = 0.0; for(Double num: numbers){ sum += num; } return sum; } } // ./CalculatorOOPS/Calculator...
8
138
Java
PongGame
./MultiFileTest/Java/PongGame.java
// ./PongGame/Ball.java package projecteval.PongGame; import java.awt.*; import java.util.*; public class Ball extends Rectangle{ Random random; int xVelocity; int yVelocity; int initialSpeed = 4 ; Ball(int x, int y, int width, int height){ super(x, y, width, height); random = n...
6
321
Java
SimpleChat
./MultiFileTest/Java/SimpleChat.java
// ./SimpleChat/Client.java package projecteval.SimpleChat; import java.io.*; import java.net.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Client { JTextArea incoming; JTextField outgoing; BufferedReader reader; PrintWriter writer; Socket sock; public static void main...
2
170
Java
Train
./MultiFileTest/Java/Train.java
// ./Train/Driver.java package projecteval.Train; public class Driver { /** * This testdriver wil test the difrent methods from train and trainstation */ public static void test() { Train t1 = new Train("Aarhus", "Berlin", 999); Train t2 = new Train("Herning", "Copenhagen", 42); ...
3
216
Java
bankingApplication
./MultiFileTest/Java/bankingApplication.java
// ./bankingApplication/bank.java package projecteval.bankingApplication; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class bank { public static void main(String args[]) //main class of bank throws IOException { BufferedReader sc = new BufferedReader( ...
3
357
Java
emailgenerator
./MultiFileTest/Java/emailgenerator.java
// ./emailgenerator/Email.java package projecteval.emailgenerator; import java.util.Scanner; public class Email { private String firstName; private String lastName; private String password; private String department; private String email; private int defaultPasswordLength=8; private int codelen=5; private Str...
2
194
Java
heap
./MultiFileTest/Java/heap.java
// ./heap/FibonacciHeap.java package projecteval.heap; public class FibonacciHeap { private static final double GOLDEN_RATIO = (1 + Math.sqrt(5)) / 2; private HeapNode min; private static int totalLinks = 0; private static int totalCuts = 0; private int numOfTrees = 0; private int numOfHeapNod...
3
629
Java
idcenter
./MultiFileTest/Java/idcenter.java
// ./idcenter/Base62.java package projecteval.idcenter; /** * A Base62 method * * @author adyliu (imxylz@gmail.com) * @since 1.0 */ public class Base62 { private static final String baseDigits = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; private static final int BASE = baseDigits.l...
4
295
Java
libraryApp
./MultiFileTest/Java/libraryApp.java
// ./libraryApp/Book.java package projecteval.libraryApp; public class Book { private int isbn; private String title; private String author; private String genre; private int quantity; private int checkedOut; private int checkedIn; //Constructor for book object public Book(int isbn, String title, String a...
4
340
Java
libraryManagement
./MultiFileTest/Java/libraryManagement.java
// ./libraryManagement/AddBookMenu.java package projecteval.libraryManagement; import java.sql.Connection; import java.sql.Statement; import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the t...
7
483
Java
logrequestresponseundertow
./MultiFileTest/Java/logrequestresponseundertow.java
// ./logrequestresponseundertow/Application.java package projecteval.logrequestresponseundertow; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory; import org.spri...
3
85
Java
passwordGenerator
./MultiFileTest/Java/passwordGenerator.java
// ./passwordGenerator/Alphabet.java package projecteval.passwordGenerator; public class Alphabet { public static final String UPPERCASE_LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; public static final String LOWERCASE_LETTERS = "abcdefghijklmnopqrstuvwxyz"; public static final String NUMBERS = "1234567890"; public ...
5
344
Java
redis
./MultiFileTest/Java/redis.java
// ./redis/DummyReadWriteLock.java package projecteval.redis; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReadWriteLock; /** * @author Iwao AVE! */ class DummyReadWriteLock implements ReadWriteLock { ...
9
651
Java
servlet
./MultiFileTest/Java/servlet.java
// ./servlet/DBUtilR.java package projecteval.servlet; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class DBUtilR { static Connection conn = null; static { try { Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection("jdbc:mysql...
6
308
Java
springdatamongowithcluster
./MultiFileTest/Java/springdatamongowithcluster.java
// ./springdatamongowithcluster/Car.java package projecteval.springdatamongowithcluster; import org.springframework.data.annotation.Id; import lombok.Builder; @Builder public class Car { @Id private String id; private String name; } // ./springdatamongowithcluster/SpringDataMongoWithClusterA...
2
51
Java
springmicrometerundertow
./MultiFileTest/Java/springmicrometerundertow.java
// ./springmicrometerundertow/SpringMicrometerUndertowApplication.java package projecteval.springmicrometerundertow; import io.micrometer.core.instrument.MeterRegistry; import io.undertow.server.HandlerWrapper; import io.undertow.server.handlers.MetricsHandler; import io.undertow.servlet.api.MetricsCollector; import o...
3
130
Java
springreactivenonreactive
./MultiFileTest/Java/springreactivenonreactive.java
// ./springreactivenonreactive/SpringMvcVsWebfluxApplication.java package projecteval.springreactivenonreactive; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringMvcVsWebfluxApplication { public static v...
7
170
Java
springuploads3
./MultiFileTest/Java/springuploads3.java
// ./springuploads3/SpringUploadS3Application.java package projecteval.springuploads3; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SpringUploadS3Application { public static void main(String[] args) { Sp...
7
192
Java
aggregate
./MultiFileTest/JavaScript/aggregate.js
// ./aggregate/aggregate.js import { setNonEnumProp } from './descriptors.js' // Array of `errors` can be set using an option. // This is like `AggregateError` except: // - This is available in any class, removing the need to create separate // classes for it // - Any class can opt-in to it or not // - This uses...
2
32
JavaScript
animation
./MultiFileTest/JavaScript/animation.js
// ./animation/AnimationAction.js import { WrapAroundEnding, ZeroCurvatureEnding, ZeroSlopeEnding, LoopPingPong, LoopOnce, LoopRepeat, NormalAnimationBlendMode, AdditiveAnimationBlendMode } from './constants.js'; class AnimationAction { constructor( mixer, clip, localRoot = null, blendMode = clip.blendMode ) { t...
2
911
JavaScript
check
./MultiFileTest/JavaScript/check.js
// ./check/check.js import { isSubclass } from './subclass.js' // Confirm `custom` option is valid export const checkCustom = (custom, ParentError) => { if (typeof custom !== 'function') { throw new TypeError( `The "custom" class of "${ParentError.name}.subclass()" must be a class: ${custom}`, ) } ...
2
78
JavaScript
circle
./MultiFileTest/JavaScript/circle.js
// ./circle/Circle.js var Shape = require('./Shape') , vec2 = require('./vec2') , shallowClone = require('./Utils').shallowClone; module.exports = Circle; /** * Circle shape class. * @class Circle * @extends Shape * @constructor * @param {options} [options] (Note that this options object will be passed on ...
4
1,068
JavaScript
ckmeans
./MultiFileTest/JavaScript/ckmeans.js
// ./ckmeans/ckmeans.js import makeMatrix from "./make_matrix.js"; import numericSort from "./numeric_sort.js"; import uniqueCountSorted from "./unique_count_sorted.js"; /** * Generates incrementally computed values based on the sums and sums of * squares for the data array * * @private * @param {number} j * @pa...
4
364
JavaScript
controls
./MultiFileTest/JavaScript/controls.js
// ./controls/Controls.js import { EventDispatcher } from './EventDispatcher.js'; class Controls extends EventDispatcher { constructor( object, domElement = null ) { super(); this.object = object; this.domElement = domElement; this.enabled = true; this.state = - 1; this.keys = {}; this.mouseButton...
2
119
JavaScript
convex
./MultiFileTest/JavaScript/convex.js
// ./convex/Convex.js var Shape = require('./Shape') , vec2 = require('./math/vec2') , dot = vec2.dot , polyk = require('./math/polyk') , shallowClone = require('./Utils').shallowClone; module.exports = Convex; /** * Convex shape class. * @class Convex * @constructor * @extends Shape * @param {object} [o...
6
1,878
JavaScript
easing
./MultiFileTest/JavaScript/easing.js
// ./easing/BezierEasing.js /** * @author pschroen / https://ufo.ai/ * * Based on https://github.com/gre/bezier-easing */ // These values are established by empiricism with tests (tradeoff: performance VS precision) const NEWTON_ITERATIONS = 4; const NEWTON_MIN_SLOPE = 0.001; const SUBDIVISION_PRECISION = 0.000000...
2
341
JavaScript
magnetic
./MultiFileTest/JavaScript/magnetic.js
// ./magnetic/BezierEasing.js /** * @author pschroen / https://ufo.ai/ * * Based on https://github.com/gre/bezier-easing */ // These values are established by empiricism with tests (tradeoff: performance VS precision) const NEWTON_ITERATIONS = 4; const NEWTON_MIN_SLOPE = 0.001; const SUBDIVISION_PRECISION = 0.0000...
7
949
JavaScript
overlapkeeper
./MultiFileTest/JavaScript/overlapkeeper.js
// ./overlapkeeper/OverlapKeeper.js var TupleDictionary = require('./TupleDictionary'); var OverlapKeeperRecordPool = require('./OverlapKeeperRecordPool'); module.exports = OverlapKeeper; /** * Keeps track of overlaps in the current state and the last step state. * @class OverlapKeeper * @constructor */ function ...
6
539
JavaScript
particle
./MultiFileTest/JavaScript/particle.js
// ./particle/Particle.js var Shape = require('./Shape') , shallowClone = require('./Utils').shallowClone , copy = require('./vec2').copy; module.exports = Particle; /** * Particle shape class. * @class Particle * @constructor * @param {object} [options] (Note that this options object will be passed on to the...
4
963
JavaScript
pixelrender
./MultiFileTest/JavaScript/pixelrender.js
// ./pixelrender/BaseRenderer.js import Pool from "./Pool"; export default class BaseRenderer { constructor(element, stroke) { this.pool = new Pool(); this.element = element; this.stroke = stroke; this.circleConf = { isCircle: true }; this.initEventHandler(); this.name = "BaseRenderer"; } ...
9
794
JavaScript
plane
./MultiFileTest/JavaScript/plane.js
// ./plane/Plane.js var Shape = require('./Shape') , vec2 = require('./vec2') , Utils = require('./Utils'); module.exports = Plane; /** * Plane shape class. The plane is facing in the Y direction. * @class Plane * @extends Shape * @constructor * @param {object} [options] (Note that this options object wi...
4
1,052
JavaScript
solver
./MultiFileTest/JavaScript/solver.js
// ./solver/EventEmitter.js module.exports = EventEmitter; /** * Base class for objects that dispatches events. * @class EventEmitter * @constructor * @example * var emitter = new EventEmitter(); * emitter.on('myEvent', function(evt){ * console.log(evt.message); * }); * emitter.emit({ ...
2
242
JavaScript
span
./MultiFileTest/JavaScript/span.js
// ./span/DomUtil.js export default { /** * Creates and returns a new canvas. The opacity is by default set to 0 * * @memberof Proton#Proton.DomUtil * @method createCanvas * * @param {String} $id the canvas' id * @param {Number} $width the canvas' width * @param {Number} $height the canvas' he...
6
536
JavaScript
spherical
./MultiFileTest/JavaScript/spherical.js
// ./spherical/MathUtils.js const _lut = [ '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '...
2
448
JavaScript
synergy
./MultiFileTest/JavaScript/synergy.js
// ./synergy/attribute.js import { isPrimitive, typeOf } from "./helpers.js" const pascalToKebab = (string) => string.replace(/[\w]([A-Z])/g, function (m) { return m[0] + "-" + m[1].toLowerCase() }) const kebabToPascal = (string) => string.replace(/[\w]-([\w])/g, function (m) { return m[0] + m[2].toUppe...
5
374
JavaScript
t_test
./MultiFileTest/JavaScript/t_test.js
// ./t_test/mean.js import sum from "./sum.js"; /** * The mean, _also known as average_, * is the sum of all values over the number of values. * This is a [measure of central tendency](https://en.wikipedia.org/wiki/Central_tendency): * a method of finding a typical or central value of a set of numbers. * * This ...
6
213
JavaScript
validate
./MultiFileTest/JavaScript/validate.js
// ./validate/map.js // We use a global `WeakMap` to store class-specific information (such as // options) instead of storing it as a symbol property on each error class to // ensure: // - This is not exposed to users or plugin authors // - This does not change how the error class is printed // We use a `WeakMap` ins...
2
37
JavaScript
zone
./MultiFileTest/JavaScript/zone.js
// ./zone/MathUtil.js const PI = 3.1415926; const INFINITY = Infinity; const MathUtil = { PI: PI, PIx2: PI * 2, PI_2: PI / 2, PI_180: PI / 180, N180_PI: 180 / PI, Infinity: -999, isInfinity(num) { return num === this.Infinity || num === INFINITY; }, randomAToB(a, b, isInt = false) { if (!is...
3
223
JavaScript
blackjack
./MultiFileTest/Python/blackjack.py
# ./blackjack/__init__.py from blackjack.base import Card as Card from blackjack.dealer import BlackjackDealer as Dealer from blackjack.judger import BlackjackJudger as Judger from blackjack.player import BlackjackPlayer as Player from blackjack.game import BlackjackGame as Game # ./blackjack/base.py ''' Game-relate...
6
401
Python
bridge
./MultiFileTest/Python/bridge.py
# ./bridge/__init__.py from bridge.base import Card as Card from bridge.player import BridgePlayer as Player from bridge.dealer import BridgeDealer as Dealer from bridge.judger import BridgeJudger as Judger from bridge.game import BridgeGame as Game # ./bridge/action_event.py from bridge_card import BridgeCard # ==...
11
792
Python
doudizhu
./MultiFileTest/Python/doudizhu.py
# ./doudizhu/__init__.py from doudizhu.base import Card as Card from doudizhu.dealer import DoudizhuDealer as Dealer from doudizhu.judger import DoudizhuJudger as Judger from doudizhu.player import DoudizhuPlayer as Player from doudizhu.round import DoudizhuRound as Round from doudizhu.game import DoudizhuGame as Game ...
8
1,178
Python
fuzzywuzzy
./MultiFileTest/Python/fuzzywuzzy.py
# ./fuzzywuzzy/StringMatcher.py #!/usr/bin/env python # encoding: utf-8 """ StringMatcher.py ported from python-Levenshtein [https://github.com/miohtama/python-Levenshtein] License available here: https://github.com/miohtama/python-Levenshtein/blob/master/COPYING """ from Levenshtein import * from warnings import war...
6
808
Python
gin_rummy
./MultiFileTest/Python/gin_rummy.py
# ./gin_rummy/__init__.py from gin_rummy.base import Card as Card from gin_rummy.player import GinRummyPlayer as Player from gin_rummy.dealer import GinRummyDealer as Dealer from gin_rummy.judge import GinRummyJudge as Judger from gin_rummy.game import GinRummyGame as Game # ./gin_rummy/action_event.py from gin_rum...
14
1,453
Python
keras_preprocessing
./MultiFileTest/Python/keras_preprocessing.py
# ./keras_preprocessing/__init__.py """Enables dynamic setting of underlying Keras module. """ _KERAS_BACKEND = None _KERAS_UTILS = None def set_keras_submodules(backend, utils): # Deprecated, will be removed in the future. global _KERAS_BACKEND global _KERAS_UTILS _KERAS_BACKEND = backend _KERAS...
3
1,002
Python
leducholdem
./MultiFileTest/Python/leducholdem.py
# ./leducholdem/__init__.py from leducholdem.base import Card as Card from leducholdem.dealer import LeducholdemDealer as Dealer from leducholdem.judger import LeducholdemJudger as Judger from leducholdem.player import LeducholdemPlayer as Player from leducholdem.player import PlayerStatus from leducholdem.round impor...
8
833
Python
limitholdem
./MultiFileTest/Python/limitholdem.py
# ./limitholdem/__init__.py from limitholdem.base import Card as Card from limitholdem.dealer import LimitHoldemDealer as Dealer from limitholdem.judger import LimitHoldemJudger as Judger from limitholdem.player import LimitHoldemPlayer as Player from limitholdem.player import PlayerStatus from limitholdem.round impor...
8
1,243
Python
mahjong
./MultiFileTest/Python/mahjong.py
# ./mahjong/__init__.py from mahjong.dealer import MahjongDealer as Dealer from mahjong.card import MahjongCard as Card from mahjong.player import MahjongPlayer as Player from mahjong.judger import MahjongJudger as Judger from mahjong.round import MahjongRound as Round from mahjong.game import MahjongGame as Game # ...
8
703
Python
nolimitholdem
./MultiFileTest/Python/nolimitholdem.py
# ./nolimitholdem/__init__.py from nolimitholdem.base import Card as Card from nolimitholdem.dealer import NolimitholdemDealer as Dealer from nolimitholdem.judger import NolimitholdemJudger as Judger from nolimitholdem.player import NolimitholdemPlayer as Player from nolimitholdem.player import PlayerStatus from nolim...
8
1,562
Python
slugify
./MultiFileTest/Python/slugify.py
# ./slugify/__init__.py from slugify.special import * from slugify.slugify import * # ./slugify/slugify.py from __future__ import annotations import re import unicodedata from collections.abc import Iterable from html.entities import name2codepoint try: import unidecode except ImportError: import text_unide...
3
246
Python
stock
./MultiFileTest/Python/stock.py
# ./stock/stock.py # stock.py from structure import Structure from validate import String, PositiveInteger, PositiveFloat class Stock(Structure): name = String() shares = PositiveInteger() price = PositiveFloat() @property def cost(self): return self.shares * self.price def sell(self...
3
217
Python
stock2
./MultiFileTest/Python/stock2.py
# ./stock2/reader.py # reader.py import csv import logging log = logging.getLogger(__name__) def convert_csv(lines, converter, *, headers=None): rows = csv.reader(lines) if headers is None: headers = next(rows) records = [] for rowno, row in enumerate(rows, start=1): try: ...
5
361
Python
stock3
./MultiFileTest/Python/stock3.py
# ./stock3/reader.py # reader.py import csv import logging log = logging.getLogger(__name__) def convert_csv(lines, converter, *, headers=None): rows = csv.reader(lines) if headers is None: headers = next(rows) records = [] for rowno, row in enumerate(rows, start=1): try: ...
4
286
Python
stock4
./MultiFileTest/Python/stock4.py
# ./stock4/structure.py # structure.py from validate import Validator, validated from collections import ChainMap class StructureMeta(type): @classmethod def __prepare__(meta, clsname, bases): return ChainMap({}, Validator.validators) @staticmethod def __new__(meta, name, bases, metho...
4
323
Python
structly
./MultiFileTest/Python/structly.py
# ./structly/stock.py # stock.py from structly.structure import Structure class Stock(Structure): name = String() shares = PositiveInteger() price = PositiveFloat() @property def cost(self): return self.shares * self.price def sell(self, nshares: PositiveInteger): self.sh...
6
369
Python
svm
./MultiFileTest/Python/svm.py
# ./svm/__init__.py # coding:utf-8 # ./svm/base.py # coding:utf-8 import numpy as np class BaseEstimator: y_required = True fit_required = True def _setup_input(self, X, y=None): """Ensure inputs to an estimator are in the expected format. Ensures X and y are stored as numpy ndarrays b...
4
238
Python
thefuzz
./MultiFileTest/Python/thefuzz.py
# ./thefuzz/__init__.py __version__ = '0.22.1' # ./thefuzz/fuzz.py #!/usr/bin/env python from rapidfuzz.fuzz import ( ratio as _ratio, partial_ratio as _partial_ratio, token_set_ratio as _token_set_ratio, token_sort_ratio as _token_sort_ratio, partial_token_set_ratio as _partial_token_set_ratio, ...
3
183
Python
tree
./MultiFileTest/Python/tree.py
# ./tree/base.py # coding:utf-8 import numpy as np from scipy import stats def f_entropy(p): # Convert values to probability p = np.bincount(p) / float(p.shape[0]) ep = stats.entropy(p) if ep == -float("inf"): return 0.0 return ep def information_gain(y, splits): splits_entropy = su...
2
225
Python
uno
./MultiFileTest/Python/uno.py
# ./uno/__init__.py from uno.dealer import UnoDealer as Dealer from uno.judger import UnoJudger as Judger from uno.player import UnoPlayer as Player from uno.round import UnoRound as Round from uno.game import UnoGame as Game # ./uno/card.py from termcolor import colored class UnoCard: info = {'type': ['numbe...
8
669
Python