prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>posix.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)] // New rule: only posix.rs gets to use libc. extern crate libc; use std::process::exit; use std::mem; use std::ops::Drop; use std::io; use std::io::Result; use std::io::Read; use std::io::Write; use std::io::Error; use std::io::ErrorKind; use...
libc::getpid()
<|file_name|>TreeWidget.py<|end_file_name|><|fim▁begin|># XXX TO DO: # - popup menu # - support partial or total redisplay # - key bindings (instead of quick-n-dirty bindings on Canvas): # - up/down arrow keys to move focus around # - ditto for page up/down, home/end # - left/right arrows to expand/collapse...
<|file_name|>network.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import socket from paramiko import SSHClient, AutoAddPolicy, AuthenticationException from bssh.utils import env from bssh.auth import get_pkey from bssh.logger import logger def connect( hostname=None, port=22, use...
except socket.error: logger.login.error('%s Network Error' % hostname) except Exception as e: logger.login.error('%s %s' % (hostname, str(e)))
<|file_name|>NodeProperty.rs<|end_file_name|><|fim▁begin|>GUI.NodeProperty$4 GUI.NodeProperty GUI.NodeProperty$5 GUI.NodeProperty$2 GUI.NodeProperty$3 GUI.NodeProperty$8 GUI.NodeProperty$9 GUI.NodeProperty$6 GUI.NodeProperty$7 GUI.NodeProperty$11 GUI.NodeProperty$12 GUI.NodeProperty$10<|fim▁hole|><|fim▁end|>
GUI.NodeProperty$1 GUI.NodeProperty$13 GUI.NodeProperty$14
<|file_name|>test_import_command.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import datetime from collections import namedtuple import mock import six from django.conf import settings from django.test import TestCase from django.utils import timezon...
) self.assertEqual("http://newdomain.com/images/2011/04/my_image.jpg", url) self.assertEqual("2011_04_my_image.jpg", filename)
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import setuptools<|fim▁hole|> with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="gabriel-server", version="2.0.2", author="Roger Iyengar", author_email="ri@rogeriyengar.com", description="Server for Wearab...
<|file_name|>test_image_meta.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.apache.org/licenses/LICENSE-2.0 # ...
'checksum': None, 'owner': None, 'size': None, 'virtual_size': None,
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from jarbas.core.models import Company from jarbas.core.serializers import CompanySerializer from jarbas.chamber_of_deputies.serializers import format_cnpj class CompanyDetailView(RetrieveAPIView): lookup_field = 'cnpj' queryset = Company.object...
from django.db import connection from django.http import HttpResponse from django.shortcuts import get_object_or_404 from rest_framework.generics import RetrieveAPIView
<|file_name|>default_test.go<|end_file_name|><|fim▁begin|>package pool import ( "testing" "time" "github.com/micro/go-micro/v3/network/transport" "github.com/micro/go-micro/v3/network/transport/memory" ) func testPool(t *testing.T, size int, ttl time.Duration) { // mock transport tr := memory.NewTransport() ...
l, err := tr.Listen(":0") if err != nil { t.Fatal(err)
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { suite } from 'uvu' import * as assert from 'uvu/assert' import browserEnv from 'browser-env' import Component from '../src' import sinon from 'sinon' import templates from './fixtures/templates' import { definitions, definitionFunction } from './fixtures...
test('replaceContent should clear out refs and _componentInstances to replace them with new ones', () => { const rootComponent = createRootComponent(templates.refs, definitions)
<|file_name|>get_project_var_cmd.go<|end_file_name|><|fim▁begin|>package cmd import ( "github.com/fatih/color" out "github.com/plouc/go-gitlab-client/cli/output" "github.com/spf13/cobra" ) func init() { getCmd.AddCommand(getProjectVarCmd) } var getProjectVarCmd = &cobra.Command{ Use: resourceCmd("project-va...
return nil }, }
<|file_name|>validation-controller-factory.ts<|end_file_name|><|fim▁begin|>import { Container, Optional } from 'aurelia-dependency-injection'; import { GlobalValidationConfiguration, ValidationControllerFactory, ValidationController, Validator, validateTrigger } from '../src/aurelia-validation'; des...
<|file_name|>comparison_instructions.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 extern crate test_generation; use itertools::Itertools; use test_generation::abstract_state::{AbstractState, AbstractValue}; use vm::file_format::{Bytecode, SignatureT...
<|file_name|>routing.js<|end_file_name|><|fim▁begin|>function checkHeadersSent(res, cb) { return (err, results) => { if (res.headersSent) { if (err) { return cb(err) } return null<|fim▁hole|> cb(err, results) } } exports.finish = function finish(req, res, next) { const check = ch...
}
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os.path import re import warnings try: from setuptools import setup, find_packages except ImportError: from distribute_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages version = '0...
'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.0',
<|file_name|>tags.go<|end_file_name|><|fim▁begin|>// Copyright 2011 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 msgpack import ( "strings" ) // tagOptions is the string following a comma in a struct field's "jso...
// string boundary or commas.
<|file_name|>unsafe-mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// These are supported by rustc syntactically but not semantically. #[cfg(any())] unsafe mod m { } #[cfg(any())] unsafe extern "C++" { }<|fim▁end|>
<|file_name|>stockfs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright 2015 Comcast Cable Communications Management, 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 # # h...
print "uri ", uri line = urllib2.urlopen(uri).read().strip()
<|file_name|>0003_auto_20161217_2150.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-12-17 20:50 from __future__ import unicode_literals from django.db import migrations <|fim▁hole|> dependencies = [ ('jordbruksmark', '0002_auto_20161217_2140'), ] opera...
class Migration(migrations.Migration):
<|file_name|>LocationAnnotator.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2014 Michael Joyce <ubermichael@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 version 2. *...
<|file_name|>code.py<|end_file_name|><|fim▁begin|>import inspect import re import sys import traceback from inspect import CO_VARARGS from inspect import CO_VARKEYWORDS from traceback import format_exception_only from types import TracebackType from typing import Generic from typing import Optional from typing import P...
""" return code object for given function. """ try: return obj.__code__
<|file_name|>RestHandler.js<|end_file_name|><|fim▁begin|>//>>built define("dojox/wire/ml/RestHandler",["dijit","dojo","dojox","dojo/require!dojox/wire/_base,dojox/wire/ml/util"],function(_1,_2,_3){ _2.provide("dojox.wire.ml.RestHandler"); _2.require("dojox.wire._base"); _2.require("dojox.wire.ml.util"); _2.declare...
} if(_10){ _e+="?"+_10;
<|file_name|>profile_detail_view_test.py<|end_file_name|><|fim▁begin|>import json from django.test import TestCase from rest_framework.test import APIRequestFactory from rest_framework.test import force_authenticate from rest_framework import status from rest_framework.authtoken.models import Token from core.models...
self.test_profile = Profile.objects.create(user=user)
<|file_name|>p1_no_assignee.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/. from libmozdata import utils as lmdutils from auto_nag impo...
} utils.get_empty_assignees(params)
<|file_name|>instancePropertyInStructType_basic.ts<|end_file_name|><|fim▁begin|>// @target: ES5 // ok module NonGeneric { struct C { x: string; /* get y() { return 1; } set y(v) { } */ fn() { return this; } constructor(public a: number, private...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from flask import Blueprint main = Blueprint('main', __name__)<|fim▁hole|>from . import errors, views from ..models import Permission @main.app_context_processor def inject_permissions(): return dict(Permission=Permission)<|fim▁end|>
<|file_name|>count_sequences.py<|end_file_name|><|fim▁begin|>import argparse<|fim▁hole|>def run(description): parser = argparse.ArgumentParser( description = 'Prints the number of sequences in input file to stdout', usage = 'fastaq count_sequences <infile>') parser.add_argument('infile', help='N...
from pyfastaq import tasks
<|file_name|>jquery.fileupload-angular.min.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
version https://git-lfs.github.com/spec/v1 oid sha256:691b4033e555f469bcdba73a60c0e6a24b38ebffbbf94ebe7ba61e3edbf61601 size 6745
<|file_name|>isurl.js<|end_file_name|><|fim▁begin|>// Copyright 2015-2018 FormBucket LLC <|fim▁hole|> // credit: http://stackoverflow.com/questions/5717093/check-if-a-javascript-string-is-an-url var pattern = new RegExp( "^(https?:\\/\\/)?" + // protocol "((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|" + ...
// ISURL returns true when the value matches the regex for a uniform resource locator. export default function isurl(str) {
<|file_name|>pyclean.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 expandtab shiftwidth=4 autoindent import INN import datetime import logging import logging.handlers import os import os.path import re import shelve import sys import time import traceback # In Python2.4, utils was called Utils try: from email...
self.stats['decrement'] = decrement
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>PRIORITY_EMAIL_NOW = 0 PRIORITY_HIGH = 1 PRIORITY_NORMAL = 3 PRIORITY_LOW = 5 RESULT_SENT = 0 RESULT_SKIPPED = 1<|fim▁hole|> PRIORITIES = { 'now': PRIORITY_EMAIL_NOW, 'high': PRIORITY_HIGH, 'normal': PRIORITY_NORMAL, 'low': PRIORITY_LOW, } PRIORIT...
RESULT_FAILED = 2
<|file_name|>shapes.py<|end_file_name|><|fim▁begin|>EGA2RGB = [ (0x00, 0x00, 0x00), (0x00, 0x00, 0xAA), (0x00, 0xAA, 0x00), (0x00, 0xAA, 0xAA), (0xAA, 0x00, 0x00), (0xAA, 0x00, 0xAA), (0xAA, 0x55, 0x00), (0xAA, 0xAA, 0xAA),<|fim▁hole|> (0x55, 0xFF, 0x55), (0x55, 0xFF, 0xFF), (...
(0x55, 0x55, 0x55), (0x55, 0x55, 0xFF),
<|file_name|>dates.py<|end_file_name|><|fim▁begin|>from datetime import date, timedelta from django.conf import settings date_in_near_future = date.today() + timedelta(days=14) FOUR_YEARS_IN_DAYS = 1462 election_date_before = lambda r: { 'DATE_TODAY': date.today() } election_date_on_election_day = lambda r: { ...
election_date_after = lambda r: { 'DATE_TODAY': date.today() + timedelta(days=28)
<|file_name|>slow.rs<|end_file_name|><|fim▁begin|>//! Slow, fallback cases where we cannot unambiguously round a float. //! //! This occurs when we cannot determine the exact representation using //! both the fast path (native) cases nor the Lemire/Bellerophon algorithms, //! and therefore must fallback to a slow, arbi...
pub fn positive_digit_comp<F: Float>(mut bigmant: Bigint, exponent: i32) -> ExtendedFloat { // Simple, we just need to multiply by the power of the radix.
<|file_name|>BaseApiController.java<|end_file_name|><|fim▁begin|>package bartburg.nl.backbaseweather.provision.remote.controller; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import j...
import java.net.URL; import java.util.HashMap;
<|file_name|>selectors.js<|end_file_name|><|fim▁begin|>export const getIsAdmin = (state) => state.session.user?.administrator; export const getUserId = (state) => state.session.user?.id; export const getDevices = (state) => Object.values(state.devices.items); <|fim▁hole|><|fim▁end|>
export const getPosition = (id) => (state) => state.positions.items[id];
<|file_name|>augmented-assignments-feature-gate.rs<|end_file_name|><|fim▁begin|>// run-pass use std::ops::AddAssign; struct Int(i32); impl AddAssign<i32> for Int { fn add_assign(&mut self, _: i32) { } } fn main() {<|fim▁hole|><|fim▁end|>
let mut x = Int(0); x += 1; }
<|file_name|>dom_style_sheet.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::DOMMediaList; use crate::DOMNode; use crate::DOMObject; use glib::object::Cast; use glib::object::IsA; use...
} }
<|file_name|>nview.hpp<|end_file_name|><|fim▁begin|>/*============================================================================= Copyright (c) 2009 Hartmut Kaiser Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENS...
// define the nview() generator functions #include <boost/fusion/view/nview/detail/nview_impl.hpp>
<|file_name|>generate-deriving-span-tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # 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-AP...
if old_str_ignoring_date == string: # if all we're doing is updating the copyright year, ignore it
<|file_name|>item_chooser.js<|end_file_name|><|fim▁begin|>define([ 'backbone', 'text!templates/item_chooser.tpl', 'models/item', 'models/trigger', 'models/instance', 'models/media', 'views/item_chooser_row', 'views/trigger_creator', 'vent', 'util', ], function( Backbone, Template, Item, Trig...
vent.trigger("application:popup:show", trigger_creator, "Add Item to Scene"); },
<|file_name|>prints.client.routes.js<|end_file_name|><|fim▁begin|>'use strict'; // Setting up route angular.module('prints').config(['$stateProvider', function($stateProvider) { $stateProvider. state('listPrints', {<|fim▁hole|> } ]);<|fim▁end|>
url: '/prints', templateUrl: 'modules/prints/views/print-client-list.html' });
<|file_name|>characterdata.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/. */ //! DOM bindings for `CharacterData`. use dom::binding...
let old_length = self.Length(); let new_length = data.encode_utf16().count() as u32;
<|file_name|>mixins.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- # Copyright 2014-2017 Luc Saffre # This file is part of Lino Welfare. # # Lino Welfare 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 Fou...
from builtins import str import logging
<|file_name|>test_caxs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- from os import listdir import os import re import sys from argparse import ArgumentParser import random import subprocess from math import sqrt import ast from adderror import adderror """ENSAMBLE, -d directory -n numb...
with open("file_for_pymol.pml", "w") as file_for_pymol: file_for_pymol.write(""" load {s1} load {s2}
<|file_name|>bootstrap-slider.js<|end_file_name|><|fim▁begin|>/*! ========================================================= * bootstrap-slider.js * * Maintainers: * Kyle Kemp * - Twitter: @seiyria * - Github: seiyria * Rohit Kalkur * - Twitter: @Rovolutionary * - Github: rovolution * * ========...
<|file_name|>Accounts.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2013 OpenJST Project * * 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 License, or ...
<|file_name|>fasta_parser.py<|end_file_name|><|fim▁begin|>#(c) 2013-2014 by Authors #This file is a part of Ragout program. #Released under the BSD license (see LICENSE file) """ This module provides some basic FASTA I/O """ import logging <|fim▁hole|>logger = logging.getLogger() class FastaError(Exception): pas...
from string import maketrans
<|file_name|>linux_ssh.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import re import socket import time from netmiko.cisco_base_connection import CiscoSSHConnection from netmiko.ssh_exception import NetMikoTimeoutException class LinuxSSH(CiscoSSHConnection): def disable_paging(self, ...
"""Verify root"""
<|file_name|>sk1.js<|end_file_name|><|fim▁begin|>window._skel_config = { prefix: 'css/style', preloadStyleSheets: true, resetCSS: true, boxModel: 'border', grid: { gutters: 30 }, breakpoints: { wide: { range: '1200-', containers: 1140, grid: { gutters: 50 } }, narrow: { range: '...
var selected = $('#mathFunction :selected').val();
<|file_name|>default.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnDestroy, OnInit, Input } from '@angular/core'; import { control, Collection } from 'openlayers'; import { MapComponent } from '../map.component'; <|fim▁hole|> selector: 'aol-control-defaults', template: '' }) export class DefaultCon...
@Component({
<|file_name|>rssi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # RSSI production test import serial, sys, optparse, time, fdpexpect parser = optparse.OptionParser("update_mode") parser.add_option("--baudrate", type='int', default=57600, help='baud rate') parser.add_option("--rtscts", action='store_true', def...
parser.add_option("--dsrdtr", action='store_true', default=False, help='enable dsrdtr')
<|file_name|>qimage_test.py<|end_file_name|><|fim▁begin|>'''Test cases for QImage''' import unittest import py3kcompat as py3k from PySide.QtGui import * from helper import UsesQApplication, adjust_filename xpm = [ "27 22 206 2", " c None", ". c #FEFEFE", "+ c #FFFFFF", "@ c #F9F9F9", "# ...
"+ y z . @ A k B 7 n + ( s | p 8 C D 2 E 4 + + F G + . ", "# H I $ J G K L - M N . 2 O P Q R R S T U s s V W j + ", "X Y Z @ o ` _ g ...+.( 4 @.#.m G $.%.7 &.X *.=.-.;.&.",
<|file_name|>LKDemoController.java<|end_file_name|><|fim▁begin|>package com.lichkin.framework.springboot.controllers.impl; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.spring...
/** * 页面跳转逻辑 * @author SuZhou LichKin Information Technology Co., Ltd.
<|file_name|>ed.js<|end_file_name|><|fim▁begin|>/*global chrome */<|fim▁hole|>// Check if the feature is enable let promise = new Promise(function (resolve) { chrome.storage.sync.get({ isEdEnable: true }, function (items) { if (items.isEdEnable === true) { resolve(); } })...
<|file_name|>bitcoin_bs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="bs" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Ponscoin</source> ...
</message>
<|file_name|>DXImageTransform.Microsoft.MaskFilter.js<|end_file_name|><|fim▁begin|>class dximagetransform_microsoft_maskfilter { constructor() { // Variant Color () {get} {set} this.Color = undefined;<|fim▁hole|>} module.exports = dximagetransform_microsoft_maskfilter;<|fim▁end|>
}
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>fn main() { let out_dir = std::env::var("OUT_DIR").unwrap(); let out_path = |f : &str| format!("{}/{}", out_dir, f); std::process::Command::new("gcc")<|fim▁hole|> &out_path("morpha_interface.o")]) .status().unwrap(); std::process:...
.args(&["src/morpha_interface.c", "-c", "-fPIC", "-o",
<|file_name|>i18n.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * `I18nMutateOpCode` defines OpCodes for `I18nMutateOpCodes` a...
*/
<|file_name|>fetchUrl.go<|end_file_name|><|fim▁begin|>// package main /* Packages must be imported: "core/common/page" "core/spider" Pckages may be imported: "core/pipeline": scawler result persistent; "github.com/PuerkitoBio/goquery": html dom parser. */ import ( "github.com/PuerkitoBio/goquery" ...
// these urls will be saved and crawed by other coroutines. p.AddTargetRequests(urls, "html") name := query.Find(".entry-title .author").Text()
<|file_name|>oc_version.py<|end_file_name|><|fim▁begin|># pylint: skip-file # pylint: disable=too-many-instance-attributes class OCVersion(OpenShiftCLI): ''' Class to wrap the oc command line tools ''' # pylint allows 5 # pylint: disable=too-many-arguments def __init__(self, config, ...
if yum_base.rpmdb.searchNevra(name='atomic-openshift'):
<|file_name|>sinf64.rs<|end_file_name|><|fim▁begin|>#![feature(core, core_intrinsics, core_float)] extern crate core; #[cfg(test)] mod tests { use core::intrinsics::sinf64; use core::num::Float; use core::f64; use core::f64::consts::PI; <|fim▁hole|> // pub fn sinf64(x: f64) -> f64; #[test] ...
<|file_name|>514f4b9bc74_added_columns_for_duel_win_lose_streaks_.py<|end_file_name|><|fim▁begin|>"""Added columns for duel win/lose streaks in the tb_user_duel_stats table Revision ID: 514f4b9bc74 Revises: 1d6dbeb93c9 Create Date: 2015-12-22 00:17:51.509756 """ # revision identifiers, used by Alembic. revision = '5...
<|file_name|>codeFixNoPropertyAccessFromIndexSignature_fixAll.ts<|end_file_name|><|fim▁begin|>/// <reference path='fourslash.ts'/> // @noPropertyAccessFromIndexSignature: true //// interface A { //// foo: string //// } //// interface B { //// [k: string]: string //// } //// interface C { //// foo...
fixAllDescription: ts.Diagnostics.Use_element_access_for_all_undeclared_properties.message, newFileContent:
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 Hyunsik Choi // // 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 ...
/// libhdfs binding APIs
<|file_name|>12.07-002.js<|end_file_name|><|fim▁begin|>// Copyright JS Foundation and other contributors, http://js.foundation // // 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 // // ht...
sum += 1;
<|file_name|>test.js<|end_file_name|><|fim▁begin|>// import should from 'should'; import { createStore } from 'redux'; import reredeux, { deux, LABELS } from '../src'; const { INIT, SELECT, ACTION, REDUCER, VALUE } = LABELS; import todo from './todo'; import counter from './counter'; import phonebook from './phonebook...
<|file_name|>block_test.go<|end_file_name|><|fim▁begin|>// Copyright 2017 The go-xenio Authors // Copyright 2015 The go-ethereum Authors // // This file is part of the go-xenio library. // // The go-xenio library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Pub...
bt.walk(t, blockTestDir, func(t *testing.T, name string, test *BlockTest) { if err := bt.checkFailure(t, name, test.Run()); err != nil { t.Error(err)
<|file_name|>formkit.js<|end_file_name|><|fim▁begin|>/* $(document.body).ready(function() { FormKit.install(); FormKit.initialize(document.body); }); Inside Ajax Region: $(document.body).ready(function() {<|fim▁hole|> }); */ var FormKit = { register: function(initHandler,installHandler) { ...
FormKit.initialize( div element );
<|file_name|>ColorsUtil.java<|end_file_name|><|fim▁begin|>package ca.six.views.util; import android.graphics.Color; public class ColorsUtil { public static boolean isLight(int color) { return Math.sqrt( Color.red(color) * Color.red(color) * 0.241 + Color.green(color) * Color.green(color) * 0...
} public static int getBaseColor(int color) { if (isLight(color)) {
<|file_name|>interalSimpleDownloader.py<|end_file_name|><|fim▁begin|>import xml.etree.ElementTree as etree import base64 from struct import unpack, pack import sys import io import os import time import itertools import xbmcaddon import xbmc import urllib2,urllib import traceback import urlparse import posixpath import...
self.status='finished'
<|file_name|>local.py<|end_file_name|><|fim▁begin|>"""Dev server used for running a chalice app locally. This is intended only for local development purposes. """ from __future__ import print_function import re import threading import time import uuid import base64 import functools import warnings from collections im...
handler_cls, app_object=app_object, config=config) self.server = server_cls((host, port), self._wrapped_handler)
<|file_name|>ListExampleFolder.js<|end_file_name|><|fim▁begin|>import React from 'react'; import MobileTearSheet from './MobileTearSheet'; import List from 'material-ui/lib/lists/list'; import ListItem from 'material-ui/lib/lists/list-item'; import ActionInfo from 'material-ui/lib/svg-icons/action/info'; import Divider...
</List> <Divider inset={true} /> <List subheader="Files" insetSubheader={true}> <ListItem
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Solve the Project Euler problems using functional Python. https://projecteuler.net/archives """ from importlib import import_module from os import listdir<|fim▁hole|>SOLVED = set( int(m.group(1)) for f in listdir(abspath(dirname(__file__))) for m in...
from os.path import abspath, dirname from re import match
<|file_name|>FeedBackInfo.java<|end_file_name|><|fim▁begin|>package com.oa.bean; public class FeedBackInfo { private Long id; private String feedbackinfo; private String userid; private String date; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getFeed...
<|file_name|>InventoryClick.java<|end_file_name|><|fim▁begin|>package com.a4server.gameserver.network.packets.clientpackets; import com.a4server.gameserver.model.GameLock; import com.a4server.gameserver.model.GameObject; import com.a4server.gameserver.model.Hand; import com.a4server.gameserver.model.Player; import com...
// положим в инвентарь if (to != null) { if (to.getObject().tryLock(WAIT_LOCK))
<|file_name|>$rename.js<|end_file_name|><|fim▁begin|>/** * Created by sh on 15/7/6. */ "use strict"; var type = require("../type"); exports.parse = function (object, define, addition) { return type.dataParse(object, {type: Object, contents: String}, addition);<|fim▁hole|><|fim▁end|>
};
<|file_name|>project_spec.js<|end_file_name|><|fim▁begin|>'use strict'; var chakram = require('chakram'), expect = chakram.expect, Request = require('../../commons/request.js'), request = new Request(), User = require('../user/user.js'), user = new User(), Project = require('./project.js'), ...
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from './alert.service'; export * from './authentication.service'; export * from './task.service'; export * from './project.service'; export * from './label.service';<|fim▁hole|><|fim▁end|>
export * from './user.service';
<|file_name|>pt-br.js<|end_file_name|><|fim▁begin|>/* <|fim▁hole|> copy: 'Copyright &copy; $1. Todos os direitos reservados.', dlgTitle: 'Sobre o CKEditor 4', moreInfo: 'Para informações sobre a licença por favor visite o nosso site:' } );<|fim▁end|>
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'about', 'pt-br', {
<|file_name|>issue-11873.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. Thi...
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at
<|file_name|>htmlfieldsetelement.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::attr::Attr; use dom::bindings::codegen::...
fn super_type(&self) -> Option<&VirtualMethods> { Some(self.upcast::<HTMLElement>() as &VirtualMethods)
<|file_name|>no.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.<|fim▁hole|>*/ CKEDITOR.plugins.setLang( 'save', 'no', { toolbar: 'Lagre' } );<|fim▁end|>
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
<|file_name|>test_tf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import pytest from sumy.models import TfDocumentModel from sumy.nlp.tokenizers import Tokenizer def test_no_tokenizer_with_string(): with pytest.raises...
model = TfDocumentModel(("wA", "WB", "wB", "WA"))
<|file_name|>prometheusremotewrite_test.go<|end_file_name|><|fim▁begin|>package prometheusremotewrite import ( "bytes" "fmt" "github.com/gogo/protobuf/proto" "github.com/golang/snappy" "github.com/prometheus/common/model" "github.com/prometheus/prometheus/prompb" "strings" "testing" "time" "github.com/influ...
"cpu",
<|file_name|>todo-list-view.js<|end_file_name|><|fim▁begin|>var $ = require('jquery'); var Backbone = require('backbone'); Backbone.$ = $; //CHALLENGE: "bring in" the appropriate template for this view var TodoListView = Backbone.View.extend({ tagName: 'div',<|fim▁hole|> }, render: function () { var data =...
className: 'list-group', initialize: function () { this.listenTo(this.collection,'all', this.render);
<|file_name|>bitcoin_fa.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fa" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About KCz</source> ...
<location line="+68"/>
<|file_name|>rt.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT> //! General — Library initialization and misc...
#[cfg(feature = "3.10")] pub fn set_allowed_backends(backends: &str) { assert_not_initialized!();
<|file_name|>SearchField.java<|end_file_name|><|fim▁begin|>package dk.lessismore.nojpa.reflection.db.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /**<|fim▁hole|> * User: seb */ @Target(Ele...
* Created : with IntelliJ IDEA.
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin<|fim▁hole|># Register your models here. admin.site.register(xbee_module);<|fim▁end|>
from xbee_module.models import xbee_module
<|file_name|>DocumentCategorizerContextGenerator.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 ...
import java.util.Collection; import java.util.LinkedList; import java.util.Map;
<|file_name|>setting.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package org import ( "strings" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/auth"...
} else { ctx.Handle(500, "UserSignIn", err)
<|file_name|>ok.py<|end_file_name|><|fim▁begin|>""" Source: https://github.com/txt/mase/blob/master/src/ok.md # Unit tests in Python Python has some great unit testing tools. The one shown below is a "less-is-more" approach and is based on [Kent Beck video on how to write a test engine in just a few lines of code](h...
tries = fails = 0 # tracks the record so far @staticmethod def score():
<|file_name|>agent.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- # Copyright (c) 2015 b<>com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
def update(self, notifier, data): LOG.debug("[Agent] Updated by: %s", notifier)
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Nablarch解説書 documentation build configuration file, created by # sphinx-quickstart on Fri Jan 08 09:45:59 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration ...
copyright = u'2010-' + str(date.today().year) + u', koyi Inc'
<|file_name|>BioXASCarbonFilterFarm.cpp<|end_file_name|><|fim▁begin|>#include "BioXASCarbonFilterFarm.h" BioXASCarbonFilterFarm::BioXASCarbonFilterFarm(const QString &deviceName, QObject *parent) : BioXASBeamlineComponent(deviceName, parent) { // Create upstream actuator. upstreamActuator_ = new BioXASCarbonFilter...
} void BioXASCarbonFilterFarm::removeDownstreamActuatorWindowPreference(double filter) {
<|file_name|>widget.spec.ts<|end_file_name|><|fim▁begin|>// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import { Context, DocumentRegistry, TextModelFactory } from '@jupyterlab/docregistry'; import * as Mock from '@jupyterlab/testutils/lib/mock'; import { U...
function fakeRenderCell(row: number, column: number) {
<|file_name|>schema.rs<|end_file_name|><|fim▁begin|>use types::{ChecksumType, Column, ColumnValue}; use v1::row::{Row}; use v1::write::{schema_write}; use v1::read::schema_read; use v1::parse::parse_string; use std::io::{Error, ErrorKind, Read, Write}; use std::str; pub struct Metadata { pub checksum: Checksu...
<|file_name|>ConfigFilesFinder.java<|end_file_name|><|fim▁begin|>package org.xiaotian.config; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import org.apache.log4j.Logger; import org.xiaotian.config.bean.ConfigFile; import org.xiaotian.config.bean.ConfigFiles; import org.xiaotian...
}
<|file_name|>text.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" /> <% fr...
#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToCss)] pub enum Side { Clip,