prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_urls.py<|end_file_name|><|fim▁begin|>import unittest
from django.core.urlresolvers import resolve, reverse, NoReverseMatch
from pulp.server.webservices.urls import handler404
def assert_url_match(expected_url, url_name, *args, **kwargs):
"""
Generate a url given args and kwargs and... | url = '/v2/repositories/mock_repo/distributors/'\
'mock_distributor/schedules/publish/mock_schedule/' |
<|file_name|>generic_modulator.py<|end_file_name|><|fim▁begin|>import numpy as np
import fir_filter
import gauss_pulse
import comms_filters
class generic_modulator:
def __init__(self, modulation_type, samples_per_symbol, pulse_factor, pulse_length, config):
""" Create the generic modulator object and speci... |
elif self.config in ["132/180"]:
# different mapping for different LDPC codes
|
<|file_name|>templates.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#--------------------------------------------------------------------
# Copyright (c) 2014 Eren Inan Canpolat
# Author: Eren Inan Canpolat <eren.canpolat@gmail.com>
#
# This program is free software: you can redistribute i... | <rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
</rootfiles> |
<|file_name|>multiple_ranges_test.cc<|end_file_name|><|fim▁begin|>#include "benchmark/benchmark.h"
#include <cassert>
#include <set>
class MultipleRangesFixture : public ::benchmark::Fixture {
public:
MultipleRangesFixture()
: expectedValues({{1, 3, 5},
{1, 3, 8},
... | assert(state.range() != state.range(1));
for (auto _ : state) {
}
} |
<|file_name|>formulacion_geotextiles.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) 2005-2008 Francisco José Rodríguez Bogado, #
# Diego Muñoz Escal... | ##
###################################################################
#
################################################################### |
<|file_name|>inotify.rs<|end_file_name|><|fim▁begin|>//! Monitoring API for filesystem events.
//!
//! Inotify is a Linux-only API to monitor filesystems events.
//!
//! For more documentation, please read [inotify(7)](https://man7.org/linux/man-pages/man7/inotify.7.html).
//!
//! # Examples
//!
//! Monitor all events ... | //! # use nix::sys::inotify::{AddWatchFlags,InitFlags,Inotify};
//! #
//! // We create a new inotify instance.
//! let instance = Inotify::init(InitFlags::empty()).unwrap(); |
<|file_name|>domomaster_postinst.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
## @package domomaster
# Master daemon for D3 boxes.
#
# Developed by GreenLeaf.
import sys;
import os;
import random;
import string;
from hashlib import sha1
from subprocess import *
import socket;
sys.path.append("/usr/lib/domoleaf"... | query3 = 'INSERT INTO user (Host, User, Password) VALUES (\'%\', \'domoleaf\', PASSWORD(\''+password.hexdigest()+'\'));';
query4 = 'INSERT INTO db (Host, Db, User, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Grant_priv, References_priv, Index_priv, Alter_priv, Create_tmp_table_pr... |
<|file_name|>test_json.py<|end_file_name|><|fim▁begin|>"""Test Home Assistant json utility functions."""
from json import JSONEncoder
import os
import sys
from tempfile import mkdtemp
import unittest
from unittest.mock import Mock
import pytest
from homeassistant.exceptions import HomeAssistantError
from homeassistan... |
class MockJSONEncoder(JSONEncoder):
"""Mock JSON encoder."""
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from holoviews.element import (
ElementConversion, Points as HvPoints, Polygons as HvPolygons,
Path as HvPath
)
from .geo import (_Element, Feature, Tiles, is_geographic, # noqa (API import)
WMTS, Points, Image, Text, LineContours, RGB... | class GeoConversion(ElementConversion):
""" |
<|file_name|>widget.tsx<|end_file_name|><|fim▁begin|>/*
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
/*
Widget rendering.
*/
import $ from "jquery";
import { Map, Set, List, fromJS } from "immutable";
import { Tabs, Tab } f... | |
<|file_name|>wrapper.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of holmesalf.
# https://github.com/holmes-app/holmes-alf
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2014 Pablo Aguiar scorphus@gmail.com
from ... | client_id=self.config.get('OAUTH_CLIENT_ID'),
client_secret=self.config.get('OAUTH_CLIENT_SECRET')
)
return self._async_client |
<|file_name|>github_test.go<|end_file_name|><|fim▁begin|>package github
import (
"bytes"
"io/ioutil"
"net/http"
"net/http/httptest"
"strings"
"testing"
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/openshift/origin/pkg/build/api"
"github.com/openshift/origin/pkg/build/webhook"
)
type... | //validation |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>def get_attributes_display_map(variant, attributes):
display = {}
for attribute in attributes:
value = variant.get_attribute(attribute.pk)
if value:
choices = {a.pk: a for a in attribute.values.all()}
attr = choices.get(v... | |
<|file_name|>TypeA.java<|end_file_name|><|fim▁begin|><|fim▁hole|>public class TypeA extends VisitableType {}<|fim▁end|> | package org.inferred.freevisitor.tests.j8;
|
<|file_name|>bitcoin_nb.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="nb" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About RipoffCoin</source>
... | <source>&Label</source>
<translation>&Merkelapp</translation> |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import os.path
class Xbraid(Makefil... | install('makefile.inc', prefix.share) |
<|file_name|>issue-3008-3.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/li... | } |
<|file_name|>events.js<|end_file_name|><|fim▁begin|>define([
// '../../../../src/utils/event',
// '../../../../src/utils/objectCreate'
], function(
// Event,
// objectCreate
){
var objectCreate = hello.utils.objectCreate;
var utils = hello.utils;
//
// Events
//
describe('utils / event', function(){
var hello,
ar... |
var spy2 = sinon.spy(function(){ |
<|file_name|>list.py<|end_file_name|><|fim▁begin|>from node import Node
from fern.ast.tools import simplify, ItemStream
from fern.primitives import Undefined
class List(Node):
def __init__(self):
Node.__init__(self)
self.children = []
self.value = None
def put(self, thingy):
if ... | else:
self.value.append(result)
def get_children(self):
return self.children |
<|file_name|>GetCategories.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
###############################################################################
#
# GetCategories
# Returns the latest category hierarchy for the eBay site.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed ... | |
<|file_name|>load_module.cpp<|end_file_name|><|fim▁begin|>#include <pybind11/embed.h>
#include <iostream>
#include <string>
namespace py = pybind11;
#include "load_module.h"
py::object LoadPyModuleFromFile(const char * file_path)
{
py::dict locals;
locals["path"] = py::cast(file_path);
py::eval<py::eva... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># 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 required by appli... | # License for the specific language governing permissions and limitations
# under the License. |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_M... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-04-25 18:48
from __future__ import unicode_literals
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(string_split_off)]
extern crate ansi_term;
#[macro_use]
extern crate lazy_static;<|fim▁hole|>
pub mod prompt;
pub mod command;
pub mod functions;
pub mod signals;
pub mod job_manager;<|fim▁end|> | |
<|file_name|>test_sensor.py<|end_file_name|><|fim▁begin|>"""Test the Advantage Air Sensor Platform."""
from datetime import timedelta
from json import loads
from homeassistant.components.advantage_air.const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from homeassistant.components.advantage_air.sensor import (
ADVANTAGE... | assert len(aioclient_mock.mock_calls) == 3
assert aioclient_mock.mock_calls[-2][0] == "GET" |
<|file_name|>search.component.ts<|end_file_name|><|fim▁begin|>import { Component, EventEmitter, ChangeDetectionStrategy, Output } from '@angular/core';
import { FormControl } from '@angular/forms';
import { Http } from '@angular/http';
import { AlbumService } from '../../services/album/album.service';
import { LoadingS... | |
<|file_name|>step_copy_image.go<|end_file_name|><|fim▁begin|>package uhost
import (
"context"
"fmt"
"github.com/hashicorp/packer/common/retry"
"strings"
"time"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
"github.com/ucloud/ucloud-sdk-go/ucloud"
)
<|fim▁hole|> RegionId ... | type stepCopyUCloudImage struct {
ImageDestinations []ImageDestination |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Run pytest with coverage and generate an html report."""
from sys import argv
from os import system as run
# To run a specific file with debug logging prints:
# py -3 -m pytest test_can.py --log-cli-format="%(asctime)s.%(msecs)d %(leve... | arg = ''
# All source files included in coverage
|
<|file_name|>image_interpolation_params.py<|end_file_name|><|fim▁begin|># Copyright 2018 The Lucid 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 obtain a copy of the License at
#
# http:/... | shaped tensor, t, where the final [width, width, channel] should be
seen as images, such that the following properties hold:
t[a, b] = t[b, a, ::-1] |
<|file_name|>artificial-block.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
fn f() -> isize { { return 3; } }
pub fn main() { assert_eq!(f(), 3); }<|fim▁end|> | // run-pass |
<|file_name|>linux.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
from pathlib import Path
from scripts.build_env import BuildEnv, Platform
from scripts.platform_builder import PlatformBuilder
class pugixmlLinuxBuilder(PlatformBuilder):
def __init__(self,
config_package: dict=Non... | config_platform: dict=None):
super().__init__(config_package, config_platform)
|
<|file_name|>utils.go<|end_file_name|><|fim▁begin|><|fim▁hole|>
package convert
import (
"strings"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/structs"
)
// ToCorrectPageSize makes sure page size is in allowed range.
func ToCorrectPageSize(size int) int {
if size <= 0 {
size = setting.AP... | // Copyright 2020 The Gitea Authors. All rights reserved.
// Copyright 2016 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. |
<|file_name|>stmt_test.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2016 Google Inc. 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.apa... | def testFutureUnicodeLiterals(self):
want = "u'foo'\n"
self.assertEqual((0, want), _GrumpRun(textwrap.dedent("""\ |
<|file_name|>CallableAndFutureTest.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package test.thread;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionExc... | } |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2011
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
#
# This is free softw... | if os.path.exists(aux_get_os):
get_os = aux_get_os
break |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .tornadoconnection import TornadoLDAPConnection |
<|file_name|>application.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* 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... | }
} |
<|file_name|>java.ts<|end_file_name|><|fim▁begin|>class System {
static out = {
println(obj?:any) {
console.log(obj);
},
print(obj:any) {
console.log(obj);
}
};
static err = {
println(obj?:any) {
console.log(obj);
},
... | if(p.equals(p2)) { |
<|file_name|>Asteroid.java<|end_file_name|><|fim▁begin|>package septemberpack.september;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import java.util.Random;
/**
* Created by Vlady on 22.10.2015.
*/
/**
* Данный класс реализует отрисовку астероидов
*/
public cla... | * Метод обновляющий координаты астероидов и задающий новые координаты при уплытии за границы фона
*/
public void update(){
if(line1y > 1400) { |
<|file_name|>ignoretogether.py<|end_file_name|><|fim▁begin|># ignore-together.py - a distributed ignore list engine for IRC.
from __future__ import print_function
import os
import sys
import yaml
weechat_is_fake = False
try:
import weechat
except:<|fim▁hole|> def command(self, cmd):
print(cmd... | class FakeWeechat: |
<|file_name|>use-uninit-match.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.or... | }
return x;
} |
<|file_name|>cordova-config.spec.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var cordovaConfig = require("./cordova-config");
describe('parseConfig function', function () {
it('should return {} when the config does not contain a widget', function () {... | id: 'theid', |
<|file_name|>models.ts<|end_file_name|><|fim▁begin|>namespace DashCI.Resources.Github {
export interface IRepository extends ng.resource.IResource<IRepository> {
id: number;
name: string;
full_name: string;
}
export interface IIssue extends ng.resource.IResource<IIssue> {
}
... | count: number;
}
} |
<|file_name|>query.js<|end_file_name|><|fim▁begin|>var dns = require('native-dns'),
util = require('util');
var question = dns.Question({
name: 'www.google.com',
type: 'A', // could also be the numerical representation
});
var start = new Date().getTime();
var req = dns.Request({
question: question,
server... | });
req.on('message', function (err, res) {
if(err) console.error(err, res); |
<|file_name|>data.go<|end_file_name|><|fim▁begin|>package prune
import (
"fmt"
"time"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/cache"
kapi "k8s.io/kubernetes/pkg/apis/core"
appsapi "github.com/openshift/origin/pkg/apps/apis/apps"
appsutil "github.com/openshift/origin/pkg/apps/util... | results = append(results, item.(*appsapi.DeploymentConfig))
}
return results, nil
} |
<|file_name|>script-explicit.rs<|end_file_name|><|fim▁begin|>extern crate boolinator;
use boolinator::Boolinator;
fn main() {<|fim▁hole|> println!("--output--");
println!("{:?}", true.as_some(1));
}<|fim▁end|> | |
<|file_name|>pages.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon<|fim▁hole|># weboob 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 ... | #
# This file is part of weboob.
# |
<|file_name|>bitcoin_bs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="bs" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About SpamSlayer</source>
<translation type="unfinish... | <translation type="unfinished"/>
</message> |
<|file_name|>OptionsRestRequest.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2013
* by 52 North Initiative for Geospatial Open Source Software GmbH
*
* Contact: Andreas Wytzisk
* 52 North Initiative for Geospatial Open Source Software GmbH
* Martin-Luther-King-Weg 24
* 48155 Muenster, Germany
* info@52... | private String resourceType; |
<|file_name|>ImageServerUtils.java<|end_file_name|><|fim▁begin|>// **********************************************************************
//
// <copyright>
//
// BBN Technologies
// 10 Moulton Street
// Cambridge, MA 02138
// (617) 873-8000
//
// Copyright (C) BBNT Solutions LLC. All rights reserved.
//
// </c... | }
if (Debug.debugging("imageserver")) {
Debug.output("ImageServerUtils.createOMProjection: projection " |
<|file_name|>apitest.py<|end_file_name|><|fim▁begin|>from leapp.topics import Topic
<|fim▁hole|><|fim▁end|> |
class ApiTestTopic(Topic):
name = 'api_test' |
<|file_name|>moment_curve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the ... | Run moment curve layout (Cohen, Eades, Lin, Ruskey 1995). |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|># coding=utf-8
from django.utils.functional import SimpleLazyObject
from mongo_auth import get_user as mongo_auth_get_user
def get_user(request):
if not hasattr(request, '_cached_user'):
request._cached_user = mongo_auth_get_user(request)
return ... | pass |
<|file_name|>eventlist.component.ts<|end_file_name|><|fim▁begin|>import {Component, EventEmitter, OnInit, TemplateRef, ViewEncapsulation} from '@angular/core';
import {routerTransition} from '../../router.animations';
import { CalendarService } from '../calendar.service';
import { Eventdate, Windy } from '../eventdate... | |
<|file_name|>spec.js<|end_file_name|><|fim▁begin|>isClear = true;
function context(description, spec) {
describe(description, spec);
};
function build() {
$('body').append('<div id="element"></div>');
};
function buildDivTarget() {
$('body').append('<div id="hint"></div>');
};
function buildComboboxTarget() {... | });
|
<|file_name|>KidneyServerSolver.java<|end_file_name|><|fim▁begin|>package web;
import graphUtil.CycleChainDecomposition;
import graphUtil.EdgeChain;
import ilog.concert.IloException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import kepLib.KepInstance;
import kepLib.KepProblemData;
import... | } else if (pmp < 20) {
return 2; |
<|file_name|>Euler12.java<|end_file_name|><|fim▁begin|>package com.martijndashorst.euler;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import org.junit.Test;
/**
* The sequence of triangle numbers is generated by adding the natural numbers.
* So the 7th triangle number wou... | |
<|file_name|>_abcoll.py<|end_file_name|><|fim▁begin|># Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they ar... | def discard(self, value): |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>var testLogin = function(){
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
alert("username="+username+" , password="+password);
}
window.onload = function (){
<|fim▁hole|><|fim▁end|> | } |
<|file_name|>rpc-client.ts<|end_file_name|><|fim▁begin|>"use strict"
import net = require("net")
import rpc = require("./rpc")
export class RpcClient {
connect(port:Number = 63342) {
var socket = net.connect({port: port}, function () {
console.log('Connected to IJ RPC server localhost:' + port)
});
... | this.byteConsumed(this.contentLength)
this.contentLength = 0
buffer = totalBuffer |
<|file_name|>allocate.rs<|end_file_name|><|fim▁begin|>// Our use cases
use super::expander;
pub fn allocate_expander(par_eax: i32, par_edx: i32) -> expander::SoundExpander {
let mut sound_expander = expander::SoundExpander::new();
let mut par_eax = par_eax;
let mut par_edx = par_edx;
sound_expander.wa... | if 2 & par_edx != 0 { |
<|file_name|>son_emu_simple_switch_13.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011 Nippon Telegraph and Telephone Corporation.
#
# 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
#
# h... |
if dst in self.mac_to_port[dpid]: |
<|file_name|>test_Factor.py<|end_file_name|><|fim▁begin|>import unittest
import warnings
from collections import OrderedDict
import numpy as np
import numpy.testing as np_test
from pgmpy.extern.six.moves import range
from pgmpy.factors.discrete import DiscreteFactor
from pgmpy.factors.discrete import JointProbability... | self.assertRaises(TypeError, factor_product, 1, 2)
|
<|file_name|>genoa.py<|end_file_name|><|fim▁begin|><|fim▁hole|> sys.exit(0)<|fim▁end|> | import sys
if __name__ == "__main__":
print("Genoa python script") |
<|file_name|>arv-enum-test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Aravis - Digital camera library
#
# Copyright (c) 2011-2012 Emmanuel Pacaud
#
# This library 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 Fre... | |
<|file_name|>ExamplePartialBeanImplementation.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source
* Copyright 2014, Red Hat, Inc. and/or its affiliates, and individual
* contributors by the @authors tag. See the copyright.txt in the
* distribution for a full listing of individual contribu... | |
<|file_name|>0004_auto__add_field_application_content_type__add_field_application_object.py<|end_file_name|><|fim▁begin|># encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Application.content_type'
... | 'country': ('django.db.models.fields.CharField', [], {'max_length': '2', 'null': 'True', 'blank': 'True'}),
'department': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_lengt... |
<|file_name|>gazelleSchema.js<|end_file_name|><|fim▁begin|>/* global GazelleSchema :true */
// obj2 is merged into obj1, replacing duplicate keys.
function merge (obj2, obj1) {
for (var k in obj2) {
try {
if (obj2[k].constructor === Object) {
obj1[k] = merge(obj1[k], obj2[k]);
} else {
... | type: String,
label: this.formatLabel('created by user id'), |
<|file_name|>client_manager.cc<|end_file_name|><|fim▁begin|>#include "client_manager.hh"
#include "buffer_manager.hh"
#include "command_manager.hh"
#include "containers.hh"
#include "event_manager.hh"
#include "face_registry.hh"
#include "file.hh"
#include "user_interface.hh"
#include "window.hh"
namespace Kakoune
{
... | WindowAndSelections ws = get_free_window(buffer);
Client* client = new Client{std::move(ui), std::move(ws.window),
std::move(ws.selections), std::move(env_vars), |
<|file_name|>uiProgressBar.cpp<|end_file_name|><|fim▁begin|>/***
* Inferno Engine v4 2015-2017
* Written by Tomasz "Rex Dex" Jonarski
*
* [# filter: elements\controls\simple #]
***/
#include "build.h"
#include "uiProgressBar.h"
#include "ui/toolkit/include/uiStaticContent.h"
namespace ui
{
//---
// active ... |
RTTI_BEGIN_TYPE_NOCOPY_CLASS(ProgressBarArea);
RTTI_METADATA(ElementClassName).setName("ProgressBarArea");
RTTI_END_TYPE(); |
<|file_name|>grid_x_y_viewbox.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# vispy: gallery 2
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
... | |
<|file_name|>actions.go<|end_file_name|><|fim▁begin|>package files
import (
"bytes"
"io"
"io/ioutil"
"strings"
"github.com/golang/protobuf/proto"
"github.com/octavore/nagax/util/errors"
uuid "github.com/satori/go.uuid"
"github.com/willnorris/imageproxy"
"github.com/ketchuphq/ketchup/proto/ketchup/models"
)
... | |
<|file_name|>user-profile.js<|end_file_name|><|fim▁begin|>import DS from 'ember-data';
export default DS.Model.extend({<|fim▁hole|> user: DS.belongsTo('user'),
userUsername: DS.attr('string'),
emailNotifications: DS.attr('boolean')
});<|fim▁end|> | |
<|file_name|>FileScanner.cpp<|end_file_name|><|fim▁begin|>//***************************************************************************
//
// Copyright (c) 1999 - 2006 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Li... | m_used = FALSE;
} |
<|file_name|>gear_transformTools.py<|end_file_name|><|fim▁begin|>'''
This file is part of GEAR_mc.
GEAR_mc is a fork of Jeremie Passerin's GEAR project.
GEAR 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... |
##########################################################
# MATCH TRANSFORM |
<|file_name|>base64.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/lic... | |
<|file_name|>change_edges.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Santosh Philip
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# ============================... | )
for edg, clean_edg in data: |
<|file_name|>IDocument.java<|end_file_name|><|fim▁begin|>/**
*
*/
package org.jbpt.pm.bpmn;
<|fim▁hole|> *
* @author Cindy F�hnrich
*/
public interface IDocument extends IDataNode {
/**
* Marks this Document as list.
*/
public void markAsList();
/**
* Unmarks this Document as list.
*/
public void ... | import org.jbpt.pm.IDataNode;
/**
* Interface class for BPMN Document. |
<|file_name|>LexModelBuildingServiceErrorMarshaller.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. 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.
* A copy of the L... |
return AWSErrorMarshaller::FindErrorByName(errorName);
} |
<|file_name|>imageprocess.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os.path
import time
import urllib
import json
import requests
from tencentyun import conf
from .auth import Auth
class ImageProcess(object):
def __init__(self, appid, secret_id, secret_key, bucket):
self.IMAGE_FILE_N... | r = requests.post(url, data=json.dumps(payload), headers=header)
ret = r.json()
return ret |
<|file_name|>canned_sentiment_analysis.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
from input_functions import get_input_fn
import tensorflow as tf
from tensorflow.contrib.keras.python.keras.datasets impor... | help='Number of output classes. ' |
<|file_name|>model.rs<|end_file_name|><|fim▁begin|>//! Struct and enum definitions of values in the Discord model.
#![allow(missing_docs)]
use super::{Error, Result};
use serde_json::Value;
use std::collections::BTreeMap;
use std::fmt;
use std::borrow::Cow;
pub use self::permissions::Permissions;
macro_rules! req {
... | |
<|file_name|>dataschema-text.js<|end_file_name|><|fim▁begin|>/**
* Provides a DataSchema implementation which can be used to work with
* delimited text data.
*
* @module dataschema
* @submodule dataschema-text
*/
/**
Provides a DataSchema implementation which can be used to work with
delimited text data.
See th... |
@example
// Process simple csv
var schema = { |
<|file_name|>EQSANSFlatTestAPIv2.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Iden... | class EQSANSFlatTest(systemtesting.MantidSystemTest):
def requiredFiles(self):
files = [] |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
__all__ = ('RatingField',)
<|fim▁hole|><|fim▁end|> | class RatingField(forms.ChoiceField):
pass |
<|file_name|>motorTemperature.js<|end_file_name|><|fim▁begin|>MotorTemperatures = new Mongo.Collection('MotorTemperatures');
// fields : value, timestamp
MotorTemperatures.allow({
insert: function(userid, temp){return true;} //for now
});
Meteor.methods({
motorTemperatureInsert: function(temp) {
check(temp... | timestamp: Date.now()
};
MotorTemperatures.insert(tempObject); |
<|file_name|>browser.py<|end_file_name|><|fim▁begin|># Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
import os, sys
def open_in_browser(link):
browser = os.environ.get('BROWSER', 'firefox')
child = os.fork()
if child == 0:
# We are the child<|fim▁hole|> exce... | try:
os.spawnlp(os.P_NOWAIT, browser, browser, link)
os._exit(0) |
<|file_name|>test_common_fields.py<|end_file_name|><|fim▁begin|>import socket
import pytest
import mock
from pygelf import GelfTcpHandler, GelfUdpHandler, GelfHttpHandler, GelfTlsHandler, GelfHttpsHandler
from tests.helper import logger, get_unique_message, log_warning, log_exception
SYSLOG_LEVEL_ERROR = 3
SYSLOG_LEV... | template = message + '_%s_%s'
graylog_response = log_warning(logger, template, args=('hello', 'gelf')) |
<|file_name|>elastic_profiles.tsx<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless... | * Copyright 2018 ThoughtWorks, Inc.
* |
<|file_name|>derive.rs<|end_file_name|><|fim▁begin|>use crate::cfg_eval::cfg_eval;
use rustc_ast as ast;
use rustc_ast::{attr, token, GenericParamKind, ItemKind, MetaItemKind, NestedMetaItem, StmtKind};
use rustc_errors::{struct_span_err, Applicability};
use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, Ind... | .span_label(span, "not applicable here")
.span_label(item.span(), "not a `struct`, `enum` or `union`")
.emit(); |
<|file_name|>books.py<|end_file_name|><|fim▁begin|>bookprefix = {
'Genesis' : '1',
'genesis' : '1',
'Gen' : '1',
'gen' : '1',
'Exodus' : '2',
'exodus' : '2',
'Exo' : '2',
'exo' : '2',
'Ex' : '2',
'ex' : '2',
'Leviticus' : '3',
'leviticus' : '3',
'Lev' : '3',
'lev'... | 'Zephaniah' : '36',
'zephaniah' : '36',
'Zeph' : '36',
'zeph' : '36', |
<|file_name|>cli_ssh.py<|end_file_name|><|fim▁begin|>'''
Created on Jun 16, 2014
@author: lwoydziak
'''
import pexpect
import sys
from dynamic_machine.cli_commands import assertResultNotEquals, Command
class SshCli(object):
LOGGED_IN = 0
def __init__(self, host, loginUser, debug = False, trace = Fals... | self._connection.sendline(str(self._bufferedCommands))
self._bufferedCommands = None |
<|file_name|>gogo_octogist.py<|end_file_name|><|fim▁begin|>'''
Use the Github API to get the most recent Gist for a list of users
Created on 5 Nov 2019
@author: si
'''
from datetime import datetime
import sys
import requests
class OctoGist:
def __init__(self):
self.base_url = 'https://api.github.com'
... | self.log(f"Couldn't get gists for {username}", "ERROR")
return
docs_fetched = 0 |
<|file_name|>harbour-jollagram_cs_CZ.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="cs_CZ" version="2.1">
<context>
<name>About</name>
<message>
<location filename="../qml/pages/About.qml" line="25"/>
<source>About</source>
<comment>About page title</com... | <translation>Pozvat přátele</translation> |
<|file_name|>test_rfkill.py<|end_file_name|><|fim▁begin|># rfkill tests
# Copyright (c) 2014, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import time
import hostapd
from hostapd import Hosta... | |
<|file_name|>censor.go<|end_file_name|><|fim▁begin|>/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless ... | defer func() {
if err := tarWriter.Close(); err != nil { |
<|file_name|>upgrade-notification.js<|end_file_name|><|fim▁begin|>'use strict';
function getBetterUpgradeMessage(foundVersion) {
let version = (foundVersion && foundVersion[1]) ? `(${foundVersion[1]}) ` : '';
return `A new version of Ghost Core ${version}is available! Hot Damn. \
<a href="http://support.ghost.... | if (elements.length === 0 && attempts > 0) {
setTimeout(() => upgradeNotification(attempts - 1), 50); |
<|file_name|>live.rs<|end_file_name|><|fim▁begin|>/// Disk scheme replacement when making live disk
use alloc::sync::Arc;
use alloc::collections::BTreeMap;
use core::{slice, str};
use core::sync::atomic::{AtomicUsize, Ordering};<|fim▁hole|>use syscall::data::Stat;
use syscall::error::*;
use syscall::flag::{MODE_DIR, M... | use spin::RwLock;
|
<|file_name|>Export_Count_Station_Location.py<|end_file_name|><|fim▁begin|>'''
Copyright 2015 Travel Modelling Group, Department of Civil Engineering, University of Toronto
This file is part of the TMG Toolbox.
The TMG Toolbox is free software: you can redistribute it and/or modify
it under the terms ... | |
<|file_name|>samples_compact_yaml.py<|end_file_name|><|fim▁begin|>SAMPLES_YAML = {
'a': """\
- a1-a: [pk]
- [A1]
- [A2]
- [B1]
- [C1]
- [C2]
- [D1]
- [E1]
- [P1]
""",
'b': """\
- a1-a: [pk]
- [B1]
- [C1]
... | - a1-a: [pk]
- [C1]
- [C2] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.