prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>nil.hpp<|end_file_name|><|fim▁begin|>//
// MessagePack for C++ static resolution routine
//
// Copyright (C) 2008-2009 FURUHASHI Sadayuki
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
/... | } // MSGPACK_API_VERSION_NAMESPACE(v1)
/// @endcond
|
<|file_name|>ValueSymbolTable.py<|end_file_name|><|fim▁begin|>from binding import *
from .Value import ValueSymbolTable, Value
from .ADT.StringRef import StringRef
@ValueSymbolTable
class ValueSymbolTable:
if LLVM_VERSION >= (3, 3):
_include_ = 'llvm/IR/ValueSymbolTable.h'
else:<|fim▁hole|> new = Co... | _include_ = 'llvm/ValueSymbolTable.h' |
<|file_name|>FavoriteImpl.ts<|end_file_name|><|fim▁begin|>/**
* Swaggy Jenkins
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-gener... | */
import * as models from './models';
|
<|file_name|>display_list_builder.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/. */
//! Builds display lists from flows and fragment... | let container_size = Size2D::zero();
let metrics = &text_fragment.run.font_metrics; |
<|file_name|>account.py<|end_file_name|><|fim▁begin|># Copyright 2018 Silvio Gregorini (silviogregorini@openforce.it)
# Copyright (c) 2018 Openforce Srls Unipersonale (www.openforce.it)<|fim▁hole|># License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import models
class AccountMoveLine(models.Mo... | # Copyright (c) 2019 Matteo Bilotta |
<|file_name|>mesh.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------... | varying vec4 v_ambientk;
varying vec4 v_light_color; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright © 2018 Cormac O'Brien
//
// 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... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[doc = r" Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::F5R2 {
#[doc = r" Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&sel... | #[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
const MASK: bool = true;
const OFFSET: u8 = 3; |
<|file_name|>use_sax.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from xml.parsers.expat import ParserCreate
class DefaultSaxHandler(object):
def start_element(self, name, attrs):
print('sax:start_element: %s, attrs: %s' % (name, str(attrs)))
def end_element(self, n... | parser.EndElementHandler = handler.end_element
parser.CharacterDataHandler = handler.char_data |
<|file_name|>application_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 Rohith 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/LICENS... | assert.False(t, app.AllTaskRunning())
|
<|file_name|>partners_plugin.py<|end_file_name|><|fim▁begin|>from cms.models.pluginmodel import CMSPlugin
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from django.utils.translation import gettext_lazy as _
from django.utils.translation import get_language
from partners.models impor... |
class PartnersPlugin(CMSPluginBase): |
<|file_name|>SerializeWriter.js<|end_file_name|><|fim▁begin|>/*
* (c) Copyright Ascensio System SIA 2010-2014
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foun... | return;
}
oThis.WriteUChar(g_nodeAttributeStart);
oThis._WriteLimit2(0, ln.algn); |
<|file_name|>PetrifyDamageSource.java<|end_file_name|><|fim▁begin|>package telinc.telicraft.util;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.StatCollector;
public class PetrifyDamageSource extends Telicraf... | |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict';
const express = require('express');
const path = require('path');
const logger = require('morgan');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const cons = require('consolidate');
const session = require('expr... |
app.use('/', index); |
<|file_name|>asset_service.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/cloud/asset/v1beta1/asset_service.proto
package asset
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
context "golang... | func (m *BatchGetAssetsHistoryRequest) GetAssetNames() []string {
if m != nil {
return m.AssetNames |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless ... |
// validate options
if errs := completedOptions.Validate(); len(errs) != 0 {
return utilerrors.NewAggregate(errs) |
<|file_name|>module.js<|end_file_name|><|fim▁begin|><|fim▁hole|>(function () {
'use strict';
var module = angular.module('memosWebApp', []);
}());<|fim▁end|> | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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/license... | GetPatchDeploymentRequest,
ListPatchDeploymentsRequest,
ListPatchDeploymentsResponse,
MonthlySchedule, |
<|file_name|>ignore.js<|end_file_name|><|fim▁begin|>import path from 'node:path';
import test from 'ava';
import slash from 'slash';
import {
isIgnoredByIgnoreFiles,
isIgnoredByIgnoreFilesSync,
isGitIgnored,
isGitIgnoredSync,
} from '../ignore.js';
import {
PROJECT_ROOT,
getPathValues,
} from './utilities.js';
c... |
test('multiple negation', async t => { |
<|file_name|>flagSource.go<|end_file_name|><|fim▁begin|>package flag
import (
"flag"
"github.com/mono83/cfg"
"github.com/mono83/cfg/reflect"
"os"
"sync"
)
type flagSource struct {
set *flag.FlagSet
args []string
m sync.Mutex
values map[string]interface{}
}
// NewFlagSource creates new configuration sou... | |
<|file_name|>markdown.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
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | out.push_str(load_or_return!(name.as_slice(), None, None));
out.push_char('\n');
} |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>#![allow(unused_variables)]
// extern crate bindgen;
extern crate make_cmd;
use make_cmd::make;
use std::env;
use std::path::Path;
use std::process::Command;
const LIBSIXEL_DIR: &str = "libsixel";
fn main() {
let testing_build = false;
let out_dir = en... | println!("cargo:rustc-link-search=native={}", out_dir.join("lib").display());
|
<|file_name|>NewsListModel.java<|end_file_name|><|fim▁begin|>package me.knox.zmz.mvp.model;
import io.reactivex.Flowable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import java.util.List;
import javax.inject.Inject;
import me.knox.zmz.App;
import me.knox.zmz.entity.News;
import me.knox.zmz.mvp.contract.... | * Created by KNOX.
*/
public class NewsListModel implements NewsListContract.Model { |
<|file_name|>validate_urls.py<|end_file_name|><|fim▁begin|>import logging
from django.core.management.base import BaseCommand
from citation.ping_urls import verify_url_status
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = '''Method that check if the code archived urls are active and wo... | logger.debug("Validation completed") |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate cgmath;
#[macro_use]
extern crate puck_core;
extern crate alto;
extern crate lewton;
extern crate time;
extern crate notify;
extern crate rand;
extern crate image;
#[macro_use]
extern crate gfx;
extern crate gfx_device_gl;
extern crate gfx_window_glutin;
ex... | pub use resources::*;
use std::io;
use std::path::PathBuf; |
<|file_name|>kv.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2019 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package lru
import (
"container/list"
"sync"
)
// kv represents a key-value pair.
type kv struct {
key interface{}
value... | |
<|file_name|>custom.js<|end_file_name|><|fim▁begin|>/**
* Template Name: Daily Shop
* Version: 1.1
* Template Scripts
* Author: MarkUps
* Author URI: http://www.markups.io/
Custom JS
1. CARTBOX
2. TOOLTIP
3. PRODUCT VIEW SLIDER
4. POPULAR PRODUCT SLIDER (SLICK SLIDER)
5. FEATURED PRODUCT... | }
}
// You can unslick at a given breakpoint now by adding: |
<|file_name|>clients.rs<|end_file_name|><|fim▁begin|>#![feature(proc_macro, plugin, custom_attribute, custom_derive, plugin)]
#![plugin(serde_derive)]
extern crate tin_can_telephone as tct;
use std::net::{TcpStream as StdTcpStream, SocketAddr};
use std::io::{
//Read,
Write};
#[test]
fn login() {<|fim▁hole|>... | let addr = "127.0.0.1:3000".to_string().parse::<SocketAddr>().unwrap();
let mut tcp_a = match StdTcpStream::connect(&addr) {
Ok(stream) => stream, |
<|file_name|>findBreaksVCF.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
import sys
import os
import getopt
import vcf
def main():
params = parseArgs()
vfh = vcf.Reader(open(params.vcf, 'r'))
#grab contig sizes
contigs = dict()
for c,s in vfh.contigs.items():
contigs[s.id] = s.length
regions ... | -f,--force : Number of PIS to force a break
-h,--help : Displays help menu |
<|file_name|>myparser.py<|end_file_name|><|fim▁begin|>import sys, argparse
class MyParser(argparse.ArgumentParser):
def error(self, message):<|fim▁hole|> sys.exit(2)<|fim▁end|> | '''Wraps error and prints in a shorter way'''
sys.stderr.write('error: %s\n' % message)
#self.print_help() |
<|file_name|>chrome_url_request_user_data.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/renderer_host/chrome_url_request_user_data.h"
name... | return user_data; |
<|file_name|>App.js<|end_file_name|><|fim▁begin|>import React from 'react';
import PropTypes from 'prop-types';
import Header from './Header';
// This is a class-based component because the current
// version of hot reloading won't hot reload a stateless<|fim▁hole|> render() {
return (
<div className="conta... | // component at the top-level.
class App extends React.Component { |
<|file_name|>writehtml.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from troubleshooting.framework.modules.manager import ManagerFactory
from troubleshooting.framework.variable.variable import *
from troubleshooting.framework.libraries.baseList import list2stringAndFormat
from troubleshooting.framework.libra... | |
<|file_name|>irc-colors.ts<|end_file_name|><|fim▁begin|>declare module 'irc-colors' {
function stripColorsAndStyle(data: string): string;<|fim▁hole|><|fim▁end|> | } |
<|file_name|>listpages.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
r"""
Print a list of pages, as defined by page generator parameters.
Optionally, it also prints page content to STDOUT or save it to a file
in the current directory.
These parameters are supported to specify which pages t... | encoding = config.textfile_encoding
page_target = None |
<|file_name|>callee.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
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses... | |
<|file_name|>test_avatar.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 i... | b'def654fccc4a4d8?d=retro&s=32'))
|
<|file_name|>board.rs<|end_file_name|><|fim▁begin|>extern crate image;
use std::fs::File;
use std::path::Path;
pub struct Board {
pub width: usize,
pub height: usize,
pub data: Vec<String>
}
impl Board {<|fim▁hole|> pub fn new(x: usize, y: usize) -> Board {
Board {
width: x,
height:... | |
<|file_name|>WSO2EventAdapter.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2005 - 2014, WSO2 Inc. (http://www.wso2.org) 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 ... | |
<|file_name|>containermgmt.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 Crunchy Data Solutions, 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/LIC... | logit.Error.Println(err.Error()) |
<|file_name|>definition_structure.hpp<|end_file_name|><|fim▁begin|>/*!
* \file definition_structure.hpp
* \brief Headers of the main subroutines used by SU2_EDU.
* The subroutines and functions are in the <i>definition_structure.cpp</i> file.
* \author Aerospace Design Laboratory (Stanford University).
* \v... | */
#pragma once |
<|file_name|>solution.cpp<|end_file_name|><|fim▁begin|>class Solution {
public:
vector<int> ori, cur;
random_device rd;
mt19937 g;
Solution(vector<int> nums) : ori(nums), cur(nums), g(rd()) {
}
/** Resets the array to its original configuration and return it. */
vector<int> res... | |
<|file_name|>xquad_test.py<|end_file_name|><|fim▁begin|># coding=utf-8<|fim▁hole|>#
# 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
#
# Unless... | # Copyright 2022 The TensorFlow Datasets Authors. |
<|file_name|>PdxType.cpp<|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 Ap... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# hrCMS documentation build configuration file, created by
# sphinx-quickstart on Sat Mar 28 20:11:13 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values... | # You can specify multiple suffix as a list of string: |
<|file_name|>move_base_force_cancel.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import rospy
import actionlib
from move_base_msgs.msg import MoveBaseActionGoal
from actionlib_msgs.msg import GoalID
class ForceCancel(object):
def __init__(self, nodename="force_cancel", is_newnode=True, repetition=10):
... | self.id = msg.goal_id.id
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_name = "rusthello_lib"]
#![crate_type = "lib"]<|fim▁hole|>
// External crates
extern crate rand;
extern crate rayon;
extern crate reversi;
extern crate termion;
// Modules
pub mod interface;
pub mod human_player;
pub mod ai_player;
use reversi::{ReversiError};... | |
<|file_name|>convertTreeToEvt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>import os
import sys
import math
import pyRootPwa
import pyRootPwa.core
def writeParticleToFile (outFile, particleName, particleMomentum):
if pyRootPwa.core.particleDataTable.isInTable(particleName):
partProperties = pyR... |
import argparse |
<|file_name|>mailbase.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: utf-8
import email.utils
import logging
import os
import smtplib
import threading
from email.mime.text import MIMEText
from email.MIMEMultipart import MIMEMultipart
logger = logging.getLogger("maillog")
class MailBase(threading.Th... | try:
server.sendmail(self.BASICS["USERNAME"], to, msg.as_string())
finally: |
<|file_name|>alpha_beta.rs<|end_file_name|><|fim▁begin|>use ::NodeCount;
use uci;
use std::fmt;
use std::cmp;
use std::cmp::PartialOrd;
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::hash::Hash;
use std::cmp::Ordering;
use std::f32;
use std::ops;
use board_game_traits::board::GameResul... | use uci::ChessVariant;
use uci::UciInfo;
use std::io; |
<|file_name|>js.py<|end_file_name|><|fim▁begin|>import logging
import hashlib
from pylons import request, response, session, tmpl_context as c
from pylons.controllers.util import abort, redirect_to, etag_cache
from pylons.decorators import jsonify
from pylons.i18n.translation import _
from wurdig.lib.base import BaseC... | 'been disapproved.'),
'Your+request+has+been+completed+successfully': _('Your+request+has+been+' |
<|file_name|>bar.rs<|end_file_name|><|fim▁begin|>#![crate_type = "lib"]<|fim▁hole|><|fim▁end|> |
extern crate baz; |
<|file_name|>maps_http_geocode_place_id.py<|end_file_name|><|fim▁begin|># [START maps_http_geocode_place_id]
import requests
url = "https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJd8BlQ2BZwokRAFUEcm_qrcA&key=YOUR_API_KEY"
payload={}<|fim▁hole|>print(response.text)
# [END maps_http_geocode_place_id]<|f... | headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
|
<|file_name|>create_user.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
#-*- coding:utf-8 -*
import csv
from werkzeug import generate_password_hash<|fim▁hole|>from bootstrap import db
def create_user(email, name, password):
user = User(email=email,
name=name,
pwdhash=generate_p... |
from web.models import User |
<|file_name|>worker_parallel_scheduling_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# htt... | |
<|file_name|>consoleInput.py<|end_file_name|><|fim▁begin|>#from: http://stackoverflow.com/questions/10361820/simple-twisted-echo-client
#and
#from: http://stackoverflow.com/questions/510357/python-read-a-single-character-from-the-user
from twisted.internet.threads import deferToThread as _deferToThread
from twisted.int... | """
Gets a single character from standard input. Does not echo to the screen.
"""
def __init__(self): |
<|file_name|>token.js<|end_file_name|><|fim▁begin|>'use strict';
const path = require('path');
const jwt = require('jsonwebtoken');
const AuthConfig = require(path.resolve('./config')).Auth;
const jwtSecret = AuthConfig.jwt.secret;
const tokenExpirePeriod = AuthConfig.jwt.tokenExpirePeriod;
function generateToken(p... | }
} |
<|file_name|>csi_block_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | defer os.RemoveAll(tmpDir)
fakeClient := fakeclient.NewSimpleClientset() |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>import datetime
from mock import patch
from pretend import stub
from gurtel import session
def test_annotates_request():
"""Annotates request with ``session`` property."""
request = stub(
cookies={},
app=stub(secret_key='secret', is_s... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub mod cif_parser;
use cif_parser::EdgeSign;
pub mod profile_parser;
use clingo::{
ast::Location, defaults::Non, AllModels, ClingoError, Control, ExternalError, FactBase,
FunctionHandler, GenericControl, GenericSolveHandle, OptimalModels, Part, ShowType, SolveMo... | let behavior = into_behavior(symbol.arguments()?[2])?;
vlabels.push(Prediction {
node: id.arguments()?[0].string()?.to_string(), |
<|file_name|>event-handler.js<|end_file_name|><|fim▁begin|>/**
* socket.io application object & request wrapper
*
* The first few requests when hitting the site will be pre-cached, as the socket won't
* have had time to connect yet. Socket.io already does this, but we want to fallback to
* AJAX instead of waiting ... |
//---------------------------------------------------------------------------- |
<|file_name|>ble-uart.js<|end_file_name|><|fim▁begin|>/*
Noble cread UART service example
This example uses Sandeep Mistry's noble library for node.js to
read and write from Bluetooth LE characteristics. It looks for a UART
characteristic based on a proprietary UART service by Nordic Semiconductor.
You can see this s... | var service = '6e400001b5a3f393e0a9e50e24dcca9e'; // the service you want
var receive, transmit; // transmit and receive BLE characteristics
var self = this; // reference to the instance of BleUart |
<|file_name|>local_data_priv.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org... |
pub unsafe fn local_get<T: 'static>(
handle: Handle,
key: LocalDataKey<T>) -> Option<@T> { |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * Copyright (c) 2020 Choko (choko@curioswitch.org)
*
* 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,... | * MIT License
* |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# girc documentation build configuration file, created by
# sphinx-quickstart on Fri Jul 10 20:20:32 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possibl... | #html_domain_indices = True
# If false, no index is generated.
#html_use_index = True |
<|file_name|>use_undefined_result.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
peg::parser!(grammar foo() for str {
rule foo() = "asdf"
rule bar() -> u32 = x:foo() { 0 } //~ ERROR using result of rule `foo`, which does not return a value
});
fn main() {}<|fim▁end|> | extern crate peg; |
<|file_name|>schema.py<|end_file_name|><|fim▁begin|>import inspect
import logging
import threading
from django.apps import apps
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured
from django.db import connection
from django.db.migrations.operati... | try:
return apps.get_model(settings.BOARDINGHOUSE_SCHEMA_MODEL) |
<|file_name|>set-bit.test.ts<|end_file_name|><|fim▁begin|>import setBit from './set-bit'
test('sets bits', () => {
expect(setBit(0b0, 7, 1)).toEqual(128)
expect(setBit(0b11111111, 8, 1)).toEqual(511)
expect(setBit(0b1000000000, 9, 0)).toEqual(0)<|fim▁hole|><|fim▁end|> | expect(setBit(0, 31, 1)).toEqual(1 << 31)
}) |
<|file_name|>car.helper.js<|end_file_name|><|fim▁begin|>function CarHelper(car) {
if (!(this instanceof arguments.callee)) {
return new CarHelper(car);
}
var backtrack = [];
car.helper = {
getElement: function (x, y) {
return car.table.children[y].children[x];
},
... | |
<|file_name|>unused-struct-variant.rs<|end_file_name|><|fim▁begin|>#![deny(unused)]<|fim▁hole|>struct F;
struct B;
enum E {
Foo(F),
Bar(B), //~ ERROR variant is never constructed
}
fn main() {
let _ = E::Foo(F);
}<|fim▁end|> | |
<|file_name|>should-update-task.js<|end_file_name|><|fim▁begin|>import chai, { expect } from 'chai'
import chaiHttp from 'chai-http'
import server from '../src/index'
import Query from '../src/query'
import { url } from '../src/resources'
chai.use(chaiHttp)
export default (done) =>
{
Query.create({title: 'Task', co... | expect(res.body).to.have.property('title')
expect(res.body.title).to.equal('Tarefa Alterada') |
<|file_name|>test_eve.py<|end_file_name|><|fim▁begin|>import mock
from tests.compat import unittest
from tests.utils import APITestCase
import evelink.eve as evelink_eve
class EVETestCase(APITestCase):
def setUp(self):
super(EVETestCase, self).setUp()
self.eve = evelink_eve.EVE(api=self.api)
... | },
'points': {
'total': [{'id': 395923478, 'name': 'sasawong', 'points': 197046}], |
<|file_name|>Action.py<|end_file_name|><|fim▁begin|>class Action:
label = ""
selectable = 0
def __init__ (self,label="",s=0):
self.label = label
self.selectable = s
def getLabel (self):
return self.label
def do (self):<|fim▁hole|> def canSelect (self):
return s... | tmp = 1
|
<|file_name|>Reference.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package com.piron1991.builder_tools.reference;
public class Reference {
public static final String MOD_ID = "builder_tools";
public static final String VERSION = "0.1";
public static final String MOD_NAME = "Builder tools";
public st... | |
<|file_name|>run_julia.py<|end_file_name|><|fim▁begin|>import sys
import time
from mpi4py.futures import MPICommExecutor
x0 = -2.0
x1 = +2.0
y0 = -1.5
y1 = +1.5
w = 1600
h = 1200
dx = (x1 - x0) / w
dy = (y1 - y0) / h
def julia(x, y):
c = complex(0, 0.65)
z = complex(x, y)
n = 255
while abs(z) < 3 a... | warnings.simplefilter('ignore', UserWarning) |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/*jslint browser: true */
/*global require, app: true, $, Backbone, window, document */
require([
'router'
], function () {
<|fim▁hole|><|fim▁end|> | 'use strict';
}); |
<|file_name|>OrthomclToolbox.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2012 Unknown <diogo@arch>
#
# 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 Foun... | self.max_extra_copy = 0
for cl in self.groups:
cl.remove_taxa(taxa_list) |
<|file_name|>forwarder.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0212
import fcntl
import inspect
import logging
import os
import psutil
import... | |
<|file_name|>registry.go<|end_file_name|><|fim▁begin|>// Package registry is an interface for service discovery
package registry
import (
"errors"
)
// The registry provides an interface for service discovery
// and an abstraction over varying implementations
// {consul, etcd, zookeeper, ...}
type Registry interface... | func Deregister(s *Service) error {
return DefaultRegistry.Deregister(s) |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
... | require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'), |
<|file_name|>ViewTech.java<|end_file_name|><|fim▁begin|>package com.ciandt.techgallery.servlets;
import java.io.IOException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
<|fim▁hole|> public void doGet(HttpServletRequest req, HttpS... | @SuppressWarnings("serial")
public class ViewTech extends HttpServlet {
@Override |
<|file_name|>BearTestHelper.py<|end_file_name|><|fim▁begin|>import logging
logging.warning('This module is deprecated. Use '
'`coalib.testing.BearTestHelper` instead.')
<|fim▁hole|><|fim▁end|> | from coalib.testing.BearTestHelper import * |
<|file_name|>typeobject.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Daniel Grunwald
//
// 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 limi... | use conversion::ToPyObject;
use objects::{PyObject, PyTuple, PyDict}; |
<|file_name|>paramSplitFieldBoth.py<|end_file_name|><|fim▁begin|>'''
Created on Oct 3, 2012
Copyright © 2013
The Board of Trustees of The Leland Stanford Junior University.
All Rights Reserved
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Licen... | '''
import numpy as np |
<|file_name|>ESStoreTest.java<|end_file_name|><|fim▁begin|>package com.winterwell.depot;
import java.util.Map;
import org.junit.Test;
import com.winterwell.depot.merge.Merger;
import com.winterwell.es.client.ESConfig;
import com.winterwell.es.client.ESHttpClient;
import com.winterwell.gson.FlexiGson;
import com.wint... | import com.winterwell.utils.Utils;
import com.winterwell.utils.containers.ArrayMap;
|
<|file_name|>Decade.js<|end_file_name|><|fim▁begin|>'use strict';
var babelHelpers = require('./util/babelHelpers.js');
var React = require('react'),
_ = require('./util/_'),
cx = require('classnames'),
dates = require('./util/dates'),
localizers = require('./util/configuration').locale,
CustomPro... | babelHelpers._extends({}, props, {
role: 'grid', |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>"""Tests if it "compiles" (except that it doesn't).
Also: trivial usage example.
"""
from da import Node, Network
import topo
class MyNode(Node):
def run(self):
self.send(0, self.ID)
self.send(1, self.ID)
p, m = self.recv()
p, m = ... | def run(n):
net = Network(MyNode, topo.C(n))
net.run() |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from .models import User
from application.models import (Contact, Personal, Wife, Occupation, Children,
Hod, Committee, UserCommittee, Legal)
# Register your models here.
class ContactInline(admin.Stack... | model = Hod
|
<|file_name|>add_to_a_path.py<|end_file_name|><|fim▁begin|>"""Script to display a collection of paths after inserting one new path
Usage:
add_to_a_path.py [-U] PATHS PATH
add_to_a_path.py [-U] (-s | -i INDEX ) PATHS PATH
Options:
-h, --help Show this help and exit
-v, --version ... | import os |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | /// }
/// # Ok(()) |
<|file_name|>resource.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# 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 ... | self.assertEquals("TestPage",
resource.get_resource_description(self.env, target))
self.assertEquals("TestPage", |
<|file_name|>ViewDelegatesFactory.cpp<|end_file_name|><|fim▁begin|>#include "ViewDelegatesFactory.h"
#include "CategoryViewDelegate.h"
#include "ClientViewDelegate.h"
ViewDelegatesFactory* ViewDelegatesFactory:: ViewDelegatesFactory_ = nullptr;
ViewDelegatesFactory::ViewDelegatesFactory( QObject * parent)
{
oAvai... | } |
<|file_name|>theme.rs<|end_file_name|><|fim▁begin|>extern crate nanovg;<|fim▁hole|>
pub struct Theme {
font_normal: Option<nanovg::Font>,
font_bold: Option<nanovg::Font>,
font_icons: Option<nanovg::Font>,
standard_font_size: u32,
button_font_size: u32,
textbox_font_size: u32,
window_corner_... |
use common::{Color};
use resources; |
<|file_name|>scrollable.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk.
//
// rgtk is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option)... | policy)
}
}
|
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import user_passes_test
from django.contrib.auth.models import Group
def group_required(names, login_url=None):
"""
Checks if the user is a member of a particular group (or at least one
group from the list)<|fim▁hol... | """
if not hasattr(names,'__iter__'): |
<|file_name|>eps.hpp<|end_file_name|><|fim▁begin|>//==============================================================================
// Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II
// Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI
//
// Distributed under the Boos... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.test import TestCase as DjangoTestCase
from django.conf import settings
from seeder.models import *
from seeder.posters import TwitterPoster
from random import randint as random
from datetime import datetime
import time
import mox
import re
def generate_ra... | |
<|file_name|>macro_example.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate nickel;
extern crate regex;
extern crate rustc_serialize;
extern crate hyper;
use std::io::Write;
use nickel::status::StatusCode::{self, NotFound};
use nickel::{
Nickel, NickelError, Continue, Halt, Request, Response, MediaType,
... | |
<|file_name|>io.rs<|end_file_name|><|fim▁begin|>//! SOLID-specific extensions to general I/O primitives
#![deny(unsafe_op_in_unsafe_fn)]
#![unstable(feature = "solid_ext", issue = "none")]
use crate::net;
use crate::sys;
use crate::sys_common::{self, AsInner, FromInner, IntoInner};
/// Raw file descriptors.
pub type... | /// accidentally allow violating this contract which can cause memory |
<|file_name|>patricia-tree-demo.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <string>
#include <map>
#include <unistd.h>
#include <utility>
#include <sstream>
#include "./patricia-tree.hpp"
int main(void) {
std::cout << "Add new command!\n";
PatriciaTree<Node<std::string, StringKeySpec>> pt;... | } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.