prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>sponsors.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { MdButtonModule, MdCardModule, MdProgressSpinnerModule, MdIconModule } from '@angular/material'; import { AvailableSponsorsComponent } from './available-sponsors...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; var mongoose = require('mongoose'), async = require('async'); var DeleteChildrenPlugin = function(schema, options) { schema.pre('remove', function(done) { var parentField = options.parentField; var childModel = options.childModel; if (!parentF...
exports.parentAttach = ParentAttachPlugin;
<|file_name|>context.rs<|end_file_name|><|fim▁begin|>use criterion::Criterion; use lucet_runtime_internals::context::{Context, ContextHandle}; /// Time the initialization of a context. fn context_init(c: &mut Criterion) { extern "C" fn f() {} let mut stack = vec![0u64; 1024].into_boxed_slice(); c.bench_f...
criterion::BatchSize::PerIteration, ) });
<|file_name|>resources.py<|end_file_name|><|fim▁begin|>import requests import platform from authy import __version__, AuthyFormatException from urllib.parse import quote # import json try: import json except ImportError: try: import simplejson as json except ImportError: from django.utils i...
'phone_number': phone_number, 'country_code': country_code, 'via': via }
<|file_name|>tileset2fj.go<|end_file_name|><|fim▁begin|>/* Copyright (C) 2015 Curoverse, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the Licen...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod api; use gcrypt; use hyper; use rustc_serialize::base64; use rustc_serialize::hex; use rustc_serialize::json; use crypto;<|fim▁hole|> use std::fmt; use std::io; use rustc_serialize::base64::FromBase64; use rustc_serialize::hex::FromHex; use rustc_serialize::hex::...
<|file_name|>DataAdapter.java<|end_file_name|><|fim▁begin|>package com.creativecub.iotarduino; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.Switch; import androi...
ivIcon = (ImageView) view.findViewById(R.id.ivIcon);
<|file_name|>status-tweet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # This script will tweet the text that is passed as an argument # Requires Twython, API credentials set as env vars # Usage: python status-tweet.py "Hello Everyone, this is my Raspberry Pi tweeting you more nonsense" import sys import os ...
# Tweet api.update_status(status=sys.argv[1][:140])
<|file_name|>majority_voting_test.py<|end_file_name|><|fim▁begin|>#to get some base functionality for free, including the methods get_params and set_params #to set and return the classifier's parameters as well as the score method to calculate the #prediction accuracy,respectively from sklearn.base import BaseEstimato...
y = le.fit_transform(y)
<|file_name|>sanitizeUri.js<|end_file_name|><|fim▁begin|>'use strict'; /** * @description * Private service to sanitize uris for links and images. Used by $compile and $sanitize. */ function $$SanitizeUriProvider() { var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/, imgSrcSanitizationWhite...
/**
<|file_name|>config.js<|end_file_name|><|fim▁begin|><|fim▁hole|> module.exports = { type: 'error', error: { line: 1, column: 3, message: 'Unexpected character \'💩\'.', }, };<|fim▁end|>
'use strict';
<|file_name|>qualityControl.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
# TODO implement a smoothing function perhaps # (Ie only accept frames within x distance of previous frame)
<|file_name|>firefox.d.ts<|end_file_name|><|fim▁begin|>interface ContentScriptPort { emit(method :string, data ?:Object) :void; on(method :string, handler :Function) :void; once(method :string, handler :Function) :void; removeListener(method :string, handler :Function) :void;<|fim▁hole|><|fim▁end|>
}
<|file_name|>test_c_agf2.py<|end_file_name|><|fim▁begin|># Copyright 2014-2020 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 # # http://www.ap...
def test_c_ragf2(self): xija = np.random.random((self.nmo, self.nocc, self.nocc, self.nvir)) gf_occ = aux.GreensFunction(np.random.random(self.nocc), np.eye(self.nmo, self.nocc))
<|file_name|>split.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os,re,sys,pprint,shutil from pathlib import Path PACKAGES_DIR = "../packages" def errorExit(msg): print(msg) sys.exit(1) def isPathDisabled(path): for part in path.parts: if part.lower().startswith("_disab...
errorExit("Merged products file does not exist")
<|file_name|>pe288-an-enormous-factorial.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 """288. An enormous factorial https://projecteuler.net/problem=288 For any prime p the number N(p,q) is defined by N(p,q) = ∑n=0 to q Tn*pn with Tn generated by the following random number generator: S0 = ...
Find NF(61,107) mod 6110 """
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from .models import EssNutr, FoodCategory<|fim▁hole|>admin.site.register(EssNutr) admin.site.register(FoodCategory)<|fim▁end|>
# Register your models here.
<|file_name|>pickletools.py<|end_file_name|><|fim▁begin|>'''"Executable documentation" for the pickle module. Extensive comments about the pickle protocols and pickle-machine opcodes can be found here. Some functions meant for external use: genops(pickle) Generate all the opcodes in a pickle, as (opcode, arg, pos...
else:
<|file_name|>title.js<|end_file_name|><|fim▁begin|>game.TitleScreen = me.ScreenObject.extend({ init: function(){ this.font = null; },<|fim▁hole|> game.data.newHiScore = false; me.game.world.addChild(new BackgroundLayer('bg', 1)); me.input.bindKey(me.input.KEY.ENTER, "enter", true); me.input....
onResetEvent: function() { me.audio.stop("theme");
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './user.effects'; export * from './router.effects';<|fim▁end|>
<|file_name|>check_mq_channel.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import getopt import sys import pymqi, CMQC, CMQCFC STATE_OK = 0 STATE_WARNING = 1 STATE_CRITICAL = 2 STATE_UNKNOWN = 3 def usage(): print """Usage: rbh_check_mq_channel_status -H <HostName> -g <QMGRName> -p <PortNumber> -a <ChannelN...
if __name__ == "__main__": main()
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[doc = r" Value read from the register"] pub struct R { bits: u32, } #[doc = r" Value to write to the register"] pub struct W { bits: u32, } impl super::WINR { #[doc = r" Modifies the contents of the register"] #[inline(always)] pub fn modify<F>(&sel...
let bits = { const MASK: u16 = 4095; const OFFSET: u8 = 0;
<|file_name|>mem_server.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2013 OpenStack, 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...
from swift.obj.mem_diskfile import InMemoryFileSystem from swift.obj import server
<|file_name|>daku.cpp<|end_file_name|><|fim▁begin|>#include "daku.h" namespace daku { void bigBang() { av_register_all(); } <|fim▁hole|><|fim▁end|>
}
<|file_name|>CreateOperation.java<|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 un...
@Override public OperationResult<String> getResult() { try {
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lic...
}
<|file_name|>load-resolve-path.js<|end_file_name|><|fim▁begin|>'use strict' module.exports = function (config) { if (!process.env.COOKING_PATH) { return } const rootPath = process.env.COOKING_PATH.split(',') config.resolve = config.resolve || {} config.resolveLoader = config.resolveLoader || {}<|fim▁hol...
<|file_name|>vec.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/LI...
<|file_name|>commandtest.py<|end_file_name|><|fim▁begin|># Copyright (C) 2009 Google Inc. 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 source code must retain the ab...
<|file_name|>test_nb.py<|end_file_name|><|fim▁begin|><|fim▁hole|>locale = "nb" def test_diff_for_humans(): with pendulum.test(pendulum.datetime(2016, 8, 29)): diff_for_humans() def diff_for_humans(): d = pendulum.now().subtract(seconds=1) assert d.diff_for_humans(locale=locale) == "for 1 sekund ...
import pendulum
<|file_name|>3451.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
print((int((str(179**10))*4))**(1/10))
<|file_name|>issue-5884.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/lice...
// compile-pass #![allow(dead_code)]
<|file_name|>HttpFilterCamelHeadersTest.java<|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...
import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.impl.JndiRegistry;
<|file_name|>mails_resource.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2015 ThoughtWorks, Inc. # # Pixelated 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 License, or # ...
return NOT_DONE_YET
<|file_name|>state.entity.ts<|end_file_name|><|fim▁begin|>export interface IState{ id:number; name:string; uf:string; } export class StateEntity implements IState{ id:number; name:string; uf:string;<|fim▁hole|> this.name = data.name || null; this.uf = data.ud || null; ...
constructor(data?:any) { if (data) { this.id = data.id || null;
<|file_name|>genericNodePropertyComponent.tsx<|end_file_name|><|fim▁begin|>import * as React from "react"; import { LineContainerComponent } from '../../sharedComponents/lineContainerComponent'; import { IPropertyComponentProps } from './propertyComponentProps'; import { TextInputLineComponent } from '../../sharedCo...
let cantDisplaySlider = (isNaN(options.min as number) || isNaN(options.max as number) || options.min === options.max);
<|file_name|>product.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for<|fim▁hole|># # Code generated by Microsof...
# license information.
<|file_name|>apiservice.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 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/licenses/LICENSE-2.0 Unl...
import (
<|file_name|>browsercontext.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::js::{JS, JSRef, Temporary}; use dom...
iterate: None, call: None, construct: None,
<|file_name|>data.py<|end_file_name|><|fim▁begin|>""" A neural chatbot using sequence to sequence model with attentional decoder. This is based on Google Translate Tensorflow model https://github.com/tensorflow/models/blob/master/tutorials/rnn/translate/ Sequence to sequence model by Cho et al.(2014) Created by Ch...
with open(file_path, 'rb') as f: lines = f.readlines()
<|file_name|>app.ts<|end_file_name|><|fim▁begin|>import 'leaflet'; import './main.scss'; import "reflect-metadata"; import "zone.js/dist/zone"; import "zone.js/dist/long-stack-trace-zone"; import { BrowserModule } from "@angular/platform-browser"; import { platformBrowserDynamic } from "@angular/platform-browser-dynami...
<|file_name|>quaternion.pb.go<|end_file_name|><|fim▁begin|>// Copyright 2021 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/LICENSE-2....
<|file_name|>_open_newick.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # #START_LICENSE########################################################### # # # This file is part of the Environment for Tree Exploration program # (ETE). http://ete.cgenomics.org # # ETE is free software: you can redistribute it and...
<|file_name|>pages.js<|end_file_name|><|fim▁begin|>const models = require('../../models'); const {i18n} = require('../../lib/common'); const errors = require('@tryghost/errors'); const urlUtils = require('../../../shared/url-utils'); const ALLOWED_INCLUDES = ['tags', 'authors', 'authors.roles']; const UNSAFE_ATTRS = ['...
<|file_name|>app.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import time import json import random import re from bottle import route, hook, response, run, static_file @route('/') def index(): return static_file('index.html', root = '.') @route('/maptweets.js') def index_css(): return static_file('m...
return static_file('event.png', root = '.') run(host = '0.0.0.0', port = 80, server = 'tornado', debug = True)
<|file_name|>CommCareTestApp.java<|end_file_name|><|fim▁begin|>package org.commcare; import org.commcare.models.database.UnencryptedHybridFileBackedSqlStorage; import org.commcare.models.database.UnencryptedHybridFileBackedSqlStorageMock; import org.javarosa.core.services.storage.Persistable; /** * Delegator around ...
return new UnencryptedHybridFileBackedSqlStorageMock<>(name, c, app.buildAndroidDbHelper(), app);
<|file_name|>mqtt_chat_client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Created on 17/2/16. @author: love ''' import paho.mqtt.client as mqtt import json import ssl def on_connect(client, userdata, flags, rc): print("Connected with result code %d"%rc) client.publish("Login/HD_Login/1", json.d...
elif s=="start": client.publish("Master/HD_Start_Process/2", json.dumps({"ProcessID": "001"}),qos=0,retain=False) elif s=="stop":
<|file_name|>ApiConstants.js<|end_file_name|><|fim▁begin|>export const GET = 'GET'; export const PUT = 'PUT'; export const POST = 'POST';<|fim▁hole|><|fim▁end|>
export const DELETE = 'DELETE';
<|file_name|>compatibility.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys import django from django.utils import six try: from django.utils.text import truncate_words except ImportError: # django >=1.5 from django.utils.text import Truncator from django.utils.functional import allo...
<|file_name|>DenseTest.cpp<|end_file_name|><|fim▁begin|>//================================================================================================= /*! // \file src/mathtest/diagonalmatrix/DenseTest.cpp // \brief Source file for the DiagonalMatrix dense test // // Copyright (C) 2013 Klaus Iglberger - All Rig...
<|file_name|>r12writer.py<|end_file_name|><|fim▁begin|># Copyright (c) 2020 Manfred Moitzi # License: MIT License from pathlib import Path from time import perf_counter import math from ezdxf.addons import MengerSponge from ezdxf.addons import r12writer from ezdxf.render.forms import sphere, circle, translate DIR = Pa...
<|file_name|>foo.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The Wire 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 // // https://www.apache.org/licenses/LICENSE-2.0 /...
fmt.Println(string(buf)) }
<|file_name|>package.py<|end_file_name|><|fim▁begin|>############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, t...
# License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
<|file_name|>handshake.js<|end_file_name|><|fim▁begin|>var crypto = require('crypto'); var lob = require('lob-enc') var hashname = require('hashname'); var log = require("./log")("Handshake") module.exports = { bootstrap : handshake_bootstrap, validate : handshake_validate, from : handshake_from, types ...
<|file_name|>SelectorDimFilter.java<|end_file_name|><|fim▁begin|>/* * Licensed to Metamarkets Group Inc. (Metamarkets) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Metamarkets licenses this file * to...
.put(extractionFnBytes) .array(); }
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from math import ceil from django.db import models, IntegrityError, connection from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature from djang...
batch_size = max(connection.ops.bulk_batch_size(['pk'], range(TEST_SIZE)), 1) # TEST_SIZE // batch_size (select related `T` instances)
<|file_name|>test_actions.py<|end_file_name|><|fim▁begin|>from servicemanager.actions import actions from servicemanager.smcontext import SmApplication, SmContext, ServiceManagerException from servicemanager.smprocess import SmProcess from servicemanager.service.smplayservice import SmPlayService from servicemanager.se...
servicetostart = "PLAY_NEXUS_END_TO_END_TEST" port = None
<|file_name|>power_bi_embedded_management_client_enums.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # licen...
class CheckNameReason(str, Enum):
<|file_name|>processDefinitionCtrl.js<|end_file_name|><|fim▁begin|>ngDefine( 'cockpit.plugin.statistics-plugin.controllers', function(module) { module .controller( 'processDefinitionCtrl', [ '$scope', 'DataFactory', ...
function() {
<|file_name|>cartridge.hpp<|end_file_name|><|fim▁begin|>class Cartridge : property<Cartridge> { public: enum class Mode : unsigned { Normal, BsxSlotted, Bsx, SufamiTurbo, SuperGameBoy, }; enum class Region : unsigned { NTSC, PAL, }; //assigned externally to point to file-system d...
<|file_name|>stylesheet.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use context::QuirksMode; use cssparser::{Parser, ParserInp...
// Acquire the lock *after* parsing, to minimize the exclusive section. let mut guard = existing.shared_lock.write();
<|file_name|>noreferences.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- """ This script adds a missing references section to pages. It goes over multiple pages, searches for pages where <references /> is missing although a <ref> tag is present, and in that case adds a new references sectio...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[cfg(test)] pub mod mocks; #[cfg(test)] mod spec_tests; use crate::{ cart::Cart, ppu::{control_register::IncrementAmount, write_latch::LatchState}, }; use std::cell::Cell; pub trait IVram: Default { fn write_ppu_addr(&self, latch_state: LatchState); f...
match inc_amount {
<|file_name|>model_support.py<|end_file_name|><|fim▁begin|>from cuescience_shop.models import Client, Address, Order from natspec_utils.decorators import TextSyntax from cart.cart import Cart from django.test.client import Client as TestClient class ClientTestSupport(object): def __init__(self, test_case): ...
order = Order(client=client, cart=cart) order.save()
<|file_name|>TestSlotInfo.java<|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 ...
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>import { Dimensions, PixelRatio } from 'react-native'; const Utils = { ratio: PixelRatio.get(), pixel: 1 / PixelRatio.get(), size: { width: Dimensions.get('window').width, height: Dimensions.get('window').height, }, post(url, data,...
export default Utils;
<|file_name|>forme.cpp<|end_file_name|><|fim▁begin|>#include "forme.h" /// /// \brief Forme::Forme /// Forme::Forme() { } /// /// \brief Forme::GetSize /// \return Nombre de points constituant la forme /// int Forme::GetSize() const { return L.size(); } /// /// \brief Forme::GetPoint /// \param i Indice du point /...
///
<|file_name|>script.py<|end_file_name|><|fim▁begin|><|fim▁hole|>../../../../../../../share/pyshared/orca/scripts/apps/nautilus/script.py<|fim▁end|>
<|file_name|>in_process_lease.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. */ use anyhow::Result; use async_trait::async_trait; use context::CoreContext; u...
/// LeaseOps that use in-memory data structures to avoid two separate tasks writing to the same key
<|file_name|>meta_strategies.py<|end_file_name|><|fim▁begin|># Copyright 2019 DeepMind Technologies Limited # # 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/lice...
def prd_strategy(solver, return_joint=False):
<|file_name|>impls_misc.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
<|file_name|>js__7hlBWPf1ttIudqF3iXkeU8oj7-zn_KRtVHFZdJJJ7v0__aTMdf5d7seM9dLI2fkwXQ2X0SNki2Q_-7ojT8gPzfnw__f87EqBUvTXEvjkncqMkj5xIZ6nPMQzVQhJdgieC7TpU.js<|end_file_name|><|fim▁begin|>(function($) { /** * Initialize editor instances. * * @todo Is the following note still valid for 3.x? * This function needs to be c...
$drupalToolbar.show();
<|file_name|>test_tweetMining.py<|end_file_name|><|fim▁begin|>import unittest from tweetMining import TweetMining, TweetProxy, TestProxy, HttpProxy import nltk class TweetMiningTestCase(unittest.TestCase): def setUp(self): self.tweetMining = TweetMining(proxy='test') self.search = self.tweetMining....
<|file_name|>ac97_mixer.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use crate::pci::ac97_regs::*; // AC97 Vendor ID const AC97_VENDOR_ID1: u16 = 0x8086; const AC9...
fn set_master_reg(&mut self, val: u16) { self.master_mute = val & MUTE_REG_BIT != 0; self.master_volume_r = (val & VOL_REG_MASK) as u8;
<|file_name|>mdbver.java<|end_file_name|><|fim▁begin|>/* * #%L * Fork of MDB Tools (Java port). * %% * Copyright (C) 2008 - 2013 Open Microscopy Environment: * - Board of Regents of the University of Wisconsin-Madison * - Glencoe Software, Inc. * - University of Dundee * %% * This program is free softwar...
* Window - Preferences - Java - Code Style - Code Templates */ package mdbtools.libmdb06util;
<|file_name|>scribe.py<|end_file_name|><|fim▁begin|>import io import sys isPython3 = sys.version_info >= (3, 0) class Scribe: @staticmethod def read(path): with io.open(path, mode="rt", encoding="utf-8") as f: s = f.read() # go to beginning f.seek(0) ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#/usr/bin/env python # -#- coding: utf-8 -#- # # equity_master/tests/__init__.py - equity masger unit test package # # Standard copyright message # # # # Initial version: 2012-04-02 # Author: Amnon Janiv """ .. module:: equity_master/tests :synopsis: equ...
It is comprised of the following modules:
<|file_name|>Session.ts<|end_file_name|><|fim▁begin|>import { PushRequest } from './../protocol/push/PushRequest'; import { PushRequestNewObject } from './../protocol/push/PushRequestNewObject'; import { PushRequestObject } from './../protocol/push/PushRequestObject'; import { PushResponse } from './../protocol/push/Pu...
public pushResponse(pushResponse: PushResponse): void {
<|file_name|>ModelOrBuilder.java<|end_file_name|><|fim▁begin|>// Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/ml/v1beta1/model_service.proto package com.google.cloud.ml.api.v1beta1; public interface ModelOrBuilder extends // @@protoc_insertion_point(interface_extends:google.clo...
* </pre>
<|file_name|>encrypting_serializer.go<|end_file_name|><|fim▁begin|>package session import ( "crypto/sha256" "fmt" "github.com/fasthttp/session/v2" "github.com/authelia/authelia/v4/internal/utils" ) // EncryptingSerializer a serializer encrypting the data with AES-GCM with 256-bit keys. type EncryptingSerializer...
return nil, nil }
<|file_name|>DigestAuthentication.cpp<|end_file_name|><|fim▁begin|>/********** This library 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 2.1 of the License, or (at your option) any later v...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import http from "http"; import express from "express"; import cors from "cors"; import morgan from "morgan"; import bodyParser from "body-parser"; import initializeDb from "./db"; import middleware from "./middleware"; import api from "./api"; import config from "con...
// internal middleware app.use(middleware({ config })); // api router
<|file_name|>test_cargo_compile_git_deps.rs<|end_file_name|><|fim▁begin|>use std::fs::{self, File}; use std::io::prelude::*; use std::path::Path; use std::thread; use git2; use support::{git, project, execs, main_file, path2url}; use support::{COMPILING, UPDATING, RUNNING}; use support::paths::{self, CargoPathExt}; us...
test!(dep_with_changed_submodule { let project = project("foo");
<|file_name|>share_instances.py<|end_file_name|><|fim▁begin|># Copyright 2015 Mirantis inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://...
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.
<|file_name|>940_more_supplier_details.py<|end_file_name|><|fim▁begin|>""" Extend suppliers table with new fields (to be initially populated from declaration data) Revision ID: 940 Revises: 930 Create Date: 2017-08-16 16:39:00.000000 """ # revision identifiers, used by Alembic. revision = '940' down_revision = '930'...
<|file_name|>example.py<|end_file_name|><|fim▁begin|>import numpy try: import matplotlib.pyplot as pypl plotting = True except: plotting = False import os, shutil this_dir = os.path.dirname(os.path.realpath(__file__)) import condor import logging logger = logging.getLogger('condor') logger.setLevel("INF...
s = "particle_map_custom" E = condor.Experiment(src, {s : par}, det)
<|file_name|>explicit-self.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/l...
match *shape { circle(_, radius) => 0.5 * tau * radius * radius,
<|file_name|>MyApplication.java<|end_file_name|><|fim▁begin|>package com.a7av.news24h; import android.app.Application; import android.content.Context; import android.support.multidex.MultiDex; import uk.co.chrisjenx.calligraphy.CalligraphyConfig; import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper; /** * ...
@Override
<|file_name|>snip.py<|end_file_name|><|fim▁begin|>import json import logging from flask import abort, redirect, render_template, request, send_file import ctrl.snip from . import handlers @handlers.route('/snip/<slug>.png') def snip_view(slug): filename = ctrl.snip.getSnipPath(slug) if filename == None: logg...
return send_file(filename, attachment_filename=slug + '.png', mimetype='image/png') @handlers.route('/snip/<slug>')
<|file_name|>ftp_rmdir.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import ftplib import os.path import sys p_debug = False def ftp_rmdir(ftp, folder, remove_toplevel, dontremove): for filename, attr in ftp.mlsd(folder): if attr['type'] == 'file' and filename not in dontremove: if p...
ftp.delete(os.path.join(folder, filename)) if attr['type'] == 'dir':
<|file_name|>cabi_powerpc.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2015 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.o...
<|file_name|>env.go<|end_file_name|><|fim▁begin|>package mock import ( "github.com/fkmhrk/OpenInvoice/v1/model/env"<|fim▁hole|>type EnvDAO struct { CreateResult env.Env GetResult env.Env GetListResult []*env.Env SaveResult error UpdateResult env.Env DeleteResult env.Env } func (d *EnvDAO) Create(key,...
)
<|file_name|>workers.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Mark Clarkson // // 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|>test_remote_access_controller.py<|end_file_name|><|fim▁begin|># coding: utf-8 from __future__ import absolute_import import unittest from flask import json from six import BytesIO from openapi_server.models.computer_set import ComputerSet # noqa: E501 from openapi_server.models.free_style_build import ...
query_string = [('depth', 56)] headers = {
<|file_name|>gather_op_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.ap...
<|file_name|>body.rs<|end_file_name|><|fim▁begin|>use url::form_urlencoded; use hyper::Chunk; use mime; use controller::context::BodyContent; pub fn parse_body(content_type: Option<&mime::Mime>, body_data: Chunk) -> Option<BodyContent> { if body_data.is_empty() {<|fim▁hole|> } else { let is_multipart_f...
None
<|file_name|>DownloadView.cpp<|end_file_name|><|fim▁begin|>/* This file is part of cpp-ethereum. cpp-ethereum 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 opti...
}
<|file_name|>poll_opt.rs<|end_file_name|><|fim▁begin|>use std::{fmt, ops}; /// Options supplied when registering an `Evented` handle with `Poll` /// /// `PollOpt` values can be combined together using the various bitwise /// operators. /// /// For high level documentation on polling and poll options, see [`Poll`]. ///...
self.contains(PollOpt::edge()) }
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import importlib from django.conf import settings from django.views import View class BaseView(View): """后台管理基类""" def __init__(self): self.context = {} self.context["path"] = {} def dispatch(self,request,*args,**kwargs): _path = re...
self.context["path"]["action"] = _path[-1]
<|file_name|>service_handler.go<|end_file_name|><|fim▁begin|>package scimoxy <|fim▁hole|><|fim▁end|>
type ServiceHandler interface { Users() }