prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>brand.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(installed... | ], |
<|file_name|>node.rs<|end_file_name|><|fim▁begin|>use std::fs::{ create_dir, read_dir };
use std::mem::{ MaybeUninit };
use std::path::{ Path, PathBuf };
use std::ptr::{ null_mut };
use std::sync::mpsc::{ channel, Sender, Receiver, TryRecvError };
use std::thread::{ sleep, spawn, JoinHandle };
use std::time::{ Duration... | user: Id,
) -> Result<SystemInformation, ErrorResponse> {
let admin_system_information = { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2012-2014, John Haddon. All rights reserved.
# Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary form... | from TextTest import TextTest
from MapProjectionTest import MapProjectionTest
from MapOffsetTest import MapOffsetTest |
<|file_name|>ccdetect.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2020 Matthew Waters <matthew@centricular.com>
//
// 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; either
// versi... | }
#[test]
fn test_have_cdp_notify() { |
<|file_name|>maShape.cc<|end_file_name|><|fim▁begin|>/******************************************************************************
Copyright 2013 Scientific Computation Research Center,
Rensselaer Polytechnic Institute. All rights reserved.
The LICENSE file included with this distribution describes the te... | tet = 0;
fixer = 0;
} |
<|file_name|>interface.d.ts<|end_file_name|><|fim▁begin|>/* eslint-disable max-len */
declare global {
namespace Kloudless.filePicker {
function picker(options: ChooserOptions | SaverOptions): Picker;
function dropzone(options: DropzoneOptions): Dropzone;
function getGlobalOptions(): BuildOptions;
f... | name: string;
size: number;
mime_type: string; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from share.transform.chain.exceptions import * # noqa
from share.transform.chain.links import * # noqa
from share.transform.chain.parsers import * # noqa<|fim▁hole|>
# Context singleton to be used for parser definitions
# Class SHOULD be thread safe
# Accessing s... | from share.transform.chain.transformer import ChainTransformer # noqa
from share.transform.chain.links import Context
|
<|file_name|>account.py<|end_file_name|><|fim▁begin|>from collections import ChainMap
from django.conf import settings
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import render, redirect, resolve_url
from django.contrib import messages
from django.contrib.auth import REDIRECT_FIELD_NAME
from... | formset_class = UpdateAddressFormSet |
<|file_name|>ChangeDirectionExecute.java<|end_file_name|><|fim▁begin|>package commands.executes;
import agents.Agent;
import agents.Robot;
import agents.Speed;
import agents.Vacuum;
import commands.AgentCommand;
import commands.AgentCommandVisitor;
import commands.FieldCommand;
import commands.NoFieldCommandException;... | public FieldCommand getFieldCommand() throws NoFieldCommandException {
throw new NoFieldCommandException();
}
|
<|file_name|>optimize.py<|end_file_name|><|fim▁begin|>#__docformat__ = "restructuredtext en"
# ******NOTICE***************
# optimize.py module by Travis E. Oliphant
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************... | |
<|file_name|>GraphService.java<|end_file_name|><|fim▁begin|>package com.github.weeniearms.graffiti;
import com.github.weeniearms.graffiti.config.CacheConfiguration;
import com.github.weeniearms.graffiti.generator.GraphGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.... |
@Cacheable(CacheConfiguration.GRAPH)
public byte[] generateGraph(String source, GraphGenerator.OutputFormat format) throws IOException { |
<|file_name|>Settings.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import List from 'react-toolbox/lib/list/List';
import ListSubHeader from 'react-toolbox/lib/list/ListSubHeader';
import ListCheckbox from 'react-toolbox/lib/list/ListCheckbox';
import ListItem from 'react-toolbox/lib/list/L... | import ConnectedStoreHOC from '../utils/connect.store.hoc';
import * as Actions from '../utils/actions';
import { NEW_PHOTO_DURATIONS } from '../configs/constants';
|
<|file_name|>test_admin_actions.py<|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<|fim▁hole|># U... | # |
<|file_name|>test_weather.py<|end_file_name|><|fim▁begin|>"""Tests for Climacell weather entity."""
from __future__ import annotations
from datetime import datetime
import logging
from typing import Any
from unittest.mock import patch
import pytest
from homeassistant.components.climacell.config_flow import (
_ge... | |
<|file_name|>gallery.component.spec.ts<|end_file_name|><|fim▁begin|>/* tslint:disable:no-unused-variable */
<|fim▁hole|>import { RouterTestingModule } from '@angular/router/testing';
import { SharedModule } from './../../shared/shared.module';
import { StoreService } from './../../core/store.service';
import { ScoreSer... | import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { StoreModule } from '@ngrx/store'; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>).
# All Rights Res... | # Luis Escobar <luis@vauxoo.com>
# Planified by: Nhomar Hernandez
# Finance by: Vauxoo, C.A. http://vauxoo.com
# Audited by: Humberto Arocha humberto@openerp.com.ve |
<|file_name|>poincare.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Jayant Jain <jayantjain1992@gmail.com>
# Copyright (C) 2017 Radim Rehurek <me@radimrehurek.com>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""Python implementation of Poincaré... | |
<|file_name|>classifier.py<|end_file_name|><|fim▁begin|>"""
Module containing MPG Ranch NFC coarse classifier, version 3.1.
An NFC coarse classifier classifies an unclassified clip as a `'Call'`
if it appears to be a nocturnal flight call, or as a `'Noise'` otherwise.
It does not classify a clip that has already been ... | |
<|file_name|>unique-decl-init-copy.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.apac... | // Should be a copy |
<|file_name|>sourceMap-InterfacePrecedingVariableDeclaration1.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>// @sourcemap: true
interface I {}
var x = 0;<|fim▁end|> | // @target: ES3
|
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for React Router 4.0
// Project: https://github.com/ReactTraining/react-router
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Huy Nguyen <https://github.com/huy-nguyen>
// Definitions: https://github.com/Definit... | |
<|file_name|>fix_ssa_opcalls.rs<|end_file_name|><|fim▁begin|>//! Fixes the call target for all call sites in the SSA
//! For every [`OpCall`] SSA node in every function, try to find that call
//! site's corresponding edge in [the callgraph] and replace the "target"
//! operand of the SSA node with a constant value for ... | |
<|file_name|>hook-sysconfig.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full... | if hasattr(sysconfig, 'get_makefile_filename'):
# sysconfig.get_makefile_filename is missing in Python < 2.7.9
_MAKEFILE = sysconfig.get_makefile_filename() |
<|file_name|>fstree.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
from fs.opener import opener
from fs.commands.runner import Command
from fs.utils import print_fs
class FSTree(Command):
usage = """fstree [OPTION]... [PATH]
Recursively display the contents of PATH in an ascii tree"""
... | args = ['.']
for fs, path, is_dir in self.get_resources(args, single=True):
if not is_dir: |
<|file_name|>base.js<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
$(document).ready(function(){
var div = document.getElementById('content');
var div1 = document.getElementById('leftbox');
div.style.height = document.body.c... | }); |
<|file_name|>uk.js<|end_file_name|><|fim▁begin|>(function($) {
$.Redactor.opts.langs['uk'] = {
html: 'Код',
video: 'Відео',
image: 'Зображення',
table: 'Таблиця',
link: 'Посилання',
link_insert: 'Вставити посилання ...',
link_edit: 'Edit link',
unlink:... | anchor: 'Anchor', |
<|file_name|>test_storage.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright 2015 rpaas authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
<|fim▁hole|>
from rpaas import plan, storage
class MongoDBStorageTestCase(unittest.TestC... | import unittest |
<|file_name|>picker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# This code is available for use under CC0 (Creative Commons 0 - universal).
# You can copy, modify, distribute and perform the work, even for commercial
# purposes, all without asking permission. For more information, see LICENSE.md or
# https://c... | |
<|file_name|>node.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<|fim▁hole|> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Traits that nodes must implement. Breaks the othe... | |
<|file_name|>edsl.rs<|end_file_name|><|fim▁begin|>//! Holmes EDSL
//!
//! This module provides a set of macros for more easily writing Holmes
//! programs, avoiding manual construction of all tye types required.
/// Converts an EDSL type specification into a Holmes type object
/// Takes the name of a variable containi... | }) |
<|file_name|>LinkedHashMapFactory.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2009 Aleksandar Seovic
*
* 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/... | * instance.
*
* @author Aleksandar Seovic 2010.11.08 |
<|file_name|>subsetOf.ts<|end_file_name|><|fim▁begin|>import { Collection, CollectionConstructor } from '../collection';
import { define, tools } from '../object-plus';
import { AggregatedType, ChainableAttributeSpec, Record, type } from '../record';
import { ItemsBehavior, transactionApi } from '../transactions';
impo... |
_metatype : AggregatedType
get __inner_state__(){ return this.refs || this.models; } |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>import json
from prismriver import util, main
class SongJsonEncoder(json.JSONEncoder):
def default(self, o):
return o.__dict__
def format_output(songs, output_format, txt_template=None):
if output_format == 'txt':
formatted_songs = []
... | |
<|file_name|>npo.py<|end_file_name|><|fim▁begin|>import logging
import json
import os
import re
#from pprint import pprint
#from itertools import count
from urlparse import urljoin
from lxml import html
from thready import threaded
import requests
from scrapekit.util import collapse_whitespace
from connectedafrica.sc... | data['category'] = text
next_heading = 'legal_form'
elif next_heading == 'legal_form':
data['legal_form'] = text |
<|file_name|>web.py<|end_file_name|><|fim▁begin|>"""
Nodes that use web services to do something.
"""
import json
import httplib2
import urllib
from BeautifulSoup import BeautifulSoup
from nodetree import node, exceptions
from . import base
from .. import stages
class WebServiceNodeError(exceptions.NodeError):
... | class MashapeProcessing(BaseWebService):
"""Mashape entity extraction."""
stage = stages.POST
baseurl = "http://text-processing.com/api/" |
<|file_name|>SwiftIntTypes.py<|end_file_name|><|fim▁begin|># ===--- SwiftIntTypes.py ----------------------------*- coding: utf-8 -*-===//
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Ru... | |
<|file_name|>builder.rs<|end_file_name|><|fim▁begin|>use rustc_index::vec::IndexVec;
use rustc_middle::mir::tcx::RvalueInitializationState;
use rustc_middle::mir::*;
use rustc_middle::ty::{self, TyCtxt};
use smallvec::{smallvec, SmallVec};
use std::iter;
use std::mem;
use super::abs_domain::Lift;
use super::IllegalMo... | | TerminatorKind::GeneratorDrop
| TerminatorKind::Unreachable => {}
TerminatorKind::Assert { ref cond, .. } => { |
<|file_name|>angularfire-tests.ts<|end_file_name|><|fim▁begin|>/// <reference path="angularfire.d.ts"/>
var myapp = angular.module("myapp", ["firebase"]);
interface AngularFireScope extends ng.IScope {
data: any;
}
var url = "https://myapp.firebaseio.com";
myapp.controller("MyController", ["$scope", "$firebase"... | email: 'my@email.com',
password: 'mypassword' |
<|file_name|>procurement_pull.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or mod... | |
<|file_name|>setcounter.go<|end_file_name|><|fim▁begin|>package core
import (
"github.com/MG-RAST/AWE/lib/core/cwl"
"github.com/MG-RAST/AWE/lib/logger"
)
type SetCounter struct {
Counter []int
Max []int
NumberOfSets int
Scatter_type string
//position_in_counter int
}<|fim▁hole|>func NewSetCounter... | |
<|file_name|>witness.go<|end_file_name|><|fim▁begin|>package client
import (<|fim▁hole|> "github.com/docker/notary/client/changelist"
"github.com/docker/notary/tuf"
"github.com/docker/notary/tuf/data"
)
// Witness creates change objects to witness (i.e. re-sign) the given
// roles on the next publish. One change is... | |
<|file_name|>cmd_from_callable.py<|end_file_name|><|fim▁begin|>from doit.action import CmdAction
def task_hello():
"""hello cmd """
def create_cmd_string():
return "echo hi"
return {<|fim▁hole|><|fim▁end|> | 'actions': [CmdAction(create_cmd_string)],
'verbosity': 2,
} |
<|file_name|>MeshComponent.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2014 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1... | * @return <p>
* An ArrayList of all Polygons in the MeshComponent that are |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>"""
Views for contract feature
"""
import logging
from edxmako.shortcuts import render_to_response
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
from django.shortcuts import redirect
from django.core.urlresolvers import... | |
<|file_name|>strip_icc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from thumbor.... |
class Filter(BaseFilter):
@filter_method() |
<|file_name|>uint_macros.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.or... |
#[test]
pub fn test_to_str() {
assert_eq!((0 as $T).to_str_radix(10u), "0".to_owned()); |
<|file_name|>pathfinders.py<|end_file_name|><|fim▁begin|>from molpher.algorithms.functions import find_path
from molpher.core import ExplorationTree as ETree
class BasicPathfinder:
"""
:param settings: settings to use in the search
:type settings: `Settings`
A very basic pathfinder class that can be ... | class MaxItersReachedException(Exception):
def __init__(self, tree): |
<|file_name|>toast.d.ts<|end_file_name|><|fim▁begin|>import * as React from "react";
import { IActionProps, IIntentProps, IProps } from "../../common/props";
export interface IToastProps extends IProps, IIntentProps {
/**
* Action to display in a minimal button. The toast is dismissed automatically when the
... | render(): JSX.Element;
componentDidMount(): void; |
<|file_name|>compute_squared_distance.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::animate::{AnimationFieldAttrs, A... | |
<|file_name|>0030_auto__add_field_agency_alias.py<|end_file_name|><|fim▁begin|># -*- coding: 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):
# Adding field 'Agency.alias'
... | 'position': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'})
},
'lobbyingph.exp_indirect_comm': { |
<|file_name|>version.py<|end_file_name|><|fim▁begin|>import sys
import platform
<|fim▁hole|>import twisted
import scrapy
from scrapy.command import ScrapyCommand
class Command(ScrapyCommand):
def syntax(self):
return "[-v]"
def short_desc(self):
return "Print Scrapy version"
def add_opt... | |
<|file_name|>LoadApp.py<|end_file_name|><|fim▁begin|>from .SlackIntegration import slackIntegration
import logging
from aiohttp import ClientSession
import asyncio
from time import perf_counter
class LoadApp():
def __init__(self):
self.logger = logging.getLogger('reliability')
self.app_visit_succe... |
async def get(self, url):
# To simulate differnt users accessing same app, do not reuse session |
<|file_name|>db.rs<|end_file_name|><|fim▁begin|>use sled;
use std::path::PathBuf;
pub struct DB {
tree: sled::Tree,
}
impl DB {
pub fn open(path: String) -> Self {
let db_path = PathBuf::from(&path);
let cfg = sled::Config::default()
.path(path.to_owned())
.use_compres... |
}
} |
<|file_name|>PanoramioPlugin.cpp<|end_file_name|><|fim▁begin|>//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2009 Bastian Holst <b... |
void PanoramioPlugin::initialize()
{
setModel( new PanoramioModel( marbleModel(), this ) ); |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use super::*;
// Ensure serialization of MessagingProtocolVersion enum takes 1 byte.
#[test]
fn net_protocol() -> bcs::Result<()> {
let protocol = MessagingProtocolVersion::V1;
... | |
<|file_name|>TableCustomConfig.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2014-2015 LinkedIn Corp. (pinot-core@linkedin.com)
*
* 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
*... | if (LOGGER.isWarnEnabled()) {
LOGGER.warn("Caught exception while processing field " + field, ex);
}
} |
<|file_name|>enrich_intersection_points.hpp<|end_file_name|><|fim▁begin|>// Boost.Geometry (aka GGL, Generic Geometry Library)
// Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands.
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0. (See accompanying file L... | |
<|file_name|>main_test.go<|end_file_name|><|fim▁begin|>package main
import (
"bytes"
"context"
"log"
"net/http"
"net/http/httptest"
"strings"
"testing"
"time"
strings_app "github.com/utrack/clay/integration/client_cancel_request/app/strings"
strings_pb "github.com/utrack/clay/integration/client_cancel_reque... | |
<|file_name|>Router.js<|end_file_name|><|fim▁begin|>var express = require('../')
, Router = express.Router
, request = require('./support/http')
, methods = require('methods')
, assert = require('assert');
describe('Router', function(){
var router, app;
beforeEach(function(){
router = new Router;
... | |
<|file_name|>SiltEffect.cpp<|end_file_name|><|fim▁begin|>/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later versio... | return;
}
if (nv.getVisitorType() == osg::NodeVisitor::NODE_VISITOR)
|
<|file_name|>test_fastq.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this ... | (get_data_path('longreads_original_sanger.fastq'), |
<|file_name|>csssupportsrule.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/. */
use cssparser::{Parser, ParserInput};<|fim▁hole|>use ... | use dom::bindings::codegen::Bindings::CSSSupportsRuleBinding; |
<|file_name|>refcounted.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/. */
//! A generic, safe mechanism by which DOM objects can be ... | {
let table = live_references.promise_table.borrow_mut(); |
<|file_name|>replication_lib.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""An implementation of the ReplicationConfig proto interface."""
fr... | |
<|file_name|>JdkHelper.ts<|end_file_name|><|fim▁begin|>/*
* Copyright 2019 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.apach... | Promise<Result<string, ValidatePathError>> { |
<|file_name|>proxyhandler.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/. */
//! Utilities for the implementation of JSAPI proxy hand... | use js::glue::{GetProxyHandler, SetProxyExtra};
use js::jsapi::GetObjectProto;
use js::jsapi::{Handle, HandleId, HandleObject, MutableHandle, ObjectOpResult, RootedObject}; |
<|file_name|>archive.js<|end_file_name|><|fim▁begin|>import React from "react"
import { Link, graphql } from "gatsby"
import Bio from "../components/bio"
import Layout from "../components/layout"
import SEO from "../components/seo"
import { rhythm } from "../utils/typography"
class BlogIndex extends React.Component {... | |
<|file_name|>zepto.js<|end_file_name|><|fim▁begin|>/*!
* CanJS - 1.1.4 (2013-02-05)
* http://canjs.us/
* Copyright (c) 2013 Bitovi
* Licensed MIT
*/
define(['can/util/can', 'zepto', 'can/util/object/isplain', 'can/util/event', 'can/util/fragment', 'can/util/deferred', 'can/util/array/each'], function (can) {
var $ = Z... | function setData(node, name, value) {
var id = node[exp] || (node[exp] = ++uuid),
store = data[id] || (data[id] = {}); |
<|file_name|>BackendTarget.java<|end_file_name|><|fim▁begin|>/* This file is part of VoltDB.
* Copyright (C) 2008-2013 VoltDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, e... | NATIVE_EE_IPC("ipc", true), |
<|file_name|>recover.py<|end_file_name|><|fim▁begin|>import sys
import zmq
import tnetstring
command_uri = sys.argv[1]
sock = zmq.Context.instance().socket(zmq.REQ)
sock.connect(command_uri)
req = {'method': 'recover'}
sock.send(tnetstring.dumps(req))<|fim▁hole|>if not resp.get('success'):
raise ValueError('request... |
resp = tnetstring.loads(sock.recv()) |
<|file_name|>sqlstring_test.py<|end_file_name|><|fim▁begin|>import unittest
import wire
<|fim▁hole|> '''Sets up the test case'''
self.sql = wire.SQLString
def test_pragma(self):
'''Tests the PRAGMA SQL generation'''
self.assertEqual(self.sql.pragma("INTEGRITY_CHECK(10)"), "PRAGMA INTEGRITY_CHECK(10)")
self.a... | class TestSQLString(unittest.TestCase):
def setUp(self): |
<|file_name|>axe.config.js<|end_file_name|><|fim▁begin|>/*jshint node: true*/
'use strict';
// Defaults derived from: https://github.com/dequelabs/axe-core
const defaults = {
rules: {
'area-alt': { 'enabled': true },
'audio-caption': { 'enabled': true },
'button-name': { 'enabled': true },
'document-... | 'marquee': { 'enabled': true },
'meta-viewport': { 'enabled': true },
'meta-viewport-large': { 'enabled': true } |
<|file_name|>view.js<|end_file_name|><|fim▁begin|>function BxTimelineView(oOptions) {
this._sActionsUri = oOptions.sActionUri;
this._sActionsUrl = oOptions.sActionUrl;
this._sObjName = oOptions.sObjName == undefined ? 'oTimelineView' : oOptions.sObjName;
this._iOwnerId = oOptions.iOwnerId == undefined ? 0 ... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io::{self, Read};
mod smtp_parser;<|fim▁hole|>
let mut buffer = String::new();
io::stdin()
.read_to_string(&mut buffer)
.expect("Could not read input");
match smtp_parser::session(&buffer) {
Ok(r) => pr... |
fn main() {
println!("Hello, type some SMTP and press ctrl+d"); |
<|file_name|>queues.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Queue definitions.
This module defines the queues where a worker may look for work.
"""
from grr_response_core.lib import rdfvalue
# Queues that a standard worker should work from, highest priority first.
#
# "W" and "CA" are deprecated, b... | WORKER_LIST = list(map(rdfvalue.RDFURN, ["CA", "W", "E", "F", "H", "S"]))
# The normal queue for enrollment messages.
ENROLLMENT = rdfvalue.RDFURN("E") |
<|file_name|>de.py<|end_file_name|><|fim▁begin|># Authors: David Goodger; Gunnar Schwant
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 21817 $
# Date: $Date: 2005-07-21 13:39:57 -0700 (Thu, 21 Jul 2005) $
# Copyright: This module has been placed in the public domain.
# New language mappings... | 'widmung': 'dedication',
'zusammenfassung': 'abstract'}
"""German (lowcased) to canonical name mapping for bibliographic fields.""" |
<|file_name|>dockets.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import logging
from uuid import uuid1
import dockets.queue
import dockets.error_queue
from .base import Queue
class DocketsQueue(Queue):
def __init__(self, redis_client, queue_name, wait_time, timeout):
self.queu... | return [(envelope, True) for envelope in envelopes]
|
<|file_name|>test_monitors.py<|end_file_name|><|fim▁begin|># Copyright 2015 Huawei Technologies Co.,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/licenses/... | |
<|file_name|>battery_models.py<|end_file_name|><|fim▁begin|>import numpy as np
def min_max_model(power, use, battery_capacity):
"""
Minimal maximum battery model, obsoleted
:param power: Pandas TimeSeries, total power from renewable system
:param use: float, unit W fixed load of the power system
... | return LPSP |
<|file_name|>used_before_assignment_nonlocal.py<|end_file_name|><|fim▁begin|>"""Check for nonlocal and used-before-assignment"""
# pylint: disable=missing-docstring, unused-variable, no-init, too-few-public-methods
__revision__ = 0
def test_ok():
""" uses nonlocal """
cnt = 1
def wrap():
... | |
<|file_name|>authReducer.js<|end_file_name|><|fim▁begin|>import * as ActionTypes from '../constants/constants';
const initialState = {
isAuthenticated: false,
isFetching: false,
loaded: false,
message: ''
};
const authReducer = (state = initialState, action) => {
switch (action.type) {
case ActionTypes.... | |
<|file_name|>commands.go<|end_file_name|><|fim▁begin|>package docker
import (
"archive/tar"
"bufio"
"bytes"
"encoding/base64"
"encoding/json"
"errors"
"flag"
"fmt"
"github.com/dotcloud/docker/archive"
"github.com/dotcloud/docker/auth"
"github.com/dotcloud/docker/registry"
"github.com/dotcloud/docker/term"
... | receiveStdout = utils.Go(func() (err error) {
defer func() { |
<|file_name|>13287_cake.cc<|end_file_name|><|fim▁begin|>#include <bits/stdc++.h>
using namespace std;
#define DEBUG // comment this line to pull out print statements
#ifdef DEBUG
// completely copied from http://saadahmad.ca/cc-preprocessor-metaprogramming-2/
const char NEWLINE[] = "\n";
const char TAB[] = "\t";
#... | {
if (feof(stdin)) return false; |
<|file_name|>string_template_engine.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Provide the standard Python string.Template engine."""
from __future__ import absolute_import
from __future__ import print_function
from string import Template
from . import Engine
class StringTemplate(Engine):
"""Str... | return self.template.safe_substitute(mapping)
return self.template.substitute(mapping) |
<|file_name|>test_environment.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
import pytest
from django.core import mail
from django.db import connection
from pytest_django_test.app.models import Item
# It doesn't matter which order all the _again methods are run, we just need
# to check the e... |
def test_mail():
assert len(mail.outbox) == 0 |
<|file_name|>srv.rs<|end_file_name|><|fim▁begin|>extern crate anvil_server;
<|fim▁hole|><|fim▁end|> | fn main() {
anvil_server::server("\0anvil_uds").unwrap();
} |
<|file_name|>parseCrimeDataCoords.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import sys
import csv
import json
#test to make sure pyproj exists
try:
import pyproj
except ImportError:
sys.stderr.write("Please install the pyproj python module!\n")
sys.exit(3)
try:
from pymongo import MongoClien... | sys.exit(3)
|
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># Copyright (C) 2017 Xavier Lucas
#
# 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) an... | # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import getpass |
<|file_name|>IntegerColumnReferenceTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
* license agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership. Crate licenses
* this file to yo... |
@Override |
<|file_name|>_lonsrc.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class LonsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="lonsrc", parent_name="scattermapbox", **kwargs):
super(LonsrcValidator, self).__init__(
plotly_name=plotly_... | ) |
<|file_name|>UserRoleService.java<|end_file_name|><|fim▁begin|>package com.svcet.cashportal.service;
import com.svcet.cashportal.web.beans.UserRequest;
import com.svcet.cashportal.web.beans.UserRolesScreenRequest;
import com.svcet.cashportal.web.beans.UserRolesScreenResponse;
public interface UserRoleService {
User... | |
<|file_name|>alive_squids_csv.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# IkaLog
# ======
# Copyright (C) 2015 Takeshi HASEGAWA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | # See the License for the specific language governing permissions and
# limitations under the License. |
<|file_name|>vc.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2001 - 2015 The SCons Foundation
#
# 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 l... | except KeyError, e: |
<|file_name|>ldcmp1.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `LDCMP1` reader"]
pub struct R(crate::R<LDCMP1_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<LDCMP1_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<LDCMP1_SPEC>> for R ... | type Ux = u32;
} |
<|file_name|>CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_74b.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE193_char_memcpy_74b.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE193.label.xml
Template File: sources-s... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>'''Brainfuck interpreter'''
VERSION = '0.1.2.1103'
def __static_vars():
'''Decorate, add static attr'''
def decorate(func):
'''The decorate'''
setattr(func, 'stdin_buffer', [])
return func
return decorate
@__static_vars()
def _... | elif instruction == '-': |
<|file_name|>messages.py<|end_file_name|><|fim▁begin|># Copyright (C) 2007-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 F... |
:param message: The Message-ID of the mesage to delete from the store. |
<|file_name|>benchmark_base.rs<|end_file_name|><|fim▁begin|>// These functions are re-exported as public from lib.rs
// this makes them available to the benchmark crates in the workspace
use super::criterion::Criterion;
use super::rand::Rng;
use super::{<|fim▁hole|> DecodedEntity, Entity, ASCII_TEXT, UNICODE_TEXT,
}... | decoded_entities, entity_refs, render, render_chars, render_chars2,
render_chars_entity_references, render_chars_entity_references_to_chars, render_coords, |
<|file_name|>release.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
import re
import ast
import subprocess
import sys
from optparse import OptionParser
DEBUG = False
CONFIRM_STEPS = False
DRY_RUN = False
def skip_step():
"""
Asks for user's response whether to run... | push_tags_to_github()
upload_source_tarball() |
<|file_name|>tree_view_column.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
//! A widget that emits a signa... |
pub fn set_alignment(&self, x_align: f32) {
unsafe { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.