prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>info.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2014-2016 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Founda... | }
// sanity check that Info is a PlaceInfo
var _ PlaceInfo = (*Info)(nil) |
<|file_name|>outline.mako.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/. */
<%namespace name="helpers" file="/helpers.mako.rs" />
<... | }
}
</%helpers:shorthand>
|
<|file_name|>HuffmanAllocator.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2011 Matthew Francis
*
* 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 ... | case 2:
array[1] = 1;
case 1:
array[0] = 1; |
<|file_name|>depends.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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/license... | extern crate needs_panic_runtime; |
<|file_name|>test_orcid.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2016 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either v... |
from inspirehep.utils.record_getter import get_db_record
from invenio_accounts.models import User |
<|file_name|>vgrid.py<|end_file_name|><|fim▁begin|># encoding: utf-8
'''
Various vertical coordinates
Presently, only ocean s-coordinates are supported. Future plans will be to
include all of the vertical coordinate systems defined by the CF conventions.
'''
__docformat__ = "restructuredtext en"
import numpy as np
i... |
def _get_Cs_r(self): |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from flask import Flask
from . import config
from . import ElaborateCharts
app = Flask(__name__)
app.config['SECRET_KEY'] = config.SECRET_KEY
charts = ElaborateCharts(app)
<|fim▁hole|> app.run(host='127.0.0.1', debug=True)<|fim▁end|> |
if __name__ == '__main__': |
<|file_name|>handshakecryptoowner.rs<|end_file_name|><|fim▁begin|>use constants::*;
use utils::*;
use crypto_types::*;
use cipherstate::*;
pub struct HandshakeCryptoOwner<R: RandomType + Default,
D: DhType + Default,
C: CipherType + Default,
... | has_s: false,
has_e: false, |
<|file_name|>event-simulate.js<|end_file_name|><|fim▁begin|>YUI.add('event-simulate', function (Y, NAME) {
(function() {
/**
* Simulate user interaction by generating native DOM events.
*
* @module event-simulate
* @requires event
*/
//shortcuts
var L = Y.Lang,
isFunction = L.isFunction,
isString =... | customEvent = Y.config.doc.createEvent("TouchEvent");
|
<|file_name|>LocationInfo.java<|end_file_name|><|fim▁begin|>package com.example.currentplacedetailsonmap.data;
import java.io.Serializable;
public class LocationInfo implements Serializable {
private String placeid;
private String lat;
private String lng;
private String vicinity; //addr
private String tel;
pr... | }
public void setLng(String lng) {
this.lng = lng; |
<|file_name|>win32_aclui.py<|end_file_name|><|fim▁begin|># pylint:disable=line-too-long
import logging
from ...sim_type import SimTypeFunction, SimTypeShort, SimTypeInt, SimTypeLong, SimTypeLongLong, SimTypeDouble, SimTypeFloat, SimTypePointer, SimTypeChar, SimStruct, SimTypeFixedSizeArray, Sim... | |
<|file_name|>CalculateS.py<|end_file_name|><|fim▁begin|># Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: G... | |
<|file_name|>comment.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import collections
import httplib as http
import pytz
from flask import request
from modularodm import Q
from framework.exceptions import HTTPError
from framework.auth.decorators import must_be_logged_in
from framework.auth.utils import priv... | {
'id': privacy_info_handle(user._id, anonymous),
'url': privacy_info_handle(user.url, anonymous), |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from openerp import models, fields
class AccountBankStatementLine(models.Model):
_inherit = "account.bank.statement.line"
name = fields.Char(
string='Memo',
required=False,
default="",<|fim▁hole|><|fim▁end|> | ) |
<|file_name|>sqlcreatetable.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2014-2016, Santili Y-HRAH KRONG
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of sour... | |
<|file_name|>corsym.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! Common Language Runtime Debugging Symbol Reader/Writer/Binder Interfaces
DEFINE_GUID!(CorSym_LanguageType_C, 0x63a08714, 0xfc37, 0x11d2,
0x90, 0x4c, 0x0, 0xc0, 0x4f, 0xa3, 0x02,... | ADDR_NATIVE_REGREL = 4, |
<|file_name|>GameView.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2005 Wolfgang Becker <uafr@gmx.de>
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 2 of the License, or
(at your... | |
<|file_name|>PythonServer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# 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 fil... | from tutorial.ttypes import InvalidOperation, Operation
from shared.ttypes import SharedStruct |
<|file_name|>gingerAle.js<|end_file_name|><|fim▁begin|>recipes['Fiery Ginger Ale (2L)'] = {
type: 'Fiery Ginger Ale (2L)',
volume: '2L',
brewTime: [
'2 days',<|fim▁hole|> ],
ingredients: [
'1.5 oz. finely grated fresh ginger (the younger the better; microplane suggested)',
'6 ... | |
<|file_name|>Block.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* 블럭 모델
*
* @class Block
*
* @exception {Error} Messages.CONSTRUCT_ERROR
* 아래 문서의 1.3 Models Folder의 항목 참조
* @link https://github.com/Gaia3D/F4DConverter/blob/master/doc/F4D_SpecificationV1.pdf
*/
var Block = function()
{
if (!(this insta... | this.radius = undefined; |
<|file_name|>filters.rs<|end_file_name|><|fim▁begin|>//! Public, no-mangle API to create additional filters<|fim▁hole|><|fim▁end|> | //! via external plugins. |
<|file_name|>AppActionCreators.js<|end_file_name|><|fim▁begin|>import AppDispatcher from '../dispatcher/AppDispatcher';
import AppConstants from '../constants/AppConstants';
const ActionTypes = AppConstants.ActionTypes;
export function showMenu() {
AppDispatcher.dispatchViewAction(ActionTypes.SHOW_MENU);
}
export ... | }
export function showModal() { |
<|file_name|>Kaithi-regex.js<|end_file_name|><|fim▁begin|>// Regular expression that matches all symbols in the `Kaithi` script as per Unicode v6.0.0:<|fim▁hole|>/\uD804[\uDC80-\uDCC1]/;<|fim▁end|> | |
<|file_name|>structshyft_1_1timeseries_1_1d__ref__t_3_01_t_00_01typename_01enable__if_3_01is__shared__ptr_3_0a96d8130ed21daa23ed2d27c0d825333.js<|end_file_name|><|fim▁begin|>var structshyft_1_1timeseries_1_1d__ref__t_3_01_t_00_01typename_01enable__if_3_01is__shared__ptr_3_0a96d8130ed21daa23ed2d27c0d825333 =
[
[ "ty... | ]; |
<|file_name|>test_svnimplementation.py<|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 licens... | |
<|file_name|>drs.py<|end_file_name|><|fim▁begin|># implement samba_tool drs commands
#
# Copyright Andrew Tridgell 2010
# Copyright Andrew Bartlett 2017
#
# based on C implementation by Kamen Mazdrashki <kamen.mazdrashki@postpath.com>
#
# This program is free software; you can redistribute it and/or modify
# it under t... | '''make a ldap connection to the server''' |
<|file_name|>metadata.go<|end_file_name|><|fim▁begin|>package handler
import (
"encoding/base64"
"encoding/pem"
"github.com/amdonov/lite-idp/config"
"io/ioutil"
"log"
"net/http"
"text/template"
)
type metadataHandler struct {
template *template.Template
Configuration *config.Configuration
Certificate ... | <AttributeService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP"
Location="{{ .Configuration.BaseURL }}{{ .Configuration.Services.AttributeQuery }}"/>
<NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName</NameIDFormat> |
<|file_name|>user_service.go<|end_file_name|><|fim▁begin|>package testing
import (
"bytes"
"context"
"sort"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/influxdata/influxdb/v2"
"github.com/influxdata/influxdb/v2/kit/platform"
"github.com/influxdata/influxdb/v2/kit/platform/errors"
"github.com/influxd... | t.Errorf("users are different -got/+want\ndiff %s", diff)
} |
<|file_name|>CoreTask.py<|end_file_name|><|fim▁begin|>from GangaCore.GPIDev.Lib.Tasks import ITask
from GangaCore.GPIDev.Schema import Schema, Version
<|fim▁hole|>class CoreTask(ITask):
"""General non-experimentally specific Task"""
_schema = Schema(Version(1, 0), dict(ITask._schema.datadict.items()))
_ca... | ########################################################################
|
<|file_name|>respond.py<|end_file_name|><|fim▁begin|># Contains functionality for responses
import numpy as np
import astropy.io.fits as fits
__all__ = ["RMF", "ARF"]
class RMF(object):
def __init__(self, filename):
self._load_rmf(filename)
pass
def _load_rmf(self, filename):
"""
... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from polls.models import Choice, Poll
class ChoiceInline(admin.TabularInline):
model = Choice
extra = 3
class PollAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['question']}),
('D... | ]
inlines = [ChoiceInline]
list_display = ('question','pub_date')
|
<|file_name|>tests_iso_14443_a_card_1_hydranfc_v2.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def test_iso_14443_a_card_1_generic(hydranfc_connection):
hn = Iso14443ASession(drv=hydranfc_connection, block_size=120)
hn.connect()
hn.field_off()
time.sleep(0.1)
hn.field_on()
hn.polling()
r ... | import time
from pynfcreader.sessions.iso14443.iso14443a import Iso14443ASession |
<|file_name|>323calfflac2.cpp<|end_file_name|><|fim▁begin|>/*
ID: s0000151
PROG: calfflac
LANG: C++
*/
#include<stdio.h>
#define DEBUG 1
main(){
if(!DEBUG){freopen("calfflac.in","r",stdin);
freopen("calfflac.out","w",stdout);}
<|fim▁hole|>
if(DEBUG)scanf(" ");
}<|fim▁end|> | |
<|file_name|>humor_hangoutcalls.py<|end_file_name|><|fim▁begin|>import time
import plugins
import hangups
def _initialise(bot):
plugins.register_handler(on_hangout_call, type="call")
def on_hangout_call(bot, event, command):
if event.conv_event._event.hangout_event.event_type == hangups.schemas.ClientHang... | else:
"""subsequent calls for a GROUP""" |
<|file_name|>test_nums.py<|end_file_name|><|fim▁begin|>import eqpy
import sympy
from eqpy._utils import raises
def test_constants():
assert eqpy.nums.Catalan is sympy.Catalan<|fim▁hole|> assert eqpy.nums.nan is sympy.nan
assert eqpy.nums.oo is sympy.oo
assert eqpy.nums.pi is sympy.pi
assert eqpy.nu... | assert eqpy.nums.E is sympy.E
assert eqpy.nums.EulerGamma is sympy.EulerGamma
assert eqpy.nums.GoldenRatio is sympy.GoldenRatio
assert eqpy.nums.I is sympy.I |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>"""This module implement decorators for wrapping data sources so as to
simplify their construction and attribution of properties.
"""
import functools
<|fim▁hole|>
"""
def _decorator(func):
@functools.wraps(func)
def _properties(settings... | def data_source_generator(name=None, **properties):
"""Decorator for applying to a simple data source which directly
returns an iterable/generator with the metrics for each sample. The
function the decorator is applied to must take no arguments. |
<|file_name|>test_iosxe.py<|end_file_name|><|fim▁begin|>"""
Tests are performed against csr1000v-universalk9.03.15.00.S.155-2.S-std.
"""
import unittest
from iosxe.iosxe import IOSXE
from iosxe.exceptions import AuthError
node = '172.16.92.134'
username = 'cisco'
password = 'cisco'
port = 55443
class TestIOSXE(unit... | self.assertRaises(AuthError, IOSXE, node=node, username='stuff', password='things',
disable_warnings=True)
|
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate eve;
extern crate getopts;
extern crate url;
extern crate core;
use std::thread;
use std::env;
use getopts::Options;
use std::net::SocketAddr;
use core::str::FromStr;
use eve::server;
use eve::login;
#[allow(dead_code)]
fn main() {
... | let default_addr = SocketAddr::from_str("0.0.0.0:8080").unwrap();
let addr = match matches.opt_str("f") {
Some(ip) => { |
<|file_name|>gzip.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package gzip
import (
"bufio"
"errors"
"fmt"
"io"
"net"
"net/http"
"regexp"
"strconv"
"strings"
... | writerPool.Put(poolWriter) |
<|file_name|>des_c.py<|end_file_name|><|fim▁begin|># This file is part of 'NTLM Authorization Proxy Server' http://sourceforge.net/projects/ntlmaps/
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# This library is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gen... | d = ((d >> 2)|(d << 26))
else:
c = ((c >> 1)|(c << 27)) |
<|file_name|>ExampleSimple.java<|end_file_name|><|fim▁begin|>package examples.Bricklet.Moisture;
import com.tinkerforge.BrickletMoisture;
import com.tinkerforge.IPConnection;
public class ExampleSimple {
private static final String host = "localhost";
private static final int port = 4223;
private static final Strin... | ipcon.connect(host, port); // Connect to brickd
// Don't use device before ipcon is connected
|
<|file_name|>multipartner.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP module
# Copyright (C) 2010 Micronaet srl (<http://www.micronaet.it>)
#
# Italian OpenERP Community (<http://www.openerp-italia.com... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use super::core::{
af_array, dim_t, AfError, Array, ComplexFloating, ConvDomain, ConvMode, FloatingPoint,
HasAfEnum, InterpType, RealFloating, HANDLE_ERROR,
};
use libc::{c_double, c_float, c_int, c_uint, size_t};
use num::Complex;
extern "C" {
fn af_approx... | inp: af_array,
pos0: af_array,
interp_dim0: c_int, |
<|file_name|>TableLayout.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2014
*
* 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
*
* ... | getWidth(), rowHeight, cols);
}
}
} |
<|file_name|>dpy.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Copyright 2009-2014 by Luc Saffre.
# License: BSD, see file LICENSE for more details.
"""
Documented in :ref:`dpy`.
"""
import logging
logger = logging.getLogger(__name__)
from StringIO import StringIO
import os
import imp
from decimal impo... | #~ def end_serialization(self):
#~ pass
#~ def start_object(self, obj):
#~ self._current = {} |
<|file_name|>flow.py<|end_file_name|><|fim▁begin|>'''
David Rodriguez
Goal: Continuously looping while to perform valve actions at specified times,
introduce substance at a specific ratio based on flow data, recording
and saving flow data, and actuating a flush at a specified time.
Inputs: A schedule of events... | |
<|file_name|>features.rs<|end_file_name|><|fim▁begin|>//! Feature tests for OS functionality
pub use self::os::*;
#[cfg(any(target_os = "linux", target_os = "android"))]
mod os {
use sys::utsname::uname;
// Features:
// * atomic cloexec on socket: 2.6.27
// * pipe2: 2.6.27
// * accept4: 2.6.28
... | 1 => digit(&mut minor, b),
_ => digit(&mut patch, b), |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { key, CustomLocale } from "../types/locale";
import { Arabic as ar } from "./ar";
import { Bulgarian as bg } from "./bg";
import { Bangla as bn } from "./bn";
import { Catalan as cat } from "./cat";
import { Czech as cs } from "./cs";
import { Welsh as cy } fr... | pl,
pt,
ro,
ru, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2018 OpenSynergy Indonesia
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import hr_certification<|fim▁hole|><|fim▁end|> | from . import hr_training_participant |
<|file_name|>texthtmlbuilder.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of the Grantlee template system.
Copyright (c) 2008 Stephen Kelly <steveire@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as publis... | if ( height != 0 ) d->m_text.append( QString::fromLatin1( "height=\"%2\" " ).arg( height ) ); |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2014 Thomas Perl and the gPodder Team
# Copyright (c) 2011 Neal H. Walfield
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the G... |
def format_filesize(bytesize, use_si_units=False, digits=2):
""" |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Nick Fitzgerald
//
// 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
//... | Ok(form) => {
match eval::evaluate(heap, &form, location) {
Ok(val) => println!("{}", *val),
Err(e) => println!("{}", e), |
<|file_name|>pattern-tyvar-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Track and report errors, exceptions and messages from your Rust application to Rollbar.
pub extern crate backtrace;
extern crate futures;
extern crate hyper;
extern crate hyper_tls;
extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crat... | }
impl<'a> ReportBuilder<'a> { |
<|file_name|>value.py<|end_file_name|><|fim▁begin|>import numbers
from six import string_types
from pypif.obj.common.pio import Pio
from pypif.obj.common.scalar import Scalar
from pypif.obj.common.file_reference import FileReference
class Value(Pio):
"""
Information about a scalar, vector, or matrix, or a lis... | |
<|file_name|>external_load_balancer_attachment.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/li... | AutoscalingGroup *AutoscalingGroup |
<|file_name|>test_init.py<|end_file_name|><|fim▁begin|>"""The tests for the logbook component."""
# pylint: disable=protected-access,invalid-name
import collections
from datetime import datetime, timedelta
import json
import unittest
import pytest
import voluptuous as vol
from homeassistant.components import logbook,... | },
}
) |
<|file_name|>inspector.py<|end_file_name|><|fim▁begin|># This is just a simple example of how to inspect ASTs visually.
#
# This can be useful for developing new operators, etc.
import ast
from cosmic_ray.mutating import MutatingCore
from cosmic_ray.operators.comparison_operator_replacement import MutateComparisonOper... | operator = MutateComparisonOperator(core)
new_node = operator.visit(node)
print()
print(ast.dump(new_node)) |
<|file_name|>setup-driver.js<|end_file_name|><|fim▁begin|>const webdriver = require('selenium-webdriver');
const setupDriver = (browser) => {
const driver = new webdriver
.Builder()
.usingServer('http://localhost:9515/')
.withCapabilities({
browserName: browser,
})
... |
module.exports = { setupDriver }; |
<|file_name|>sale_stock.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistri... | })
sale_line_obj = self.pool.get('sale.order.line')
invoice_line_obj = self.pool.get('account.invoice.line')
sale_line_ids = sale_line_obj.search(cr, uid, [('order_id', '=', move.procurement_id.sale_line_id.order_id.id), ('invoiced', '=', False), '|', ('product_id', '=', ... |
<|file_name|>cell.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licen... | //!
//! struct Rc<T> {
//! ptr: *mut RcBox<T> |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>var Base64 = new function() {
this.encode = function(string) {
return window.btoa(string);
};
this.urlSafeEncode = function(string) {
return this.encode(string).replace('+', '-').replace('/', '_');
};
this.decode = function(base64) {
try {... | b = b.charCodeAt(0).toString(16).toUpperCase();
if (b.length === 1) { |
<|file_name|>sale_line_invoice.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can r... | tree_res = ir_model_data.get_object_reference(cr, uid, 'account', 'invoice_tree') |
<|file_name|>Picklist.js<|end_file_name|><|fim▁begin|>/*+***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Origin... |
registerModulePickListChangeEvent : function() { |
<|file_name|>openvswitch_bridge.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
#
# Portions copyright @ 2015 VMware, Inc.
#
# This file is part of Ansible
#
# This module is free software: you can redistribute it and/or modify
# it under the t... | ##
# Change and add existing external ids.
exp_external_ids = self.module.params['external_ids'] |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"net/http"
"github.com/go-on/wrap"
"github.com/go-on/wrap-contrib/wraps"
"github.com/go-on/router"
// "github.com/go-on/wrap-contrib/helper"<|fim▁hole|> rw.Write([]byte("not found"))
}
func main() {
rt := router.New()
rt.GET("/", wraps.... | )
func missing(rw http.ResponseWriter, req *http.Request) {
rw.WriteHeader(404) |
<|file_name|>issue-10636-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/l... | // option. This file may not be copied, modified, or distributed |
<|file_name|>cell_x.go<|end_file_name|><|fim▁begin|>package bugreports
import "github.com/cheekybits/genny/generic"
// X is the type generic type used in tests
type X generic.Type
// CellX is result of generating code via genny for type X
type CellX struct {
Value X
}
const constantX = 1
func funcX(p CellX) {}
/... | if aCellX != anotherCellX { |
<|file_name|>babel.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
flaskext.babel
~~~~~~~~~~~~~~
Implements i18n/l10n support for Flask applications based on Babel.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_... | datetime = get_timezone().localize(datetime)
return datetime.astimezone(UTC).replace(tzinfo=None) |
<|file_name|>admin_crud.ts<|end_file_name|><|fim▁begin|>/*
* Copyright 2019 ThoughtWorks, 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/LI... | import {ApiRequestBuilder, ApiVersion} from "helpers/api_request_builder";
import SparkRoutes from "helpers/spark_routes"; |
<|file_name|>la.py<|end_file_name|><|fim▁begin|>r"""
This module contains linear algebra solvers for SparseMatrices,
TPMatrices and BlockMatrices.
"""
import numpy as np
from numbers import Number, Integral
from scipy.sparse import spmatrix, kron
from scipy.sparse.linalg import spsolve, splu
from scipy.linalg import so... |
if len(constraints) > 0:
if b.ndim > 1: |
<|file_name|>dprectool.cpp<|end_file_name|><|fim▁begin|>/*
Drawpile - a collaborative drawing program.
Copyright (C) 2014-2019 Calle Laakkonen
Drawpile 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 Foundati... | fprintf(stderr, "Unable to read input file: %s\n", qPrintable(reader.errorString()));
return false;
|
<|file_name|>test_node_to_node_quota.py<|end_file_name|><|fim▁begin|>from copy import copy
import pytest
from plenum.common.stacks import nodeStackClass
from plenum.common.util import randomString
from stp_core.loop.eventually import eventually
from stp_core.network.auth_mode import AuthMode
from stp_core.network.port... | |
<|file_name|>0006_auto_20170918_1954.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-09-18 19:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('coursedashboards', '0005_auto... | |
<|file_name|>ErrorPos.js<|end_file_name|><|fim▁begin|>define(["Log","FS"],function (Log,FS) {//MODJSL
return function showErrorPos(elem, err) {
var mesg, src, pos;
if (!err) {
close();
return;
}
var row,col;
if (err.isTError) {
mesg=err.mesg;
src=err.src;
pos=... | var lines=str.split(/\n/);
for (var i=0 ; i<lines.length && i+1<pos.row ; i++) { |
<|file_name|>exponential.py<|end_file_name|><|fim▁begin|>"""
Class representing an exponential distribution, allowing us to sample from it.
"""
from numpy.random import exponential<|fim▁hole|># Exponential draws
def exponential_draw(lambdax):
scale = 1.0 / lambdax
return exponential(scale=scale,size=None)
... | |
<|file_name|>bitcoin_hi_IN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="hi_IN" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Cockcoin Core</source>
<translation type=... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""Main urls.py for the ``pythonsingapore.com`` project."""
from django.conf import settings
from django.conf.urls.defaults import patterns, include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.staticfiles.urls imp... | sitemaps['cmspages'] = CMSSitemap() |
<|file_name|>thumbnail.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# This contains a 128x128 px thumbnail in PNG format
# Taken from http://www.zwahlendesign.ch/en/node/20
# openoffice_icons/openoffice_icons_linux/openoffice11.png
# License: Freeware
import base64
iconstr = """\
iVBORw0KG... | |
<|file_name|>syncer.rs<|end_file_name|><|fim▁begin|>use postgres;
use serde_json;
use std;
use std::fmt::Debug;
use std::iter::Iterator;
use std::collections::BTreeMap;
use serde::{Serialize,Deserialize};
use errors::*;
pub struct Comm<I: std::iter::Iterator<Item=T>, J: std::iter::Iterator<Item=T>, T: Clone + Eq + Ord... | |
<|file_name|>Timeval.cc<|end_file_name|><|fim▁begin|>/*
* Timeval.cc -- time arithmetic
*
* (c) 2003 Dr. Andreas Mueller, Beratung und Entwicklung
*
* $Id: Timeval.cc,v 1.7 2009/01/10 19:00:25 afm Exp $
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif /* HAVE_CONFIG_H */
#include <Timeval.h>
#ifdef HAVE_MATH_H
... | |
<|file_name|>pullCharityData.py<|end_file_name|><|fim▁begin|>import urllib2
import wikipedia
import json
from bs4 import BeautifulSoup
if __name__ == '__main__':
wikipedia.set_rate_limiting(True)
charity_list_url = 'List_of_charitable_foundations'
wikipage_list = wikipedia.page(charity_list_url)
charit... | try:
wikipage_charity = wikipedia.page(charity_name)
name = charity_name
print 'Processing : %s'%name |
<|file_name|>dx.messages.cs.js<|end_file_name|><|fim▁begin|>/*!
* DevExtreme (dx.messages.cs.js)
* Version: 20.2.7
* Build date: Thu Apr 22 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
"use strict";
! funct... | "dxDiagram-unitPx": "TODO",
"dxDiagram-dialogButtonOK": "TODO",
|
<|file_name|>_baseIsNative.ts<|end_file_name|><|fim▁begin|>import { isFunction } from './isFunction';
/**
* Used to match `RegExp`
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
*/
import { isObject } from './isObject';
import { isMasked } from './_isMasked';
import { toSource } fr... | const reIsNative = RegExp(
'^' + |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from picamera.exc import PiCameraError
from picamera.camera import PiCamera<|fim▁end|> | |
<|file_name|>trace.py<|end_file_name|><|fim▁begin|>import sys
from pdb import Pdb
from ipdb.__main__ import update_stdout, def_colors, wrap_sys_excepthook
class Tdb(Pdb):
def __init__(self, *args, **kwargs):
Pdb.__init__(self, *args, **kwargs)
self.botframe = None
self.quitting = False
... | self.set_step() |
<|file_name|>alltest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# vim: ai ts=4 sts=4 et sw=4
# Copyright (c) 2009 Intel Corporation
#
# 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 Fou... | |
<|file_name|>ConfigurableWebBindingInitializer.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2002-2018 the original author or 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
... | |
<|file_name|>professor.py<|end_file_name|><|fim▁begin|>from . import db
from .assoc import section_professor
class Professor(db.Model):
__tablename__ = 'professors'
id = db.Column(db.Integer, primary_key=True)<|fim▁hole|>
university_id = db.Column(db.Integer, db.ForeignKey('universities.id'), nullable=Fa... | user_id = db.Column(db.Integer, db.ForeignKey('users.id'), unique=True)
first_name = db.Column(db.Text, nullable=False)
last_name = db.Column(db.Text) |
<|file_name|>CRemoteControlData.cpp<|end_file_name|><|fim▁begin|>// Qt
#include <QDateTime>
// Application
#include "CRemoteControlData.h"
//-------------------------------------------------------------------------------------------------
quint32 CFileTransferData::m_ulNextTransferID = 1;
CFileTransferData::CFileTr... | |
<|file_name|>filter.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either ver... | |
<|file_name|>webglquery.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::WebGL2Render... | query_result_available: Cell<Option<u32>>,
query_result: Cell<u32>, |
<|file_name|>tray_item.py<|end_file_name|><|fim▁begin|>import dataStructures
import logging, os
log = logging.getLogger("tray_item")
log.setLevel(logging.WARN)
class TrayItem:
"""
Parent Class for all items in a tray.
"""
<|fim▁hole|> def __init__(self):
self.selected = False
... | |
<|file_name|>PasswordResetRequestDAO.java<|end_file_name|><|fim▁begin|>package fi.pyramus.dao.users;
import java.util.Date;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
imp... | return getSingleResult(entityManager.createQuery(criteria));
} |
<|file_name|>_rangebreaks.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class RangebreaksValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="rangebreaks", parent_name="layout.xaxis", **kwargs):
super(RangebreaksValidator, self).__init__(
... | dvalue
Sets the size of each `values` item. The |
<|file_name|>0002_auto__add_field_subscription_paid.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration<|fim▁hole|>
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Subscription.paid'
db.add_c... | from django.db import models
|
<|file_name|>check_static.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/li... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __version__ = '20.0.0' |
<|file_name|>install.py<|end_file_name|><|fim▁begin|>import os
import cv2
import sys
import math
import time
import json
import argparse
import numpy as np
from ownLibraries.pathsandnames import PathsAndNames
debug = False
nuevaLocalizacion = ''
# We get the current working git branch
gitBranches = os.popen('git branc... | indices.append((punto0+i*pasoHorizontal+j*pasoVertical).tolist())
#print('len of indices', len(indices)) |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for geodjango_smurfs project.
It exposes the WSGI callable as a module-level variable named ``application``.
<|fim▁hole|>"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geodjango_smurfs... | For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.