prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>gcncirc.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import absolute_import
import re
from pyingest.config.utils import u2asc
from .default import DefaultParser
from .author_names import AuthorNames
from .entity_convert import EntityConverter
head_dict = {'TITLE:':... | auth_string = re.sub(r'\s?:', '', auth_string)
auth_string = re.sub(r',?\s+,', ',', auth_string)
auth_array = [s.strip() for s in auth_string.split(',')] |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for yookan_todo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get... | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'yookan_todo.settings')
application = get_wsgi_application() |
<|file_name|>genetic_engine.py<|end_file_name|><|fim▁begin|>class GeneticEngine:
genomLength = 10
generationCount = 10
individualCount = 10
selectionType = 10
crossingType = 10
useMutation = 1
mutationPercent = 50
"""constructor"""
def __init__(self, fitnessFunction):
re... | def run():
return 0
|
<|file_name|>browser_default.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from rdflib import Graph, BNode, Literal, URIRef
from rdflib.namespace import FOAF
from flask import Flask
import flask_rdf
import random
app = Flask(__name__)
# set up a custom formatter to return turtle in text/plain to browsers
cus... | return graph
|
<|file_name|>int32_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | """Test exclusion of ops which are not supported in INT32 mode by TF-TRT"""
|
<|file_name|>UI5Table.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2014 SCN SDK Community
*
* Original Source Code Location:
* https://github.com/org-scn-design-studio-community/sdkpackage/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance... |
initDesignStudio: function() {
var that = this;
|
<|file_name|>EC2Cloud.py<|end_file_name|><|fim▁begin|>#
# Copyright 2011 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... | |
<|file_name|>addressbookpage.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/bitcoin-config.h"
#... | case ReceivingTab:
// Receive filter |
<|file_name|>BoxTest.java<|end_file_name|><|fim▁begin|>/**
* BoxTest.java - test for the Box class
*
* Copyright 2011 Jeffrey Finkelstein
*
* This file is part of jeffraytracer.
*
* jeffraytracer is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as... | * Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* jeffraytracer is distributed in the hope that it will be useful, but WITHOUT |
<|file_name|>stream.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
spdypy.stream
~~~~~~~~~~~~~
Abstractions for SPDY streams.
"""
import collections
from .frame import (SYNStreamFrame, SYNReplyFrame, RSTStreamFrame,
DataFrame, HeadersFrame, WindowUpdateFrame, FLAG_FIN)
class Stream(o... | self._queued_frames = collections.deque()
self._compressor = compressor
self._decompressor = decompressor
|
<|file_name|>regions-ret.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/lic... | } |
<|file_name|>sdb_dump_patch.py<|end_file_name|><|fim▁begin|>import sys
import logging
import hexdump
import vstruct
import vivisect
import envi
import envi.archs.i386 as x86
import envi.archs.amd64 as x64
import sdb
from sdb import SDB_TAGS
from sdb_dump_common import SdbIndex
from sdb_dump_common import item_get_chi... | g_logger.debug("done loading database")
|
<|file_name|>plot-roh.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import glob, gzip, csv, sys, os, copy, re
csv.register_dialect('tab', delimiter='\t', quoting=csv.QUOTE_NONE)
def usage(msg=None):
if msg==None:
print 'Usage: plot.py [OPTIONS] <dir>'
print 'Options:'
print ' -H, --h... | for smpl in dat_gt[chr]:
ytick_lbl.append(samples[smpl]) |
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import pytest
import allure_commons
from allure_pytest.utils import ALLURE_LABEL_PREFIX, ALLURE_LINK_PREFIX
class AllureTestHelper(object):
<|fim▁hole|> def decorate_as_label(self, label_type, label... | def __init__(self, config):
self.config = config
@allure_commons.hookimpl |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from django.utils.translation import gettext_lazy as _
from rest_framework import serializers
from ..models import MyUser, Profile
from ..utils import perform_reputation_check
class CreateUserSerializer(serializers.ModelSerializer):
password = serializers... |
class ProfileSerializer(serializers.ModelSerializer):
|
<|file_name|>visual.py<|end_file_name|><|fim▁begin|>import pdb
#!python
# -*- coding: utf-8 -*-
"""File: visual.py
Description:
This module contains visualizing method for geo data
History:
0.1.0 The first version.
"""
__version__ = '0.1.0'
__author__ = 'SpaceLis'
import dataset
from anatool.dm.db... | |
<|file_name|>TiledBackingStore.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2010-2012 Nokia Corporation and/or its subsidiary(-ies)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; e... | This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
<|file_name|>Generic.java<|end_file_name|><|fim▁begin|>public class Generic{
public static void main(String[] args){
Car <String> car1 = new Car <String> ();
car1.setName("Buick");
car1.setPrice("100");
System.out.printf("name=%s,price=%s\n",car1.getName(),car1.getPrice());
Car <Integer> car2 = new Car <In... | public Car(T name,T price){
this.name = name; |
<|file_name|>cf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
import sqlite3
import sys
from collections import OrderedDict, defaultdict
from functools import wraps
from warnings import warn
import numpy as np
import pyproj
import regex
from cf_units import Un... | )
else:
for grid_var_name in grid_mapping.split(): |
<|file_name|>key.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Author: Scott Reynolds <scott@scottreynolds.us>
#
"""Redboy: Key representation"""
# @TODO: Really this class is silly. Its really just an __init__ and a
# str(). Seems obtuse and useless.
import uuid
class Key(object):
"""
A key determines how to... | # -*- coding: utf-8 -*-
#
# © 2012 Scott Reynolds |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>"""
Copyright 2014 Jason Heeris, jason.heeris@gmail.com
This file is part of the dungeon excavator web interface ("webcavate").
Webcavate is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Fr... | version.
Webcavate is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
<|file_name|>DimensionsListController.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015-2016, Mostafa Ali (engabdomostafa@gmail.com)
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met: Re... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>;(function() {
'use strict';
var listOfProgrammingLanguages = {
restrict: 'E',
templateUrl: '/directives/tpl/cd-programming-languages-list',
bindings: {<|fim▁hole|> controller: ['cdProgrammingLanguagesService', function (cdProgrammingLanguagesServic... | programmingLanguages: '<'
}, |
<|file_name|>twist.py<|end_file_name|><|fim▁begin|>__author__ = "Harish Narayanan"
__copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__
__license__ = "GNU GPL Version 3 or any later version"
from cbc.twist import *
from sys import argv
""" DEMO - Twisting of a hyperelastic cube """
cla... | twist.solve() |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from collections import Sized, OrderedDict
import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np
import ipywidgets
import IPython.display as ipydisplay
from menpo.image import MaskedImage, Image
from menpo.image.base import _conve... | options_box = ipywidgets.Tab(children=[tmp_wid, patch_options_wid,
channel_options_wid, |
<|file_name|>bitmasks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""pypozyx.definitions.bitmasks - contains all bitmasks used in Pozyx functionality, such as interrupt flags."""
# Bit mask for POZYX_ST_RESULT
POZYX_ST_RESULT_ACC = 0x01
POZYX_ST_RESULT_MAGN = 0x02
POZYX_ST_RESULT_GYR = 0x04
POZYX_ST_RESULT_M... | # Bit mask for POZYX_LED_CTRL
POZYX_LED_CTRL_LED1 = 0x01
POZYX_LED_CTRL_LED2 = 0x02
POZYX_LED_CTRL_LED3 = 0x04 |
<|file_name|>ru.js<|end_file_name|><|fim▁begin|>tinyMCE.addI18n("ru.len-slider",{
title : "Шорткод для вставки LenSlider"<|fim▁hole|><|fim▁end|> | }); |
<|file_name|>borrowed-enum.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/l... | |
<|file_name|>0022_anexoexpediente.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-14 17:41
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import posgradmin.models
class... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use snafu::{ResultExt, Snafu};
use std::fs::File;
use std::io::BufReader;
use std::path::Path;
pub mod admin;
pub mod osm_store;
pub mod osm_utils;
pub mod poi;
pub mod street;
pub type OsmPbfReader = osmpbfreader::OsmPbfReader<BufReader<File>>;
/// Size of the IO buf... |
Ok(osmpbfreader::OsmPbfReader::new(BufReader::with_capacity(
PBF_BUFFER_SIZE, |
<|file_name|>functions_1.js<|end_file_name|><|fim▁begin|>var searchData=
[<|fim▁hole|>];<|fim▁end|> | ['clear',['clear',['../d8/d84/a00001.html#a11dc3b617f2fedbb3b499971493b9c4f',1,'ArrayBase']]] |
<|file_name|>gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function (grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
// grunt-contrib-clean
clean: {
instrument: "<%= instrument.options.basePath %>"
},
// grun... | }, |
<|file_name|>exp_react.js<|end_file_name|><|fim▁begin|>(function outer(modules, cache, entries){
/**
* Global
*/
var global = (function(){ return this; })();
/**
* Require `name`.
*
* @param {String} name
* @param {Boolean} jumped
* @api public
*/
function require(name, jumped){
... | /** |
<|file_name|>deepnet.py<|end_file_name|><|fim▁begin|>"""
Kaggle上的Quora question pairs比赛,按照Abhishek Thakur的思路,把整个流程跑通了
讲解的文章https://www.linkedin.com/pulse/duplicate-quora-question-abhishek-thakur。
里面有两个实现,基于传统机器学习模型的实现和基于深度学习的实现,这段脚本是后者。
基本的思路比较简单,不清楚的地方也添加了注释。使用GloVe的词向量库,把每个句子转换成词向量
拼接起来的矩阵,之后就可以搭建神经网络了。自己在Convoluti... | |
<|file_name|>cluster_test.go<|end_file_name|><|fim▁begin|>package cluster
import (
"strings"
. "testing"
"github.com/stretchr/testify/assert"
"github.com/ctrlaltdel121/radix/extra/pool"
"github.com/ctrlaltdel121/radix/redis"
)
// These tests assume there is a cluster running on ports 7000 and 7001, with
// the... | |
<|file_name|>update-dbus-docs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
import argparse
import collections
import sys
import os
import subprocess
import io
try:
from lxml import etree
except ModuleNotFoundError as e:
etree = e
try:
from shlex impo... | if opts.print_errors: |
<|file_name|>assimilator.go<|end_file_name|><|fim▁begin|>package db
import (
"github.com/couchbase/go-couchbase"
"github.com/couchbase/sync_gateway/base"
)
// A goroutine that watches the tapListener for documents that don't have
// sync metadata, and calls assimilate() on them.
func (c *DatabaseContext) watchDocC... | |
<|file_name|>timeoutWith.ts<|end_file_name|><|fim▁begin|>import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { async } from '../scheduler/async';
import { Observable } from '../Observable';
import { isDate } from '../util/isDate';
import { OuterSubscriber } from '../OuterSubscribe... | * @return {Observable<T>} Observable that mirrors behaviour of source or, when timeout check fails, of an Observable
* passed as a second parameter.
* @method timeoutWith |
<|file_name|>policy.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""<|fim▁hole|>Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""<|fim▁end|> | Copyright (C) 2016, Zato Source s.r.o. https://zato.io
|
<|file_name|>fc8_helpers.js<|end_file_name|><|fim▁begin|>import robot from 'robotjs'
import sleep from 'sleep'
import orifice from './fc8_orifice_map.json'
var fs = require('fs')
/*//set speed
robot.setKeyboardDelay(150)
robot.setMouseDelay(100)*/
let type = [
"Orifice",
"Venturi",
"Nozzle",
"Fixed Ge... | sleep.msleep(500)
robot.typeString(fileName)
robot.keyTap('enter')
sleep.msleep(500) |
<|file_name|>proto.js<|end_file_name|><|fim▁begin|>const protobuf = require('protobufjs')
const path = require('path')
protobuf.load(path.resolve('../protobuf/meetings.proto'))
.then(start)
.catch(console.error)
function start (root) {
const User = root.lookupType('meetings.User')
const payload = {
firstN... | |
<|file_name|>CheckedMenuItem.js.uncompressed.js<|end_file_name|><|fim▁begin|>require({cache:{
'url:dijit/templates/CheckedMenuItem.html':"<tr class=\"dijitReset dijitMenuItem\" data-dojo-attach-point=\"focusNode\" role=\"menuitemcheckbox\" tabIndex=\"-1\">\n\t<td class=\"dijitReset dijitMenuItemIconCell\" role=\"prese... | // A checkbox-like menu item for toggling on and off
|
<|file_name|>config.py<|end_file_name|><|fim▁begin|># The default ``config.py``
# flake8: noqa
def set_prefs(prefs):
"""This function is called before opening the project"""
# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# V... |
# How many undos to hold?
prefs['max_history_items'] = 32 |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import division
# -*- coding: utf-8 -*-
#
# Sphinx documentation build configuration file, created by
# sphinx-quickstart.py on Sat Mar 8 21:47:50 2008.
#
# This file is execfile()d with the current directory set to its containin... |
# Content template for the index page.
html_index = 'index.html'
|
<|file_name|>counterIncrement.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = {
set: function (v) {
this.setProperty('counter-increment', v);
},
get: function () {
return this.getPropertyValue('counter-increment');<|fim▁hole|> },
enumerable: true
};<|fim▁end|> | |
<|file_name|>transmute_ref_to_ref.rs<|end_file_name|><|fim▁begin|>use super::{TRANSMUTE_BYTES_TO_STR, TRANSMUTE_PTR_TO_PTR};
use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then};
use clippy_utils::source::snippet;
use clippy_utils::sugg;
use if_chain::if_chain;
use rustc_errors::Applicability;
use ru... | "_mut"
} else { |
<|file_name|>colorshowlabel.cpp<|end_file_name|><|fim▁begin|>/**
*×÷Õß:Âé²Ë
*ÈÕÆÚ:2013Äê6ÔÂ20ÈÕ
*¹¦ÄÜ:×Ô¶¨ÒåÑÕɫѡÔñ¶ÔÏó,´ÓQColorDialogÀàÖÐÌáÈ¡ÖØÐ·â×°.½ö±£Áôͨ¹ýÊó±êpickÌáÈ¡ÑÕÉ«µÄ¿Ø¼þ
*˵Ã÷:¿ªÔ´,Ãâ·Ñ,ʹÓÃʱÇë±£³Ö¿ªÔ´¾«Éñ.
*ÁªÏµ:12319597@qq.com
*²©¿Í:www.newdebug.com
**/
#include "colorshowlabel.h"
#include... | p.fillRect(contentsRect()&e->rect(), m_color);
}
void YviColorShowLabel::mousePressEvent(QMouseEvent *e) |
<|file_name|>EOSProjectData.cpp<|end_file_name|><|fim▁begin|>#include "EOSProjectData.h"
EOSProjectData::EOSProjectData()<|fim▁hole|>
EOSProjectData::~EOSProjectData()
{
}<|fim▁end|> | {
} |
<|file_name|>test_native.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/lic... | |
<|file_name|>test_postgres_to_s3_transfer.py<|end_file_name|><|fim▁begin|>try:
import unittest.mock as mock
except ImportError:
import mock
import subprocess
import dags.utils.helpers as helpers
from dags.operators.postgres_to_s3_transfer import PostgresToS3Transfer
class TestPostgresToS3Transfer(object):
... | |
<|file_name|>router.rs<|end_file_name|><|fim▁begin|>use middleware::{Middleware, Continue, MiddlewareResult};
use request::Request;
use response::Response;
use router::HttpRouter;
use hyper::method::Method;
use hyper::status::StatusCode;
use router::{Matcher, FORMAT_PARAM};
/// A Route is the basic data structure tha... | |
<|file_name|>CheckBoxPanel.java<|end_file_name|><|fim▁begin|>package autotest.afe;
import java.util.ArrayList;
import java.util.List;
public class CheckBoxPanel {
public static interface Display {
public ICheckBox generateCheckBox(int index);
}
private List<ICheckBox> checkBoxes = new ArrayList<I... | }
} |
<|file_name|>Pair.java<|end_file_name|><|fim▁begin|>package pl.edu.agh.idziak.asw.common;
import com.google.common.base.Preconditions;
/**
* Created by Tomasz on 13.07.2016.
*/
public class Pair<X, Y> {
private final X one;
private final Y two;
Pair(X one, Y two) {
this.one = Preconditions.che... | }
} |
<|file_name|>nvd3-test-lineWithFocusChartx2AxisLabel.ts<|end_file_name|><|fim▁begin|>/// <reference path="nvd3.d.ts" />
module nvd3_test_lineWithFocusChartx2AxisLabel {
nv.addGraph(function () {
var chart = nv.models.lineWithFocusChart();
chart.brushExtent([50, 70]);
chart.xAxis.tickForm... | |
<|file_name|>protectionpolicyoperationstatuses.go<|end_file_name|><|fim▁begin|>package backup
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Ch... | if err != nil {
err = autorest.NewErrorWithError(err, "backup.ProtectionPolicyOperationStatusesClient", "Get", nil, "Failure preparing request")
return
} |
<|file_name|>URLService.java<|end_file_name|><|fim▁begin|>package com.polarion.starter.utility;
/**
* Created by scottrichards on 9/5/15.
*/
public class URLService extends Object {<|fim▁hole|> // return url formed by adding the specified ending url to the base url
static public String buildUrl(String url) {
... | private static String baseURL = "http://54.183.27.217";
|
<|file_name|>surnametab.py<|end_file_name|><|fim▁begin|>#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2010 Benny Malengier
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... | if not EmbeddedList.key_pressed(self, obj, event):
if event.type == Gdk.EventType.KEY_PRESS and event.keyval in (_TAB,): |
<|file_name|>project-summary.component.ts<|end_file_name|><|fim▁begin|>import {Component} from 'angular2/core';
import {ROUTER_DIRECTIVES, RouteParams} from 'angular2/router';
import {Response} from 'angular2/http';
import {ProjectManager} from '../commons/purifinity/ProjectManager';
import {PanelComponent} from '../c... | DurationPipe
], |
<|file_name|>EnumeratedAttributeValue.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.spdx.org/licenses/EPL... | /**
* Copyright (c) 2014 Kay Erik Münch. |
<|file_name|>Door.java<|end_file_name|><|fim▁begin|>/**
*
* Copyright 2014 Martijn Brekhof
*
* This file is part of Catch Da Stars.
*
* Catch Da Stars 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, e... | }
} |
<|file_name|>edge_5x10_003.py<|end_file_name|><|fim▁begin|>from pypov.pov import Texture, Pigment, Intersection, Cylinder
from pypov.pov import Union, Difference, Object, Box, Sphere
from pypov.common import grey, white<|fim▁hole|>from pypov.colors import Colors
from lib.base import five_by_ten_edge
from lib.textures ... | |
<|file_name|>set_value.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
#![allow(unused_imports)]
extern crate libc;
extern crate sysctl;
// Import the trait
use sysctl::Sysctl;
#[cfg(target_os = "freebsd")]
const CTLNAME: &str = "net.inet.ip.forwarding";
#[cfg(target_os = "macos")]
const CTLNAME: &str = "net.i... | panic!("Could not set value. Error: {:?}", e);
});
assert_eq!(new_value, target_value, "could not set value");
println!("OK. Now restoring old value '{}'...", old_value); |
<|file_name|>argument-passing.rs<|end_file_name|><|fim▁begin|>// run-pass
struct X {
x: isize
}
fn f1(a: &mut X, b: &mut isize, c: isize) -> isize {
let r = a.x + *b + c;
a.x = 0;
*b = 10;
return r;
}
<|fim▁hole|> let mut b = 2;
let c = 3;
assert_eq!(f1(&mut a, &mut b, c), 6);
asser... | fn f2<F>(a: isize, f: F) -> isize where F: FnOnce(isize) { f(1); return a; }
pub fn main() {
let mut a = X {x: 1}; |
<|file_name|>DMNTypeSchemas.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://... | schema.addExtension(DMNOASConstants.X_DMN_TYPE, getDMNTypeSchemaXDMNTYPEdescr(t));
return schema; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
<|fim▁hole|># Create your models here.
class Pizza(models.Model):
name = models.CharField(max_length=128)
price = models.DecimalField(decimal_places=2, max_digits=5)
ingredients = models.TextField()
picture = models.ImageFi... | |
<|file_name|>User.java<|end_file_name|><|fim▁begin|>package com.humbinal.ssm.test;
public class User {
private long user_Id;
private String user_name;
private int user_age;<|fim▁hole|>
public long getUser_Id() {
return user_Id;
}
public void setUser_Id(long user_Id) {
this.use... |
public User() {
} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from . import views
app_name = 'persons'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^contact/$', views.contact, name='contact'),
url(r'^thanks/$', views.thanks, name='thanks'),
url(r'^upload/$', views.up... |
] |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/**
* Module dependencies.
*/
var express = require('express');
var path = require('path');
var api = require('./lib/api');
var seo = require('./lib/seo');
var app = module.exports = express();
app.set('port', process.env.PORT || 3000);
app.s... | |
<|file_name|>Span2ConverterBenchmarks.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2015-2017 The OpenZipkin 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.apa... | .putTag("srv/finagle.version", "6.44.0")
.build(); |
<|file_name|>query-editor.js<|end_file_name|><|fim▁begin|>var $ = require('jquery');
var keymaster = require('keymaster');
var ChartEditor = require('./component-chart-editor.js');
var DbInfo = require('./component-db-info.js');
var AceSqlEditor = require('./component-ace-sql-editor.js');
var DataGrid = require('./comp... | return false; |
<|file_name|>html5.py<|end_file_name|><|fim▁begin|>"""
A HTML5 target.
"""
from targets import _
from html import TYPE
import html
NAME = _('HTML5 page')
EXTENSION = 'html'
HEADER = """\
<!DOCTYPE html>
<html>
<head>
<meta charset="%(ENCODING)s">
<title>%(HEADER1)s</title>
<meta name="generator" content="http://txt... | <h3>%(HEADER3)s</h3>
</hgroup>
</header> |
<|file_name|>named.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------... | #----------------------------------------------------------------------------- |
<|file_name|>test_robotparser.py<|end_file_name|><|fim▁begin|>import unittest, StringIO, robotparser
from test import test_support
from urllib2 import urlopen, HTTPError
class RobotTestCase(unittest.TestCase):
def __init__(self, index, parser, url, good, agent):
unittest.TestCase.__init__(self)
if ... | good = ['/some/path?']
bad = ['/another/path?']
RobotTest(16, doc, good, bad) |
<|file_name|>LoginManagerPrompter.js<|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/. */
const Cc = Components.classes;
const Ci = Compo... | |
<|file_name|>listCommits.module.ts<|end_file_name|><|fim▁begin|>import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {SharedModule} from '../shared/shared.module';
import {ListCommitsComponent, CommitList, CommitItem} from './listCommits.component';
import {GithubCommitsQuery} fr... | export class ListCommitsModule {
} |
<|file_name|>test_discount.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from bda.plone.discount import UUID_PLONE_ROOT
from bda.plone.discount.tests import Discount_INTEGRATION_TESTING
from bda.plone.discount.tests import set_browserlayer
from plone.uuid.interfaces import IUUID
import unittest2 as unittest
... | |
<|file_name|>billy.py<|end_file_name|><|fim▁begin|>from comics.aggregator.crawler import CrawlerBase
from comics.core.comic_data import ComicDataBase
class ComicData(ComicDataBase):
name = 'Billy'
language = 'no'
url = 'http://www.billy.no/'
start_date = '1950-01-01'<|fim▁hole|>
class Crawler(CrawlerB... | active = False
rights = 'Mort Walker'
|
<|file_name|>parse-srcset_test.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2015 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at... | |
<|file_name|>nxos_linkagg.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
A... | RETURN = """
commands:
description: The list of configuration mode commands to send to the device |
<|file_name|>add_diff_hash.py<|end_file_name|><|fim▁begin|>from django_evolution.mutations import AddField, RenameField
from django.db import models
MUTATIONS = [<|fim▁hole|> related_model='diffviewer.FileDiffData'),
AddField('FileDiff', 'parent_diff_hash', models.ForeignKey, null=True,
r... | RenameField('FileDiff', 'diff', 'diff64', db_column='diff_base64'),
RenameField('FileDiff', 'parent_diff', 'parent_diff64',
db_column='parent_diff_base64'),
AddField('FileDiff', 'diff_hash', models.ForeignKey, null=True, |
<|file_name|>outputFormat.spec.js<|end_file_name|><|fim▁begin|>/* global expect */
describe('outputFormat', () => {
describe('when given a format', () => {
it('decides the output that will be used for serializing errors', () => {
expect(
function () {
const clonedExpect = expect.clone().ou... | '\n\x1b[31m\x1b[1mexpected\x1b[22m\x1b[39m 42 \x1b[31m\x1b[1mto equal\x1b[22m\x1b[39m 24\n',
}
); |
<|file_name|>craw.rs<|end_file_name|><|fim▁begin|>//! Module for parsing Canon CR3 files that are ISO Base Media Format
//! aka video/mp4 streams.
// 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 a... | pub fn read_craw_entry<T: Read>( |
<|file_name|>WithTimeout.tsx<|end_file_name|><|fim▁begin|>import { Component, ComponentClass } from 'react';
import { Timeout } from '../../helpers/Timeout';
interface InnerProps {
timeLeft: number;
maxTime: number;
}
interface WithTimeoutProps {
maxTime: number;
onTimeUp: Function;
}
inter... | }
|
<|file_name|>en-us.ts<|end_file_name|><|fim▁begin|>import {IModelResolver} from "../resolvers/imodel-resolver";
export const locale =
{
"default": "This field is invalid",
"required": "This field is required",
"date": (value: any) => `This field contains "${value}" which is not a valid date`,
"decimal"... | "regex": "This field does not match the expected format",
"step": (value: any, step: number) => `This field has a value of ${value} and should be an increment of ${step}`,
"matches": (modelResolver: IModelResolver, propertyName: string, optionsOrProperty: any) => { |
<|file_name|>zero.rs<|end_file_name|><|fim▁begin|>#![feature(core, zero_one)]
extern crate core;
#[cfg(test)]
mod tests {
use core::num::Zero;
// pub trait Zero {
// /// The "zero" (usually, additive identity) for this type.
// fn zero() -> Self;
// }
// pub trait One {
// ///... | |
<|file_name|>json_doc.py<|end_file_name|><|fim▁begin|>try:
import simplejson
except ImportError:
import json as simplejson
from .meta import DocumentMeta, BaseDocumentSession
json_objects = []
class JSONDocument(object):
"""
JSON Document base class
"""
__metaclass__ = DocumentMeta
d... | """ |
<|file_name|>globals.js<|end_file_name|><|fim▁begin|>define(
[
'jquery',
'stapes',
'./conditionals'
],
function(
$,
Stapes,
conditionalsMediator
) {
'use strict';
/**
* Global Mediator (included on every page)
... | |
<|file_name|>worker.py<|end_file_name|><|fim▁begin|>from src import cron
from src.api import Api
api = Api()
def fetch_photo():
api.fetch_photo()
@cron.route('/worker', methods=['GET'])
def scheduler_worker():
<|fim▁hole|><|fim▁end|> | fetch_photo()
return 'fetch photo...' |
<|file_name|>application.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
* _ _____ __________ *
* | | / / _ | / __/_ __/ Visibility *
* |... | * LICENSE file found in the top-level directory of this distribution and at *
* http://vast.io/license. No part of VAST, including this file, may be *
* copied, modified, propagated, or distributed except according to the terms * |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
import re
import time
import math
import threading
try:
f... | self._last_angles[5] = kwargs.get('N') if is_radian else math.radians(kwargs.get('N'))
if 'O' in kwargs and isinstance(kwargs['O'], (int, float)):
|
<|file_name|>options_dialog_base.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'options_dialog_base.ui'
#
# Created: Mon Feb 17 11:50:09 2014
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 imp... | self.gridLayout_4 = QtGui.QGridLayout(self.tab_basic)
self.gridLayout_4.setMargin(0)
self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>"""This module is responsible for storing files on disk.
The storage strategy is as follows:
- Files themselves are stored in a separate directory called 'blobs'.
- Stored files are named by their SHA256 hashes (in hex).
- Stored files are grouped into directories b... | |
<|file_name|>nucleus_data.cc<|end_file_name|><|fim▁begin|>#include "jednostki.h"
#include "generatormt.h"
#include "nucleus_data.h"
#include "calg5.h"
#include "util2.h"
using namespace std;
template < class T >
static inline T pow2 (T x)
{
return x * x;
}
static inline double bessj0(double x)
{
if(fabs(x)<0.000... | static double _3pF_7_7[4]= {2.57000 ,0.5052 ,-0.18070 ,0.0127921 };
static double _3pF_7_8[4]= {2.33430 ,0.4985 , 0.13930 ,0.011046 };
static double _3pF_12_12a[4]={3.10833 ,0.6079 ,-0.16330 ,0.00707021};
static double _3pF_12_12b[4]={3.19234 ,0.6046 ,-0.24920 ,0.00742766}; |
<|file_name|>virtual.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var width = 12<|fim▁end|> | /** @name dimensions */
|
<|file_name|>prototype.js<|end_file_name|><|fim▁begin|>/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(insta... | 'p',
{ style: stylePara },
React.createElement(
'span', |
<|file_name|>debugViewlet.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*-----... | return null;
}
private onDebugServiceStateChange(): void { |
<|file_name|>sale_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# (c) Manuel Guil
# © 2016 Esther Martín - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
class SaleOrder(models.Model):
_inherit = "sale.order"<|fim▁hole|> period_... | |
<|file_name|>add_derive_existing_attr_after.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | #[derive(Something<caret>)]
struct Test {} |
<|file_name|>issue-2526-a.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.o... | #![feature(globs)] |
<|file_name|>issue-2734.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/lice... | let _ = perform_hax(box 42); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.