prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sourc... | importeur.hook["personnage:deplacer"].executer(
personnage, d_salle, None, 0)
if not hasattr(d_salle, "navire") or d_salle.navire is None: |
<|file_name|>message.js<|end_file_name|><|fim▁begin|>var models = require('../models');
var Message = models.Message;
var User = require('../proxy').User;
var messageProxy = require('../proxy/message');
var mail = require('./mail');
exports.sendReplyMessage = function (master_id, author_id, topic_id, reply_id) {
var... | // TODO: 异常处理
mail.sendAtMail(master.email, msg);
});
} |
<|file_name|>app.route.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular
.module('lcRegistration')
.config(["$routeProvider", function($routeProvider) {
$routeProvider
.when("/", {
templateUrl: "/client/app/regForm/regForm.html",... | }).when("/hello", {
templateUrl: "/client/app/hello/hello.html",
controller: "helloController" |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os<|fim▁hole|>def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="blake-archive",
version="0.1",
description="Blake archive web app",
license="Closed source",
packages=['blake', 'test'],
... | from setuptools import setup
|
<|file_name|>PopupMenu(1).rs<|end_file_name|><|fim▁begin|>com.hepia.logisim.chronogui.PopupMenu
<|fim▁hole|><|fim▁end|> | com.hepia.logisim.chronogui.PopupContents |
<|file_name|>regions-infer-at-fn-not-param.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://... | fn main() {} |
<|file_name|>scrape.js<|end_file_name|><|fim▁begin|>var request = require('request');
var cheerio = require('cheerio');
var admin = require("firebase-admin");
//var serviceAccount = require("tehillim-17559-firebase-adminsdk-gx90v-b712a63ab5.json");
admin.initializeApp({
credential: admin.credential.cert("tehilli... | |
<|file_name|>0008_auto_20170908_1914.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-08 19:14
from __future__ import unicode_literals
from django.db import migrations, models
<|fim▁hole|>
dependencies = [
('invoice', '0007_profile_invoice_logo'),
]
... | class Migration(migrations.Migration): |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import csv
from django.contrib import admin
from django.http import HttpResponse
from .models import Donor, Donation
class DonationInline(admin.TabularInline):
model = Donation
extra = 0
@admin.register(Donor)
class Do... | @staticmethod
def last_amount(obj):
return obj.donation_set.latest().amount
|
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>#
# Copyright 2015-2019, Institute for Systems Biology
#
# 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... | |
<|file_name|>grapheme.go<|end_file_name|><|fim▁begin|>package boundaryh
//replacer:ignore
// TODO replace windows path separator
//go:generate go run $GOPATH\src\github.com\apaxa-go\generator\replacer\main.go -- $GOFILE
// Returns if there is a break between l0 and r0.
func gDecision(l1Diff, l0 gClass, lOddRI bool, r... | |
<|file_name|>docstring_cop.py<|end_file_name|><|fim▁begin|>import sys, re
for fn in sys.argv[1:]:
with open(fn, 'r') as f:
s = f.read()
xx = re.findall(r'([^\n]+)\s+\'\'\'(.*?)\'\'\'', s, re.M|re.S)
for (obj, doc) in xx:
s = re.findall('[^:`]\B(([`*])[a-zA-Z_][a-zA-Z0-9_]*\\2)... | |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>"""
Copyright 2017-present Airbnb, 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.0
Unless re... | |
<|file_name|>recognition.py<|end_file_name|><|fim▁begin|># PyKinect
# Copyright(c) Microsoft Corporation
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the License); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apach... | _StopRecognizeAsync.argtypes = [ctypes.c_voidp]
_StopRecognizeAsync.restype = ctypes.HRESULT
_EnumRecognizersCallback = ctypes.WINFUNCTYPE(None, ctypes.c_wchar_p, ctypes.c_wchar_p, ctypes.c_voidp) |
<|file_name|>make_clim_file_bio_addons.py<|end_file_name|><|fim▁begin|>import subprocess
import os
import sys
import commands
import numpy as np
import pyroms
import pyroms_toolbox
from remap_bio_woa import remap_bio_woa<|fim▁hole|>dst_dir='./'
src_grd = pyroms_toolbox.BGrid_GFDL.get_nc_BGrid_GFDL('/archive/u1/uaf/k... | from remap_bio_glodap import remap_bio_glodap
data_dir_woa = '/archive/u1/uaf/kate/COBALT/'
data_dir_glodap = '/archive/u1/uaf/kate/COBALT/' |
<|file_name|>sitecustomize.py<|end_file_name|><|fim▁begin|>import os
import socket<|fim▁hole|>
batch_enabled = int(os.environ.get('_BACKEND_BATCH_MODE', '0'))
if batch_enabled:
# Since latest Python 2 has `builtins`and `input`,
# we cannot detect Python 2 with the existence of them.
if sys.version_info.majo... | import sys
input_host = '127.0.0.1'
input_port = 65000 |
<|file_name|>Spell.ts<|end_file_name|><|fim▁begin|>export default interface Spell {
id: number;
name: string;
icon: string;
//Death Knights
runesCost?: number
runicPowerCost?: number;
//Demon Hunter
furyCost?: number;
painCost?: number;
//Feral Druid & Rogue
energyCost?: number;
comboPointsCost?... | }
export interface SpellList<T extends Spell = Spell> { |
<|file_name|>bdo-poke.js<|end_file_name|><|fim▁begin|>/**
* Инициализация модуля.
*/
/*global define*/
define(['./poke-control', './poke-history', 'jquery'], function (pokeControl, pokeHistory, $) {
'use strict';
var pokeSettings = {
pokeControl: {<|fim▁hole|> pokeHistory: {
... | selector: '.poke-control-container',
template: '<form class="form"><div class="form-group"><label for="bdoChannel">Канал:</label><select class="form-control" name="bdoChannel" id="bdoChannel"></select></div><div class="form-group"><label for="bdoQuest">Квест:</label><select class="form-c... |
<|file_name|>configtx_test.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2017 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/li... | )
func TestConfigtxInitializerInterface(t *testing.T) {
_ = configtx.Initializer(&Initializer{}) |
<|file_name|>mainService.js<|end_file_name|><|fim▁begin|>'use strict';
describe('Service: mainService', function () {
// load the service's module
beforeEach(module('catsGoApp'));
// instantiate service
var mainService;
beforeEach(inject(function (_mainService_) {
mainService = _mainService_;
}));
<|... | it('randomArray testing', function () { |
<|file_name|>test_exact.py<|end_file_name|><|fim▁begin|>import unittest
from llvm.core import (Module, Type, Builder)
from .support import TestCase, tests
class TestExact(TestCase):
def make_module(self):
mod = Module.new('asdfa')
fnty = Type.function(Type.void(), [Type.int()] * 2)
func = m... | self.has_exact(opf(bldr, a, b, exact=True), opname) |
<|file_name|>update.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
"container/list"
"fmt"
"os/exec"
"strings"
log "gopkg.in/clog.v1"
git "gi... | // CommitToPushCommit transforms a git.Commit to PushCommit type.
func CommitToPushCommit(commit *git.Commit) *PushCommit { |
<|file_name|>DraftFeatureFlags-core.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2013-present, Facebook, Inc.<|fim▁hole|> * of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DraftFeatureFlags-core
*
*/
'use strict';
var DraftFeatureFlags = {
draft_accept_selection... | * All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant |
<|file_name|>api-helper.js<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright [2017] [Quirino Brizi (quirino.brizi@gmail.com)]
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance w... | res.status(statusCode).send(message);
}, |
<|file_name|>test_forked_green_actors.py<|end_file_name|><|fim▁begin|>import sys
if '' not in sys.path:
sys.path.append('')
import time
import unittest
from pyactors.logs import file_logger
from pyactors.exceptions import EmptyInboxException
from tests import ForkedGreActor as TestActor
from multiprocessing imp... | result.append(actor.inbox.get())
except EmptyInboxException:
break
self.assertEqual(len(result), 10) |
<|file_name|>LabelField.java<|end_file_name|><|fim▁begin|>package autotest.tko;
import autotest.common.Utils;
public abstract class LabelField extends ParameterizedField {
@Override
public String getSqlCondition(String value) {
String condition = " IS NOT NULL";
if (value.equals(Utils.JSON_NUL... | } |
<|file_name|>position.py<|end_file_name|><|fim▁begin|>from math import fabs
"""Kept these functions outside the class, since they are static
for the search and movement functions for board. The downside is it creates
an object for search purposes, which seems relatively heavy. I'll
optimize later if necessary... | return self._y
|
<|file_name|>sprk-footer.stories.ts<|end_file_name|><|fim▁begin|>// prettier-ignore
// @ts-ignore
import { moduleMetadata, Meta } from '@storybook/angular';
import { SprkFooterModule } from './sprk-footer.module';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { SprkFooterCompone... | 'https://spark-assets.netlify.app/spark-logo-mark.svg',
imgAlt: 'placeholder', |
<|file_name|>opencga-sample-browser.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|>};<|fim▁end|> | const OpencgaSampleBrowserConfig = {
|
<|file_name|>module_horo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Fetches horoscopes from iltalehti.fi
Created on Oct 17, 2012
@author: huqa / pikkuhukka@gmail.com
"""
import re
horo_url = "http://www.iltalehti.fi/horoskooppi"
def command_horo(bot, user, channel, args):
"""Hakee päivittäisen ... | |
<|file_name|>generateImageWebPage.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
##############################################################################
##
##
## @Name : generateImageWebPage.py
##
## @license : MetPX Copyright (C) 2004-2006 Environment Canada
## MetPX comes with ABSOLU... |
from pxStats.lib.StatsPaths import StatsPaths
from pxStats.lib.LanguageTools import LanguageTools |
<|file_name|>io.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package io provides basic interfaces to I/O primitives.
// Its primary job is to wrap existing implementation... | |
<|file_name|>test_bibgloss.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
test_sphinx
~~~~~~~~~~~
General Sphinx test and check output.
"""
import sys
import pytest
import sphinx
from ipypublish.sphinx.tests import get_test_source_dir
from ipypublish.tests.utils import HTML2JSONParser
@pyt... | output = get_sphinx_app_output(app, buildername="html") |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import uuid
import os
import shutil
import urlparse
import re
import hashlib
from lxml import html
from PIL import Image, ImageFile
from django.conf import settings
import views
ImageFile.MAXBLOCKS = 10000000
def match_or_none(string, rx):
"""
Tries to matc... | rendered_path = os.path.join(dirname, 'rendered')
if not os.path.exists(rendered_path): |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var fs = require('fs');
var join = require('path').join;<|fim▁hole|>var debug = require('debug')('ip');
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var thunkify = require('thunkify-wrap');
function IpUtil(ipFile, encoding, isLoad) {
... | var iconv = require('iconv-lite'); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import find_packages, setup
root = os.path.dirname(os.path.realpath(__file__))
long_description = open(os.path.join(root, 'README.rst')).read()
setup(
name='range-regex',
version='1.0.3',
description='Python numeric range regular... | include_package_data=True,
keywords='numeric range regex regular expression generator',
) |
<|file_name|>playerstate.ts<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> */
export enum PlayerState {
LoadingAssets,
Ready,
Disconnected,
Idle
}<|fim▁end|> | * Handles the player state |
<|file_name|>Util.py<|end_file_name|><|fim▁begin|>"""
Facilities for pyFTS Benchmark module
"""
import matplotlib as plt
import matplotlib.cm as cmx
import matplotlib.colors as pltcolors
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sqlite3
#from mpl_toolkits.mplot3d import Axes3D
fro... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rtstock documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possi... | master_doc = 'index'
|
<|file_name|>en-ca.js<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> preview: 'Preview'
} );<|fim▁end|> | Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'preview', 'en-ca', { |
<|file_name|>app.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
frest - flask restful api frame
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This project is the frame of the restful api server created with flask.
<|fim▁hole|>"""
import os
from flask_script import Server, Manager
from flask_migrate import ... | :copyright: (C) 2017 h4wldev@gmail.com
:license: MIT, see LICENSE for more details. |
<|file_name|>repeat.py<|end_file_name|><|fim▁begin|>from django import template
register = template.Library()
class RepeatNode(template.Node):
def __init__(self, nodelist, count):
self.nodelist = nodelist
self.count = template.Variable(count)
def render(self, context):
output = se... | |
<|file_name|>authentication.rs<|end_file_name|><|fim▁begin|>use std::io::{self, Read};
use aes::Aes192;
use byteorder::{BigEndian, ByteOrder};
use hmac::Hmac;
use pbkdf2::pbkdf2;
use protobuf::ProtobufEnum;
use serde::{Deserialize, Serialize};
use sha1::{Digest, Sha1};
use crate::protocol::authentication::Authenticat... | fn read_u8<R: Read>(stream: &mut R) -> io::Result<u8> {
let mut data = [0u8]; |
<|file_name|>wifi-olsr-flowmon.py<|end_file_name|><|fim▁begin|># -*- Mode: Python; -*-
# Copyright (c) 2009 INESC Porto
#
# 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;
#
# Th... | # GNU General Public License for more details.
# |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from cobra.core.application import Application
from cobra.core.loading import get_class
class AutoCheckDashboardApplication(Application):
name = None
index_view = get_class('dashboard.autocheck.views', 'IndexView')<|fim▁hole|>... |
def get_urls(self):
urls = [
url(r'^$', self.index_view.as_view(), name='autocheck-index'), |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const Hapi = require('hapi');
const Request = require('request');
const port = process.env.PORT || 8080;
const server = new Hapi.Server();
const cephalopods = 'http://api.gbif.org/v1/species/136';
server.connection({
port: port,
host: '0.0.0.0'
});
server.ro... | |
<|file_name|>test_ovs_firewall.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of ... | self.assertIn("123", self.ovs_firewall.filtered_ports)
self.assertTrue(mock_exception_log.called) |
<|file_name|>ViewLoader.java<|end_file_name|><|fim▁begin|>/* Copyright (C) 2022, Specify Collections Consortium
*
* Specify Collections Consortium, Biodiversity Institute, University of Kansas,
* 1345 Jayhawk Boulevard, Lawrence, Kansas, 66045, USA, support@specifysoftware.org
*
* This program is free software; ... | case field :
//view = createFormView(FormView.ViewType.field, element, id, name, gettableClassName, settableClassName,
// className, desc, instance.doingResourceLabels, isValidated);
break; |
<|file_name|>log.py<|end_file_name|><|fim▁begin|># Copyright 2014 Xinyu, He <legendmohe@foxmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
<|file_name|>webpack.config.renderer.js<|end_file_name|><|fim▁begin|>const merge = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const base = require('./webpack.config.base')
const pkg = require('../app/package.json')
... | // historyApiFallback: true,
// progress: true,
// inline: true,
// colors: true, |
<|file_name|>historybuffer.py<|end_file_name|><|fim▁begin|>from __future__ import annotations<|fim▁hole|>import gc
import threading
from typing import Optional
from utils.utilfuncs import safeprint
def DummyAsyncFileWrite(fn, writestr, access='a'):
safeprint('Called HB file write before init {} {} {}'.format(fn, wr... | import os
import shutil
import time |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># coding=utf-8<|fim▁hole|> 'db_user': '', # mongodb的用户名
'db_pass': '', # mongodb的密码
'db_host': 'localhost',
'db_port': 27017,
'db_name': 'novelRS',
'cpu_num': 4 # 开几个进程计算
}<|fim▁end|> |
config = {
'timeout': 10, |
<|file_name|>Product.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package entities;
import java.io.Serializable;
import javax.persistence... | this.afbeelding = afbeelding;
}
|
<|file_name|>pelicanconf.py<|end_file_name|><|fim▁begin|># Theme-specific settings
SITENAME = "Marc Sleegers"
DOMAIN = "marcsleegers.com"
BIO_TEXT = "Infrequent ramblings."
FOOTER_TEXT = '© 2022 Marc Sleegers. Licensed <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a>.'
SITE_AUTHOR = "Marc Slee... | ("url_expire", False),
("versions", False),
] |
<|file_name|>injection.js<|end_file_name|><|fim▁begin|>import { defineComponent, mount, Html } from 'js-surface';
import { Component } from 'js-surface/common';
const { br, div } = Html;
const Parent = defineComponent({
displayName: 'Parent',
properties: {
masterValue: {
type: String,
... | |
<|file_name|>InWechatTextMsgExecutor.java<|end_file_name|><|fim▁begin|>package com.byhealth.wechat.mysdk.process.in.executor;
import com.byhealth.wechat.base.admin.entity.RespMsgActionEntity;
import com.byhealth.wechat.config.MsgTemplateConstants;
import com.byhealth.wechat.mysdk.constants.WechatReqMsgtypeConstants;
i... | ReqTextMessage textMessage = new ReqTextMessage(WechatContext.getWechatPostMap());
logger.info("进入文本消息处理器fromUserName="+textMessage.getFromUserName()); |
<|file_name|>JsonImagePanorama.java<|end_file_name|><|fim▁begin|>package alexiil.mods.load.json.subtypes;
import java.util.Collections;<|fim▁hole|>import java.util.List;
import java.util.Map;
import net.minecraft.util.ResourceLocation;
import alexiil.mods.load.baked.func.BakedFunction;
import alexiil.mods.load.baked... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { OrderService } from '../order.component/order.service';
import { ActivatedRoute, Params } from '@angular/router';
@Component({
selector: 'order-detail',
styleUrls: [
'./style.scss'
],
template... | constructor( |
<|file_name|>MovieGet.java<|end_file_name|><|fim▁begin|>package uk.co.ourfriendirony.medianotifier.clients.tmdb.movie.get;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annot... | // @JsonProperty("name")
// private String name; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*!
Various BWT-DC compression models
*/
use compress::bwt::dc;
use compress::entropy::ari;
use std::io;
/// A copy of `bbb` model
pub mod bbb;
/// Old Dark-0.51 model
pub mod dark;
/// Original BWT-DC compression model
pub mod exp;
/// Raw output for debugging
pub m... | fn roundtrips_simple() {
roundtrips_dc(super::simple::Model::new());
}
|
<|file_name|>GET.java<|end_file_name|><|fim▁begin|>/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2010-2013 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") o... | *
* @author Paul Sandoz
* @author Marc Hadley
* @see HttpMethod |
<|file_name|>database.py<|end_file_name|><|fim▁begin|>import logging
import rethinkdb as r
log = logging.getLogger(__name__)
class Database():
def __init__(self, bot):
self.bot = bot
self.db_name = self.bot.config.rname
self.db = None
r.set_loop_type("asyncio")
self.ready... | info = await self.db.server() |
<|file_name|>adminaddmemberwv.cpp<|end_file_name|><|fim▁begin|>#include "adminaddmemberwv.h"
void AdminAddMemberWV::processItems(){
const QString & type = intro->cgetType();
const QString & nick = bio->cgetField("nick");
const QString & name = bio->cgetField("name");
const QString & surname = bio->cg... | |
<|file_name|>FeaturesVectorFulltext.java<|end_file_name|><|fim▁begin|>package org.grobid.core.features;
import org.grobid.core.layout.LayoutToken;
import org.grobid.core.utilities.TextUtilities;
/**
* Class for features used for fulltext parsing.
*
*/
public class FeaturesVectorFulltext {
public LayoutToken to... | public boolean bitmapAround = false;
public boolean vectorAround = false;
// if a graphic is in close proximity of the current block, characteristics of this graphic |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::ops::{Add, Sub, Mul, Div};
fn do_operation<F, V>(f: F, v1: V, v2: V) -> V
where
F: Fn(V, V) -> V,
V: Add + Sub + Mul + Div {
f(v1, v2)
}
pub fn rpn(raw: &str) -> f64 {
let mut stack = Vec::new();
for c in raw.split(' ') {
... | }
|
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import sys, Tkinter, tkFont, ttk
sys.path.insert(0, "./src/")
import button, database
from config import *
# Note: need to set size for bg_canvas here; otherwise it will grow disregard the size set while created!
def AuxscrollFunction(event):
bg_canvas.configure(sc... | batch_photo_frame.bind("<Configure>", AuxscrollFunction)
# Note: don't pack batch_photo_frame here, otherwise scroll bar won't show!!!
|
<|file_name|>gauge.rs<|end_file_name|><|fim▁begin|>use std::f64;
use std::mem;
use std::sync::atomic::{AtomicU64, Ordering};
#[derive(Debug)]
pub struct Gauge {
value: AtomicU64,
}
impl Gauge {
pub fn new() -> Gauge {
let bits = unsafe { mem::transmute(f64::NAN) };
Gauge { value: AtomicU64::ne... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Ultimaker B.V.<|fim▁hole|>from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
def getMetaData():
return {
"plugin": {
"name": catalog.i18nc("@label", "Cura Profile Reader"),
"author": "Ultimaker",
... | # Cura is released under the terms of the AGPLv3 or higher.
from . import CuraProfileReader
|
<|file_name|>extern-fail.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.
//<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apa... | |
<|file_name|>Owner_0001.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Printmodel django module for condominium
@author: Laurent GAY
@organization: sd-libre.fr
@contact: info@sd-libre.fr
@copyright: 2016 sd-libre.fr
@license: This file is part of Lucterios.
Lucterios is free software: you can redistribut... | <cell display_align="center" border_color="black" border_style="solid" border_width="0.2" text_align="start" line_height="7" font_family="sans-serif" font_weight="" font_size="7">
#bank_account
</cell> |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/* jslint node: true */
'use strict';
var express = require('express'),
sections = require('./sections'),
http = require('http'),
expressLess = require('express-less'),
path = require('path');
/**
* Create server
*/... | app.use(express.compress());
app.use(express.methodOverride()); |
<|file_name|>list.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import json
import logging
from pip._vendor import six
from pip._vendor.six.moves import zip_longest
from pip._internal.cli import cmdoptions
from pip._internal.cli.base_command import Command
from pip._internal.exceptions impor... | default=True,
)
index_opts = cmdoptions.make_option_group( |
<|file_name|>FigureDetector.java<|end_file_name|><|fim▁begin|>package yuka.detectors;
import yuka.containers.News;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
im... | //int height = image.getHeight(); |
<|file_name|>place.search.unit.ts<|end_file_name|><|fim▁begin|>import { assert } from "chai";
import * as helper from "./helper/index";
import { getConfig } from "../src/config/config";
const { defaults } = getConfig();
const searchDefaults = defaults.placesSearch;
const { Place } = helper;
describe("Place Model", () ... | testQueries.forEach((query) => {
it(`finds incomplete words. like '${query}'`, async () => {
const results = await Place.prefixSearch({ name: query }); |
<|file_name|>dm.py<|end_file_name|><|fim▁begin|># ============================================================================
'''
This file is part of the lenstractor project.
Copyright 2012 David W. Hogg (NYU) and Phil Marshall (Oxford).
Description
-----------
General-purpose data management classes and functions:... | else:
# Make a var image from the sci image...
background = np.median(sci)
diffimage = sci - background |
<|file_name|>assignmentClientPlayer.js<|end_file_name|><|fim▁begin|>"use strict";
//
// Bot Player
// assignmentClientPlayer.js
// Created by Milad Nazeri on 2019-06-06
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://ww... | // ************************************* |
<|file_name|>BindParameterMapperManagerTest.java<|end_file_name|><|fim▁begin|>package jp.co.future.uroborosql.parameter.mapper;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.math.BigDecimal;
import java.s... | }
|
<|file_name|>run.py<|end_file_name|><|fim▁begin|>from mainapp import create_app<|fim▁hole|> app.run(host='0.0.0.0')<|fim▁end|> |
app = create_app()
if __name__ == '__main__': |
<|file_name|>0006_chg_field_feed_title.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Feed.title'
db.alte... | 'title': ('django.db.models.fields.CharField', [], {'max_length': '70'})
}
} |
<|file_name|>frosted_checker.py<|end_file_name|><|fim▁begin|># # # # # # # # # # # # # #
# CAPTAINHOOK IDENTIFIER #
# # # # # # # # # # # # # #
from .utils import bash, filter_python_files
DEFAULT = 'off'
CHECK_NAME = 'frosted'
NO_FROSTED_MSG = (
"frosted is required for the frosted plugin.\n"
"`pip install f... |
def run(files, temp_folder):
"Check frosted errors in the code base." |
<|file_name|>d095.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <string>
#include<iomanip>
using namespace std;
int main()
{
string a;
double h,m,x;
while(cin>>a)
{
if(a=="0:00")break;
if(a[1]==':')
{
h=a[0]-'0';
... | |
<|file_name|>gather-2.6.x.py<|end_file_name|><|fim▁begin|>from twilio.twiml.voice_response import Gather, VoiceResponse
response = VoiceResponse()
response.gather()
<|fim▁hole|><|fim▁end|> | print(response) |
<|file_name|>must-authorize.js<|end_file_name|><|fim▁begin|><|fim▁hole|>const appErrorsFactory = require('../../app-errors/app-errors-factory');
/**
*
*/
function setup(req, res, next) {
if (!req.currentUser) {
next(appErrorsFactory.createAppError({ statusCode: 401 }));
}
else {
next();
}
}
module.e... | 'use strict'; |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from datetime import date, timedelta, datetime
import time
def get_first_day(dt, d_years=0, d_months=0):<|fim▁hole|>
def get_last_day(dt):
return get_first_day(dt, 0, 1) + timedelta(-1)
def str_to_date(value):
"""
Convert string to datatime object
"... | # d_years, d_months are "deltas" to apply to dt
y, m = dt.year + d_years, dt.month + d_months
a, m = divmod(m-1, 12)
return date(y+a, m+1, 1) |
<|file_name|>vec.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | // debugger:run
// debugger:print a
// check:$1 = {1, 2, 3} |
<|file_name|>gen_prime.py<|end_file_name|><|fim▁begin|>import argparse
import sys
# Sieve of Eratosthenes
# Code by David Eppstein, UC Irvine, 28 Feb 2002
# http://code.activestate.com/recipes/117119/
def gen_primes():
""" Generate an infinite sequence of prime numbers.
"""
# Maps composites to primes wit... | if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate prime number array") |
<|file_name|>test_init.py<|end_file_name|><|fim▁begin|>import pytest<|fim▁hole|>
@pytest.fixture
def abstract_serial_server():
return AbstractSerialServer()
def test_abstract_serial_server_get_meta_data(abstract_serial_server):
""" Test if meta data is correctly extracted from request. """
assert abstrac... |
from umodbus.server.serial import AbstractSerialServer |
<|file_name|>xyz.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2017 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of th... | def dump_xyz(filename, data): |
<|file_name|>sphero_multiple.go<|end_file_name|><|fim▁begin|>// +build example
//
// Do not build by default.
package main
import (
"fmt"
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/api"
"gobot.io/x/gobot/platforms/sphero"
)
func NewSwarmBot(port string) *gobot.Robot {
spheroAdaptor := sphero.NewAdaptor(port)... |
spheroDriver.On(sphero.Collision, func(data interface{}) {
fmt.Println("Collision Detected!")
}) |
<|file_name|>magma_csolverinfo.cpp<|end_file_name|><|fim▁begin|>/*
-- MAGMA (version 1.6.2) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date May 2015
@generated from magma_zsolverinfo.cpp normal z -> c, Sun May 3 11:23:01 2015
... | printf("%% CG (merged) performance analysis every %d iteration\n", |
<|file_name|>issue-19358.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | }
impl Trait for int {}
|
<|file_name|>sh.py<|end_file_name|><|fim▁begin|>'''
Created on 22/ago/2011
@author: norby
'''
from core.moduleexception import ModuleException, ProbeException, ExecutionException, ProbeSucceed
from core.moduleguess import ModuleGuess
from core.argparse import ArgumentParser, StoredNamespace
from core.argparse import S... | |
<|file_name|>hu.js<|end_file_name|><|fim▁begin|>/*!
* froala_editor v4.0.1 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2021 Froala Labs
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('... | |
<|file_name|>tree.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2015 Zhassulan Zhussupov
# Author zhzhussupovkz@gmail.com
# Tree class
import random
class Tree:
def __init__(self, world, screen, x, y):
self.world, self.pygame = world, world.pygame
self.screen = screen
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from ilogue.fexpect.api import expect, controlchar, expecting, run, sudo, local<|fim▁end|> | |
<|file_name|>sort.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import sublime
import sublime_plugin
from isort.isort import SortImports
class PysortCommand(sublime_plugin.TextCommand):
def run(self, edit):
old_content = self.view.substr(sublime.Region(0, self.view.size()))
new_content = SortImport... | |
<|file_name|>max_cost_assignment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
#
#
# This simple example shows how to call dlib's optimal linear assignment problem solver.
# It is an implementation of the famous Hungarian al... | print "optimal assignments: ", assignment |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from . import font
from .indicator import Indicator, IndicatorOptions
from .airspeed import AirspeedIndicator<|fim▁hole|>from .altitude import AltitudeIndicator
from .attitude import AttitudeIndicator
from .compass import CompassIndicator
from .pfd import PFD
from ... | |
<|file_name|>DomainVerificationTwoTone.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {<|fim▁hole|>});
exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(require("./uti... | value: true |
<|file_name|>expanded_landing_page_view.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v2/resources/expanded_landing_page_view.proto
package resources
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
wrappers "github.com/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.