prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>pgoapi.py<|end_file_name|><|fim▁begin|>from logging import getLogger
from yarl import URL
from aiohttp import BasicAuth
try:
from aiosocks import Socks4Auth, Socks5Auth
except ImportError:
class Socks4Auth(Exception):
def __init__(*args, **kwargs):
raise ImportError(
... | |
<|file_name|>0031_premise_weight.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('premises', '0030_report_reason'),
]
operations = [
migratio... | ] |
<|file_name|>dashboard.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may... | |
<|file_name|>mount.py<|end_file_name|><|fim▁begin|>import sys
import socket
import fcntl
import struct
import random
import os
import shutil
import subprocess
import time
import csv
import ipaddress
# Run `python3 -m unittest discover` in this dir to execute tests
default_mount_options_nfs = "nfs hard,nointr,proto=tc... | number = number + 1
folder = "/media/secondarynfs" + str(number) |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use expectest::prelude::*;
use maplit::*;
use serde_json::json;
use crate::models::{headers_from_json, Interaction, OptionalBody, PactSpecification, Consumer, Provider, ReadWritePact, write... | // let x = rand::random::<u16>();
// dir.push(format!("pact_test_{}", x));
// dir.push(pact.default_file_name());
// |
<|file_name|>inventory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+<|fim▁hole|># | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ / | ... | # | ____ _ _ __ __ _ __ | |
<|file_name|>DefaultScene.cpp<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////////
// This source file is part of Hect.
//
// Copyright (c) 2016 Colin Hill
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and a... | |
<|file_name|>commands.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Module for pull and push command."""
import abc
from base64 import b64decode
import six
from six.moves import configparser
from ..core.api import API
from ..core.commands import AbstractCommand
from ..core.models.terminal import clean_orde... | password = self.prompt_password()
self.validate_password(password) |
<|file_name|>movie-result.directive.js<|end_file_name|><|fim▁begin|>angular.module('movieApp')
.directive('movieResult', function () {
var directive = {
restrict: 'E',
replace: true,
scope: {
result: '=result'
},
template: [
'<div class="row">',
'<div class="col-sm-4">',
'<img ng-src="{{resu... | };
return directive; |
<|file_name|>solver060.rs<|end_file_name|><|fim▁begin|>// COPYRIGHT (C) 2017 barreiro. All Rights Reserved.
// Rust solvers for Project Euler problems
use std::collections::HashMap;
use euler::algorithm::long::{concatenation, pow_10, square};
use euler::algorithm::prime::{generator_wheel, miller_rabin, prime_sieve};
... | set.iter().sum()
} |
<|file_name|>customwizardpage.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercia... | // Pre 2.2 Legacy: "combochoices" attribute with a comma-separated list, for |
<|file_name|>str-growth.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | |
<|file_name|>trayicon.cpp<|end_file_name|><|fim▁begin|>#include "trayicon.h"
#include <QApplication>
#include <QMenu>
#include <QTimer>
#include <conf/addressgroup.h>
#include <conf/appgroup.h>
#include <conf/confmanager.h>
#include <conf/firewallconf.h>
#include <form/controls/mainwindow.h>
#include <fortsettings.h>... | |
<|file_name|>20.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { Globe20 as default } from "../../"; |
<|file_name|>data.ts<|end_file_name|><|fim▁begin|>import { DataFrameDTO, FieldConfig } from './dataFrame';
import { DataTransformerConfig } from './transformations';
import { ApplyFieldOverrideOptions } from './fieldOverrides';
import { PanelPluginDataSupport } from '.';
import { DataTopic } from './query';
import { Da... | /** Used to track transformation ids that where part of the processing */
transformations?: string[];
/** Currently used to show results in Explore only in preferred visualisation option */ |
<|file_name|>RequestTrackingHostValveTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2009 Martin Grotzke
*
* 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... | when(_request.getMethod()).thenReturn("GET");
when(_request.getQueryString()).thenReturn(null);
when(_request.getContext()).thenReturn(_contextContainer); |
<|file_name|>TType2.java<|end_file_name|><|fim▁begin|>package rholang.parsing.delimc.Absyn; // Java Package generated by the BNF Converter.
public class TType2 extends TType {
public final Type type_1, type_2;
public TType2(Type p1, Type p2) { type_1 = p1; type_2 = p2; }
public <R,A> R accept(rholang.parsing.de... | return 37*(this.type_1.hashCode())+this.type_2.hashCode();
} |
<|file_name|>templateresponse.py<|end_file_name|><|fim▁begin|>import logging
from xml.dom.minidom import *
from jinja2 import Environment, Template<|fim▁hole|>
from edge.dateutility import DateUtility
from edge.opensearch.response import Response
class TemplateResponse(Response):
def __init__(self):
super... | |
<|file_name|>flatbuttonrenderer.js<|end_file_name|><|fim▁begin|>// Copyright 2008 The Closure Library Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ... | * @fileoverview Similiar functionality of {@link goog.ui.ButtonRenderer}, |
<|file_name|>app-config.js<|end_file_name|><|fim▁begin|>(function (angular) {
'use strict';
var config = {
githubApiUrl: 'https://api.github.com/',
};<|fim▁hole|>
angular.module('myGithubApp').constant('config', config);
})(angular);<|fim▁end|> | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export * from './selectInputs.component'; |
<|file_name|>resources.py<|end_file_name|><|fim▁begin|># coding: utf-8
import os
from UserDict import DictMixin
from fnmatch import fnmatch
from datetime import datetime
from datetime import date
import pytz
from pyramid.threadlocal import get_current_registry
from pyramid.traversal import resource_path
from sqlalche... |
class Banner(Base):
id = Column(Integer, primary_key=True) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
<|fim▁hole|># Django starts so that shared_task will use this app.
from .celery import app as celery_app<|fim▁end|> | from .local import Local # noqa
from .production import Production # noqa
# This will make sure the app is always imported when |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! The module contains implementations of HTTP/2 clients that could be
//! directly used to access HTTP/2 servers, i.e. send requests and read
//! responses.
pub use self::simple::SimpleClient;
pub use self::async::Client;
<|fim▁hole|>#[cfg(test)]mod tests;<|fim▁end|> | mod simple;
mod async; |
<|file_name|>partial_gpus.py<|end_file_name|><|fim▁begin|># File has been renamed.<|fim▁hole|>raise DeprecationWarning("This file has been renamed to `fractional_gpus.py` "
"in the same folder!")<|fim▁end|> | |
<|file_name|>pyds9_backend.py<|end_file_name|><|fim▁begin|>#_PYTHON_INSERT_SAO_COPYRIGHT_HERE_(2007)_
#_PYTHON_INSERT_GPL_LICENSE_HERE_
from itertools import izip
import numpy
import time
import ds9
from sherpa.utils import get_keyword_defaults, SherpaFloat
from sherpa.utils.err import DS9Err
_target = 'sherpa'
def ... | if _target in target:
return True |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>struct Inches {
pub inches: f64,
}
struct Feet {
pub ft: f64,
}
struct Yards {
pub yd: f64,
}
impl Into <Feet> for Inches {
fn into (self) -> Feet {
Feet { ft: self.inches / 12.0 }
}
}
impl Into <Yards> for Inches {
fn into (self) -> Yards {
Yards { yd: se... | } |
<|file_name|>dpdk.hh<|end_file_name|><|fim▁begin|>/*
* This file is open source software, licensed to you under the terms
* of the Apache License, Version 2.0 (the "License"). See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. You may not use this file exc... | /** |
<|file_name|>test_gvar.py<|end_file_name|><|fim▁begin|>"""
test-gvar.py
"""
# Copyright (c) 2012-20 G. Peter Lepage.
#
# 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 Li... | def test_cov(g):
if hasattr(g, 'keys'):
g = BufferDict(g) |
<|file_name|>argumentsparser.py<|end_file_name|><|fim▁begin|>import argparse
import select
<|fim▁hole|>
def parse_args(args, input):
parser = argparse.ArgumentParser()
parser.add_argument('--url', help="URL of the target data-set",
required=True)
parser.add_argument('--token', help="... | def no_piped_input(arguments):
inputs_ready, _, _ = select.select([arguments.file], [], [], 0)
return not bool(inputs_ready) |
<|file_name|>txindex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test txindex generation and fetching
#
import t... |
signed_tx = self.nodes[0].signrawtransaction(binascii.hexlify(tx.serialize()).decode("utf-8")) |
<|file_name|>antenna_grab.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# script to measure save a bunch of VNA phase measurements while stepping beam numbers
# useful for characterizing the RF path (transmitter antenna port to receiver input) and looking for time delay differences
# requires ssh key for QNX box an... | for p in range(args.paths):
p = int(raw_input('connect and enter a path number and then press enter to continue... '))
time.sleep(TX_STARTUP_DELAY) # wait for transmitter to warm up |
<|file_name|>stickyVoteButtons.user.js<|end_file_name|><|fim▁begin|>// ==UserScript==
// @name Sticky vote buttons
// @namespace http://stackexchange.com/users/4337810/
// @version 1.0
// @description Makes the vote buttons next to posts sticky whilst scrolling on that post
// @author ᔕᖺᘎᕊ (http:... | vote.css({position:"fixed", left:$(this).offset().left, top:0 + offset});
}else{
vote.css({position:"relative", left:0, top:$(this).height()-vote.height()}); |
<|file_name|>readcsv.rs<|end_file_name|><|fim▁begin|>///
/// This example parses, sorts and groups the iris dataset
/// and does some simple manipulations.
///
/// Iterators and itertools functionality are used throughout.
///
///
use ndarray::Array;
use dataframe::DataFrame;
use util::traits::UtahNum;
use util::error... |
let matrix = Array::from_shape_vec((nrow, ncol), v).unwrap();
DataFrame::new(matrix).columns(&columns[..])
} |
<|file_name|>test_geometric.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy.testing import (assert_equal, assert_array_almost_equal,
assert_raises)
from skimage.transform._geometric import _stackcopy
from skimage.transform._geometric import GeometricTransform
from skimage.transf... | |
<|file_name|>test_grafana.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Nicolas Lamirault <nicolas.lamirault@gmail.com>
<|fim▁hole|># the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but W... | # 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 |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from sqlalchemy import create_engine
from sqlalchemy import Column, Integer, String, UniqueConstraint
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('sqlite:///challenge.... | __table_args__ = (UniqueConstraint('cep'),) |
<|file_name|>authentication.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def requests_handshaker():
consumer_key = config.OAUTH_CONSUMER_KEY
consumer_secret = config.OAUTH_CONSUMER_SECRET
consumer_token = ConsumerToken(consumer_key, consumer_secret)
return Handshaker("https://meta.wikimedia.org/w/index... | from . import config
from django.shortcuts import render
from mwoauth import ConsumerToken, Handshaker, tokens |
<|file_name|>payment.braintree.providersettings.controller.js<|end_file_name|><|fim▁begin|>angular.module('merchello.plugins.braintree').controller('Merchello.Plugins.GatewayProviders.Dialogs.PaymentMethodAddEditController',
['$scope', 'braintreeProviderSettingsBuilder',
function($scope, braintreeProviderS... | |
<|file_name|>icf.py<|end_file_name|><|fim▁begin|># Copyright 2008 Dan Smith <dsmith@danplanet.com>
#
# 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 you... | |
<|file_name|>CONSTANTS_DIRECTIONS.java<|end_file_name|><|fim▁begin|>package br.com.tosin.ssd.utils;
/**
* Created by roger on 11/03/17.
*/
public class CONSTANTS_DIRECTIONS {<|fim▁hole|> public static final String EAST = "E";
public static final String NORTHWEST = "NW";
public static final Stri... |
public static final String NORTH = "N";
public static final String SOUTH = "S";
public static final String WEST = "W"; |
<|file_name|>PublicDnsPropertiesMutable.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/servicediscovery/model/PublicDnsPropertiesMutable.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <u... | } // namespace Model
} // namespace ServiceDiscovery |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>/**
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you unde... | }; |
<|file_name|>book.service.ts<|end_file_name|><|fim▁begin|>import {Injectable} from '@angular/core';
import {Headers, Http, Response} from '@angular/http';
import 'rxjs/add/operator/toPromise';
import {Book} from './../models/book';
@Injectable()
export class BookService {
private booksUrl: string = 'api/books';
... | |
<|file_name|>selection_behavior.rs<|end_file_name|><|fim▁begin|>use crate::{api::prelude::*, proc_macros::*};
/// Used for selection.
pub enum SelectionAction {
ToggleSelection,
}
/// The `SelectionBehaviorState` handles the `SelectionBehavior` widget.
#[derive(Default, AsAny)]
pub struct SelectionBehaviorState {... | }
impl State for SelectionBehaviorState {
fn init(&mut self, _: &mut Registry, ctx: &mut Context) { |
<|file_name|>PointGeometry.java<|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 ... | |
<|file_name|>TicketSelectionPage.java<|end_file_name|><|fim▁begin|>package task03.pages;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.ui.ExpectedConditions;
public class TicketSelectionPage extends Page {
public TicketSelectionPage(PageMana... | |
<|file_name|>test_server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Tests the pooled server
:license: Apache License 2.0
"""
# JSON-RPC library
from jsonrpclib import ServerProxy
from jsonrpclib.SimpleJSONRPCServer import PooledJSONRPCServer
from jsonrpclib.threadpool import... | # Standard library |
<|file_name|>abduction.py<|end_file_name|><|fim▁begin|>'''abduction.py
Base functionality for logical abduction using a knowledge base of definite clauses
Andrew S. Gordon
'''
import itertools
from . import parse
from . import unify
def abduction(obs, kb, maxdepth, skolemize = True):
'''Logical abduction: return... | else:
res[predicate] = [dc] |
<|file_name|>mooedit.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The moo Editor
~~~~~~~~~~~~~~
:copyright: 2005-2008 by The PIDA Project
:license: GPL 2 or later (see README/COPYING/LICENSE)
"""
# Standard Libs
import os
import gtk
import gobject
import re
from gtk import gdk
# UGLY ... | _('Reload file content'), |
<|file_name|>euler004.py<|end_file_name|><|fim▁begin|>#!/bin/python3
import bisect
def is_palindrome(n):
return str(n) == str(n)[::-1]
def generate_palindromes():
return [i * j
for i in range(100, 1000)
for j in range(100, 1000)
if is_palindrome(i * j)]
def find_lt(a, ... | palindromes = sorted(generate_palindromes())
test_cases = int(input().strip())
for _ in range(test_cases): |
<|file_name|>aeabi_memcpy.rs<|end_file_name|><|fim▁begin|>#![cfg(all(
target_arch = "arm",
not(any(target_env = "gnu", target_env = "musl")),
target_os = "linux",
feature = "mem"
))]
#![feature(compiler_builtins_lib)]
#![feature(lang_items)]
#![no_std]
extern crate compiler_builtins;
// test runner
ex... | dest.copy_from_slice(&[0; 8]);
unsafe { __aeabi_memcpy4(dest.as_mut_ptr(), src.as_ptr(), n) }
|
<|file_name|>virtualdisk.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2007, 2008 Agostino Russo
# Python port of wubi/disckimage/main.c by Hampus Wessman
#
# Written by Agostino Russo <agostino.russo@gmail.com>
#
# win32.ui is free software; you can redistribute it and/or modify
# it under the terms of the ... | defs.CREATE_ALWAYS,
defs.FILE_ATTRIBUTE_NORMAL,
defs.NULL)
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""
A Pygments lexer for Magpie.
"""
from setuptools import setup
__author__ = 'Robert Nystrom'
setup(
name='Magpie',
version='1.0',
description=__doc__,
author=__author__,
packages=['magpie'],<|fim▁hole|> '''
)<|fim▁end|> | entry_points='''
[pygments.lexers]
magpielexer = magpie:MagpieLexer |
<|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 https://mozilla.org/MPL/2.0/. */
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate... | /// Sends messages to the embedder.
pub struct EmbedderProxy {
pub sender: Sender<(Option<TopLevelBrowsingContextId>, EmbedderMsg)>,
pub event_loop_waker: Box<dyn EventLoopWaker>, |
<|file_name|>keys.py<|end_file_name|><|fim▁begin|>Alchemy sentiment analysis: fb12d2c55fff36e1e268584e261b6b010b37279f
<|fim▁hole|><|fim▁end|> |
Africa Is Talking: 676dbd926bbb04fa69ce90ee81d3f5ffee2692aaf80eb5793bd70fe93e77dc2e |
<|file_name|>jquery.phantomjs.fix.js<|end_file_name|><|fim▁begin|>jQuery.each(("blur focus focusin focusout click dblclick " +
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave").split(" "),
function(i, name) {
jQuery.fn[name] = function() {
var el = this[0];
var ev = document.createEvent('M... | }; |
<|file_name|>file_path_watcher_util.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/media_galleries/fileapi/file_path_watcher_util.h"
#include "... | |
<|file_name|>login.py<|end_file_name|><|fim▁begin|>from flask_wtf import Form
from wtforms import StringField, PasswordField, SubmitField
from wtforms.validators import DataRequired
<|fim▁hole|> submit = SubmitField('Log In', validators=[DataRequired()])<|fim▁end|> | class LoginForm(Form):
username = StringField('ID or Email Address', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use self::{
bit_board::BitBoard,
board::Board,
player::{AiPlayer, PlayerKind},
};
mod bit_board;
mod board;
mod multi_direction;
mod player;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub struct Point(pub u32, pub u32);
impl Point {
fn from_offse... | impl Side {
pub fn flip(self) -> Side {
match self {
Side::Black => Side::White, |
<|file_name|>nzbToGamez.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
#
##############################################################################
### NZBGET POST-PROCESSING SCRIPT ###
# Post-Process to CouchPotato, SickBeard, NzbDrone, Mylar, Gamez, HeadPhones.
#
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""<|fim▁hole|>"""<|fim▁end|> | Created on Wed Mar 2 12:13:32 2016
@author: Zahari Kassabov |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2017 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hop... | digit >> tag!(",") >> digit >> tag!(",") >>
digit >> tag!(",") >> digit >> tag!(",") >>
part1: getu16 >>
tag!(",") >> |
<|file_name|>mx_test.go<|end_file_name|><|fim▁begin|>package bsw
import (
"testing"
)
func TestMX(t *testing.T) {
_, results, err := MX("stacktitan.com", "8.8.8.8")
if err != nil {
t.Error("error returned from MX")
t.Log(err)
}
found := false
for _, r := range results {
if r.Hostname == "mx1.emailsrvr.com... | |
<|file_name|>php.js<|end_file_name|><|fim▁begin|>define(["exports"], function (_exports) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.phpLang = phpLang;
function phpLang(hljs) {
var VARIABLE = {
begin: "\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*"
... | excludeEnd: true,
illegal: "\\$|\\[|%",
contains: [hljs.UNDERSCORE_TITLE_MODE, {
className: "params", |
<|file_name|>inter.js<|end_file_name|><|fim▁begin|>'use strict';
import Maths from './maths.js'<|fim▁hole|><|fim▁end|> | import FSM from './fsm.js'
import { Animation, Interpolation } from './animation.js'
export { Maths, FSM, Interpolation, Animation } |
<|file_name|>fail_if_no_c.py<|end_file_name|><|fim▁begin|># Copyright 2009-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | |
<|file_name|>InputReader.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "InputReader.h"
#include "graph.h"
#include <iostream>
#include <string>
using namespace std;
InputReader::InputReader(const char* fileName, const char* stFileName)
{
in.open(fileName);
if(!in.is_open())
{
cout<<"Input file "... | if(!stIn.is_open()) |
<|file_name|>IPCFutexPageQueue.cpp<|end_file_name|><|fim▁begin|>#include "IPCFutexPageQueue.h"
#include "IPCCheck.h"
#include "IPCException.h"
#include "IPCLog.h"
#include "IPCType.h"
#include "futex.h"
#include <errno.h>
#include <sched.h>
#include <string.h>
#include <sys/mman.h>
#include <time.h>
#include <unistd.h>... | // build a terminate msg. |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_id = "playgroundrs"]
#![crate_type = "lib"]
extern crate std;
extern crate core;
extern crate rand;
pub mod heap;
pub mod util;
pub mod sort;<|fim▁hole|><|fim▁end|> | pub mod test; |
<|file_name|>SwingConsole.java<|end_file_name|><|fim▁begin|>package toncc;
import javax.swing.*;
/** Utility class to run JFrame-based GUI classes.
*
* @author Bruce Eckel, Giacomo Parolini
*/
class SwingConsole {
private static void prepare(final JFrame f) {
f.setTitle(f.getClass().getSimpleName());
f.setDe... | |
<|file_name|>connection.js<|end_file_name|><|fim▁begin|>const EventEmitter = require("events");
const ssh2 = require("ssh2");
const Client = ssh2.Client;
class Connection extends EventEmitter {
constructor (connectOptions, dimensions) {
this.connectOptions = connectOptions;
this.dimensions = dimensions;
this.er... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2018 Bruce Stenning. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain ... | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.<|fim▁hole|>// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Parity is distributed in the hope that it will be useful,
// b... |
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by |
<|file_name|>dashboard-view.js<|end_file_name|><|fim▁begin|>import '@polymer/iron-icon/iron-icon.js';
import '@polymer/iron-icons/iron-icons.js';
import '@polymer/paper-card/paper-card.js';
import '@polymer/paper-ripple/paper-ripple.js';
import '@polymer/paper-item/paper-icon-item.js';
import '@polymer/paper-icon-butto... | ${css.toString()}
</style> |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
use system::syscall::sys_iopl;
use power::reset;
mod power;
fn main() {
unsafe { sys_iopl(3).unwrap() };
println!("Performing reset");
reset();
}<|fim▁end|> | extern crate system; |
<|file_name|>_rb.cpp<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////////
//
// File : $Id: _rb.cpp 27 2006-05-20 19:31:15Z mbabuskov $
// Subject : IBPP, internal RB class implementation
//
//////////////////////////////////////////////////////////////////////... | data = std::string(p+3, len);
return len;
} |
<|file_name|>callbacks.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.... |
Supports all values that can be represented as a string,
including 1D iterables such as np.ndarray.
|
<|file_name|>splitter.py<|end_file_name|><|fim▁begin|># (c) 2014 James Cammarata, <jcammarata@ansible.com>
#
# 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, either ve... | if quote_char:
if cur_char == quote_char:
quote_char = None
else: |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import time
import random
import os
import os.path
import logging
import urlparse
import functools
import lms.lib.comment_client as cc
import django_comment_client.utils as utils
import django_comment_client.settings as cc_settings
from django.core import exceptions... | return _create_comment(request, course_id, thread_id=thread_id)
|
<|file_name|>mode-jsx.js<|end_file_name|><|fim▁begin|>ace.define("ace/mode/jsx", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/tokenizer", "ace/mode/jsx_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function (e, t, n) {
function... | }.call(l.prototype), t.Mode = l
}), ace.define("ace/mode/jsx_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/doc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function (e, t, n) {
var r = e("../lib/oop"), i = e("../lib/lang"), s = e("./doc_comment_highli... |
<|file_name|>qingjia_calendar.py<|end_file_name|><|fim▁begin|>#!usr/bin/python
# -*- coding:utf-8 -*-
from osv import osv,fields
import time
from datetime import datetime
from dateutil import rrule
class qingjia_calendar(osv.osv):
_name='qingjia.calendar'
_columns={
'start_date':fields.datetim... |
qingjia_calendar_line() |
<|file_name|>config.exceptionHandler.ts<|end_file_name|><|fim▁begin|>module App {
"use strict";
angular.module("knowledgeCenterApp")
.config([
"$provide", ($provide: ng.auto.IProvideService): void => {
$provide.decorator("$exceptionHandler",
["$delegate", "c... | return (exception: Error, cause: string): void => { |
<|file_name|>borders.hpp<|end_file_name|><|fim▁begin|>#pragma once
#include "common.hpp"
<|fim▁hole|>} // namespace ccloutline<|fim▁end|> | namespace ccloutline {
border_mat borders(const arma::mat&);
|
<|file_name|>hal_dynalib_export.cpp<|end_file_name|><|fim▁begin|>/**
******************************************************************************
* @file hal_dynalib_export.c
* @author Matthew McGowan
******************************************************************************
Copyright (c) 2015 Particle ... | version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict';
/* App Module */
var phonecatApp = angular.module('phonecatApp', [
'ngRoute',
'phonecatAnimations',
'phonecatControllers',
'phonecatFilters',
'phonecatServices',
]);
phonecatApp.config(['$routeProvider',
function($routeProvider) {
$r... | otherwise({
redirectTo: '/phones'
}); |
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|>def get_perm_argparser(self, args):
args = args.split(" ")
if args[0] == "nick":
self.conman.gen_send("Permission level for %s: %s" % (args[1], self.permsman.get_nick_perms(args[1])))
elif args[0] == "cmd":
if args[1].startswith("."):
... | self.conman.gen_send("Setting permission level for %s: %s" % (args[1], args[2]))
self.permsman.set_cmd_perms(args[1], args[2]) |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved.
//
// This program is licensed to you under the Apache License Version 2.0, and
// you may not use this file except in compliance with the Apache License
// Version 2.0. You may obtain a copy of t... |
dag.add_child(root_idx, (), child1); |
<|file_name|>AbstractDominoIterator.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013
*
* 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|>workflow_files.py<|end_file_name|><|fim▁begin|># THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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
#... | temp)
elif (
(key_owner is KeyOwner.CLIENT
and key_type is KeyType.PUBLIC |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
# © 2014 Elico Corp (https://www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
{
'name': 'Purchase Price List Item',
'version': '7.0.1.0.0',
'category': 'Purchase',
'sequence': 19,
... | |
<|file_name|>chronopost.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
In order to use this lib, you have to call the method 'get_shipping_label'
with the right arguments. To know which keys to send to this method read these lists :
- required fields
- fields
"""
from datetime i... | "content1": {'max_size': 80}, |
<|file_name|>51_N-Queens.py<|end_file_name|><|fim▁begin|>class Solution(object):
def solveNQueens(self, n):
"""
:type n: int
:rtype: List[List[str]]
"""
def search(cur):
if cur == n:
add_answer()
else:
for i in range(n)... | res_str += "."
ans.append(res_str)
result.append(ans) |
<|file_name|>transform_resource_count.go<|end_file_name|><|fim▁begin|>package terraform
import (
"github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/dag"
)
// ResourceCountTransformer is a GraphTransformer that expands the count
// out for a ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | # |
<|file_name|>sleep_schedule.py<|end_file_name|><|fim▁begin|>from datetime import datetime, timedelta
from time import sleep
from random import uniform
class SleepSchedule(object):
"""Pauses the execution of the bot every day for some time
Simulates the user going to sleep every day for some time, the sleep t... | self.entries = [] |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var fs = require("fs");
var express = require("express"),
optimist = require("optimist"),
gitstatic = require("../");
var argv = optimist.usage("Usage: $0")
.options("h", {
alias: "help",
describe: "display this help text"
})
.options... | |
<|file_name|>quickopen.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|>app.js<|end_file_name|><|fim▁begin|>function htmlEncode(value){
return $('<div/>').text(value).html();
}<|fim▁hole|> $scope.snippet = function(item){
var elem = $("#"+item);
var contents = elem.html().trim();
elem.html(htmlEncode(contents));
$('pre code').each(functio... | var app = angular.module("oasassets",[]).controller("snippetsController",function($scope){
|
<|file_name|>voxel_utils.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Google Research 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... | segment_ids: A tf.int32 tensor representing the segment id of each point |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.