prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>0006_auto_20150916_0219.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
<|fim▁hole|> dependencies = [
migrations.swappable_dependenc... | |
<|file_name|>RowLockManager.cpp<|end_file_name|><|fim▁begin|>#include "include/global.h"
#include "alinous.lock/ConcurrentGate.h"
#include "alinous.db.table.lockmonitor/IDatabaseLock.h"
#include "alinous.db.table.lockmonitor/RowLock.h"
#include "alinous.db.table.lockmonitor/IThreadLocker.h"
#include "alinous.db.table... | {
__GC_MV(this, &(this->table), table, IDatabaseTable); |
<|file_name|>auth_saml.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
from openerp.osv import fields
from openerp.osv import osv
import lasso
import simplejson
class auth_saml_provider(osv.osv):
"""Class defining the configuration values of an Saml2 provider"""<|fim▁hole|>
_name = 'auth.saml.provid... | |
<|file_name|>ensure_exception_handled.py<|end_file_name|><|fim▁begin|>import traceback
class EnsureExceptionHandledGuard:
"""Helper for ensuring that Future's exceptions were handled.
This solves a nasty problem with Futures and Tasks that have an
exception set: if nobody asks for the exception, the exce... | |
<|file_name|>tech-docs.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|><|fim▁end|> | exports.baseTechPath = require.resolve('./level-proto.js'); |
<|file_name|>SkScan_AAAPath.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 The Android Open Source Project
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "include/core/SkPath.h"
#include "include/core/SkRegion.h"
#include "include/private/... | // We need fSavedDY because the (quad or cubic) edge might be updated
blit_trapezoid_row(
blitter,
y, |
<|file_name|>dos_files.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2002-2010 The DOSBox Team
*
* 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, ... | return false;
}
// Create File |
<|file_name|>yieldoneBidAdapter_spec.js<|end_file_name|><|fim▁begin|>import { expect } from 'chai';
import { spec } from 'modules/yieldoneBidAdapter.js';
import { newBidder } from 'src/adapters/bidderFactory.js';
import { deepClone } from 'src/utils.js';
const ENDPOINT = 'https://y.one.impact-ad.jp/h_bid';
const USER_... | userId: undefined,
}, |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>WSGI config for Carkinos project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi im... | |
<|file_name|>costMemory.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
@file costMemory.py
@author Jakob Erdmann
@author Michael Behrisch
@date 2012-03-14
@version $Id: costMemory.py 22608 2017-01-17 06:28:54Z behrisch $
Perform smoothing of edge costs across successive iterations of duaIterate
S... | from __future__ import absolute_import
import os |
<|file_name|>plane.rs<|end_file_name|><|fim▁begin|>extern crate tray_rust;
extern crate rand;
extern crate image;
use std::sync::Arc;
use rand::StdRng;
use tray_rust::linalg::{AnimatedTransform, Transform, Point, Vector};
use tray_rust::film::{Colorf, RenderTarget, Camera, ImageSample};
use tray_rust::film::filter::M... | };
} |
<|file_name|>models.go<|end_file_name|><|fim▁begin|>//go:build go1.9
// +build go1.9
<|fim▁hole|>// Licensed under the MIT License. See License.txt in the project root for license information.
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder
package eventhubapi
import... | // Copyright (c) Microsoft Corporation. All rights reserved. |
<|file_name|>chain_decay.py<|end_file_name|><|fim▁begin|># coding=utf-8
<|fim▁hole|>#
# This file is part of ReaDDy.
#
# ReaDDy is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the ... | # Copyright © 2016 Computational Molecular Biology Group,
# Freie Universität Berlin (GER) |
<|file_name|>shape_detection_with_callback.cpp<|end_file_name|><|fim▁begin|>#if defined (_MSC_VER) && !defined (_WIN64)
#pragma warning(disable:4244) // boost::number_distance::distance()
// converts 64 to 32 bits integers
#endif
#include <CGAL/Exact_predicates_inexact_constructions_kerne... | <Kernel, Pwn_vector, Point_map, Normal_map> Traits;
typedef CGAL::Shape_detection_3::Efficient_RANSAC<Traits> Efficient_ransac;
typedef CGAL::Shape_detection_3::Region_growing<Traits> Region_growing; |
<|file_name|>backend_test.go<|end_file_name|><|fim▁begin|>package cert
import (
"context"
"crypto/rand"
"net/http"
"golang.org/x/net/http2"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"fmt"
"io"
"io/ioutil"
"math/big"
"net"
"os"
"reflect"
"testing"
"time"
cleanhttp "github.com/hashi... | }
|
<|file_name|>test.py<|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/.
from __future__ import absolute_import, print_function, unicode_litera... | rv[test_platform] = cfg.copy() |
<|file_name|>basic.2.go<|end_file_name|><|fim▁begin|>package main
import "fmt"
import "math"
func main() {
fmt.Println("hello world")
fmt.Printf("%t\n", 1==2)
fmt.Printf("二进制:%b\n", 255)
fmt.Printf("八进制:%o\n", 255)
fmt.Printf("十六进制:%X\n", 255)
fmt.Printf("十进制:%d\n", 255)
fmt.Printf("浮点数:%... |
const s string = "hello world"
const pi float32 = 3.1415926
} |
<|file_name|>Rectangulo.java<|end_file_name|><|fim▁begin|>public class Rectangulo {
public int Base;
public int Altura;
//Ejercicio realizado con ayuda de esta pagina:http://diagramas-de-flujo.blogspot.com/2013/02/calcular-perimetro-rectangulo-Java.html
//aqui llamamos las dos variables que utilizaremos.
Rectangulo... | } |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// MIT Licensed
exports.GridFS = require('./lib/GridFS');
exports.GridStream = require('./lib/GridStream');<|fim▁end|> | // GridFS
// Copyright(c) 2013 Siddharth Mahendraker <siddharth_mahen@me.com> |
<|file_name|>topic_stats_auth_decorator.cc<|end_file_name|><|fim▁begin|><|fim▁hole|>//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
... | // Copyright 2022 Google LLC |
<|file_name|>modulefs.py<|end_file_name|><|fim▁begin|>import json
import os
import os.path
import types
from django.conf import settings
from models import FSExpirations
if settings.DJFS['type'] == 'osfs':
from fs.osfs import OSFS
elif settings.DJFS['type'] == 's3fs':
from fs.s3fs import S3FS
from boto.s... | raise AttributeError("Bad filesystem: "+str(settings.DJFS['type']))
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
mod test_cache_fill;
mod test_reader;<|fim▁hole|>mod test_writer;
mod util;<|fim▁end|> | |
<|file_name|>capa_base.py<|end_file_name|><|fim▁begin|>"""Implements basics of Capa, including class CapaModule."""
import cgi
import copy
import datetime
import hashlib
import json
import logging
import os
import traceback
import struct
import sys
import re
# We don't want to force a dependency on datadog, so make th... | ['Traceback (most recent call last):\n'] +
traceback.format_tb(sys.exc_info()[2])
)
) |
<|file_name|>uCursor.py<|end_file_name|><|fim▁begin|>"""Module for testing cursor objects."""
import cx_Oracle
class TestCursor(BaseTestCase):
def testExecuteNoArgs(self):
"""test executing a statement without any arguments"""
result = self.cursor.execute(u"begin null; end;")
self.failUnl... | """test that bindnames() works correctly."""
self.failUnlessRaises(cx_Oracle.ProgrammingError,
self.cursor.bindnames)
self.cursor.prepare(u"begin null; end;") |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
<|fim▁hole|>admin.site.register(Callout, WidgyAdmin)<|fim▁end|> | from widgy.admin import WidgyAdmin
from widgy.contrib.page_builder.models import Callout
|
<|file_name|>S11.12_A2.1_T3.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
/**<|fim▁hole|> * @path ch11/11.12/S11.12_A2.1_T3.js
* @description If ToBoolean(x) is true and GetBase(y) is null, throw ReferenceError
*/
//CHECK#1
try {
true ? y : false;
$ERROR('#1.1: true... | * Operator x ? y : z uses GetValue
* |
<|file_name|>terrain.rs<|end_file_name|><|fim▁begin|>//! Read and draw terrain data in 3D.
use gl;
use yaglw::gl_context::GLContext;
use yaglw::shader::Shader;
#[allow(missing_docs)]
pub struct TerrainShader<'a> {
#[allow(missing_docs)]
pub shader: Shader<'a>,
}
impl<'a> TerrainShader<'a> {
#[allow(missing_doc... |
uniform samplerBuffer positions;
uniform samplerBuffer normals;
|
<|file_name|>md5.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import hashlib
<|fim▁hole|>#print md5_hex('swaranga@gmail.com'), "\n";
perl_result = "cbc41284e23c8c7ed98f589b6d6ebfd6"
md5 = hashlib.md5()
md5.update('swaranga@gmail.com')
hex1 = md5.hexdigest()
if hex1 == perl_result:
print "ok"
else:
prin... |
# perl
## http://stackoverflow.com/questions/9991757/sha256-digest-in-perl
#use Digest::MD5 qw(md5_hex); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//
// 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... | // Copyright 2021 Google LLC |
<|file_name|>PopupWindowActivity.java<|end_file_name|><|fim▁begin|>package com.carlisle.incubators.PopupWindow;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.carlisle.incubators.R;
<|fim▁hole|>/**
* Created b... | |
<|file_name|>active-roadmap-page.tsx<|end_file_name|><|fim▁begin|>import { connect } from "react-redux"
import { RoadmapPage } from "../components/roadmap-page/roadmap-page"
const getActiveRoadmap = (roadmaps: any[], activeRoadmapId: number) => {
return roadmaps[activeRoadmapId]
}
const mapStateToProps = (state: ... | return {
roadmap: getActiveRoadmap(state.roadmaps, ownProps.params.id)
} |
<|file_name|>advance.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use std::sync::{Arc, Mutex};
use std::time::Duration;
use collections::HashMap;
use concurrency_manager::ConcurrencyManager;
use engine_traits::KvEngine;
use futures::compat::Future01CompatExt;
use ... | Err(e) => {
debug!("resolved-ts check leader error"; "err" =>?e);
None |
<|file_name|>set_webhook_parameters.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
package updates
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"time"
"golang.org/x/net/conte... | func (o *SetWebhookParams) SetContext(ctx context.Context) {
o.Context = ctx
} |
<|file_name|>defaults.py<|end_file_name|><|fim▁begin|>DEBUG = False
BASEDIR = ''
SUBDIR = ''
PREFIX = ''
QUALITY = 85
CONVERT = '/usr/bin/convert'
WVPS = '/usr/bin/wvPS'
PROCESSORS = (
'populous.thumbnail.processors.colorspace',<|fim▁hole|> 'populous.thumbnail.processors.autocrop',
'populous.thumbnail.proces... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() {
let mut sum: u32 = 0;<|fim▁hole|> sum = sum + i;
}
}
println!("The result is: {}", sum);
}<|fim▁end|> |
for i in 1..1000 {
if (i % 3 == 0) || (i % 5 == 0){ |
<|file_name|>ReactTestUtils.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2013 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICEN... | ReactComponent.isValidComponent(inst) &&
inst.constructor === type.componentConstructor
); |
<|file_name|>SubscriptionUpgradePeriod.java<|end_file_name|><|fim▁begin|>package com.iyzipay.model.subscription.enumtype;
public enum SubscriptionUpgradePeriod {
NOW(1),
NEXT_PERIOD(2);
private final Integer value;
SubscriptionUpgradePeriod(Integer value) {
this.value = value;<|fim▁hole|> ... | }
public Integer getValue() { |
<|file_name|>drawplugins.gpr.py<|end_file_name|><|fim▁begin|>#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
#
#
# 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 Foun... | |
<|file_name|>ipng.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2003-2013 Runtime Revolution Ltd.
This file is part of LiveCode.
LiveCode is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License v3 as published by the Free
Software Foundation.
LiveCode is distr... | if (t_success)
t_success = GetGeometry(t_width, t_height);
|
<|file_name|>CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_calloc_52c.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_calloc_52c.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete.la... |
/* goodB2G uses the BadSource with the GoodSink */
void goodB2GSink_c(int64_t * data)
|
<|file_name|>filterField.js<|end_file_name|><|fim▁begin|>'use strict';
var inheritance = require('./../../helpers/inheritance'),
Field = require('./field');
var FilterField = function(){};
inheritance.inherits(Field,FilterField);
FilterField.prototype.isOpen = function(){
return this.world.helper.elementGet... | |
<|file_name|>ftx.go<|end_file_name|><|fim▁begin|>package ftx
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"math"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/thrasher-corp/gocryptotrader/common"
"github.com/thrasher-corp/gocryptotrader/common/crypto"
"github.com/thrashe... | |
<|file_name|>test_iterables.py<|end_file_name|><|fim▁begin|>from textwrap import dedent
from sympy import (
symbols, Integral, Tuple, Dummy, Basic, default_sort_key, Matrix,
factorial, true)
from sympy.combinatorics import RGS_enum, RGS_unrank, Permutation
from sympy.utilities.iterables import (
_partition... | assert flatten(ls, levels=1) == [(-2, -1), (1, 2), (0, 0)]
assert flatten(ls, levels=2) == [-2, -1, 1, 2, 0, 0]
assert flatten(ls, levels=3) == [-2, -1, 1, 2, 0, 0]
|
<|file_name|>browsing_context.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/. */
//! Liberally derived from the [Firefox JS implement... | |
<|file_name|>hostReportError.js<|end_file_name|><|fim▁begin|>/** PURE_IMPORTS_START PURE_IMPORTS_END */
export function hostReportError(err) {<|fim▁hole|>}
//# sourceMappingURL=hostReportError.js.map<|fim▁end|> | setTimeout(function () { throw err; }, 0); |
<|file_name|>PMT.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from acq4.devices.OptomechDevice import OptomechDevice
from acq4.devices.DAQGeneric import DAQGeneric
class PMT(DAQGeneric, OptomechDevice):
def __init__(self, dm, config, name):
self.omConf = {}
for k in ['parentDevice', 'tra... | OptomechDevice.__init__(self, dm, config, name) |
<|file_name|>db.py<|end_file_name|><|fim▁begin|>##
# Copyright 2013-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www... | |
<|file_name|>CloudClusterPrinterStatus.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import List, Union, Dict, Optional, Any
from cura.PrinterOutput.PrinterOutputController import PrinterOutputController
from cura.PrinterOutp... | # \param unique_name: The unique name of the printer in the network. |
<|file_name|>chunk.py<|end_file_name|><|fim▁begin|>"""
Chunk (N number of bytes at M offset to a source's beginning) provider.
Primarily for file sources but usable by any iterator that has both
seek and read( N ).
"""
import os
import base64
import base
import exceptions
import logging
log = logging.getLogger( __nam... | |
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>//! The rpeek library.
//!
//! # License
//!
//! Copyright (c) 2015 by Stacy Prowell. All rights reserved.
//!
//! Licensed under the BSD 2-Clause license. See the file LICENSE
//! that is part of this distribution. This file may not be copied,
//! modified, or dis... | |
<|file_name|>bitrpc.py<|end_file_name|><|fim▁begin|>from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = Servi... | try:
acct = raw_input("Enter an account (optional): ")
mc = raw_input("Minimum confirmations (optional): ") |
<|file_name|>MultipleResourcePackageIntegrationTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* ... | *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
<|file_name|>test_detector.rs<|end_file_name|><|fim▁begin|>use sourcemap::{is_sourcemap_slice, locate_sourcemap_reference, SourceMapRef};
#[test]
fn test_basic_locate() {
let input: &[_] = b"foo();\nbar();\n//# sourceMappingURL=foo.js";
assert_eq!(
locate_sourcemap_reference(input).unwrap(),
So... | assert_eq!( |
<|file_name|>app.po.ts<|end_file_name|><|fim▁begin|>import { browser, element, by } from 'protractor';
<|fim▁hole|>export class ContactsAppClientPage {
navigateTo() {
return browser.get('/');
}
getParagraphText() {
return element(by.css('app-root h1')).getText();
}
}<|fim▁end|> | |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|># This stores all the dialogue related stuff
import screen
class Dialogue(object):
"""Stores the dialogue tree for an individual NPC"""
def __init__(self, npc):
super(Dialogue, self).__init__()
self.npc = npc
self.game = npc.game
self.root = No... |
npcName = None
if self.game.player.notebook.isNpcKnown(self.npc):
npcName = self.npc.firstName + " " + self.npc.lastName |
<|file_name|>costcalculator.js<|end_file_name|><|fim▁begin|>process.env.NODE_ENV = 'test';<|fim▁hole|>
const CostCalculator = require("../libs/costcalculator");
describe('Calculate Cost', () => {
describe("Book Meeting Room", () => {
it("it should calcuate cost for meeting room for 30m", async (done)... |
const chai = require('chai');
const chaiHttp = require('chai-http');
const should = chai.should(); |
<|file_name|>NodeSelection.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2000 - 2013 Silverpeas
*
* This program is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as published by the Free Software Foundation, either version 3
* of the Lice... |
import com.stratelia.silverpeas.silvertrace.SilverTrace; |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");<|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.o... | |
<|file_name|>code.js<|end_file_name|><|fim▁begin|><|fim▁hole|>module.exports = function CodeType(config) {
var self = {
selector: '.field-type-code[for="' + config.fieldName + '"]',
elements: {
label: '.FormLabel',
lineNumber: '.CodeMirror-linenumber',
codeMirror: '.CodeMirror-container',
},
commands:... | var utils = require('../../../utils');
|
<|file_name|>test_cubegen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2019 The PySCF Developers. 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
#
#... | |
<|file_name|>Channel.js<|end_file_name|><|fim▁begin|>import _ from 'lodash';
/**
* Represents a channel with which commands can be invoked.
*
* Channels are one-per-origin (protocol/domain/port).
*/
class Channel {
constructor(config, $rootScope, $timeout, contentWindow) {
this.config = config;
... | |
<|file_name|>gen.go<|end_file_name|><|fim▁begin|><|fim▁hole|>//go:generate go get github.com/golang/mock/mockgen
//go:generate sh -c "mockgen -package=mockapi github.com/citwild/wfe/api AccountsServer > accounts.go"<|fim▁end|> | package mockapi
|
<|file_name|>test_spec_parser.py<|end_file_name|><|fim▁begin|>import unittest
import pythran
import os.path
#pythran export a((float,(int,uintp),str list) list list)
#pythran export a(str)
#pythran export a( (str,str), int, intp list list)
#pythran export a( float set )
#pythran export a( bool:str dict )
#pythran expo... | def foo(i,j): return
''' |
<|file_name|>utilities_spec.js<|end_file_name|><|fim▁begin|>/*global waitsFor:true expect:true describe:true beforeEach:true it:true spyOn:true */
describe("Discourse.Utilities", function() {
describe("emailValid", function() {
it("allows upper case in first part of emails", function() {
expect(Discourse... | |
<|file_name|>pfop.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from qiniu import config
from qiniu import http
class PersistentFop(object):
"""持久化处理类
该类用于主动触发异步持久化操作,具体规格参考:
http://developer.qiniu.com/docs/v6/api/reference/fop/pfop/pfop.html
Attributes:
auth: 账号管理密钥对,Auth对象... | if self.notify_url:
data['notifyURL'] = self.notify_url
if force == 1: |
<|file_name|>OGLSurfaceData.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU Gener... | new PixelToParallelogramConverter(sg2d.shapepipe,
oglAAPgramPipe, |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2015 Antiun Ingeniería S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': "Manage model export profiles",
'category': 'Personalization',
'version': '10.0.1.0.0',... | 'data': [ |
<|file_name|>layoutmodel.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2013 by Claudio Zopfi, Zurich, Suisse, z@x21.ch
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 Lic... | {
return ctlx[i];
} |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { A, O } from 'b-o-a';
import { State } from '../types/state';
import currentPage$ from '../props/current-page';<|fim▁hole|>import stampRallies$ from '../props/stamp-rallies';
import stampRally$ from '../props/stamp-rally';
import stampRallyForm$ from '../prop... | import signIn$ from '../props/sign-in';
import spots$ from '../props/spots';
import spotForm$ from '../props/spot-form'; |
<|file_name|>64a7d6477aae_fix_description_field_in_connection_to_.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 AS... | """Unapply fix description field in connection to be text""" |
<|file_name|>argv_experiment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from sys import argv
from sys import stdout
stdout.write('argv ')
print(argv)
stdout.write('argv[1:] ')
print(argv[1:])
stdout.write('argv[:] ')
print(argv[:])
stdout.write('len(argv) ')
print(len(argv))
stdout.write('len(argv[1:])... |
stdout.write('len(argv[:]) ')
print(len(argv[:])) |
<|file_name|>Glyphs.cpp<|end_file_name|><|fim▁begin|>//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Glyphs.h"<|fim▁hole|>#pragma link "PngImageList"
#ifndef NO_RESOURCES
#pragma resource "*.dfm"
#endif
//-----------------------------------------... | //---------------------------------------------------------------------------
#pragma package(smart_init) |
<|file_name|>cmdLineUtils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env @python@
# ROOT command line tools module: cmdLineUtils
# Author: Julien Ripoche
# Mail: julien.ripoche@u-psud.fr
# Date: 20/08/15
"""Contain utils for ROOT command line tools"""
##########
# Stream redirect functions
# The original code of the... | if not rootFile:
retcode += 1
continue
openRootFiles.append(rootFile) |
<|file_name|>shader.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be<|fim▁hole|>#include "flutter/lib/ui/ui_dart_state.h"
namespace flutter {
IMPLEMENT_WRAPPERTYPEINFO(ui, Shader);
Shader::Shader(flut... | // found in the LICENSE file.
#include "flutter/lib/ui/painting/shader.h"
|
<|file_name|>index.web.tsx<|end_file_name|><|fim▁begin|>/* tslint:disable:jsx-no-multiline-js */
import React from 'react';
import classNames from 'classnames';
import Flex from '../flex';
import Carousel from '../carousel/index.web';
import { DataItem, GridProps } from './PropsType';
export default class Grid extends... | )); |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># Copyright 2016 Sotera Defense Solutions 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/LICENS... | distance_filter = 0 |
<|file_name|>9F3DE783494F7FF30679A17B0C5B912834121095.js<|end_file_name|><|fim▁begin|>this.NesDb = this.NesDb || {};
NesDb[ '9F3DE783494F7FF30679A17B0C5B912834121095' ] = {
"$": {
"name": "Nekketsu Kouha Kunio-kun",
"altname": "熱血硬派くにおくん",
"class": "Licensed",
"catalog": "TJC-KN",
"publisher": "Technos",
... | {
"$": { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Exonum Team
//
// 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|>case.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import codecs
import json
import unittest
from pkg_resources import resource_filename
from calmjs.parse import es5
class ExamplesTestCase(unittest.TestCase):
"""
A test case that automatically load the examples JS module into the
... |
data = None |
<|file_name|>keypage_prepare_fields.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013,2014 Rodolphe Quiédeville <rodolphe@quiedeville.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... |
log.stop = datetime.now()
log.save() |
<|file_name|>test_asia.py<|end_file_name|><|fim▁begin|>from datetime import date
from workalendar.tests import GenericCalendarTest
from workalendar.asia import HongKong, Japan, Qatar, Singapore
from workalendar.asia import SouthKorea, Taiwan, Malaysia
class HongKongTest(GenericCalendarTest):
cal_class = HongKon... | self.assertIn(date(2012, 5, 1), holidays) # 1st day (Sun lieu) |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.http import HttpRequest
import mock
import pytest
from nose.tools import assert_false
from olympia import amo
from olympia.amo.tests import TestCase, req_factory_factory
from olympia.amo.urlresolvers import reverse
from olympia.addons.models import Addon,... | request = mock.Mock() |
<|file_name|>util.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 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.
/**
* The global object.
* @type {!Object}
*/
const global = this;
// TODO(estade): This should ... | document.addEventListener('click', function(e) {
// Allow preventDefault to work. |
<|file_name|>datasync.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 licenses this file
# to you under the Apache... | self.create_destination_location_kwargs = create_destination_location_kwargs
|
<|file_name|>StandardCompiler.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of solidity.
solidity is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) ... | "sources": {
"fileA": {
"content": "contract A { }"
} |
<|file_name|>cryptographer.py<|end_file_name|><|fim▁begin|>from base64 import b64decode, b64encode
from hashlib import sha256
from Crypto import Random
from Crypto.Cipher import AES
from frontstage import app
class Cryptographer:
"""Manage the encryption and decryption of random byte strings"""
def __init_... | Set up the encryption key, this will come from an .ini file or from
an environment variable. Change the block size to suit the data supplied
or performance required. |
<|file_name|>datastore_v3_pb.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2007 Google 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... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
console.log('TESTTTT');
var mean = require('meanio');
exports.render = function (req, res) {
function isAdmin() {
return req.user && req.user.roles.indexOf('admin') !== -1;
}
// Send some basic starting info to the view
res.re... | motti: 'motti is cool',
isAdmin: 'motti',
adminEnabled: isAdmin() && mean.moduleEnabled('mean-admin') |
<|file_name|>tree.ui.tablet-onepanel.js<|end_file_name|><|fim▁begin|>Joshfire.define(['joshfire/class', 'joshfire/tree.ui', 'joshfire/uielements/list', 'joshfire/uielements/panel', 'joshfire/uielements/panel.manager', 'joshfire/uielements/button', 'src/ui-components'], function(Class, UITree, List, Panel, PanelManager,... | uiDataMaster: '/sidebarright/content/itemList',
forceDataPathRefresh: true,
loadingTemplate: '<div class="loading"></div>',
innerTemplate: UI.tplTweetPage, |
<|file_name|>block_base.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 NetApp, Inc. All rights reserved.
# Copyright (c) 2014 Ben Swartzlander. All rights reserved.
# Copyright (c) 2014 Navneet Singh. All rights reserved.
# Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2014 Alex Mead... | |
<|file_name|>dashboard.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under th... | 'timeOut': hasattr(job, 'timeOut') and job.timeOut or None,
'endTime': job.endTime and format_time(job.endTime) or None,
'pauseTime': hasattr(job, 'pauseTime') and job.pauseTime and format_time(job.endTime) or None, |
<|file_name|>cow.rs<|end_file_name|><|fim▁begin|>#![allow(unused_imports)]
use geometry::prim::{Prim};<|fim▁hole|>use light::light::{Light};
use light::lights::{PointLight, SphereLight};
use material::materials::{CookTorranceMaterial, FlatMaterial, PhongMaterial};
use material::Texture;
use material::textures::{Checke... | use geometry::prims::{Plane, Sphere, Triangle}; |
<|file_name|>bfi.rs<|end_file_name|><|fim▁begin|>use crate::core::bits::Bits;
use crate::core::instruction::{BfiParams, Instruction};
use crate::core::register::Reg;
#[allow(non_snake_case)]
pub fn decode_BFI_t1(opcode: u32) -> Instruction {
let rn: u8 = opcode.get_bits(16..20) as u8;
let rd: u8 = opcode.get_b... | // msbit = lsbit + width -1 <=>
// width = msbit - lsbit + 1 |
<|file_name|>probe_pins.rs<|end_file_name|><|fim▁begin|>extern crate serial;
use std::env;
use std::thread;
use std::time::Duration;
use serial::prelude::*;
const SETTINGS: serial::PortSettings = serial::PortSettings {
baud_rate: serial::Baud9600,
char_size: serial::Bits8,
parity: serial::Par... | println!("opened device {:?}", arg);
probe_pins(&mut port).unwrap();
} |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * 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 obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | * 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 |
<|file_name|>shift_swap_network_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licens... | cca.testing.assert_permutation_decomposition_equivalence(gate, n_qubits) |
<|file_name|>0021_sso_id_verification.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-04-11 15:33
from __future__ import unicode_literals
from django.db import migrations, models
<|fim▁hole|> ]
operations = [
migrations.AddField(
model_name='lt... | class Migration(migrations.Migration):
dependencies = [
('third_party_auth', '0020_cleanup_slug_fields'), |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>"""
Copyright (c) 2016 Gabriel Esteban
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the righ... | """
from django.contrib import admin |
<|file_name|>format.rs<|end_file_name|><|fim▁begin|>use gl;
use ToGlEnum;
/// List of client-side pixel formats.
///
/// These are all the possible formats of data when uploading to a texture.
#[allow(missing_docs)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ClientFormat {
U8,
U8U8,
U8U8U8,
... |
impl UncompressedIntFormat {
/// Turns this format into a more generic `TextureFormat`.
pub fn to_texture_format(self) -> TextureFormat { |
<|file_name|>chart.component.spec.ts<|end_file_name|><|fim▁begin|>/* tslint:disable:no-unused-variable */
import { TestBed, async } from '@angular/core/testing';
import { DpsBarChartComponent } from './dps-bar-chart.component';
describe('Component: DpsBarChart', () => {
it('should create an instance', () => {<|fim▁... | let component = new DpsBarChartComponent(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.