prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>tree.go<|end_file_name|><|fim▁begin|>package excellent
import (
"fmt"
"strings"
"github.com/nyaruka/goflow/envs"
"github.com/nyaruka/goflow/excellent/functions"
"github.com/nyaruka/goflow/excellent/operators"
"github.com/nyaruka/goflow/excellent/types"
)
// Expression is the base interface of all ... | lookup string
} |
<|file_name|>for-loop-refutable-pattern-error-message.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or... | } |
<|file_name|>var-8-namedtuple-1st.py<|end_file_name|><|fim▁begin|>import bench
from ucollections import namedtuple
<|fim▁hole|> i = 0
while i < t.num:
i += 1
bench.run(test)<|fim▁end|> | T = namedtuple("Tup", ["num", "bar"])
def test(num):
t = T(20000000, 0) |
<|file_name|>UiSelectorBuilder.java<|end_file_name|><|fim▁begin|>package com.nagopy.android.disablemanager2;
import android.os.Build;
import com.android.uiautomator.core.UiSelector;
@SuppressWarnings("unused")
public class UiSelectorBuilder {
private UiSelector uiSelector;
public UiSelector build() {
... | }
/** |
<|file_name|>DefaultShaders.js<|end_file_name|><|fim▁begin|>/**
* Author: thegoldenmule
* Date: 3/17/13
*/
(function (global) {
"use strict";
var colorShaderVS = {
name: "color-shader-vs",
type: "x-shader/x-vertex",
body:
"precision highp float;" +
"uniform ... | name: "ss-shader-vs",
type: "x-shader/x-vertex",
body: |
<|file_name|>input.js<|end_file_name|><|fim▁begin|>class A {
static get #x() {}
get #x() {}<|fim▁hole|><|fim▁end|> | } |
<|file_name|>pyedit_assign_params_to_attributes.py<|end_file_name|><|fim▁begin|>"""Assign Params to Attributes by Joel Hedlund <joel.hedlund at gmail.com>.
PyDev script for generating python code that assigns method parameter
values to attributes of self with the same name. Activates with 'a' by
default. Edit global... | Contact the author for bug reports/feature requests.
Changed:Fabio Zadrozny (binded to Ctrl+1 too) |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import logging
import random
import string
import sys
from oslo.config import cfg
# Logging setup
logger = logging.getLogger(__name__)
stdout = logging.StreamHandler(sys.stdout)
stdout.setLevel(logging.DEBUG)
logger.addHandler(stdout)
logger.setLevel(logging.DEBUG)
... |
def parse(): |
<|file_name|>util.format.js<|end_file_name|><|fim▁begin|>// I used to use `util.format()` which was massive, then I switched to
// format-util, although when using rollup I discovered that the index.js<|fim▁hole|>// just exported `require('util').format`, and then had the below contents
// in another file. at any rate ... | |
<|file_name|>svg.mako.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<%hel... | }
}
if position.is_none() { |
<|file_name|>StylesSidebarPane.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
* Copyright (C) 2009 Joseph Pecoraro
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* ... | this._matchedStyles.resetActiveProperties();
this._parentPane._refreshUpdate(this);
} |
<|file_name|>mac_dev.py<|end_file_name|><|fim▁begin|># coding=utf-8
__author__ = "Daniel Arroyo <daniel@astroprint.com>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
import logging
<|fim▁hole|> def __init__(self):
self.name = "astrobox-dev"
self.logger = lo... | from astroprint.network import NetworkManager as NetworkManagerBase
class MacDevNetworkManager(NetworkManagerBase): |
<|file_name|>TestValidator_float.py<|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 ... | _test(0, "float[0]", TypeCode.FLOAT4, Float, Float(Float.MIN_VALUE), "4" )
_test(0, "float[0]", TypeCode.FLOAT4, Float, Float(Float.MAX_VALUE), "5" )
_test(0, "float[0]", TypeCode.FLOAT4, Float, Float(Float.MIN_VALUE), "abc" ) |
<|file_name|>rolebinding.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes 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
Un... | delegate.Groups = fromLiteralArray
delete(genericParams, "group")
}
fromSAStrings, found := genericParams["serviceaccount"] |
<|file_name|>dump_dependency_json.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import os
import gyp
import gyp.common
import gyp.msvs_emu... | while len(targets_to_visit) > 0:
target = targets_to_visit.pop() |
<|file_name|>TftpContexts.py<|end_file_name|><|fim▁begin|># vim: ts=4 sw=4 et ai:
"""This module implements all contexts for state handling during uploads and
downloads, the main interface to which being the TftpContext base class.
The concept is simple. Each context object represents a single upload or
download, and ... | def end(self): |
<|file_name|>NewOrExistingModelWizard.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2015 Google Inc. 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
*... | },
},
{
name: 'newViewFactory', |
<|file_name|>vendor.rs<|end_file_name|><|fim▁begin|>use crate::command_prelude::*;
use cargo::ops;
use std::path::PathBuf;
pub fn cli() -> App {
subcommand("vendor")
.about("Vendor all dependencies for a project locally")
.arg(opt("quiet", "No output printed to stdout").short("q"))
.arg_man... | .arg(
Arg::with_name("relative-path")
.long("relative-path") |
<|file_name|>P06_RankIt.py<|end_file_name|><|fim▁begin|># You have been given an array A consisting of N integers. All the elements in this array A are unique. You have to
# answer some queries based on the elements of this array. Each query will consist of a single integer x. You need to
# print the rank based positio... | array.sort()
q = int(input())
|
<|file_name|>Movie2KTo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from ..internal.DeadCrypter import DeadCrypter
<|fim▁hole|> __type__ = "crypter"
__version__ = "0.56"
__status__ = "stable"
__pattern__ = r'http://(?:www\.)?movie2k\.to/(.+)\.html'
__config__ = [("activated", "bool", "Ac... |
class Movie2KTo(DeadCrypter):
__name__ = "Movie2KTo" |
<|file_name|>scene.py<|end_file_name|><|fim▁begin|>"""Support for Lutron Caseta scenes."""
from typing import Any
from homeassistant.components.scene import Scene<|fim▁hole|>
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Lutron Caseta scene platform.
Adds scenes from the ... |
from .const import BRIDGE_LEAP, DOMAIN as CASETA_DOMAIN |
<|file_name|>theme-customizer.js<|end_file_name|><|fim▁begin|>(function( $ ) {
wp.customize( 'blogname', function( value ) {<|fim▁hole|> } );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).text( to );
} );
} );
})( jQuery );<|fim▁end|> | value.bind( function( to ) {
$( '.site-title a' ).text( to ); |
<|file_name|>netcdf.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""Wrapper for netCDF readers."""
from __future__ import unicode_literals, division, print_function
import os.path
import warnings
import numpy as np
from co... | #self.path2group = OrderedDict()
#for children in self.walk_tree():
# for child in children:
# #print(child.group, child.path) |
<|file_name|>tflow.py<|end_file_name|><|fim▁begin|>import uuid
from typing import Optional, Union
from mitmproxy import connection
from mitmproxy import flow
from mitmproxy import http
from mitmproxy import tcp
from mitmproxy import websocket
from mitmproxy.test.tutils import treq, tresp
from wsproto.frame_protocol im... | source_address=("address", 22), |
<|file_name|>currency_getter.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 CamptoCamp. All rights reserved.
# @author Nicolas Bessi
#
# This program is free software: you can redistribute it and/or m... | |
<|file_name|>SQLQueryResult.java<|end_file_name|><|fim▁begin|>/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2021 DBeaver Corp and others
*
* 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 ... | public void setRowOffset(Long rowOffset) {
|
<|file_name|>mfa.js<|end_file_name|><|fim▁begin|>wesabe.provide("fi-scripts.com.citibank.mfa", {
dispatch: function() {
if (page.present(e.mfa.indicator)) {
action.answerSecurityQuestions();
return false;
}
},
actions: {
},
elements: {
mfa: {
indicator: [
'//*[has-class... | |
<|file_name|>configuration.js<|end_file_name|><|fim▁begin|>sap.ui.define(["sap/ui/integration/Designtime"], function (
Designtime
) {
"use strict";
return function () {
return new Designtime({
"form": {
"items": {
"validationGroup": {
"type": "group",
"label": "Validation"
},
"Ord... | "translatable": false, |
<|file_name|>base64utils.py<|end_file_name|><|fim▁begin|># Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | Use the filter_formatting() function to assure the input text
contains only the members of the alphabet. |
<|file_name|>mainMenu.java<|end_file_name|><|fim▁begin|>package championpicker.console;
import com.googlecode.lanterna.gui.*;
<|fim▁hole|>import com.googlecode.lanterna.TerminalFacade;
import com.googlecode.lanterna.terminal.Terminal;
import com.googlecode.lanterna.terminal.TerminalSize;
import com.googlecode.lanterna... | |
<|file_name|>sync.py<|end_file_name|><|fim▁begin|>import fnmatch
import os
import re
import shutil
import sys
import uuid
from base import Step, StepRunner
from tree import Commit
here = os.path.abspath(os.path.split(__file__)[0])
bsd_license = """W3C 3-clause BSD License
Redistribution and use in source and binary... |
state.sync_tree.checkout(state.sync_commit.sha1, state.local_branch, force=True)
self.logger.debug("New base commit is %s" % state.sync_commit.sha1) |
<|file_name|>SetAttributeTool.gpr.py<|end_file_name|><|fim▁begin|>#<|fim▁hole|># Copyright (C) 2009 Douglas S. Blank <doug.blank@gmail.com>
#
# This program 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; eith... | # Gramps - a GTK+/GNOME based genealogy program
# |
<|file_name|>_mock.py<|end_file_name|><|fim▁begin|>from typing import Any, Callable, Tuple, Union
from packed import pack, unpack
import jj
from jj import default_app, default_handler
from jj.apps import BaseApp, create_app
from jj.http.codes import BAD_REQUEST, OK
from jj.http.methods import ANY, DELETE, GET, POST
f... | except Exception:
return Response(status=BAD_REQUEST, json={"status": BAD_REQUEST})
|
<|file_name|>issue-5243.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
// Check that merely having lifetime parameters is not
// enough for codegen to consider this as non-monomorphic,
// which led to various assertions and failures in turn.
// pretty-expanded FIXME #23616
struct S<'a> {
v: &'a ... | |
<|file_name|>pipeline.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use bluetooth_traits::BluetoothRequest;
use compositing::Com... | scheduler_chan: self.scheduler_chan,
bluetooth_thread: self.bluetooth_thread,
resource_threads: self.resource_threads, |
<|file_name|>SignificanceHeuristicTests.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* t... | long c = randomLong();
long d = randomLong();
score = heuristic.getScore(a, b, c, d); |
<|file_name|>universal-issue-48703.rs<|end_file_name|><|fim▁begin|>#![feature(universal_impl_trait)]
use std::fmt::Debug;
fn foo<T>(x: impl Debug) { }
fn main() {
foo::<String>('a'); //~ ERROR cannot provide explicit generic arguments<|fim▁hole|><|fim▁end|> | } |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2015, 2016 Saurav Sachidanand
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 t... | THE SOFTWARE.
*/
|
<|file_name|>training_test.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.apa... | |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.initConfig({
jshint: {
options: { jshintrc: true },
all: ['*.js', 'lib/*.js', 'test/*.js']
}
});
grunt.registerTask('de... | }; |
<|file_name|>Setup.py<|end_file_name|><|fim▁begin|>__author__ = 'Autio'<|fim▁hole|>from distutils.core import setup
import py2exe
setup(windows=['ShitCrimson.py'])<|fim▁end|> | |
<|file_name|>exec.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////
// Name: exec.cpp
// Purpose: exec sample demonstrates wxExecute and related functions
// Author: Vadim Zeitlin
// Modified by:
// Created: 15.01.00
// RCS-ID: $Id: e... | #endif // __WINDOWS__
|
<|file_name|>ConfigurationTest.java<|end_file_name|><|fim▁begin|>package configuration;
import org.agle4j.framework.constant.ConfigConstant;
import org.apache.commons.configuration.ConfigurationException;
<|fim▁hole|>import org.junit.Test;
/**
* commons-configuration 包测试
* 一个java应用程序的配置管理类库
*
* @author ... | import org.apache.commons.configuration.PropertiesConfiguration;
|
<|file_name|>L01.ExeSeq01.py<|end_file_name|><|fim▁begin|><|fim▁hole|>print ("Hello World !!")<|fim▁end|> | |
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>pub const MEMWRITER_ERROR: &'static str = "MemWriter unexpectedly failed";<|fim▁hole|><|fim▁end|> | pub const SURFACE_ERROR: &'static str = "Surface could not be created"; |
<|file_name|>the-S3-amongos.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2015 The ChEMBL group.
# Author: Nathan Dedman <ndedman@ebi.ac.uk>
# 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 o... |
def start(port,debug=False):
"""Starts the pymongo S3 server"""
application = mongoS3(debug) |
<|file_name|>load_dsm.cpp<|end_file_name|><|fim▁begin|>/*
* This program is free software; you can redistribute it and modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the license or (at your
* option) any later version.
*
* Auth... | case 0x20: command = 0x0E; param = (param & 0x0F) | 0xA0; break;
case 0x30: command = 0x0E; param = (param & 0x0F) | 0x10; break;
case 0x40: command = 0x0E; param = (param & 0x0F) | 0x20; break;
default: command = 0; |
<|file_name|>codeFixChangeJSDocSyntax12.ts<|end_file_name|><|fim▁begin|>// @strict: true<|fim▁hole|>////}
verify.codeFix({
description: "Change '*' to 'any'",
errorCode: 8020,
index: 0,
newRangeContent: "any",
});<|fim▁end|> | /// <reference path='fourslash.ts' />
////class C {
//// p: [|*|] |
<|file_name|>FeatureAlgorithms.cpp<|end_file_name|><|fim▁begin|>/* FeatureAlgorithm.cpp */
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
/* */
/* Copyright (C) 2007 Open Microscopy Environment ... | return coeffs; |
<|file_name|>steering_acceleration.rs<|end_file_name|><|fim▁begin|>use nalgebra::{distance_squared, Point3, Vector3};
use alga::general::Real;
use alga::general::AbstractModule;
use num_traits::identities::Zero;
use IsEnabled;
use std::cell::RefCell;
use std::rc::Rc;
/// Represents result of a steering behaviour comp... | /// Sets both compononents to zero
pub fn set_zero(&mut self) -> &mut Self {
self.angular = T::zero();
self.linear = Vector3::zero(); |
<|file_name|>OgreGLSLESProgram.cpp<|end_file_name|><|fim▁begin|>/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2014 Torus Knot Software L... | |
<|file_name|>LoginLog.java<|end_file_name|><|fim▁begin|>package com.jeesms.entity.system;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.jeesms.common.Constants;
import com.jeesms.entity.ba... | return remark;
} |
<|file_name|>sequence_feature_column_integration_test.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 Licens... | } |
<|file_name|>persistent_list.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! A persistent, thread-safe singly-linked list.
us... | |
<|file_name|>animation.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! CSS transitions and animations.
<|fim▁hole|>use clock_t... | use flow::{self, Flow};
use incremental::{self, RestyleDamage};
|
<|file_name|>function_classification_evaluation.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# This research is supported by the European Union Seventh Framework Programme (FP7/2007-2013), project ASPIRE (Advanced Software Protection: Integration, Research, and Exploitation), under grant agreement no. 609734; on... | fun_insts = ida_clusters[fun]
|
<|file_name|>event_serializer.d.ts<|end_file_name|><|fim▁begin|>export declare function serializeGenericEvent(e: Event): {
[key: string]: any;
};
export declare function serializeEventWithTarget(e: Event): {<|fim▁hole|>};
export declare function serializeMouseEvent(e: MouseEvent): {
[key: string]: any;
};
expor... | [key: string]: any; |
<|file_name|>shape_base.py<|end_file_name|><|fim▁begin|>from . import numeric as _nx
from .numeric import asanyarray, newaxis
def atleast_1d(*arys):
res = []
for ary in arys:<|fim▁hole|> else :
result = ary
res.append(result)
if len(res) == 1:
return res[0]
else:
... | ary = asanyarray(ary)
if len(ary.shape) == 0 :
result = ary.reshape(1) |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import codecs
from ConfigParser import ConfigParser
import os
import subprocess
import sys
import six
import twiggy
from twiggy import log
from twiggy.levels import name2level
from xdg import BaseDirectory
def asbool(some_value):
""" Cast config values to boole... | :param service: Service name, may be key into secure store (as string).
:param username: Username for the service (as string).
:param oracle: Hint which password oracle strategy to use.
:return: Retrieved password (as string) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
pub fn read_file<P: AsRef<Path>>(path: P) -> String {
let mut contents = String::new();
File::open(path).unwrap().read_to_string(&mut contents).unwrap();
contents<|fim▁hole|><|fim▁end|> | } |
<|file_name|>RobotsActivity.java<|end_file_name|><|fim▁begin|>package com.holdit.feedthemax;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import sta... | import static com.holdit.feedthemax.R.id.rbt3price;
|
<|file_name|>initialization.py<|end_file_name|><|fim▁begin|>from graphics_module.objects import *<|fim▁hole|>
def make_pixels_array_config_based(config):
if config.colorscheme == "b&w":
c = Color()
elif config.colorscheme == "light":
c = Color(r=245,g=235,b=234,a=0.85) #"light" or whatever to be... | import numpy as np
def make_pixels_array_basic(amount):
return np.full(10,Pixel(), dtype=np.object) |
<|file_name|>direct_client.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2012 OpenStack, LLC.
#
# 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/LICE... | # See the License for the specific language governing permissions and
# limitations under the License.
""" |
<|file_name|>AbstractMapLayerModel.js<|end_file_name|><|fim▁begin|>/**
* @class Oskari.mapframework.domain.AbstractLayer
*
* Superclass for layer objects copy pasted from wmslayer. Need to check
* if something should be moved back to wmslayer. Nothing else currently uses this.
*/
Oskari.clazz.define('Oskari.mapfra... | },
/** |
<|file_name|>users_leaderboard.go<|end_file_name|><|fim▁begin|>/*
These are more functions for querying the "users" table,
but these functions are only used in "leaderboard.go"
*/
package models
import (
"database/sql"
"errors"
"strconv"
)
const (
SoloSeason1StartDatetime = "2017-10-17 23:00:00"
SoloSeason1En... | FROM race_participants |
<|file_name|>class-cast-to-trait.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(dead_code)]
#![allow(unused_mut)]
#![allow(non_camel_case_types)]
// ignore-freebsd FIXME fails on BSD
trait noisy {
fn speak(&mut self);
}
struct cat {
meows: usize,
how_hungry: isize,
name: String,
}
impl noisy for cat ... | return false;
}
} |
<|file_name|>fluiddb.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
A very thin wrapper on top of the FluidDB RESTful API
Copyright (c) 2009-2010 Seo Sanghyeon, Nicholas Tollervey and others
See README, AUTHORS and LICENSE for more information
"""
import sys
import httplib2
import urllib
import types
if... | path = '/'+'/'.join(path)
# Make sure the correct content-type header is sent
if isinstance(body, dict): |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>mod ui;
fn main() {
let button = ui::widgets::button::Button::new();<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>import re
from django import forms
from django.conf import settings
from django.template.defaultfilters import slugify
from tower import ugettext_lazy as _lazy
from kitsune.products.models import Product, Topic
from kitsune.sumo.form_fields import MultiUsernameField... | allow_discussion = forms.BooleanField(
label=_lazy(u'Allow discussion on this article?'), |
<|file_name|>sunos.py<|end_file_name|><|fim▁begin|>"""engine.SCons.Platform.sunos
Platform-specific initialization for Sun systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2... | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
<|file_name|>UnsafeHttpsClient.java<|end_file_name|><|fim▁begin|>package com.android.potlach.cloud.client;
import java.io.IOException;
import java.net.Socket;
import java.net.UnknownHostException;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;... |
import javax.net.ssl.SSLContext;
|
<|file_name|>visualization.py<|end_file_name|><|fim▁begin|>"""Klamp't visualization routines. See Python/demos/vistemplate.py for an
example of how to run this module.
The visualization module lets you draw most Klamp't objects in a 3D world
using a simple interface. It also lets you customize the GUI using Qt
wid... | #raw_input() |
<|file_name|>parser.go<|end_file_name|><|fim▁begin|>package parser
// #include "query_types.h"
// #include <stdlib.h>
import "C"
import (
"bytes"
"fmt"
"math"
"reflect"
"regexp"
"strconv"
"strings"
"time"
"unsafe"
)
type From struct {
TableName string
}
type Operation int
type IntoClause struct {
Target... | fmt.Fprintf(buffer, " from %s", self.FromClause.GetString())
if withTime {
fmt.Fprintf(buffer, " where %s", self.GetWhereConditionWithTime(startTime, endTime).GetString()) |
<|file_name|>intelli.js<|end_file_name|><|fim▁begin|>intelli = {
/**
* Name of the current page
*/
pageName: '',
securityTokenKey: '__st',
lang: {},
/**
* Check if value exists in array
*
* @param {Array} val value to be checked
* @param {String} arr array
*
... | if (c.animated)return;
u = c.getBoundingClientRect() |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors
// Licensed under the MIT License:
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), t... | _ => ()
} |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from captcha.fields import CaptchaField
from django import forms
from django.contrib.auth.models import User
from django.http import HttpResponse
try:
from django.template import engines
__is_18 = True
except ImportError:
from django.template import loade... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os<|fim▁hole|>
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)<|fim▁end|> | import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "PhotoLoader.settings") |
<|file_name|>vsbackup.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015-2017 winapi-rs developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files ... | fn GetIncludeFile(
iFile: UINT,
ppFiledesc: *mut *mut IVssWMFiledesc,
) -> HRESULT, |
<|file_name|>managed-pointer-within-unique.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// ht... | // gdb-check:$1 = {-1, -2}
// gdb-command:print managed_within_unique->x |
<|file_name|>throbber.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
"use strict";<|fim▁hole|>var setupThrobber = require("../../throbber")
, throbber = setupThrobber(process.stdout.write.bind(process.stdout), 200);
process.stdout.write("START");
throbber.start();
setTimeout(throbber.stop, 1100);<|fim▁end... | |
<|file_name|>Mobitel.cpp<|end_file_name|><|fim▁begin|>#include <bits/stdc++.h>
template<typename T> T gcd(T a, T b) {
if(!b) return a;
return gcd(b, a % b);
}
template<typename T> T lcm(T a, T b) {
return a * b / gcd(a, b);
}
template<typename T> void chmin(T& a, T b) { a = (a > b) ? b : a; }
template<typ... | int in() { int x; scanf("%d", &x); return x; }
using namespace std; |
<|file_name|>addusertogroup.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand, CommandError
from django.db import IntegrityError
<|fim▁hole|>from olympia.users.models import UserProfile
class Command(BaseCommand):
help = 'Add a new user to a group.'
log = olympia.core.logger... | import olympia.core.logger
from olympia.access.models import Group, GroupUser |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># Database
DB_NAME = 'censusreporter_ke'
DB_USER = 'censusreporter_ke'<|fim▁hole|><|fim▁end|> | DB_PASSWORD = 'censusreporter_ke' |
<|file_name|>transaction.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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, eithe... | "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681",
"code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01600055",
"data" : "0x",
"gas" : "0x0186a0", |
<|file_name|>hello.cc<|end_file_name|><|fim▁begin|>/*
This file is part of MADNESS.
Copyright (C) 2007,2010 Oak Ridge National Laboratory
This program 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; ei... | P.O. Box 2008, MS-6367 |
<|file_name|>issue-30438-b.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/l... | |
<|file_name|>booking_shooting_service_book_test.go<|end_file_name|><|fim▁begin|>package book
import (
"testing"
"time"
. "github.com/bborbe/assert"
booking_booked_event "github.com/bborbe/booking/booked_event"
booking_shooting "github.com/bborbe/booking/shooting"
"github.com/bborbe/eventbus"
)
func TestImplem... | func TestTimeInFutureEqual(t *testing.T) {
ti, err := time.Parse(time.RFC3339, "2012-01-02T15:04:05Z")
if err := AssertThat(err, NilValue()); err != nil { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>mod stat_utils;
mod text_utils;
mod vector_utils;
mod vision_utils;
pub use direction_utils::*;
pub use number_utils::*;
pub use portal_utils::*;
pub use stat_utils::*;
pub use text_utils::*;
pub use vector_utils::*;
pub use vision_utils::*;<|fim▁end|> | mod direction_utils;
mod number_utils;
mod portal_utils; |
<|file_name|>496A - Minimum Difficulty.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
using namespace std;
int main() {
int n, x, y;
cin >> n;
int a[n];
for (int i = 0; i < n; ++i) {<|fim▁hole|> for (int i = 2; i < n; ++i) {
x = max(a[i] - a[i - 1], x);
y = min(a[i] - a[i - 2], y);
}
cout << ... | cin >> a[i];
}
x = a[1] - a[0];
y = a[2] - a[0]; |
<|file_name|>statistic.go<|end_file_name|><|fim▁begin|><|fim▁hole|>import (
"net/http"
"strconv"
"time"
"gopkg.in/gin-gonic/gin.v1"
"github.com/knopt/iot/backend/api/model"
"github.com/knopt/iot/backend/error"
)
// GetStatisticsByDeviceDataType by given requests parameters
func (api *Api) GetStatisticsByDevice... | package api
|
<|file_name|>job-progress.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { JobProgressComponent } from './job-progress.component';
describe('JobProgressComponent', () => {
let component: JobProgressComponent;
let fixture: ComponentFi... | .compileComponents(); |
<|file_name|>batch_decoupled_variational_strategy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import torch
from torch.distributions.kl import kl_divergence
from ..distributions import Delta, MultivariateNormal
from ..lazy import MatmulLazyTensor, SumLazyTensor
from ..utils.errors import CachingError
from .... | x` is given by:
.. math:: |
<|file_name|>queue.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import HTMLParser
import smtplib, quopri
from frappe import msgprint, throw, _
from frappe.email.smtp import SMTPS... | |
<|file_name|>ok.py<|end_file_name|><|fim▁begin|>"""
OK resolveurl XBMC Addon
Copyright (C) 2016 Seberoth
Version 0.0.2
This program 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... | if 'error' in json_data:
raise ResolverError('File Not Found or removed')
|
<|file_name|>testsuite.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 PaddlePaddle 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.apa... | outputs={"Out": loss},
type='scale', |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export { Svgo };<|fim▁end|> | import * as Svgo from './svgo'; |
<|file_name|>topic-trending.component.js<|end_file_name|><|fim▁begin|>"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in ... | core_1.Component({
selector: 'app-topic-trending', |
<|file_name|>shared_queue.hpp<|end_file_name|><|fim▁begin|>/*
* queue.hpp
*
* Created on: 14 ott 2015
* Author: Marco
*/
#ifndef SOURCE_UTILITIES_INCLUDE_SHARED_QUEUE_HPP_
#define SOURCE_UTILITIES_INCLUDE_SHARED_QUEUE_HPP_
#include <deque>
#include <condition_variable>
#include <mutex>
#include <utilities/... | cv.wait(guard, [this](){
return !data.empty();
});
return data.front(); |
<|file_name|>region.rs<|end_file_name|><|fim▁begin|>#![experimental]
use libc;
use std::ptr;
use std::os;
#[experimental]
pub trait MemoryRegion {
fn protect(&mut self) -> bool;
fn copy(&mut self, data: &[u8]) -> bool;
}
#[experimental]
impl MemoryRegion for os::MemoryMap {
fn protect(&mut self) -> bool {
... | fn copy(&mut self, data: &[u8]) -> bool { |
<|file_name|>AntLabMain.java<|end_file_name|><|fim▁begin|>package edu.gatech.oad.antlab.pkg1;
import edu.cs2335.antlab.pkg3.*;
import edu.gatech.oad.antlab.person.*;
import edu.gatech.oad.antlab.pkg2.*;
/**
* CS2335 Ant Lab
*
* Prints out a simple message gathered from all of the other classes
* in ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.