code
stringlengths
0
29.6k
language
stringclasses
9 values
AST_depth
int64
3
30
alphanumeric_fraction
float64
0.2
0.86
max_line_length
int64
13
399
avg_line_length
float64
5.02
139
num_lines
int64
7
299
source
stringclasses
4 values
<?php include_once 'funciones/funciones.php'; include_once 'funciones/sesion.php'; include_once 'templates/header.php'; ?> <body class="hold-transition skin-blue fixed sidebar-mini"> <!-- Site wrapper --> <div class="wrapper"> <?php include_once 'templates/barra.php'; ?> <?php include_once 'templates/navegacion.php';...
php
4
0.605634
88
23.342857
35
starcoderdata
import hashlib from luigi import Task, ListParameter, Parameter from luigi.util import inherits class Dctool2TaskBase(Task): output_folder = Parameter() @inherits(Dctool2TaskBase) class Dctool2Task(Task): categories = ListParameter() documents_file = Parameter() def create_classifier_id(max_df, min_d...
python
10
0.7
63
21.4
25
starcoderdata
namespace TryAtSoftware.Randomizer.Core.Interfaces { public interface IInstanceBuilder<out TEntity> { TEntity PrepareNewInstance(); } }
c#
7
0.717949
51
21.428571
7
starcoderdata
///////////////////////////////////////////////////////////// // // // Copyright (c) 2003-2017 by The University of Queensland // // Centre for Geoscience Computing // // http://earth.uq.edu.au/centre-geoscience-computing // // ...
c
18
0.658948
116
31.060606
198
starcoderdata
#include using namespace std; struct Money { int g, s, k; inline int safe_mod(int x, int y) { int t = x % y; if (t < 0)return t + y; else return t; } inline int hash() { return g * 17 * 29 + s * 29 + k; } void rationalize() { int sc = hash(); ...
c++
15
0.428351
106
20.65
60
starcoderdata
package com.github.phantauth.resource.producer; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.c...
java
13
0.634946
118
33.736111
72
starcoderdata
import logging from ctypes import byref, c_char_p, c_uint8, CFUNCTYPE from .lmbinc import LCMInfo, LCMKeyMsg, PSP logger = logging.getLogger(__name__) class LCM: """ Liquid Crystal Display Module. sdk/src_utils/sdk_lcm/sdk_lcm.c :param lmb_io_path: path of liblmbio.so :param lmb_api_path: path...
python
15
0.554756
91
45.054348
184
starcoderdata
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace nsExceptions { /// /// Handles exception inside tasks. /// public static class TaskExceptionHandler { public static void Handle(Task t...
c#
15
0.605195
112
24.666667
30
starcoderdata
void plo_init(void) { u16 t; int i, act; const char digits[] = "0123456789abcdef"; low_init(); timer_init(); serial_init(BPS_115200); phfs_init(); //plostd_printf(ATTR_LOADER, "\n"); plostd_printf(ATTR_LOADER, "%s\n", WELCOME); /* Execute loader command */ for (t = _plo_timeout; t; t--) { plostd_printf...
c
10
0.611111
70
17.542857
35
inline
void space_resize(int h, int w, int maxhw, int times, int *nh, int *nw) { int m; float scale; // Make sure nh and nw <= maxhw, m = MAX(h, w); if (maxhw > 0 && m > maxhw) { scale = 1.0 * maxhw / m; h = (int)(scale * h); w = (int)(scale * w); } h = (h + times - 1) / times; w = (w + times - 1)...
c
10
0.481081
73
20.823529
17
inline
const http = require("http") const fs = require("fs") const toObject = require("object-deep-from-entries") const {parse} = require("then-busboy") const server = () => http.createServer((req, res) => { async function transform(body) { const files = await Promise.all(body.files.entries().map( ([path, file]...
javascript
20
0.631799
73
23.512821
39
starcoderdata
package org.consumersunion.stories.common.shared.dto; import java.util.List; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeName; import com.google.common.collect.Lists; @JsonTypeName("organization_links") public class OrganizationResourceLinks extends ResourceL...
java
7
0.695215
123
28.035398
113
starcoderdata
#include #include "utils.hpp" int main(int argc, char* argv[]) { std::string mission_type = "passthrough.yaml"; std::string mpc_main_yaml_path = MULTICOPTER_MPC_OCP_DIR "/mpc-main.yaml"; multicopter_mpc::MpcMain mpc_main(multicopter_mpc::MultiCopterTypes::Iris, mission_type, mpc_main_yaml_path); Simulator s...
c++
12
0.680962
111
37.28
25
starcoderdata
package com.baeldung.tutorial.hexagonal.adapter; import com.baeldung.tutorial.hexagonal.port.in.UserRegistration; /** * User Registration data is populated in this class from REST API * Example, No Implementation */ public class RestUserRegistrationImpl implements UserRegistration { public boolean subscriptio...
java
8
0.684397
67
18.448276
29
starcoderdata
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. package com.azure.monitor.query.codesnippets; import com.azure.core.credential.TokenCredential; import com.azure.identity.DefaultAzureCredentialBuilder; import com.azure.monitor.query.MetricsQueryAsyncClient; import com.az...
java
23
0.660016
109
45.407407
81
research_code
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include #include #include #define ORGANIZATION_NAME "@EVGENY@" #define ORGANIZATION_DOMAIN "localhost" #define APPLICATION_NAME "FindOptimalK program" #define SETTINGS_FILE_PWD "config.ini" //Full path to the ini file //Settings group names #define SETTINGS_M...
c
11
0.739634
66
19.74
50
starcoderdata
func initClient(proxyAddr string, insecure bool, pool *x509.CertPool) (*webClient, *url.URL, error) { var opts []roundtrip.ClientParam u, err := url.ParseRequestURI(proxyAddr) if err != nil { return nil, nil, trace.Wrap(err).AddField("proxy_addr", proxyAddr) } if pool != nil { // use custom set of trusted CA...
go
14
0.707285
108
31.869565
23
inline
package software.amazon.qldb.example.dagger.modules; import com.amazonaws.services.qldb.AmazonQLDB; import dagger.internal.Factory; import dagger.internal.Preconditions; import javax.annotation.Generated; import javax.inject.Provider; import software.amazon.qldb.example.actions.ledgermanagement.ListLedgers; @Generate...
java
12
0.775848
91
32.342105
38
starcoderdata
#ifndef _WCHAR_H #define _WCHAR_H // This mechanism provides __gnu_va_list which is equivalent to va_list // We have to do this because wchar.h is not supposed to define va_list #define __need___va_list #include #include #include #include #include #include #define WEOF 0xffffffffU // TODO: The following declar...
c
12
0.686687
103
36.193548
124
starcoderdata
// Copyright (c) Xenko contributors (https://xenko.com) and Silicon Studio Corp. (https://www.siliconstudio.co.jp) // Distributed under the MIT license. See the LICENSE.md file in the project root for more information. using Xenko.UI.Tests.Events; using Xenko.UI.Tests.Layering; namespace Xenko.UI.Tests { public c...
c#
13
0.623116
114
29.955556
45
starcoderdata
package com.github.huihuangui.ovalseekbar.app; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.RecyclerView; import android.view.ViewGroup; import android.widget.ImageView; import com.azoft.carousellayoutmanager.Car...
java
10
0.723299
127
35.541667
72
starcoderdata
/* ------------------------------------------------------------------------------ Licensing information can be found at the end of the file. ------------------------------------------------------------------------------ pixelfont.h - v0.1 - Do this: #define PIXELFONT_IMPLEMENTATION before you include this file ...
c
25
0.617816
118
29.730216
278
starcoderdata
<?php namespace Billplz\Base\Collection; use Billplz\Request; use Laravie\Codex\Contracts\Response; use Billplz\Contracts\Collection\PaymentMethod as Contract; class PaymentMethod extends Request implements Contract { /** * Get payment method index. * * @return \Billplz\Response */ public...
php
15
0.607415
96
22.512821
39
starcoderdata
using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Draw.src.Model { [JsonObject] public class TriangleShape : Shape { #region Constructor [JsonConstructor] public TriangleShape(Rectangle...
c#
18
0.635557
80
22.572727
110
starcoderdata
import React from 'react'; import { connect } from 'react-redux'; import OpenFile from './OpenFile'; import { closeBgSettingsPanel, insert, setBgImage, setBgVideo } from '../actions/actions'; import { getLabels, getInitialSlideBgSettings, getNewSlideBgSettings, getLeftPanelStatus } from '../selectors'; import Labe...
javascript
19
0.627862
111
28.982906
234
starcoderdata
var Floor = function Floor(game,posx,posy) { this.game = game; this.sprite = null; this.posx = posx; this.posy = posy; } Floor.prototype.create= function() { this.sprite = this.game.add.sprite(this.posx, this.posy, 'floor'); this.game.physics.arcade.enable(this.sprite); this.sprite.body.all...
javascript
17
0.680062
70
24.92
25
starcoderdata
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\post; use App\comment; use App\user; class HomeController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('auth'); ...
php
13
0.536873
91
23.565217
69
starcoderdata
bool StreamCpp::SetPosition(off_type position, PositionType positionType) { // Currently we assume there is an istream present. if(mpStdIstream) { switch(positionType) { case kPositionTypeBegin: mpStdIstream->seekg((std::streamoff)position, std::ios::beg); ...
c++
16
0.61705
121
34.238095
21
inline
<?php namespace frontend\models; use common\models\Account; use Yii; /** * Signup form */ class Work extends Account { public $institute_name; public $degree; public $time_period; public $description; /** * @inheritdoc */ public function rules() { return [ ...
php
17
0.445133
94
20.223684
76
starcoderdata
import Button from '../../../../plugins/input/button/Button.js'; import EmitChildEvent from './EmitChildEvent.js'; const GetValue = Phaser.Utils.Objects.GetValue; var ClickChild = function (config) { var clickConfig = GetValue(config, 'click', undefined); if (clickConfig === false) { return; } ...
javascript
9
0.632632
98
28.71875
32
starcoderdata
// Cannot implicitly shard accessed collections because queries on a sharded collection are not // able to be covered when they aren't on the shard key since the document needs to be fetched in // order to apply the SHARDING_FILTER stage. // @tags: [ // assumes_unsharded_collection, // ] // Test indexing of decimal ...
javascript
20
0.666036
97
44.534483
58
starcoderdata
///VectorAdd sample, from the NVidia JumpStart Guide ///http://developer.download.nvidia.com/OpenCL/NVIDIA_OpenCL_JumpStart_Guide.pdf ///Instead of #include we include ///Apart from this include file, all other code should compile and work on OpenCL compliant implementation #include #include #include #include ...
c++
14
0.658947
145
36.439306
173
starcoderdata
def save_topology_info(topo_name, node_dict, link_dict): """ Save topology info. 'node_dict' and 'link_dict' are saved in folder ."self.name"/"self.name"DB/ respectively in the files nodes.json and links.json. """ # Build up database_path current_dir = os.path.dirname(__file__) da...
python
8
0.651026
79
31.52381
21
inline
/* * 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 uk.trainwatch.web.signal; import java.time.Instant; import java.time.temporal.ChronoUnit; import java.util.Optional; import ja...
java
23
0.635636
108
28.820896
67
starcoderdata
void testInsert_reverseorder(value_T *master_table, size_t item_count, const std::string &myTypeName, size_t iteration_count, bool do_summarize = true ) { // reverse the master list order std::reverse( master_table, master_table+item_count ); testInsert_common<value_T>(master_table,item_count,myTypeName,i...
c++
8
0.741551
154
49.4
10
inline
using System; using System.Windows.Media; using ATL; using Gouter.DataModels; using Gouter.Utils; namespace Gouter; /// /// アルバム情報 /// internal class AlbumInfo : NotificationObject, IPlaylistInfo { /// /// アルバムの内部ID /// public int Id { get; } /// /// アルバム識別キー /// public string ...
c#
18
0.566902
74
23.816794
131
starcoderdata
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #pragma once // Common libraries #include "Kismet/KismetArrayLibrary.h" #include "Kismet/KismetSystemLibrary.h" #include "Kismet/KismetMathLibrary.h" // Special libraries #include "Kismet/DataTableFunctionLibrary.h" FORCEINLINE UClass* DynamicMetaCast(con...
c
29
0.748495
133
24.5625
208
starcoderdata
private Pair<String, String> resolveMethodAndSignature(ASTNode x, com.sun.fortress.nodes.Type arrow, String methodName) throws Error { Pair<String, String> method_and_signature = null; String signature = null; if ( arrow instanceof ArrowType ) { // TODO should this be no...
java
11
0.639011
84
46.25
24
inline
import json from typing import Any, Dict import requests def lambda_handler(event: Dict[str, Any], context: Dict[str, Any]) -> Dict[str, Any]: print(f"request: {json.dumps(event)}") uuid_message = get_uuid_message() return { "statusCode": 200, "headers": {"Content-Type": "text/plain"}, ...
python
10
0.620755
85
25.5
20
starcoderdata
static public void AddSimpleSetParametersToObject( Utilities.CommandLineBuilder commandLineBuilder, Framework.ITaskItem[] originalItems, string valueQuoteChar, bool foptimisticParameterDefaultValue ) { System.Collections.Generic.IList<Framework.ITaskIt...
c#
18
0.500811
98
43.047619
42
inline
import { addStyles } from "../util" let toast export function setupToast() { toast = document.createElement('div') toast.classList.add('toast') addStyles(toast, { position: 'fixed', top: 0, left: 0, right: 0, margin: 'auto', fontSize: '2rem', textAlign: 'center', fontFamily: 'sa...
javascript
13
0.62029
47
19.323529
34
starcoderdata
package com.github.tavalin.orvibo.devices; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.github.tavalin.orvibo.OrviboClient; import com.github.tavalin.orvibo.commands.CommandFactory; import com.github.tavalin.orv...
java
14
0.647146
91
30.261538
65
starcoderdata
package opa import ( "context" "encoding/json" "fmt" "strconv" "strings" "github.com/bradmccoydev/tfval/model" "github.com/open-policy-agent/opa/rego" ) func RetrieveOpaPolicyResponse(plan []byte, policyLocation string, opaRegoQuery string) string { rs := GetOpaResultSet(plan, policyLocation, opaRegoQuery) ...
go
13
0.686073
213
24.48366
153
starcoderdata
package org.multibit.hd.error_reporting.tasks; import com.google.common.collect.ImmutableMultimap; import com.yammer.dropwizard.tasks.Task; import org.multibit.hd.error_reporting.ErrorReportingService; import org.multibit.hd.error_reporting.resources.PublicErrorReportingResource; import org.slf4j.Logger; import org.sl...
java
19
0.7
137
30
80
starcoderdata
package diy.uigeneric; import org.junit.runner.RunWith; import org.junit.runners.Suite; import diy.uigeneric.data.SampleServerDataSourceTest; import diy.uigeneric.data.SampleServerIndirectListTest; @RunWith(Suite.class) @Suite.SuiteClasses({ SampleServerDataSourceTest.class, SampleServerIndirectListT...
java
7
0.726688
76
24.916667
24
starcoderdata
void Part::Draw(QImage* pImage_) { if(m_pDrawing) { // 1.get accumulate transform // from all parent NTransform::TransformGroup* _pTransGroup = new NTransform::TransformGroup(); NTransform::Transform* _pTrans = GetTran...
c++
11
0.464208
70
30.810345
58
inline
import tensorflow as tf import keras import pandas as pd import numpy as np from sklearn import linear_model, preprocessing # Loading data from the hltv api data = pd.DataFrame.from_dict(hltv.get_results()); # Encoding all non-numeric values le = preprocessing.LabelEncoder() for column in data: if data[column].dt...
python
12
0.717902
74
28.105263
19
starcoderdata
Collections = {}; //CRFs = new Meteor.Collection("CRFs"); //Metadata = new Meteor.Collection("Metadata"); if (Meteor.isClient){ Template.registerHelper("Collections", Collections); // Collections.Blobs = new FS.Collection("blobs", { // stores: [Stores.blobs], // chunkSize: 4 * 1024 * 1024 // }); }
javascript
6
0.664756
54
23.928571
14
starcoderdata
public static Class<?> findPackageOrFail(final Class<?> component, final Predicate<Class<?>> tester, final String api) { final ClassLoader loader = Thread.currentThread().getContextClassLoader(); final String pck = component.getPackage() == null ? null : component.getPackage().getName(); ...
java
15
0.540741
112
47.25
28
inline
using System; using System.Runtime.InteropServices; namespace RegHook { class WinAPI { [UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet = CharSet.Auto, SetLastError = true)] internal delegate IntPtr RegOpenKeyEx_Delegate( IntPtr hKey, string subKey, ...
c#
13
0.596617
116
33.545455
154
starcoderdata
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef DEVICE_VR_VR_DEVICE_H #define DEVICE_VR_VR_DEVICE_H #include "base/callback.h" #include "base/macros.h" #include "device/vr/public/mojom/vr_servi...
c
14
0.737631
79
32.372093
86
starcoderdata
"""Utility functions for clack.""" import os.path import sys __all__ = ('local_path', 'string_types') def local_path(filename): """Return an absolute path to a file in the current directory.""" return os.path.join(os.path.dirname(os.path.realpath(__file__)), filename) if sys.version_info >= (3,): stri...
python
11
0.655172
78
21.176471
17
starcoderdata
@GetMapping("/games/lobbies/{gameSetUpId}/{playerToken}") @ResponseStatus(HttpStatus.OK) @ResponseBody public LobbyGetDTO getLobbyInfo(@PathVariable String gameSetUpId, @PathVariable String playerToken) { //Check that SetupEntity actually exists stringIsALong(gameSetUpId); //Try ...
java
7
0.684105
105
44.272727
11
inline
package com.dmall.mms.service.impl.membersku.handler; import com.dmall.common.dto.BaseResult; import com.dmall.common.util.ResultUtil; import com.dmall.component.web.handler.AbstractCommonHandler; import com.dmall.mms.feign.SkuServiceFeign; import com.dmall.mms.generator.dataobject.MemberCollectionSkuDO; import com.dm...
java
12
0.765027
106
39.666667
45
starcoderdata
/** * /author * * /file CFrameMgr.H * /brief Keeps track of the room to virtual space transform * * Note: this pretty much came from gfxmgr in vrbase */ #ifndef CFRAMEMGR_H #define CFRAMEMGR_H #include #include #include #include typedef std::shared_ptr<class CFrameMgr> CFrameMgrRef; class CFrameMgr : public...
c
10
0.76393
101
34.694118
85
starcoderdata
//------------------------------------------------------------------------------ // DAO for accounting purposes // Require index: `db.accounting.createIndex( { addr: 1, date: 1 } )` //------------------------------------------------------------------------------ module.exports = class AccountTxDAO { constructor(e...
javascript
13
0.551445
88
32.307692
26
starcoderdata
""" embedeval ~~~~~~~~~ NLP Embedding Evaluation Tool :copyright: (c) 2019 by :license: MIT, see LICENSE for more details. """ from typing import List, Tuple from pathlib import Path import numpy as np from embedeval.errors import EmbedevalError from embedeval.embedding import WordEmbedding class SimpleWordEmb...
python
17
0.588235
97
30.96
100
starcoderdata
def init(publicKey, privateKey=None): """ Set public and private key """ global config config['publicKey'] = publicKey config['privateKey'] = privateKey
python
7
0.644068
37
21.25
8
inline
def _generate_compose_file(self, command, additional_volumes=None, additional_env_vars=None): """Writes a config file describing a training/hosting environment. This method generates a docker compose configuration file, it has an entry for each container that will be created (based on self.hos...
python
12
0.609426
101
38.703704
54
inline
@Override public Set<Object> computeVariableValues(Value value, Stmt stmt) { if (value instanceof StringConstant) { return Collections.singleton((Object) ((StringConstant) value).value.intern()); } else if (value instanceof NullConstant) { return Collections.singleton((Object) "<NULL>"); } els...
java
19
0.604155
91
40.44186
43
inline
/* Consider a game where there are n children (numbered 1,2,…,n) in a circle. During the game, every second child is removed from the circle, until there are no children left. In which order will the children be removed? Input The only input line has an integer n. Output Print n integers: the removal order. Constrain...
c++
11
0.538028
98
21.680851
47
starcoderdata
<?php namespace App\Http\Controllers\API\Param; use App\Http\Controllers\Controller; use App\Http\Resources\Params\JabatanResource; use App\Http\Resources\Params\PendidikanResource; use App\Http\Resources\Params\StatusKeluargaResource; use App\Models\Param; class GetParamController extends Controller { public fu...
php
17
0.664927
118
30.933333
30
starcoderdata
private void ProcessControlFrame(Stream clientStream) { switch (CurrentHeader.Flags.Option) { case WebSocketFrameOption.Continuation: case WebSocketFrameOption.Text: case WebSocketFrameOption.Binary: throw new WebSocketE...
c#
17
0.555556
134
50.117647
34
inline
import { TOGGLE_MODE_EVENT } from '../../util/EventHelper'; const VERY_HIGH_PRIORITY = 50000; export default function PreserveElementColors( eventBus, elementRegistry, graphicsFactory) { this._elementRegistry = elementRegistry; this._graphicsFactory = graphicsFactory; this._elementColors = {}; event...
javascript
18
0.695092
95
23.343284
67
starcoderdata
import React from 'react' import { Space, Typography } from 'antd' import { FacebookOutlined, ChromeOutlined } from '@ant-design/icons' import logo from '../assets/logo.svg' const { Text } = Typography const Footer = () => { return ( <div className={'footer-container'}> <img width={164} heigh...
javascript
11
0.527159
101
36.466667
30
starcoderdata
const { Node, Stack } = require('../stackLL') describe('Stack > Using Linked List', () => { test('should create new node with correct default reference', () => { let element1 = new Node() expect(element1.data).toBeNull() expect(element1.next).toBeNull() let element2 = new Node(10) expect(element...
javascript
19
0.625784
79
27.7
50
starcoderdata
/* Copyright 2021 The KodeRover Authors. 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 or agreed to in writing, s...
go
13
0.684295
107
25.181818
143
starcoderdata
LRESULT CFFindDialog::OnInitDialog(UINT msg, WPARAM wparam, LPARAM lparam, BOOL& handled) { // Init() must be called before Create() or DoModal()! DCHECK(automation_client_.get()); InstallMessageHook(); SendDlgItemMessage(IDC_FIND_TEXT, EM_EXLIMITTEXT, 0, kMaxFindChars); BO...
c++
8
0.646018
74
36.733333
15
inline
package com.dcits.dcwlt.pay.batch.service; /** * Created by yangjld on 2021/3/12 0012. */ public interface IReportDataService { void statistics(String reportDate); }
java
13
0.772727
111
27.6
10
starcoderdata
from datetime import datetime from django.contrib.auth import get_user_model from django.conf import settings # 이메일 전송 관련 Imports from django.core.mail import EmailMessage from django.utils.encoding import force_bytes from django.utils.http import urlsafe_base64_encode # Rest Framework Serializers from rest_framework ...
python
13
0.625098
107
35.748201
139
starcoderdata
function () { //inizializzo proprietà dell'oggetto che contiene una lista messaggi fake da dove pescare messaggi random this.initializeSampleMessage(); //creo le conversazioni fake this.createFakeThreads(); //carico le conversazioni this.loadThreads(); //rimuovo splash screen this.discardSplashScreen();...
javascript
7
0.755376
107
30.083333
12
inline
package subscriber import ( "fmt" "io" "github.com/husainaloos/event-bus/message" ) // WriterSubscriber Demonistration subscriber type WriterSubscriber struct { id string doneChannel chan (message.Message) isRunning bool writer io.Writer } // NewWriterSubscriber constructor func NewWriterSubs...
go
14
0.719355
81
20.016949
59
starcoderdata
(function($){ $(function(){ $.lazyLoadXT.onload = function() { var $el = $(this); $el .removeClass('lazy-hidden') .addClass('animated ' + $el.attr('data-effect')); }; $('.button-collapse').sideNav(); $('.carousel.carousel-slider').carousel({full_width: true}); ...
javascript
22
0.507508
64
25.68
25
starcoderdata
const showTip = (msg, { type = 'ok', delay = 1500, cb = () => {} } = {}) => { const klas = `${type}-toast msg` const _toast = document.getElementById('global-toast') const _msg = _toast.getElementsByClassName('msg')[0] _toast.addEventListener('transitionend', () => { if (!_toast.classList.contains('show')) ...
javascript
15
0.580696
77
25.333333
24
starcoderdata
import Vue from 'vue'; import VueRouter from 'vue-router'; import Vuex from 'vuex'; // components import Home from './components/Home.vue'; import NewsAndUpdate from './components/NewsAndUpdate.vue'; import Register from './components/Register.vue'; import RegisterSuccess from './components/Register/Successful.vue'; i...
javascript
13
0.700999
103
39.65625
32
starcoderdata
private void handleRegion(TaggedMap region) { if (region != null && !region.isEmpty()) { try { // postpone writing out LAT_LON_BOX element until there is a child element // likewise don't write Region element unless we have LAT_LON_BOX or Lod LinkedLis...
java
16
0.551128
113
51.794118
68
inline
bool apBreakpointHitEvent::writeSelfIntoChannel(osChannel& ipcChannel) const { bool retVal = true; // Write the break reason: ipcChannel << (gtInt32)_breakReason; bool isFunctionCallPresent = (_aptrBreakedOnFunctionCall.pointedObject() != NULL); ipcChannel << isFunctionCallPresent; if (isFun...
c++
9
0.7
86
26.535714
28
inline
package com.planet_ink.coffee_mud.core.collections; import java.util.Collection; import java.util.Enumeration; import java.util.LinkedList; import java.util.NoSuchElementException; /* Copyright 2000-2014 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wi...
java
12
0.736294
81
23
76
starcoderdata
import ApiResponse from '/Core/Api/ApiResponse'; import Registry from '/Core/Registry'; function handleResponse(response) { // Log Http responses to console if developerMode is enabled return Registry.getStore('Core.Layout.AppStore').getData().then(data => { if(data.developerMode){ console.log(response) } r...
javascript
13
0.685636
112
28.459459
74
starcoderdata
// SPDX-License-Identifier: GPL-2.0+ /* NetworkManager Applet -- allow user control over networking * * * * (C) Copyright 2007 - 2012 Red Hat, Inc. */ #ifndef NMA_WIRELESS_DIALOG_H #define NMA_WIRELESS_DIALOG_H #include #include #include #include #include #include #include #include #define NMA_TYPE_W...
c
8
0.660922
129
36.435484
62
starcoderdata
<?php class homeController extends controller { public function index($parametro = null) { $this->loadView('', array(), false); } }
php
10
0.628378
43
11.333333
12
starcoderdata
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model app\models\MaterialSearch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="material-search"> <?php $form = ActiveForm::begin([ 'action' => ['index'], 'method' => 'get', ]); ?> <...
php
11
0.541195
75
26.537634
93
starcoderdata
# minimalna vrijednost O_MIN = [ 38, 115, 46, 100, 38, 23, 8, 16, ] # maksimalna vrijednost O_MAX = [ 78, 240, 96, 210, 82, 50, 18, 36, ] # srednja vrijdnost O_Z = [ 58, 177, 71, 155, 60, 36, 13, 26, ] # potrosnja P = [ ...
python
4
0.449905
23
8.280702
57
starcoderdata
void HumdrumFileBase::prepare_address(struct sockaddr_in *address, const string& hostname, unsigned short int port) { memset(address, 0, sizeof(struct sockaddr_in)); struct hostent *host_entry; host_entry = gethostbyname(hostname.c_str()); if (host_entry == NULL) { cerr << "Could not find address for " << hos...
c++
10
0.693709
66
29.25
20
inline
namespace BookmarksAPI.Services { using System; using System.Linq; using System.Text; using System.Threading.Tasks; using BookmarksAPI.Exceptions; using BookmarksAPI.Services.Interfaces; using DataWorkShop; using DataWorkShop.Entities; using DataWorkShop.Entities.Structures; usi...
c#
25
0.565606
133
33.35
140
starcoderdata
using System; using System.Diagnostics.CodeAnalysis; using Moq.Language; using Moq.Language.Flow; namespace Moq { internal sealed partial class MethodCallReturn<TMock, TResult> { public IVerifies Raises eventExpression, Func<T, EventArgs> func) { return this.RaisesImpl(eventExpression, func); } public I...
c#
11
0.698127
220
43.826087
299
starcoderdata
<?php return array( 'extra' => array( 'routes' => array( 'vetor.panel' => function() { $api = new modules\vetor\panel\PanelApi(); $api->api(); }, 'vetor.panel/feed' => function() { $url = isset($_GET['url']) ? $_GET['url'] :...
php
18
0.383592
63
27.1875
16
starcoderdata
import Page from '../Page'; class Home extends Page { static init(props) { console.log(props); } } export default Home;
javascript
8
0.653846
27
13.444444
9
starcoderdata
@Override public void detectAndSendChanges() { super.detectAndSendChanges(); // Resend the whole inventory to prevent visual glitches due to client-prediction // This would not be needed if the Container enforces the same restrictions on slots as vanilla // Cursor Item /*for...
java
6
0.619718
103
40.823529
17
inline
<?php /** * Created by IntelliJ IDEA. * User: tonyxu * Date: 31/07/2016 * Time: 7:28 PM */ namespace Menulog\Model; class Restaurant { /** * @var int $id */ protected $id; /** * @var Menu[] $menus */ protected $menus; /** * @var string $name */ protected...
php
14
0.504992
78
16.425121
207
starcoderdata
import numpy as np # Script to generate data for inverse and inverse update tests # Output for copy-and-paste to C++ def output_for_cpp(A,var_name='a'): N = A.shape[0] for i in range(N): for j in range(N): print('%s(%d,%d) = %12.10g;'%(var_name,i,j,A[i,j])) A = np.array([ [2.3, 4.5, 2.6], [0.5, 8.5, 3...
python
13
0.556332
62
19.087719
57
starcoderdata
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
python
16
0.596487
120
27.789272
261
starcoderdata
using System; using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Web; using HMPPS.ErrorReporting; using Sitecore; using Sitecore.Pipelines.HttpRequest; using Sitecore.Security; using Sitecore.Security.Authentication; using Sitecore.Web; using HMPPS.Utilities.Helpers; using H...
c#
20
0.686851
160
40.285714
84
starcoderdata
async _run() { try { this.running = true; // main blocking loop // abort if this.running is set to false // from here on, user can end debugger with ctrl+c while (this.running) { if (this.argv.ngrok) { // agent: ngr...
javascript
16
0.457002
88
36.022727
44
inline