prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>solr_test.py<|end_file_name|><|fim▁begin|>from optparse import OptionParser
import sys
from os.path import expanduser, abspath
import sunburnt
import dist_job_mgr.client as djm
QUERY_TERM="datablox"
def run_query(addresses):
master = addresses[0]
si = sunburnt.SolrInterface("http://%s:8983/solr"... | |
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Govisor Authors
//<|fim▁hole|>// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use file except in compliance with the License.
// You may obtain a copy of the license at
//
// http://www.apache.org/licenses/LIC... | |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016-present Open Networking Laboratory
*
* 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.ap... | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/ |
<|file_name|>SkScalerCacheTest.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "include/core/SkFont.h"
#include "include/core/SkTypeface.h"
#include "src/core/SkScalerCache.h"
#incl... | auto executor = SkExecutor::MakeFIFOThreadPool(kThreadCount);
for (int tries = 0; tries < 100; tries++) {
SkScalerContextEffects effects;
std::unique_ptr<SkScalerContext> ctx{ |
<|file_name|>reference_assoc.py<|end_file_name|><|fim▁begin|>import orange
data = orange.ExampleTable("lenses")
print "\nAssociation rules"
rules = orange.AssociationRulesInducer(data, support = 0.3)
for r in rules:
print "%5.3f %5.3f %s" % (r.support, r.confidence, r)
print "\nClassification rules"
rules = or... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
import urlparse
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.http.response import HttpResponseBadRequest
from .base import Mixin
from .. import strings
class SuccessURLAliasViewMixin(Mixin):
... | from_referer = urlparse.urlsplit(
request.META.get('HTTP_REFERER', '')).path
if referers is not None \ |
<|file_name|>history_traversal.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 script_thread::{CommonScriptMsg, MainThreadScri... | |
<|file_name|>color.test.js<|end_file_name|><|fim▁begin|>goog.provide('ol.test.color');
goog.require('ol.color');
describe('ol.color', function() {
describe('ol.color.asArray()', function() {
it('returns the same for an array', function() {
var color = [1, 2, 3, 0.4];
var got = ol.color.asArray(co... |
it('can parse rgba colors', function() { |
<|file_name|>SystemTrayIcon.hpp<|end_file_name|><|fim▁begin|>#pragma once
#include <MellowPlayer/Presentation/Notifications/ISystemTrayIcon.hpp>
#include <QMenu>
#include <QSystemTrayIcon>
namespace MellowPlayer::Domain
{
class ILogger;
class IPlayer;
class Setting;
class Settings;
}
class SystemTray... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! RustPN<|fim▁hole|>//! A stack-based scripting language.
extern crate num;
mod lex;
pub mod item;
pub mod parse;
pub mod vm;
pub mod builtin;<|fim▁end|> | //! |
<|file_name|>konm~es_k~om~es_.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | showWord(["n. ","Boutik, magazen, kote yo vann. Nan ri sa a, gen anpil konmès."
]) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># pylint: disable=missing-docstring<|fim▁hole|>from .cpython.testwith import *<|fim▁end|> | # pylint: disable=wildcard-import
from .test_mocks import *
from .cpython.testmock import * |
<|file_name|>assoc-types.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|>// except according to those terms.
#![crate_type="lib"]
// @has assoc_types/trait.I... | // 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. This file may not be copied, modified, or distributed |
<|file_name|>mainWindow.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# M4Baker
# Copyright (C) 2010 Kilian Lackhove
#
# 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 ... | self.updateTree()
#TODO: maybe it is smarter to add the chapter after current item? |
<|file_name|>pycapsule.rs<|end_file_name|><|fim▁begin|>use libc::{c_void, c_char, c_int};
use object::*;
#[cfg_attr(windows, link(name="pythonXY"))] extern "C" {
pub static mut PyCapsule_Type: PyTypeObject;
}
pub type PyCapsule_Destructor = unsafe extern "C" fn(o: *mut PyObject);
#[inline]
pub unsafe fn PyCapsul... | |
<|file_name|>GrupoEstudoTests.java<|end_file_name|><|fim▁begin|>package br.edu.fumep.entity;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
/**
* Created by arabasso on 09/05/2017.... | public void alunoEstaInseridoGrupo() { |
<|file_name|>netmiko_sh_arp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.
from netmiko import ConnectHandler
<|fim▁hole|>def main():
# Definition of routers
rtr1 = {
'device_type': 'cisco_ios',
'ip': '50... | |
<|file_name|>com_object.cpp<|end_file_name|><|fim▁begin|>#include "com_object.hpp"
#include <Windows.h>
namespace pw
{
com_object::com_object()
{
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
}
com_object::~com_object()
{<|fim▁hole|><|fim▁end|> | CoUninitialize();
}
} |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[cfg(test)]
mod tests {<|fim▁hole|><|fim▁end|> | #[test]
fn it_works() {
}
} |
<|file_name|>c00_wulala.js<|end_file_name|><|fim▁begin|>var casper = require('casper').create();
var utils = require('utils');<|fim▁hole|>
var x = require('casper').selectXPath;
casper.on("resource.error", function(resourceError) {
console.log('Unable to load resource (#' + resourceError.id + 'URL:' + resourceError.... |
// casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36'); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// ams - Advanced Memory Scanner
// Copyright (C) 2018 th0rex
//
// 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... | pub memory_region: MemoryRegion,
} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
const Base = require('yeoman-generator');
const generatorArguments = require('./arguments');<|fim▁hole|> constructor(args, options) {
super(args, options);
Object.keys(generatorArguments).forEach(key => this.argument(key, generatorArguments[key... | const generatorOptions = require('./options');
const generatorSteps = require('./steps');
module.exports = class ResponseGenerator extends Base { |
<|file_name|>assignment-operator-unimplemented.rs<|end_file_name|><|fim▁begin|>struct Foo;<|fim▁hole|>
fn main() {
let mut a = Foo;
let ref b = Foo;
a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo`
}<|fim▁end|> | |
<|file_name|>meshRefinementMerge.C<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web: ... | // Get the kept faces that need to be recalculated.
labelHashSet retestFaces(6*retestOldFaces.size());
const cellList& cells = mesh_.cells(); |
<|file_name|>test_play_iterator.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Found... | |
<|file_name|>viewer_controller.py<|end_file_name|><|fim▁begin|># Nessus results viewing tools
#
# Developed by Felix Ingram, f.ingram@gmail.com, @lllamaboy
# http://www.github.com/nccgroup/lapith
#
# Released under AGPL. See LICENSE for more information
import wx
import os
from model.Nessus import NessusFile,... | self.view.Bind(wx.EVT_TOOL, self.combine_files, id=ID_Merge_Files)
self.view.Bind(wx.EVT_TOOL, self.generate_csv, id=ID_Generate_CSV)
|
<|file_name|>class_example.py<|end_file_name|><|fim▁begin|>class Friend:
def walk(self,shravan=""):
'''
>>> Friend().walk()
walking
'''
print "walking",
def talk(self):
print "talking",
def fight(self):
print "fighting",<|fim▁hole|>f1=Friend()
f1.walk()
import doctest
doctest.testmod()<|fim▁en... | |
<|file_name|>upload.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, subprocess, hashlib, shutil, glob, stat, sys, time
from subp... | |
<|file_name|>switch.rs<|end_file_name|><|fim▁begin|>use core::sync::atomic::Ordering;
use arch;
use super::{contexts, Context, Status, CONTEXT_ID};
/// Switch to the next context<|fim▁hole|>///
/// Do not call this while holding locks!
pub unsafe fn switch() -> bool {
use core::ops::DerefMut;
// Set the glob... | ///
/// # Safety |
<|file_name|>myAirSimClient.py<|end_file_name|><|fim▁begin|>import numpy as np
import time
import math
import cv2
from pylab import array, arange, uint8
from PIL import Image
import eventlet
from eventlet import Timeout
import multiprocessing as mp
# Change the path below to point to the directoy where you installed t... | from AirSimClient import *
class myAirSimClient(MultirotorClient): |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::fs;
use std::io::prelude::*;
use std::net::TcpListener;
use std::net::TcpStream;
use std::thread;
use std::time::Duration;
use web_server::ThreadPool;
fn main() {
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
let pool = ThreadPool::new... | stream.read(&mut buffer).unwrap();
let get = b"GET / HTTP/1.1\r\n";
let sleep = b"GET /sleep HTTP/1.1\r\n"; |
<|file_name|>test_mariofile.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# python 2 support via python-future
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import dict
import os
import pytest
from mariobros import mariofile
SIMPLE_MARIOFILE = """[sectio... | 'target_pattern': '',
'task_cmd': 'task_command', |
<|file_name|>storage-gen.go<|end_file_name|><|fim▁begin|>// Package storage provides access to the Cloud Storage JSON API.
//
// See https://developers.google.com/storage/docs/json_api/
//
// Usage example:
//
// import "google.golang.org/api/storage/v1"
// ...
// storageService, err := storage.New(oauthHttpClien... | func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} |
<|file_name|>char.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... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed |
<|file_name|>0091_auto_20180727_1844.py<|end_file_name|><|fim▁begin|># Generated by Django 1.11.11 on 2018-07-27 18:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0090_degree_curriculum_reset'),
]
operations = [
... | |
<|file_name|>PAYBYCREDITCARDPROJECTION.java<|end_file_name|><|fim▁begin|>/**
* This class is generated by jOOQ
*/
package com.aviafix.db.generated.tables.pojos;
import java.io.Serializable;
import java.time.LocalDate;
import javax.annotation.Generated;
/**
* This class is generated by jOOQ.
*/
@Generated(
... | |
<|file_name|>fixhtml.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
""" Quick helper to add HTML5 DOCTYPE and <title> to every testcase. """
import os
import re
import sys
def fixhtml(folder):
changed = 0
for dirpath, _, filenames in os.walk(folder):
for file in filenames:
name, ex... | f.write(shouldbe + content)
return changed
|
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Package bingo is a pastebin-like where the server has zero knowledge of pasted data.
// Data is encrypted/decrypted in the browser using AES.<|fim▁hole|><|fim▁end|> | package bingo |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Tests for Dynamo3 """
import sys
import unittest
from decimal import Decimal
from pickle import dumps, loads
from urllib.parse import urlparse
from botocore.exceptions import ClientError
from mock import ANY, MagicMock, patch
from dynamo3 import (
Binary,... | def test_bool(self):
"""Store and retrieve a boolean"""
self.make_table()
self.dynamo.put_item("foobar", {"id": "abc", "b": True}) |
<|file_name|>autobind.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/licens... | // except according to those terms. |
<|file_name|>0006_eventcalander.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-25 12:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('venue', '0005_auto_20170916_... | ] |
<|file_name|>qgswmsgetcapabilities.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
qgswmsgetmap.h
-------------------------
begin : December 20 , 2016
copyright : (C) 2... | QDomElement styleNameElem = doc.createElement( QStringLiteral( "Name" ) ); |
<|file_name|>TSRRobot.cpp<|end_file_name|><|fim▁begin|>/***********************************************************************
Copyright (c) 2014, Carnegie Mellon University
All rights reserved.
Authors: Jennifer King <jeking04@gmail.com>
Redistribution and use in source and binary forms, with or without
modificati... | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
<|file_name|>Constants.java<|end_file_name|><|fim▁begin|>package io.omengye.common.utils.constants;
public class Constants {
private Constants(){}
public static final String RESULT_FLAG = "flag";<|fim▁hole|><|fim▁end|> |
} |
<|file_name|>deferred.js<|end_file_name|><|fim▁begin|>/*
* aem-sling-contrib
* https://github.com/dherges/aem-sling-contrib
*
* Copyright (c) 2016 David Herges
* Licensed under the MIT license.
*/
define([
"./core",
"./var/slice",
"./callbacks"
], function( jQuery, slice ) {
jQuery.extend({
Deferred: funct... | for ( ; i < length; i++ ) {
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
resolveValues[ i ].promise()
.done( updateFunc( i, resolveContexts, resolveValues ) ) |
<|file_name|>visualization.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# Modified from https://github.com/tylerneylon/explacy
import io
from collections import defaultdict
from pprint import pprint
from phrasetree.tree import Tree
def make_table(rows, insert_header=False):
col_widths = [max(len(s) for... | right_rule = {'<': '-', '^': ':', '>': ':'}
|
<|file_name|>insertVsColonZero.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from time import time
REPS = 17500
def insert():
m = [None]
i = 0
now = time()
while i < REPS:
m.insert(0, i)
i += 1
print 'Elapsed (insert):', time() - now
def colonZero():
m = [None]<|fim▁hole|> i = 0
... | |
<|file_name|>images.py<|end_file_name|><|fim▁begin|>from rewpapi.common.http import Request
from rewpapi.listings.listing import ListingResidential
class RemoteListingImages(Request):
def __init__(self, base_site, auth, listing_type, listing_uuid):
super(RemoteListingImages, self).__init__(auth)
s... | |
<|file_name|>linkintegrity.py<|end_file_name|><|fim▁begin|>from castle.cms.interfaces import IReferenceNamedImage
from plone.app.uuid.utils import uuidToObject
from persistent.mapping import PersistentMapping
from persistent.dict import PersistentDict
from lxml.html import fromstring
from lxml.html import tostring
from... | li.updateReferences(obj, refs) |
<|file_name|>id_test.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2017 Google 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/LICENSE-2.... | assert.For("id").That(str).Equals(sampleIDString)
}
func TestParseID(t *testing.T) { |
<|file_name|>test_pool_upgrade_no_loop_reinstall.py<|end_file_name|><|fim▁begin|>from copy import deepcopy
import pytest
from sovrin_node.test import waits
from stp_core.loop.eventually import eventually
from plenum.common.constants import VERSION
from sovrin_common.constants import REINSTALL
from sovrin_node.test.u... | import sovrin_node
|
<|file_name|>cb_balance_grabber.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import requests, json
from os.path import expanduser<|fim▁hole|>accounts = client.get_accounts()
print accounts ['data'][0]['balance']<|fim▁end|> |
from coinbase.wallet.client import Client
home = expanduser('~')
client = Client('YOUR_API_KEY', 'YOUR_API_SECRET') |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>from django.conf import settings
BACKEND_CLASS = getattr(
settings, "COURRIERS_BACKEND_CLASS", "courriers.backends.simple.SimpleBackend"
)
MAILCHIMP_API_KEY = getattr(settings, "COURRIERS_MAILCHIMP_API_KEY", "")
MAILJET_API_KEY = getattr(settings, "COURRIERS... |
PAGINATE_BY = getattr(settings, "COURRIERS_PAGINATE_BY", 9) |
<|file_name|>eggwriter.py<|end_file_name|><|fim▁begin|>"""
Writes Python egg files.
Supports what's needed for saving and loading components/simulations.
"""
import copy
import os.path
import re
import sys
import zipfile
import pkg_resources
from openmdao.util import eggobserver
__all__ = ('egg_filename', 'write')
... | |
<|file_name|>reducer.js<|end_file_name|><|fim▁begin|>import {makeInstanceAction} from '#/main/app/store/actions'
import {makeReducer} from '#/main/app/store/reducer'
import {makeFormReducer} from '#/main/app/content/form/store/reducer'
import {RESOURCE_LOAD} from '#/main/core/resource/store/actions'
import {selectors... | const reducer = { |
<|file_name|>io_aggfile.py<|end_file_name|><|fim▁begin|>"""
Module which groups all the aggregated precomputed information in order to
save computational power.
"""
import pandas as pd<|fim▁hole|>
def read_agg(filepath):
"Read file of aggregated info."
table = pd.read_csv(filepath, sep=';')
table = cp2str... | from FirmsLocations.Preprocess.preprocess_cols import cp2str |
<|file_name|>key_tests.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2012-2013 The Bitcoin Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "key.h"
#include "base58.h"
#include "script/script.h"
... | CKey key2 = bsecret2.GetKey();
BOOST_CHECK(key2.IsCompressed() == false); |
<|file_name|>coord_bounds.py<|end_file_name|><|fim▁begin|>''' Work of Cameron Palk '''
import sys
import pandas as pd
def main( argv ):
try:
csv_filepath = argv[ 0 ]
output_filepath = argv[ 1 ]
except IndexError:
print( "Error, usage: \"python3 coord_bounds.py <CSV> <output_file>\"" ) <|fim▁hole|>
training... | return |
<|file_name|>diskmetricstore.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Prometheus 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/LIC... | } |
<|file_name|>enforcer_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2017 Google 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/lice... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package logging
import (
"fmt"
"os"
"time"
"github.com/op/go-logging"
)
const (
size = 1024
)
var (
Log *CTopLogger
exited bool
level = logging.INFO // default level
format = logging.MustStringFormatter(
`%{color}%{time:15:04:05.000} ▶ %{level:.4s} %{... | logging.SetBackend(backendLvl) |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | # which most machines do not provide and crash the build
parallel = False
|
<|file_name|>Clip.ts<|end_file_name|><|fim▁begin|>import * as uuid from 'uuid'
import { AvailableRenderer } from '../Engine/Renderer'
import { Branded } from '../helper/Branded'
import { safeAssign } from '../helper/safeAssign'
import { Animatable } from './Animatable'
import { Effect } from './Effect'
interface ClipP... | |
<|file_name|>tables.py<|end_file_name|><|fim▁begin|># import json
# import pandas as pd
import numpy as np
import os
from core.lda_engine import model_files
from pandas import DataFrame
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from core.keyword_db import keyword_dbs
def db_connect(... | DA = DataFrame(tmpt.fetchall(), columns=list(tmpt.keys()))
Key_Freq = '''
select keywords.id, keyword, freqency |
<|file_name|>http_transport_test_server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
# Copyright 2014 The Crashpad 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 obta... | return int(chunk_size_and_ext_line[:chunk_size_end], base=16) |
<|file_name|>clientscriptAPI.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
get_server_fields = function(method, arg, table_field, doc, dt, dn, allow_edit, call_back) {
frappe.dom.freeze();
if($.isPlainObject(arg)) arg = JSON.s... | refresh_field(key, d.name, table_field);
else |
<|file_name|>test_business_quarter.py<|end_file_name|><|fim▁begin|>"""
Tests for the following offsets:
- BQuarterBegin
- BQuarterEnd
"""
from __future__ import annotations
from datetime import datetime
import pytest
from pandas._libs.tslibs.offsets import QuarterOffset
from pandas.tests.tseries.offsets.common impo... | datetime(2008, 4, 15): datetime(2008, 4, 1),
datetime(2007, 7, 3): datetime(2007, 7, 2),
datetime(2007, 4, 3): datetime(2007, 4, 2),
datetime(2007, 7, 2): datetime(2007, 4, 2), |
<|file_name|>balanced_resource_allocation.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/license... | |
<|file_name|>tslint-json.ts<|end_file_name|><|fim▁begin|>/**
* This module defines the `tslint-json` project task.
*
* @module project-tasks/tslint-json
* @internal
*/
/** (Placeholder comment, see TypeStrong/typedoc#603) */
import { Furi, join as furiJoin } from "furi";
import Undertaker from "undertaker";<|fim... | import { DEFAULT_UNTYPED_TSLINT_CONFIG } from "../options/tslint";
import { ResolvedProject } from "../project"; |
<|file_name|>MultiLineString.js<|end_file_name|><|fim▁begin|>/**
* @module ol/geom/MultiLineString
*/
import {extend} from '../array.js';
import {closestSquaredDistanceXY} from '../extent.js';
import GeometryLayout from '../geom/GeometryLayout.js';
import GeometryType from '../geom/GeometryType.js';
import LineString... | getFlatMidpoints() {
const midpoints = [];
const flatCoordinates = this.flatCoordinates; |
<|file_name|>application.rs<|end_file_name|><|fim▁begin|>//! This module contains the base elements of an OrbTk application (Application, WindowBuilder and Window).
use std::sync::mpsc;<|fim▁hole|>use crate::{
core::{application::WindowAdapter, localization::*, *},
shell::{Shell, ShellRequest},
};
/// The `Ap... |
use dces::prelude::Entity;
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($){
//check if the .cd-image-container is in the viewport
//if yes, animate it
checkPosition($('.cd-image-container'));
$(window).on('scroll', function(){
checkPosition($('.cd-image-container'));
});
... | var actual = $(this);
updateLabel(actual.find('.cd-image-label[data-type="modified"]'), actual.find('.cd-resize-img'), 'left'); |
<|file_name|>code2seq_dataset.py<|end_file_name|><|fim▁begin|># Copyright 2021 Google 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/LICENSE-2.0
#... | _URLS_SMALL = { |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>module.exports = function(config) {
config.set({
basePath: '../../',
frameworks: ['jasmine', 'requirejs'],
files: [
{pattern: 'test/unit/require.conf.js', included: true},
{pattern: 'test/unit/tests/global.js'... | 'src/client/component/**/*.js': ['coverage'], |
<|file_name|>deluged_client.py<|end_file_name|><|fim▁begin|># Author: Paul Wollaston
# Contributions: Luke Mullan
#
# This client script allows connection to Deluge Daemon directly, completely
# circumventing the requirement to use the WebUI.
import json
from base64 import b64encode
import sickbeard
from sickbeard im... |
def set_torrent_path(self, torrent_id, path):
try: |
<|file_name|>_load_balancer_network_interfaces_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for lice... | |
<|file_name|>mockCartData.ts<|end_file_name|><|fim▁begin|>export const data = [
{
id: "DBS0238532",
name: "γS13",
fee: "$30.00",
},
{
id: "DBS0238534",
label: "γS14",
fee: "$30.00",<|fim▁hole|> {
id: "502",
name: "(Myc)2-apm1",
fee: "$15.00",
},
]<|fim▁end|> | }, |
<|file_name|>0.py<|end_file_name|><|fim▁begin|># - Coding UTF8 -
#
# Networked Decision Making
# Site: http://code.google.com/p/global-decision-making-system/
#
# License Code: GPL, General Public License v. 2.0
# License Content: Creative Commons Attribution 3.0
#
# Also visit: www.web2py.com
# or Groups: ... | #globaldecisionmaking will use google - for some reason Janrain doesn't seem
#to come up with google as a login and google login does not support dual methods
#reason for which has not been investigated |
<|file_name|>guard.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/. */
//! Machinery to conditionally expose things.
use js::jsapi::{... | |
<|file_name|>System.js<|end_file_name|><|fim▁begin|>"use strict";
tutao.provide('tutao.entity.sys.System');
/**
* @constructor
* @param {Object=} data The json data to store in this entity.
*/
tutao.entity.sys.System = function(data) {
if (data) {
this.updateData(data);
} else {
this.__format = "0";
... | }; |
<|file_name|>test_streams.py<|end_file_name|><|fim▁begin|># Copyright 2020 ScyllaDB
#
# This file is part of Scylla.
#
# Scylla 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 Li... | # If we're still here, the last compare_events returned false.
pytest.fail('missing events in output: {}'.format(output))
|
<|file_name|>basic.rs<|end_file_name|><|fim▁begin|>extern crate jade;
<|fim▁hole|><|fim▁end|> |
#[test]
fn test_basic_template() {
} |
<|file_name|>BrowserMain.cpp<|end_file_name|><|fim▁begin|>// Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
// $HeadURL$
// $Id$
// 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... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 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 c... | @classmethod
def setUpClass(cls):
super(BaseIdentityAdminTest, cls).setUpClass() |
<|file_name|>connection_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <utility>
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory... | OnConnectionAuthenticating(host_connection_.get()));
EXPECT_CALL(host_event_handler_,
OnConnectionAuthenticated(host_connection_.get())); |
<|file_name|>regex_with_defaults.py<|end_file_name|><|fim▁begin|>"""Get a `re.Pattern` instance (as given by re.compile()) with control over defaults of it's methods.
Useful to reduce if/else boilerplate when handling the output of search functions (match, search, etc.)
See [regex_search_hack.md](https://gist.github.co... | >>> p.findall('I am beating around the bush, am I?')
['bush']
""" |
<|file_name|>setup_pre_context.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import sys
import os
sys.path.insert(0, os.environ["QUEX_PATH"])
from copy import deepcopy
from quex.core_engine.state_machine.core import *
import quex.core_engine.state_machine.nfa_to_dfa as nfa_to_dfa
import quex.core_engine.sta... | the_state_machine.core().set_pre_context_sm(inverse_pre_context)
pre_context_sm_id = inverse_pre_context.get_id() |
<|file_name|>offline-saver-admin.js<|end_file_name|><|fim▁begin|>(function( $ ) {
'use strict';
/**
* All of the code for your admin-facing JavaScript source
* should reside in this file.
*
* This enables you to define handlers, for when the DOM is ready:
*<|fim▁hole|> * When the window is loaded:
*
*... | * $(function() {
*
* });
* |
<|file_name|>BenderSolution.java<|end_file_name|><|fim▁begin|>package medium_challenges;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class BenderSolution {
public static void main(String args[]) {
@SuppressWarnings("resource")
Scanner in = new Scanner(System.in);
... |
/** Direction enum includes the ability to find next node based on direction Bender is facing.
*/
private enum Direction { |
<|file_name|>musicbox.py<|end_file_name|><|fim▁begin|>import sys, struct, array
import SocketServer
# import StringIO as StringIO
# import pygame
p = 0x08d682598db70a889ff1bc7e3e00d602e9fe9e812162d4e3d06954b2ff554a4a21d5f0aab3eae5c49ac1aec7117709cba1b88b79ae9805d28ddb99be07ba05ea219654afe0c8dddac7e73165f3dcd851a3c8a3b... | def handle(self): |
<|file_name|>RefsetDtoShort.java<|end_file_name|><|fim▁begin|>package com.ihtsdo.snomed.model.xml;
import java.sql.Date;
import javax.xml.bind.annotation.XmlRootElement;
import com.google.common.base.Objects;
import com.google.common.primitives.Longs;
import com.ihtsdo.snomed.dto.refset.RefsetDto;
import com.ihtsdo.... | |
<|file_name|>wasm-module.wasm.spec.ts<|end_file_name|><|fim▁begin|>import * as path from "path";
import * as fs from "fs";
import {compileWasmSync} from "./utils/utils";
import {WasmModule} from "../src/backends/webassembly/wasm/wasm-module";
test('wasm-module', () => {
compileWasmSync(path.join(__dirname, 'wasm-m... | }); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Init and utils."""
from zope.i18nmessageid import MessageFactory
_ = MessageFactory('dakhli.sitecontent')<|fim▁hole|>def initialize(context):
"""Initializer called when used as a Zope 2 product."""<|fim▁end|> | |
<|file_name|>GPSSensor.hpp<|end_file_name|><|fim▁begin|>/*
Copyright_License {
G-Meter INU.
Copyright (C) 2013-2015 Peter F Bradshaw
A detailed list of copyright holders can be found in the file "AUTHORS".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Gen... | * @return The acceleration in meters per second per second.
*/
double A() const;
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() {
for x in 1..10 {
println!("{}", x);
}
// An iterator is something that we can call the .next() method on repeatedly,
// and it gives us a sequence of things.
let mut num_range = 0..5;
loop {
match num_range.next() {
Some(x) => {... | // with references, we're just borrowing a reference to the data,
// and so it's just passing a reference, without needing to do the move. |
<|file_name|>unordered_rules.py<|end_file_name|><|fim▁begin|>"""
Sponge Knowledge Base
Using unordered rules
"""
from java.util.concurrent.atomic import AtomicInteger
from org.openksavi.sponge.examples import SameSourceJavaUnorderedRule
from org.openksavi.sponge.core.library import Deduplication
def onInit()... | self.withAllConditions([
|
<|file_name|>t.py<|end_file_name|><|fim▁begin|><|fim▁hole|># !/usr/bin/env python
# -*-coding:utf-8-*-
# by huangjiangbo
# 部署服务
# deploy.py
from ConfigParser import ConfigParser
ConfigFile = r'config.ini' # 读取配置文件
config = ConfigParser()
config.read(ConfigFile)
de_infos = config.items(r'deploy_server') # 远程部署服务器信息
r... | |
<|file_name|>le.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Converts the array to mutable slice
// fn as_mut_slice(&m... | //
// #[unstable(feature = "array_as_ref",
// reason = "should ideally be implemented for all fixed-sized arrays")]
// impl<T> AsMut<[T]> for [T; $N] { |
<|file_name|>simple.cpp<|end_file_name|><|fim▁begin|>#include "t05.h"
#include <iostream>
int main(int argc, char* argv[])
{
RibbonTrail a;
<|fim▁hole|><|fim▁end|> | std::cout << "done" << std::endl;
} |
<|file_name|>ce_file_copy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... |
full_path = file_system + dst |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.