prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>logger.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import string
import json
import config
import helper
import busses
def log_message(msg):
#log format: time type message
time_str = str(time.time())
line = time_str[:time_str.f... | appendix = appendix.replace("\n", "\\n").rjust(40, str(" ")) |
<|file_name|>cdgdec.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2019 Guillaume Desmottes <guillaume.desmottes@collabora.com>
//
// 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/MI... | // Pull the sample in question out of the appsink's buffer.
let sample = appsink.pull_sample().map_err(|_| gst::FlowError::Eos)?;
let buffer = sample.get_buffer().ok_or(gst::FlowError::Error)?; |
<|file_name|>AnnotateStatsProcCtx.java<|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
* ... | |
<|file_name|>CheckedCastBrJumpThreading.cpp<|end_file_name|><|fim▁begin|>#define DEBUG_TYPE "sil-simplify-cfg"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "swift/SIL/SILInstruction.h"
#include "swift/SILOptimizer/Analysis/DominanceAnalysis.h"
#include "swift/SILOptimizer/Utils/CFG.h"
#i... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# romeo documentation build configuration file, created by
# sphinx-quickstart on Sat Dec 19 15:51:40 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values... | #'pointsize': '10pt',
|
<|file_name|>coord.js<|end_file_name|><|fim▁begin|>PUMP_SELECTOR.CoordSlicer = function( parameters ) {
var image = parameters.image;
var coord = parameters.coord;
var name = parameters.name;
var obj = {};
if( image === undefined) {
//PUMPER.debug("PUMPER::CoordSlicer() - Cannot sli... | |
<|file_name|>bitcoin_et.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="et" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Mercury</source>
<translation type="unfinished"... | <message>
<location line="+1"/>
<source>Cannot write default address</source> |
<|file_name|>encode.go<|end_file_name|><|fim▁begin|>// Copyright 2011 The Snappy-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 snappy
import (
"encoding/binary"
"io"
)
// We limit how far copy back-references can go,... | wroteHeader bool |
<|file_name|>volk_register.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import sys
import os
import re
import string
from xml.dom import minidom
from volk_regexp import *
from make_cpuid_c import make_cpuid_c
from make_cpuid_h import make_cpuid_h
from make_set_simd import make_set_simd
from make_config_fixed... | outfile_config_fixed.write(make_config_fixed(filearchs));
outfile_config_fixed.close();
outfile_typedefs.write(make_typedefs(functions, retlist, my_argtypelist)); |
<|file_name|>pcspeaker_pl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pl" version="2.1">
<context>
<name>@default</name>
<message>
<source>PC Speaker</source>
<translation>PC Speaker</translation>
</message>
</context>
<context><|fim▁hole|> <transl... | <name>PCSpeakerConfigurationWidget</name>
<message>
<source>Put the played sounds separate by space, _ for pause, eg. D2 C1# G0</source> |
<|file_name|>FileLogger.java<|end_file_name|><|fim▁begin|>import java.io.BufferedWriter;<|fim▁hole|>import java.io.IOException;
public class FileLogger extends MyLoggerImpl {
private String fileName;
public FileLogger(String fileName) {
super();
this.fileName = fileName;
}
@Override
public void log(int le... | import java.io.File;
import java.io.FileWriter; |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-<|fim▁hole|>class Model(SqlBaseModel):
def __init__(self):
super(Model, self).__init__(db_name='blog')
Base = Model().Base<|fim▁end|> | from models.base import SqlBaseModel
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""Tests for the canary component."""
from unittest.mock import MagicMock, PropertyMock
from canary.api import SensorType
def mock_device(device_id, name, is_online=True, device_type_name=None):
"""Mock Canary Device class."""
device = MagicMo... | |
<|file_name|>auth.js<|end_file_name|><|fim▁begin|>'use strict';
var os = require('os');
// expose our config directly to our application using module.exports
module.exports = {
'twitterAuth' : {
'consumerKey' : process.env.TWITTER_CONSUMER_KEY || 'unknown',
'consumerSecret' : process.env.TWITTER_CONSUM... | }; |
<|file_name|>dummy.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 WNProject Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be<|fim▁hole|>#include "hashing/inc/hash.h"<|fim▁end|> | // found in the LICENSE file.
// Intentionally left empty so that we can build a lib target for this library
|
<|file_name|>minibuf.rs<|end_file_name|><|fim▁begin|>//! Minibuffer input and completion.
use remacs_macros::lisp_fn;
use crate::{
buffers::{current_buffer, LispBufferOrName},
editfns::field_end,
eval::unbind_to,
keymap::get_keymap,
lisp::LispObject,
lists::{car_safe, cdr_safe, memq},
mult... |
/// Return the prompt string of the currently active
/// minibuffer. If no minibuffer is active return nil.
#[lisp_fn] |
<|file_name|>dismantling.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { SharedModule } from '../../shared/shared.module';
import { DismantlingRoutingModule } from './dismantling-routing.module';
import { DismantlingHomeComponent } from './dismantling-home/dismantling-home.com... | |
<|file_name|>IssueHistory.java<|end_file_name|><|fim▁begin|>/*
* Property of RECAPT http://recapt.com.ec/
* Chief Developer Ing. Eduardo Alfonso Sanchez eddie.alfonso@gmail.com
*/
package com.recapt.domain;
import java.time.LocalDateTime;
/**
*
* @author Eduardo
*/
public class IssueHistory {
private Strin... |
public void setDescription(String description) { |
<|file_name|>types.generated.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... | func (x *HorizontalPodAutoscalerStatus) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer1234
z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r |
<|file_name|>modifyexperience.js<|end_file_name|><|fim▁begin|>(function (badges, $, undefined) {
"use strict";
var options = {}, geocoder, map, marker;
badges.options = function (o) {
$.extend(options, o);
};
badges.init = function () {
initializeTypeahead();
i... | } else {
alert('Geocode was not successful for the following reason: ' + status);
}
|
<|file_name|>dependencies.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import os
import json
import requests
# Plan is to import and to checkout dependencies:<|fim▁end|> | import time |
<|file_name|>ufunc_db.py<|end_file_name|><|fim▁begin|>"""This file contains information on how to translate different ufuncs
into numba. It is a database of different ufuncs and how each of its
loops maps to a function that implements the inner kernel of that ufunc
(the inner kernel being the per-element function).
Us... |
ufunc_db[np.arccosh] = {
'f->f': npyfuncs.np_real_acosh_impl, |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict"
var express = require('express');
var app = express();
var elasticsearch = require('elasticsearch');
var client = new elasticsearch.Client({
host: 'localhost:9200',
log: 'trace'
});
var router = express.Router();
router.get('/accidents', function(req,... | var response = resp.hits.hits.map(function(e){ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .wiki import * |
<|file_name|>debuginfo.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/... | |
<|file_name|>renderer.js<|end_file_name|><|fim▁begin|>const fs = require('fs');
const electron = require('electron');
const cl = require('node-opencl');
const RUN_GAMELOOP_SYNC = true;
const GAMETICK_CL = true;
const INIT_OPENGL = false;
let canvas; // canvas dom element
let gl; // opengl context
let clCtx; ... | process.stdout.write('gametick cl 2\n');
cl.enqueueReadBuffer(clQueue, clBufferImageData, true, 0, imageData.byteLength, imageData); |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>import sys
import json
import flask
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.cors import origin
from parse import ProfileParser, IHMEParser
from flask import render_template
from flask import Response
from werkzeug.contrib.fix... | ])
return Response( |
<|file_name|>NotifyD7Networks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2019 Chris Caron <lead2gold@gmail.com>
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and a... | 'Authorization': 'Basic {}'.format(base64.b64encode(auth))
}
|
<|file_name|>rabbit.go<|end_file_name|><|fim▁begin|>package cmd
import (
"fmt"
"time"
"github.com/spf13/cobra"
"github.com/streadway/amqp"
)
// rabbitCmd represents the rabbit command
var rabbitCmd = &cobra.Command{
Use: "rabbit",
Short: "A brief description of your command",
Run: func(cmd *cobra.Command, a... | nil, //arguements |
<|file_name|>export.py<|end_file_name|><|fim▁begin|>from flask import Blueprint
from flask import flash
from flask import make_response, render_template
from flask_login import current_user
from markupsafe import Markup
from app.helpers.data_getter import DataGetter
from app.helpers.auth import AuthManager
from app.he... | 'gentelella/admin/event/export/export.html', event=event, export_jobs=export_jobs,
current_user=user
)
|
<|file_name|>link_functions.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2015 The GPy authors (see AUTHORS.txt)
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
import scipy
from ..util.univariate_Gaussian import std_norm_cdf, std_norm_pdf
import scipy as sp
from ..util.misc impor... | |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) Dag Henning Liodden Sørbø <daghenning@lioddensorbo.com>
*
* 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.
*
... | |
<|file_name|>AshtaVargaChartData.java<|end_file_name|><|fim▁begin|>/**
* AshtavargaChartData.java
* Created On 2006, Mar 31, 2006 5:12:23 PM
* @author E. Rajasekar
*/
package app.astrosoft.beans;
import java.util.EnumMap;
import app.astrosoft.consts.AshtavargaName;
import app.astrosoft.consts.AstrosoftTableColum... | }; |
<|file_name|>hashsplit.py<|end_file_name|><|fim▁begin|>import math, os
from bup import _helpers, helpers
from bup.helpers import sc_page_size
_fmincore = getattr(helpers, 'fmincore', None)
BLOB_MAX = 8192*4 # 8192 is the "typical" blob size for bupsplit
BLOB_READ_SIZE = 1024*1024
MAX_PER_TREE = 256
progress_callba... | if ofs:
if ofs > BLOB_MAX: |
<|file_name|>ua_utils.py<|end_file_name|><|fim▁begin|>"""
Usefull method and classes not belonging anywhere and depending on opcua library
"""
from dateutil import parser
from datetime import datetime
from enum import Enum, IntEnum
import uuid
from opcua import ua
from opcua.ua.uaerrors import UaError
def val_to_st... |
return basetypes
|
<|file_name|>HelpDialog.js<|end_file_name|><|fim▁begin|>/*
* ../../../..//localization/fr/HelpDialog.js
*
* Copyright (c) 2009-2018 The MathJax Consortium
*
* 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... | /*************************************************************
*
* MathJax/localization/fr/HelpDialog.js |
<|file_name|>PackagePool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: iso-8859-2 -*-
import string
import copy
import os
import gzip
import gtk
import commands
try:
from backports import lzma
except ImportError:
from lzma import LZMAFile as lzma
import singletons
from common import *
i... | file = lzma.open(source.hdlist) |
<|file_name|>migrateToPostgres.ts<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Matrix.org Foundation C.I.C.
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/... | log.info("Starting roomMigrations");
await roomMigrations();
log.info("Finished roomMigrations");
log.info("Starting slackUserMigrations"); |
<|file_name|>exercise.rs<|end_file_name|><|fim▁begin|>use regex::Regex;
use serde::Deserialize;
use std::fmt::{self, Display, Formatter};
use std::fs::{remove_file, File};
use std::io::Read;
use std::path::PathBuf;
use std::process::{self, Command, Output};
const RUSTC_COLOR_ARGS: &[&str] = &["--color", "always"];
con... | name: "pending_exercise".into(),
path: PathBuf::from("tests/fixture/state/pending_exercise.rs"), |
<|file_name|>Li2_atomize.py<|end_file_name|><|fim▁begin|>import os
from ase.structure import molecule
from ase.io import read, write
from ase.parallel import rank
from gpaw import GPAW, restart
import warnings
# cmr calls all available methods in ase.atoms detected by the module inspect.
# Therefore also deprecated ... | h = 0.20
|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from './keep';
export * from './room';
<|fim▁hole|><|fim▁end|> | export * from './thing';
export * from './thingType'; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod account;
pub mod data;
pub mod default;
pub mod func;
// pub use crate::account::{Account, BankDetail, Position, Trade, Transfer, Order, QIFI};
// pub use crate::data::{Bar, DataItem, Tick, L2X};<|fim▁hole|><|fim▁end|> | // pub use crate::func::{from_bson_, from_serde_value, from_str, from_string, to_doc};
// |
<|file_name|>11_only_specific_values.rs<|end_file_name|><|fim▁begin|>extern crate clap;
use clap::{App, Arg};
fn main() {
// If you have arguments of specific values you want to test for, you can use the
// .possible_values() method of Arg
//
// This allows you specify the valid values for that argum... | }
} |
<|file_name|>test_plugins.py<|end_file_name|><|fim▁begin|>import imp
import os.path
import pkgutil
import six
import unittest
import streamlink.plugins
from streamlink import Streamlink
class PluginTestMeta(type):
def __new__(mcs, name, bases, dict):
plugin_path = os.path.dirname(streamlink.plugins.__fi... | session.plugins[pname].can_handle_url("http://test.com")
return load_plugin_test
|
<|file_name|>touch.js.uncompressed.js<|end_file_name|><|fim▁begin|><|fim▁hole|>oid sha256:1668f227ab9bbb326809d8430e0c9d1105688b38b177ab927f0528eb9593a652
size 7357<|fim▁end|> | version https://git-lfs.github.com/spec/v1 |
<|file_name|>and.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Strahinja Val Markovic
//
// 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-... | assert_eq!( parse_state, orig_state );
}
_ => panic!( "No match." )
} |
<|file_name|>TabsSpec.js<|end_file_name|><|fim▁begin|>import React from 'react';
import ReactTestUtils from 'react/lib/ReactTestUtils';
import ReactDOM from 'react-dom';
import Nav from '../src/Nav';
import NavItem from '../src/NavItem';
import Tab from '../src/Tab';
import TabPane from '../src/TabPane';
import Tabs f... | </Tabs>
); |
<|file_name|>LineComment.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 Raquel Pau and Albert Coroleu.
*
* Walkmod 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, either version 3 of
* th... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .net import Net |
<|file_name|>ko.rs<|end_file_name|><|fim▁begin|>/************************************************************************
* *
* Copyright 2014 Urban Hafner, Thomas Poinsot *
* Copyright 2015 Urban Hafner, Igor Polyakov ... | use std::path::Path; |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict';
var angular = require('angular');
var angularMessages = require('angular-messages');
var satellizer = require('satellizer');
var material = require('angular-material');
angular.module('sheltrApp', [
require('angular-ui-router'),
require('./controllers'... | |
<|file_name|>appointment_form.js<|end_file_name|><|fim▁begin|>function appointment(input)
{
Ti.include('/ui/common/helpers/dateTime.js');
Ti.include('/ui/common/database/users_db.js');
Ti.include('/ui/common/database/children_db.js');
Ti.include('/ui/common/database/relationships_db.js');
Ti.include('/ui/common/da... |
modalPicker.showDatePickerDialog({
value: new Date(date.text), |
<|file_name|>BigQueryColumnMetadataReader.java<|end_file_name|><|fim▁begin|>package com.exasol.adapter.dialects.bigquery;
import java.sql.Connection;
import java.sql.Types;
import com.exasol.adapter.AdapterProperties;
import com.exasol.adapter.dialects.IdentifierConverter;
import com.exasol.adapter.jdbc.BaseColumnMet... | * @param properties user-defined adapter properties |
<|file_name|>20141017-permalinks.py<|end_file_name|><|fim▁begin|>from redwind import app, db, util
from redwind.models import Post
import itertools
db.engine.execute('alter table post add column historic_path varchar(256)')
db.engine.execute('update post set historic_path = path')
for post in Post.query.all():<|fim▁h... | print(post.historic_path)
if not post.slug:
post.slug = post.generate_slug() |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015-2020 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesse... | // This library 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 GNU |
<|file_name|>network.js<|end_file_name|><|fim▁begin|>exports.netCheck = function() {
var url = "http://api.openbeerdatabase.com/v1/beers.json";
var client = Ti.Network.createHTTPClient({<|fim▁hole|> var data = JSON.parse(this.responseText);
var beers = data.beers;
for ( i = 0,
j = beers.length; i < j; i++)... | onload : function(evt) {
var newCrud = new crud();
newCrud.dele(); |
<|file_name|>clean_mac_info_plist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the MineCoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string... | |
<|file_name|>make_ml_output_summary.py<|end_file_name|><|fim▁begin|>import sys
import socket
import os
import os.path
from optparse import OptionParser
#import scipy as scp
import numpy as np
import matplotlib.pyplot as plt
import pylab
import genome_management.kg_file_handling as kgf
import math
def file_exists(ls,f... | |
<|file_name|>view-service.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
@Injectable()
export class warstockrptService {
constructor(private _dataserver: DataService, private _router: Router) { }
}<|fim▁end|> | import { Injectable } from '@angular/core';
import { DataService } from '../../../_service/dataconnect';
import { Router } from '@angular/router'; |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from django.contrib.auth import get_user_model
from rest_framework.fields import CharField
from rest_framework.serializers import ModelSerializer
from grandchallenge.challenges.models import Challenge
from grandchallenge.components.serializers import (
Compo... | model = get_user_model()
fields = ("username",)
|
<|file_name|>browser_util.d.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { NgZone } from '@angular/core';
export declare le... | isSlow: boolean;
supportsNativeIntlApi: boolean;
isChromeDesktop: boolean; |
<|file_name|>hashlib.py<|end_file_name|><|fim▁begin|># $Id$
#
# Copyright (C) 2005 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
__doc__ = """hashlib module - A common interface to many hash functions.
new(name, string='') - returns a new hash object implementing th... | |
<|file_name|>logsettings.py<|end_file_name|><|fim▁begin|>"""Get log settings."""
import os
import platform
import sys
from logging.handlers import SysLogHandler
LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
def get_logger_config(log_dir,
logging_env="no_env",
... | 'level': 'DEBUG',
'propagate': False, |
<|file_name|>database.go<|end_file_name|><|fim▁begin|>package redis
import (
"bytes"
"encoding/gob"
"github.com/iris-framework/iris/adaptors/sessions/sessiondb/redis/service"
)
// Database the redis database for q sessions
type Database struct {
redis *service.Service
}
// New returns a new redis database
func ... | |
<|file_name|>AbstractGuiElement.java<|end_file_name|><|fim▁begin|>/*
* This file is part of jGui API, licensed under the MIT License (MIT).
*
* Copyright (c) 2016 johni0702 <https://github.com/johni0702>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
... | @Override
public T setContainer(GuiContainer container) {
this.container = container;
return getThis(); |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>var dest = './public';
var src = './src';
module.exports = {
browserSync: {
server: {
// Serve up our build folder
baseDir: dest
},
open: false,
https: false
},
sass: {
src: [
src + '/assets/css/*.{sass,scss}',
src + '/assets/css/**/*.{sass,s... | } |
<|file_name|>test_unsafe_proxy.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
class Tip(models.Model):<|fim▁hole|> text = models.TextField(max_length=1000)
date = models.DateField(auto_now_add=True)
class Meta:
ordering = ['-date']
def __unicode__(self):
return '%... | |
<|file_name|>jester_vectorize.py<|end_file_name|><|fim▁begin|>from src.utils import glove
import numpy as np
import string
class jester_vectorize():
def __init__(self, user_interactions, content, user_vector_type, content_vector_type, **support_files):
"""Set up the Jester Vectorizer.
Args:
... | def get_content_vector(self):
"""Produce an RDD containing tuples of the form (item, content_vector).
There is one method of producing content vectors: |
<|file_name|>AccumuloConstantPcjIntegrationTest.java<|end_file_name|><|fim▁begin|>package org.apache.rya.indexing.external;
import java.net.UnknownHostException;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this wo... | + " ?y <uri:talksTo> ?z. " //
+ " ?z <uri:talksTo> <uri:e1>. " //
+ "}";//
|
<|file_name|>project.go<|end_file_name|><|fim▁begin|>package rancher
import (
"github.com/Sirupsen/logrus"
"github.com/docker/libcompose/logger"
"github.com/docker/libcompose/lookup"
"github.com/docker/libcompose/project"
)
func NewProject(context *Context) (*project.Project, error) {
context.ConfigLookup = &lo... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub type clock_t = ::c_uint;
pub type suseconds_t = ::c_int;
pub type dev_t = u64;
pub type blksize_t = ::int32_t;
pub type fsblkcnt_t = ::uint64_t;
pub type fsfilcnt_t = ::uint64_t;
pub type idtype_t = ::c_int;
s! {
pub struct aiocb {
pub aio_offset: ::off_... | pub const DCCP_TYPE_CLOSE: ::c_int = 6;
pub const DCCP_TYPE_RESET: ::c_int = 7; |
<|file_name|>doctest.py<|end_file_name|><|fim▁begin|>""" discover and run doctests in modules and test files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import platform
import sys
import traceback
from contextlib import contextmanager
... | DOCTEST_REPORT_CHOICE_NONE: 0,
}[key] |
<|file_name|>binary_tree.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Takeru Ohta <phjgt308@gmail.com>
//
// This software is released under the MIT License,
// see the LICENSE file at the top-level directory.
extern crate dawg;
use dawg::binary_tree::Builder;
#[test]
fn build() {
let mut b = Builder::n... | for w in words().iter() {
assert!(b.insert(w.bytes()).is_ok());
}
assert_eq!(words().len(), b.finish().len()); |
<|file_name|>iotjs_module_timer.cpp<|end_file_name|><|fim▁begin|>/* Copyright 2015 Samsung Electronics Co., Ltd.
*
* 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... |
// Stop timer. |
<|file_name|>db.js<|end_file_name|><|fim▁begin|>"use strict";
const mongoose = require('mongoose');<|fim▁hole|>
module.exports = (()=>{
mongoose.connect('mongodb://192.168.56.101:30000/blog');
let db = mongoose.connection;
db.on('error', function(err){
console.log(err);
});
db.once('open', (err)=> {
console.l... | |
<|file_name|>test_db_rule_enforcement.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under... | # (the 'License'); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at |
<|file_name|>CallMacroStep.java<|end_file_name|><|fim▁begin|>package org.museautomation.core.step;
import org.jetbrains.annotations.*;
import org.museautomation.core.*;
import org.museautomation.core.context.*;
import org.museautomation.core.step.descriptor.*;
import org.museautomation.core.steptask.*;
import org.muse... | if (resource == null)
throw new StepExecutionError("unable to locate project resource, id=" + id); |
<|file_name|>Sprite.ts<|end_file_name|><|fim▁begin|>module example.components {
import Component = artemis.Component;
import PooledComponent = artemis.PooledComponent;
import Pooled = artemis.annotations.Pooled;
import Point = PIXI.Point;
import Container = PIXI.Container;
import Texture = PIXI.Texture;
... | addTo(layer:Container) {
layer.addChild(this.sprite_); |
<|file_name|>generateGeotiff.py<|end_file_name|><|fim▁begin|># This script generates GeoTiff files based Corine land cover data
# Usage: python generateGeotiff.py berryName
# berryName is optional. If not provided all output layers are generated.
# Licensed under the MIT license
from osgeo import gdal, ogr, gdalconst
... | for berry in berries:
driver = srcDs.GetDriver()
dstDs = driver.Create(dstPath + "/" + berry + ".tif", xSize, ySize, 1, gdal.GDT_UInt16, options = ['COMPRESS=LZW'])
dstDs.SetGeoTransform(srcDs.GetGeoTransform()) |
<|file_name|>emnist.py<|end_file_name|><|fim▁begin|>import shutil
import numpy as np
import dill
import gzip
import os
import subprocess
import struct
from array import array
import warnings
from dps import cfg
from dps.utils import image_to_string, cd, resize_image
# This link seems not to work anymore...
# emnist_... | """ Load emnist data from disk by class. |
<|file_name|>0002_auto_20160628_1024.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
('catalogue', '0001_initial'),
]
operations = [
... | |
<|file_name|>JavadocCompletionProposal.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2000, 2016 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of t... | }
}
return null;
} |
<|file_name|>authorized_keys.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import os
import pwd
import grp
import sys
import subprocess
from .command import Command
class AuthorizedKeysCommand(Command):
"""
Get authorized keys for a user using NSS and SSSD.
"""
... | "failed to retrieve user passwd entry: {0}".format(e),
file=sys.stderr)
sys.exit(1) |
<|file_name|>Home.js<|end_file_name|><|fim▁begin|>import React from 'react';
function Home(props) {
return (
<div id='react-home'>
<h1>BC</h1>
<h2>FreeCodeCamp Projects using React</h2>
</div>
);
}
<|fim▁hole|><|fim▁end|> | export default Home |
<|file_name|>helper.py<|end_file_name|><|fim▁begin|>"""A library of helper functions for the CherryPy test suite."""
import datetime
import io
import logging
import os
import re
import subprocess
import sys
import time
import unittest
import warnings
import portend
import pytest
import six
from cheroot.test import w... | 'host': self.host,
'port': self.port, |
<|file_name|>EDMLoop_neg_slope.py<|end_file_name|><|fim▁begin|># Import a whole load of stuff
from System.IO import *
from System.Drawing import *
from System.Runtime.Remoting import *
from System.Threading import *
from System.Windows.Forms import *
from System.Xml.Serialization import *
from System import *
... | print("Acquiring block " + str(blockIndex) + " ...")
|
<|file_name|>context.py<|end_file_name|><|fim▁begin|># for accessing babusca library.
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import smatrix<|fim▁hole|>import g2
import generators<|fim▁end|> | import scattering
import g1 |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|># This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public transport:
# a non endin... | |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import os
import django
from unipath import Path
BASE_DIR = Path(os.path.abspath(__file__))
BOOKTYPE_SITE_NAME = ''
BOOKTYPE_SITE_DIR = 'tests'
THIS_BOOKTYPE_SERVER = ''
BOOKTYPE_URL = ''
BOOKTYPE_ROOT = BASE_DIR.parent
STATIC_ROOT = BASE_DIR.parent.child("stati... | SECRET_KEY = 'enc*ln*vp^o2p1p6of8ip9v5_tt6r#fh2-!-@pl0ur^6ul6e)l'
COVER_IMAGE_UPLOAD_DIR = 'cover_images/' |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
use std::io::prelude::*;
use std::collections::HashMap;
fn get_input() -> i32 {
let mut file = File::open("input.txt").unwrap();
let mut content = String::new();
file.read_to_string(&mut content).unwrap();
content.parse().unwrap()
}
... | self.dir = Direction::YNeg;
self.y -= 1; |
<|file_name|>VoldemortNativeRequestHandler.java<|end_file_name|><|fim▁begin|>package voldemort.server.protocol.vold;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
import org.apache.log4j.Logger;
import voldemort.VoldemortException;
import vol... | if(outputContainer != null) {
outputContainer.getBuffer().clear();
} |
<|file_name|>png_unittest.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source c... | |
<|file_name|>map.go<|end_file_name|><|fim▁begin|>package hashmap
// Map is a persistent associative data structure mapping keys to values. It
// is immutable, and supports near-O(1) operations to create modified version of
// the map that shares the underlying data structure. Because it is immutable,
// all of its met... | Iterator() Iterator |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(slice_position_elem, iter_arith)]
#[macro_use] extern crate libeuler;
/// 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
///
/// What is the smallest positive number that is evenly divisible by all ... | }
retval |
<|file_name|>pattern_match.rs<|end_file_name|><|fim▁begin|>use std::env;
fn main() {
let a: i32 = env::args().nth(0).unwrap().parse::<i32>().unwrap();
let b = match a {
1 => true,
2 => true,
3 | 4 => true,
_ => false,
};
println!("{}", b);<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>update.contribution.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
... | |
<|file_name|>users-routes.Spec.js<|end_file_name|><|fim▁begin|>"use strict";
var chai = require('chai');<|fim▁hole|>
var user1 = {
username: 'Laura',
password: 'tiger',
address: {
street: '123 Main St',
city: 'Beaverton',
state: 'OR',
zip: 97007,
},
_id: '',
};
chai.use(chaiHttp);
function ... | var chaiHttp = require('chai-http');
var expect = require('chai').expect;
var app = require('../app');
var port = 3001; |
<|file_name|>code_generator.py<|end_file_name|><|fim▁begin|>#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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... | #
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod mpsc;
pub mod notify;
pub mod broadcast;
mod mutex;
<|fim▁hole|>pub use self::mutex::Mutex;<|fim▁end|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.