prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>file2json.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
let papa = require('papaparse');
@Injectable()
export class File2JSONService {
CSV2JSON(csvFile: File, callback): void {
let config = { skipEmptyLines: true,
header: true,
... | |
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = {
"extends": "airbnb",
"parser": "babel-eslint",
"plugins": [
"react"
],
"rules": {
"react/prop-types": 0,
"react/jsx-boolean-value": 0,
"consistent-return": 0,
"guard-for-in": 0,<|fim▁hole|>};<|fim▁end|> | "no-use-before-define": 0,
"space-before-function-paren": [2, { "anonymous": "never", "named": "always" }]
} |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for nykampweb project.<|fim▁hole|>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 django.core.wsgi im... | |
<|file_name|>lights.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/. */
//! Module that implements lights for `PhilipsHueAdapter`
//!
... | }
pub fn get_power(&self) -> bool { |
<|file_name|>variable.rs<|end_file_name|><|fim▁begin|>use Renderable;
use context::Context;
use error::Result;
#[derive(Debug)]
pub struct Variable {
name: String,
}
impl Renderable for Variable {
fn render(&self, context: &mut Context) -> Result<Option<String>> {
let res = match context.get_val(&self... | } |
<|file_name|>anti-abuse-client.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/* global $ */
"use strict";
var formField = require("../ui/utils/form-field.js");
module.exports = function(core, config, store) {
function addBanMenu(from, menu, next) {
var room = store.get("nav", "room"),
rel = store.getRelation()... | /* jshint browser: true */ |
<|file_name|>HttpConnection.java<|end_file_name|><|fim▁begin|>package org.osmdroid.bonuspack.utils;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.StatusL... | |
<|file_name|>controllers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from gluon import current
#from gluon.html import *
from gluon.storage import Storage
from s3 import S3CustomController
THEME = "historic.CRMT"
# =============================================================================
class index... | query = (table.pe_id == og.pe_id)
else: |
<|file_name|>util.tour.js<|end_file_name|><|fim▁begin|>define(['jquery', 'util.tooltips', 'helper.boxes', 'modules/panel'], function($, tooltips, panel) {
/* Grid */
tourStepsGrid = [
{
beginning: true,
title: 'Welcome to the Blox Visual Editor!',
content: '<p>If this is your first time in the Blox Visual... | } else {
api.set('position.adjust.y', 0); |
<|file_name|>Nextion.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
*
* 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 versio... | |
<|file_name|>transform.py<|end_file_name|><|fim▁begin|>#
# SPDX-FileCopyrightText: 2017 Dmytro Kolomoiets <amerlyq@gmail.com> and contributors.
#<|fim▁hole|>
class NodeSuperimposeTr(object):
def __call__(self, g, node_uid, aug):
conv = {}
for uid in aug:
if uid == aug.get_root():
... | # SPDX-License-Identifier: GPL-3.0-only
#
|
<|file_name|>GbjUserSoldCommentsReplyService.java<|end_file_name|><|fim▁begin|>/**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.sys.service.gbj;
import java.util.List;
import org.springframework.beans.factory.anno... | public void save(GbjUserSoldCommentsReply gbjUserSoldCommentsReply) {
super.save(gbjUserSoldCommentsReply);
} |
<|file_name|>Troop.js<|end_file_name|><|fim▁begin|>class Goblin extends Entity {
constructor(x, y, team) {
super(x, y, team);
this.totalHealth = 100;
this.attackStrength = 60;
this.attackSpeed = 1100;<|fim▁hole|> this.deploySpeed = 1000;
this.size = 10;
... | this.speed = 0.15; // 10 px/ms |
<|file_name|>questions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Module that implements the questions types
"""
import json
from . import errors
def question_factory(kind, *args, **kwargs):
for clazz in (Text, Password, Confirm, List, Checkbox):
if clazz.kind == kind:
retur... | 'Json contained a %s variable when a dict or list was expected',
type(data)) |
<|file_name|>filecontainer.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2017 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed ... | Some(c) => {
(c.FileContainerRecycle)(self); |
<|file_name|>initialize_fill_test.cpp<|end_file_name|><|fim▁begin|>#include <stan/math/prim.hpp>
#include <gtest/gtest.h>
#include <vector>
TEST(AgradPrimMatrix, initialize_fill) {
using Eigen::Dynamic;
using Eigen::Matrix;
using stan::math::initialize_fill;
using std::vector;
double x;
double y = 10;
i... |
Matrix<double, Dynamic, Dynamic> m(2, 3); |
<|file_name|>test_settings.py<|end_file_name|><|fim▁begin|>from datetime import date, datetime, time
from decimal import Decimal
from django.core.files import File
from django.core.files.storage import default_storage
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from d... | |
<|file_name|>class-poly-methods-cross-crate.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http:/... | pub fn main() {
let mut nyan : cat<char> = cat::<char>(52u, 99, ~['p']); |
<|file_name|>deepset.js<|end_file_name|><|fim▁begin|>'use strict';
// MODULES //
var isArrayLike = require( 'validate.io-array-like' ),
isTypedArrayLike = require( 'validate.io-typed-array-like' ),
deepSet = require( 'utils-deep-set' ).factory,
deepGet = require( 'utils-deep-get' ).factory;
// FUNCTIONS
var POW... | dset( x[ i ], NaN ); |
<|file_name|>recipe-511434.py<|end_file_name|><|fim▁begin|>HOST = '127.0.0.1'
PORT = 8080
from Tkinter import *
import tkColorChooser
import socket
import thread
import spots
################################################################################
def main():
global hold, fill, draw, look<|fim▁hole|> ... | |
<|file_name|>input.js<|end_file_name|><|fim▁begin|>var foo = createReactClass({});<|fim▁hole|><|fim▁end|> | var bar = React.createClass({}); |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|>from django.db import migrations, models
from django.conf import settings
from opaque_keys.edx.django.models import CourseKeyField
<|fim▁hole|> ]
operations = [
migrations.CreateModel(
name='CourseGoal',
fields=[
... | class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
<|file_name|>currencyPairs.service-mock.ts<|end_file_name|><|fim▁begin|>import { bind } from "@react-rxjs/core"<|fim▁hole|>import { of } from "rxjs"
import { delay, distinctUntilChanged, map } from "rxjs/operators"
import { CurrencyPair } from "./types"
const fakeData: Record<string, CurrencyPair> = {
EURUSD: {
... | |
<|file_name|>userTableModule.js<|end_file_name|><|fim▁begin|>angular.module("userTableModule", [])
.controller('userTableController', ['$http', function ($http, $scope, $log) {
var userTable = this;
userTable.users = [];
$http.get('/allUsers').success(function (data) {
userTable... | if (index == -1) {
alert("Не удалось найти строку с таким id:" + id);
}
userTable.users.splice(index, 1); |
<|file_name|>sweep.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from utils import load_data, save_data
<|fim▁hole|>def run():
# load in members, orient by bioguide ID
print("Loading current legislators...")
current = load_data("legislators-current.yaml")
current_bioguide = { }
for m in cu... | |
<|file_name|>Make Layer Cells.py<|end_file_name|><|fim▁begin|># $description: Split into layer cells
# $autorun
# $show-in-menu
import pya
import sys
sys.stderr = sys.stdout
class MenuAction(pya.Action):
def __init__(self, title, shortcut, action):
self.title = title
self.shortcut = shortcut
... | array = pya.CellInstArray() |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>/*
* main.cpp
*
* Created on: 2015Äê12ÔÂ3ÈÕ
* Author: weiteng
*/
#include <sys/file.h>
#include "libc2c/pid_guard.h"
#include "../../include/log_manager.h"
#include "app_config.h"
#include "config_report_agent.h"
void CheckProcessAlive(con... | |
<|file_name|>cstringio-example-2.py<|end_file_name|><|fim▁begin|>'''
ΪÁËÈÃÄãµÄ´úÂ뾡¿ÉÄÜ¿ì, µ«Í¬Ê±±£Ö¤¼æÈݵͰ汾µÄ Python ,Äã¿ÉÒÔʹÓÃÒ»¸öС¼¼ÇÉÔÚ cStringIO ²»¿ÉÓÃʱÆôÓà StringIO Ä£¿é, Èç ÏÂÀý Ëùʾ.
'''
try:
import cStringIO
StringIO = cStringIO<|fim▁hole|>
print StringIO<|fim▁end|> | except ImportError:
import StringIO |
<|file_name|>Generator.java<|end_file_name|><|fim▁begin|>package com.sqisland.gce2retrofit;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonReader;
import com.squareup.javawriter.JavaWriter;
import ... | }
// Then add the keys not in parameterOrder
for (String key : remaining) { |
<|file_name|>unicodecsv.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys
import csv
from itertools import izip
# https://pypi.python.org/pypi/unicodecsv
# http://semver.org/
VERSION = (0, 9, 4)
__version__ = ".".join(map(str, VERSION))
pass_throughs = [
'register_dialect',
'unregister_diale... | except UnicodeDecodeError as e: |
<|file_name|>ThreadTask.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1998-2010 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source is free software; you... | }
|
<|file_name|>A.java<|end_file_name|><|fim▁begin|>public enum A {
;
A(String s){}<|fim▁hole|><|fim▁end|> | } |
<|file_name|>a23e88f06478_add_commentset_fields.py<|end_file_name|><|fim▁begin|>"""Add commentset fields.
Revision ID: a23e88f06478
Revises: 284c10efdbce
Create Date: 2021-03-22 02:54:30.416806
"""
from alembic import op
from sqlalchemy.sql import column, table
import sqlalchemy as sa
# revision identifiers, used by... | )
op.alter_column('commentset_membership', 'is_muted', server_default=None)
|
<|file_name|>EventsBoss.java<|end_file_name|><|fim▁begin|>/**
* NOTE: This copyright does *not* cover user programs that use HQ
* program services by normal system calls through the application
* program interfaces provided as part of the Hyperic Plug-in Development
* Kit or the Hyperic Client Development Kit - thi... | throws SessionNotFoundException, SessionTimeoutException, PermissionException, |
<|file_name|>_tickvals.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="sunburst.marker.colorbar", **kwargs
):
super(TickvalsValidator, self).__... | **kwargs
) |
<|file_name|>webpackStatic.js<|end_file_name|><|fim▁begin|>"use strict";<|fim▁hole|>
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var STATIC_REG = /.*\.(png|jpe?g|gif|svg|woff2?|eot|ttf|otf)$/;
var VER_REG = /[\W][\d\w]+(?=\.\w+$)/;
var _default = function _default(req,... | |
<|file_name|>wordfast.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | ("&'A0;", u"\u00A0"), # - Non breaking space
("&'A9;", u"\u00A9"), # © - Copyright
("&'AE;", u"\u00AE"), # ® - Registered |
<|file_name|>backend.memory.js<|end_file_name|><|fim▁begin|>this.recline = this.recline || {};
this.recline.Backend = this.recline.Backend || {};
this.recline.Backend.Memory = this.recline.Backend.Memory || {};
(function(my, recline) {
"use strict";
my.__type__ = 'memory';
// private data - use either jQuery or... | });
tmp.terms = tmp.terms.slice(0, 10);
});
return facetResults; |
<|file_name|>course_copy_csv.py<|end_file_name|><|fim▁begin|>import requests
import csv
from configparser import ConfigParser
config = ConfigParser()
config.read("config.cfg")
token = config.get("auth", "token")
domain = config.get("instance", "domain")
headers = {"Authorization" : "Bearer %s" % token}
source_course_id... | payload = {'migration_type': 'course_copy_importer', 'settings[source_course_id]': source_course_id} |
<|file_name|>001_add_initial_tables.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 Lic... | |
<|file_name|>b.py<|end_file_name|><|fim▁begin|>from font import font
from qt import QFont
class b( font ):
"""<|fim▁hole|> <p>
<b>Properties:</b>
<br>
See <a href="font.html"><font></a> for properties.
"""
def __init__( self, *args ):
"""
Initiate the container, contents, and properties.
-*args, ar... | <b> makes text bold. |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for youtube_podcaster.
This file was generated with PyScaffold 2.4.2, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"... |
def setup_package():
needs_sphinx = {'build_sphinx', 'upload_docs'}.intersection(sys.argv) |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>/**
* Problem 10.1 CTCI Sorted Merge
*
* You are given two sorted arrays, a and b, where a has a large enough buffer at the end to hold
* b. Write a method to merge b into a in sorted order.
*
* Examples:
*
* a: 2, 7, 22, 44, 56, 88, 456, 5589
* b: 1, 4... | *
* 1) Starting at the end of the arrays, compare (a, b) each descending element and place the larger
* at the end of the result array (a). If the values are identical, put both elements into the |
<|file_name|>GetWebPage.py<|end_file_name|><|fim▁begin|>from urllib.request import urlopen
for line in urlopen('https://secure.ecs.soton.ac.uk/status/'):
line = line.decode('utf-8') # Decoding the binary data to text.
if 'Core Priority Devices' in line: #look for 'Core Priority Devices' To find the line of te... | |
<|file_name|>live.js<|end_file_name|><|fim▁begin|>window.chartColors = {
red: 'rgb(255, 99, 132)',
orange: 'rgb(255, 159, 64)',
yellow: 'rgb(255, 205, 86)',
green: 'rgb(75, 192, 192)',
blue: 'rgb(54, 162, 235)',
purple: 'rgb(153, 102, 255)',
grey: 'rgb(231,233,237)'
};
ES.WidgetLive = ES.Wi... | |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>"""A basic implementation of a Neural Network
by following the tutorial by Andrew Trask
http://iamtrask.github.io/2015/07/12/basic-python-network/
"""
import numpy as np
# sigmoid function
def nonlin(x, deriv=False):
if deriv==True:
return x * (1-x)
r... | # deterministic (good practice)
np.random.seed(1) |
<|file_name|>wikiLink.spec.ts<|end_file_name|><|fim▁begin|>import Markdown from 'markdown-it'
import { wikiLinkInit } from './index'
describe('wikiLink', () => {
let md: Markdown = undefined<|fim▁hole|>
afterEach(() => (md = undefined))
it('should gerenare wiki link tag', () => {
const actual = md?.render('... |
beforeEach(() => (md = new Markdown({}).use(wikiLinkInit()))) |
<|file_name|>compile_OgreMain_1.cpp<|end_file_name|><|fim▁begin|>#include "src/OgreExternalTextureSourceManager.cpp"
#include "src/OgreFileSystem.cpp"
#include "src/OgreFont.cpp"
#include "src/OgreFontManager.cpp"
#include "src/OgreFrustum.cpp"
#include "src/OgreGpuProgram.cpp"
#include "src/OgreGpuProgramManager.cpp"
... | #include "src/OgreMaterial.cpp" |
<|file_name|>check.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*-
from findbilibili import *
#funtion name [checkinfo]<|fim▁hole|>#param array 抓取的文字
#return string 回答
def checkinfo2(content):
content[1] = content[1].decode('gbk')
key = content[1].encode('utf-8')
if key == '节操':
return '这种东西... | #判断要输出的回答 |
<|file_name|>_customdatasrc.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
<|fim▁hole|> plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "none"),
**kwargs
)<|fim▁end|> |
class CustomdatasrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="customdatasrc", parent_name="scatter", **kwargs):
super(CustomdatasrcValidator, self).__init__( |
<|file_name|>amicreation.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
import boto3
import time
from botocore.exceptions import ClientError
from datetime import datetime
def get_unix_timestamp():
"""
Generate a Unix timestamp string.
"""
d = datetime.no... | event['DryRun'] = False
if not 'Filters' in event: |
<|file_name|>fclass.rs<|end_file_name|><|fim▁begin|>use std::{borrow::Cow, io::Write};
use log::debug;
use petgraph::Direction;
use proc_macro2::{Span, TokenStream};
use quote::{quote, ToTokens};
use rustc_hash::FxHashSet;
use smol_str::SmolStr;
use syn::{spanned::Spanned, Ident, Type};
use crate::{
cpp::{
... | |
<|file_name|>CyanACTabCompleter.java<|end_file_name|><|fim▁begin|>package info.cyanac.plugin.bukkit;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
public class CyanACTabCompleter implements TabCom... |
}
return null; |
<|file_name|>ui_test.go<|end_file_name|><|fim▁begin|>package main
import (
"testing"
)
<|fim▁hole|>}<|fim▁end|> | func TestMain(t *testing.T) { |
<|file_name|>packet_handler.rs<|end_file_name|><|fim▁begin|>extern crate netfilter_queue as nfq;
use std::ptr::null;
use nfq::handle::{Handle, ProtocolFamily};
use nfq::queue::{CopyMode, Verdict, PacketHandler, QueueHandle};<|fim▁hole|>use nfq::message::Message;
use nfq::error::Error;
fn main() {
let mut handle =... | |
<|file_name|>batch.py<|end_file_name|><|fim▁begin|># Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... |
def _assign_entity_to_mutation(mutation_pb, entity, auto_id_entities):
"""Copy ``entity`` into appropriate slot of ``mutation_pb``. |
<|file_name|>map.js<|end_file_name|><|fim▁begin|>/**
* Clone a copy of the object passed as parameter using JQuery extension
* @param {object} o
* @return {object} copy of the parameter object
*/
function clone(o) {
return jQuery.extend({}, o);
}
function disableZoomHandlers(map) {
map.touchZoom.disable();
... | mouse_position = e.clientX;
if (mouse_position <= 100) {
animating = true; |
<|file_name|>base.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 under the Apache Lic... | """ |
<|file_name|>aff_validator.py<|end_file_name|><|fim▁begin|># coding: utf-8
import os
from difflib import SequenceMatcher
from unicodedata import normalize
def remove_diacritics(s):
try:
s = normalize('NFKD', s)
except TypeError:
s = normalize('NFKD', unicode(s, "utf-8"))
finally:
r... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import Y... | Getter method for state, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/global/lsp_bit/overload_bit/state (container)
YANG Description: This container defines state for ISIS Overload Bit. |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>#coding=utf-8
from django.db import models
from django.contrib.auth.models import User<|fim▁hole|>
class Activity(models.Model):
owner = models.ForeignKey(User, null=False)
text = models.CharField(max_length=20, unique=True)
class Dessert(models.Model):
a... | |
<|file_name|>add-page.js<|end_file_name|><|fim▁begin|>/**
* Created with JetBrains WebStorm.
* User: yuzhechang
* Date: 13-9-24
* Time: 下午3:47
* To change this template use File | Settings | File Templates.
*/
(function($) {
var ngmod = angular.module("framework.controllers", ["framework.serviceService"]);
<|... | ngmod.controller("pageCtrl",function($scope,$rootScope,service_clist_FlistRES){
$scope.abc = "test-data";
$scope.flistData = null;
$scope.selFlist=null ; |
<|file_name|>adminws.py<|end_file_name|><|fim▁begin|>"""Contain the socket handler for players"""
from game import Game
from websocket import WebSocketHandler
from zone import Zone
import errcode
class AdminWs(WebSocketHandler):
"""The socket handler for websocket"""
def __init__(self, *args, **kwargs):
... | |
<|file_name|>type.go<|end_file_name|><|fim▁begin|>// Copyright 2009 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.
// DWARF type information structures.
// The format is heavily biased toward C, but for simplicity
// the Stri... | for i, v := range t.Val {
if i > 0 { |
<|file_name|>goku_test.go<|end_file_name|><|fim▁begin|>package goku
import (
"runtime"
"testing"
"time"
)
type TestReader struct{}
func (self TestReader) Read() ([]Message, error) {
time.Sleep(10 * time.Millisecond)
return []Message{"Hello"}, nil
}
type TestWriter struct {
msgs []Message
}
func (self *TestWr... | case <-time.After(100 * time.Millisecond):
t.Fatal("Timeout expired")
} |
<|file_name|>testPotentialIntegrals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from icqsol.bem.icqPotentialIntegrals import PotentialIntegrals
from icqsol.bem.icqLaplaceMatrices import getFullyQualifiedSharedLibraryName
import numpy
def testObserverOnA(order):
paSrc = numpy.array([0., 0., 0.])
pbSr... | ptIds.SetId(0, 0); ptIds.SetId(1, 1); ptIds.SetId(2, 3)
pdata.InsertNextCell(vtk.VTK_POLYGON, ptIds) |
<|file_name|>learning_curve.py<|end_file_name|><|fim▁begin|>"""Utilities to evaluate models with respect to a variable
"""
# Author: Alexander Fabisch <afabisch@informatik.uni-bremen.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
from .base import is_classifier, clone
from .cross_validation import ... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Django settings for opendata project.
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
from django.core.urlresolvers import reverse_lazy
PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PROJECT_ROOT = os... | 'PORT': '',
}
}
|
<|file_name|>card-list.ts<|end_file_name|><|fim▁begin|>import {
Component, Input,
ContentChild, ViewChildren, QueryList
} from 'angular2/core';
import template from './card-list.html!text';
import { CardHeader } from './header/card-header';
import { CardBody } from './body/card-body';
import { Card } from './card/c... | body: CardBody; |
<|file_name|>taskbar_ia.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ia">
<context>
<name>LxQtTaskButton</name>
<message>
<location filename="../lxqttaskbutton.cpp" line="367"/>
<source>Application</source>
<translation ... | <source>Show windows from all desktops</source>
<translation type="unfinished"></translation>
</message> |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.template.defaultfilters import truncatechars
class Setting(models.Model):
name = models.CharField(max_length=100, unique=True, db_index=True)
value = models.TextField(blank=True, default='')
value_type = models.Ch... | def __str__(self): |
<|file_name|>security.js<|end_file_name|><|fim▁begin|>BrowserPolicy.content.allowOriginForAll("*.googleapis.com");
BrowserPolicy.content.allowOriginForAll("*.gstatic.com");
BrowserPolicy.content.allowOriginForAll("*.bootstrapcdn.com");
BrowserPolicy.content.allowOriginForAll("*.geobytes.com");<|fim▁hole|>BrowserPolicy.... | |
<|file_name|>component.js<|end_file_name|><|fim▁begin|><|fim▁hole|> hasErrors: Ember.computed.notEmpty('model.errors.[]')
});<|fim▁end|> | import Ember from 'ember';
export default Ember.Component.extend({ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Converts XML strings into a DOM structure
//!
//! ### Example
//!
//! ```
//! use document::parser::Parser;
//! let parser = Parser::new();
//! let xml = r#"<?xml version="1.0"?>
//! <!-- Awesome data incoming -->
//! <data awesome="true">
//! <datum>Science</datum... | fn processing_instruction(&mut self, target: &str, value: Option<&str>);
fn text(&mut self, text: &str);
fn reference(&mut self, reference: Reference); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() {
let x = 5;
let x = x + 1;<|fim▁hole|>}<|fim▁end|> |
let x = x * 2;
println!("The value of x is: {}", x); |
<|file_name|>errno.rs<|end_file_name|><|fim▁begin|>use imp::errno as errno;
const ZMQ_HAUSNUMERO: i32 = 156384712;
pub const EACCES: i32 = errno::EACCES;
pub const EADDRINUSE: i32 = errno::EADDRINUSE;
pub const EAGAIN: i32 = errno::EAGAIN;
pub const EBUSY: i32 = errno::EBUSY;
pub ... | pub const EFSM: i32 = (ZMQ_HAUSNUMERO + 51); |
<|file_name|>tessera.ts<|end_file_name|><|fim▁begin|>import { Searchable } from '../common'
<|fim▁hole|>import { Tesseramento } from './tesseramento'
export class Tessera implements Searchable{
id: number;
numero: number;
anno: Tesseramento;
quota ?: number;
id_statino ?: number;
... | |
<|file_name|>lifelines.py<|end_file_name|><|fim▁begin|>import time
import RPi.GPIO as GPIO
GPIO.VERSION
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11,GPIO.OUT)<|fim▁hole|>
from smbus import SMBus
bus = SMBus(1)
def read_ain(i):
global bus
#bus.write_byte_data(0x48, 0x40 | ((i) & 0x03), 0)
bus.write_byte(0x48... | GPIO.setup(12,GPIO.OUT) |
<|file_name|>validate_match.py<|end_file_name|><|fim▁begin|>'''
Created on Mar 4, 2017
@author: preiniger
'''
def __validate_alliance(alliance_color, teams, official_sr):
team1sr = None
team2sr = None
team3sr = None
# TODO: there has to be a better way... but I'd rather not touch the DB
for sr i... | |
<|file_name|>VirtualFolder.ts<|end_file_name|><|fim▁begin|>import { IResource, SimpleCallback, ReturnCallback, ResourceType } from '../IResource'
import { Readable, Writable } from 'stream'
import { StandardResource } from '../std/StandardResource'
import { ResourceChildren } from '../std/ResourceChildren'
import { Vir... | callback(e);
}); |
<|file_name|>mtk-route.js<|end_file_name|><|fim▁begin|>!(function(root) {
function Grapnel(opts) {
"use strict";
var self = this; // Scope reference
this.events = {}; // Event Listeners
this.state = null; // Router state object
this.options = opts || {}; // Options
... | Grapnel.prototype.path = function(pathname) {
var self = this,
frag; |
<|file_name|>commentsClass.ts<|end_file_name|><|fim▁begin|>// @target: ES5
// @declaration: true
// @comments: true
/** This is class c2 without constuctor*/
class c2 {
}
var i2 = new c2();
var i2_c = c2;
class c3 {
/** Constructor comment*/
constructor() {
}
}
var i3 = new c3();
var i3_c = ... | constructor() { /// constructor comment2
}
}
|
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>// use msg_parse::{ParsingResult, Parsing, add_char};
// use test_diff;
// pub const MSG_TEST_WIKIPEDIA1: &'static str = "8=FIX.4.2|9=178|35=8|49=PHLX|56=PERS|52=20071123-05:\
// 30:00.000|11=ATOMNOCCC9990900|20=3|150=E|... | // panic!("ParsedErrors in icomplete message") |
<|file_name|>test_door.py<|end_file_name|><|fim▁begin|>"""
Tests for a door card.<|fim▁hole|>from onirim import card
from onirim import component
from onirim import core
from onirim import agent
class DoorActor(agent.Actor):
"""
"""
def __init__(self, do_open):
self._do_open = do_open
def ope... | """
import pytest
|
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate gcc;
// Build script which is called before every 'cargo build'
fn main() {<|fim▁hole|> println!("Compiling libmovie_hash.a!");
gcc::Config::new()
.file("c_src/movie_hash.c")
.compile("libmovie_hash.a");
}<|fim▁end|> | // Debug output only visible on panic! |
<|file_name|>ticker.ts<|end_file_name|><|fim▁begin|>import { State } from './core/enum/state'
import { ITicker } from './core/interfaces/ITicker'
/**
* Main Fatina Ticker
* Parent of all the normal tween and sequence
*
* @export
* @class Ticker
* @extends {EventList}
* @implements {ITicker}
*/
export class Tic... |
/** |
<|file_name|>vi.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
{
'# selected': '# được lựa chọn',
"'Cancel' will indicate an asset log entry did not occur": "'Hủy' sẽ chỉ dẫn một lệnh nhập không thực hiện được",
"A location that specifies the geographic area for this region. This can be a location from the... | 'Summary of Completed Assessment Forms': 'Tổng hợp biểu mẫu đánh giá đã hoàn thành',
|
<|file_name|>socket.js<|end_file_name|><|fim▁begin|>define(['socket.io'], function() {
var socket = io.connect('//' + window.document.location.host);<|fim▁hole|>})<|fim▁end|> | return socket; |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>"""
Utilities and helper functions<|fim▁hole|> try:
return model.objects.get(**kwargs)
except model.DoesNotExist:
return None<|fim▁end|> | """
def get_object_or_none(model, **kwargs): |
<|file_name|>uint_macros.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.or... | }
}
#[experimental = "might need to return Result"] |
<|file_name|>auto_channels.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package app
import (
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
)
<|fim▁hole|> Fuzzy bool
DisplayNameLen... | type AutoChannelCreator struct {
client *model.Client
team *model.Team |
<|file_name|>configuration.d.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2013 Palantir Technologies, 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:/... | |
<|file_name|>aiplatform_generated_aiplatform_v1beta1_metadata_service_query_context_lineage_subgraph_async.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lic... | # NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.
# To install the latest published package dependency, execute the following: |
<|file_name|>promlex.l.go<|end_file_name|><|fim▁begin|>// CAUTION: Generated file - DO NOT EDIT.
// Copyright 2017 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
//
... | |
<|file_name|>details.js<|end_file_name|><|fim▁begin|>import React, { Fragment } from 'react';
import { compose, graphql } from 'react-apollo';
import { set } from 'react-redux-values';
import ReduxForm from 'declarative-redux-form';
import { Row, Col } from 'joyent-react-styled-flexboxgrid';
import { Margin } from 'sty... | icon={<NameIcon />}
>
Image name and details
</Title> |
<|file_name|>theme.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { StorageService } from '../../provider/storage.service';
import { ThemeService } from '../../provider/theme.service';
import { InformService } from '... | export class ThemePage { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from . import models<|fim▁hole|><|fim▁end|> | from . import lroe |
<|file_name|>Pwm.cpp<|end_file_name|><|fim▁begin|>#include "Wire.h"
PwmRPi::PwmRPi(unsigned char channel) {
this->channel = (channel & 0x01);
}
void PwmRPi::begin() {
pwm.address = PWM_ADDRESS;
Bcm2835::mapPeripheral(&pwm);
}
void PwmRPi::stop() {
Bcm2835::unmapPeripheral(&pwm);
}<|fim▁hole|>PwmRPi P... | |
<|file_name|>ImageDataComposite.java<|end_file_name|><|fim▁begin|>package com.kartoflane.superluminal2.ui.sidebar.data;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLay... | private Label lblFollowHelp;
|
<|file_name|>deferred.js<|end_file_name|><|fim▁begin|>// Returns function that returns deferred or promise object.
//
// 1. If invoked without arguments then deferred object is returned
// Deferred object consist of promise (unresolved) function and resolve
// function through which we resolve promise
// 2. If in... | });
promise.returnsPromise = true; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.