prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>stdlib.js<|end_file_name|><|fim▁begin|>var NULL = null;
function NOP() {}
function NOT_IMPLEMENTED() { throw new Error("not implemented."); }
function int(x) {
return x|0;
}
function pointer(src, offset, length) {
offset = src.byteOffset + offset * src.BYTES_PER_ELEMENT;
if (typeof length === "num... | throw new Error("calloc failed.");
} |
<|file_name|>basecalloptimizer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2006-2008 1&1 Internet AG, Germany, htt... | newCall = treeutil.compileString("%s.call()" % superClass)
# "member" |
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.example.a226;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class MainActivity extends Activity {
EditText et;... | |
<|file_name|>ofc_utils.py<|end_file_name|><|fim▁begin|>from suds.client import Client
from nova import exception
from nova import db
import logging
logging.getLogger('suds').setLevel(logging.INFO)
def update_for_run_instance(service_url, region_name, server_port1, server_port2, dpid1, dpid2):
# check region name... |
def has_region(service_url, region_name): |
<|file_name|>basewidget.py<|end_file_name|><|fim▁begin|>from pygame.sprite import DirtySprite
from pygame import draw
class BaseWidget(DirtySprite):
"""clase base para todos los widgets"""
focusable = True
# si no es focusable, no se le llaman focusin y focusout
# (por ejemplo, un contenedor, ... | def on_key_down(self, keydata):
pass
def on_key_up(self, keydata):
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import functools<|fim▁hole|>import pfp.interp
def native(name, ret, interp=None, send_interp=False):
"""Used as a decorator to add the decorated function to the
pfp interpreter so that it can be used from within scripts.
:param str name: The name of the functio... | |
<|file_name|>broker_reader_test.cpp<|end_file_name|><|fim▁begin|>// 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. The ASF licenses this file
// to you ... | // under the License.
#include "exec/broker_reader.h"
|
<|file_name|>scorers.py<|end_file_name|><|fim▁begin|>'''
Auxiliary code providing vector-valued scoring functions
for convenient use in the parameter-free Ladder Mechanism.
Original algorithm by Avrim Blum and Moritz Hardt
Python implementation by Jamie Hall and Moritz Hardt
MIT License
'''
from sklearn.utils import... | "({0}!={1})".format(y_true.shape[1], y_pred.shape[1])) |
<|file_name|>sql.rs<|end_file_name|><|fim▁begin|>use std::str::FromStr;
use crate::parsers::parser;
pub use crate::parsers::sql::clause::Limit;
pub use crate::parsers::sql::clause::OrderBy;
use crate::parsers::sql::Field;
pub use crate::parsers::sql::WhereCond;
#[derive(Debug, Default, Clone, PartialEq)]
pub struct S... | impl FromStr for Sql {
type Err = anyhow::Error; |
<|file_name|>Helpers.ts<|end_file_name|><|fim▁begin|>import { Assertions, Mouse, UiFinder } from '@ephox/agar';
import { Obj, Type } from '@ephox/katamari';
import { Attribute, Checked, Class, Focus, SugarBody, SugarElement, Traverse, Value } from '@ephox/sugar';
import { assert } from 'chai';
import Editor from 'tiny... | |
<|file_name|>index.controller.js<|end_file_name|><|fim▁begin|>(function() {<|fim▁hole|>
angular.module('newApp')
.controller('newAppCtrl', newAppCtrl);
function newAppCtrl() {
}
})();<|fim▁end|> | 'use strict'; |
<|file_name|>NotificationWorker.java<|end_file_name|><|fim▁begin|>/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Vincent Vergnolle
*
* 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... | |
<|file_name|>product-info.controller.js<|end_file_name|><|fim▁begin|>angular.module('elementBoxApp.products.productInfo')
.controller('ProductInfoCtrl', [
'$scope', '$rootScope', '$state', '$stateParams', '$timeout', 'ModalAlert', 'ProductsService', 'UserService', 'CommentsService', 'EVENT_NAMES',
function... | $scope.commentSent = true; |
<|file_name|>pointCloudJsonUtils.js<|end_file_name|><|fim▁begin|>// COPYRIGHT © 2017 Esri
//
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
//
// This material is licensed for use under the Esri Master License
// Agreement (MLA), and... | |
<|file_name|>UseDefaultArchivesAction.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2010 Oak Ridge National Laboratory.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the E... | public void run()
{
new AddArchiveCommand(operations_manager, pvs, Preferences.getArchives(), true);
} |
<|file_name|>testSocketIO.js<|end_file_name|><|fim▁begin|>var net = require('net');
Stomp = require('./stomp');
wrapTCP = function(port, host) {
var socket, ws;
socket = null;
ws = {
url: 'tcp:// ' + host + ':' + port,
send: function(d) {
return socket.write(d);
},
close: function() {<|fim▁... | return socket.end();
}
}; |
<|file_name|>live.py<|end_file_name|><|fim▁begin|>from envs.common import *
DEBUG = False
TEMPLATE_DEBUG = DEBUG
# EMAIL_BACKEND = 'django_ses.SESBackend'
STATIC_URL = 'http://%s.s3.amazonaws.com/' % AWS_STORAGE_BUCKET_NAME
COMPRESS_URL = STATIC_URL
FAVICON_URL = "%sfavicon.ico" % STATIC_URL
DEFAULT_FILE_STORAGE = ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016-2021, NVIDIA CORPORATION.<|fim▁hole|><|fim▁end|> | # SPDX-License-Identifier: Apache-2.0 |
<|file_name|>docs.py<|end_file_name|><|fim▁begin|># Module: docs
# Date: 03rd April 2013
# Author: James Mills, j dot mills at griffith dot edu dot au
"""Documentation Tasks"""
from fabric.api import lcd, local, task
from .utils import pip, requires<|fim▁hole|>
PACKAGE = "mio"
@task()
@requires("make", "s... | |
<|file_name|>socialcoffee.js<|end_file_name|><|fim▁begin|>/*
* 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.
*/
//var MODAL = $("#modalProducto");
var URL = Define.URL_BASE;
window.onlo... | } |
<|file_name|>authentication.py<|end_file_name|><|fim▁begin|>import datetime
from rest_framework.authentication import TokenAuthentication
from rest_framework import exceptions
from factotum.environment import env
class ExpiringTokenAuthentication(TokenAuthentication):
keyword = "Bearer"
def authenticate_cr... | model = self.get_model()
try: |
<|file_name|>fsdev_disks.py<|end_file_name|><|fim▁begin|>import sys, os, re, string
from autotest_lib.client.bin import utils, fsinfo, fsdev_mgr, partition
from autotest_lib.client.common_lib import error
fd_mgr = fsdev_mgr.FsdevManager()
# For unmounting / formatting file systems we may have to use a device name
# ... |
# Next step is to create a fresh file system (if we need to) |
<|file_name|>is-jetpack-product-site.ts<|end_file_name|><|fim▁begin|>import getRawSite from 'calypso/state/selectors/get-raw-site';
import isAtomicSite from 'calypso/state/selectors/is-site-automated-transfer';
import { AppState } from 'calypso/types';
type Site = {
options?: {
jetpack_connection_active_plugins?: s... |
if ( ! site ) {
return null;
} |
<|file_name|>optimize_test.cc<|end_file_name|><|fim▁begin|>#include <cassert>
#include <iostream>
#include <sstream>
#include <boost/program_options/variables_map.hpp>
#include "optimize.h"
#include "online_optimizer.h"
#include "sparse_vector.h"
#include "fdict.h"
using namespace std;
double TestOptimizer(BatchOptim... |
using namespace std::tr1;
void TestOnline() { |
<|file_name|>SimpleDataCoding.java<|end_file_name|><|fim▁begin|>/*
* 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 requir... | public int hashCode() {
final int prime = 31; |
<|file_name|>foreach_object.js<|end_file_name|><|fim▁begin|>var jazz = require("../lib/jazz");
var fs = require("fs");
var data = fs.readFileSync(__dirname + "/foreach_object.jazz", "utf8");
var template = jazz.compile(data);
template.eval({"doc": {<|fim▁hole|><|fim▁end|> | "title": "First",
"content": "Some content"
}}, function(data) { console.log(data); }); |
<|file_name|>path.rs<|end_file_name|><|fim▁begin|>use crate::factory::IFactory;
use crate::geometry::IGeometry;
use crate::resource::IResource;
use com_wrapper::ComWrapper;
use dcommon::Error;
use winapi::shared::winerror::SUCCEEDED;
use winapi::um::d2d1::{ID2D1Geometry, ID2D1PathGeometry, ID2D1Resource};
use wio::com... |
pub mod builder;
#[repr(transparent)] |
<|file_name|>0006_add_jsonb_index_for_fileversions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-04-03 20:50
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
<|fim▁hole|> dependencies = [
('osf', '00... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>"""<|fim▁end|> | The TradeChain community is used to keep track of transactions performed in the decentralized market. |
<|file_name|>stif_tests.py<|end_file_name|><|fim▁begin|># Copyright (c) 2001-2016, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.can... | response = self.query_region(query) |
<|file_name|>issue-16452.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616
<|fim▁hole|>fn main() {
if true { return }
match () {
() => { static MAGIC: usize = 0; }
}
}<|fim▁end|> | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(feature = "nightly-testing", feature(plugin))]
#![cfg_attr(feature = "nightly-testing", plugin(clippy))]
#[macro_use]
extern crate clap;
extern crate hoedown;
extern crate rayon;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde... | |
<|file_name|>test_driver.py<|end_file_name|><|fim▁begin|>"""
@package mi.instrument.nortek.aquadopp.ooicore.test.test_driver
@author Rachel Manoni
@brief Test cases for ooicore driver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ bin/test_driver
$ bin/test_driver -u
$ bin/test_... | AquadoppDwVelocityDataParticleKey.TEMPERATURE: {TYPE: int, VALUE: 0, REQUIRED: True},
AquadoppDwVelocityDataParticleKey.VELOCITY_BEAM1: {TYPE: int, VALUE: 0, REQUIRED: True}, |
<|file_name|>MessageTest.java<|end_file_name|><|fim▁begin|>/**
* The MIT License
* Copyright (c) 2012 Graylog, Inc.
*
* 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... |
@Test |
<|file_name|>style.js<|end_file_name|><|fim▁begin|>// -------------------------------------------------------------
// WARNING: this file is used by both the client and the server.
// Do not use any browser or node-specific API!
// -------------------------------------------------------------
/* eslint hammerhead/proto... | var url = url1 || url2 || url3 || url4 || url5;
var closeQuote = closeQuote1 || closeQuote2 || closeQuote3 || closeQuote4 || ''; |
<|file_name|>custom-admin.js<|end_file_name|><|fim▁begin|>jQuery(function($) {
///////////////////////////////////////////////////////////////////
///// META BOXES JS
///////////////////////////////////////////////////////////////////
jQuery('.repeatable-add').live('click', function() {
var field = jQuery(this... | imageFrame.on( 'select', function() {
selection = imageFrame.state().get('selection'); |
<|file_name|>paymentserver.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <QApplication>
#include "paymentserver.h"
#include "gui... |
QString name = ipcServerName();
// Clean up old socket leftover from a crash: |
<|file_name|>EditorMouseMenu.java<|end_file_name|><|fim▁begin|>/*
* EditorMouseMenu.java
*
* Created on March 21, 2007, 10:34 AM; Updated May 29, 2007
*
* Copyright 2007 Grotto Networking
*/
package Samples.MouseMenu;
import edu.uci.ics.jung.algorithms.layout.Layout;
import edu.uci.ics.jung.algorithm... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__all__ = ["speedtest_exceptions", "speedtest"]<|fim▁hole|>from . import sendtest<|fim▁end|> | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN<|fim▁hole|># modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.util.mimetypes import register_custom_mimetypes
__version__ = '2.3-dev'
register_custo... | #
# Indico is free software; you can redistribute it and/or |
<|file_name|>FeedEntryEditor.js.uncompressed.js<|end_file_name|><|fim▁begin|>define(
"dojox/atom/widget/nls/ja/FeedEntryEditor", ({
doNew: "[新規]",
edit: "[編集]",
save: "[保存]",
cancel: "[キャンセル]"
})<|fim▁hole|><|fim▁end|> | ); |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># Python - 3.6.0
<|fim▁hole|><|fim▁end|> | Test.expect(find_multiples(5, 25) == [5, 10, 15, 20, 25], f'{str(find_multiples(5, 25))} should equal [5, 10, 15, 20, 25]')
Test.expect(find_multiples(1, 2) == [1, 2], f'{str(find_multiples(1, 2))} should equal [1, 2]') |
<|file_name|>cloudpickle_wrapper.py<|end_file_name|><|fim▁begin|>import inspect
from functools import partial
try:
from joblib.externals.cloudpickle import dumps, loads
cloudpickle = True
except ImportError:
cloudpickle = False
WRAP_CACHE = dict()
class CloudpickledObjectWrapper(object):
def __init... | |
<|file_name|>log_formatting.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys
import string
from datetime import datetime,timedelta
import calendar
import csv
import re
# ファイルオープン(fpは引数でログファイル,wfpは書き出すcsvファイルを指定)
fp = open(sys.argv[1],'r')
# logがローテートするタイミングが1日の間にある場合,/var/log/kern.logと/var/log/kern.l... | l[19] = 0
w[6] = l[19]
else:
w[6] = l[19][4:] |
<|file_name|>RegisterRulesTest.java<|end_file_name|><|fim▁begin|>/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser ... | }
}
} |
<|file_name|>json_format.js<|end_file_name|><|fim▁begin|>// Эти данные получаются с помощью метода cars_by_order
var result = {
// Базовые данные
carModel: "INFINITI FX5 PREMIUM",
num: "т607ау190",
vin: "JN1TANS50U0005180",
body: "", // Номер кузова
year: "2007",
engineDisp: "3498", // Об... | |
<|file_name|>clean.js<|end_file_name|><|fim▁begin|><|fim▁hole|> {
all: '<%= settings.build.dst %>'
});
}<|fim▁end|> | 'use strict';
module.exports = function(grunt) {
grunt.config('clean', |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>default_app_config = 'workflow.apps.WorkflowAppConfig'<|fim▁end|> | |
<|file_name|>dns.py<|end_file_name|><|fim▁begin|>import sqlalchemy as sa
from oslo_db.sqlalchemy import types as db_types
from nca47.db.sqlalchemy.models import base as model_base
from nca47.objects import attributes as attr
HasTenant = model_base.HasTenant
HasId = model_base.HasId
HasStatus = model_base.HasStatus
H... | masters = sa.Column(db_types.JsonEncodedList)
slaves = sa.Column(db_types.JsonEncodedList) |
<|file_name|>named_test.go<|end_file_name|><|fim▁begin|>package named
import (
"testing"
)
func TestNamedSelector(t *testing.T) {
data := []string{"foo", "bar", "baz"}
s := NewSelector()
for _, name := range data {
next, err := s.Select(name)
if err != nil {
t.Fatal(err)
}
for i := 0; i < 3; i++ {
... | |
<|file_name|>test_connect_all_to_all.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# test_connect_all_to_all.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | |
<|file_name|>AnimatedButton.js<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright 2012, 2013 CNES - CENTRE NATIONAL d'ETUDES SPATIALES
*
* This file is part of SITools2.
*
* SITools2 is free software: you can redistribute it and/or modify
* it... | AnimatedButton.prototype.stopAnimation = function()
{
this.stopped = true; |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(iter_max_by, iter_min_by)]
use std::collections::HashMap;
use std::io;
use std::io::prelude::*;
enum DecodingMethod {
MostLikely,
LeastLikely,
}
fn decode_message(input: &str, method: DecodingMethod) -> String {
let len = input.lines().map(|li... | svetve\n\
tesnvt\n\ |
<|file_name|>api_protocol_base.cpp<|end_file_name|><|fim▁begin|>#include "api_protocol_base.h"
///
/// \brief TestProtocol::TestProtocol
/// Constructor
///
TestProtocol::TestProtocol()
{
nam = new QNetworkAccessManager(this);
// nam = NAM_INSTANCE;
connect(nam, SIGNAL(finished(QNetworkReply*)),
... | << itemDoc;
emit newData(); |
<|file_name|>EPAAlgorithm.java<|end_file_name|><|fim▁begin|>/*
* This file is part of React, licensed under the MIT License (MIT).
*
* Copyright (c) 2013 Flow Powered <https://flowpowered.com/>
* Original ReactPhysics3D C++ library by Daniel Chappuis <http://danielchappuis.ch>
* React is re-licensed with permissio... | * @param collisionShape2 The second collision shape
* @param transform2 The transform of the second collision shape |
<|file_name|>torchir_passes.py<|end_file_name|><|fim▁begin|># Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from collections import defaultdict, Orde... | output -> x_internal_tensor_assign_2
|
<|file_name|>np_mask_ops.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# 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.apach... | """Computes pairwise intersection-over-area between box collections.
Intersection-over-area (ioa) between two masks, mask1 and mask2 is defined as |
<|file_name|>apt_retry.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/json"
"flag"
"fmt"
"github.com/APTrust/bagman/bagman"
"github.com/APTrust/bagman/workers"
"io/ioutil"
"os"
)
/*
apt_retry retries the record step of a failed item. This only works
on items that have passed the prepare and st... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Core XML support for Python.
This package contains four sub-packages:
dom -- The W3C Document Object Model. This supports DOM Level 1 +
Namespaces.
parsers -- Python wrappers for XML parsers (currently only supports Expat).
sax -- The Simple API for X... | if 'PY_USE_XMLPLUS' in os.environ: |
<|file_name|>loader.go<|end_file_name|><|fim▁begin|>package loader
import (
"errors"
"fmt"
"go/ast"
"go/parser"
"go/scanner"
"go/token"
"go/types"
"log"
"os"
"golang.org/x/tools/go/gcexportdata"
"golang.org/x/tools/go/packages"
)
// Graph resolves patterns and returns packages with all the
// information ... | return fmt.Errorf("dependency %q hasn't been loaded yet", path)
}
}
if pkg.ExportFile == "" { |
<|file_name|>AuctionController.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU Ge... | try (InputStream source = bomStream("UTF-16", xmlFile)) {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true); |
<|file_name|>ckan_engine_e2e_tests.py<|end_file_name|><|fim▁begin|>import os
import random
import string
import unittest
import requests
from tethys_dataset_services.engines import CkanDatasetEngine
try:
from tethys_dataset_services.tests.test_config import TEST_CKAN_DATASET_SERVICE
except ImportError:
print(... | # Verify Success |
<|file_name|>rpsystem.py<|end_file_name|><|fim▁begin|>"""
Roleplaying base system for Evennia
Contribution - Griatch, 2015
This module contains the ContribRPObject, ContribRPRoom and
ContribRPCharacter typeclasses. If you inherit your
objects/rooms/character from these (or make them the defaults) from
these you will... | Notes:
The RPObject version doesn't add color to its display. |
<|file_name|>video_input_generator.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors All Rights Reserved.
#
# 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://... | |
<|file_name|>unauthenticated.exception.ts<|end_file_name|><|fim▁begin|>import { HttpException, HttpStatus } from '@nestjs/common';
import { WsException } from '@nestjs/websockets';
import { createExceptionBody } from '../../exceptions/exceptionBody.util';
export const ERROR_CODE = 'CHARACTER_NOT_AUTHENTICATED';
export... | } |
<|file_name|>rules.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// Generated by CoffeeScript 1.7.1
(function() {
var ERROR, IGNORE, WARN;
ERROR = 'error';
WARN = 'warn';
IGNORE = 'ignore';
module.exports = {
coffeescript_error: {
level: ERROR,
message: ''
}
};
}).call(this);<|fim▁end... | |
<|file_name|>services.py<|end_file_name|><|fim▁begin|>from .models import *
from django.db.models import Count, F, Max, Sum
# Game info services
def get_median_points(game_id):
return median_value(Team.objects.filter(play__game__id=game_id) \
.exclude(play__team__points__isnull=True),
... | |
<|file_name|>promoted-function-2.rs<|end_file_name|><|fim▁begin|>// build-fail
// compile-flags:-Zpolymorphize=on
#![crate_type = "lib"]
#![feature(generic_const_exprs, rustc_attrs)]
//~^ WARN the feature `generic_const_exprs` is incomplete
#[rustc_polymorphize_error]
fn test<T>() {
//~^ ERROR item has unused gene... | }
pub fn caller() { |
<|file_name|>environment.rs<|end_file_name|><|fim▁begin|>use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use lox_object::LoxObject;
use scanner::Token;
use interpreter::{RuntimeError, RuntimeResult};
pub struct Environment {
enclosing: Option<Rc<Environment>>,
values: RefCell<HashMap<S... | enclosing: None, |
<|file_name|>diff_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The etcd 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-... | }
func mustTemp(pre, body string) string { |
<|file_name|>test_hfl_logistic_regression.py<|end_file_name|><|fim▁begin|>#
# Copyright 2016 The BigDL 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/l... | def setUp(self) -> None:
self.fl_server = FLServer()
self.fl_server.build() |
<|file_name|>start_controllers.go<|end_file_name|><|fim▁begin|>package start
import (
"fmt"
"io"
"os"
"github.com/golang/glog"
"github.com/spf13/cobra"
kerrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"github.com/op... |
if err := options.StartMaster(); err != nil { |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import sys
from spack import *
class Vtk(CMakePackage):
... | ])
# NOTE: The following definitions are required in order to allow |
<|file_name|>test_submain_package.py<|end_file_name|><|fim▁begin|>from mock import patch
from nose.tools import eq_
from helper import TestCase
import appvalidator.submain as submain
class TestSubmainPackage(TestCase):
@patch("appvalidator.submain.test_inner_package",
lambda x, z: "success")
def ... |
name = "tests/resources/submain/install_rdf.xpi" |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>use pkg_config::Config;
fn main() {<|fim▁hole|>
if std::env::var_os("CARGO_FEATURE_CLIENT").is_some() {
Config::new().probe("wayland-client").unwrap();
}
if std::env::var_os("CARGO_FEATURE_CURSOR").is_some() {
Config::new().probe("wayland-c... | if std::env::var_os("CARGO_FEATURE_DLOPEN").is_some() {
// Do not link to anything
return;
} |
<|file_name|>callback.rs<|end_file_name|><|fim▁begin|>// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
use crate::call::server::{RequestContext, UnaryRequestContext};
use crate::call::{BatchContext, Call};
use crate::cq::CompletionQueue;
use crate::server::{self, RequestCallContext};
pub struct Requ... | UnaryRequest { ctx }
} |
<|file_name|>homebrew_tap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# (c) 2016, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# Based on homebrew (Andrew Dunham <andrew@du.nham.ca>)
#
# This file is part of Ansible
#
# Ansible is free soft... | '''Returns True if already tapped.''' |
<|file_name|>core.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// Project: SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
// Portions ©2008-2011 Apple Inc. All rights reserved.
// License: Licensed under MIT license (see license.js)
// ================... | // ========================================================================== |
<|file_name|>MeanCenteredFacesDemo.java<|end_file_name|><|fim▁begin|>package uk.ac.soton.ecs.comp3204.l3;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridBagLayout;
import java.io.IOException;
import javax.swing.JPanel;
import org.openimaj.content.slideshow.Slide... | import org.openimaj.image.FImage; |
<|file_name|>defaults-bg_BG.js<|end_file_name|><|fim▁begin|>/*!
* Bootstrap-select v1.13.2 (https://developer.snapappointments.com/bootstrap-select)
*
* Copyright 2012-2018 SnapAppointments, LLC
* Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
*/
(function (ro... | } |
<|file_name|>format.py<|end_file_name|><|fim▁begin|>"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
re... | |
<|file_name|>test_azure_mgmt_wcfrelay.py<|end_file_name|><|fim▁begin|># coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
... |
class MgmtWcfRelayTest(AzureMgmtTestCase): |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.sites.models import Site
from django.utils._os import safe_join
from django.views.generic import TemplateView
from skin.conf import settings
from skin.template.loaders.util import get_site_skin
class TemplateSkinView(TemplateView):
"""
A ... | def get_template_names(self): |
<|file_name|>QuestionActivity.java<|end_file_name|><|fim▁begin|>package com.hackathon.hackathon2014.activity;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
im... | |
<|file_name|>url_fixer_upper_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 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.
#include <stdlib.h>
#include "base/basictypes.h"
#include "base/file_util.h"
#i... | |
<|file_name|>activate.go<|end_file_name|><|fim▁begin|>package model
import (
"errors"
)
var (
ErrAlreadyActivated = errors.New("ErrAlreadyActivated")
)
/*
Activate activates the account, or returns an error if the account was already
activated, or the token given is invalid.<|fim▁hole|>*/
func (a *Account) Activat... | |
<|file_name|>product_loader.py<|end_file_name|><|fim▁begin|>import os
import xlrd
import configparser
import logging
from ..entities import product
def process_cell(cell):
"""Converts the given cell to the appropriate value."""
if cell.value == 'NA':
return ''
ttype = cell.ctype # get the cell's '... | |
<|file_name|>homegenie.statistics.js<|end_file_name|><|fim▁begin|>//
// namespace : HG.Statistics
// info : -
//
HG.Statistics = HG.Statistics || {};
//
HG.Statistics.ServiceCall = function (fn, opt1, opt2, callback) {
$.ajax({
url: '/' + HG.WebApp.Data.ServiceKey + '/' + HG.WebApp.Data.ServiceDomain... | var counter = eval(data)[0]; |
<|file_name|>primitivesIndex.NIRI.py<|end_file_name|><|fim▁begin|># This is added to the reduction object dictionary, but only one reduction
# object per AstroData Type. NOTE: primitives are the member functions of a
# Reduction Object.
localPrimitiveIndex = {
"NIRI": ("primitives_NIRI.py", "NIRIPrimitives"),
... | } |
<|file_name|>go.js<|end_file_name|><|fim▁begin|>$(document).ready(function() {
$.getJSON('/backend/go/' + go_term['id'] + '/locus_details', function(data) {<|fim▁hole|>
$.getJSON('/backend/go/' + go_term['id'] + '/ontology_graph', function(data) {
var cy = create_cytoscape_vis("cy", layout, graph_style, data, nul... | create_go_table(data);
}); |
<|file_name|>TCPMondrian.py<|end_file_name|><|fim▁begin|>#import printStatWithName
from AZutilities import dataUtilities
from AZutilities import paramOptUtilities
from trainingMethods import AZorngRF
from trainingMethods import AZorngCvSVM
import Orange
import orange
import math
import copy
import string
"""
Module fo... | minDiff.append(min(distListDiff))
|
<|file_name|>country.js<|end_file_name|><|fim▁begin|>var articles = null;
function restore_all_articles_view() {
$("#allbtn").button('toggle');
$('#articleslist').empty();
$('#articleslist').append(articles);
$('#filterwarning').hide();
}
function switch_category(category) {
if (typeof category != "undefine... | }); |
<|file_name|>378_kth_smallest_element_in_a_sorted_matrix.py<|end_file_name|><|fim▁begin|># 378. Kth Smallest Element in a Sorted Matrix
#
# Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.
#
# Note that it is the kth smallest element in ... | # When popping the heap, we also need to push necessary matrix elements into the heap.
# Time complexity is O(KlogK) (every heap operation takes O(logK))
def kthSmallest(self, matrix, k):
# element in the heap: (val, x coord, y coord) |
<|file_name|>pipe_select_interrupter.hpp<|end_file_name|><|fim▁begin|>//
// detail/pipe_select_interrupter.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
... | |
<|file_name|>reddit_handler.py<|end_file_name|><|fim▁begin|>"""
==========================================
Author: Tyler Brockett
Username: /u/tylerbrockett
Description: Alert Bot (Formerly sales__bot)
Date Created: 11/13/2015
Date Last Edited: 12/20/2016
Version: v2.0
==... | Logger.log(traceback.format_exc(), Color.RED)
invalid.append(subreddit)
return invalid
|
<|file_name|>configurationService.test.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license informa... | |
<|file_name|>cache.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::ffi::OsStr;
use std::fs;
use std::io::Read;
use std::iter;
use std::path::{Path, PathBuf};
use app_dirs::{get_app_root, AppDataType};
use flate2::read::GzDecoder;
use log::debug;
use reqwest::{blocking::Client, Proxy};
use std::time::{Duration, ... | self
} |
<|file_name|>whatsapp.js<|end_file_name|><|fim▁begin|>/**
* WhatsApp service provider<|fim▁hole|>
module.exports = {
popupUrl: 'whatsapp://send?text={title}%0A{url}',
popupWidth: 600,
popupHeight: 450
};<|fim▁end|> | */ |
<|file_name|>pipeline.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils import timezone
from django.utils.translation impo... | |
<|file_name|>userThread.py<|end_file_name|><|fim▁begin|>#This thread handles user operations of only 1 user
#, and is connected to the matchmaking thread and to the database thread
#The list of operations is as follows:
#userType: 0 for normal, 1 for facebook
# ID | ARGUMENTS
# ... | #Configure server Socket
setupSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
#Listen on all interfaces |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.