prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>gtypes.cpp<|end_file_name|><|fim▁begin|>/*
* File: gtypes.cpp
* ----------------
* This file implements the classes in the gtypes.h interface.
*
* @version 2016/10/14
* - modified floating-point equality tests to use floatingPointEqual function
* @version 2015/07/05
* - using global hashing functi... |
bool operator !=(const GDimension& d1, const GDimension& d2) {
return !(d1 == d2); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate crypto;
extern crate regex;
use std::env;
use std::str::FromStr;
use std::io::{BufRead, BufReader};
use std::fs::File;
use std::collections::{HashMap, HashSet};
use crypto::digest::Digest;
use crypto::md5::Md5;
use regex::Regex;
#[derive(Debug)]
enum Ligh... | |
<|file_name|>ff_profile_tests.py<|end_file_name|><|fim▁begin|># Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under ... |
import base64
import os |
<|file_name|>minification.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
"""
JS and CSS minification
============================
Author: Toni Heittola (toni.heittola@gmail.com)
This plugin will create dynamic datatable with charting features from given yaml-datafile.
"""
import os
import sys
im... | #!/usr/bin/env python |
<|file_name|>bitcoin_eo.ts<|end_file_name|><|fim▁begin|><TS language="eo" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>Krei novan adreson</translation>
</message>
<message>
<source>&New</source>
<tr... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|><|fim▁end|> | # -*- coding: utf-8 -*_ |
<|file_name|>home.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: Will<|fim▁hole|>
class ImportFrom(forms.Form):
HOST_TYPE=((1,"001"),(2,"002")) #替換爲文件
host_type = forms.IntegerField(
widget=forms.Select(choices=HOST_TYPE)
)
hostn... | """
from django import forms
from app01 import models |
<|file_name|>elixir.js<|end_file_name|><|fim▁begin|>module.exports = function(hljs) {
var ELIXIR_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_.]*(\\!|\\?)?';
var ELIXIR_METHOD_RE = '[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?';
var ELIXIR_KEYWORDS =
'and false then defined module in ... | };
var STRING = { |
<|file_name|>SearchOrbView.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 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://www... | |
<|file_name|>OWS.d.ts<|end_file_name|><|fim▁begin|>import XML from './XML';
<|fim▁hole|> readFromNode(node: Element): any;
}<|fim▁end|> | export default class OWS extends XML {
constructor();
readFromDocument(doc: Document): any; |
<|file_name|>_public_ip_addresses_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 informati... | |
<|file_name|>theme.module.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Akveo. All Rights Reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
import { ModuleWithProviders, NgModule } from '@angular/core';
import { RouterModule } from '@angular/ro... | NgdPageTabsComponent,
NgdColorSwatchDirective,
NgdDescriptionDirective, |
<|file_name|>AssertXml.java<|end_file_name|><|fim▁begin|>/* Copyright (c) 2018 lib4j
*
* 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 th... | throw new UnsupportedOperationException("Only support replacement of attribute values");
} |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# MAVProxy documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 19 05:17:36 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration val... | 'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.pngmath', |
<|file_name|>custom_transforms.py<|end_file_name|><|fim▁begin|>from sklearn.base import BaseEstimator, TransformerMixin
import numpy as np
class PositionalSelector(BaseEstimator, TransformerMixin):
def __init__(self, positions):
self.positions = positions
def fit(self, X, y=None):<|fim▁hole|> r... | return self
def transform(self, X): |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* The main() function
*/
/*
* Copyright (C) 2006-2009 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is ... | LogFlowFunc (("Font: Substitute family is '%s'. It is %s.\n",
sub.toLatin1().constData(), |
<|file_name|>intra_mixed_exchange.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of VROOM.
Copyright (c) 2015-2021, Julien Coupey.
All rights reserved (see LICENSE).
*/
#include "problems/vrptw/operators/intra_mixed_exchange.h"
namespace vroom {
namespace vrptw {
IntraMixedExchange::IntraMixedExchange(cons... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from django.db.models.lookups import Lookup
from django.db.models.query import QuerySet
from django.db.models.sql.where import SubqueryConstraint, WhereNode
from django.utils.six import text_type
class FilterEr... | |
<|file_name|>ChromeTraceBuildListenerTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013-present Facebook, 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://ww... | HttpArtifactCacheEvent.Started artifactCacheEventStarted = |
<|file_name|>HReconnectMatchElementsRHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPostConditionPattern
import cPickle as pickle
from uuid import UUID
class HReconnectMatchElementsRHS(HimesisPostConditionPattern):
def __init__(self):
"""
Creates the himesis graph repre... | Executable constraint code.
@param PostNode: Function taking an integer as parameter
and returns the node corresponding to that label. |
<|file_name|>ReadRecInd.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2007 Esmertec AG.
* Copyright (C) 2007 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 ... | */
public void setTo(EncodedStringValue[] value) {
mPduHeaders.setEncodedStringValues(value, PduHeaders.TO); |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|># Author: Zhang Huangbin <zhb@iredmail.org>
import web
session = web.config.get('_session')
def require_login(func):
def proxyfunc(self, *args, **kw):
if session.get('logged') is True:
return func(self, *args, **kw)
else:
... | |
<|file_name|>media.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
eve.io.media
~~~~~~~~~~~~
Media storage for Eve-powered APIs.
:copyright: (c) 2014 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
class MediaStorage(object):
""" The MediaStorage class provid... | |
<|file_name|>TestWarDeployment.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2011, 2012 camunda services GmbH
*
* 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.... | |
<|file_name|>tokens_controller.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... | |
<|file_name|>tomate2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
from __future__ import division
import os
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import GObject as gobject
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import Notify
from gi.repository im... | |
<|file_name|>global.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/. */
//! Abstractions for global scopes.
//!
//! This module contai... | |
<|file_name|>reader.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/licenses... | } else {
self.reader.read_be_u32().unwrap()
}
} |
<|file_name|>CollectionEntity.tsx<|end_file_name|><|fim▁begin|>import { Box, Link, Sans, Serif, color } from "@artsy/palette"
import { CollectionEntity_collection } from "v2/__generated__/CollectionEntity_collection.graphql"
import { track } from "v2/System/Analytics"
import * as Schema from "v2/System/Analytics/Schema... | <Box mb={3} width="100%">
<StyledLink |
<|file_name|>publications.client.routes.js<|end_file_name|><|fim▁begin|>'use strict';
// Setting up route
angular.module('publications').config(['$stateProvider',
function ($stateProvider) {
// publications state routing
$stateProvider
.state('publications', {
abstract: true,
url: '/pub... | templateUrl: 'modules/publications/client/views/view-publication.client.view.html',
data: {
roles: ['user', 'admin']
} |
<|file_name|>agent.rs<|end_file_name|><|fim▁begin|>use actix::prelude::*;
use actors::{AddA2ARoute, HandleA2AMsg, RouteA2AMsg, RouteA2ConnMsg};
use actors::agent_connection::{AgentConnection, AgentConnectionConfig};
use actors::router::Router;
use domain::a2a::*;
use domain::a2connection::*;
use domain::config::WalletS... |
let wallet_id = format!("dummy_{}_{}", owner_did, rand::rand_string(10)); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(stmt_expr_attributes)]
extern crate winerunner;
use winerunner::core::Core;
use winerunner::cmd::ListVersionsCommand;
use winerunner::cmd::WinebootCommand;
use winerunner::cmd::WinecfgCommand;
use winerunner::cmd::WineserverCommand;
use winerunner::cmd::Win... | |
<|file_name|>command.rs<|end_file_name|><|fim▁begin|>use self::SmtpInput::*;
use bytes::Bytes;
use std::fmt;
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr};
#[derive(Eq, PartialEq, Debug, Clone)]
pub enum SmtpInput {
Command(usize, usize, SmtpCommand),
Invalid(usize, usize, Bytes),
Incomplete(usize, usize,... | |
<|file_name|>sceneParams_0.js<|end_file_name|><|fim▁begin|>var HLSP = {
/*
set squareness to 0 for a flat land
*/
// intensità colore land audioreattivab più bassa
mizu: {
cameraPositionY: 10,
seaLevel: 0,
displayText: '<b>CHAPTER ONE, MIZU</b><br/><i>TO BE TRAPPED INTO THE MORNIN... | |
<|file_name|>format.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import print_function
# pylint: disable=W0141
import sys
from pandas.core.base import PandasObject
from pandas.core.common import adjoin, notnull
from pandas.core.index import Index, MultiIndex, _ensure_index
from pandas impor... | recs_new[tag + 1] = span
else: |
<|file_name|>Wave.java<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2009-2013 Bengt Martensson.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or (at
your option) a... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react';
import ReactDOM from 'react-dom';
import _ from 'underscore';
import babel from 'babel-core/browser';
import esprima from 'esprima';
import escodegen from 'escodegen';
import estraverse from 'estraverse';
import Codemirror from 'react-codemir... | const cmOptions = {
lineNumbers: true,
readOnly: !showSource,
mode: 'jsx', |
<|file_name|>sim_det_noise.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015-2018 by the parties listed in the AUTHORS file.
# All rights reserved. Use of this source code is governed by
# a BSD-style license that can be found in the LICENSE file.
"""
sim_det_noise.py implements the noise simulation operator, OpSi... | RuntimeError: If observations are not split into chunks.
"""
autotimer = timing.auto_timer(type(self).__name__) |
<|file_name|>foreign2.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// 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... | |
<|file_name|>SCfdiSignature.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package erp.cfd;
import java.io.Serializable;
/**
*
* @author Juan Barajas
*/
public final class SCfdiSignature implements Serializable {
private S... | msRfcEmisor = ""; |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from './baPageTop';
// export * from './baMsgCenter';
export * from './baSidebar';
export * from './baMenu/components/baMenuItem';
export * from './baMenu';
export * from './baContentTop';
export * from './baCard';<|fim▁hole|>export * from './baFullCalendar';
... | export * from './baAmChart';
export * from './baChartistChart';
export * from './baBackTop'; |
<|file_name|>Test_pt.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS>
<context>
<name>TestGui::UnitTest</name>
<message>
<source>FreeCAD UnitTest</source>
<translation>Teste de unidade do FreeCAD</translation>
</message>
<message>
<source>Fail... | <message>
<source>Remaining:</source>
<translation>Faltando:</translation>
</message> |
<|file_name|>section-title.component.ts<|end_file_name|><|fim▁begin|>import { ChangeDetectionStrategy, Component } from '@angular/core';<|fim▁hole|> template: `
<div fxLayout fxLayoutAlign="start center">
<h2>
<i class="fas fa-caret-right" aria-hidden="true"></i>
<fa-icon [icon]="iconCaretRig... | import { faCaretRight } from '@fortawesome/free-solid-svg-icons';
@Component({
selector: 'section-title', |
<|file_name|>nuavatar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistr... | External object ID. Used for integration with third party systems |
<|file_name|>closure.rs<|end_file_name|><|fim▁begin|>// rustfmt-normalize_comments: true
// Closures
fn main() {
let square = ( |i: i32 | i * i );
let commented = |/* first */ a /*argument*/, /* second*/ b: WithType /* argument*/, /* ignored */ _ |
(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbb... | // as others may emit required metadata for dependent crate types
if a.starts_with("--emit") && is_final_crate_type && !self.workspace_mode {
"--emit=dep-info" |
<|file_name|>generic.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import gobject
import dbus.mainloop.glib
dbus.mainloop.glib.DBusGMainLoop(set_as_default = True)
import telepathy
DBUS_PROPERTIES = 'org.freedesktop.DBus.Properties'
def get_registry():
reg = telepathy.client.ManagerRegistry()... | 'bluetooth,
reply_handler = self._on_done,
error_handler = self._on_error, |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod decode;<|fim▁hole|>mod mirror;<|fim▁end|> | mod encode; |
<|file_name|>HumidTemp.js<|end_file_name|><|fim▁begin|>const sensor = require('node-dht-sensor');
const logger = require('../logging/Logger');
/**
* Reads pin 4 of the raspberry PI to obtain temperature and humidity information.
* @return {Promise} A promise that will resolve with the results. In the
* case where t... | if(err) {
logger.error("Could not read from the DHT sensor. " + err);
|
<|file_name|>col.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from flask import (Blueprint, redirect, url_for, render_template, flash,
request, abort, send_file, current_app)
from flask_babel import gettext
from sqlalchemy.orm.exc import NoResultFound
import crypto_util
import store
fro... | |
<|file_name|>listProcessSuccessfulUsersTop_jsp.java<|end_file_name|><|fim▁begin|>package com.sapienter.jbilling.client.jspc.user;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.sapienter.jbilling.client.util.Constants;
public final class listProcessSuccessfulUsersTo... | int _jspx_eval_html_005fmessages_005f0 = _jspx_th_html_005fmessages_005f0.doStartTag();
|
<|file_name|>yaxis.js<|end_file_name|><|fim▁begin|>const alter = require('../lib/alter.js');
const Chainable = require('../lib/classes/chainable');
module.exports = new Chainable('yaxis', {
args: [
{
name: 'inputSeries',
types: ['seriesList']
},
{
name: 'yaxis',
types: ['number', ... | eachSeries._global = eachSeries._global || {}; |
<|file_name|>express.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var express = require('express'),
consolidate = require('consolidate'),
mongoStore = require('connect-mongo')(express),
flash = require('connect-flash'),
helpers = require('view-helpers'),
assetmanage... | // Log it
console.error(err.stack);
|
<|file_name|>slackbuild.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# slackbuild.py file is part of slpkg.
# Copyright 2014-2015 Dimitris Zlatanidis <d.zlatanidis@gmail.com>
# All rights reserved.
# Slpkg is a user-friendly package manager for Slackware installations
# https://github.c... | |
<|file_name|>InPlaceEdit.js<|end_file_name|><|fim▁begin|>YUI.add("inputex-inplaceedit", function(Y){
var lang = Y.Lang;//, Event = YAHOO.util.Event, Dom = YAHOO.util.Dom, CSS_PREFIX = 'inputEx-InPlaceEdit-';
/**
* Meta field providing in place editing (the editor appears when you click on the formatted value).
... | |
<|file_name|>15.2.3.6-3-29.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Ecma International. All rights reserved.
// Ecma International makes this code available under the terms and conditions set
// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
// "Use Terms"). Any redistribution... | |
<|file_name|>object.js<|end_file_name|><|fim▁begin|>/**
* 在球场
* zaiqiuchang.com
*/
const initialState = {
users: {},
posts: {},
courts: {},
files: {},
userStats: {},
postStats: {},
courtStats: {},<|fim▁hole|> fileStats: {}
}
export default (state = initialState, action) => {
if (action.type === 'C... | |
<|file_name|>validation.go<|end_file_name|><|fim▁begin|>package validation
import (
"fmt"
"net"
"net/url"
"os"
"strings"
"github.com/go-ldap/ldap"
"github.com/spf13/pflag"
kvalidation "k8s.io/kubernetes/pkg/api/validation"
"k8s.io/kubernetes/pkg/util/fielderrors"
"k8s.io/kubernetes/pkg/util/sets"
"github... | |
<|file_name|>plot_forest.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from os import listdir
<|fim▁hole|>colorarray = np.random.random_sample((10000, 3))
for f in files:
size = int(f.split('-')[0])
x, y, c = np.loadtxt('./data/plots/' +... | files = listdir('./data/plots/') |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from __future__ import print_function<|fim▁hole|>from django.conf.urls import * # NOQA
from django.conf.urls.i18n import i18n_patterns
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin
from django.conf import settings
... | from cms.sitemaps import CMSSitemap |
<|file_name|>rm.py<|end_file_name|><|fim▁begin|># Short help
def display_summary():
print("{:<13}{}".format( 'rm', "Removes a previously copied SCM Repository" ))<|fim▁hole|>USAGE="""
Removes a previously 'copied' repository
===============================================================================
usage: evie... |
# DOCOPT command line definition |
<|file_name|>report.service.ts<|end_file_name|><|fim▁begin|>import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';<|fim▁hole|>export class ReportService {
constructor (private http: HttpClient, private global: GlobalService) {
}
public postReport (data: FormData): O... | import { Observable } from 'rxjs/Observable';
import { GlobalService } from '../service/global.service';
@Injectable() |
<|file_name|>bloom9.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library 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 ... | bin.Or(bin, bloom9(b[:]))
} |
<|file_name|>test_game.ts<|end_file_name|><|fim▁begin|>/* eslint-disable no-self-assign */
import Game from '../../../../gui/html/js/game';
import { Plugin } from '../../../../gui/html/js/plugin';
import Translator from '../../../../gui/html/js/translator';
jest.mock('../../../../gui/html/js/dom');
jest.mock('../../.... | version: '1.0',
isActive: true, |
<|file_name|>get_item_details.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, throw
from frappe.utils import flt, cint, add_days, cs... | serial_no = get_serial_no(args) |
<|file_name|>monitor_correction_test.py<|end_file_name|><|fim▁begin|># Copyright 2014 Diamond Light Source Ltd.
#
# 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/l... | unittest.main() |
<|file_name|>exporter_spec.js<|end_file_name|><|fim▁begin|>/*globals describe, afterEach, beforeEach, it*/
var should = require('should'),
sinon = require('sinon'),
Promise = require('bluebird'),
// Stuff we're testing
db = require('../../server/data/db'),
errors = require('../..... | knexMock.getCall(0).should.be.calledWith('posts');
knexMock.getCall(1).should.be.calledWith('users');
knexMock.getCall(2).should.be.calledWith('roles');
knexMock.getCall(3).should.be.calledWith('roles_users'); |
<|file_name|>balances.go<|end_file_name|><|fim▁begin|>/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
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 ... | |
<|file_name|>global.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The etcd 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... | |
<|file_name|>app.ts<|end_file_name|><|fim▁begin|>/// <reference path="../framework/angular.d.ts"/>
/// <reference path="../controllers/home-controller.ts"/>
/// <reference path="./factories/gamevars-factory.ts"/>
/// <reference path="./factories/work-factory.ts"/>
/// <reference path="./factories/food-factory.ts"/>
///... | |
<|file_name|>EuropeanaExtractor.java<|end_file_name|><|fim▁begin|>/*
* WANDORA
* Knowledge Extraction, Management, and Publishing Application
* http://wandora.org
*
* Copyright (C) 2004-2016 Wandora Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Gen... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 VIB/BEG/UGent - Tim Diels <tim@diels.me>
#
# This file is part of pytil.
#
# pytil 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, ... | '''
Assert dir unchanged after code block. |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(slice_patterns)]
use std::io;
use std::io::Read;
use std::fs::{self, OpenOptions};
mod engine;
use engine::BrainFuck;
use std::env;<|fim▁hole|> let program = if let Ok(f) = fs::metadata(&src) {
if f.is_file() {
let mut s =... |
fn main() {
if let Some(src) = env::args().skip(1).take(1).next() { |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>import csv
import datetime
import logging
import os
from celery.task import task
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.timezone import now
from libya_elections.constants import REMINDER_CHECKIN, REMINDER_RE... | |
<|file_name|>extenv-not-defined-default.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<|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LIC... | // http://rust-lang.org/COPYRIGHT. |
<|file_name|>dbscan_.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
"""
# Author: Robert Layton <robertlayton@gmail.com>
#
# License: BSD
import warnings
import numpy as np
from ..base import BaseEstimator
from ..metrics import pairwise... | |
<|file_name|>0011_auto__add_fare__add_unique_fare_source_fare_id__add_unique_shape_sourc.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
... | def backwards(self, orm):
|
<|file_name|>simulation_test.go<|end_file_name|><|fim▁begin|>package wrapper
import (
"encoding/json"
"testing"
"github.com/SpectoLabs/hoverfly/core/handlers/v2"
"github.com/SpectoLabs/hoverfly/core/matching/matchers"
. "github.com/onsi/gomega"
)
func Test_ExportSimulation_GetsModeFromHoverfly(t *testing.T) {
... | |
<|file_name|>test_t1197_telem.py<|end_file_name|><|fim▁begin|>import json
import pytest
from common.utils.attack_utils import ScanStatus
from infection_monkey.model import VictimHost
from infection_monkey.telemetry.attack.t1197_telem import T1197Telem
DOMAIN_NAME = "domain-name"
IP = "127.0.0.1"
MACHINE = VictimHost... | "usage": USAGE_STR,
} |
<|file_name|>pyRona.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# Copyright 2016-2018 Francisco Pina Martins <f.pinamartins@gmail.com>
# This file is part of pyRona.
# pyRona 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 ... | else:
self.avg_ronas += [np.nan] |
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
from tests import mongoutils
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | },
MONGO_DATABASES={ |
<|file_name|>i16.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/licenses/LI... | unsafe {
let (x, y) = intrinsics::i16_sub_with_overflow(*self, *v);
if y { None } else { Some(x) }
} |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-13 18:08
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
... |
operations = [
migrations.CreateModel( |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for meetingroom project.
This module contains the WSGI application used by Django's development server<|fim▁hole|>named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usu... | and any production WSGI deployments. It should expose a module-level variable |
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use super::timestamp::TimeStamp;
use bitflags::bitflags;
use byteorder::{ByteOrder, NativeEndian};
use collections::HashMap;
use kvproto::kvrpcpb;
use std::fmt::{self, Debug, Display, Formatter};
use t... | pub fn from_raw_maybe_unbounded(key: &[u8]) -> Option<Key> {
if key.is_empty() {
None |
<|file_name|>AstVisitor.java<|end_file_name|><|fim▁begin|>package yokohama.unit.ast;
public abstract class AstVisitor<T> {
public abstract T visitGroup(Group group);
public abstract T visitAbbreviation(Abbreviation abbreviation);
public T visitDefinition(Definition definition) {
return definition.a... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import stripe <|fim▁hole|>from django.http import HttpResponse
from django.shortcuts import render
from django.views.generic import TemplateView, DetailView, ListView
from carton.cart import Cart
from .models import Sale, SaleProduct, SaleError
from products.models i... | import json
from django.conf import settings |
<|file_name|>socialevents.client.routes.js<|end_file_name|><|fim▁begin|>'use strict';
// Setting up route
angular.module('socialevents').config(['$stateProvider',
function($stateProvider) {
// SocialEvents state routing
$stateProvider.
state('listSocialEvents', {
url: '/socialevents',
templateUrl: 'module... | }).
state('createSocialEvent', {
url: '/socialevents/create', |
<|file_name|>ServiceContext.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012-2017 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License ... | UriBuilder getServiceUriBuilder();
/** Get UriBuilder which already contains base URI of RESTful application. */ |
<|file_name|>A_out.js<|end_file_name|><|fim▁begin|>public class X {
void bar() {
for (final int i; 0 < (i = 1); i = i + 1) {
}
}
}
<|fim▁hole|>//public class X {
// public static void main(String[] args) {
// final int i;
// for ( ; ; i = 1)
// break;
// i = 1;
// }
//}
//public class X... | |
<|file_name|>client-common.ts<|end_file_name|><|fim▁begin|>/*! *****************************************************************************
Copyright (c) 2016 Tangra 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 c... |
public static configureClientAuthAppDelegate(): void {
// nothing to do by default
} |
<|file_name|>privacy_reexport.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<|fim▁hole|>// <LICENSE-... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(path_ext)]
extern crate delivery;
extern crate rustc_serialize;
extern crate tempdir;
#[macro_use] extern crate log;
// Thanks, Cargo.
macro_rules! test {
($name:ident $expr:expr) => (
#[test]
fn $name() {
setup();
... | Ok(val) => val,
Err(e) => {
panic!("{:?}", e)
} |
<|file_name|>astropyautosummary.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This sphinx extension builds off of `sphinx.ext.autosummary` to
clean up some issues it presents in the Astropy docs.
The main issue this fixes is the summary tables getting cut off befor... | env = self.state.document.settings.env
prefixes = get_import_prefixes_from_env(env)
|
<|file_name|>buffer.js<|end_file_name|><|fim▁begin|>var buf = new Buffer(39);
var len = buf.write("www.baidu.com");
<|fim▁hole|>}
var json = buf.toJSON();
console.log(json);<|fim▁end|> | console.log("写入字节数为 : "+len);
for(var i=13;i < 39;i++){
buf[i] = i+84; |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from "./graphic";<|fim▁end|> | |
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>"""
Test models, managers, and validators.
"""
from __future__ import absolute_import, division, unicode_literals
import six
from completion import models, waffle
from completion.test_utils import CompletionWaffleTestMixin, submit_completions_for_testing
from d... | with self.assertNumQueries(SELECT + UPDATE + 4 * SAVEPOINT):
_, isnew = models.BlockCompletion.objects.submit_completion( |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>import random, copy
<|fim▁hole|>def grade(data):
raise Exception('deliberately broken grading function')<|fim▁end|> | def generate(data):
data['correct_answers']['x'] = 3
|
<|file_name|>pg_psql.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from django.core.management.base import BaseCommand, CommandError
import subprocess
from pgrunner import bin_path
from pgrunner.commands import get_port
class Command(BaseCommand):
help = 'Run psql with correct database'
def run_from_argv(self... | from __future__ import absolute_import, division, print_function, unicode_literals |
<|file_name|>toString_test.js<|end_file_name|><|fim▁begin|>import { run } from '@ember/runloop';
import { guidFor, setName } from 'ember-utils';
import { context } from 'ember-environment';
import EmberObject from '../../../lib/system/object';
import Namespace from '../../../lib/system/namespace';
import { moduleFor, A... | |
<|file_name|>core_macro_forms.rs<|end_file_name|><|fim▁begin|>use crate::{
ast,
ast::Ast,
ast_walk::{
LazyWalkReses,
WalkRule::{Body, LiteralLike, NotWalked},
},
beta::{Beta, Beta::*, ExportBeta},
core_forms::{strip_ee, strip_ql},
core_type_forms::{less_quoted_ty, more_quoted... | name: n("extend_syntax"),
grammar: Rc::new(form_pat!(
[(lit "extend_syntax"),
(extend |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.