prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>simclock.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum 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... |
ev.s.mu.Lock() |
<|file_name|>OpenNebula.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
#
# IM - Infrastructure Manager
# Copyright (C) 2011 - GRyCAP - Universitat Politecnica de Valencia
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... |
@patch('IM.connectors.OpenNebula.ServerProxy')
@patch('IM.connectors.OpenNebula.OpenNebulaCloudConnector.getONEVersion') |
<|file_name|>test_list_endpoints.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 OpenStack, 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/LIC... | ])
# test ustom path without trailing slash
custom_path_le = list_endpoints.filter_factory({ |
<|file_name|>platform_detect.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Modified by Mauy5043 (2016)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in t... | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.core.urlresolvers import reverse
from vkontakte_api.admin import VkontakteModelAdmin
from .models import Album, Video
class VideoInline(admin.TabularInline):
def image(self, instance):
return '<img src="%s" />' % (instance.photo_... | # -*- coding: utf-8 -*-
from django.contrib import admin |
<|file_name|>HotController.js<|end_file_name|><|fim▁begin|>import webpack from "webpack"
import { spawn } from "child_process"
import appRootDir from "app-root-dir"
import path from "path"
import { createNotification } from "./util"
import HotServerManager from "./HotServerManager"
import HotClientManager from "./Hot... | import ConfigFactory from "../webpack/ConfigFactory"
import StatusPlugin from "../webpack/plugins/Status"
|
<|file_name|>test_schedule.py<|end_file_name|><|fim▁begin|># 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 Foundation, either version 3 of the L... | |
<|file_name|>KnightBlack.java<|end_file_name|><|fim▁begin|>package ru.job4j.chess.firuges.black;
import ru.job4j.chess.ImpossibleMoveException;
import ru.job4j.chess.firuges.Figure;
import ru.job4j.chess.firuges.Cell;
/**
* Black Knight.
* @author Natasha Panchina (panchinanata25@gmail.com)
* @version 1
* @since ... | || Math.abs(deltax - deltay) == 1 && deltay == 2) {
result = true;
}
return result; |
<|file_name|>radix.go<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2020 Simon Schmidt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
... | |
<|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 cyphers</source>
... | <location line="+58"/>
<source>To</source>
<translation>Til</translation> |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>};
export default IIcon;<|fim▁end|> | export const IIcon = {
name: 'i-icon', |
<|file_name|>bitcoin_pt_PT.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_PT" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About bitcoinlite</source>
<translation type="u... | <message>
<location line="+6"/> |
<|file_name|>test_Abstract_Factory_Pattern.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# @auth ivan
# @time 2016-10-14 16:36:15
# @goal test Abstract Factory Pattern
class Shape:
def __init__(self):
return
<|fim▁hole|>
class Circle(Shape):
def draw(self):
print("Inside Circle::draw... | def draw(self):
return
# Circle Rectangle Square
|
<|file_name|>fn6.js<|end_file_name|><|fim▁begin|>{<|fim▁hole|> "name": "fn6.js",
"url": "https://github.com/stefanwimmer128/fn6.js.git"
}<|fim▁end|> | |
<|file_name|>ForwardDependenciesBuilder.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* 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... | if (vFile != null) {
if (indicator != null) { |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>//! Error manipulations.
use std::error::Error;
use std::ffi::{self, CStr};
use std::fmt;
use std::ptr;
use std::sync::Arc;
use rdkafka_sys as rdsys;
use rdkafka_sys::types::*;
use crate::util::{KafkaDrop, NativePtr};
// Re-export rdkafka error code
pub use rdsys::... | }
|
<|file_name|>lab.py<|end_file_name|><|fim▁begin|>import cryspy.numbers
import cryspy.geo
class Goniometer:
def __init__(self, motiontype, axis, direction, parametername):
assert motiontype in ["translation", "rotation"], \
"First parameter for creating a Goniometer " \
"must be one ... | # assert len(parameters) == 1, \
# "A Goniometer which is not composed can have only one " \
# "parameter."
# parametername = list(parameters.keys())[0] |
<|file_name|>attributes.py<|end_file_name|><|fim▁begin|>from __future__ import (absolute_import, division, print_function,
unicode_literals)
from prov.model import *
EX_NS = Namespace('ex', 'http://example.org/')
EX_OTHER_NS = Namespace('other', 'http://example.org/')
class TestAttributesBa... | def test_entity_with_one_type_attribute_25(self): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2013-2015 Noviat nv/sa (www.noviat.com).
#
# This program is free software: you can redis... | #
##############################################################################
from . import account |
<|file_name|>optimize.js<|end_file_name|><|fim▁begin|>/**
* Created by joonkukang on 2014. 1. 16..
*/
var math = require('./utils').math;
let optimize = module.exports;
optimize.hillclimb = function(options){
var domain = options['domain'];
var costf = options['costf'];
var i;
var vec = [];
for(... | newVec.push(vec[i]); |
<|file_name|>output.py<|end_file_name|><|fim▁begin|># Copyright 2015 Isotoma Limited
#
# 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
#
# Unles... | |
<|file_name|>class-super.py<|end_file_name|><|fim▁begin|>class Base:
def meth(self):
print("in Base meth")
class Sub(Base):
def meth(self):<|fim▁hole|> print("in Sub meth")
return super().meth()
a = Sub()
a.meth()<|fim▁end|> | |
<|file_name|>em_bridge_lifecycle_states.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 a... | }
return values |
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>//! # Errors
//!
//! Rust doesn't have exceptions, so errors are expressed as a variant on
//! the standard library [`Result`]() type that implements the [`Error`]()
//! trait.
//! The problem with the `Error` trait is that it can be cumbersome to implement
//! manual... | }
PersonNotFound { |
<|file_name|>directxtest_index_buffer.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016 by Alexander Schroeder
*/
#include <agge/graphics/render_context.hpp>
#include "agge/graphics/index_buffer.hpp"
#include "directxtest_test.hpp"
using agge::graphics::index_buffer;
using agge::graphics::index_type... | {
|
<|file_name|>diskstats_common.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LI... | // +build !nodiskstats
// +build openbsd linux darwin |
<|file_name|>block.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2016 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/licenses/L... |
func (b *BlockData) Hash() []byte { |
<|file_name|>f5trafficshield.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
NAME = 'F5 Trafficshield'
def is_waf(self):
for hv in [['cookie', '^ASINFO='], ['server', 'F5-TrafficShield']]:
r = self.matchheader(hv)
if r is None:
return
elif r:<|fim▁hole|> return False... | return r
# the following based on nmap's http-waf-fingerprint.nse
if self.matchheader(('server', 'F5-TrafficShield')):
return True |
<|file_name|>CustomDataIndicatorExtensionsAlgorithm.py<|end_file_name|><|fim▁begin|># QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... |
### <summary>
### The algorithm creates new indicator value with the existing indicator method by Indicator Extensions
### Demonstration of using the external custom datasource Quandl to request the VIX and VXV daily data |
<|file_name|>hello.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | println!("hello, world!"); |
<|file_name|>tlsconfig_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 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
... | |
<|file_name|>_tceparser.py<|end_file_name|><|fim▁begin|>"""
Tensor Contraction Engine output parser.
This module provides parsers of the output of the Tensor Contraction Engine of
So Hirata into Tensor objects in drudge.
"""
import collections
import itertools
import re
from sympy import nsimplify, sympify, Symbol... | raise ValueError('Invalid TCE output line', line)
factors_str = match_res.group('factors').strip() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__doc__ = """
Preprocess input data, include
`video` format should be `avi` or `mp4`
`slide` format should be `pdf` and auto-convert to `jpg` or
a set of `jpg` images
`summary` save `video` and `slide` infomation to summary store
`reducer` re... | |
<|file_name|>contact-events.ts<|end_file_name|><|fim▁begin|>import { EventEmitter } from 'events'
import type TypedEventEmitter from 'typed-emitter'
import type {
ContactInterface,
FriendshipInterface,
MessageInterface,
} from '../user-modules/mod.js'
type ContactEventListenerMessage = (... | |
<|file_name|>problem_38.py<|end_file_name|><|fim▁begin|>"""38. Count and Say
https://leetcode.com/problems/count-and-say/description/
The count-and-say sequence is the sequence of integers with the first five
terms as following:
1. 1
2. 11
3. 21
4. 1211
5. 111221
1 is read off as "one 1" or 11.
1... | Input: 1
Output: "1"
Example 2: |
<|file_name|>ordering.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''auto ordering call chain test mixins'''
from inspect import ismodule
from twoq.support import port
class ARandomQMixin(object):
def test_choice(self):
self.assertEqual(len(list(self.qclass(1, 2, 3, 4, 5, 6).choice())), 1)
... | # )
|
<|file_name|>sensorimotor_experiment_runner.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for thi... | def _checkParams(self, params):
for k,v in params.iteritems():
if v == "Sorry": |
<|file_name|>chevronButton.styles.ts<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2021 3D Repo Ltd
*
* This program 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
... | `; |
<|file_name|>matrix.cc<|end_file_name|><|fim▁begin|>#include <cstdio>
#include <cmath>
#include "matrix.h"
#include "vector.h"
#include "quat.h"
using namespace std;
// ----------- Matrix3x3 --------------
Matrix3x3 Matrix3x3::identity = Matrix3x3(1, 0, 0, 0, 1, 0, 0, 0, 1);
Matrix3x3::Matrix3x3()
{
*this = identi... | {
scalar_t sina = (scalar_t)sin(angle);
scalar_t cosa = (scalar_t)cos(angle);
scalar_t invcosa = 1-cosa; |
<|file_name|>metadata_test.go<|end_file_name|><|fim▁begin|>package metadata
import "testing"
func TestGetLanguage(t *testing.T) {
for _, l := range AllowedLanguages {
if g, ok := GetLanguage(l.Name); !ok {
t.Errorf("language defined but not found: %s", l.Name)
} else if g != l {
t.Errorf("found wrong langu... | }
} |
<|file_name|>http_negotiate.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 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 "chrome_frame/http_negotiate.h"
#include <atlbase.h>
#include <atlcom.h>
#includ... |
// IBindStatusCallback implementation
STDMETHOD(OnStartBinding)(DWORD reserved, IBinding* binding) {
return E_NOTIMPL; |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for wireframe project.
import os
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycop... | 'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
#'django.middleware.doc.XViewMiddleware', |
<|file_name|>test_util.py<|end_file_name|><|fim▁begin|>"""
Unit tests for utility functions.<|fim▁hole|>
from thrifty import util
@pytest.mark.parametrize("num", [15, 16])
def test_fft_bin(num):
"""Validate fft_bin against numpy's fftfreq function."""
expected = np.fft.fftfreq(num, 1./num)
got = np.array(... | """
import numpy as np
import pytest |
<|file_name|>test_server_external_events.py<|end_file_name|><|fim▁begin|># Copyright 2014 Red Hat, 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.apac... | |
<|file_name|>dispatcher.py<|end_file_name|><|fim▁begin|>import re
import asyncio
import threading
from collections import defaultdict
def connector(bot, dispatcher, NICK, CHANNELS, PASSWORD=None):
@bot.on('client_connect')
async def connect(**kwargs):
bot.send('USER', user=NICK, realname=NICK)
... | a single user
"""
if channel: |
<|file_name|>db.go<|end_file_name|><|fim▁begin|>// Copyright 2017 The go-ethereum Authors
// This file is part of go-ethereum.
//
// go-ethereum 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... | Usage: "export a local chunk database as a tar archive (use - to send to stdout)", |
<|file_name|>mission_select.rs<|end_file_name|><|fim▁begin|>use voodoo::window::{Point, Window};
use game_state::{UiState, ModelView};
const TITLE: [&'static str; 6] = [
"██████╗ ███████╗ ██╗██╗ ██╗ █████╗ ██████╗██╗ ██╗",
"██╔══██╗██╔════╝ ██╔╝██║ ██║██╔══██╗██╔════╝██║ ██╔╝",
"█████╔╝█████╗ ... | pub enum Transition {
Ui(UiState),
Level(usize),
} |
<|file_name|>profile_fibonacci_raw.py<|end_file_name|><|fim▁begin|>import profile
def fib(n):
# from literateprograms.org
# http://bit.ly/hlOQ5m
if n == 0:
return 0<|fim▁hole|> return fib(n - 1) + fib(n - 2)
def fib_seq(n):
seq = []
if n > 0:
seq.extend(fib_seq(n - 1))
... | elif n == 1:
return 1
else: |
<|file_name|>raw.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | |
<|file_name|>analytics01.js<|end_file_name|><|fim▁begin|>//baidu
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F4233e74dff0ae5bd0a3d81c6ccf756e6' type='text/javascript'%3E%3C/script%3E"));
//goog... | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); |
<|file_name|>vengine_cpy.py<|end_file_name|><|fim▁begin|>import sys, imp
from . import model, ffiplatform
class VCPythonEngine(object):
_class_key = 'x'
_gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
self._struct_pending_ve... | self._load(module, 'loading')
#
# the C code will need the <ctype> objects. Collect them in
# order in a list. |
<|file_name|>processor.py<|end_file_name|><|fim▁begin|>import base64
import hashlib
import logging
import re
import urllib
import urlparse
import xmlrpclib
import redis
import requests
import lxml.html
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.files.base impo... | # url, md5_hash = m.groups()
# verified_md5_hashes[url] = md5_hash
|
<|file_name|>bitcoin_hr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="hr" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About EvilCoin</source>
<translation type="unfinished... | <source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/> |
<|file_name|>EditorWindow.py<|end_file_name|><|fim▁begin|>import sys
import os
import platform
import re
import imp
from Tkinter import *
import tkSimpleDialog
import tkMessageBox
import webbrowser
from idlelib.MultiCall import MultiCallCreator
from idlelib import idlever
from idlelib import WindowList
from idlelib im... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>"""Forms to render HTML input & validate request data."""
from wtforms import Form, BooleanField, DateTimeField, PasswordField
from wtforms import TextAreaField, TextField
from wtforms.validators import Length, required
class AppointmentForm(Form):
"""Render HTM... | |
<|file_name|>traceback.rs<|end_file_name|><|fim▁begin|>use std::default::Default;
use std::iter;
use std::marker::PhantomData;
use std::ops::Range;
use crate::alignment::AlignmentOperation;
use crate::pattern_matching::myers::{word_size, BitVec, DistType, State};
/// Objects implementing this trait handle the additi... | |
<|file_name|>foreign-link-switcher.ts<|end_file_name|><|fim▁begin|>export class ForeignLinkSwitcher {
private static instance: ForeignLinkSwitcher;
private static initPage = location.href;
foreignLinkCheckbox = document.getElementById('has_foreign_link') as HTMLInputElement;
foreignLinkSwitchedEl = document.... |
private get isChecked(): boolean { |
<|file_name|>ss-elements.module.ts<|end_file_name|><|fim▁begin|>// //import { AeChartComponent } from './ae-chart/ae-chart.component';
// import { RouterModule } from '@angular/router';
// // import { AeLegendComponent } from './ae-legend/ae-legend.component';
// // import { AeIndicatorComponent } from './ae-indicator/... | // // import { AeButtonComponent } from './ae-button/ae-button.component';
// // import { AeSelectComponent } from './ae-select/ae-select.component';
// // import { AeLabelComponent } from './ae-label/ae-label.component'; |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># Copyright 2014 Dev in Cachu authors. All rights reserved.
# Use of this source code is governed by a BSD-style<|fim▁hole|>from django.views.decorators import csrf
from django.views.generic import base
from django.contrib import admin
admin.autodiscover()
from devinc... | # license that can be found in the LICENSE file.
from django.conf import settings
from django.conf.urls import include, patterns, url |
<|file_name|>widget-form.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input, Output, EventEmitter } from "@angular/core";
import { Widget } from "../../../models/widget";
interface SelectItem {
value: string;
label: string;
}
@Component({
selector: "widget-form",
template: require(".... | } |
<|file_name|>ko.js<|end_file_name|><|fim▁begin|>var Lang = {};
Lang.category = {
"name": "ko"
};
Lang.type = "ko";
Lang.en = "English";
Lang.Command = {
"101": "블록 쓰레드 추가하기",
"102": "블록 쓰레드 삭제하기",
"103": "블록 삭제하기",
"104": "블록 복구하기",
"105": "블록 끼워넣기",
"106": "블록 분리하기",
"107": "블록 이동하기",
... | "analyze_dataRepresentation": "데이터 표현",
"analyze_abstraction": "추상화", |
<|file_name|>api.ts<|end_file_name|><|fim▁begin|>// ==LICENSE-BEGIN==
// Copyright 2017 European Digital Reading Lab. All rights reserved.
// Licensed to the Readium Foundation under one or more contributor license agreements.
// Use of this source code is governed by a BSD-style license
// that can be found in the LIC... | import { apiActions } from "readium-desktop/common/redux/actions";
// eslint-disable-next-line local-rules/typed-redux-saga-use-typed-effects |
<|file_name|>ics-convert.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Converts the .ics/.ical file into a FullCalendar compatiable JSON file
FullCalendar uses a specific JSON format similar to iCalendar format. This
script creates a JSON file containing renamed event components. Only the
title, description... | 'end':component.decoded('dtend').isoformat(),
'url':component.get('url')
}
|
<|file_name|>cover.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp');
var config = require('./config');
var mocha = require('gulp-mocha');
var istanbul = require('gulp-istanbul');
gulp.task('cover', function() {
return gulp.src(config.tests.unit, { read: false })
.pipe(mocha({
reporter: 'dot',
... | .pipe(istanbul.writeReports());
}); |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|><|fim▁hole|>// 临时素材管理.
//
// 永久素材管理在 material 模块;
// 对于图文消息里的图片, 可以调用 base.UploadImage 或者 base.UploadImageFromReader 来上传.
package media<|fim▁end|> | |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>package nl.pelagic.musicTree.flac2mp3.cli;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.nio.file.Files;
import java.util.HashSet;
import java.util.List;
impor... | }
}
} |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate gcc;
use std::env;
pub fn main() {
let target = env::var("TARGET").unwrap();
let os = if target.contains("linux") {
"LINUX"
} else if target.contains("darwin") {
"DARWIN"
} else {
"UNKNOWN"
};
let mut con... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst<|fim▁hole|>from .ui import *
from .mpl_style import *<|fim▁end|> |
from .stretch import *
from .interval import *
from .transform import * |
<|file_name|>watchedfolders.py<|end_file_name|><|fim▁begin|># Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | """Change if a watched folder is visible or not."""
messages.SetWatchedFolderVisible(id_, visible).send_to_backend()
|
<|file_name|>entry.py<|end_file_name|><|fim▁begin|>import os
from inspect import signature
from . import db
from . import settings
class Entry:
def __init__(self, id_=None, author=None, date=None, body=None, body_html=None, url=None,
plus=None, media_url=None, tags=None, is_nsfw=None, entry_id=N... | self.date = date
self.body = body
self.body_html = body_html
self.url = url |
<|file_name|>Fp64Operand.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2010-2017 Gordon Fraser, Andrea Arcuri and EvoSuite
* contributors
*
* This file is part of EvoSuite.
*
* EvoSuite is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License a... | public Fp64Operand(RealValue realExpr) {
this.realExpr = realExpr;
} |
<|file_name|>ap.js<|end_file_name|><|fim▁begin|>(function () {
angular.module('travelApp', ['toursApp'])<|fim▁hole|> var pattern = /Date\(([^)]+)\)/;
var results = pattern.exec(value);
var dt = new Date(parseFloat(results[1]));
return dt;
}
... | .service('dateParse', function () {
this.myDateParse = function (value) { |
<|file_name|>click-with-callback.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.10.0
(function() {<|fim▁hole|> console.log("some_button clicked!");
return event.preventDefault();
});
})(jQuery);
}).call(this);<|fim▁end|> | (function($) {
return $(".some_button").on("click", function(event) { |
<|file_name|>network.cc<|end_file_name|><|fim▁begin|>#include "network.h"
namespace network
{
bool can_reach_host (char const* host)
{
bool res = false;
if(SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, host))
{
SCNetworkReachabilityFlags flags;
if(SCNetworkReacha... | res = true;
} |
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2018 MuadDib
----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
@tantrumdev wrote this file. As long as you retain this notice you
can do whatever you want with th... | 'season': "0",
'episode': "0",
'info': {},
'year': "0", |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># encoding: 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):
# Adding model 'ProductType'
db.create_table('in... | 'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['inventory.ProductType']", 'null': 'True', 'blank': 'True'}), |
<|file_name|>data_store.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
loaded_data::runtime_types::Type,
values::{GlobalValue, Value},
};
use move_core_types::{account_address::AccountAddress, language_storage::ModuleId};
use vm::... | /// proper of a script execution (transaction).
pub trait DataStore {
// --- |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django_pgjson.fields
import django.utils.timezone
import django.db.models.deletion
import djorm_pgarray.fields
impor... | migrations.AddField(
model_name='membership', |
<|file_name|>policies.py<|end_file_name|><|fim▁begin|>import sys, os, fabric
class PiServicePolicies:
@staticmethod
def is_local():
return (not fabric.api.env.hosts or fabric.api.env.hosts[0] in ['localhost', '127.0.0.1', '::1'])
@staticmethod
def is_pi():
return os.path.isdir('/home/pi')
@staticme... | def installed(self):
ret = self.file_exists('__init__.py')
if not ret: print self.name+' not installed'
return ret |
<|file_name|>backend.go<|end_file_name|><|fim▁begin|>package ssh
import (
"strings"
"sync"
"github.com/hashicorp/vault/helper/salt"
"github.com/hashicorp/vault/logical"
"github.com/hashicorp/vault/logical/framework"
)
type backend struct {
*framework.Backend
view logical.Storage
salt *salt.Salt
sa... | |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... |
homepage = "https://flask-socketio.readthedocs.io"
url = "https://pypi.io/packages/source/F/Flask-SocketIO/Flask-SocketIO-2.9.6.tar.gz" |
<|file_name|>tournament.py<|end_file_name|><|fim▁begin|># coding: utf-8
# license: GPLv3
from enemies import *
from hero import *
def annoying_input_int(message =''):
answer = None
while answer == None:
try:
answer = int(input(message))
except ValueError:
print('Вы ввели... | dragon_list = generate_dragon_list(dragon_number) |
<|file_name|>HsqlList.java<|end_file_name|><|fim▁begin|>/* Copyright (c) 2001-2009, The HSQL Development Group
* 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 source c... | |
<|file_name|>testRBTCoM.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import unittest
import numpy as np
import pydrake
import os.path
class TestRBTCoM(unittest.TestCase):
def testCoM0(self):
r = pydrake.rbtree.RigidBodyTree(os.path.join(pydrake.getDrakePath(),
... | 0., 1., 0., 0.2425, 0., 0., 0.,
0., 0., 1., 0., 0., 0., 0.], atol=1e-4))
|
<|file_name|>_colorbar.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="colorbar", parent_name="bar.marker", **kwargs):
super(ColorbarValidator, self).__init__(
plotly_na... | Determines whether or not the tick labels are
drawn.
showtickprefix |
<|file_name|>crash28.C<|end_file_name|><|fim▁begin|>// Build don't link:
// Origin: Jakub Jelinek <jakub@redhat.com>
namespace N
{
class X;
template <class T>
class Y
{
public:
inline Y () {}
inline operator const Y<X> & () const
{
return *reinterpret_cast<const Y<X> *>(this);<|fim▁hole|>{
... | }
};
}
class bar |
<|file_name|>arg.rs<|end_file_name|><|fim▁begin|>extern crate ttml;
use ttml::arg::TokenArg;
#[test]
fn token_arg_to_string() {
let token = TokenArg {
name: "test".to_string(),
attribute: Some("test_attr".to_string()),
macro_name: None,
};<|fim▁hole|>
let token = TokenArg {
... | assert_eq!(token.to_string(), "@test.test_attr".to_string()); |
<|file_name|>subplot.py<|end_file_name|><|fim▁begin|>"""
subplot - Manage modern mode figure subplot configuration and selection.
"""
import contextlib
from pygmt.clib import Session
from pygmt.exceptions import GMTInvalidInput
from pygmt.helpers import (
build_arg_string,
fmt_docstring,
is_nonstr_iter,
... | yield |
<|file_name|>http_loader.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use brotli::Decompressor;
use connector::{Connector, crea... | // Step 2
// TODO: Spec says requires testing on Proxy-Authenticate headers |
<|file_name|>issue-3743.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/lice... | } |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># Python3
from solution1 import multiplicationTable as f
qa = [
(5,
[[1, 2, 3, 4, 5],
[2, 4, 6, 8, 10],
[3, 6, 9, 12, 15],
[4, 8, 12, 16, 20],
[5, 10, 15, 20, 25]]),
(2,
[[1, 2],
[2, 4]]),
(4,
[[1, 2, ... | |
<|file_name|>icon.js<|end_file_name|><|fim▁begin|>import React from 'react';
class Icon extends React.Component {
constructor(props) {
super(props);
this.displayName = 'Icon';
this.icon = "fa " + this.props.icon + " " + this.props.size;<|fim▁hole|> render() {
return (
<i class... | } |
<|file_name|>installer.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008-2012 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
# General contacts <info@alistek.com>
#
# WARNING: This... | |
<|file_name|>WebGLRenderer.js<|end_file_name|><|fim▁begin|>/* WebGL Renderer*/
var WebGLRenderer,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) chi... | return this.gl.drawArrays(this.gl.LINES, 0, vertices.length / 3); |
<|file_name|>curl_httpclient.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | """Called by IOLoop when the requested timeout has passed."""
with stack_context.NullContext():
self._timeout = None
while True: |
<|file_name|>cron.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Dane Summers <dsummers@pinedesk.biz>
# Copyright: (c) 2013, Mike Grozak <mike.grozak@gmail.com>
# Copyright: (c) 2013, Patrick Callahan <pmc@patrickcallahan.com>
# Copyright: (c) 2015, Evan Kaufman <evan... | # set SELinux permissions
if self.module.selinux_enabled() and self.cron_file: |
<|file_name|>cellGem.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "cellGem.h"
#include "cellCamera.h"
#include "Emu/Cell/PPUModule.h"
#include "Emu/Io/MouseHandler.h"
#include "Emu/RSX/GSRender.h"
#include "Utilities/Timer.h"
#include "Input/pad_thread.h"
LOG_CHANNEL(cellGem);
template <>
void fmt_... |
return CELL_OK;
}
|
<|file_name|>app.ts<|end_file_name|><|fim▁begin|>import {server} from './initializers'
<|fim▁hole|>}<|fim▁end|> | module.exports = function startServer(){
server.listen(8080) |
<|file_name|>Clue.js<|end_file_name|><|fim▁begin|>import React from 'react';
import styled from 'styled-components';
import Item from './Item';
import parchment from '../assets/parchment.png';
import chest from '../assets/chest.png';
const Container = styled.div`
background: url(${parchment});
position: relative;
... | {rewards.map(reward => ( |
<|file_name|>cursor.py<|end_file_name|><|fim▁begin|>import asyncio
import warnings
import psycopg2
from .log import logger
class Cursor:
def __init__(self, conn, impl, timeout, echo):
self._conn = conn
self._impl = impl
self._timeout = timeout
self._echo = echo
@property
... |
def __iter__(self): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.