prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from BinPy.combinational.combinational import *<|fim▁end|> | |
<|file_name|>InteractiveDoG.java<|end_file_name|><|fim▁begin|>package mpicbg.spim.segmentation;
import fiji.tool.SliceListener;
import fiji.tool.SliceObserver;
import ij.IJ;
import ij.ImageJ;
import ij.ImagePlus;
import ij.ImageStack;
import ij.WindowManager;
import ij.gui.OvalRoi;
import ij.gui.Overlay;
import ij.gui... | |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>package api
import (
"fmt"
"net"
"strings"
"time"
"os"
"github.com/chuckpreslar/emission"
"github.com/ellcrys/util"
"github.com/ellcrys/cocoon/core/api/api/proto_api"
"github.com/ellcrys/cocoon/core/config"
"github.com/ellcrys/cocoon/core/platform"
"github.... | var apiLog = config.MakeLogger("api.rpc")
// SetLogLevel sets the log level of the logger
func SetLogLevel(l logging.Level) { |
<|file_name|>vmc_stats_emulator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.6
# This file is part of VoltDB.
# Copyright (C) 2008-2018 VoltDB Inc.
#
# This file contains original code and/or modifications of original code.
# Any modifications made by VoltDB Inc. are licensed under the following
# terms and ... | # 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 |
<|file_name|>pwm.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust.
// Copyright 2015 Paul Osborne <osbpau@gmail.com>
//
// 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
... | match *self {
Channel0PeriodReserved => { reg::PWM1().mr[0].set_value(value); },
Channel1 => { reg::PWM1().mr[1].set_value(value); }, |
<|file_name|>yanntricksKScolorD.py<|end_file_name|><|fim▁begin|>from yanntricks import *
def KScolorD():
pspict,fig = SinglePicture("KScolorD")
pspict.dilatation(1)
x=var('x')
C=Circle(Point(0,0),1)
N1=C.graph(90,180)<|fim▁hole|> N2=C.graph(270,360)
C.parameters.color="blue"
N1.paramete... | |
<|file_name|>exclude_list_dialog.py<|end_file_name|><|fim▁begin|># This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import re
from PyQt5.QtCore import Qt, pyqt... | |
<|file_name|>res_partner_btree.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution<|fim▁hole|># All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
####################... | #
# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/ |
<|file_name|>viewStaffInfo.js<|end_file_name|><|fim▁begin|><|fim▁hole|> $roles.each(
function()
{
var str = $(this).find("input").val();
var en_role_index = getRoleIndex(str,"EN");
var cn_role_str = indexToRole(en_role_index,"CN");
$(this).find("span").append(cn_role_st... | $(document).ready(
function()
{
var $roles = $(".role_change"); |
<|file_name|>lock.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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
// http://www.apache.org/licen... | let mut reader_convos = Vec::new();
for _ in range(0u, 10) {
let ((tx1, rx1), (tx2, rx2)) = (channel(), channel());
reader_convos.push((tx1, rx2)); |
<|file_name|>0021_auto_20161228_1233.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.9 on 2016-12-28 12:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0020_profile_preferred_proxy'),
]
operatio... | model_name='statistics', |
<|file_name|>subscriber.py<|end_file_name|><|fim▁begin|>import sys<|fim▁hole|>
server_port = sys.argv[1]
peers = sys.argv[2:]
n = Node(server_port, peers)
while True:
pass<|fim▁end|> | from gossip import Node
if __name__ == '__main__': |
<|file_name|>blog_widgets.py<|end_file_name|><|fim▁begin|>__author__ = 'michael'
from django import template
<|fim▁hole|>
@register.inclusion_tag('blog/widgets/tag_cloud.html')
def tag_cloud(blog_slug):
tags = unobase_models.TagModel.get_distinct_tags('blogentry')
#set(unobase_models.TagModel.get_tags('blogen... | from unobase import models as unobase_models
register = template.Library() |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of medical_medicament,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# medical_medicament ... | #
# medical_medicament is distributed |
<|file_name|>web_reserver-bak.py<|end_file_name|><|fim▁begin|>import web
import json
import datetime
import time
import uuid
#from mimerender import mimerender
#import mimerender
from onsa_jeroen import *
render_xml = lambda result: "<result>%s</result>"%result
render_json = lambda **result: json.dumps(result,sort_key... | |
<|file_name|>ty.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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
// http://www.apache.org/license... | seen.push(did);
let vs = enum_variants(cx, did);
|
<|file_name|>PlayerFriendsManager.py<|end_file_name|><|fim▁begin|>from direct.distributed.DistributedObjectGlobal import DistributedObjectGlobal
from direct.directnotify.DirectNotifyGlobal import directNotify
from otp.otpbase import OTPGlobals
from otp.avatar.Avatar import teleportNotify
from otp.friends import FriendR... | self.notify.warning('updatePlayerFriend: %s, %s, %s' % (id, info, isNewFriend))
info.calcUnderstandableYesNo()
if info.playerName[0:5] == 'Guest':
info.playerName = 'Guest ' + info.playerName[5:] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# __init__.py
# cjktools
#
"""
This package contains various tools for Japanese NLP tasks, although some
may be applicable to any python project. See documentation of each module for
details.
"""
__all__ = [
'alternations',
'com... | |
<|file_name|>memory.rs<|end_file_name|><|fim▁begin|>pub struct Memory {
}
impl Memory {
pub fn new() -> Memory {
let mut mem = Memory {<|fim▁hole|>
pub fn get(address: u16) -> &[u8] {
}
}<|fim▁end|> |
}
} |
<|file_name|>sociallogin_interface.js<|end_file_name|><|fim▁begin|>var options={}; options.login=true;
LoginRadius_SocialLogin.util.ready(function ()
{ $ui = LoginRadius_SocialLogin.lr_login_settings;
$ui.interfacesize = Drupal.settings.lrsociallogin.interfacesize;
$ui.lrinterfacebackground=Drupal.settings.lrso... | $ui.is_access_token=true;
$ui.callback=Drupal.settings.lrsociallogin.location;
$ui.lrinterfacecontainer ="interfacecontainerdiv"; LoginRadius_SocialLogin.init(options); }); |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate gcc;
use std::path::PathBuf;
use std::env;<|fim▁hole|> let arch =
if cfg!(target_arch = "x86_64") {
"x86_64"
} else if cfg!(target_arch = "i686") {
"i686"
} else if cfg!(target_arch = "arm") {
... |
const LIB_NAME: &'static str = "libctxswtch.a";
fn main() { |
<|file_name|>bitcoin_ka.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ka">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About wzcoin</source>
<translation ... | |
<|file_name|>lxqt-config-monitor_ast.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ast">
<context>
<name>FastMenu</name>
<message>
<location filename="../fastmenu.ui" line="20"/>
<source>Fast options</source>
<translation... | <translation type="unfinished"></translation> |
<|file_name|>adverseEventServiceIntSpec.js<|end_file_name|><|fim▁begin|>'use strict';
define(['angular-mocks'], function(angularMocks) {
describe('the adverse event service', function() {
var rootScope, q,
adverseEventService,
outcomeServiceMock = jasmine.createSpyObj('OutcomeService', ['queryItems',... | it('should query the events', function(done) {
adverseEventService.queryItems().then(function(items) {
expect(items.length).toBe(1);
expect(outcomeServiceMock.queryItems).toHaveBeenCalled(); |
<|file_name|>regions-static-closure.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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.apa... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed |
<|file_name|>pointing.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/. */
//! Specified values for Pointing properties.
//!
//! https:... | use values::specified::url::SpecifiedUrl;
/// The specified value for the `cursor` property.
/// |
<|file_name|>photon_pd.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
Unle... | }
|
<|file_name|>strFormat.py<|end_file_name|><|fim▁begin|># testStr = "Hello {name}, How long have you bean?. I'm {myName}"
#
# testStr = testStr.format(name="Leo", myName="Serim")
#
# print(testStr)<|fim▁hole|>
# print( "4" in "3.5")<|fim▁end|> |
limit = None
hello = str(limit, "")
print(hello) |
<|file_name|>Frame-onStep-14.js<|end_file_name|><|fim▁begin|>// Test how stepping interacts with switch statements.
var g = newGlobal();
g.eval('function bob() { return "bob"; }');
// Stepping into a sparse switch should not stop on literal cases.
evaluate(`function lit(x) { // 1
debugger; ... | } |
<|file_name|>mode.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package gin<|fim▁hole|>)
const GIN_MODE = "GIN_MODE"
const (
DebugMode string = "debug"
ReleaseM... |
import (
"log"
"os" |
<|file_name|>distinct.rs<|end_file_name|><|fim▁begin|>use std::collections::{HashMap, HashSet};
use std::collections::hash_state::DefaultState;
use std::hash::{hash, Hash, SipHasher};
use std::default::Default;
use communication::Data;
use communication::pact::Exchange;
use construction::{Stream, GraphBuilder};
use c... | let mut elements: HashMap<_, HashSet<_, DefaultState<SipHasher>>> = HashMap::new();
let exch = Exchange::new(|x| hash::<_,SipHasher>(&x)); |
<|file_name|>StringStartWithMatcher.java<|end_file_name|><|fim▁begin|>/*
Copyright 2010-2011 Zhengmao HU (James)
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/lic... | // 然后寻找第一个不相同字符的位置
for (firstDiff = 0; firstDiff < start.length(); firstDiff++){
|
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>"""
tests for the models
"""
import json
from datetime import datetime, timedelta
import ddt
from pytz import utc
from student.roles import CourseCcxCoachRole
from student.tests.factories import AdminFactory
from xmodule.modulestore.tests.django_utils import TE... | """verify that a ccx marked as starting yesterday has started"""
now = datetime.now(utc)
delta = timedelta(1) |
<|file_name|>BoruvkaTestCase.java<|end_file_name|><|fim▁begin|>package org.nnsoft.trudeau.spanning;
/*
* Copyright 2013 The Trudeau Project
*
* 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 ... | /** |
<|file_name|>CertAuthority.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module provides the necessary methods for a Certification Authority.
For creating the self signed Certificate for the CA, use the following command:
$ openssl req -x509 -newkey rsa:2048 -keyout ca_priv.pem -out ca_cert.pem
... | verifyEVP.assign_rsa(pub_key)
verifyEVP.verify_init()
verifyEVP.verify_update(msgDigest.digest())
return verifyEVP.verify_final(str(signature.decode('base64'))) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># This file is part of django-doubleoptin-contactform.
# django-doubleoptin-contactform is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, eit... |
# django-doubleoptin-contactform is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<|file_name|>extensions.js<|end_file_name|><|fim▁begin|><|fim▁hole|> r.push.apply(r, Ember.isArray(el) ? el.flatten() : [el]);
});
return r;
};
// jQuery Additions
jQuery.fn.exists = function() { return this.length > 0; };<|fim▁end|> | // Ember Extensions
Ember.ArrayProxy.prototype.flatten = Array.prototype.flatten = function() {
var r = [];
this.forEach(function(el) { |
<|file_name|>polyfills.ts<|end_file_name|><|fim▁begin|>import 'core-js/es6';
import 'core-js/es7/reflect';
import 'zone.js/dist/zone';
import 'ts-helpers';
if (process.env.ENV === 'production') {
} else {
// dev
Error['stackTraceLimit'] = Infinity;
require('zone.js/dist/long-stack-trace-zone');<|fim▁hole|... | } |
<|file_name|>ClasspathGridShiftLocator.java<|end_file_name|><|fim▁begin|>/*
* GeoTools - The Open Source Java GIS Toolkit
* http://geotools.org
*
* (C) 2002-2012, Open Source Geospatial Foundation (OSGeo)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms... | * License as published by the Free Software Foundation;
* version 2.1 of the License. |
<|file_name|>borland.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
pygments.styles.borland
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the Borland IDEs.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
... | |
<|file_name|>build.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from cpt.packager import ConanMultiPackager
from cpt.ci_manager import CIManager
from cpt.printer import Printer
class BuilderSettings(object):
@property
def username(self):
""" Set ca... | not match the stable pattern. Otherwise it will upload to stable |
<|file_name|>importar_uf_municipio.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand
from django_brfied.models import UnidadeFederativa, Municipio
from ...migrations import UNIDADE_FEDERATIVA_ROWS, MUNICIPIO_ROWS
class Command(BaseCommand):
help = "Importa as UFs e os Municípios ... | Municipio.objects.update_or_create(codigo=m[0], defaults={'nome': m[1], 'uf_id': m[2]})
i += 1 |
<|file_name|>helpper.js<|end_file_name|><|fim▁begin|>//Init
var CANVAS_WIDTH = 512;
var CANVAS_HEIGHT = 512;
var MOVABLE = "movable";
//jiglib body types in strings
var BODY_TYPES = ["SPHERE", "BOX","CAPSULE", "PLANE"];
//enums for indexing BODY_TYPES
var BodyValues = {"SPHERE":0, "BOX":1, "CAPSULE":2, "PLANE":3};
... | }
else if(side2 < 0.0 && side1 >= 0.0){
return(Math.abs(side2) + side1);
} |
<|file_name|>CSS.js<|end_file_name|><|fim▁begin|>djsex.css = {
/*
* http://stackoverflow.com/questions/524696/how-to-create-a-style-tag-with-javascript
*/
create: function(stylesheet) {
var head = document.getElementsByTagName('head')[0],
style = document.createElement('style'),
... | style.styleSheet.cssText = rules.nodeValue;
else style.appendChild(rules); |
<|file_name|>reader.rs<|end_file_name|><|fim▁begin|>macro_rules! impl_fastx_reader {
($multiline_fastq:expr, $DefaultPositionStore:ty, ($($mod_path:expr),*)) => {
impl_reader!(
Reader, crate::fastx::RefRecord<S>, crate::fastx::OwnedRecord,
crate::fastx::RecordSet<S>, crate::fastx::Error,
crate::core::Q... | }
impl<R, P, S> Reader<R, P, S> |
<|file_name|>opts.py<|end_file_name|><|fim▁begin|># Copyright 2015 OpenStack Foundation
# 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.... | |
<|file_name|>namespace_class_runme.py<|end_file_name|><|fim▁begin|>from namespace_class import *
try:
p = Private1()
error = 1
except:
error = 0
if (error):
raise RuntimeError, "Private1 is private"
try:
p = Private2()
error = 1
except:
error = 0
if (error):
raise RuntimeError, "Private2 is private"... |
b = BooT_i()
b = BooT_H() |
<|file_name|>cache.js<|end_file_name|><|fim▁begin|>'use strict';
var should = require('chai').should();
describe('Cache', function(){
var Hexo = require('../../../lib/hexo');
var hexo = new Hexo();
var Cache = hexo.model('Cache');
<|fim▁hole|> });
});<|fim▁end|> | it('_id - required', function(){
return Cache.insert({}).catch(function(err){
err.should.have.property('message', 'ID is not defined');
}); |
<|file_name|>else_if_without_else.rs<|end_file_name|><|fim▁begin|>//! Lint on if expressions with an else if, but without a final else branch.
use clippy_utils::diagnostics::span_lint_and_help;
use rustc_ast::ast::{Expr, ExprKind};
use rustc_lint::{EarlyContext, EarlyLintPass};
use rustc_middle::lint::in_external_macr... | }
} |
<|file_name|>PrizeView.js<|end_file_name|><|fim▁begin|>import React from 'react';
import {
Text,
View,
TextInput,
} from 'react-native';
import newChallengeStyles from '../../styles/newChallenge/newChallengeStyles';
import mainStyles from '../../styles/main/mainStyles';
import ItemSelectView from './ItemS... | this.state = {
prize: null,
|
<|file_name|>getitem.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
class Indexer:
def __getitem__(self, index):
return index ** 2
x = Indexer()
for i in range(5):
print x[i],
class Stepper:
def __getitem__(self, index):<|fim▁hole|> return self.data[index]
s = Stepper()
s.data = "spam"
for x in s:
... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>class Base(object):
def meth(self):
pass
class Derived1(Base):
def meth(self):
return super().meth()
class Derived2(Derived1):
def meth(self):
return super().meth()
class Derived3(Derived1):
pass
class Derived4(Derived3, De... | |
<|file_name|>DeregisterClusterRequest.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/eks/model/DeregisterClusterRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
<|fim▁hole|>using namespace A... | #include <utility>
using namespace Aws::EKS::Model; |
<|file_name|>callee.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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/licenses... | }
} |
<|file_name|>trottle.ts<|end_file_name|><|fim▁begin|>export const throttle = <A extends any[]>(
fn: (...args: A) => void,
wait = 100
) => {
let time = Date.now();
return (...args: A) => {
if (time + wait - Date.now() < 0) {
fn(...args);
time = Date.now();
}<|fim▁h... | };
}; |
<|file_name|>test_book.py<|end_file_name|><|fim▁begin|>book_1 = {
"ISBN": "0436203057",
"authors": [
"Howard Marks"
],
"genre": "non-fiction",
"pages": 466,
"title": "Mr. Nice"
}
<|fim▁hole|>book_2 = {
"ISBN": "0439708184",
"authors": [
"J. K. Rowling"
],
"genre":... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import utils
from flask import render_template, redirect, request, session, url_for, json, jsonify
from . import murmurbp
from .User import User
# User Views
@murmurbp.route("/users", methods = ['GET'])
def get_all_users():
u = User()
ul = utils.obj_to_dict(u... |
from .ACLGroup import ACL, Group
|
<|file_name|>MotionStreakTest.cpp<|end_file_name|><|fim▁begin|>#include "MotionStreakTest.h"
#include "../testResource.h"
enum {
kTagLabel = 1,
kTagSprite1 = 2,
kTagSprite2 = 3,
};
Layer* nextMotionAction();
Layer* backMotionAction();
Layer* restartMotionAction();
static int sceneIdx = -1;
static std::function<L... | layer->autorelease();
return layer;
} |
<|file_name|>transfer.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package http
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"net/textproto"
"sort"
"st... | // encoding. |
<|file_name|>announcement.go<|end_file_name|><|fim▁begin|>// Copyright © 2017 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package announcement
import (
"encoding"
"fmt"
"reflect"
"strings"
"time"
pb "github.com/TheThingsNetwork/ttn/api/dis... | // AppEUIMetadata is used to store an AppEUI |
<|file_name|>loadavg_unix_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Joel Scoble and The JoeFriday 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.apach... | |
<|file_name|>SyntaxError.java<|end_file_name|><|fim▁begin|>package com.semmle.jcorn;
import com.semmle.js.ast.Position;
public class SyntaxError extends RuntimeException {
private static final long serialVersionUID = -4883173648492364902L;
private final Position position;<|fim▁hole|> this.position = loc;
}
... |
public SyntaxError(String msg, Position loc, int raisedAt) {
super(msg); |
<|file_name|>apigw.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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, software
# distributed under the Licen... | # Copyright 2016 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package ch.hesso.master.caldynam;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.graphics.Outline;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android... | |
<|file_name|>ThinkingTestingAB.py<|end_file_name|><|fim▁begin|># pattern seems to be multiplying every pair of digits from different numbers and adding them up
from itertools import product
<|fim▁hole|>def test_it(a, b):
return sum(int(d1)*int(d2) for d1,d2 in product(str(a), str(b)))<|fim▁end|> | |
<|file_name|>inline-middle.tsx<|end_file_name|><|fim▁begin|>/** @jsx jsx */
import { Editor, Transforms } from 'slate'
import { jsx } from '../../..'
export const run = editor => {
Transforms.splitNodes(editor, { match: n => Editor.isBlock(editor, n) })
}
export const input = (<|fim▁hole|> <block>
<text />
... | <editor> |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! `Cask` is a key-value store backed by a log-structured hash table which is inspired by
//! [bitcask](https://github.com/basho/bitcask/).
//!
//! Keys are indexed in a `HashMap` and values are written to an append-only log. To avoid the log
//! from getting filled wit... | mod cask; |
<|file_name|>hdpmodel.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Jonathan Esterhazy <jonathan.esterhazy at gmail.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
#
# HDP inference code is adapted from the onlinehdp.py script by
# C... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> * This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
mod builder;
mod errors;
mod sql_phases;
mod sql_store;
pub use builder::SqlPhasesBuilder;
pub use errors::SqlPhasesError;<|fim▁end|> | /*
* Copyright (c) Meta Platforms, Inc. and affiliates.
* |
<|file_name|>bilinear.py<|end_file_name|><|fim▁begin|>import numpy
from chainer import cuda
from chainer import function
from chainer.utils import array
from chainer.utils import type_check
class BilinearFunction(function.Function):
def check_type_forward(self, in_types):
n_in = type_check.eval(in_types... | W = inputs[2] |
<|file_name|>PostgresNoSQLTable.py<|end_file_name|><|fim▁begin|>import copy
import json
from psycopg2.extensions import AsIs
from psycopg2.extras import RealDictCursor
from pg4nosql import DEFAULT_JSON_COLUMN_NAME, DEFAULT_ROW_IDENTIFIER
from pg4nosql.PostgresNoSQLQueryStructure import PostgresNoSQLQueryStructure
from ... |
def execute(self, sql_query): |
<|file_name|>build.js<|end_file_name|><|fim▁begin|>({
baseUrl: "../linesocial/public/js",<|fim▁hole|> out: "main-built.js"
})<|fim▁end|> | paths: {
jquery: "public/js/libs/jquery-1.9.1.js"
},
name: "main", |
<|file_name|>generator.py<|end_file_name|><|fim▁begin|>import nltk
import json
import sys
sys.path.append("../../")
import parser
from entity import Word
class ModelRewriter:
rewriteRules = None
rewriteRuleFileName = "model.txt"
@staticmethod
def loadModel():
inputFile = open("model.txt")
... | |
<|file_name|>scf.py<|end_file_name|><|fim▁begin|>import numpy as np
from gpaw import KohnShamConvergenceError
class SCFLoop:
"""Self-consistent field loop.
converged: Do we have a self-consistent solution?
"""
def __init__(self, eigenstates=0.1, energy=0.1, density=0.1, maxiter=100,
... | if niter_fixdensity is None:
niter_fixdensity = 2 |
<|file_name|>FlowableMaterializeTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016-present, RxJava Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www... | return f.materialize(); |
<|file_name|>create_trans_table.py<|end_file_name|><|fim▁begin|>#coding: utf-8
import csv
from read_conf import config
import MySQLdb as mysql
conn = mysql.connect(host='localhost',user='root',passwd='111111111',port=3306)
cur = conn.cursor()
def create_db():
count = cur.execute('create database if not exists s... | a += 1
if a % 10000 == 0 : |
<|file_name|>skoolsound.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2013, 2014 Richard Dymond (rjdymond@gmail.com)
#
# This file is part of Pyskool.
#
# Pyskool is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Fre... | for i, delay in enumerate(delays): |
<|file_name|>console.py<|end_file_name|><|fim▁begin|>"""
@author: Daniel Butum, Group 911
"""
from domain.number import Number, NumberException
from utils.number import convert_to_int
class Console:
def __init__(self):
pass
def run(self):
"""
Run the console gui
"""
... | try:
if option == "q": # quit the loop
break |
<|file_name|>SignalSender.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
SignalVisitor.cpp - description
-------------------
begin : Wed Jan 26 2000
copyright : (C) 2... |
SignalSender::~SignalSender() {
p_SignalSender = NULL;
} |
<|file_name|>5-10.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(Reverse(-27))
fmt.Println(Reverse(314))
}
func Reverse(d int) (r int) {
factors := make([]int, 0, 0)
isNeg := false
if d < 0 {
isNeg = true
d *= -1<|fim▁hole|> } else {
factors = append(fac... | }
for {
if d == 0 {
break |
<|file_name|>Force_Drag.cpp<|end_file_name|><|fim▁begin|>// Copyright (C) 2004 Id Software, Inc.
//
#include "../../idlib/precompiled.h"
#pragma hdrstop
#include "../Game_local.h"
CLASS_DECLARATION( idForce, idForce_Drag )
END_CLASS
/*
================
idForce_Drag::idForce_Drag
================
*/
idForce_Drag::id... | }
/* |
<|file_name|>mediawiki.debug.profile.js<|end_file_name|><|fim▁begin|>/*!
* JavaScript for the debug toolbar profiler, enabled through $wgDebugToolbar
* and StartProfiler.php.
*
* @author Erik Bernhardson
* @since 1.23
*/
( function ( mw, $ ) {
'use strict';
/**
* @singleton
* @class mw.Debug.profile
*/
... | list.splice( idx, 1 ); |
<|file_name|>environment.ts<|end_file_name|><|fim▁begin|>// The file contents for the current environment will overwrite these during build.<|fim▁hole|>export const environment = {
production: false,
API_ENDPOINT: 'http://127.0.0.1:8000/api/v1/'
};<|fim▁end|> | // The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
|
<|file_name|>exception.py<|end_file_name|><|fim▁begin|># HRGRN WebServices
# Copyright (C) 2016 Xinbin Dai, Irina Belyaeva
<|fim▁hole|># This file is part of HRGRN WebServices API.
#
# HRGRN API is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | |
<|file_name|>sort.ts<|end_file_name|><|fim▁begin|>async function arraySort() {
"use speedyjs";
<|fim▁hole|>
const ascending = array.sort();
const descending = array.sort(descendingComparator);
}
function descendingComparator(a: int, b: int) {
"use speedyjs";
return b - a as number;
}<|fim▁end|> | const array = [1, 2]; |
<|file_name|>printers.py<|end_file_name|><|fim▁begin|>from src import model as mdl
class LaTeXPrinter(object):
def __init__(self, target_file_path):
self._target_file_path = target_file_path
def run(self):
with open(self._target_file_path, 'w') as output:
text = self._generate_tex... |
class UseCaseRequirementTrackPrinter(TablePrinter): |
<|file_name|>Act_I.js<|end_file_name|><|fim▁begin|>/*****************************
ACT I: THE SETUP
1. Hat guy
2. Lovers
// then let's start escalating...
******************************/
function Stage_Start(self){
// Create Peeps
self.world.clearPeeps();
self.world.addBalancedPeeps(20);
}
function Sta... | |
<|file_name|>panel-api.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import RestClient from 'another-rest-client';
import { RestApiService } from '../rest-api/rest-api.service';
@Injectable()
export class PanelApi {
private api: RestClient;
constructor(restApiService: RestAp... | }
} |
<|file_name|>gl.js<|end_file_name|><|fim▁begin|>/**
* @class A wrapper around WebGL.
* @name GL
* @param {HTMLCanvasElement} element A canvas element.
* @param {function} onload A callback function.
* @param {function} callbacks.onerror A callback function.
* @param {function} callbacks.onprogress A callback func... |
if (boundShader) {
oldAttribs = boundShader.attribs; |
<|file_name|>OfflineOCSPSource.java<|end_file_name|><|fim▁begin|>/**
* DSS - Digital Signature Services
* Copyright (C) 2015 European Commission, provided under the CEF programme
*
* This file is part of the "DSS - Digital Signature Services" project.
*
* This library is free software; you can redistribute it and... | * |
<|file_name|>WndModSelect.java<|end_file_name|><|fim▁begin|>package com.watabou.pixeldungeon.windows;
import com.nyrds.pixeldungeon.game.GameLoop;
import com.nyrds.pixeldungeon.game.GamePreferences;
import com.nyrds.pixeldungeon.ml.R;
import com.nyrds.pixeldungeon.utils.ModDesc;
import com.nyrds.pixeldungeon.windows.D... |
String prevMod = GamePreferences.activeMod();
if (option.equals(prevMod)) { |
<|file_name|>test.ts<|end_file_name|><|fim▁begin|>/*
* @license Apache-2.0<|fim▁hole|>* 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
*
* Unles... | *
* Copyright (c) 2019 The Stdlib Authors.
* |
<|file_name|>mongodb.py<|end_file_name|><|fim▁begin|>from pymongo import MongoClient
from pymongo.collection import Collection
from pymongo.errors import AutoReconnect
from django.conf import settings
from types import FunctionType
import functools
import time
__all__ = ("connection", "connections", "db", "get_db")
... | def __getattr__(self, func):
old = getattr(self._database, func) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, unicode_literals
import platform
import sys
import warnings
if not (2, 7) <= sys.version_info < (3,):
sys.exit(
'ERROR: Mopidy requires Python 2.7, but found %s.' %
platform.python_versio... | __version__ = '1.1.1' |
<|file_name|>StopDatafeedResponseTests.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with<|fim▁hole|> * not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ht... | * this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may |
<|file_name|>controller.py<|end_file_name|><|fim▁begin|>from .model import NetworkModel
from .view import NetworkView
from PyQt5.QtWidgets import QAction, QMenu
from PyQt5.QtGui import QCursor, QDesktopServices
from PyQt5.QtCore import pyqtSlot, QUrl, QObject
from duniterpy.api import bma
from duniterpy.documents impor... | if bma_endpoints:
conn_handler = next(bma_endpoints[0].conn_handler()) |
<|file_name|>test_robustus.py<|end_file_name|><|fim▁begin|># =============================================================================<|fim▁hole|># COPYRIGHT 2013 Brain Corporation.
# License under MIT license (see LICENSE file)
# =============================================================================
import... | |
<|file_name|>test_storage_scenarios.py<|end_file_name|><|fim▁begin|>#
# Copyright 2013 Intel Corp.
#
# 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... | self.assertEqual("16fd2706-8baf-433b-82eb-8c7fada847e0",
history[0].event_id) |
<|file_name|>practice.js<|end_file_name|><|fim▁begin|>// Lecture 11
function b() {
console.log('Called b!');
}
b();
console.log(a);
// Will return undefined as only set in Creation Phase
var a = 'Hello World!';
console.log(a);
// Lecture 12 Conceptual Aside
/*
-Single Threaded: One command at a time
-Caveat,... | /*
*/ |
<|file_name|>google-map.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, Input } from '@angular/core';
import { LoadingController, NavController } from 'ionic-angular';
import { Geolocation } from 'ionic-native';
import { Observable } from 'rxjs/Observable';
import { OriginLocationComponent } from '../origin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.