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 |
|---|---|---|---|---|---|---|---|
<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
$form=ActiveForm::begin();
echo $form->field($u,'name');
echo $form->field($u,'pass');
echo Html::submitButton('Вход',['class'=>'btn btn-success']);
ActiveForm::end();
?> | php | 8 | 0.665217 | 61 | 18.25 | 12 | starcoderdata |
#include "Controller/UnitController.h"
#include
#include
using namespace ACC::Controller;
using ACC::Measures::Temperature;
using ACC::Measures::Humidity;
using ACC::Devices::AirConditionerStatus;
void UnitController::process() {
if (display.hasAirConditioningManagementStatusChangeRequest()) {
EEPROM.pu... | c++ | 10 | 0.748748 | 117 | 35.471154 | 104 | starcoderdata |
bool PacketTraceGen::sendPacket(PacketPtr packet)
{
if (params()->system->isMemAddr(packet->getAddr())) {
if (system->isAtomicMode()) {
port.sendAtomic(packet);
receivePacket(packet);
return true;
}
const bool packet_sent = port.sendTimingReq(packet);
... | c++ | 11 | 0.553398 | 76 | 25.612903 | 31 | inline |
import numpy as np
from .optics import make_optics
from .controllers import Openloop, Integrator
from .experiments import Experiment, make_air, make_ustep, make_sine
optics = make_optics()
# Some predefined experiments
short_wait = Experiment(make_air, 1, optics)
med_wait = Experiment(make_air, 10, optics)
long_wait ... | python | 8 | 0.747378 | 110 | 35.935484 | 31 | starcoderdata |
"""
Edit:
2013-11-26 added direction, probability, hypothetical, etc. to Word and children
"""
from functools import total_ordering
@total_ordering
class Word(object):
def __init__(self, word, begin, end, _type='term', offset=0):
self.word_ = word
self.begin_ = begin
self.end_ = ... | python | 20 | 0.53927 | 106 | 25.771863 | 263 | starcoderdata |
#include "http.h"
#include "memory_pool.h"
#define Queue_Depth 8192
#define accept 0
#define read 1
#define write 2
#define prov_buf 3
#define uring_timer 4
struct io_uring *get_ring();
void init_io_uring();
void submit_and_wait();
void add_read_request(http_request_t *request);
void add_accept(struct io_uring *ring... | c | 6 | 0.660061 | 56 | 24.230769 | 26 | starcoderdata |
#include
extern int jb,ib;
extern char nameBLE,becon,beconchk;
char commandset_BLE[15][25]={
"AT+RENEW",
"AT+RESET",
"AT+MARJ0x1234",
"AT+MINO0xFA01",
"AT+ADVI5",
"AT+NAMECDACHYD",
"AT+ADTY3",
"AT+IBEA1",
"AT+DELO2",
"AT+PWRM0"
... | c | 12 | 0.496887 | 149 | 17.119048 | 84 | starcoderdata |
function hsv2hsl(hsv) {
var h = hsv[0],
s = hsv[1] / 100,
v = hsv[2] / 100,
sl, l;
l = (2 - s) * v;
sl = s * v;
sl /= (l <= 1) ? l : 2 - l;
sl = sl || 0;
l /= 2;
return [h, sl * 100, l * 100];
}
module.exports = hsv2hsl; | javascript | 19 | 0.487261 | 59 | 18.6875 | 16 | starcoderdata |
bool CPVRChannel::SetStreamURL(const std::string &strStreamURL)
{
CSingleLock lock(m_critSection);
if (m_strStreamURL != strStreamURL)
{
/* update the stream url */
m_strStreamURL = StringUtils::Format("%s", strStreamURL.c_str());
SetChanged();
m_bChanged = true;
return true;
}
return f... | c++ | 11 | 0.66055 | 69 | 19.5 | 16 | inline |
namespace KitchenRP.Domain.Models
{
public static class Roles
{
public const string Admin = "admin";
public const string Moderator = "moderator";
public const string User = "user";
}
} | c# | 10 | 0.631818 | 52 | 23.555556 | 9 | starcoderdata |
#include "clar_libgit2.h"
#include "git2/sys/filter.h"
#include "crlf.h"
static git_repository *g_repo = NULL;
void test_filter_query__initialize(void)
{
g_repo = cl_git_sandbox_init("crlf");
cl_git_mkfile("crlf/.gitattributes",
"*.txt text\n"
"*.bin binary\n"
"*.crlf text eol=crlf\n"
"*.lf text eol=lf\n"
... | c | 9 | 0.663518 | 66 | 27.233333 | 90 | starcoderdata |
[Test]
public void GetBytes ()
{
byte[] random = new byte [25];
// The C code doesn't throw an exception yet.
_algo.GetBytes (random);
} | c# | 11 | 0.605263 | 48 | 20.857143 | 7 | inline |
package com.skymanlab.weighttraining.management.user.data;
import java.io.Serializable;
public class UserTraining implements Serializable {
// constant
public static final String LEVEL = "level";
public static final String THREE_MAJOR_MEASUREMENTS = "threeMajorMeasurements";
public static final Strin... | java | 8 | 0.651399 | 83 | 21.673077 | 52 | starcoderdata |
package worker
import (
"github.com/adjust/rmq"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"time"
)
type Configuration struct {
QueueAddr string `json:"queue_addr"`
QueueName string `json:"queue_name"`
StoreQueueName string `json:"store_queue_name"`
NbConsumer int `json:"nb_consumer"`
}... | go | 13 | 0.678147 | 78 | 24.673684 | 95 | starcoderdata |
class Solution(object):
def minMoves(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
m = 0xFFFFFFFF
count = 0
for n in nums:
m = min([m, n])
count += n
return count - len(nums) * m | python | 12 | 0.426523 | 36 | 22.333333 | 12 | starcoderdata |
<?php
return array(
/**
* Menu items and titles
*/
'messageboard:board' => "Tablón de mensajes",
'messageboard:messageboard' => "tablón de mensajes",
'messageboard:viewall' => "Ver todo",
'messageboard:postit' => "Post",
'messageboard:history:title' => "Historial",
'messageboard:none' => "No... | php | 5 | 0.702961 | 130 | 29.794118 | 68 | starcoderdata |
def _parse_req_map_annotation(self, annotation, tree):
"""
This method is used to parse the data within the parenthesis of the
request mapping annotation. ex. @RequestMapping(<here>)
:param annotation: The javalang.tree.Annotation object
:param tree: The Javalang tree
:re... | python | 15 | 0.556744 | 107 | 43.710145 | 69 | inline |
/*
* Copyright (c) 2018, hiwepy (https://github.com/hiwepy).
* All Rights Reserved.
*/
package hitool.core.compress;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStrea... | java | 14 | 0.700887 | 128 | 22.762332 | 223 | starcoderdata |
from functools import wraps
from inspect import getfullargspec
from typing import get_type_hints
# Each port has two gpio pins associated with it
# Default pin for each class is "1"
# Convert Port for use with standard BCM pins
Port = {
"A0": {"1": 0, "2": 1},
"A1": {"1": 2, "2": 3},
"A2": {"1": 4, "2": 5}... | python | 13 | 0.552836 | 86 | 28 | 62 | starcoderdata |
def test_plot_parameter_uncertainty(self):
if sys.version_info >= (3, 6):
posterior = spotpy.analyser.get_posterior(self.hymod_results,percentage=10)
#assertAlmostEqual tests on after comma accuracy, therefor we divide both by 100
self.assertAlmostEqual(len(posterior)/100, se... | python | 13 | 0.588683 | 99 | 64.714286 | 14 | inline |
def labels(self, threshold, segment=True, exclude_border=0):
"""
Label connected regions of intensities larger than a threshold
This method is a simple wrapper around scipy.measurements.label()
Parameters
----------
threshold : float
Lower bound defining the... | python | 14 | 0.519695 | 79 | 40.438596 | 57 | inline |
def _locate(self, x):
'''
Given a set of color data values, return their
corresponding colorbar data coordinates.
'''
if isinstance(self.norm, (colors.NoNorm, colors.BoundaryNorm)):
b = self._boundaries
xn = x
else:
# Do calculations us... | python | 13 | 0.50763 | 71 | 32.931034 | 29 | inline |
def test_discover_and_request_capabilities(self):
discovered_devices = False
app = self.app
def discover_result(devices: [Device]):
nonlocal discovered_devices, app
discovered_devices = True
assert len(devices) > 0
for device in devices:
... | python | 10 | 0.620561 | 79 | 34.733333 | 15 | inline |
<?php
namespace App\Controllers\Admin;
use App\Controllers\BaseController;
use \App\Models\LoginModel;
use Config\Services; //session işlemleri için ekle
use \App\Models\AyarModel;
use CodeIgniter\API\ResponseTrait;
class Ayar extends BaseController
{
public function __construct()
{
$this->session = Services:... | php | 23 | 0.482744 | 152 | 30.823529 | 153 | starcoderdata |
D3DIMContext3D(IDirect3D* pd3d, const IID& iid, Surface* psurface) :
m_pd3d(pd3d),
m_psurface(psurface)
{
//
// Initialize the state
//
Matrix mat;
mat.SetIdentity();
m_pstate = new State(mat, NULL);
//
// create the d3d device
... | c++ | 12 | 0.524806 | 100 | 27.677778 | 90 | inline |
/**********************************************************************
// @@@ START COPYRIGHT @@@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. ... | c++ | 11 | 0.511912 | 88 | 26.76378 | 127 | starcoderdata |
pub fn member(&self, element: &T) -> bool {
match self {
Tree::Empty => false,
// A more straightforward implementation of this match is to handle 3 cases:
//
// 1. If element is smaller than the root of the subtree, then recursively
// search its ... | rust | 16 | 0.520252 | 88 | 41.769231 | 26 | inline |
package it.proconsole.utility.pairone.rest.controller;
import it.proconsole.utility.pairone.core.model.Team;
import it.proconsole.utility.pairone.core.repository.TeamRepository;
import it.proconsole.utility.pairone.rest.exception.TeamNotFoundException;
import org.springframework.http.ResponseEntity;
import org.springf... | java | 11 | 0.816084 | 96 | 36.657895 | 38 | starcoderdata |
using System;
using Fable.Remoting.DotnetClient;
using CSharpClientDefs;
using TinyTest;
using Microsoft.FSharp.Core;
namespace CSharpClientTests
{
class Program
{
static int Main(string[] args)
{
var proxy = Proxy.CreateFromBuilder funcName) => {
return $"http://l... | c# | 24 | 0.542804 | 97 | 31.897959 | 49 | starcoderdata |
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.drop_table('shipping_line')
op.drop_table('shipping')
op.drop_table('receiving_line')
op.drop_table('receiving')
op.drop_table('inventory_transaction_line')
op.drop_table('inventory_transaction')
### end Alem... | python | 7 | 0.666667 | 63 | 36.444444 | 9 | inline |
package abot
import (
"fmt"
"strconv"
"strings"
)
func (a *app) findAuth(id int) (uid int, err error) {
err = a.db.Get(&uid, "SELECT uid FROM tgauth WHERE tgkey=?", id)
return
}
type shortuser struct {
ID string `db:"id"`
UID int `db:"uid"`
}
func (a *app) findByPhone(phone string) (users []shortuser, er... | go | 10 | 0.634367 | 75 | 21.114286 | 35 | starcoderdata |
namespace TransactionWebService2
{
public class DataPoint
{
public int DataPointId { get; set; }
public string Value { get; set; }
}
} | c# | 6 | 0.66 | 44 | 19.1 | 10 | starcoderdata |
import os
import random
class RandomTextGenerator(object):
def __init__(self, limit=20):
self.limit = limit # limit of word counts
self.brain = {"**": {"**": 0}}
self.file_flag = True
def train(self, filename):
titles = []
if self.read_file(filename, titles):
... | python | 20 | 0.442995 | 70 | 28.714286 | 98 | starcoderdata |
from numpy import *
from numpy.random import randint, randn
from time import time
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
# Returns mean of bootstrap samples ... | python | 12 | 0.346837 | 179 | 42.94 | 50 | starcoderdata |
namespace Gw2Sharp.WebApi.V2.Models
{
///
/// Represents the selected stats on equipment items.
///
public class EquipmentItemStats : IIdentifiable
{
///
/// The itemstat id.
/// Can be resolved against <see cref="IGw2WebApiV2Client.Itemstats"/>.
///
publi... | c# | 8 | 0.568841 | 79 | 28.052632 | 19 | starcoderdata |
using SolastaModApi.Infrastructure;
using UnityEngine;
using UnityEngine.AddressableAssets;
using static RuleDefinitions;
namespace SolastaModApi.Extensions
{
///
/// This helper extensions class was automatically generated.
/// If you find a problem please report at https://github.com/SolastaMods/Solasta... | c# | 12 | 0.650815 | 110 | 36.494949 | 198 | starcoderdata |
package org.hitlabnz.sensor_fusion_demo.permission;
import android.app.Activity;
import android.content.Context;
import android.content.pm.PackageManager;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import java.util... | java | 4 | 0.563074 | 148 | 35.272727 | 99 | starcoderdata |
/*
* This file is part of the Avalon programming language
*
* 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 limitat... | c++ | 15 | 0.621756 | 134 | 29.183333 | 120 | starcoderdata |
public static long getDateFromDslashMslashY(String date) {
int index = date.indexOf('/');
String days = date.substring(0, index);
int day = Integer.parseInt(days);
int mindex = date.indexOf('/', index + 1);
String month = date.substring(index + 1, mindex);
int mon = Integer.par... | java | 8 | 0.591837 | 58 | 36.434783 | 23 | inline |
/*******************************************************************************
* Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, an... | java | 12 | 0.627984 | 121 | 29.759494 | 79 | starcoderdata |
#include "initi2c.h"
#include
#include
#include "driver/i2c.h"
void i2c_master_init()
{
int i2c_master_port = I2C_EXAMPLE_MASTER_NUM;
i2c_config_t conf;
conf.mode = I2C_MODE_MASTER;
conf.sda_io_num = I2C_EXAMPLE_MASTER_SDA_IO;
conf.sda_pullup_en = GPIO_PULLUP_ENABLE;
conf.scl_io_num = I2C_EXA... | c | 12 | 0.584083 | 78 | 26.264151 | 53 | starcoderdata |
using System;
using System.Diagnostics;
using System.IO;
using Lucene.Net.Util;
namespace Lucene.Net.Analysis.Util
{
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information... | c# | 22 | 0.524001 | 111 | 35.610169 | 177 | starcoderdata |
import FormSolution from '@lblod/ember-mu-dynamic-forms/models/form-solution' ;
import { belongsTo } from 'ember-data/relationships';
export default FormSolution.extend({
//Add the relation to the model of which the dynamic form will belong.
//e.g. company: belongsTo('company'),
}); | javascript | 3 | 0.768817 | 82 | 45.5 | 8 | starcoderdata |
/**
* @file AddressToLineTest.cpp
* @brief AddressToLine class tester.
* @author zer0
* @date 2017-06-06
*/
#include
#include
using namespace libtbag;
using namespace libtbag::debug;
using namespace libtbag::debug::st;
using namespace libtbag::debug::st::unix;
TEST(AddressToLineTest, Default)
{
ASSER... | c++ | 6 | 0.727483 | 50 | 19.619048 | 21 | starcoderdata |
using JT808.Protocol.Extensions;
using JT808.Protocol.MessageBody;
using JT808.Protocol.Interfaces;
using System;
using JT808.Protocol.MessagePack;
namespace JT808.Protocol.Formatters.MessageBodyFormatters
{
public class JT808_0x8300_Formatter : IJT808MessagePackFormatter
{
public JT808_0x8300 Deseria... | c# | 13 | 0.711579 | 105 | 35.538462 | 26 | starcoderdata |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from utils import device, args
from utils import make_directory
TRANSFER_MODEL_PATH = make_directory("../transfer_models/")
class LeNetEmbeddingNet(nn.Module):
def __init__(self, embedding_dim=32):
super(Le... | python | 14 | 0.556669 | 65 | 31.815068 | 146 | starcoderdata |
// MultiplicationTable.js
// Bouya
// A program used to generate a mutilplication table
// Run: node MultiplicationTable.js
const rl = require ("readline").createInterface({
input: process.stdin,
output: process.stdout
});
rl.question("Enter number = ", function(base){
rl.close();
for(var i=1; i<=12; i++) {
... | javascript | 8 | 0.652742 | 52 | 23 | 16 | starcoderdata |
var gutil = require('gulp-util');
var fs = require('fs');
/**
* Build up the given src file(s), to be passed to Gulp.
*
* @param {string|array} src
* @param {string} baseDir
* @param {string} search
*/
var buildGulpSrc = function(src, baseDir, search) {
if (src) {
return prefixDirToFiles(... | javascript | 17 | 0.596883 | 71 | 20.153846 | 91 | starcoderdata |
//--------------------------------------------------------------------------
/*! \file post_wu_vars_in_post_learn/model.cc
\brief model definition file that is part of the feature testing
suite of minimal models with known analytic outcomes that are used for continuous integration testing.
*/
//-----------------------... | c++ | 15 | 0.505092 | 122 | 30.883117 | 77 | starcoderdata |
#pragma once
#include
#include
#include
#include
#include "texture_provider.hpp"
#include "scene.hpp"
#include "../thread_pool.hpp"
namespace myrt
{
class pathtracer
{
public:
constexpr static unsigned buffer_binding_bvh_nodes = 0;
constexpr static unsigned buffer_binding_bvh_indices = 1;
conste... | c++ | 14 | 0.692236 | 98 | 31.867347 | 98 | starcoderdata |
WirelessTypes::SamplingMode SyncNodeConfig::samplingMode()
{
try
{
//try to read the value from the pending config
return m_networkInfo->getPendingConfig().samplingMode();
}
catch(Error_NoData&)
{
//read the value from eeprom
re... | c++ | 10 | 0.558511 | 68 | 28 | 13 | inline |
package de.lordz.java.tools.tdm;
import javax.swing.BorderFactory;
import javax.swing.JComboBox;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import de.lordz.java.tools.tdm.common.DateTimeHelper;
import de.lordz.java.tools.tdm.common.LocalizationProvider;
import de.lordz.java.tools.tdm.entities.Custo... | java | 17 | 0.644628 | 137 | 40.331683 | 202 | starcoderdata |
// -*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// @homepage@
package example;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.swing.*;
import javax.swing.event.MouseInputAdapter;... | java | 18 | 0.673477 | 146 | 33.008032 | 249 | starcoderdata |
using System.Collections.Generic;
using System.Linq;
public class Smartphone : IPhone, IWWW
{
//private List phoneNumbers;
//private List sites;
//public Smartphone(List phoneNumbers, List sites)
//{
// this.PhoneNumbers = phoneNumbers;
// this.Sites = sites;
//}
//public List ... | c# | 14 | 0.566701 | 70 | 22.585366 | 41 | starcoderdata |
Template.createJob.jobsCollection = function () {
return Jobs;
};
/**
* Markdown Editor dupport for Job Descriptions
*/
if (typeof Template.editor.created == 'undefined') {
Template.editor.created = function() {
this.editor = false;
};
Template.editor.rendered = function() {
if (!this.edito... | javascript | 18 | 0.526693 | 80 | 26.446429 | 56 | starcoderdata |
/********************************************************************
*
* 36. What will the following program display? (Some should be
* traced and require a calculator.)
*
*
* (Assume the user enters George Washington.)
*
*
*
* January 6th 2018
*
*********************************************************... | c++ | 8 | 0.493088 | 69 | 19.34375 | 32 | starcoderdata |
package algorithm.leetcode;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import java.util.ArrayDeque;
import java.util.Deque;
/**
* 删除字符串中的所有相邻重复项
*
* 给出由小写字母组成的字符串S,重复项删除操作会选择两个相邻且相同的字母,并删除它们。
*
* 在 S 上反复执行重复项删除操作,直到无法继续删除。
*
* 在完成所有重复项删除操作后返回最终的字符串。答案保证唯一。
*
*
* 示例:
*
* 输入:"abbaca"
* 输出:"c... | java | 15 | 0.548667 | 116 | 21.058824 | 68 | starcoderdata |
static QCLI_Command_Status_t StopTXRXTest(uint32_t Parameter_Count, QCLI_Parameter_t *Parameter_List)
{
uint32_t ElapsedTime;
uint32_t Bandwidth;
QCLI_Command_Status_t ret_val;
/* First, check that valid Bluetooth Stack ID exists. */
if(BLE_Demo_Context.Bluetooth... | c | 17 | 0.533225 | 104 | 37.578125 | 64 | inline |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class EscreveAutoComplete {
var $funcoes_basicas_ci_lib = "<?php
/**
\n* @property CI_DB_active_record \$db
\n* @property CI_DB_forge \$dbforge
\n* @property CI_Benchmark \$benchmark
\n* @property CI_Calendar \$calendar
\n* @property CI_C... | php | 13 | 0.681403 | 76 | 30.102273 | 88 | starcoderdata |
<?php
$lang['module_home']='Domestico';
$lang['module_customers']='Clienti';
$lang['module_customers_desc']='Aggiungere, aggiornare, eliminare e ricerca clienti';
$lang['module_suppliers']='Fornitori';
$lang['module_suppliers_desc']='Aggiungere, aggiornare, eliminare e fornitori della ricerca';
$lang['module_employe... | php | 5 | 0.731091 | 103 | 49.91954 | 87 | starcoderdata |
define([
'core/js/adapt',
'./serializers/default',
'./serializers/questions',
'core/js/enums/completionStateEnum'
], function(Adapt, serializer, questions, COMPLETION_STATE) {
// Implements Adapt session statefulness
var AdaptStatefulSession = _.extend({
_config: null,
_should... | javascript | 23 | 0.591813 | 208 | 38.759091 | 220 | starcoderdata |
const puppeteer = require('puppeteer');
require('dotenv').config();
const config = {
headless: process.env.HEADLESS === 'true' ? true : false,
slowMo: +process.env.SLOWMO,
args: process.env.ARGS.split(','),
};
//console.log('Now the process.env values are:', config);
const videoLinkFinder = async (videoURL) => {
... | javascript | 29 | 0.674668 | 144 | 35.453125 | 64 | starcoderdata |
from flask import Flask, render_template, request
import berry.script.template_updater
import berry.berry as berry
import json
app = Flask(__name__, static_url_path="")
@app.route('/')
@app.route('/index')
def index():
return render_template('index.html')
@app.route('/wifi/list')
def get_wifi_list():
""" ... | python | 9 | 0.527199 | 105 | 22.634921 | 189 | starcoderdata |
import React from 'react'
import PropTypes from 'prop-types'
const Link = ({title, description, url}) => (
<li className="link">
<img className="link__thumb" />
<h2 className="link__title">{title}
<p className="link__description"> {description}
<a className="link__url" target="_blank" > {url}
... | javascript | 10 | 0.668 | 57 | 22.809524 | 21 | starcoderdata |
import React from "react";
import { Button, Paper, Tooltip } from "@material-ui/core";
import HomeIcon from "@material-ui/icons/Home";
import { withStyles } from "@material-ui/core/styles";
const styles = (theme) => ({
paper: {
marginBottom: theme.spacing(1),
},
button: {
minWidth: "unset",
},
});
/*... | javascript | 17 | 0.610106 | 83 | 24.018868 | 53 | starcoderdata |
public void SaveMapParametersWithDialog()
{
// Create generic name at current directory
string filePath = Path.Combine(Directory.GetCurrentDirectory(), "map_appearance.sc4cart");
filePath = Helper.GenerateFilename(filePath);
using (SaveFileDialog fileDialog = new... | c# | 13 | 0.588294 | 102 | 47.047619 | 21 | inline |
package com.alibaba.tesla.appmanager.server.repository.mapper;
import com.alibaba.tesla.appmanager.server.repository.domain.RtAppInstanceDO;
import com.alibaba.tesla.appmanager.server.repository.domain.RtAppInstanceDOExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.... | java | 10 | 0.783862 | 124 | 34.931034 | 29 | starcoderdata |
const void*
ProgGLES2::ConstBuf::Instance() const
{
if (frame != CurFrame)
{
inst = nullptr;
*lastInst = nullptr;
}
if (!inst)
{
#if RHI_GL__USE_STATIC_CONST_BUFFER_OPTIMIZATION
// try to make 'static'
if (ProgGLES2::ConstBuf::CurFrame - lastmodifiedFrame > 3 && altD... | c++ | 18 | 0.495947 | 109 | 23.690909 | 55 | inline |
//===-- PlatformDarwinTest.cpp --------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===---------------------------... | c++ | 9 | 0.729407 | 80 | 43.186335 | 161 | starcoderdata |
<?php
namespace WP_Rocket\Optimization\JS;
use WP_Rocket\Logger\Logger;
use MatthiasMullie\Minify as Minifier;
/**
* Minify JS files
*
* @since 3.1
* @author
*/
class Minify extends Abstract_JS_Optimization {
/**
* Minifies JS files
*
* @since 3.1
* @author
*
* @param string $html HTML content.
... | php | 20 | 0.589199 | 152 | 24.142157 | 204 | starcoderdata |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Logic
{
///
/// 开始节点
///
public class StartNode : LogicNodeBase
{
}
} | c# | 5 | 0.656716 | 51 | 16.866667 | 15 | starcoderdata |
#ifndef FORCE_DEBUG
#define NDEBUG
#endif
#include
#include "base/CommandLineParser.h"
#include "aligns/KmerAlignCore.h"
#include "analysis/DNAVector.h"
#include
#include "base/FileParser.h"
#include "analysis/KmerTable.h"
//===================================================================
//==============... | c++ | 20 | 0.551994 | 144 | 22.213953 | 215 | starcoderdata |
import React from 'react';
import PropTypes from 'prop-types';
import glamorous from 'glamorous';
import {colors} from '../constants';
const Container = glamorous.div({
display: 'flex',
flexDirection: 'column',
boxShadow: '2px 2px 0 0 rgba(0, 0, 0, 0.25)',
transition: '0.3s',
marginTop: '10px'
});
... | javascript | 6 | 0.619554 | 49 | 19.933333 | 45 | starcoderdata |
static int WriteInitialHeaderMarker (TRI_datafile_t* datafile,
TRI_voc_fid_t fid,
TRI_voc_size_t maximalSize) {
// create the header
TRI_df_header_marker_t header;
TRI_InitMarkerDatafile((char*) &header, TRI_DF_MARKER_HEADER, sizeof(TRI_df_... | c++ | 11 | 0.632184 | 96 | 34.636364 | 22 | inline |
@Override
public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> e,
Get get, List<Cell> results) throws IOException {
// ^^ RegionObserverExample
LOG.debug("Got preGet for row: " + Bytes.toStringBinary(get.getRow()));
// vv RegionObserverExample
if (Bytes.equals(get.getRow(), FIXED_ROW... | java | 12 | 0.710692 | 144 | 57.631579 | 19 | inline |
def _check_test_linear3(self, ml):
""" Simple linear model (without any noise) """
df = ml.datasets.dataset
epsilon = 0.001
for xi in ['x1', 'x2', 'x3']:
self.assertTrue(abs(df[xi].mean()) < epsilon)
self.assertTrue(abs(df[xi].std() - 1) < epsilon)
# Check... | python | 15 | 0.677939 | 107 | 61.133333 | 30 | inline |
define( function () {
return '<div unselectable="on" class="fui-colorpicker-container">\n' +
'<div unselectable="on" class="fui-colorpicker-toolbar">\n' +
'<div unselectable="on" class="fui-colorpicker-preview"> +
'<div unselectable="on" class="fui-colorpicker-clear">$clearText +
' +
'<div unselectable="on" class="fui-... | javascript | 25 | 0.672821 | 194 | 53.2 | 25 | starcoderdata |
import numpy as np
import matplotlib.pyplot as plt
from fealpy.mg.DarcyForchheimerP0P1 import DarcyForchheimerP0P1
from fealpy.mesh.adaptive_tools import mark
from fealpy.tools.show import showmultirate, show_error_table
from fealpy.pde.darcy_forchheimer_2d import LShapeRSinData
from fealpy.pde.darcy_forchheimer_2d imp... | python | 8 | 0.669713 | 84 | 26.357143 | 56 | research_code |
package ru.job4j.auto.web.user;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.core.context.SecurityContextHolder;
imp... | java | 10 | 0.739472 | 106 | 35.627119 | 59 | starcoderdata |
module.exports = [
'supplier',
'preparer',
'collector',
'patentee',
'collector',
'inventor',
'depicted',
'sitter',
'subject',
'owner',
'recipient'
]; | javascript | 3 | 0.663934 | 71 | 16.428571 | 14 | starcoderdata |
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _get ... | javascript | 30 | 0.583143 | 94 | 25.437209 | 215 | starcoderdata |
fn main() {
// We do argument parsing manually... which might not be the best idea,
// because it's annoying to extend it. It's probably the best to use `clap`
// or something like that from the very beginning.
let args: Vec<_> = std::env::args().skip(1).take(3).collect();
if args.len() != 2 {
... | rust | 15 | 0.584158 | 84 | 42.333333 | 21 | inline |
@Override
public String format(LogRecord log) {
String s = log.getMessage();
boolean isCoded = true;
int colon = s.indexOf(":");
if (colon >= 0) {
String preamble = s.substring(0, colon);
for (char c : preamble.toCharArray()) {
if (Character.isLowerCase(c))
isCoded = false;
}
}
... | java | 14 | 0.557188 | 59 | 30.8 | 30 | inline |
# TODO: move this file into ocfweb.component.session?
from urllib.parse import urlencode
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.urls import reverse
from ocflib.account.search import user_is_group
from ocfweb.comp... | python | 20 | 0.635086 | 85 | 29.492063 | 63 | starcoderdata |
#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_genius = 0; ngtkana_is_genius < int(n); ngtkana_is_genius++)
#define rep(i, begin, end) for(int i = int(begin); i < int(end); i++)
#define lint long long
auto cmn = [](auto& a, auto b){if (a > b) {a = b; return true;} return false;};
auto cmx = [](auto& a, au... | c++ | 15 | 0.524719 | 96 | 26.032787 | 122 | codenet |
package soot.jimple.infoflow.methodSummary.xml;
public class XMLMetaDataConstants {
// xml meta data summary tree
/*
* <summaryMetaData> <exclusiveModels> <exclusiveModel> </exclusiveModel> ...
* </exclusiveModels> </summaryMetaData>
*/
public static final String TREE_SUMMARY_META_DATA = "summaryMetaData";
p... | java | 6 | 0.762983 | 78 | 36.55 | 20 | research_code |
//
// Basic scheme interpreter
//
// Copyright 2012 (
//
//
// 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, m... | c++ | 21 | 0.631031 | 114 | 26.387879 | 165 | starcoderdata |
public static void RemoveKeysInRange(AnimationCurve curve, float beginTime, float endTime)
{
// Loop backwards so key removals don't mess up order
for (int i = curve.length - 1; i >= 0; i--)
{
if (curve[i].time >= beginTime && curve[i].time < endTime)
... | c# | 13 | 0.472019 | 90 | 36.454545 | 11 | inline |
## Discrete Choice Models Overview
from __future__ import print_function
import numpy as np
import statsmodels.api as sm
# ## Data
#
# Load data from Spector and Mazzeo (1980). Examples follow Greene's Econometric Analysis Ch. 21 (5th Edition).
spector_data = sm.datasets.spector.load()
spector_data.exog = sm.add_co... | python | 9 | 0.732342 | 180 | 23.454545 | 110 | starcoderdata |
"""
Définit page de l'appliation web qui affiche une carte des accidents, qu'on peut filtrer selon les conditions de lumière et les conditions atmosphériques
"""
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
from apps.app import app
from datavisualiz... | python | 19 | 0.636898 | 153 | 35.234043 | 47 | starcoderdata |
namespace PushSharp.Core
{
using System;
public interface IServiceConnectionFactory where TNotification : INotification
{
IServiceConnection Create();
}
} | c# | 6 | 0.75 | 97 | 21.909091 | 11 | starcoderdata |
package app
import (
"database/sql"
"fmt"
"strings"
)
type Hostinfo struct {
DBUser,
DBPassword,
DBName,
DBHost,
DBPort,
DBChar string
}
/**
连接数据库
*/
func connectMysql(host *Hostinfo) (db *sql.DB, err error) {
if host.DBPort == "" {
host.DBPort = "3306"
}
if host.DBChar == "" {
host.DBChar = "utf8... | go | 12 | 0.62183 | 62 | 13.868852 | 61 | starcoderdata |
// **************************************** Lavio Engine ****************************************
// **************************** Copyright (c) 2017 All Rights Reserved **************************
// ***************************** ( **************************
//#include "../stdafx.h"
#include "../Source/IO/Utilities/Fi... | c++ | 21 | 0.642857 | 107 | 27.632258 | 155 | starcoderdata |
#ifndef LITE_WINDOW_H
#define LITE_WINDOW_H
class LiteWindow {
public:
LiteWindow() {}
virtual ~LiteWindow() {}
int IsValid() { return 0; }
void MakeCurrent() {}
void Create(int x = -1, int y = -1, const char* display = NULL) {}
};
#endif | c | 9 | 0.68125 | 68 | 21.857143 | 14 | starcoderdata |
package liquibase.configuration;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* This wraps all the {@link ProvidedValue}s to return the overall value returned from the collection of {@link ConfigurationValueProvider}s.
* Returned by {@link LiquibaseConfiguration#getCurrentCon... | java | 14 | 0.655697 | 143 | 31 | 113 | starcoderdata |
/* Copied from http://web.engr.oregonstate.edu/~mjb/cs575/Projects/proj01.html */
#include "settings.h"
#define Z00 0.
#define Z10 1.
#define Z20 0.
#define Z30 0.
#define Z01 1.
#define Z11 6.
#define Z21 1.
#define Z31 0.
#define Z02 0.
#define Z12 1.
#define Z22 0.
#define Z32 ... | c++ | 14 | 0.470032 | 81 | 23.862745 | 51 | starcoderdata |
def table_example():
"""Demonstration function that creates and populates a table object.
This function is for demonstration purposes only; it shows
the basics of how to make and output a table. It creates
a new table object, names it, populates some columns of data
and then adds some graph definitions befor... | python | 12 | 0.63894 | 70 | 32.181818 | 33 | inline |
const asks = [
{ price: 34, amount: 89 },
{ price: 34, amount: 89 },
{ price: 89, amount: 76 },
];
const bids = [
{ price: 34, amount: 89 },
{ price: 34, amount: 89 },
{ price: 89, amount: 76 },
];
export { asks, bids }; | javascript | 5 | 0.594771 | 70 | 20.857143 | 14 | starcoderdata |
using System;
using System.Web.Http;
using System.Collections.Generic;
namespace ClassesAndInterfaces
{
public class WeaponsController : ApiController
{
IWeaponRepository weaponRepository;
public WeaponsController (IWeaponRepository weaponRepository)
{
this.weaponRepositor... | c# | 17 | 0.655431 | 83 | 25.7 | 30 | starcoderdata |
/*****************************************************************************
FreqSplitter5.h
Author: 2016
The group delay depends on the splitting frequency. Approximate figures:
GD(<fsplit) is close to fs / (fsplit * 2) samples
GD(~fsplit) doubles relatively to GD(~DC)
GD(>fsplit) gets down quickl... | c | 18 | 0.533603 | 117 | 21.454545 | 110 | starcoderdata |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.