prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>expanded-and-path-remap-80832.rs<|end_file_name|><|fim▁begin|>// Test for issue 80832 // // pretty-mode:expanded // pp-exact:expanded-and-path-remap-80832.pp<|fim▁hole|>fn main() {}<|fim▁end|>
// compile-flags: --remap-path-prefix {{src-base}}=the/src
<|file_name|>03_map.py<|end_file_name|><|fim▁begin|># Bug in 2.7 base64.py _b32alphabet = {<|fim▁hole|> 1: 'B', 10: 'K', 19: 'T', 28: '4', 2: 'C', 11: 'L', 20: 'U', 29: '5', 3: 'D', 12: 'M', 21: 'V', 30: '6', 4: 'E', 13: 'N', 22: 'W', 31: '7', 5: 'F', 14: 'O', 23: 'X', 6: 'G', 15: 'P', 24: 'Y', ...
0: 'A', 9: 'J', 18: 'S', 27: '3',
<|file_name|>apprunner.py<|end_file_name|><|fim▁begin|># This file is part of the Enkel web programming library. # # Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.net) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published...
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * @author Sergio Merino */ package assembler;<|fim▁end|>
* This package provides the necessary classes to slice and compose a file. *
<|file_name|>correspondence_estimation_backprojection.hpp<|end_file_name|><|fim▁begin|>/* * Software License Agreement (BSD License) * * Point Cloud Library (PCL) - www.pointclouds.org * Copyright (c) 2012-, Open Perception, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms...
if (!initCompute ()) return; typedef typename pcl::traits::fieldList<PointSource>::type FieldListSource;
<|file_name|>parse.py<|end_file_name|><|fim▁begin|>import xmltodict def parseData(data): try: return xmltodict.parse(data) except: <|fim▁hole|> return None else: raise Exception('Invalid XML data', data)<|fim▁end|>
if len(data.split()) is 0:
<|file_name|>grove_slide_potentiometer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # GrovePi Example for using the Grove Slide Potentiometer (http://www.seeedstudio.com/wiki/Grove_-_Slide_Potentiometer) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: htt...
<|file_name|>DatabaseHelper.java<|end_file_name|><|fim▁begin|>/* Copyright (C) 2011 Lorenzo Bernardi (fastlorenzo@gmail.com) 2010 Ben Van Daele (vandaeleben@gmail.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...
if(c.moveToFirst()) result = c.getLong(4); else
<|file_name|>virtualmachinescalesetvms.go<|end_file_name|><|fim▁begin|>package compute // Copyright (c) Microsoft and contributors. 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...
}
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use solicit::client::ClientConnectError; use solicit::http::client::tls::TlsConnectError; use openssl::ssl::error::SslError;<|fim▁hole|>use std::error::Error; use std::fmt; #[derive(Debug)] pub enum ProviderError { ClientConnectError(String), SslError(String) ...
<|file_name|>SimRepAnaligRMSD.py<|end_file_name|><|fim▁begin|>import MDAnalysis import matplotlib.pyplot as plt import numpy as np from MDAnalysis.analysis.align import * from MDAnalysis.analysis.rms import rmsd def ligRMSD(u,ref): """ This function produces RMSD data and plots for ligand. :input ...
u = MDAnalysis.Universe(args.topology, args.trajectory) ref = MDAnalysis.Universe(args.topology, args.trajectory) ligandRMSD = []
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>use std::{fmt, mem}; use std::sync::{Arc, Mutex}; use itertools::{Itertools, MultiPeek}; use unicode::{self, UString}; use lang::{Context, Filter}; use lang::context::PrecedenceGroup; use util::Labeled; #[derive(Debug)] pub enum ParseError { InvalidToken(char)...
run: Box::new(Labeled::new("<filter group (α)>", Arc::new(|attrs, input, output| { assert_eq!(attrs.len(), 1);
<|file_name|>winusb.rs<|end_file_name|><|fim▁begin|>// Copyright © 2016-2017 winapi-rs developers // Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. // All files in...
pub fn WinUsb_ParseConfigurationDescriptor( ConfigurationDescriptor: PUSB_CONFIGURATION_DESCRIPTOR, StartPosition: PVOID, InterfaceNumber: LONG,
<|file_name|>unboxed-closures-drop.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apac...
b(move |a: isize, b| { a + b }); } assert_eq!(drop_count(), 3);
<|file_name|>UUID.js<|end_file_name|><|fim▁begin|>// Private array of chars to use var CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''); var ID = {}; ID.uuid = function (len, radix) { var chars = CHARS, uuid = [], i; radix = radix || chars.length; if (len) { // Compact form ...
// A more compact, but less performant, RFC4122v4 solution:
<|file_name|>bitcoin_pl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pl" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="14"/> <source>About Forcoin</source> ...
<location filename="../bitcoinstrings.cpp" line="52"/>
<|file_name|>CollapsibleMultilineText.py<|end_file_name|><|fim▁begin|>import qt class CollapsibleMultilineText(qt.QTextEdit): """Text field that expands when it gets the focus and remain collapsed otherwise""" def __init__(self): super(CollapsibleMultilineText, self).__init__() self.minHeight =...
<|file_name|>consts.py<|end_file_name|><|fim▁begin|>import sys from rpython.rlib.unroll import unrolling_iterable SEND_EFFECT = 0xFF ARRAY_EFFECT = 0xFE BLOCK_EFFECT = 0xFD UNPACK_EFFECT = 0xFC # Name, number of arguments, stack effect BYTECODES = [ ("LOAD_SELF", 0, +1), ("LOAD_SCOPE", 0, +1), ("LOAD_BL...
("LOAD_SINGLETON_CLASS", 0, 0),
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function (grunt) { 'use strict'; // Project configuration. grunt.initConfig({ jshint: { options: { "expr": true, "laxcomma": true, "smarttabs": true, "c...
jUnit: { report: false, savePath: "./build/reports/jasmine/", useDotNotation: true,
<|file_name|>base.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/licenses/LI...
API requests. If ``None``, then default info will be used. Generally, you only need to set this if you're developing your own client library.
<|file_name|>hello_world.rs<|end_file_name|><|fim▁begin|>// [Ref](http://kmcallister.github.io/talks/rust/2015-contributing-to-rust/slides.html) // rustc -Z time-passes hello_world.rs fn main() { println!("Hello World!");<|fim▁hole|><|fim▁end|>
}
<|file_name|>server3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import server import time from Sensoria.stereotypes.TimeControlData import TimeControlData from Sensoria.stereotypes.InstantMessageData import InstantMessageData class TemperatureSensor (server.TemperatureSensor): def __init__ (self): supe...
while True: time.sleep (1)
<|file_name|>mac_securityd.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*-<|fim▁hole|># # Copyright 2014 The Plaso Project Authors. # Please see the AUTHORS file for details on individual authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file e...
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>#[macro_export] macro_rules! hash_test ( ($inp:expr, $out_b:expr, $out_s:expr) => (<|fim▁hole|> HashTestCase { input: $inp, output: $out_b, output_str: $out_s } ) );<|fim▁end|>
<|file_name|>UniqueOperationTypesRule.ts<|end_file_name|><|fim▁begin|>import { GraphQLError } from '../../error/GraphQLError'; import type { SchemaDefinitionNode, SchemaExtensionNode, } from '../../language/ast'; import type { ASTVisitor } from '../../language/visitor'; import type { SDLValidationContext } from '...
<|file_name|>credentials.py<|end_file_name|><|fim▁begin|># encoding: utf-8 # module samba.credentials # from /usr/lib/python2.7/dist-packages/samba/credentials.so # by generator 1.135 """ Credentials management. """ # imports import talloc as __talloc # Variables with simple values AUTO_KRB_FORWARDABLE = 0 AUTO_US...
Change domain name.
<|file_name|>desaturate.py<|end_file_name|><|fim▁begin|>from os.path import dirname, join from pystacia import lena dest = join(dirname(__file__), '../_static/generated') <|fim▁hole|><|fim▁end|>
image = lena(256) image.desaturate() image.write(join(dest, 'lena_desaturate.jpg')) image.close()
<|file_name|>modal.js<|end_file_name|><|fim▁begin|>// Get the modal var modal = document.getElementById('myModal'); // Get the image and insert it inside the modal - use its "alt" text as a caption var img = document.getElementById('myImg'); var modalImg = document.getElementById("img01"); var captionText = document.g...
modalImg.src = this.src; modalImg.alt = this.alt; captionText.innerHTML = this.alt;
<|file_name|>contactgetrequests.js<|end_file_name|><|fim▁begin|>const R = require('aws-response'); const f = require('../contactGetRequests/index'); <|fim▁hole|><|fim▁end|>
exports.handler = R(f);
<|file_name|>NPWidgetService.java<|end_file_name|><|fim▁begin|>package com.networkprofiles.widget; /** Service to refresh the widget **/ import android.app.Service; import android.appwidget.AppWidgetManager; import android.content.Intent; import android.graphics.Color; import android.os.IBinder; import android.provider...
rv.setTextColor(R.id.textWidgetGps, Color.WHITE);
<|file_name|>LeadForm.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react' import PropTypes from 'prop-types' import themed from '@rentpath/react-themed' import clsx from 'clsx' import isEqual from 'lodash/isEqual' import { randomId } from '@rentpath/react-ui-utils' import SubmitButton from './Submi...
<|file_name|>boundaryMeasurements.C<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 201...
),
<|file_name|>gelk.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2015-2019 Bitergia # # 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 ver...
from grimoire_elk.elastic import ElasticConnectException from grimoire_elk.elastic import ElasticSearch
<|file_name|>bitcoin_de.ts<|end_file_name|><|fim▁begin|><TS language="de" version="2.0"> <context> <name>AboutDialog</name> <message> <source>About sherlockcoin Core</source> <translation>Über sherlockcoin Core</translation> </message> <message> <source>&lt;b&gt;sherlockcoin Core...
</message> <message> <source>Date</source> <translation>Datum</translation>
<|file_name|>Union.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|> for (auto&& figure : figures) if (figure->contains(point)) return true; return false; } Figure* Union::createCopy() const { return new Union(*this); } std::ostream &operator<<(std::ostream& os, const Union* un) { retu...
#include "Union.h" bool Union::contains(const Vector2D& point) const {
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from dateutil.relativedelta import relativedelta from script.models import Script, ScriptProgress from rapidsms.models import Connection import datetime from rapidsms.models import Contact from rapidsms.contrib.locations.models import Location from poll.models import P...
10.3: 'HIV/AIDS', 11.1: 'Concept of technology', 11.2: 'Processing and making things from natural materials',
<|file_name|>md5.rs<|end_file_name|><|fim▁begin|>use digest::Digest; use utils::buffer::{ FixedBuffer64, FixedBuffer, StandardPadding }; use byteorder::{ WriteBytesExt, ReadBytesExt, LittleEndian<|fim▁hole|>}; #[derive(Debug)] struct MD5State { s0: u32, s1: u32, s2: u32, s3: u32...
<|file_name|>launch_suite.js<|end_file_name|><|fim▁begin|>;(function($){ var page_container, current_select = null; $(document).ready(function(){ page_container = $('#launch_suite_pages'); $('#funnel_select').change(function(){ if(parseInt($('#funnel_id').val()) > 0){ ...
page_container.sortable({
<|file_name|>borrowck-univariant-enum.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.a...
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>""" Represents protected content """ from django.conf.urls import url<|fim▁hole|>def testview(request): return HttpResponse() urlpatterns = [url(r"^$", testview, name="test_url_content")]<|fim▁end|>
from django.http import HttpResponse
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright Cryptape Technologies 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/licenses/LICENSE-2.0 /...
#[cfg(test)] extern crate cita_crypto;
<|file_name|>swap.rs<|end_file_name|><|fim▁begin|>#![feature(core)] extern crate core; #[cfg(test)] mod tests { use core::atomic::AtomicUsize; use core::atomic::Ordering::{Relaxed, Release, Acquire, AcqRel, SeqCst}; use std::sync::Arc; use std::thread; // pub struct AtomicUsize { // v: U...
// /// // /// # Examples
<|file_name|>TextureDummy.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015, Alexander Orzechowski. * * 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, includi...
if (ready){ this.setReady(); };
<|file_name|>bls.rs<|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 under the Apache License, Ve...
// let mut v = pair::ate2(&g, &d, &pk, &hm);
<|file_name|>ex12.py<|end_file_name|><|fim▁begin|>#import factorial #import square x = int(raw_input("What is 'x'?\n")) y = int(raw_input("What is y?\n")) # question0 = str(raw_input("Define a y value? (y/n)\n")) # if (question0 == "y","Y","yes","Yes"): # y = int(raw_input("What will 'y' be?\n")) # elif (y == "n",...
# from sys import argv
<|file_name|>author.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { Http, Response } from '@angular/http'; import { Author } from '../entities/author'; @Injectable() export class AuthorService { private baseUrl: string = 'https://api.github.com'; constructor(private h...
}
<|file_name|>widget_medialist.js<|end_file_name|><|fim▁begin|>/* FTUI Plugin * Copyright (c) 2016 Mario Stephan <mstephan@shared-files.de> * Under MIT License (http://www.opensource.org/licenses/mit-license.php) */ /* global ftui:true, Modul_widget:true */ "use strict"; var Modul_medialist = function () { $(...
changedCurrent(elem, pos); } });
<|file_name|>core.py<|end_file_name|><|fim▁begin|># Copyright 2017 Erik Tollerud # # 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 # # ...
aspects = np.ptp(y)/np.ptp(x) if np.isscalar(aspects) or aspects.shape==tuple(): aspects = np.ones(len(x)) * aspects
<|file_name|>instr_vpcmpuw.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode}; use ::RegType::*; use ::instruction_def::*; use ::Operand::*; use ::Reg::*; use ::RegScale::*; use ::test::run_test; #[test] fn vpcmpuw_1() { run_test(&Instru...
#[test] fn vpcmpuw_11() { run_test(&Instruction { mnemonic: Mnemonic::VPCMPUW, operand1: Some(Direct(K2)), operand2: Some(Direct(ZMM12)), operand3: Some(Direct(ZMM15)), operand4: Some(Literal8(113)), lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: Some(MaskReg::K2), broadcast: None }, &[98, 21...
<|file_name|>protocol-buffers-schema-tests.ts<|end_file_name|><|fim▁begin|>import schema from "protocol-buffers-schema"; <|fim▁hole|> required int32 y=2; optional string label = 3; } message Line { required Point start = 1; required Point end = 2; optional string label = 3; }`; // pass a buffer or string to ...
const proto = `syntax = "proto2"; message Point { required int32 x = 1;
<|file_name|>draw.C<|end_file_name|><|fim▁begin|>void draw(){ TString histoFileName = "data0/histo.root"; TFile* histoFile = TFile::Open(histoFileName); TH3D* hDetEventTime = (TH3D*) histoFile->Get("hDetEventTime"); printf("Nentries:%i\n",hDetEventTime->GetEntries()); for (Int_t det=1;det<=6;det++)...
hTofPointsZ->Draw();
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var path = require('path'); var fs = require('fs') var http = require('http') var url = require('url') var mime = require('./mime').types var config = require("./config"); var zlib = require("zlib") var utils = require("./utils") var port = 8089; var server = http.creat...
<|file_name|>KanalanschlussPropertyConstants.java<|end_file_name|><|fim▁begin|>/*************************************************** * * cismet GmbH, Saarbruecken, Germany<|fim▁hole|>* ... and it just works. * ****************************************************/ /* * Copyright (C) 2011 jruiz * * This ...
*
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or mo...
<|file_name|>errors.py<|end_file_name|><|fim▁begin|>from flask import render_template from . import main @main.app_errorhandler(404) def page_not_found(e): return render_template('404.html'), 404 @main.app_errorhandler(500)<|fim▁hole|><|fim▁end|>
def internal_server_error(e): return render_template('500.html'), 500
<|file_name|>const-bound.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lic...
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed
<|file_name|>cleanfilecache.py<|end_file_name|><|fim▁begin|>import os from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.core.exceptions import ImproperlyConfigured from cacheops.simple import file_cache, FILE_CACHE_DIR class Command(BaseCommand):<|fim▁hol...
help = 'Clean filebased cache' def handle(self, **options):
<|file_name|>test_tasks.py<|end_file_name|><|fim▁begin|>from django.test import TestCase from django.test.utils import override_settings from django.utils import timezone from django.core import mail from ovp.apps.users.tests.fixture import UserFactory from ovp.apps.organizations.tests.fixture import OrganizationFact...
Assert cellery task to remind volunteer is created when user applies to project """ mail.outbox = []
<|file_name|>test_rnaseq.py<|end_file_name|><|fim▁begin|>import pytest<|fim▁hole|> @pytest.yield_fixture def ericscript_run(mocker): yield mocker.patch('bcbio.pipeline.rnaseq.ericscript.run', autospec=True) @pytest.fixture def sample(): return { 'config': { 'algorithm': { '...
from bcbio.pipeline import rnaseq
<|file_name|>development.js<|end_file_name|><|fim▁begin|>// Note: You must restart bin/webpack-watcher for changes to take effect const merge = require('webpack-merge') const sharedConfig = require('./shared.js')<|fim▁hole|> stats: { errorDetails: true }, output: { pathinfo: true } })<|fim▁end|>
module.exports = merge(sharedConfig, { devtool: 'sourcemap',
<|file_name|>getlyrics.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- u"""歌詞コーパスの取得 """ import argparse import requests import logging import urllib, urllib2 import re import time from BeautifulSoup import BeautifulSoup verbose = False logger = None def init_logger(): global logger logger = logging...
def getLyricUrlList(artist): u"""アーティストのすべての歌詞ページのUrlを取得
<|file_name|>assignment5.py<|end_file_name|><|fim▁begin|>import math import pandas as pd import numpy as np from scipy import misc from mpl_toolkits.mplot3d import Axes3D import matplotlib import matplotlib.pyplot as plt # Look pretty... # matplotlib.style.use('ggplot') plt.style.use('ggplot') def Plot2D(T, title, x...
<|file_name|>callee.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses...
{
<|file_name|>cg.py<|end_file_name|><|fim▁begin|>import numpy as np def CG(A, X, B, maxiter=20, tolerance=1.0e-10, verbose=False): """Solve X*A=B using conjugate gradient method. ``X`` and ``B`` are ``ndarrays```of shape ``(m, nx, ny, nz)`` coresponding to matrices of size ``m*n`` (``n=nx*ny*nz``) and ...
<|file_name|>noop.ts<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * 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 applicable law or agreed to in writing, software * distributed u...
* Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License");
<|file_name|>randfact.py<|end_file_name|><|fim▁begin|><|fim▁hole|>arguments = ["self", "info", "args"] helpstring = "randfact" minlevel = 1 def main(connection, info, args) : """Returns a random fact""" source = urllib2.urlopen("http://randomfunfacts.com/").read() fact = re.search(r"<strong><i>(.*)</...
import re, urllib2
<|file_name|>ut_util.py<|end_file_name|><|fim▁begin|>__author__ = 'deevarvar' import string import random import os <|fim▁hole|>#generate a random string def string_generator(size=6, chars=string.ascii_letters+string.digits): return ''.join(random.choice(chars) for _ in range(size)) #emulate touch cmd def touchFi...
<|file_name|>event_mail.py<|end_file_name|><|fim▁begin|># pylint: disable=api-one-deprecated from datetime import datetime from dateutil.relativedelta import relativedelta from odoo import api, fields, models, tools _INTERVALS = { "hours": lambda interval: relativedelta(hours=interval), "days": lambda interv...
<|file_name|>io.py<|end_file_name|><|fim▁begin|>""" This module loads all the classes from the VTK IO library into its namespace. This is a required module.""" import os if os.name == 'posix': from libvtkIOPython import * else:<|fim▁hole|><|fim▁end|>
from vtkIOPython import *
<|file_name|>lc003-longest-substring-without-repeating-characters.py<|end_file_name|><|fim▁begin|># coding=utf-8 import unittest """3. Longest Substring Without Repeating Characters https://leetcode.com/problems/longest-substring-without-repeating-characters/description/ Given a string, find the length of the **longe...
substring.
<|file_name|>gui_main.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'c:/steganography/main.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = Qt...
self.text_message = QtGui.QTextEdit(self.group_message) self.text_message.setGeometry(QtCore.QRect(180, 20, 811, 191))
<|file_name|>floating_ip_pools.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 X.commerce, a business unit of eBay 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 # # ...
<|file_name|>scripts.prod.js<|end_file_name|><|fim▁begin|>(function(jQuery) { "use strict"; var control = Echo.Control.manifest("Echo.Tests.Controls.TestControl"); if (Echo.Control.isDefined(control)) return; control.init = function() { if (!Echo.Variables) { Echo.Variables = {}; } Echo.Variables.TestControl = ...
<|file_name|>fixnss.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # # Copyright (C) 2012,2014 Stefano Sanfilippo. # See LICENSE.txt in the main source package for more information # from __future__ import with_statement import sys # Ugly ugly trick to give us compatibility both with Py2 and Py3k try: import ...
<|file_name|>sha512.go<|end_file_name|><|fim▁begin|>package hash <|fim▁hole|>// Hashing with SHA512 func HashSHA512(input string) string { return HashWith(sha512.New(), input) }<|fim▁end|>
import "crypto/sha512"
<|file_name|>test_configuration.py<|end_file_name|><|fim▁begin|># tests/test_configuration.py # vim: ai et ts=4 sw=4 sts=4 ft=python fileencoding=utf-8 from io import StringIO from pcrunner.configuration import ( read_check_commands, read_check_commands_txt, read_check_commands_yaml, ) def test_read_che...
{ 'command': u'check_dummy.py 0 OK -s 0', 'name': u'CHECK_01',
<|file_name|>tlsconfig_go1_8.go<|end_file_name|><|fim▁begin|>// +build go1.8 /* * * k6 - a next-generation load testing tool * Copyright (C) 2016 Load Impact * * 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 t...
"TLS_ECDHE_RSA_WITH_RC4_128_SHA": tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export default class UnitOfWork { sortAscending(set: Array<number>): Array<number> { if (!set || set.length === 0) { return []; } if (set.length === 1) { return [set[0]]; } for (let i=1; i<set.length...
} set[z+1] = v; }
<|file_name|>fn.js<|end_file_name|><|fim▁begin|>'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = fn; var _includes = require('utilise/includes'); var _includes2 = _interopRequireDefault(_includes); var _client = require('utilise/client'); var _client2 = _interopRequi...
var proto = Object.create(HTMLElement.prototype),
<|file_name|>import_load_libs.py<|end_file_name|><|fim▁begin|>import unittest import re import os class ImportLoadLibs(unittest.TestCase): """ Test which libraries are loaded during importing ROOT """ # The whitelist is a list of regex expressions that mark wanted libraries # Note that the regex ...
'liblz4', 'libxxhash', 'liblzma',
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015-2019 OpenCraft <contact@opencraft.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
<|file_name|>graphics.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.10.0 var Graphics; Graphics = (function() { function Graphics(ctx, viewport1) { this.ctx = ctx; this.viewport = viewport1; this.transform = { x: 0, y: 0, rotation: 0, scale: 1 }; } Graphi...
return this.ctx.strokeStyle = color; };
<|file_name|>middleware.js<|end_file_name|><|fim▁begin|>var prettyURLs = require('../middleware/pretty-urls'), cors = require('../middleware/api/cors'), urlRedirects = require('../middleware/url-redirects'), auth = require('../../auth'); /** * Auth Middleware Packages * * IMPORTANT * - cors middleware ...
cors, urlRedirects, prettyURLs
<|file_name|>LibertyOP_BasicTests_oauth_usingSocialConfig.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2017, 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available u...
* * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/
<|file_name|>98a6883f88ed207a422bce14e041cea9032231df.js<|end_file_name|><|fim▁begin|>"use strict"; const http_1 = require("http"); const WebSocketServer = require("ws"); const express = require("express"); const dgram = require("dgram"); const readUInt64BE = require("readuint64be"); const buffer_1 = require("buffer");...
<|file_name|>key.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' The Salt Key backend API and interface used by the CLI. The Key class can be used to manage salt keys directly without interfacing with the CLI. ''' # Import python libs from __future__ import absolute_import, print_function import os import ...
shutil.move( os.path.join(
<|file_name|>spectrum_analyzer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import time import numpy as np import matplotlib matplotlib.use('GTKAgg') from matplotlib import pyplot as plt from koheron import connect from drivers import Spectrum from drivers import Laser host...
sampling_rate = 125e6 freq_min = 0 freq_max = sampling_rate / mhz / 2
<|file_name|>ClassNames.ts<|end_file_name|><|fim▁begin|>/** * Class names to use for display elements. */ export interface ClassNames { /** * Class name for the contents container. */ contentArea: string; /** * Class name for each menu's div. */ menu: string; /** * Class...
/** * Class name for the left half of a two-part option. */
<|file_name|>script.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){ //The user will be prompted to continue and go down the page by clicking on an HTML element //The result will be a smooth transition of the word ">>>Continue" and then a smooth scroll down the page //to the next stage of the user's proces...
$(welcomeHeader).hide().delay(2000).appendTo('#optionsBar').fadeIn(100);
<|file_name|>setupenv_windows.py<|end_file_name|><|fim▁begin|>#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full li...
# Installers are available only for Python 2.6/2.7.
<|file_name|>repositoryCache.ts<|end_file_name|><|fim▁begin|>// // Copyright (c) Microsoft. // Licensed under the MIT license. See LICENSE file in the project root for full license information. // import { EntityField} from '../../lib/entityMetadataProvider/entityMetadataProvider'; import { EntityMetadataType, IEntity...
}
<|file_name|>GetFileAndSys.C<|end_file_name|><|fim▁begin|>#include "TString.h" #include "TGraph.h" #include "TGraphErrors.h" #include "TGraphAsymmErrors.h" #include <fstream> #include <Riostream.h> #include <sstream> #include <fstream> using namespace std; TGraphErrors* GetGraphWithSymmYErrorsFromFile(TString txtFileN...
box = new TBox(x+xshift-xwidth,y-fabs(yerr),x+xwidth,y+fabs(yerr)); box->SetLineWidth(0);
<|file_name|>params.js<|end_file_name|><|fim▁begin|>export default { modules: require('glob!./glob.txt'), options: { name: 'Comment',<|fim▁hole|><|fim▁end|>
}, info: true, utils: {}, };
<|file_name|>ios-minus-outline.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { IconBaseProps } from 'react-icon-base';<|fim▁hole|><|fim▁end|>
export default class IoIosMinusOutline extends React.Component<IconBaseProps, any> { }
<|file_name|>jquery-ui-accessible-tabs.js<|end_file_name|><|fim▁begin|>/* Copyright 2008-2009 University of Cambridge Copyright 2008-2009 University of Toronto Licensed under the Educational Community License (ECL), Version 2.0 or the New BSD license. You may not use this file except in compliance with one these Licen...
// Put the tablist in the tab focus order. Take each tab *out* of the tab order // so that they can be navigated with the arrow keys instead of the tab key. fluid.tabbable(tablist);
<|file_name|>core.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- "Main module defining filesystem and file classes" from __future__ import absolute_import import ctypes import logging import os import posixpath import re import warnings import operator import functools from collections import deque from .com...
res = [out[i].to_dict() for i in range(x.value)] if res: _lib.hdfsFreeEncryptionZoneInfo(out, x) return res
<|file_name|>dates_finished.py<|end_file_name|><|fim▁begin|># # Example file for working with date information # (For Python 3.x, be sure to use the ExampleSnippets3.txt file) from datetime import date from datetime import time from datetime import datetime def main(): ## DATE OBJECTS # Get today's date from the ...
print "Date Components: ", today.day, today.month, today.year
<|file_name|>logger.py<|end_file_name|><|fim▁begin|># Higgins - A multi-media server # Copyright (c) 2007-2009 Michael Frank <msfrank@syntaxjockey.com> # # This program is free software; for license information see # the COPYING file.<|fim▁hole|>from higgins.logger import Loggable class UPnPLogger(Loggable): log_...
<|file_name|>data.py<|end_file_name|><|fim▁begin|>## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license import re from dadict import DADict from error import log_loading ####...
<|file_name|>request_redraw_threaded.rs<|end_file_name|><|fim▁begin|>use std::{thread, time}; use simple_logger::SimpleLogger; use winit::{ event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::WindowBuilder, };<|fim▁hole|>fn main() { SimpleLogger::new().init().unwrap(); let ev...