prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Functions.js<|end_file_name|><|fim▁begin|>var util = require('util');
var fs = require('fs');
var path = require('path');
var ltrim = require('underscore.string/ltrim');
exports.isCommand = function (input) {
if (input.toLowerCase().substr(0, prefix.length) === prefix)
return true;
else
return... | |
<|file_name|>quest_player_manager.py<|end_file_name|><|fim▁begin|>from copy import deepcopy
import settings
from twitch.player_manager import PlayerManager
class QuestPlayerManager(PlayerManager):
"""
Functions like add_gold perform a raw store action and then save. __add_gold is the raw store action in this... | self.__penalize(user, gold=gold, exp=exp, item=item, prestige_benefits=prestige_benefits)
else: |
<|file_name|>unique-mutable.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/... |
pub fn main() {
let mut i = ~0; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in com... | # See https://github.com/GrahamDumpleton/mod_wsgi/issues/184 for more. |
<|file_name|>ip_renewer_gui.py<|end_file_name|><|fim▁begin|>import weakref
import logging<|fim▁hole|>from core.api import api
from core.config import conf
from qt import signals
#Config parser
OPTION_IP_RENEW_ACTIVE = "ip_renew_active"
OPTION_RENEW_SCRIPT_ACTIVE = "renew_script_active"
class IPRenewerGUI:
"""""... | logger = logging.getLogger(__name__)
import core.cons as cons |
<|file_name|>pitchanalysis.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
pitchanalysis.py
--
Christopher Kuech
cjkuech@gmail.com
--
Requires:
Python 2.7
Instructions:
python pitchanalysis.py [wav-file-name]
"""
import matplotlib
from math import log
matplotlib.use("TkAgg")
from matplotlib.backends... | |
<|file_name|>test_static.py<|end_file_name|><|fim▁begin|>import unittest
from cStringIO import StringIO
from ..backends import static
# There aren't many tests here because it turns out to be way more convenient to
# use test_serializer for the majority of cases
class TestStatic(unittest.TestCase):
def compile... | def test_api(self):
data = """key: |
<|file_name|>.happydoc.TkMoleculeDrawer.py<|end_file_name|><|fim▁begin|>(S'7f2210613c44962221805a1b28aa76d6'
p1
(ihappydoclib.parseinfo.moduleinfo
ModuleInfo
p2
(dp3
S'_namespaces'
p4
((dp5
S'TkDrawer'
p6
(ihappydoclib.parseinfo.classinfo
ClassInfo
p7
(dp8
g4
((dp9
(dp10
tp11
sS'_filename'
p12
S'../python/frowns/Depict... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -------------------------------- Database models----------------------------------------------------------------------
import sys, os
import sqlalchemy
from sqlalchemy import create_engine
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.absp... | from sqlalchemy import ForeignKey |
<|file_name|>jquery.inputmask.extensions.js<|end_file_name|><|fim▁begin|>/*
Input Mask plugin extensions
http://github.com/RobinHerbots/jquery.inputmask
Copyright (c) 2010 - 2014 Robin Herbots
Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
Version: 0.0.0
Optional extensions on the ... | urlpre3: new RegExp("(ftp|htt)"),
urlpre4: new RegExp("(ftp:|http|ftps)"), |
<|file_name|>EntityMethodPostUpdateTest.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 1998, 2015 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms o... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse
from django.shortcuts import render
from survey.models import Choice
from survey.forms import ChoiceForm
import csv
import random
# Create your views here.
def index(request):
examples = ['controlling Exposure', 'changing Temp... |
return response |
<|file_name|>Equipment.java<|end_file_name|><|fim▁begin|>package com.winsun.fruitmix.model;
/**
* Created by Administrator on 2016/7/6.
*/
public class Equipment {
private String serviceName;
private String host;
private int port;
public Equipment(String serviceName, String host, int port) {
... | }
public int getPort() { |
<|file_name|>timeseries.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This module will define useful objects for conditional analysis
"""
import collections
import numpy as np
import pandas as pd
from tunacell.base.datatools import Coordinates
# define an object to handle heterog... | dic[self.timeseries.x_name].extend(_x)
dic[self.timeseries.y_name].extend(_y)
dic['cellID'].extend(len(_x) * [self.ids[index], ]) |
<|file_name|>SocketStatus.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 to You un... | *
* @author remm
*/
public enum SocketStatus { |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate uu_cut;<|fim▁hole|>
fn main() {
std::process::exit(uu_cut::uumain(std::env::args().collect()));
}<|fim▁end|> | |
<|file_name|>ka.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.<|fim▁hole|>CKEDITOR.plugins.setLang( 'removeformat', 'ka', {
toolbar: 'ფორმატირების მოხსნა'
} );<|fim▁end|> | For licensing, see LICENSE.md or http://ckeditor.com/license
*/ |
<|file_name|>test_schematron_1_3.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
import unittest
import io
from lxml import isoschematron, etree
from packtools.catalogs import SCHEMAS
SCH = etree.parse(SCHEMAS['sps-1.3'])
def TestPhase(phase_name, cache):
"""Factory of ... | <collab>Foo</collab> |
<|file_name|>buildbot_selector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import subprocess
import sys
sys.path.append... |
BOT_ASSIGNMENT = {
###################################################################### |
<|file_name|>test_analyser.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file contains a class to analyse text in giellatekno xml format
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free ... | |
<|file_name|>init.py<|end_file_name|><|fim▁begin|>"""
Created on Thu May 05 20:02:00 2011
@author: Tillsten
"""
import numpy as np
from scipy.linalg import qr
eps = np.finfo(float).eps
def mls(B, v, umin, umax, Wv=None, Wu=None, ud=None, u=None, W=None, imax=100):
"""
mls - Control allocation using... | implementation does not handle the case of coplanar controls.
Inputs:
-------
|
<|file_name|>compareWithPreviousOutputs.check.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Amadeus s.a.s.
* 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.o... | "version1.parse",
"version2.parse",
"user.parse", |
<|file_name|>4d8d18f311aa_add_deleted_bool_to_.py<|end_file_name|><|fim▁begin|>"""add deleted bool to things
Revision ID: 4d8d18f311aa
Revises: 4e34b4290fbc
Create Date: 2019-02-27 21:31:09.575521
"""
# revision identifiers, used by Alembic.
revision = '4d8d18f311aa'
down_revision = '4e34b4290fbc'
from alembic impo... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# ChatterBot documentation build configuration file, created by
# sphinx-quickstart on Mon May 9 14:38:54 2016.
import sys
import os
import sphinx_rtd_theme
from datetime import datetime
# Insert the project root dir as the first element in... | #source_encoding = 'utf-8-sig'
|
<|file_name|>base.js<|end_file_name|><|fim▁begin|>define([
'domReady',
'jquery',
'underscore',
'gettext',
'common/js/components/views/feedback_notification',
'common/js/components/views/feedback_prompt',
'js/utils/date_utils',
'js/utils/module',
'js/utils/handle_iframe_binding',
... | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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 applicable law or agreed to in writing, software
# distributed under the ... | # Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>simple_api_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "tools/json_schema_compiler/test/simple_api.h"
#include "testing/gtest/incl... | |
<|file_name|>unicodetext.cc<|end_file_name|><|fim▁begin|>// Copyright (C) 2006 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
setup(<|fim▁hole|> name='Korail',
packages=['korail'],
version='0.0.3',
description='An unoffical API for Korail.',
long_description=open('README.rst').read(),
license='BSD License',
author='Su Yeol Jeon',
... | |
<|file_name|>small-enum-range-edge.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.apac... | // except according to those terms.
/*! |
<|file_name|>consumer.py<|end_file_name|><|fim▁begin|>import datetime
import logging
import os
import signal
import threading
import time
from multiprocessing import Event as ProcessEvent
from multiprocessing import Process
try:
import gevent
from gevent import Greenlet
from gevent.event import Event as G... | |
<|file_name|>helpers.js<|end_file_name|><|fim▁begin|>DV.Schema.helpers = {
HOST_EXTRACTOR : (/https?:\/\/([^\/]+)\//),
annotationClassName: '.DV-annotation',
// Bind all events for the docviewer
// live/delegate are the preferred methods of event attachment
bindEvents: function(context){
va... | if (this.viewer.options.zoom == 'auto') {
zoom = Math.min(
700,
windowWidth - (this.viewer.models.pages.REDUCED_PADDING * 2) |
<|file_name|>EncapsulateUI.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2017, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided tha... | |
<|file_name|>optionsmodel.cpp<|end_file_name|><|fim▁begin|>#include "optionsmodel.h"
#include "bitcoinunits.h"
#include <QSettings>
#include "init.h"
#include "walletdb.h"
#include "guiutil.h"
OptionsModel::OptionsModel(QObject *parent) :
QAbstractListModel(parent)
{
Init();
}
bool static ApplyProxySettings(... | int OptionsModel::getDisplayUnitBrostake()
{ |
<|file_name|>RideNavigator.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010 Mark Liversedge (liversedge@gmail.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2... | {
// paint background for user defined color ?
bool rideBG = appsettings->value(this,GC_RIDEBG,false).toBool(); |
<|file_name|>grayscale.rs<|end_file_name|><|fim▁begin|>#pragma version(1)
#pragma rs java_package_name(com.example.background)
rs_allocation in;<|fim▁hole|>
uint32_t width;
uint32_t height;
void root(const uchar4* v_in, uchar4* v_out, const void* usrData, uint32_t x, uint32_t y) {
int r = v_in->r;
int g = v_in->g... | rs_allocation out;
rs_script script; |
<|file_name|>dump.py<|end_file_name|><|fim▁begin|># This file is part of Codetrawl
# Copyright (C) 2015 Nathaniel Smith <njs@pobox.com>
# See file LICENSE.txt for license information.
"""Usage:
codetrawl.dump PATTERN FILE [FILE...]
where PATTERN is a Python format string like "{raw_url}", with allowed keys:
- ser... |
if __name__ == "__main__":
args = docopt.docopt(__doc__)
|
<|file_name|>make-release.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make-release
~~~~~~~~~~~~
Helper script that performs a release. Does pretty much everything
automatically for us.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for... | def parse_date(string): |
<|file_name|>application_test.js<|end_file_name|><|fim▁begin|>/*globals EmberDev */
import Ember from "ember-metal/core";
import {get} from "ember-metal/property_get";
import {set} from "ember-metal/property_set";
import {forEach} from "ember-metal/array";
import run from "ember-metal/run_loop";
import Application fro... | |
<|file_name|>ioptron.py<|end_file_name|><|fim▁begin|>import re
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.time import Time
from panoptes.mount.mount import AbstractMount
from ..utils.logger import has_logger
from ..utils.config import load_config
from ..utils import error as... | self.logger.info('Initializing {} mount'.format(__name__)) |
<|file_name|>ConnectionWrapper.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This file is part of OpenNMS(R).
*<|fim▁hole|> *
* OpenNMS(R) is a registered trademark of The OpenNMS Group, Inc.
*
* OpenNMS(R) is free software: you can redistribut... | * Copyright (C) 2006-2011 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2011 The OpenNMS Group, Inc. |
<|file_name|>abdt_branch__t.py<|end_file_name|><|fim▁begin|>"""Test suite for abdt_branch."""
# =============================================================================
# TEST PLAN
# -----------------------------------------------------------------------------
# Here we detail the... |
for do_transition in transition_list:
branches = phlgit_branch.get_remote(self.repo_arcyd, 'origin') |
<|file_name|>authconfig_data.go<|end_file_name|><|fim▁begin|>package data
import (
"github.com/rancher/rancher/pkg/auth/providers/activedirectory"
"github.com/rancher/rancher/pkg/auth/providers/azure"
"github.com/rancher/rancher/pkg/auth/providers/github"
"github.com/rancher/rancher/pkg/auth/providers/googleoauth"... | if err := addAuthConfig(github.Name, client.GithubConfigType, false, management); err != nil {
return err
}
|
<|file_name|>node.go<|end_file_name|><|fim▁begin|>package interpreter
import (
"fmt"
"github.com/Azer0s/Hummus/parser"
)
// NodeType a variable type
type NodeType uint8
// Node a variable node
type Node struct {
Value interface{}
NodeType NodeType
}
const (
// NODETYPE_INT int variable type
NODETYPE_INT No... | NODETYPE_STRUCT NodeType = 8
)
// FnLiteral a function literal (block) |
<|file_name|>test_key.py<|end_file_name|><|fim▁begin|>from nose.tools import istest, eq_<|fim▁hole|> @istest
def same_key_is_equal(self):
eq_(Key("key"), Key("key"))
@istest
def key_is_usable_as_key(self):
key_dict = {
Key("key"): "Value"
}
eq_(key_dict[Key("k... | from tetris.values.key import Key
class TestKey(object):
|
<|file_name|>plugin_padtools_ru.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="ru_RU">
<context>
<name>PadTools::Internal::PadWriter</name>
<message>
<location filename="../../plugins/padtoolsplugin/padwriter.ui" line="14"/>
<sour... | </context>
<context> |
<|file_name|>workspace.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>#include <new>
static const int32_t EXT_CONST = 0;
struct ExtType {
uint32_t data;
};
extern "C" {
void consume_ext(ExtType _ext);
} // extern "C"<|fim▁end|> | #include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream> |
<|file_name|>iter-step-overflow-debug.rs<|end_file_name|><|fim▁begin|>// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes
use std::panic;
fn main() {
let r = panic::catch_unwind(|| {
let mut it = u8::MAX..;
it.next().unwrap(); // 255<|fi... | it.next().unwrap();
});
assert!(r.is_err());
|
<|file_name|>ur.py<|end_file_name|><|fim▁begin|>from ..rerequest import TemplateRequest
init_req = TemplateRequest(
re = r'(http://)?(www\.)?(?P<domain>ur(play)?)\.se/(?P<req_url>.+)',
encode_vars = lambda v: { 'req_url': 'http://%(domain)s.se/%(req_url)s' % v } )
hls = { 'title': 'UR-play', 'url': 'http://... | |
<|file_name|>client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
import json
import click
import serial
import pkg_resources
import serial.tools.list_ports
import logging.config
from educube.web import server as webserver
import logging
logger = logging.getLogger(__name__)
plugin_folder... | suggested_educube_port = ports[-1]
if suggested_educube_port.description == 'BASE':
return 9600 |
<|file_name|>centrifuge.py<|end_file_name|><|fim▁begin|>from protocols.forms import forms
from core.utils import SPEED_UNITS
class CentrifugeForm(forms.VerbForm):
name = "Centrifuge"
slug = "centrifuge"
has_machine = True
# duration = forms.IntegerField(help_text='this is the minimal time this should... | # speed_comment = forms.CharField(required=False) |
<|file_name|>ExportResultsAction.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* <copyright> Copyright (c) 2014 - 2021 Bauhaus Luftfahrt e.V.. All rights reserved. This program and the accompanying
* materials are made available under the terms of t... |
result.setAverageNumberOfActivePassengers( |
<|file_name|>em_ahc_test.py<|end_file_name|><|fim▁begin|>import unittest
import pylab as pl
import matplotlib as mpl
import itertools
import sys
import math
import timeit
import copy
from em import *
def generate_synthetic_data(N):
np.random.seed(0)
C = np.array([[0., -0.7], [3.5, .7]])
C1 = np.array([[-0... | 'max_num_dimensions': ['50'], |
<|file_name|>test_reboot_unprovisioned.py<|end_file_name|><|fim▁begin|># Copyright 2015 Rackspace, 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
#
# ... | active_node = self._get_test_node(
provision_state=states.ACTIVE,
instance_uuid='118ad976-084a-443f-9ec5-77d477f2bfcc') |
<|file_name|>heuristics.py<|end_file_name|><|fim▁begin|>import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.utcnow()
return date + ... | 'cache-control': 'public',
}
def warning(self, response): |
<|file_name|>github.py<|end_file_name|><|fim▁begin|>import hashlib
import hmac
import json
import requests
class GitHubResponse:
"""Wrapper for GET request response from GitHub"""
def __init__(self, response):
self.response = response
@property
def is_ok(self):
"""Check if request ha... | :rtype: ``repocribro.github.GitHubResponse``
""" |
<|file_name|>pretty.rs<|end_file_name|><|fim▁begin|>// Pris -- A language for designing slides
// Copyright 2017 Ruud van Asseldonk
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 3. A copy
// of the License is available in the roo... | ///
/// This is similar to `assert_eq!`, but using `Print` rather than `fmt::Debug`.
#[macro_export] |
<|file_name|>0003_remove_message_issue.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
('msgs', '0002_auto_20150204_1116'),
]
operations = [
migrations.RemoveField(
... |
from django.db import models, migrations
|
<|file_name|>TypePayment.java<|end_file_name|><|fim▁begin|>package st.domain.quitanda.client.model.contract;
/**
* Created by Daniel Costa at 8/27/16.
* Using user computer xdata
*/
public interface TypePayment<|fim▁hole|><|fim▁end|> | {
public int getDataBaseId();
} |
<|file_name|>page_runner.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import time
import traceback
import urlparse
import random
import csv
f... | test_random.shuffle(self.page_set) |
<|file_name|>ghtml.go<|end_file_name|><|fim▁begin|>// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
// Package g... |
// StripTags strips HTML tags from content, and returns only text. |
<|file_name|>vnstat.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Display vnstat statistics.
Coloring rules.
If value is bigger that dict key, status string will turn to color, specified
in the value.
Example:
coloring = {
800: "#dddd00",
900: "#dd0000",
}
(0 - 8... | try:
type, number, ts, rxm, txm, rxk, txk, fill = filter_stat().split(";") |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import time
import json
import datetime
import urllib
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from django_dynamic_fixture import G
from django.utils.dateformat import format
from .utils import datetime_to_timestamp, timest... | self.assertEqual(response.status_code, 404)
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django import forms
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_required
from django.shortcuts import render
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from data... |
@staff_member_required |
<|file_name|>thumbnail.js<|end_file_name|><|fim▁begin|>(function (factory) {
if (typeof module === 'object' && typeof module.exports === 'object') {
var v = factory(require, exports); if (v !== undefined) module.exports = v;
}
else if (typeof define === 'function' && define.amd) {
define(["r... | var core_1 = require('@angular/core'); |
<|file_name|>new.go<|end_file_name|><|fim▁begin|>package buildah
import (
"context"
"fmt"
"math/rand"
"strings"
"github.com/containers/buildah/define"
"github.com/containers/buildah/pkg/blobcache"
"github.com/containers/common/libimage"
"github.com/containers/common/pkg/config"
"github.com/containers/image/v... | }
err = builder.Save()
if err != nil { |
<|file_name|>css.js<|end_file_name|><|fim▁begin|>// Modules.<|fim▁hole|> config = require('../../config'),
path = require('path');
// Package libraries.
gulp.task('package:css', () => {
'use strict';
let sourcePath = path.join(config.development.paths.css, '**/*');
let destinationPath = config.pack... | let gulp = require('gulp'), |
<|file_name|>test_ntpath.py<|end_file_name|><|fim▁begin|>import ntpath
import os
import sys
from test.test_support import TestFailed
from test import test_support, test_genericpath
import unittest
def tester0(fn, wantResult):
gotResult = eval(fn)
if wantResult != gotResult:
raise TestFailed, ... | |
<|file_name|>get_effective_class_service.py<|end_file_name|><|fim▁begin|>##############################################################################
#<|fim▁hole|># designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# ... | # OSIS stands for Open Student Information System. It's an application |
<|file_name|>qspsound.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2009 AI */
/* Copyright (C) 2011-2012 Yury P. Fedorchenko (yuryfdr at users.sf.net) */
/*
* 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 Fr... | }
pthread_mutex_lock(&played.mt);
if(name==played.name.substr(GetQuestPath().size())){ |
<|file_name|>builder.go<|end_file_name|><|fim▁begin|>package cmd
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
docker "github.com/fsouza/go-dockerclient"
"github.com/golang/glog"
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/runtime"
s2iapi ... | return nil
} |
<|file_name|>show_status.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright 2019 IBM Corp.
#
# 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
#
# htt... | bridge_vlan_mgmt_client = 'br' + str(vlan_mgmt_client)
|
<|file_name|>AppCompatPreferenceActivity.java<|end_file_name|><|fim▁begin|>/**
Copyright:
2015/2016 Benjamin Aigner
developer.google.com
This file is part of AustrianPublicStream.
AustrianPublicStream is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as... | @Override
public void setContentView(@LayoutRes int layoutResID) {
getDelegate().setContentView(layoutResID);
} |
<|file_name|>AbstractDozerB2IBeanConverter.java<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2012 GFT Appverse, S.L., Sociedad Unipersonal.
This Source Code Form is subject to the terms of the Appverse Public License
Version 2.0 (“APL v2.0”). If a copy of the APL was not distributed with this
file, You can obta... | final List<IntegrationBean> integrationBeans,
List<BusinessBean> businessBeans) throws Exception {
if (integrationBeans.size() != businessBeans.size()) {
throw new ListDiffersSizeException(); |
<|file_name|>setting.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2018 The Gitea 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 repo
import (
"errors"
"fmt"
"io/io... | |
<|file_name|>io_util_test.go<|end_file_name|><|fim▁begin|>package util
import (
"testing"
. "github.com/bborbe/assert"
)
func TestIsDirectory(t *testing.T) {
isDir, err := IsDirectory("/tmp")
if err := AssertThat(err, NilValue()); err != nil {
t.Fatal(err)
}
if err := AssertThat(isDir, Is(true)); err != nil ... | }
} |
<|file_name|>toku_crash.cc<|end_file_name|><|fim▁begin|>/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
#ident "$Id$"
/*
COPYING CONDITIONS NOTICE:
This program is free software; you can redistribute it and/or modify
it under the terms of version ... | CONDITIONS NOTICE, the COPYRIGHT NOTICE (below), the
DISCLAIMER (below), the UNIVERSITY PATENT NOTICE (below), the
PATENT MARKING NOTICE (below), and the PATENT RIGHTS |
<|file_name|>docker_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 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.apache.org... | if len(containersInfo) < 2 { |
<|file_name|>null-presence-channel.d.ts<|end_file_name|><|fim▁begin|>import { NullChannel } from './null-channel';
import { PresenceChannel } from './presence-channel';
export declare class NullPresenceChannel extends NullChannel implements PresenceChannel {
here(callback: Function): NullPresenceChannel;
<|fim▁h... | joining(callback: Function): NullPresenceChannel;
leaving(callback: Function): NullPresenceChannel;
whisper(eventName: any, data: any): NullPresenceChannel;
} |
<|file_name|>browser.ts<|end_file_name|><|fim▁begin|>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
'use strict';
import {
IContentsModel
} from 'jupyter-js-services';
import {
Message
} from 'phosphor-messaging';
import {
PanelLayout
} from 'phosphor-pan... | * Handle a model refresh.
*/
private _handleRefresh(): void { |
<|file_name|>repl.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// Compiled by ClojureScript 0.0-2311
goog.provide('antares.repl');
goog.require('cljs.core');
goog.require('weasel.repl');
goog.require('weasel.repl');
console.log("WEASEL REPL ACTIVATED");
weasel.repl.connect.call(null,"ws://localhost:9001",new cljs.core.K... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! FFI bindings to alink.
#![no_std]
#![experimental]
extern crate winapi;
use winapi::*;
extern "system" {
}<|fim▁end|> | |
<|file_name|>gdiobj.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////
// Name: src/msw/gdiobj.cpp
// Purpose: wxGDIObject class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: gdiobj.cpp 40626 2006-08-16 1... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate crypto;
extern crate hyper;
extern crate rustc_serialize;
extern crate rand;
mod hmac_sha1;
use hyper::server::{Server, Request, Response};
use hyper::status::StatusCode;
use hyper::net::Fresh;
use hyper::uri::RequestUri::AbsolutePath;
const HOST: &'stat... | };
if insecure_compare(&file_hash[..], &parsed_signature[..]) {
StatusCode::Ok
} |
<|file_name|>download-exercise-images.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 *-*
# This file is part of wger Workout Manager.
#
# wger Workout Manager 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 F... | images = requests.get(image_api.format(remote_url, exercise_id)).json()
if images['count']: |
<|file_name|>TextItem.cpp<|end_file_name|><|fim▁begin|>#include "TextItem.h"
#include <QPainter>
#include <QFont>
#include <QDebug>
////////////////////////////////////////////////////////////////
TextItem::TextItem(const QString& text, QGraphicsLayoutItem *parent)
: BaseItem(parent)
{
_text = text;
QFon... | void TextItem::setFont(const QFont &font)
{ |
<|file_name|>CLP.cpp<|end_file_name|><|fim▁begin|>#include "CLP.h"
#include <sstream>
#include <iostream>
namespace osuCrypto
{
void CLP::parse(int argc, char const*const* argv)
{
if (argc > 0)
{
std::stringstream ss;
auto ptr = argv[0];
while... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Natural Language Toolkit: Classifiers
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Classes and interfaces for labeling tokens with category lab... | |
<|file_name|>base_test.go<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: ISC
// Copyright (c) 2014-2020 Bitmark Inc.
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package transactionrecord_test
import (
"bytes"
"encoding/json"
"reflect"
"testing"
"g... | r := transactionrecord.OldBaseData{
Currency: currency.Bitcoin,
PaymentAddress: "mipcBbFg9gMiCh81Kj8tqqdgoZub1ZJRfn",
Owner: proofedByAccount, |
<|file_name|>learning_unit.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, fac... | LearningUnitHyperlinkedRelatedField
|
<|file_name|>course.py<|end_file_name|><|fim▁begin|>"""
Views related to operations on course objects
"""
import copy
import json
import logging
import random
import string # pylint: disable=deprecated-module
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.e... | |
<|file_name|>ChatFromSimulator.ts<|end_file_name|><|fim▁begin|>import { Constants } from '../../utilities'
import { UUID } from '../types'
import Delegate from './Delegate'
class ChatFromSimulator extends Delegate {
public handle(packet): void {
for (const data of packet.data.chatData) {
const chatter = {... | name: data.fromName.toString().slice(0, -1),
type: data.sourceType, |
<|file_name|>OOMPpart_RESE_0805_X_O271_67.py<|end_file_name|><|fim▁begin|>import OOMP
<|fim▁hole|>newPart.addTag("oompColor", "X")
newPart.addTag("oompDesc", "O271")
newPart.addTag("oompIndex", "67")
OOMP.parts.append(newPart)<|fim▁end|> | newPart = OOMP.oompItem(9452)
newPart.addTag("oompType", "RESE")
newPart.addTag("oompSize", "0805") |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import sinon from 'sinon';
import chai from 'chai';
import sinonChai from "sinon-chai";<|fim▁hole|>import subset from 'chai-subset';
window.sinon = sinon;
window.chai = chai;
chai.use(sinonChai);
chai.use(subset);
window.expect = chai.expect;
window.should = chai.sho... | |
<|file_name|>DateFunctionsTest.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2020 ArangoDB GmbH, Cologne, Germany
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, V... | flagBuilder.clear(); |
<|file_name|>issue_922.rs<|end_file_name|><|fim▁begin|>use juniper::*;
struct Query;
#[juniper::graphql_object]
impl Query {
fn characters() -> Vec<CharacterValue> {
vec![
Into::into(Human {
id: 0,
name: "human-32".to_owned(),
}),
Into::i... | #[derive(juniper::GraphQLObject)]
#[graphql(impl = CharacterValue)] |
<|file_name|>wiki2.js<|end_file_name|><|fim▁begin|>(function($)
{
$(document).ready(function()
{
$('.nsfw').on('click', function()
{
if($(this).hasClass('show'))
{
$(this).removeClass('show');
}
else
{
$(... | {
if($(this).hasClass('show')) |
<|file_name|>api.py<|end_file_name|><|fim▁begin|># Copyright 2016 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | self._ssl_cert = config.get("ssl_cert", False) |
<|file_name|>arith.py<|end_file_name|><|fim▁begin|><|fim▁hole|> """Add two numbers"""
return x + y<|fim▁end|> | def add(x, y): |
<|file_name|>tee.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"
"io"
"log"
"os"
"os/signal"
"syscall"
)
func init() {
log.SetFlags(0)
log.SetOutput(os.Stderr)
}
func main() {
var (
flags int = (os.O_WRONLY | os.O_CREATE)
exitval int
files []io.Writer = []io.Writer{os.Stdout}
)
app... | os.Exit(exitval) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.