prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>6aab1ac34c3_.py<|end_file_name|><|fim▁begin|>"""Initial Structure (Creating test and page tables)
Revision ID: 6aab1ac34c3
Revises: None
Create Date: 2015-07-19 12:58:04.968533
"""
# revision identifiers, used by Alembic.
revision = '6aab1ac34c3'
down_revision = None
from alembic import op
import sqlal... | ### commands auto generated by Alembic - please adjust! ###
op.create_table('test', |
<|file_name|>traceback-example-1.py<|end_file_name|><|fim▁begin|>'''
ÏÂÀý չʾÁË traceback Ä£¿éÔÊÐíÄãÔÚ³ÌÐòÀï´òÓ¡Òì³£µÄ¸ú×Ù·µ»Ø(Traceback)ÐÅÏ¢, ÀàËÆÎ´²¶»ñÒ쳣ʱ½âÊÍÆ÷Ëù×öµÄ.<|fim▁hole|>
# ×¢Òâ! µ¼Èë traceback »áÇåÀíµôÒ쳣״̬, ËùÒÔ
# ×îºÃ±ðÔÚÒì³£´¦Àí´úÂëÖе¼Èë¸ÃÄ£¿é
import traceback
try:
raise SyntaxError, "examp... | ''' |
<|file_name|>simplified_data_tasks.py<|end_file_name|><|fim▁begin|>## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 ... | |
<|file_name|>test_v3_protection.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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<|fim▁hole|>#
#... | #
# http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>intoto_provenance.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.or... | if the recipe doesn't come from a material, as
zero is default unset value for int64. |
<|file_name|>advent1.rs<|end_file_name|><|fim▁begin|>// advent1.rs
// Manhattan lengths and segment intersection
use std::io;
use std::collections::HashSet;
type Vec2 = [i32; 2];
// unit vectors for the 4 cardinal directions
const NORTH: Vec2 = [0, 1];
#[allow(dead_code)]
const SOUTH: Vec2 = [0, -1];
#[allow(dead_co... | // split the input into individual turns, add up all the distance vectors, and return the distance
fn calc_manhattan_length(turns: &str) -> i32 {
let mut dir = NORTH;
let mut position = [0, 0]; |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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/licens... | |
<|file_name|>IConcurrentSet.java<|end_file_name|><|fim▁begin|>package ninja.egg82.concurrent;<|fim▁hole|> //functions
int getRemainingCapacity();
int getCapacity();
}<|fim▁end|> |
import java.util.Set;
public interface IConcurrentSet<T> extends Set<T> { |
<|file_name|>rc4random.js<|end_file_name|><|fim▁begin|>Rc4Random = function(seed)
{
var keySchedule = [];
var keySchedule_i = 0;
var keySchedule_j = 0;
function init(seed) {
for (var i = 0; i < 256; i++) {
keySchedule[i] = i;
}
var j = 0;
for (va... | |
<|file_name|>test_settings.py<|end_file_name|><|fim▁begin|># flake8: noqa
"""Settings to be used for running tests."""
from settings import *
INSTALLED_APPS.append('integration_tests')
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
}
EMAIL_SUBJECT_P... | SOUTH_TESTS_MIGRATE = False |
<|file_name|>_management_locks_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.... | if response.status_code not in [200, 201]: |
<|file_name|>aggregates_client.py<|end_file_name|><|fim▁begin|># Copyright 2013 NEC Corporation.
# 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
#
# ht... | def add_host(self, aggregate_id, **kwargs):
"""Add a host to the given aggregate.
Available params: see http://developer.openstack.org/ |
<|file_name|>BtnUpLevel.js<|end_file_name|><|fim▁begin|>import React from 'react';
import Tap from '../hahoo/Tap';
class BtnUpLevel extends React.Component {
static propTypes = {
onItemClick: React.PropTypes.func
}
<|fim▁hole|> const { onItemClick, ...rest } = this.props;
return (<Tap
onTap={onIt... | state = {}
render() { |
<|file_name|>strain.go<|end_file_name|><|fim▁begin|>package strain
type Ints []int
type Lists [][]int
type Strings []string
func (i Ints) Keep(filter func(int) bool) Ints {
if i == nil {
return nil
}
filtered := []int{}
for _, v := range i {
if filter(v) {
filtered = append(filtered, v)
}
}
i = filtere... | return i.Keep(func(i int) bool {
return !filter(i) |
<|file_name|>create_table_metaDatasetsUsed.py<|end_file_name|><|fim▁begin|>import ReviewHelper
import pandas as pd
df = ReviewHelper.get_pandas_data_frame_created_from_bibtex_file()
# find problematic ones
df[df.metaDatasetsUsed.isnull()]
list1 = df.metaDatasetsUsed.str.split(",").tolist()
df1 = pd.DataFrame(list1... |
table_content_full = table_content_start + table_content_inside + table_content_end |
<|file_name|>en_mod_rw.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import os,sys,re
#Check the OS Version
RELEASE_FILE = "/etc/redhat-release"
RWM_FILE = "/etc/httpd/conf.modules.d/00-base.conf"
if os.path.isfile(RELEASE_FILE):
f=open(RELEASE_FILE,"r")
rel_list = f.read().split()
if rel_list[2] == "release"... | print("so far good")
else: |
<|file_name|>timer.py<|end_file_name|><|fim▁begin|>import contextlib
from time import time
from .meter import Meter
from .stats import Stat
from .histogram import Histogram
class Timer(Stat):
def __init__(self):
self.count = 0
self.meter = Meter()
self.histogram = Histogram()
supe... | |
<|file_name|>RegisterableBinder.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2011 Christopher Pheby
*
* 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.a... | * See the License for the specific language governing permissions and
* limitations under the License.
|
<|file_name|>hostkeys.py<|end_file_name|><|fim▁begin|># Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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
# Softwar... | """
class SubDict (DictMixin):
def __init__(self, hostname, entries, hostkeys):
self._hostname = hostname |
<|file_name|>Captcha.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import with_statement
import os
import time
from module.plugins.internal.Plugin import Plugin
from module.plugins.internal.utils import encode
class Captcha(Plugin):
__name__ = "Captcha"
__type__ = "captcha"
... | |
<|file_name|>test_wiringfastapi_py36.py<|end_file_name|><|fim▁begin|>from httpx import AsyncClient
# Runtime import to avoid syntax errors in samples on Python < 3.5 and reach top-dir
import os
_TOP_DIR = os.path.abspath(
os.path.sep.join((
os.path.dirname(__file__),
'../',
)),
)
_SAMPLES_DIR =... | response = self._run(self.client.get('/auth', auth=('john_smith', 'secret')))
self.assertEqual(response.status_code, 200)
self.assertEqual(response.json(), {'username': 'john_smith', 'password': 'secret'}) |
<|file_name|>MLAlertController.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008 The Android Open Source Project
*
* 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:/... | int i = vg.getChildCount();
while (i > 0) {
i--; |
<|file_name|>URLInputType.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must ... | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
<|file_name|>instr_vmovdqa64.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn vmovdqa64_1() {
run_test(&In... | fn vmovdqa64_5() { |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>import jps
import json
import time
class MessageHolder(object):
def __init__(self):
self._saved_msg = []
def __call__(self, msg):
self._saved_msg.append(msg)
def get_msg(self):
return self._saved_msg
def test_multi_pubsub... | |
<|file_name|>0029_auto_20151028_1609.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
<|fim▁hole|> dependencies = [
('core', '0028_auto_20151026_0926'),
]
operations = [
migrations.AlterField(
... | class Migration(migrations.Migration):
|
<|file_name|>parser_config.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 GigaSpaces Technologies Ltd. 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
#
# ... | 'type': str, |
<|file_name|>delayed_commits.js<|end_file_name|><|fim▁begin|>// 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 required by appli... |
// You can update but without committing immediately, and then ensure
// everything is commited in the last step. |
<|file_name|>VMMRC.cpp<|end_file_name|><|fim▁begin|>/* $Id$ */
/** @file
* VMM - Raw-mode Context.
*/
/*
* Copyright (C) 2006-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute i... | /* todo */
switch (uOperation) |
<|file_name|>performancetiming.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use dom::bindings::codegen::Bindings::PerformanceTimingBinding;
use dom::bindings::js::{JSRef, Temporary};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::window::Window;
#[deriving(Encodable)]
pub struct Perfor... | /* 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/. */
|
<|file_name|>sccache_cargo.rs<|end_file_name|><|fim▁begin|>//! System tests for compiling Rust code with cargo.
//!
//! Any copyright is dedicated to the Public Domain.
//! http://creativecommons.org/publicdomain/zero/1.0/
#![deny(rust_2018_idioms)]
#[cfg(all(not(target_os = "windows"), not(target_os = "macos")))]
#[... | let envs = vec![ |
<|file_name|>utils.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/. */
//! Various utilities to glue JavaScript and the DOM implementa... | if JS_HasPropertyById(cx, proto, id, &mut has_property) == 0 {
return false; |
<|file_name|>lib.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/. */
#![crate_name = "skia"]
#![crate_type = "rlib"]
#![feature(libc)... |
pub use skia::{
SkiaSkNativeSharedGLContextRef,
SkiaGrContextRef, |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
# Copyright (c) 2011-2015 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
import re
from rest_framework.serializers import ValidationError
def name(value):
'''Matches na... | # -*- coding: utf-8 -*- |
<|file_name|>route_lifecycle_reflector.js<|end_file_name|><|fim▁begin|>import { Type } from 'angular2/src/core/facade/lang';
import { CanActivate } from './lifecycle_annotations_impl';
import { reflector } from 'angular2/src/core/reflection/reflection';
export function hasLifecycleHook(e, type) {
if (!(type instanc... | if (annotation instanceof CanActivate) {
return annotation.fn; |
<|file_name|>resource.js<|end_file_name|><|fim▁begin|>'use strict';
define([
'jquery', 'underscore', 'angular',
'angular-resource'
],
function ($, _, angular) {
var resourceApp = angular.module('resourceApp', [ 'ngResource' ]);
resourceApp.factory('NodeFactory', function ($resource) {
// $reso... | |
<|file_name|>sequence_fr.ts<|end_file_name|><|fim▁begin|><TS language="fr" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Cliquer à droite pour modifier l'adresse ou l'étiquette</translation>
</message>
<... | </message> |
<|file_name|>enums.ts<|end_file_name|><|fim▁begin|>export enum MessageType {
Command = 0x41,
CommandReply = 0x42,
Get = 0x43,
GetReply = 0x44,
Set = 0x45,<|fim▁hole|>export enum PowerModes {
On = 0x0001,
Standby = 0x0002,
Suspend = 0x0003,
Off = 0x0004,
}
export const MONITOR_ID_ALL = '*'
export type MonitorI... | SetReply = 0x46,
}
|
<|file_name|>ezmenu.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# I found this file inside Super Mario Bros python
# written by HJ https://sourceforge.net/projects/supermariobrosp/
# the complete work is licensed under GPL3 although I can not determine# license of this file
# maybe this is the original auth... | clr = self.hcolor |
<|file_name|>request.go<|end_file_name|><|fim▁begin|>package pusher
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"net/http"
"strconv"
)
const (
contentTypeHeaderKey = "Content-Type"
contentTypeHeaderValue = "application/json"
)
var headers = map[string]string{
"Content-Type": "application/json",
"X-Pu... | return nil, err
}
if response.StatusCode >= 200 && response.StatusCode < 300 {
return responseBody, nil |
<|file_name|>run-in-foreground.js<|end_file_name|><|fim▁begin|>WScript.Echo("** The end of copyright notices **");
function quote(arg) {
arg = arg.replace(/"/g, '""');
return '"' + arg + '"';
}
var app = WScript.Arguments(0);
var args = [];
for (var i = 1; i < WScript.Arguments.Count(); ++i) {
args.push(q... | |
<|file_name|>SockshareCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class SockshareCom(DeadHoster):<|fim▁hole|>
__pattern__ = r'http://(?:www\.)?sockshare\.com/(mobile/)?(file|embed)/(?P<ID>\w+)'
__description__ = """Soc... | __name__ = "SockshareCom"
__type__ = "hoster"
__version__ = "0.05" |
<|file_name|>npx.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from util import nodeenv_delegate
from setup import setup
if __name__ == "__main__":<|fim▁hole|> nodeenv_delegate("npx")<|fim▁end|> | setup(skip_dependencies=True) |
<|file_name|>Greeting.java<|end_file_name|><|fim▁begin|>package com.company;
import java.util.Scanner;
public class Greeting {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
<|fim▁hole|> int age = Integer.parseInt(scanner.nextLine());
System.out.printf("... | String firstName = scanner.nextLine();
String lastName = scanner.nextLine(); |
<|file_name|>require.tsx<|end_file_name|><|fim▁begin|>import x from '@shortcut2/export';
<|fim▁hole|>}<|fim▁end|> | export default function(props) {
return <h1>{props.children}</h1> |
<|file_name|>csvReader.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
a csv trace reader
Author: Jason Yang <peter.waynechina@gmail.com> 2016/06
"""
import string
from PyMimircache.const import ALLOW_C_MIMIRCACHE, INSTALL_PHASE
from PyMimircache.utils.printing import *
if ALLOW_C_MIMIRCACHE and not INSTA... | super(CsvReader, self).__init__(file_loc, data_type, block_unit_size, disk_sector_size,
open_c_reader, kwargs.get("lock", None))
assert init_params is not None, "please provide init_param for csvReader" |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Support for Soma sensors."""
from datetime import timedelta
import logging
from requests import RequestException
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
from homeassistant.helpers.entity import Entity
from homeassistant.util import Thrott... | @property
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES.""" |
<|file_name|>services.ts<|end_file_name|><|fim▁begin|>module app.teacherlists {
'use strict';
interface ITeacherListResourceClass<T> extends ng.resource.IResourceClass<ng.resource.IResource<T>> {
GetStudentList(data: T): T;
}
interface ITeacherRemoveStdResourceClass<T> extends ng.resource.IRe... | private GetStudentListsvc: ITeacherListResourceClass<any>; |
<|file_name|>arduino.rs<|end_file_name|><|fim▁begin|>extern crate serial;
extern crate byteorder;
use std::io::{Read, Write};
use std::thread;
use std::sync::mpsc::{Sender, SyncSender, Receiver};
use std::sync::mpsc;
use std::sync::{Arc, Mutex};
use self::byteorder::{WriteBytesExt, LittleEndian};
use event;
use jac... | } |
<|file_name|>guestby1currentsnapshot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Karesansui.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),... | _job = Job('%s command' % cmdname, 0, action_cmd)
_jobgroup.jobs.append(_job)
|
<|file_name|>plot_tuto1DBedLoadTurb.py<|end_file_name|><|fim▁begin|>import subprocess
import sys
import numpy as np<|fim▁hole|>import matplotlib.pyplot as plt
plt.ion()
############### Plot properties #####################
import matplotlib.ticker as mticker
from matplotlib.ticker import StrMethodFormatter, NullFormat... | import fluidfoam |
<|file_name|>fonts.js<|end_file_name|><|fim▁begin|>'use strict';
var gulp = require( 'gulp' );
var fontmin = require( 'gulp-fontmin' );
var path = require( '../../paths.js' );<|fim▁hole|>
gulp.task( 'fonts', function( )
{
return gulp.src( path.to.fonts.source )
.pipe( fontmin( )
.pipe(... | |
<|file_name|>elemwise.py<|end_file_name|><|fim▁begin|>"""Elementwise operators"""
from __future__ import absolute_import as _abs
import tvm
from .. import tag
from ..util import get_const_int
@tvm.tag_scope(tag=tag.ELEMWISE)
def relu(x):
"""Take relu of input x.
Parameters
----------
x : tvm.Tensor
... | return tvm.select(x(*indices) > 0, x(*indices), x(*indices) * slope(indices[axis]))
return tvm.compute(x.shape, _compute_channelwise) |
<|file_name|>strategy.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
Unles... | api.NameGenerator
}
// Strategy is the default logic that applies when creating and updating Namespace |
<|file_name|>score.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import division
from django.core.management.base import BaseCommand
from query.models import Video, Face, LabelSet, Frame
from scannerpy import ProtobufGenerator, Config
import os
import cv2
import math
import numpy... | |
<|file_name|>gpg_key.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> License as published by the Free Software Foundation; either version
2 of the License (GPLv2) or (at your option) any later version.
There is NO WARRANTY for this software, express or implied,
including the implied warranties of MERCHANTABILITY,
N... | Copyright 2011 Red Hat, Inc.
This software is licensed to you under the GNU General Public |
<|file_name|>bibformat_regression_tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published ... | Légende</span><br /><small>Conference "Internet, Web, What's next?" le 26 juin 1998 au CERN: Tim Berners-Lee, inventeur du World-Wide Web et directeur du W3C, explique comment le Web est ne, et donne ses opinions sur l'avenir.</small></p>''' |
<|file_name|>CCPrimitive.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
Copyright (c) 2013-2017 Chukong Technologies Inc.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and assoc... | Primitive::~Primitive()
{ |
<|file_name|>PathVariable.py<|end_file_name|><|fim▁begin|>"""SCons.Variables.PathVariable
This file defines an option type for SCons implementing path settings.
To be used whenever a a user-specified path override should be allowed.
Arguments to PathVariable are:
option-name = name of this option on the command l... | # in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY |
<|file_name|>DomTextSearchTest.ts<|end_file_name|><|fim▁begin|>import { Assert, UnitTest } from '@ephox/bedrock-client';
import { Fun, Unicode } from '@ephox/katamari';
import { KAssert } from '@ephox/katamari-assertions';
import { Spot } from '@ephox/phoenix';
import { Pattern } from '@ephox/polaris';
import { Compare... | checkAbort(DomTextSearch.expandLeft(element, 1, { regex: wordbreaker, attempt: stopAtGap }));
checkAbort(DomTextSearch.expandLeft(element, 2, { regex: wordbreaker, attempt: stopAtGap }));
checkEdge(DomTextSearch.expandLeft(text, 0, { regex: wordbreaker, attempt: stopAtGap }), text); |
<|file_name|>hook_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 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
Unle... | } |
<|file_name|>EmbedMultipleMetaTagsProblem.java<|end_file_name|><|fim▁begin|>/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses ... | |
<|file_name|>hashset.rs<|end_file_name|><|fim▁begin|>use containers::array::Array;
use containers::list::List;
use containers::reference::Ref;
use containers::vector::Vector;
use memory::page::Page;
use memory::region::Region;
#[derive(Copy, Clone)]
pub struct HashSet<T: Hash<T> + Copy> {
slots: Vector<Ref<List<Sl... | fn test_hash_set() {
use containers::String;
use memory::Heap; |
<|file_name|>languages.js<|end_file_name|><|fim▁begin|>/* Global variables */
var _languagesHashOld = new Array();
var _languagesHash = new Array();
var _languagesRegexHash = new Array();
/* Initialize the languages arrays */
/* Order alphabetically by _languagesHash key */
/* Based in ISO 639-3 codes */
/* source: ht... | 'hr': _languagesHash.hrv,
'hu': _languagesHash.hun, |
<|file_name|>sugar_integration_tests.cc<|end_file_name|><|fim▁begin|>#define BOOST_TEST_MODULE sugar_integration_tests<|fim▁hole|><|fim▁end|> | #include <boost/test/included/unit_test.hpp> |
<|file_name|>peturb.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
# returns a random d dimensional vector, a direction to peturb in
def direction(d,t):
# if type == uniform
if(t == 'u'):
return np.random.uniform(-1/np.sqrt(2), 1/np.... | angles = np.random.uniform(0, np.pi, d-2) |
<|file_name|>Acao.js<|end_file_name|><|fim▁begin|>// Representa um ação que pode ser desfeita e refeita
// A ação é associada a uma aba aberta
// Nas funções redo e undo, this se refere à aba associada à ação<|fim▁hole|> var aba = Interface.abaFoco
this.id = String(Math.random())
this.nome = nome
this.redo = redo
... | function Acao(nome, redo, undo) { |
<|file_name|>screensaver.cpp<|end_file_name|><|fim▁begin|>/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Clementine 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 Foundat... | const char* Screensaver::kGnomePath = "/";
const char* Screensaver::kGnomeInterface = "org.gnome.ScreenSaver";
const char* Screensaver::kKdeService = "org.kde.ScreenSaver";
const char* Screensaver::kKdePath = "/ScreenSaver/"; |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from socketio import sdjango
from web.api import EventResource, SummaryFeedResource, SummaryFeedByCountryCodeResource
from tastypie.api import Api
# ... | |
<|file_name|>glyphMargin.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.
*------... | } |
<|file_name|>fixture-dialog.controller.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('footierepoApp').controller('FixtureDialogController',
['$scope', '$stateParams', '$uibModalInstance', 'entity', 'Fixture',
function($scope, $stateParams, $uibModalInstance, entity, Fixture) {
entit... | |
<|file_name|>mb.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 witho... | # it for now to help understand the differences. |
<|file_name|>xrinputsourceevent.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 https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::Even... | &init.frame, |
<|file_name|>web_page_block.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and contributors
# For license information, please see license.txt<|fim▁hole|>
# import frappe
from frappe.model.document import Document
class WebPageBlock(Document):
pass<|fim▁end|> |
from __future__ import unicode_literals |
<|file_name|>TableChunker.js<|end_file_name|><|fim▁begin|>/**
* Produces optimized XTemplates for chunks of tables to be
* used in grids, trees and other table based widgets.
*/
Ext.define('Ext.view.TableChunker', {
singleton: true,
requires: ['Ext.XTemplate'],
metaTableTpl: [
'{%if (this.openTab... | unselectableCls: cfg.enableTextSelection ? '' : Ext.baseCSSPrefix + 'unselectable'
},
// copy the template spec array if there are Features which might mutate it |
<|file_name|>vmops.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010 Cloud.com, Inc
# Copyright 2012 Cloudbase Solutions Srl
# 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 o... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>global_var = 2.11
print('main():')
print('global_var = ', ++global_var)
def func_use_global():
print('func_use_global():')
print('global_var = ', global_var)
func_use_global()
def func_modify_global():
global global_var # Must declare when to reassign global vari... | global_var += 1
print('func_modify_global():')
print('global_var = ', ++global_var)
|
<|file_name|>expand.rs<|end_file_name|><|fim▁begin|>// This file is part of the uutils coreutils package.
//
// (c) Virgile Andreani <virgile.andreani@anbuco.fr>
// (c) kwantam <kwantam@gmail.com>
// * 2015-04-28 ~ updated to work with both UTF-8 and non-UTF-8 encodings
//
// For the full copyright and license info... | Ok(a) => a,
Err(e) => crash!(1, "{}: {}\n", path.maybe_quote(), e),
}; |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include "hermes2d.h"
#include "solver_umfpack.h"
#include "function.h"
// This example shows how to combine the Newton's method with
// automatic adaptivity.
//
// PDE: stationary heat transfer equation with nonlinear thermal
// conductivity, - div[lambda(u)gr... | begin_time();
// calculate element errors and total error estimate
H1OrthoHP hp(1, &space); |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import uuid
import re
import datetime
import decimal
import itertools
import functools
import random
import string
import six
from six import iteritems
from ..exceptions import (
StopValidation, ValidationError, ConversionError, MockCreationError
)
try:
from ... | localized = str(localized) |
<|file_name|>test_california_housing.py<|end_file_name|><|fim▁begin|>"""Test the california_housing loader, if the data is available,
or if specifically requested via environment variable
(e.g. for travis cron job)."""
import pytest
from sklearn.datasets.tests.test_common import check_return_X_y
from functools import ... | ' requires pandas')
with pytest.raises(ImportError, match=expected_msg):
fetch_california_housing_fxt(as_frame=True) |
<|file_name|>uint.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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... |
impl Into<usize> for Uint { |
<|file_name|>_output.py<|end_file_name|><|fim▁begin|>"""
Implementation of hooks and APIs for outputting log messages.
"""
import sys
import traceback
import inspect
import json as pyjson
from threading import Lock
from functools import wraps<|fim▁hole|>
from pyrsistent import PClass, field
from . import _bytesjson a... | from io import IOBase |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate hyper;
mod credentials;<|fim▁hole|>use std::process;
use std::thread;
use std::time::Duration;
use credentials::Credentials;
use http::Client;
use error::Error;
fn main() {
let credentials = credentials();
let client = Client::new(credentials);
... | mod error;
mod http;
|
<|file_name|>graphql.js<|end_file_name|><|fim▁begin|>Cypress.Commands.add('fetchQuery', (query, variables) => {
cy.request({
url: '/graphql',
method: 'POST',
body: JSON.stringify({ query, variables }),<|fim▁hole|> 'Content-Type': 'application/json'
}
});
});<|fim▁end|> | headers: { |
<|file_name|>StartedSearches.py<|end_file_name|><|fim▁begin|>from measures.generic.GenericMeasure import GenericMeasure
import measures.generic.Units as Units
class StartedSearches(GenericMeasure):
"""Total number of started searches"""
<|fim▁hole|>
def parseLine(self, line):
self.parseInc(line)<|fim▁end|> | def __init__(self, period, simulationTime):
GenericMeasure.__init__(self, r'DEBUG .*? - Peer [0-9]+ started search for parameters .*? ([0-9]+\,[0-9]+).*?', period, simulationTime, Units.MESSAGES) |
<|file_name|>random_forest.py<|end_file_name|><|fim▁begin|># imports
import h2o
import numpy as np
import pandas as pd
from h2o.estimators.gbm import H2OGradientBoostingEstimator
from h2o.estimators.random_forest import H2ORandomForestEstimator
from h2o.grid.grid_search import H2OGridSearch
import sys
from operator i... | from h2o.estimators.glm import H2OGeneralizedLinearEstimator # import GLM models |
<|file_name|>test_schemeinfo.py<|end_file_name|><|fim▁begin|>from ...scheme import Scheme
from ..schemeinfo import SchemeInfoDialog
from ...gui import test
class TestSchemeInfo(test.QAppTestCase):
def test_scheme_info(self):
scheme = Scheme(title="A Scheme", description="A String\n")
dialog = Sche... | |
<|file_name|>test_ftd_configuration.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 Cisco and/or its affiliates.
#
# This file is part of Ansible
#
# Ansible 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... | operation_name = 'test name' |
<|file_name|>svn_fetch.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#<|fim▁hole|># For details, see https://github.com/spack/s... | # This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
# |
<|file_name|>date.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013 CERN.
#
# Invenio 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 v... | """
if isinstance(value, six.string_types): |
<|file_name|>LuceneChildApplicationContextFactory.java<|end_file_name|><|fim▁begin|>/*
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2016 Alfresco Software Limited
* %%<|fim▁hole|> * the paid license agreement will prevail. Otherwise, the software is
* provided under the following open source license ... | * This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of |
<|file_name|>universal-cache.ts<|end_file_name|><|fim▁begin|>import { Injectable, isDevMode } from '@angular/core';
@Injectable()
export class CacheService {
static KEY = 'CacheService';
_cache = new Map();
/**
* check if there is a value in our store
*/
has(key: string | number): boolean {... | */
set(key: string | number, value: any): void { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from serial_settings import SerialSettings
class AbstractStream(object):
def __init__(self, config, name):
"""
:type name: str
"""
self.config = config
self.name = name
def open(self):
raise NotI... | |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>angular.module('aac.controllers.main', [])
/**
* Main layout controller
* @param $scope
*/
.controller('MainCtrl', function($scope, $rootScope, $location, Data, Utils) {
$scope.go = function(v) {
$location.path(v);
}
<|fim▁hole|> return view == $rootSc... |
$scope.activeView = function(view) { |
<|file_name|>CacheManagerBuilder.java<|end_file_name|><|fim▁begin|>/*
* Copyright Terracotta, 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/license... | |
<|file_name|>ToolbarPersistTest.ts<|end_file_name|><|fim▁begin|>import { UiFinder, Waiter } from '@ephox/agar';
import { describe, it } from '@ephox/bedrock-client';
import { TinyHooks, TinyUiActions } from '@ephox/mcagar';
import { Focus, Insert, Remove, SugarBody, SugarElement } from '@ephox/sugar';
import Editor fr... | });
}); |
<|file_name|>texteditor.py<|end_file_name|><|fim▁begin|>import gtk
import pango
import math
from core.world import TheWorld
class TextEditor(object):
def __init__(self, text):
self.__text = text
self.cursorindex = 0
self.padding = 10.0
self.width = 0.0
self.height = 0.0
self.pixel_width ... |
def do_key_press_delete(self): |
<|file_name|>test_hashing.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd<|fim▁hole|>from dask.dataframe.hashing import hash_pandas_object
from dask.dataframe.utils import assert_eq
@pytest.mark.parametrize('obj', [
pd.Series([1, 2, 3]),
pd.Series([1.0, 1.5, 3.2]),
pd.Series([1.0, 1... |
import pytest
|
<|file_name|>listsinceblock.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2017 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import Aurorac... |
ab0
/ \
aa1 [tx0] bb1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.