prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>mct.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3... | dp = xbmcgui.DialogProgress()
dp.create('pelisalacarta-MCT')
|
<|file_name|>api_db_spec.js<|end_file_name|><|fim▁begin|>/*globals describe, before, beforeEach, afterEach, it */
/*jshint expr:true*/
var testUtils = require('../../utils'),
should = require('should'),
// Stuff we are testing
dbAPI = require('../../../server/api/db'),
ModelTag = requ... | return dbAPI.exportContent();
}).then(function () {
done(new Error('Export content is not denied without authentication.')); |
<|file_name|>SpeakPythonMakeDB.py<|end_file_name|><|fim▁begin|>import antlr3;
import sqlite3;
import pickle;
import sys, os;
import re;
from SpeakPython.SpeakPython import SpeakPython;
from SpeakPython.SpeakPythonLexer import SpeakPythonLexer;
from SpeakPython.SpeakPythonParser import SpeakPythonParser;
#sort results... | |
<|file_name|>http.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will ... | |
<|file_name|>QYBatchJobType.java<|end_file_name|><|fim▁begin|>package com.swifts.frame.modules.wx.fastweixin.company.message.req;<|fim▁hole|> * 微信企业号异步任务类型
* ====================================================================
*
* --------------------------------------------------------------------
* @author No... | /** |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/**
* Module dependencies.
*/
var express = require('express');
var http = require('http');
var path = require('path');
var handlebars = require('express3-handlebars');
var index = require('./routes/index');
var project = require('./routes/project');
var palette = re... | |
<|file_name|>message.go<|end_file_name|><|fim▁begin|>package payload
type Message struct {<|fim▁hole|> Id string
FromUser *User
Text string
Payload interface{}
SourceAdapter string
}<|fim▁end|> | |
<|file_name|>NavBarSkipLink.tsx<|end_file_name|><|fim▁begin|>import React from "react"
import styled from "styled-components"<|fim▁hole|>import { Text, color, space } from "@artsy/palette"
export const NavBarSkipLink: React.FC = () => {
return (
<Container href="#main">
<Text variant="text">Skip to Main Co... | |
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>from django.utils import translation
from nose.tools import eq_
from olympia import amo
from olympia.amo.tests import TestCase, ESTestCase
from olympia.addons.models import Addon
from olympia.reviews import tasks
from olympia.reviews.models import (
check_s... | self.trans_eq(r1.title, 'r1 title en', 'en-US')
|
<|file_name|>trim.py<|end_file_name|><|fim▁begin|>import sys
import string
f = sys.stdin
g = sys.stdout
<|fim▁hole|>echo = 0
while 1:
l = f.readline()
if not l: break
ll=string.strip(l)
if ll=='BEGIN-LOG':
echo = 1
elif ll=='END-LOG':
echo = 0
elif echo:
l=string.replace(l,"-0.000",... | |
<|file_name|>HistoryStateType.java<|end_file_name|><|fim▁begin|>//
// Questo file è stato generato dall'architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.8-b130911.1802
// Vedere <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Qualsiasi modifica a questo file andrà p... |
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute; |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># Copyright 2015-2016 NEC Corporation. All rights reserved.<|fim▁hole|># 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... | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import unittest
import re
from lxml import etree
from zope.testing import doctest, cleanup
import zope.component.eventtesting
from imagestore.xml import XMLValidationError, local_file
class ValidationTests(unittest.TestCase):
relaxng = etree.RelaxNG(file=local_... | </image> |
<|file_name|>clone.js<|end_file_name|><|fim▁begin|>define(function(require) {
/*<|fim▁hole|> DEPENDENCIES
*/
var BaseDialog = require('utils/dialogs/dialog');
var TemplateHTML = require('hbs!./clone/html');
var Sunstone = require('sunstone');
var Notifier = require('utils/notifier');
var Locale = req... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.contrib import admin
from .models import User<|fim▁hole|><|fim▁end|> |
admin.site.register(User) |
<|file_name|>utils_data.py<|end_file_name|><|fim▁begin|>import numpy as np
import cvxopt as co
def load_mnist_dataset():<|fim▁hole|> train_labels = np.array([mnist_train[i][1].numpy() for i in range(len(mnist_train))], dtype=np.int)
test = np.array([np.asarray(mnist_test[i][0]).reshape(28*28) for i in range(le... | import torchvision.datasets as datasets
mnist_train = datasets.MNIST(root='../data/mnist', train=True, download=True, transform=None)
mnist_test = datasets.MNIST(root='../data/mnist', train=False, download=True, transform=None)
test_labels = np.array([mnist_test[i][1].numpy() for i in range(len(mnist_te... |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import urlparse
import urllib
from datetime import datetime
from django.db import models
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from django.core.urlresolvers import rever... | document_search = SearchModel.get('documents.Document')
query_dict = urlparse.parse_qs(urllib.unquote_plus(smart_str(self.query)))
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod parser;
pub mod parser_error;
mod token;<|fim▁hole|><|fim▁end|> | mod lexer;
mod lexer_error; |
<|file_name|>test_flavor_rxtx.py<|end_file_name|><|fim▁begin|># Copyright 2012 Nebula, 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... |
from oslo_serialization import jsonutils
import webob |
<|file_name|>constants.js<|end_file_name|><|fim▁begin|>/*
#########################################################################
#
# Copyright (C) 2019 OSGeo
#
# 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 Soft... | # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# |
<|file_name|>auto_tags.py<|end_file_name|><|fim▁begin|>"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't ... | |
<|file_name|>locus.rs<|end_file_name|><|fim▁begin|>//! Provide a location.
//!
//! ```text
//! _ _ _
//! _ __ ___| (_)___(_) ___ _ __
//! | '__/ _ \ | / __| |/ _ \| '_ \
//! | | | __/ | \__ \ | (_) | | | |
//! |_| \___|_|_|___/_|\___/|_| |_|
//! ```
//! The relision term rewriting library.
//!
//! # L... | |
<|file_name|>test_directoryscanner.py<|end_file_name|><|fim▁begin|>import unittest
from os import path
from API.directoryscanner import find_runs_in_directory
path_to_module = path.abspath(path.dirname(__file__))
class TestDirectoryScanner(unittest.TestCase):
def test_sample_names_spaces(self):
runs = fi... | self.assertEqual(1, len(runs)) |
<|file_name|>alert_processor.py<|end_file_name|><|fim▁begin|>"""
Copyright 2017-present Airbnb, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
U... | environment={ |
<|file_name|>multi-thread-example.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# GIL limit python multi-thread effectiveness.
# But is seems fine, because these operation have so many socket IO
# So it seems no need to use multiprocess
#
import uiautomator2 as u2
import adbutils
import threading
from logzero impo... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># ##### BEGIN GPL LICENSE BLOCK #####
#
# 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
# of the License, o... | |
<|file_name|>doormon.py<|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/.
#
# Copyright (c) 2016 Digi International Inc. All Rights Reserv... | self.send_alert(status)
self.d1_status = status
time.sleep(.5)
|
<|file_name|>SendMessageContext.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... | import com.alibaba.rocketmq.common.message.Message; |
<|file_name|>Event.java<|end_file_name|><|fim▁begin|>package org.intellimate.izou.sdk.events;
import org.intellimate.izou.events.EventBehaviourControllerModel;
import org.intellimate.izou.events.EventLifeCycle;
import org.intellimate.izou.events.EventModel;
import org.intellimate.izou.identification.Identification;
im... | */ |
<|file_name|>mailPreview.js<|end_file_name|><|fim▁begin|>import MailPreview from '../components/MailPreview.vue';
import icons from "trumbowyg/dist/ui/icons.svg";
import "trumbowyg/dist/ui/trumbowyg.css";
import "trumbowyg/dist/trumbowyg.js";
import "./trumbowyg-snippets-plugin.js";
$.trumbowyg.svgPath = icons;
windo... | }, |
<|file_name|>1.ExchangeIfGrater.js<|end_file_name|><|fim▁begin|><|fim▁hole|>console.log('-----Problem 1. Exchange if greater-----');
function exchangeIfIsGrater (first, second){
console.log('Before exchange:', first, second);
var temp;
if(first > second){
temp = first;
first = second;
... | /*Write an if statement that takes two double variables a and b and exchanges their values if the first one is greater than the second.
As a result print the values a and b, separated by a space.*/
|
<|file_name|>output.py<|end_file_name|><|fim▁begin|># Copyright 1998-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id: output.py,v 1.1 2006/03/06 18:13:31 henrique Exp $
import os
import sys
import re
havecolor = 1
dotitles = 1
spinpos = 0
spinner = "/-\\|/-\\|/-\\|/-\... | |
<|file_name|>gotree.go<|end_file_name|><|fim▁begin|>// Package gotree create and print tree.
package gotree
import (
"strings"
)
const (
newLine = "\n"
emptySpace = " "
middleItem = "├── "
continueItem = "│ "
lastItem = "└── "
)
type (
tree struct {
text string
items []Tree
}
// Tree... |
// Printer is printer interface
Printer interface {
Print(Tree) string |
<|file_name|>struct_grape_f_s_1_1___performance_operation.js<|end_file_name|><|fim▁begin|>var struct_grape_f_s_1_1___performance_operation =
[
[ "_PerformanceOperation", "struct_grape_f_s_1_1___performance_operation.html#a9251cc499a0ab5c9d2fe2762ca2eb7a2", null ],
[ "FillProc", "struct_grape_f_s_1_1___performan... | |
<|file_name|>WebGLMultiview.d.ts<|end_file_name|><|fim▁begin|>import { Camera } from './../../cameras/Camera';
import { Object3D } from './../../core/Object3D';<|fim▁hole|>import { WebGLUniforms } from './WebGLUniforms';
export class WebGLMultiview {
constructor( renderer: WebGLRenderer, gl: WebGLRenderingContext );... | import { WebGLRenderer } from '../WebGLRenderer'; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """Contributed 'recipes'""" |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render
from django.utils.html import escape
from django.views.decorators.csrf import ensure_csrf_cookie
from django.contrib.auth import authenticate, login, logout
import json
# Cr... | |
<|file_name|>lexical_chains.py<|end_file_name|><|fim▁begin|>"""
lexical chain module for text tiling
"""
from tile_reader import TileReader
from scoring import boundarize, depth_scoring, window_diff
# ====================================================================================================================... | for diff in xrange(window, 0, -1):
# back off diff when there are less sentences left than dist thresh
while not i + diff < len(sents): |
<|file_name|>counts.py<|end_file_name|><|fim▁begin|>import logging
import time
from collections import OrderedDict, defaultdict
from datetime import datetime, timedelta
from typing import Callable, Dict, Optional, Sequence, Tuple, Type, Union
from django.conf import settings
from django.db import connection
from djang... | subgroup = SQL('NULL')
group_by_clause = SQL('')
else:
subgroup = Identifier(group_by[0]._meta.db_table, group_by[1]) |
<|file_name|>trace_report.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""
"""
__version__ = "$Id$"
#end_pymotw_header<|fim▁hole|>tracer = trace.Trace(count=True, trace=False, outfile='trace_report.dat')
tracer.runfunc(recurse, 2)
... |
import trace
from trace_example.recurse import recurse
|
<|file_name|>inherited_svg.mako.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/. */
<%namespace name="helpers" file="/helpers.mako.rs"... | |
<|file_name|>0009_playlistitem_created_at.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('app', '0008_playlistitem_network'),<|fim▁hole|> ... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>namespace webgl_2d_geometry_matrix_transform_with_projection {
function main() {
// Get A WebGL context
/** @type {HTMLCanvasElement} */
let canvas = <HTMLCanvasElement>document.getElementById("canvas");
webglLessonsHelper.setupLes... | gl.vertexAttribPointer(
positionLocation, size, type, normalize, stride, offset)
// set the resolution |
<|file_name|>application.py<|end_file_name|><|fim▁begin|>__author__ = 'hujin'
import sys
from os import path
from twisted.internet import reactor
from twisted.web import server, resource<|fim▁hole|>from dockerman.api import Root
from dockerman.docker import Client
from dockerman.manager import Manager
from dockerma... | from twisted.python import log
from dockerman.storage import ServiceStore |
<|file_name|>for-loop-goofiness.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<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or ... | // http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>machine.rs<|end_file_name|><|fim▁begin|>use std::io::stdio::{stdin_raw, stdout_raw};
use storage::{Tape, VectorTape};
use operators::{Sub, Incr, Decr, Prev, Next, Put, Get};
use ast::Ast;
/**
A brainfuck interpreter machine.
Models the internal state of a Brainfuck machine. It is a simple
tape machine w... | |
<|file_name|>ConnectionComplexityDao.java<|end_file_name|><|fim▁begin|>/*
* Waltz - Enterprise Architecture
* Copyright (C) 2016, 2017, 2018, 2019 Waltz open source project
* See README.md for more information
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except i... | |
<|file_name|>cleanup_instruction_set_fix_operands.cc<|end_file_name|><|fim▁begin|>// Copyright 2016 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.... | operand.set_name(kUpdatedMemoryOperandName);
} |
<|file_name|>htmllabelelement.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 dom::activation::{Activatable, ActivationSource,... | use dom::element::{AttributeMutation, Element}; |
<|file_name|>WordnetManager.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import itertools
"""
Languages | ShortCode | Wordnet
Albanian | sq | als
Arabic | ar | arb
Bulgarian | bg | bul
Catalan | ca |... | Slovenian | sl | slv
Spanish | es | spa
Swedish | sv | swe |
<|file_name|>open.js<|end_file_name|><|fim▁begin|>var opn = require('opn');
console.log('打开二维码...')
// Opens the image in the default image viewer
opn('static/img/qr.jpg').then(() => {<|fim▁hole|> console.log('关闭二维码!')
});<|fim▁end|> | |
<|file_name|>test_sources.py<|end_file_name|><|fim▁begin|>#
# Copyright 2013 Quantopian, 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.... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var intlNameInitials = function () {
};
var pattern = '{0}{1}';
function _firstLetter(text) {
return text.charAt(0);
}
function _upperCase(letter) {
if (letter === 'ı'){
return 'I';
}
return letter.toUpperCase();
}
function _... |
if (name.lastName === null || name.lastName.length === 0){
|
<|file_name|>spawn.rs<|end_file_name|><|fim▁begin|>use std::io::ErrorKind;
use std::process::Command;
fn main() {
// Make sure it doesn't try to run "hopefullydoesntexist bar.exe".
assert_eq!(Command::new("hopefullydoesntexist")
.arg("bar")
.spawn()
.unw... | |
<|file_name|>DispatcherConfig.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Code Above Lab 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/lic... | |
<|file_name|>_fallback.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
logbook._fallback
~~~~~~~~~~~~~~~~~
Fallback implementations in case speedups is not around.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
from itertools impo... | def _get(self): |
<|file_name|>global.d.ts<|end_file_name|><|fim▁begin|>declare module "*.png";
declare module "*.gif";
declare module "*.jpg";
declare module "*.jpeg";
declare module "*.svg";
declare module "*.css";
declare module "*.less";
declare module "*.scss";
declare module "*.sass";<|fim▁hole|><|fim▁end|> | declare module "*.styl"; |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var Alloy = require("alloy"), _ = Alloy._, Backbone = Alloy.Backbone;
Alloy.Globals.steps = 0;
<|fim▁hole|>
Alloy.Globals.fruitCount = 0;
Alloy.createController("index");<|fim▁end|> | Alloy.Globals.capacity = 0;
Alloy.Globals.basketImage = ""; |
<|file_name|>bigtable_input.py<|end_file_name|><|fim▁begin|># Copyright 2018 Google 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-2.0
#
#... | import math
import multiprocessing
import operator |
<|file_name|>CalendarDayEntriesSpec.ts<|end_file_name|><|fim▁begin|>/// <reference path="../typings/jasmine/jasmine.d.ts" />
/// <reference path="../src/CalendarDayEntries.ts"/>
module CalendarDay
{
class CalendarDayEntriesMock extends CalendarDayEntries
{
callCounter : number = 0;
init(year : number) : void
... | expect(result.isFeastDay).toBeFalsy();
});
}); |
<|file_name|>XEMOutputControler.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
SRC/MIXMOD/XEMOutputControler.cpp description
copyright : (C) MIXMOD Team - 2001-2011
email : contact@mixmod.org
*... | }
delete [] fileNameTmp;
/*delete completeFileName; |
<|file_name|>CNAVMessageAsm.hpp<|end_file_name|><|fim▁begin|>#pragma ident "$Id:$"
//============================================================================
//
// This file is part of GPSTk, the GPS Toolkit.
//
// The GPSTk is free software; you can redistribute it and/or modify
// it under the terms of... | //typedef std::map<gpstk::SatID,MapByObsID> CurrentMsgMap;
|
<|file_name|>post_migration.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Akretion
# (<http://www.akretion.com>).
#
# This program is free ... | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>test_caps_num_lock_indicator.py<|end_file_name|><|fim▁begin|># 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
# to use... | from test.widgets.conftest import FakeBar |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>fn compute_kmp_table(word: &String) -> Vec<i32> {
let mut table : Vec<i32> = vec![0; word.len()];
let mut pos = 2;
let mut cnd = 0;
let word_chars : Vec<char> = word.chars().collect::<Vec<char>>();
table[0] = -1;
table[1] = 0;
while pos... |
assert_eq!(res, expected_res);
} |
<|file_name|>createlink-base-min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:a92e0a42b6e55c21f7494e8604852635b90e81170e9f49207a0a68c2174158ee<|fim▁hole|><|fim▁end|> | size 877 |
<|file_name|>hook-cryptography.py<|end_file_name|><|fim▁begin|># -----------------------------------------------------------------------------
# Copyright (c) 2014, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full ... | |
<|file_name|>dashboard.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { Hero } from './hero';
import { HeroService } from './hero.service';
@Component ({
moduleId: module.id,<|fim▁hole|> styleUrls: [ './dashboard.component.css' ],
})
export class DashboardCompone... | selector: 'my-dashboard',
templateUrl: 'dashboard.component.html', |
<|file_name|>Callback.C<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenC... | along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2016 Onestein (<http://www.onestein.eu>)<|fim▁hole|>
{
'name': "Absence Management",
'summary': """Create time based absence notifications""",
'author': 'Onestein',
'website': 'http://www.onestein.eu',
'ima... | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
<|file_name|>imports.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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/license... | mod c { |
<|file_name|>CountAccumulateFunction.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* 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
*
* ... | return true;
}
/** |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import json
from tornado import gen
from tornado.httpclient import AsyncHTTPClient, HTTPError
from .exceptions import SparkPostAPIException
class TornadoTransport(object):
@gen.coroutine
def request(self, method, uri, headers, **kwargs):
if "data" in ... | |
<|file_name|>pgconf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# $Id: $
"""
postgresql.conf configuration file reader
Module contents:
readfile() - Read postgresql.conf file
class gucdict - Container for postgresql.conf settings
class setting - Holds one setting
class ConfigurationError - a ... | incfilename = value.strip("'") |
<|file_name|>speedo.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2013, ROSSER ALPHA LLC
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 code must retain the abo... | * Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of ROSSER ALPHA LLC nor the
|
<|file_name|>025.py<|end_file_name|><|fim▁begin|>from fibonacci import Fibonacci<|fim▁hole|>
def ans():
return Fibonacci.index(Fibonacci.after(int('9' * 999)))
if __name__ == '__main__':
print(ans())<|fim▁end|> | |
<|file_name|>attention_graphs.py<|end_file_name|><|fim▁begin|>import gzip
import os
import pickle
import matplotlib<|fim▁hole|>import matplotlib.pyplot as plt
import numpy as np
matplotlib.use('TKagg')
def show_attention():
# Load attentions
print('Loading attentions to pickle file')
with gzip.open(
os.... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def log_location(request):
"""
:params
:lat - latitude
:lon - longitude
:user_agent - useful for IOT applications that needs to log the client
that send the location
"""
if request.method == 'GET':
user_agent = request.GET.get('user_... | from django.shortcuts import render
from .models import GeoLocation
from django.http import HttpResponse |
<|file_name|>http.py<|end_file_name|><|fim▁begin|>import logging
import ssl
from typing import List # pylint: disable=unused-import
import aiohttp
import certifi
import trio_asyncio
from aiohttp.http_exceptions import HttpProcessingError
from .base import BufferedFree, Limit, Sink, Source
logger = logging.getLogger... | ssl_context = ssl.create_default_context(cafile=certifi.where())
conn = aiohttp.TCPConnector(ssl=ssl_context) |
<|file_name|>a_star_test.go<|end_file_name|><|fim▁begin|>// Copyright ©2014 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package path_test
import (
"math"
"reflect"
"testing"
"github.com/gonum/graph"
"github.com/g... | return tg
}(),
s: 5, t: 9*10 + 9, |
<|file_name|>support.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Frontend for running support related commands on hyperic installations.
#
# Opens as an interactive shell if no parameters are passed, otherwise runs
# the command and parameters that have been passed on the command line.
#
# Enter help to see ... | |
<|file_name|>test_stock_change_qty_reason.py<|end_file_name|><|fim▁begin|># pylint: disable=import-error,protected-access,too-few-public-methods
# Copyright 2016-2017 ACSONE SA/NV (<http://acsone.eu>)
# Copyright 2019 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common... | } |
<|file_name|>unicastsockopt_test.go<|end_file_name|><|fim▁begin|>// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ipv4_test
import (
"net"
"runtime"
"testing"
"github.com/djbarber/ipfs-hack/Gode... | } |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from django.contrib.contenttypes.generic import (
generic_inlineform... | """
class MediaForm(ModelForm):
class Meta: |
<|file_name|>debug.py<|end_file_name|><|fim▁begin|>import sys
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
... |
def push(self, token):
self._list.append(token)
|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { login } from './authenticate';
import { getUserName } from './model/User';
const emailInput = document.getElementById('email');
const passwordInput = document.getElementById('password');<|fim▁hole|>
if (!emailInput) {
throw new Error('Cannot find #email inp... | const loginForm = document.getElementById('login'); |
<|file_name|>dummy.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# Made by Kei Choi(hanul93@gmail.com)
import os # ÆÄÀÏ »èÁ¦¸¦ À§ÇØ import
import kernel
#---------------------------------------------------------------------
# KavMain Ŭ·¡½º
# ŰÄÞ¹é½Å ¿£Áø ¸ðµâÀÓÀ» ³ªÅ¸³»´Â Ŭ·¡½ºÀÌ´Ù.
# ÀÌ Å¬·¡½º°¡ ¾øÀ¸¸é ¹... | #----------------------------------------------------------------- |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for credentials.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from os.path import abspath, dirname
from ... | path.append(SITE_ROOT)
|
<|file_name|>from_sparse_tensor_slices_test.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow 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
#
# ... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.<|fim▁hole|> */
use common::FeatureFlag;
use fixture_tests::Fixture;
use graphql_test_helpers::apply_transform_for_test;
use relay_transforms::{apply_fragment_arguments, provided_variable_fragment_transform};
pub ... | *
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. |
<|file_name|>blackjack.py<|end_file_name|><|fim▁begin|>"""
Program do gry w Blackjack (a.k.a. Oczko) w języku Python przy użyciu biblioteki PyGame
Projekt zaliczeniowy - Języki Skryptowe, Informatyka i Ekonometria, rok 1, WZ, AGH
Autorzy: Joanna Jeziorek, Mateusz Koziestański, Katarzyna Maciocha
III 2016
"""
import ran... |
def shuffle(deck):
# Przyjmuje talię jako argument i zwraca potasowaną talię. Tasowanie metodą random.shuffle(). |
<|file_name|>test_hive_partition.py<|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 und... | |
<|file_name|>post_render.js<|end_file_name|><|fim▁begin|>var util = require('hexo-util');
var code = [
'if tired && night:',
' sleep()'
].join('\n');
<|fim▁hole|> '```',
'some content',
'',
'## Another title',
'{% blockquote %}',
'quote content',
'{% endblockquote %}',
'',
'{% quote Hello World %... | var content = [
'# Title',
'``` python',
code, |
<|file_name|>Execution.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 under... | |
<|file_name|>datamodel_pb.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2007 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/li... | if self.has_http_status_ and self.http_status_ != x.http_status_: return 0 |
<|file_name|>subp_main.py<|end_file_name|><|fim▁begin|># Copyright 2009 Noam Yorav-Raphael
#
# This file is part of DreamPie.
#
# DreamPie 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 3 of t... |
from os.path import abspath, join, dirname
|
<|file_name|>chat.client.routes.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
// var matcher = require('../../lib/matchUsers');
angular
.module('chat.routes')
.config(routeConfig);
routeConfig.$inject = ['$stateProvider'];<|fim▁hole|> $stateProvider
.state('chat', {
url: c... | var c = "/room";// need to make this somehow return the correct room
function routeConfig($stateProvider) { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var express = require('express'),
package = require('./package.json'),
program = require('commander'),
_ = require('underscore'),
Assets = require('./lib/assets.js');
program
.version(package.version)
.option('-s, --store <sto... | |
<|file_name|>local.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/... |
let t: Box<Task> = Local::try_take().unwrap();
let u: Option<Box<Task>> = Local::try_take();
assert!(u.is_none()); |
<|file_name|>GuessTypeParameters.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2013 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.apache.org/l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.