code stringlengths 0 26k | 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.24 131 | 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 |
// Automatically generated file. Edit generated/error.html and run
// 'make ini' to update this documentation!
const char* error_str = ""
"<!doctype html>\r\n"
"\r\n"
"<html lang=\"en\">\r\n"
"
" <meta charset=\"utf-8\">\r\n"
" Error
" <meta name=\"description\" content=\"\">\r\n"
" <meta name=\"author\" content=\"\"... | c | 5 | 0.620338 | 180 | 50.543103 | 116 | starcoderdata |
<?php defined('BASEPATH') OR exit('No direct script access allowed');
require_once dirname(__FILE__).'/Socializer/Facebook.php';
require_once dirname(__FILE__).'/Socializer/Twitter.php';
require_once dirname(__FILE__).'/Socializer/Google.php';
require_once dirname(__FILE__).'/Socializer/Instagram.php';
require_once di... | php | 10 | 0.67979 | 80 | 29.52 | 25 | starcoderdata |
package com.github.jumpt57.kijiji.engine.executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public enum CachedThreadPool {
INSTANCE;
private ExecutorService executorService;
CachedThreadPool() {
executorService = Executors.newCachedThreadPool();
}
... | java | 10 | 0.741007 | 58 | 19.85 | 20 | starcoderdata |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package cct.cprocessor;
import java.util.logging.Logger;
/**
*
* @author vvv900
*/
public class AssignmentOperator implements Comm... | java | 15 | 0.697254 | 98 | 29.086957 | 46 | starcoderdata |
import json
import scrapy
from io import BytesIO
from zipfile import ZipFile
from kingfisher_scrapy.base_spider import BaseSpider
class Zambia(BaseSpider):
name = 'zambia'
custom_settings = {
'ITEM_PIPELINES': {
'kingfisher_scrapy.pipelines.KingfisherPostPipeline': 400
},
'... | python | 22 | 0.548668 | 120 | 31.533333 | 60 | starcoderdata |
package io.github.jroy.tagger;
import fr.minuskube.inv.InventoryManager;
import io.github.jroy.tagger.command.TagCommand;
import io.github.jroy.tagger.sql.DatabaseManager;
import io.github.jroy.tagger.util.StonksIntegration;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.RegisteredServiceProvider;... | java | 12 | 0.728856 | 109 | 35.545455 | 55 | starcoderdata |
const prettier = require('prettier')
const compile = require('./vue-compiler')
module.exports = function ({
template,
data = {},
options = {},
components = {}
} = {}, {
prettier: usePrettier = true
} = {}) {
let component = compile({
template, data, options, components
})
if (usePrettier) {
//... | javascript | 11 | 0.637394 | 57 | 21.0625 | 32 | starcoderdata |
fn main() {
println!(
"Creating genesis binary blob at {} from configuration file {}",
GENESIS_LOCATION, CONFIG_LOCATION
);
let config = default_config();
config
.save_config(CONFIG_LOCATION)
.expect("Unable to save genesis config");
let mut file = File::create(GENES... | rust | 14 | 0.623984 | 72 | 28 | 17 | inline |
package org.bouncycastle.tls.crypto.impl.jcajce;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.InvalidKeyException;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.S... | java | 15 | 0.609497 | 105 | 32.461111 | 180 | starcoderdata |
package edu.mtu.examples.houghton.steppables;
import edu.mtu.examples.houghton.model.HoughtonParameters;
import edu.mtu.steppables.LandUseGeomWrapper;
import edu.mtu.steppables.ParcelAgent;
import edu.mtu.steppables.ParcelAgentType;
import edu.mtu.examples.houghton.vip.VipBase;
import edu.mtu.examples.houghton.... | java | 11 | 0.682162 | 126 | 24.298246 | 171 | starcoderdata |
package no.nav.data.catalog.policies.app.policy.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import no.nav.data.catalog.policies.app... | java | 5 | 0.79602 | 63 | 24.935484 | 31 | starcoderdata |
namespace NetFlow.Web.ViewModels.Post
{
using Microsoft.AspNetCore.Http;
using NetFlow.Common.GlobalConstants;
using System.ComponentModel.DataAnnotations;
public class CreatePostViewModel
{
public int Id { get; set; }
[Required]
[MinLength(PostsConstants.POST_TITLE_MIN_LE... | c# | 11 | 0.657554 | 63 | 26.8 | 25 | starcoderdata |
def prepare_trans_no(client_code, bse_order_type):
'''
trans_no is a unique number sent with every transaction creation request sent to BSE
If it is not unique transaction creation request is rejected by BSE
I follow this form for trans_no: eg. 20160801L0000011
- digit 1 to 8: today's date in YYYYMMDD
- digit 9... | python | 14 | 0.706712 | 109 | 40.979592 | 49 | inline |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
*
*/
class Duyurular_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
public function site_ayarlar()
{
return $this->db->get("siteayarlar")->row();
}
public function duyurular($limit)
{
if(iss... | php | 14 | 0.60241 | 63 | 13.195122 | 41 | starcoderdata |
/*
Copyright (c) 2018
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, an... | java | 18 | 0.569586 | 79 | 31.267081 | 161 | starcoderdata |
/*
* Copyright (c) 2019 by European Commission
*
* Licensed under the EUPL, Version 1.2 or - as soon they will be
* approved by the European Commission - subsequent versions of the
* EUPL (the "Licence");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Lic... | java | 17 | 0.678852 | 108 | 40.773109 | 119 | starcoderdata |
/*******************************************************************************
* Cloud Foundry
* Copyright (c) [2009-2016] Pivotal Software, Inc. All Rights Reserved.
*
* This product is licensed to you under the Apache License, Version 2.0 (the "License").
* You may not use this product except ... | java | 16 | 0.681616 | 142 | 45.147541 | 244 | starcoderdata |
"""
An example module for the homework
(hint 1: you can read this comment using: `homeworkmodule.__doc__`)
"""
def func1(param1: int, param2: dict[str, int]):
"""
This function has two parameters
(hint 2: you can read this comment using: `homeworkmodule.func1.__doc__`)
(hint 3: you can read the annota... | python | 8 | 0.652557 | 88 | 24.772727 | 22 | starcoderdata |
public void updateThemeItems() {
// Update Title
themeTitle.setText(Launcher.theme);
// Update ThemeBackground
backgroundPanel.setIcon(themeBackground);
// Update Icons
fiveFieldElementIcon.setIcon(fiveFieldElementIconFromSide);
fourFieldElementIcon.setIcon(fourFieldElementIconFromSide);
threeFiel... | java | 9 | 0.818475 | 92 | 54.321429 | 28 | inline |
int main() {
List<int> a{};
append(a, 12);
append(a, 42);
append(a, 27);
List<int> b{a}; // this should end up calling the copy ctor!
append(b, 42);
append(b, 1337);
List<int> c{};
c = b;
append(c, 9000);
std::cout << "a:\n";
forEach(a, print);
std::cout << "b:\n";
forEach(b, print);
... | c++ | 7 | 0.523288 | 62 | 13.64 | 25 | inline |
import os,sys
import math
import random
import time
def map_add(mp, key1,key2, value):
if (key1 not in mp):
mp[key1] = {}
if (key2 not in mp[key1]):
mp[key1][key2] = 0.0
mp[key1][key2] += value
def map_add1(mp,key):
if (key not in mp):
mp[key] = 0
mp[key]+=1
f = open("data... | python | 26 | 0.43499 | 160 | 28.612335 | 227 | starcoderdata |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using GamesPortal.Client.Interfaces.Entities;
using Spark.Wpf.Common.ViewModels;
namespace GamesPortal.Client.ViewModels
{
public class GameInfrastructuresSelector : View... | c# | 21 | 0.619975 | 201 | 32.054795 | 73 | starcoderdata |
package co.cask.cdap.apps.sentiment.web;
import com.google.common.base.Throwables;
import com.google.common.io.ByteStreams;
import com.ning.http.client.AsyncCompletionHandler;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;
import com.ning.http.client.Response;
import or... | java | 24 | 0.681238 | 117 | 32.698925 | 93 | starcoderdata |
const { assert } = require("chai");
const LocalAuthority = artifacts.require("LocalAuthority.sol");
contract("LocalAuthority", () => {
let localAuthority = null;
let medicament = null;
let lab = null;
before(async () => {
medicament = {
nom: "nametest",
dosage: "dosagetest",
forme: "for... | javascript | 21 | 0.685773 | 79 | 35.427673 | 159 | starcoderdata |
from js9 import j
class Repo:
def __init__(self, path):
self.repo = j.clients.git.get(path)
@classmethod
def clone(cls, url, branch='master'):
path = j.clients.git.pullGitRepo(url, branch=branch)
return cls(path)
def branch_or_tag(self):
return self.repo.getBranchOrT... | python | 12 | 0.627624 | 80 | 22.815789 | 38 | starcoderdata |
package com.example.opencvdemo2;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.vie... | java | 11 | 0.648657 | 98 | 27.632479 | 117 | starcoderdata |
public Filter findFilterByName(String name) {
Filter filter = null;
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.query(FILTERS_TABLE, new String[] { KEY_NAME,
KEY_ADDRESS }, KEY_NAME + "=?", new String[] { name }, null,
null, null);
while (cursor.moveToNext()) {
if (filter != ... | java | 10 | 0.647335 | 66 | 31.684211 | 19 | inline |
import { cleanup } from "@testing-library/react";
import { renderWithTheme } from "../../utils";
import ItemListEdit from "../ItemListEdit.js";
const mockData = {
"title": "keywords",
"items": [
{
"id": 10,
"name": "
"description": null,
"category": 4,
"creat... | javascript | 21 | 0.596277 | 110 | 33.622222 | 45 | starcoderdata |
using System;
using Optional;
namespace NukedBit.NRepo.Services
{
public class ConsoleService : IConsoleService
{
public void WriteLine(string inputString) => Console.WriteLine(inputString);
public void WriteLine() => Console.WriteLine();
public void WriteLineColored(ConsoleColor col... | c# | 19 | 0.464066 | 89 | 27.647059 | 68 | starcoderdata |
package ru.otus.listener.homework;
import ru.otus.Message;
import ru.otus.listener.Listener;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
public class ListenerMessageHistory implements Listener {
private class MessageHistoryRecord {
... | java | 15 | 0.680606 | 157 | 32.02381 | 42 | starcoderdata |
func (b *Bot) StoreMessages(user *User, msgs []Message) error {
// check if bot belongs to user
exists, err := rowExists("SELECT * FROM Bot WHERE BotID=$1 AND User=$2", b.ID, user.ID)
if err != nil {
log.Println("cannot check for bot:", err)
return ErrInternalServerError
} else if !exists {
return ErrBotDoesN... | go | 11 | 0.667268 | 88 | 24.813953 | 43 | inline |
package com.uantwerp.algorithms;
import java.util.Timer;
import javax.swing.SwingUtilities;
import com.uantwerp.algorithms.Efficiency.VariablesTimer;
import com.uantwerp.algorithms.common.GraphParameters;
import com.uantwerp.algorithms.gui.SubgraphMiningGUI;
import com.uantwerp.algorithms.utilities.AlgorithmUtility;... | java | 13 | 0.751841 | 93 | 28.663866 | 119 | starcoderdata |
var config = require('../../transpile-config');
var sassTypesToWatch = [
`${config.src}/**/*.scss`,
`${config.src}/**/*.sass`
];
var sassTypesToTranspile = sassTypesToWatch.concat([
`!${config.src}/**/_*.scss`,
`!${config.src}/**/_*.sass`
]);
module.exports = gulp=> {
config.deployModes.forEach(mod... | javascript | 22 | 0.507626 | 83 | 30.182927 | 82 | starcoderdata |
package controllers;
import com.google.common.io.Files;
import com.google.inject.Inject;
import models.Product;
import models.Tag;
import static play.mvc.Http.MultipartFormData;
import play.api.db.Database;
import play.data.Form;
import play.data.FormFactory;
import play.mvc.Result;
import play.mvc.Controller;
import... | java | 14 | 0.635994 | 80 | 28.583333 | 108 | starcoderdata |
package org.uberfire.java.nio.fs.k8s;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.Atom... | java | 20 | 0.614756 | 88 | 25.69697 | 165 | starcoderdata |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.