prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2016 Pinterest, 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/L... | |
<|file_name|>pydev_runfiles_pytest2.py<|end_file_name|><|fim▁begin|>from _pydev_runfiles import pydev_runfiles_xml_rpc
import pickle
import zlib
import base64
import os
from pydevd_file_utils import canonical_normalized_path
import pytest
import sys
import time
try:
from pathlib import Path
except:
... | # in it.
|
<|file_name|>class.spellEffects.junglecreatures.js<|end_file_name|><|fim▁begin|>spellEffects[ 'junglecreatures' ] = function( args )
{
var self = this,
_ccd = Component.bugcraft.currentCharacterObject.characterData,
_moveFrames = {},
_tc = args.targetCharacter,
_tcd = _tc.characterData,
_c... | }
});
|
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>var indexController = require('./controllers/cIndex');
var usuarioController = require('./controllers/cUsuario');
var clientesController = require('./controllers/cCliente');
var adminController = require('./controllers/cAdmin');
var umedController = require('./control... | //novedades
app.get('/listanovedades', indexController.getNovedades);
//usuarios
app.get('/usuarioslista', auth, usuarioController.getUsuarios); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup<|fim▁hole|>def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="martapy",
version=martapy.__version__,
author=martapy.__author__,
author_email="git@edward.sh",
description... | import os
import martapy
|
<|file_name|>widget.js<|end_file_name|><|fim▁begin|>(function ($, _, Backbone, models) {
"use strict";
<|fim▁hole|> "update_interval": '10'
},
url: function() {
var tmp = "/api/dashboards/" + this.get("dashboard_id") + "/widgets";
if (this.isNew()) {
return tmp;
} else {
... | models.Widget = Backbone.Model.extend({
defaults: {
"name" : "Undefined name",
"range" : '30-minutes', |
<|file_name|>home.py<|end_file_name|><|fim▁begin|>import logging
import secrets
from typing import List, Optional, Tuple
from django.conf import settings
from django.http import HttpRequest, HttpResponse
from django.shortcuts import redirect, render
from django.utils.cache import patch_cache_control
from zerver.conte... | )
needs_tutorial = user_profile.tutorial_status == UserProfile.TUTORIAL_WAITING
else: |
<|file_name|>bind.go<|end_file_name|><|fim▁begin|>package echo
import (
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"net/http"
"reflect"
"strconv"
"strings"
)
type (
// Binder is the interface that wraps the Bind method.
Binder interface {
Bind(i interface{}, c Context) error
}
// DefaultBinder is th... | |
<|file_name|>Chip.spec.js<|end_file_name|><|fim▁begin|>import Chip from '../../components/Chip'
import { vueTest } from '../utils'
describe('Chip', () => {
let vm
before((done) => {
vm = vueTest(Chip)
vm.$nextTick(done)
})
it('renders with text', () => {
const el = vm.$('#chip')
el.should.cont... | .then(() => { |
<|file_name|>bitcoin_fr.ts<|end_file_name|><|fim▁begin|><TS language="fr" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Cliquer à droite pour modifier l'adresse ou l'étiquette</translation>
</message>
<m... | </message> |
<|file_name|>models.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.cache import cache
from django.db.models.signals import post_save, post_delete
class BlockIP(models.Model):
network = models.CharField(_('IP addres... | import ipcalc |
<|file_name|>BookmarkPaymentFragment.java<|end_file_name|><|fim▁begin|>package com.mapswithme.maps.purchase;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
... | mSubsProductDetails = PurchaseUtils.toProductDetails(skuDetails);
}
void handleValidationResult(boolean validationResult) |
<|file_name|>compiler.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
# stino/compiler.py
import os
import re
import threading
import subprocess
import sublime
from . import fileutil
from . import textutil
from . import constant
from . import serial
from . import base
from . import preprocess
from . import sk... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import hashlib
from datetime import datetime
from flask import request
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from . import db, login_manager
#pylint: disable-msg=E1101
@login_manager.user_loade... | else:
return cls.query.filter_by(active=False)\
.filter(cls.name != 'Almenn frétt').all()
|
<|file_name|>Element.Data.Specs.js<|end_file_name|><|fim▁begin|>/*
---
name: Element.Data.Specs
description: n/a
requires: [Behavior/Element.Data]
provides: [Element.Data.Specs]
...<|fim▁hole|>
(function(){
var target = new Element('div', {
'data-filters': 'Test1 Test2',
'data-json':'{"foo": "bar", "nine": 9, "arr... | */ |
<|file_name|>timeline-view.js<|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 t... | jobTimeline.setOptions(options); |
<|file_name|>714_best-time-to-buy-and-sell-stock-with-transaction-fee.py<|end_file_name|><|fim▁begin|>class Solution:
def maxProfit(self, prices, fee):
dp = [[-prices[0]], [0]]
for i in range(1, len(prices)):<|fim▁hole|> dp[1].append(max(dp[0][i-1]+prices[i]-fee, dp[1][i-1]))
retu... | dp[0].append(max(dp[0][i-1], dp[1][i-1]-prices[i])) |
<|file_name|>test_complex_ops.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 file to You under the... | |
<|file_name|>debug.rs<|end_file_name|><|fim▁begin|>// This file is part of zinc64.
// Copyright (c) 2016-2019 Sebastian Jastrzebski. All rights reserved.
// Licensed under the GPLv3. See LICENSE file in the project root for full license text.
#![allow(unused)]
#![cfg_attr(feature = "cargo-clippy", allow(clippy::cast_l... | |
<|file_name|>videoplayer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import functools
from nxtools import logging, log_traceback
from .utils import (
Qt,
QWidget,
QSlider,
QTimer,
QHBoxLayout,
QVBoxLayout,
QIcon,
RegionBar,
TimecodeWindow,
get_navbar,
)
try:
fro... | )
self.duration_display = TimecodeWindow(self) |
<|file_name|>embed.js<|end_file_name|><|fim▁begin|>// NOTE: this file should only be included when embedding the inspector - no other files should be included (this will do everything)
// If gliEmbedDebug == true, split files will be used, otherwise the cat'ed scripts will be inserted
(function() {
var pathRoot ... | script.onload = function() {
if (!script.loadCalled) {
this.loadCalled = true; |
<|file_name|>example.go<|end_file_name|><|fim▁begin|>package main
import (
"bufio"
"bytes"
"github.com/mediocregopher/manatcp"
"log"
"time"
)
////////////////////////////////////////////////////////////////////////////////
// Client definition
type ExClient struct{}
func (_ ExClient) Read(buf *bufio.Reader) (i... | log.Printf("CLIENT: Got push: '%s'", string(push.([]byte)))
}
} |
<|file_name|>lint-group-plugin.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<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MI... | // http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
<|file_name|>NumberOfDiscIntersections_test.go<|end_file_name|><|fim▁begin|>package sorting
import (
. "gopkg.in/check.v1"
)
var _ = Suite(&MySuite{})
func (s *MySuite) TestNumberOfDiscIntersections(c *C) {<|fim▁hole|> for i := 0; i < c.N; i++ {
NumberOfDiscIntersections([]int{1, 5, 2, 1, 4, 0})
}
}<|fim▁end|> | c.Assert(NumberOfDiscIntersections([]int{1, 5, 2, 1, 4, 0}), Equals, 11)
}
func (s *MySuite) BenchmarkNumberOfDiscIntersections(c *C) { |
<|file_name|>pod.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
Unless req... | Error()
}
// DeleteCollection deletes a collection of objects. |
<|file_name|>wf-outlives-ty-in-fn-or-trait.rs<|end_file_name|><|fim▁begin|>#![feature(rustc_attrs)]
#![allow(dead_code)]
trait Trait<'a, T> {
type Out;
}
impl<'a, T> Trait<'a, T> for usize {
type Out = &'a fn(T); //~ ERROR `T` may not live long enough
}
struct Foo<'a,T> {
f: &'a fn(T),<|fim▁hole|>
trait ... | } |
<|file_name|>test_std.rs<|end_file_name|><|fim▁begin|>use permutohedron;
use itertools as it;
use crate::it::Itertools;
use crate::it::multizip;
use crate::it::multipeek;
use crate::it::free::rciter;
use crate::it::free::put_back_n;
use crate::it::FoldWhile;
use crate::it::cloned;
use crate::it::iproduct;
use crate::it... | fn intersperse() {
let xs = ["a", "", "b", "c"];
let v: Vec<&str> = xs.iter().map(|x| x.clone()).intersperse(", ").collect(); |
<|file_name|>event_tests.py<|end_file_name|><|fim▁begin|>import csv
import unittest
from datetime import datetime, timedelta
from hackertracker import event
from hackertracker.database import Model, Session
from sqlalchemy import create_engine
class TestEvents(unittest.TestCase):
def setUp(self):
engine =... |
def assertDatetimesEqual(self, w1, w2):
"Assert datetimes are equal to the second" |
<|file_name|>Rosenblatt_perceptron.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def plot_decision_regions(X, y, clf, res=0.02):
x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1
y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1
xx, yy = np.meshg... | X = np.array([[0,3],[1,2],[2,2],[4,0],[-1,2],[2,0],[3,-1],[4,-1]]).reshape(8,2)
ppn = Perceptron(epochs=10, eta=0.1) |
<|file_name|>test_crafting.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# -*- coding: utf-8 -*-
# test_crafting.py
import os
import sys
import unittest
root_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + ".." )
pth = root_folder #+ os.sep + 'worldbuild'
sys.path.append(pth)
from... | def setUp(self):
unittest.TestCase.setUp(self)
|
<|file_name|>excise.py<|end_file_name|><|fim▁begin|>def excise(conn, qrelname, tid):
with conn.cursor() as cur:
# Assume 'id' column exists and print that for bookkeeping.
#
# TODO: Instead should find unique constraints and print
# those, or try to print all attributes that are not ... |
row = cur.fetchone() |
<|file_name|>lpeobject.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) Johan Engelen 2007-2008 <j.b.c.engelen@utwente.nl>
* Abhishek Sharma
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include "live_effects/lpeobject.h"
#include "live_effects/effect.h"
#include "xml/repr.h"... | /*
Local Variables:
mode:c++ |
<|file_name|>rechteck.py<|end_file_name|><|fim▁begin|>import numpy as np
import uncertainties.unumpy as unp
from uncertainties.unumpy import (nominal_values as noms, std_devs as stds)
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.optimize import curve_fit
plt.rcParams['figure.figsize'] = (12, 8)
p... | plt.tight_layout()
plt.savefig('bilder/rechteck.pdf')
plt.show() |
<|file_name|>JournalDAO.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2000 - 2016 Silverpeas
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* Licen... | + " and (userId = ?) " + " order by startDay, startHour"; |
<|file_name|>i16_add_with_overflow.rs<|end_file_name|><|fim▁begin|>#![feature(core, core_intrinsics)]
extern crate core;
#[cfg(test)]
mod tests {
use core::intrinsics::i16_add_with_overflow;
// pub fn i16_add_with_overflow(x: i16, y: i16) -> (i16, bool);
#[test]
fn i16_add_with_overflow_test1() {
le... | assert_eq!(result, 0x8000); // -32768
assert_eq!(is_overflow, true); |
<|file_name|>0004_remove_redundant_packs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#pylint: skip-file
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods ... | |
<|file_name|>pcl_test.py<|end_file_name|><|fim▁begin|>import pcl<|fim▁hole|>fil.set_mean_k (50)
fil.set_std_dev_mul_thresh (1.0)
fil.filter().to_file("inliers.pcd")<|fim▁end|> | p = pcl.PointCloud()
p.from_file("test_pcd.pcd")
fil = p.make_statistical_outlier_filter() |
<|file_name|>celery.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from celery.bin import celery
from djcelery.app import app
from djcelery.management.base import CeleryCommand
base = celery.CeleryCommand(app=app)<|fim▁hole|> help = 'celery commands, see celery help'
... |
class Command(CeleryCommand):
"""The celery command.""" |
<|file_name|>githubissuetracker.py<|end_file_name|><|fim▁begin|>"""
file: gitissuetracker.py
author: Christoffer Rosen <cbr4830@rit.edu>
date: December, 2013
description: Represents a Github Issue tracker object used
for getting the dates issues were opened.
12/12/13: Doesn't currently support private repos
"""
im... | getDateOpened() |
<|file_name|>wxglvideo.py<|end_file_name|><|fim▁begin|>import wx
import wx.glcanvas
import pyglet
import pyglet.gl as gl
import pyglet.gl
import motmot.wxvideo.wxvideo as wxvideo
# XXX TODO:
# check off-by-one error in width/coordinate settings (e.g. glOrtho call)
# allow sharing of OpenGL context between instances
... |
def set_fullcanvas(self,value): |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""
Django ID mapper
Modified for Evennia by making sure that no model references
leave caching unexpectedly (no use if WeakRefs).
Also adds cache_size() for monitoring the size of the cache.
"""
import os, threading
#from twisted.internet import reactor
#from twiste... | _SA(cls, fname, None)
update_fields = [fname] if _GA(cls, "_get_pk_val")(_GA(cls, "_meta")) is not None else None |
<|file_name|>mainpage.go<|end_file_name|><|fim▁begin|>package web
import (
"net/http"
"brooce/heartbeat"
"brooce/listing"
"brooce/task"
)
type mainpageOutputType struct {
Queues map[string]*listing.QueueInfoType
RunningJobs []*task.Task
RunningWorkers []*heartbeat.HeartbeatType
TotalThreads int
... | }
output.Queues, err = listing.Queues(false)
if err != nil { |
<|file_name|>click_object.rs<|end_file_name|><|fim▁begin|>extern crate gtk;
use gtk::{ScrolledWindow,ContainerExt,Box,Orientation,Entry,EntryExt,Frame};
use std::vec::Vec;
pub trait Attachable{
fn attach<F:ContainerExt>(&self,parent: &F);
}
pub struct Control {}
impl Control {
pub fn play(&self){
pri... | pub struct LabelFrame {
label_box:Box,
labels:Vec<Label> |
<|file_name|>daemonsetcontroller.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 The Kubernetes Authors.<|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/licen... | |
<|file_name|>semi-after-macro-ty.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.<|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http:/... | |
<|file_name|>inherited_account_account_type.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountAccountType(models.Model):
_inherit = 'account.account.type'
_order = 'sequen... |
sequence = fields.Integer(
string=u'Sequence',
) |
<|file_name|>test_submit_button.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2015 McKinsey Academy
#
# Authors:
# Jonathan Piacenti <jonathan@opencraft.com>
#
# This software's license gives you freedom; you can copy, convey,
# propagate, redistribute and/or modify this program und... | # |
<|file_name|>test_microsites.py<|end_file_name|><|fim▁begin|>"""
Tests related to the Microsites feature
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from nose.plugins.attrib import attr
from courseware.tests.helpers import LoginEnrol... | ) |
<|file_name|>state_based_validator.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package statebasedval
import (
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/privacyenabledstate"
"githu... | } |
<|file_name|>pretty-color.js<|end_file_name|><|fim▁begin|><|fim▁hole|> classNames: ['pretty-color'],
attributeBindings: ['style'],
style: function(){
return 'color: ' + this.get('name') + ';';
}.property('name')
});<|fim▁end|> | export default Ember.Component.extend({
|
<|file_name|>plot.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import operator
import h5py
import numpy as np
import matplotlib.pyplot as plt
def get_time_potential_charge_absrbd_on_anode_from_h5( filename ):
h5 = h5py.File( filename, mode="r")
absorbed_charge = h5["/InnerRegions/anode"].attrs["total_absorbed_c... | import os, glob |
<|file_name|>TestPushNotifications.java<|end_file_name|><|fim▁begin|>import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Properties... | import com.google.common.base.Optional;
import com.google.common.collect.Iterables;
|
<|file_name|>framework.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 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... | "fmt" |
<|file_name|>bytecode.rs<|end_file_name|><|fim▁begin|>use ein_syntax::ast::{BinaryOp, Expr, Stmt, UnaryOp};
use crate::Value;
#[derive(Debug)]
pub enum Instruction {
// Stack control
Return,
Pop,
// Loads
LoadNil,
LoadTrue,
LoadFalse,
LoadConstant(u8),
LoadGlobal(u8),
// Stor... | lhs.emit(chunk);
rhs.emit(chunk);
chunk.add_instruction(Instruction::Divide);
} |
<|file_name|>qgsstylemanagerdialog.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
qgsstylemanagerdialog.cpp
---------------------
begin : November 2009
copyright : (C) 2009 by Martin Dobias
email ... | |
<|file_name|>ntp_client.py<|end_file_name|><|fim▁begin|>#!/bin/env python
"""
#######################################################################
# #
# Copyright (c) 2012, Prateek Sureka. All Rights Reserved. #
# This module provides an ... | |
<|file_name|>freicoin_ca_ES.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="ca_ES">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>A... | |
<|file_name|>message_box_dialog.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 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 "chrome/browser/ui/simple_message_box.h"
#include <utility>
#include "base/... | : l10n_util::GetStringUTF16(IDS_OK);
}
SetButtonLabel(ui::DIALOG_BUTTON_OK, ok_text);
|
<|file_name|>atom.rs<|end_file_name|><|fim▁begin|>use crate::syntax::Type;
use proc_macro2::Ident;
use std::fmt::{self, Display};
#[derive(Copy, Clone, PartialEq)]
pub enum Atom {
Bool,
Char, // C char, not Rust char
U8,
U16,
U32,
U64,
Usize,
I8,
I16,
I32,
I64,
Isize,
... | }
pub fn from_str(s: &str) -> Option<Self> { |
<|file_name|>auth.guard.ts<|end_file_name|><|fim▁begin|>import { Inject, Injectable } from '@angular/core';
import { CanActivate, Router } from "@angular/router";
import { AuthService } from "../services/auth.service";<|fim▁hole|> constructor(private _auth: AuthService,
private _router: Router) { }
ca... |
@Injectable()
export class AuthGuard implements CanActivate { |
<|file_name|>keyboard.js<|end_file_name|><|fim▁begin|>define(['omega/entity', 'omega/core'], function (e, o) {
'use strict';
var triggerKey = function (action, e) {
o.trigger(action, {
keyCode: e.keyCode,<|fim▁hole|> shiftKey: e.shiftKey,
ctrlKey: e.ctrlKey,
... | |
<|file_name|>encoder.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 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/li... | Some(implementations) => { |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>(function () {
var common;
this.setAsDefault = function () {
var _external = window.external;
if (_external && ('AddSearchProvider' in _external) && ('IsSearchProviderInstalled' in _external)) {
var isInstalled = 0;
try {
... | })();
console.info("谷搜客基于Google搜索,为喜爱谷歌搜索的朋友们免费提供高速稳定的搜索服务。搜索结果通过Google.com实时抓取,欢迎您在日常生活学习中使用谷搜客查询资料。");
console.info("如果你觉得谷搜客对你有帮助,请资助(支付宝账号: mlongbo@gmail.com)我一下,资金将用于支持我开发及购买服务器资源。^_^"); |
<|file_name|>handle.rs<|end_file_name|><|fim▁begin|>pub mod prelude {
pub use super::Handle;
}
<|fim▁hole|><|fim▁end|> | pub trait Handle<T> {
fn as_ptr(&self) -> *mut T;
} |
<|file_name|>productReducer.spec.js<|end_file_name|><|fim▁begin|>import { expect } from 'chai';
import productReducer from './productReducer';
import * as actions from '../actions/productActions';
import * as types from '../constants/actionTypes';
import initialState from './initialState';
describe('Product Reducer', ... | |
<|file_name|>dailyrls_wp_jh.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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... | |
<|file_name|>a11y.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|> grunt.config(
'a11y', {
live: {
options: {
urls: ['www.google.com']
}
}
});
};<|fim▁end|> |
module.exports = function (grunt) { |
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>// wrapped by build app
define("FileSaver/demo/demo", ["dojo","dijit","dojox"], function(dojo,dijit,dojox){
/* FileSaver.js demo script
* 2012-01-23
*
* By Eli Grey, http://eligrey.com
* License: X11/MIT
* See LICENSE.md
*/
/*! @source http://purl.eligrey.com/... | drawing = true;
add_point(event.pageX - canvas.offsetLeft, event.pageY - canvas.offsetTop, false);
draw(); |
<|file_name|>camerarotation.py<|end_file_name|><|fim▁begin|># Inviwo Python script
import inviwo
import math
import time
start = time.clock()
scale = 1;
<|fim▁hole|> x = d*math.sin(r)
z = -d*math.cos(r)
inviwo.setPropertyValue("EntryExitPoints.camera",((x*scale,3*scale,z*scale),(0,0,0),(0,1,0)))
... | d = 15
steps = 120
for i in range(0, steps):
r = (2 * 3.14 * i) / steps
|
<|file_name|>32e5974ada25_add_neutron_resources_table.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTI... | #
# 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 |
<|file_name|>shootout-meteor.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
// http://www.apach... | filter_masks(&mut masks);
let data = par_search(masks);
println!("{} solutions found", data.nb);
print_sol(&data.min); |
<|file_name|>gametime.rs<|end_file_name|><|fim▁begin|>extern crate time;
#[derive(Debug, Clone, Copy)]
pub struct GameTime {
prev_frame_time: time::Timespec,
curr_frame_time: time::Timespec,
}
#[allow(dead_code)]
impl GameTime {
pub fn new() -> GameTime {
let now = time::get_time();
GameTi... | }
pub fn dt(self) -> f32 { |
<|file_name|>pre_processing_driver.py<|end_file_name|><|fim▁begin|>from feature_extraction.pre_processing.filter_precedent import precendent_directory_cleaner<|fim▁hole|>
def run(command_list):
precendent_directory_cleaner.run(command_list)<|fim▁end|> | |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';<|fim▁hole|>import '../public/css/styles.css';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent { }<|fim▁end|> | |
<|file_name|>UVa492.py<|end_file_name|><|fim▁begin|>'''/* UVa problem:
*
* Topic:
*
* Level:
*
* Brief problem description:
*
*
*
* Solution Summary:
*
*
*
* Used Resources:
*
*
*
* I hereby certify that I have produced the following solution myself
* using the resources listed above i... | * collaboration policy. |
<|file_name|>iter.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
// http://www.apache.org/licen... | self.n = 0;
return None
} |
<|file_name|>grade_java.py<|end_file_name|><|fim▁begin|>import config, json, cgi, sys, Websheet, re, os
def grade(reference_solution, student_solution, translate_line, websheet, student):
if not re.match(r"^\w+$", websheet.classname):
return ("Internal Error (Compiling)", "Invalid overridden classname <tt>"... | |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>'use strict'
const assert = require('assert')
const http = require('http')
const https = require('https')
const { kState, kOptions } = require('./symbols')
const {
codes: { FST_ERR_HTTP2_INVALID_VERSION }
} = require('./errors')
function createServer (options, ht... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for RainMachine devices."""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
ATTR_ATTRIBUTION, CONF_BINARY_SENSORS, CONF_IP_ADDRESS, CONF_... | async def async_unload_entry(hass, config_entry):
"""Unload an OpenUV config entry."""
hass.data[DOMAIN][DATA_CLIENT].pop(config_entry.entry_id)
|
<|file_name|>GoogleSearchParameters.ts<|end_file_name|><|fim▁begin|>const querystring = require("querystring");
import IRequestParameters from "./IRequestParameters";
export default class GoogleSearchParameters implements IRequestParameters {
query: string;
private start: number;
constructor(searchQuery: s... | return undefined;
}
} |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from flask.ext.wtf import Form
from wtforms import StringField, BooleanField, TextAreaField, SelectField, FileField, IntegerField
from wtforms.validators import DataRequired, regexp, NumberRange
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from picture_h... | points = IntegerField('Points', validators=[DataRequired()])
note = TextAreaField('Note', validators=[DataRequired()])
|
<|file_name|>noise_driven_dynamics.py<|end_file_name|><|fim▁begin|>__author__ = 'duarte'
import sys
from preset import *
import numpy as np
"""
spike_noise_input
- standard network setup, driven with noisy, Poissonian input
- quantify and set population state
- run with noise_driven_dynamics in computations
- debug wi... | 'population_activity': {
'time_bin': 1., # bin width for spike counts, fano factors and correlation coefficients
'n_pairs': 500, # number of spike train pairs to consider in correlation coefficient
'tau': 20., # time constant of exponential filter (van Rossum distan... |
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Plugins.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope ... | return list.__getitem__(self, index)
|
<|file_name|>test_escala.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2
# -*- coding: utf-8 -*-
# coding=utf-8<|fim▁hole|>from datetime import datetime
from lib.escala import Escala
import dirs
dirs.DEFAULT_DIR = dirs.TestDir()
class FrameTest(unittest.TestCase):
def setUp(self):
self.escala = Esca... |
import unittest |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import tkinter
FRAME_BORDER = 5
class PageView(object):
__root = None
bd = None
def __init__(self, root=None, main_frame=None):
param = self.params()
if root is None:
# standalone
self.__root = tkinter.Tk()
... |
self.bd = param['bd'] |
<|file_name|>unboxed-closure-sugar-used-on-struct.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.<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT licens... | //
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
<|file_name|>freebase_key_needed_final.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from json import loads
from pprint import pprint
from sys import argv
import urllib
class FREEBASE_KEY():
'''
please input the api_key here
'''
api_key... | def get_city_attractions(city_name):
topic_id = get_city_id(city_name)
service_url = 'https://www.googleapis.com/freebase/v1/topic' |
<|file_name|>CorpusCreatorTest.java<|end_file_name|><|fim▁begin|>package org.voyanttools.trombone.tool.build;
import static org.junit.Assert.*;
import java.io.IOException;
import org.junit.Test;
import org.voyanttools.trombone.model.Corpus;
import org.voyanttools.trombone.storage.Storage;
import org.voyanttools.trom... | creator.run();
nextStep = creator.getNextCorpusCreatorStep(); |
<|file_name|>from_into.rs<|end_file_name|><|fim▁begin|>// The From trait is used for value-to-value conversions.
// If From is implemented correctly for a type, the Into trait should work conversely.
// You can read more about it at https://doc.rust-lang.org/std/convert/trait.From.html
#[derive(Debug)]
struct Person {
... | // Otherwise, then return an instantiated Person object with the results
impl From<&str> for Person {
fn from(s: &str) -> Person {
} |
<|file_name|>events.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2018 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the ... | DuplicateNegotiate,
NegotiateMalformedDialects,
FileOverlap,
} |
<|file_name|>util.js<|end_file_name|><|fim▁begin|>requirejs(['helper/util'], function(util){<|fim▁hole|><|fim▁end|> |
}); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate syslog;
extern crate libc;
extern crate pnet;
extern crate crossbeam;
extern crate scheduler;
extern crate clap;
extern crate yaml_rust;
extern crate parking_lot;
extern crate fnv;
extern... | Err(e) => error!("Error parsing config file {}: {:?}", config_path.display(), e),
} |
<|file_name|>test_volume.py<|end_file_name|><|fim▁begin|># Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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... | |
<|file_name|>editable_selects.js<|end_file_name|><|fim▁begin|>/**
* $Id: sites/all/libraries/tinymce/jscripts/tiny_mce/utils/editable_selects.js 1.3 2010/02/18 14:49:08EST Linda M. Williams (WILLIAMSLM) Production $
*
* Makes select boxes editable.
*
* @author Moxiecode
* @copyright Copyright © 2004-2008, ... | TinyMCE_EditableSelects.onBlurEditableSelectInput();
|
<|file_name|>ini.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import logging
import os
from ...platformdirs import user_config_dir
from ..info import PY3<|fim▁hole|>from .convert import convert
class IniConfig(object):
VIRTUALENV_CONFIG_FILE_ENV_VAR = ensure_str("VIR... | from ..util import ConfigParser
from ..util.path import Path
from ..util.six import ensure_str
|
<|file_name|>User.java<|end_file_name|><|fim▁begin|>package ru.otus.java_2017_04.golovnin.hw09;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity(name = "user")
@Table(name = "users")
public class User extends DataSet{
@Column(name = "name")
private Stri... | }
} |
<|file_name|>timestamps_test.py<|end_file_name|><|fim▁begin|># Copyright 2011 Google Inc.
#
# 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 2
# of the License, or (at your option)... | import os
import shutil
import tempfile |
<|file_name|>locations.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 Softwa... | |
<|file_name|>LinkageType3Choice.go<|end_file_name|><|fim▁begin|>package iso20022
// Choice of format for the linkage type.
type LinkageType3Choice struct {
// Linkage type expressed as an ISO 20022 code.
Code *LinkageType1Code `xml:"Cd"`
// Linkage type expressed as a proprietary code.<|fim▁hole|> Proprietary *Ge... | |
<|file_name|>motif-careful-splits-lean.rs<|end_file_name|><|fim▁begin|>extern crate timely;
extern crate alg3_dynamic;
use std::sync::{Arc, Mutex};
use std::io::BufReader;
use std::error::Error;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
use timely::dataflow::operators::*;
use alg3_dynamic::*;
... | panic!("EXCEPTION: couldn't open {}: {}",
Path::new(&p_str).display(),
Error::description(&why))
}, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.