prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>lit.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python <|fim▁hole|> from lit.main import main import os if __name__ == '__main__': if not os.path.exists(".cache/core.Item"): print("Note that first run may take quite a while .cache/core.* is populated...") main()<|fim▁end|>
# https://medium.com/@mshockwave/using-llvm-lit-out-of-tree-5cddada85a78 # To run lit-based test suite: # cd xyz/qmlcore/test && ./lit.py -va .
<|file_name|>bothLocust.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import csv import os import random import re import urllib3 from urllib.parse import parse_qs, urlparse, unquote, urlencode, quote from locust import HttpLocust, TaskSet, task, TaskSequence, seq_task, between # SAML IdP Host...
found_eventid = EVENTID_PAT.search(content)
<|file_name|>stdafx.cpp<|end_file_name|><|fim▁begin|>// stdafx.cpp : Ç¥ÁØ Æ÷ÇÔ ÆÄÀϸ¸ µé¾î ÀÖ´Â ¼Ò½º ÆÄÀÏÀÔ´Ï´Ù. // SampleClient.pch´Â ¹Ì¸® ÄÄÆÄÀÏµÈ Çì´õ°¡ µË´Ï´Ù. // stdafx.obj¿¡´Â ¹Ì¸® ÄÄÆÄÀÏµÈ Çü½Ä Á¤º¸°¡ Æ÷ÇԵ˴ϴÙ. #include "stdafx.h"<|fim▁hole|>// ÀÌ ÆÄÀÏÀÌ ¾Æ´Ñ STDAFX.H¿¡¼­ ÂüÁ¶ÇÕ´Ï´Ù.<|fim▁end|>
// TODO: ÇÊ¿äÇÑ Ãß°¡ Çì´õ´Â
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import division import datetime import re import itertools import random from django.conf import settings from django.core import exceptions from django.core.urlresolvers import reverse from django.db.models import Q from django.contrib.contenttyp...
if self.end_date.future: return "Started %s" % self.start_date else: return "%s &rarr; %s" % (self.start_date, self.end_date)
<|file_name|>analysis.py<|end_file_name|><|fim▁begin|>""" NeuroTools.analysis ================== A collection of analysis functions that may be used by NeuroTools.signals or other packages. .. currentmodule:: NeuroTools.analysis Classes ------- .. autosummary:: TuningCurve Functions --------- .. autosummary:: ...
if lag is None: lag = np.ceil(20*np.mean(np.diff(sua2)))
<|file_name|>cell.py<|end_file_name|><|fim▁begin|>from collections.abc import Mapping, Iterable from ctypes import c_int, c_int32, c_double, c_char_p, POINTER from weakref import WeakValueDictionary import numpy as np from numpy.ctypeslib import as_array from openmc.exceptions import AllocationError, InvalidIDError f...
""" _dll.openmc_cell_set_temperature(self._index, T, c_int32(instance))
<|file_name|>BackpackOutlined.js<|end_file_name|><|fim▁begin|>import * as React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon(<|fim▁hole|><|fim▁end|>
<path d="M17 4.14V2h-3v2h-4V2H7v2.14c-1.72.45-3 2-3 3.86v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.86-1.28-3.41-3-3.86zM18 20H6V8c0-1.1.9-2 2-2h8c1.1 0 2 .9 2 2v12zm-1.5-8v4h-2v-2h-7v-2h9z" /> , 'BackpackOutlined');
<|file_name|>string.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...
/// Reserves capacity for at least `additional` more bytes to be inserted /// in the given `String`. The collection may reserve more space to avoid /// frequent reallocations.
<|file_name|>interwebs.py<|end_file_name|><|fim▁begin|>""" A simple HTTP interface for making GET, PUT and POST requests. """ import http.client import json from urllib.parse import urlparse, urlencode # NOQA from base64 import b64encode from functools import partial from collections import namedtuple Response = nam...
get = partial(request, "GET") post = partial(request, "POST")
<|file_name|>alpha-triangle.py<|end_file_name|><|fim▁begin|>alpha = "abcdefghijklmnopqrstuvwxyz" for n in range(0, 26, 1): print alpha[0:n+1] for n in range(26, 1, -1): print alpha[0:n-1] """ alpha = "a" m = ord(alpha) n = 0<|fim▁hole|>while n < m: print chr(m + 1) in range(65, 122) m += 1 for i in range(ord(...
<|file_name|>inefficient_to_string.rs<|end_file_name|><|fim▁begin|>// run-rustfix #![deny(clippy::inefficient_to_string)] use std::borrow::Cow; fn main() { let rstr: &str = "hello"; let rrstr: &&str = &rstr;<|fim▁hole|> let _: String = rstr.to_string(); let _: String = rrstr.to_string(); let _: Str...
let rrrstr: &&&str = &rrstr;
<|file_name|>choice.ts<|end_file_name|><|fim▁begin|>export interface IChoice<T> { value: T, label?: string }<|fim▁hole|> constructor(public value: T, label?: string) { this._label = label; } get label(): string { return this._label || String(this.value); } toJs(): object { return { labe...
export class Choice<T> implements IChoice<T> { private _label;
<|file_name|>app.ts<|end_file_name|><|fim▁begin|>import application = require("application"); // Specify custom UIApplicationDelegate. /* class MyDelegate extends UIResponder implements UIApplicationDelegate { public static ObjCProtocols = [UIApplicationDelegate]; applicationDidFinishLaunchingWithOptions(app...
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Control switches.""" from datetime import timedelta import logging from ProgettiHWSW.relay import Relay import async_timeout from homeassistant.components.switch import SwitchEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core impo...
hass, _LOGGER,
<|file_name|>mod_pow.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::arithmetic::traits::ModMulAssign; use malachite_base::num::basic::traits::{One, Zero}; use malachite_base::num::logic::traits::BitIterable; use malachite_nz::natural::Natural; pub fn simple_binary_mod_pow(x: &Natural, exp: &Natural, m: &Natu...
for bit in exp.bits().rev() { out.mod_mul_assign(out.clone(), m);
<|file_name|>timer.js<|end_file_name|><|fim▁begin|>// var isWaiting = false; // var isRunning = false; // var seconds = 10; // var countdownTimer; // var finalCountdown = false; function GameTimer(game) { this.seconds = game.timelimit; <|fim▁hole|> if (this.seconds === 0 && !game.gameOver) { game.endGame(); } e...
this.secondPassed = function() {
<|file_name|>formations_test.go<|end_file_name|><|fim▁begin|>package api_test<|fim▁hole|> "testing" "github.com/remind101/empire/pkg/heroku" ) func TestFormationBatchUpdate(t *testing.T) { c, s := NewTestClient(t) defer s.Close() mustDeploy(t, c, DefaultImage) q := 2 f := mustFormationBatchUpdate(t, c, "acme-...
import (
<|file_name|>__init__.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 Apac...
* AWS SSM Parameter store """
<|file_name|>ServerScheduler.hpp<|end_file_name|><|fim▁begin|>/* * ServerScheduler.hpp * * Copyright (C) 2009-12 by RStudio, Inc. * * Unless you have received this program directly from RStudio pursuant * to the terms of a commercial license agreement with RStudio, then * this program is licensed to you under th...
// note that this function does not synchronize access to the list of // scheduled commands so it should ONLY be called during server init void addCommand(boost::shared_ptr<core::ScheduledCommand> pCmd);
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! //! Module which provide handlers to send the log records to the appropriate destination. //! pub mod streams; use handlers::streams::file::FileHandler; use handlers::streams::net::TCPHandler; use handlers::streams::stdout::StdoutHandler; use log::LogLevelFilter; us...
}
<|file_name|>bip65-cltv-p2p.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util ...
block.nVersion = 4
<|file_name|>texture_compat.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2017 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/licenses/LIC...
} dstSize := a.Width * a.Height * 4
<|file_name|>firewalld.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Adam Miller <maxamillion@fedoraproject.org> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_funct...
<|file_name|>borrowck-move-out-of-overloaded-deref.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 //...
// option. This file may not be copied, modified, or distributed // except according to those terms.
<|file_name|>jest.config.js<|end_file_name|><|fim▁begin|>module.exports = { moduleFileExtensions: ['js', 'jsx', 'json', 'vue', 'ts', 'tsx'], transform: { '^.+\\.vue$': 'vue-jest', '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', '^.+\\.tsx?$': 'ts-jest' }, transformIgnorePa...
'ts-jest': { babelConfig: true }
<|file_name|>CalculateAreaForStatsVisitor.cpp<|end_file_name|><|fim▁begin|>/* * This file is part of Hootenanny. * * Hootenanny 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 Lice...
namespace hoot
<|file_name|>cifar10_train.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.apa...
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// Copyright 2022 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 // // https://www.apache.org/licenses/LICENSE-2.0 // //...
import {PhishingProtectionServiceV1Beta1Client} from '@google-cloud/phishing-protection'; // check that the client class type name can be used
<|file_name|>sre_constants.py<|end_file_name|><|fim▁begin|># # Secret Labs' Regular Expression Engine # # various symbols used by the regular expression engine. # run this script to update the _sre include files! # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # See the sre.py file for informatio...
CH_UNICODE = { CATEGORY_DIGIT: CATEGORY_UNI_DIGIT, CATEGORY_NOT_DIGIT: CATEGORY_UNI_NOT_DIGIT, CATEGORY_SPACE: CATEGORY_UNI_SPACE,
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2020 Christian Amsüss // // This file is subject to the terms and conditions of the GNU Lesser // General Public License v2.1. See the file LICENSE in the top level // directory for more details. #![no_std] use riot_wrappers::{riot_main, println}; use r...
// deregistered (which it can't). loop { thread::sleep(); } })
<|file_name|>highq_power_sweep_0813f12.py<|end_file_name|><|fim▁begin|>import matplotlib from kid_readout.roach import baseband matplotlib.use('agg') import numpy as np import time import sys from kid_readout.utils import data_file,sweeps from kid_readout.analysis.resonator import fit_best_resonator ri = baseband.Ro...
#f0s = f0s*(0.9995)
<|file_name|>BothBlockingAndNonBlockingOnClassTest.java<|end_file_name|><|fim▁begin|>package org.jboss.resteasy.reactive.server.vertx.test; import static org.junit.jupiter.api.Assertions.fail; import io.smallrye.common.annotation.Blocking; import io.smallrye.common.annotation.NonBlocking; import java.util.function.Su...
public String hello() { return "hello"; } }
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url from cats.views.cat import ( CatList, CatDetail<|fim▁hole|>from cats.views.breed import ( BreedList, BreedDetail ) urlpatterns = [ # Cats URL's url(r'^cats/$', CatList.as_view(), name='list'), url(r'^cats/(?P...
)
<|file_name|>ResizableBehaviorTestCase.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2009 WiQuery team * * 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, incl...
public void testGetMaxHeight() { assertEquals(resizableBehavior.getMaxHeight(), 0);
<|file_name|>camera.rs<|end_file_name|><|fim▁begin|>// See LICENSE file for copyright and license details. use std::f32::consts::{PI}; use num::{Float}; use cgmath::{perspective, rad, Matrix4, Vector, Vector3, Rad}; use common::types::{Size2, ZFloat}; use common::misc::{clamp}; use zgl::{Zgl}; use types::{WorldPos}; ...
pub fn add_horizontal_angle(&mut self, angle: Rad<ZFloat>) { self.z_angle = self.z_angle + angle; while self.z_angle < rad(0.0) {
<|file_name|>youtube.py<|end_file_name|><|fim▁begin|>import logging from ..models import Activity from .date import activity_stream_date_to_datetime, datetime_to_string log = logging.getLogger(__name__) def activity_from_dict(data): log.debug("Converting YouTube dict to Activity Model") activity_dict = acti...
<|file_name|>checkJSPluginExist.js<|end_file_name|><|fim▁begin|>/* * This code it's help you to check JS plugin function (e.g. jQuery) exist. * When function not exist, the code will auto reload JS plugin from your setting. * * plugin_name: It's your plugin function name (e.g. jQuery). The type is string. * reloa...
} } return true; };
<|file_name|>mesonlib.py<|end_file_name|><|fim▁begin|># Copyright 2012-2015 The Meson development 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/LIC...
<|file_name|>SendMessageToCare.js<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2021 Inera AB (http://www.inera.se) * * This file is part of sklintyg (https://github.com/sklintyg). * * sklintyg is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as publ...
svarPa + ' <urn1:skickatAv>' + ' <urn1:part>' + ' <urn2:code>FKASSA</urn2:code>' +
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import system # Create the computer system and power it up. sys = system.System()<|fim▁hole|>sys.power_on()<|fim▁end|>
<|file_name|>get_non_locator_timeline.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # __author__: Yixuan LI # __email__: yl2363@cornell.edu import os import json import re from optparse import OptionParser import tweepy import time class UserTimeline: def __init__(self,inputDir,outputDir): self.inputDi...
<|file_name|>edgecast.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' Copyright (C) 2020, WAFW00F Developers. See the LICENSE file for copying permission. ''' NAME = 'Edgecast (Verizon Digital Media)' <|fim▁hole|> schemes = [ self.matchHeader(('Server', r'^ECD(.+)?')), self.matchHeader(('S...
def is_waf(self):
<|file_name|>enum_trait.rs<|end_file_name|><|fim▁begin|>use protocol::Enum;<|fim▁hole|> Bar, } #[test] fn can_get_discriminator() { let foo = WithGenerics::Foo(99u16, "hello".to_owned()); let bar: WithGenerics<bool, bool> = WithGenerics::Bar; assert_eq!("Foo", foo.discriminator()); assert_eq!("Bar"...
#[derive(Protocol, Clone, Debug, PartialEq)] pub enum WithGenerics<A, B> { Foo(A, B),
<|file_name|>EndgameEmber.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/. """ By default, this module uses the pre-built Ember model fro...
(fname, {'Prediction': ember_result})
<|file_name|>eval.rs<|end_file_name|><|fim▁begin|>use crate::error::*; use crate::il; /// Evaluate an `il::Expression` where all terminals are `il::Constant`, and /// return the resulting `il::Constant`. pub fn eval(expr: &il::Expression) -> Result<il::Constant> { Ok(match *expr { il::Expression::Scalar(re...
il::Expression::Trun(bits, ref rhs) => eval(rhs)?.trun(bits)?, il::Expression::Sext(bits, ref rhs) => eval(rhs)?.sext(bits)?, il::Expression::Ite(ref cond, ref then, ref else_) => { if eval(cond)?.is_one() {
<|file_name|>lattice.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ equip.analysis.dataflow.lattice ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The base lattice implementation (mostly used as semi-lattice). :copyright: (c) 2014 by Romain Gaucher (@rgaucher) :license: Apache 2, see LICENSE for more details....
pass def meet_all(self, *states): result_state = None
<|file_name|>translations.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import sys file = sys.argv[1]<|fim▁hole|> xmlns:py="http://genshi.edgewall.org/" xmlns:xi="http://www.w3.org/2001/XInclude" py:strip=""> ''' try: for lang in f: lang = lang.strip() if lang and not lang.startswith('#'...
f = open(file) print ''' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"
<|file_name|>about.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Created on Oct 2, 2010 @author: dimitry (zavlab1) ''' <|fim▁hole|>from gi.repository import Gdk from foobnix.gui.service.path_service import get_foobnix_resourse_path_by_name from foobnix.util.const import ICON_FOOBNIX from foobnix.version ...
from gi.repository import Gtk
<|file_name|>tops_sql.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- # filename: tops_sql.py # Copyright 2008-2010 Stefano Costa <steko@iosa.it> # # This file is part of Total Open Station.<|fim▁hole|># modify it under the terms of the GNU General Public License as # published by the Fre...
# # Total Open Station is free software: you can redistribute it and/or
<|file_name|>pkcs12.py<|end_file_name|><|fim▁begin|># # PKCS#12 syntax # # ASN.1 source from: # ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12.asn # # Sample captures could be obtained with "openssl pkcs12" command # from pyasn1_modules.rfc2459 import * from pyasn1_modules import rfc2251 class Attributes(univ.Set...
class CertificationRequestInfo(univ.Sequence):
<|file_name|>ar_PS.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="ps_AF" sourcelanguage="en_US"> <context> <name>ApplicationNotificationModel</name> <message> <location filename="../settings/applicationnotificationmodel.cpp" line="62"/> ...
<|file_name|>syntax-extension-bytes.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.apa...
let vec = bytes!("abc");
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>import cairo from gi.repository import Gtk from gi.repository import Gdk from pylsner import plugin class Window(Gtk.Window): def __init__(self): super(Window, self).__init__(skip_pager_hint=True, skip_taskbar_hint=Tr...
): self.name = name MetricPlugin = plugin.load_plugin('metrics', metric['plugin']) self.metric = MetricPlugin(**metric)
<|file_name|>backend_bases.py<|end_file_name|><|fim▁begin|>""" Abstract base classes define the primitives that renderers and graphics contexts must implement to serve as a matplotlib backend :class:`RendererBase` An abstract base class to handle drawing/rendering operations. :class:`FigureCanvasBase` The abs...
*trans*
<|file_name|>consts.py<|end_file_name|><|fim▁begin|># coding=utf-8<|fim▁hole|>HOSTNAME = 'localhost' DATABASE = 'r' USERNAME = 'web' PASSWORD = 'web' DB_URI = 'mysql://{}:{}@{}/{}'.format( USERNAME, PASSWORD, HOSTNAME, DATABASE)<|fim▁end|>
<|file_name|>IdxBtOmp.hpp<|end_file_name|><|fim▁begin|>/** * \file * Copyright 2014-2015 Benjamin Worpitz * * This file is part of alpaka. * * alpaka 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, eith...
namespace traits
<|file_name|>GenericsExample.java<|end_file_name|><|fim▁begin|>package com.ryanharter.auto.value.moshi.example; import com.google.auto.value.AutoValue; import com.squareup.moshi.JsonAdapter; import com.squareup.moshi.Moshi; import java.lang.reflect.Type; @AutoValue public abstract class GenericsExample<A, B, C> { ...
<|file_name|>services.js<|end_file_name|><|fim▁begin|>'use strict'; /* Services */ // Demonstrate how to register services // In this case it is a simple value service. angular.module('baApp.services', []).<|fim▁hole|><|fim▁end|>
value('version', '0.1');
<|file_name|>colorpicker.js<|end_file_name|><|fim▁begin|>/* * JCE Editor 2.2.4 * @package JCE * @url http://www.joomlacontenteditor.net * @copyright Copyright (C) 2006 - 2012 Ryan Demmer. All rights reserved * @license GNU/GPL Vers...
* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<|file_name|>Feed.cpp<|end_file_name|><|fim▁begin|>#include "Feed.h" Feed::Feed(QObject *parent) :<|fim▁hole|>}<|fim▁end|>
QObject(parent) {
<|file_name|>split_string.rs<|end_file_name|><|fim▁begin|>fn str_split<T: Into<String>>(string: T, delim: char) -> Vec<String> { let mut words = vec![]; let mut curr = String::new(); for c in string.into().chars() { match c == delim { true => { words.push(curr); ...
}
<|file_name|>valid.js<|end_file_name|><|fim▁begin|>/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib 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.apach...
<|file_name|>blog_datastore_factory.py<|end_file_name|><|fim▁begin|>''' Created on Apr 30, 2012 @author: h87966 ''' from unit5.blog_datastore_memory import BlogMemoryDataStore from unit5.blog_datastore_appengine import BlogAppengineDataStore<|fim▁hole|>class BlogDataStoreFactory(): ''' classdocs ''' st...
<|file_name|>output.py<|end_file_name|><|fim▁begin|>import sublime, sublime_plugin def clean_layout(layout): row_set = set() col_set = set() for cell in layout["cells"]: row_set.add(cell[1]) row_set.add(cell[3]) col_set.add(cell[0]) col_set.add(cell[2]) row_set = sorte...
def append_finish_message(self, command, working_dir, return_code, elapsed_time): if return_code != 0: templ = "[Finished in {:.2f}s with exit code {}]\n" self.append(templ.format(elapsed_time, return_code))
<|file_name|>BasicHttpClient.java<|end_file_name|><|fim▁begin|>/*************************************************************************** * Project file: NPlugins - NCore - BasicHttpClient.java * * Full Class name: fr.ribesg.com.mojang.api.http.BasicHttpClient * * ...
import java.io.BufferedReader;
<|file_name|>table.go<|end_file_name|><|fim▁begin|>package html type traits uint16 const ( normalTag traits = 1 << iota rawTag // raw tags need special processing for their content nonPhrasingTag // non-phrasing elements are unaffected by whitespace, remove spaces around these tags obje...
"mapsto": []byte("&map;"),
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2 on 2020-06-20 15:23 from django.db import migrations, models class Migration(migrations.Migration): <|fim▁hole|> operations = [ migrations.CreateModel( name="A", fields=[ ( ...
initial = True dependencies = []
<|file_name|>types.js<|end_file_name|><|fim▁begin|>export const ADD_COCKTAIL = 'ADD_COCKTAIL'; export const LOAD_COCKTAILS = 'LOAD_COCKTAILS'; export const ADD_SPIRIT = 'ADD_SPIRIT'; export const REMOVE_SPIRIT = 'REMOVE_SPIRIT';<|fim▁hole|><|fim▁end|>
export const UPDATE_HUE = 'UPDATE_HUE';
<|file_name|>serializer.py<|end_file_name|><|fim▁begin|>from website.addons.base.serializer import CitationsAddonSerializer <|fim▁hole|><|fim▁end|>
class MendeleySerializer(CitationsAddonSerializer): addon_short_name = 'mendeley'
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>def validate(hand): if hand < 0 or hand > 2: return False <|fim▁hole|> return True def print_hand(hand, name='ゲスト'): hands = ['グー', 'チョキ', 'パー'] print(name + 'は' + hands[hand] + 'を出しました') def judge(player, computer): if player == c...
<|file_name|>X.js<|end_file_name|><|fim▁begin|>package test0657; <|fim▁hole|><|fim▁end|>
public class X {} class A {}
<|file_name|>gssapi_not_enabled.go<|end_file_name|><|fim▁begin|>// Copyright (C) MongoDB, Inc. 2017-present.<|fim▁hole|>// 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 //+build !gssapi package auth // GSSAPI is the mech...
// // Licensed under the Apache License, Version 2.0 (the "License"); you may
<|file_name|>test_review.py<|end_file_name|><|fim▁begin|>from . import load_fixture from lintreview.config import load_config from lintreview.diff import DiffCollection from lintreview.review import Review, Problems, Comment from lintreview.repo import GithubRepository, GithubPullRequest from mock import Mock, call fro...
eq_(2, len(result)) expected = [ (None, None, 'This is a general comment'),
<|file_name|>gpmdp.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Display currently playing song from Google Play Music Desktop Player. Configuration parameters: cache_timeout: how often we refresh this module in seconds (default 5) format: specify the items and ordering of the data in th...
else: cmds = ['info', 'title', 'artist', 'album', 'status', 'current',
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ This script is a trick to setup a fake Django environment, since this reusable app will be developed and tested outside any specifiv Django project. Via ``settings.configure`` you will be able to set all necessary settings for your app and ...
<|file_name|>UpdateDomainEndpointOptionsResultStaxUnmarshaller.java<|end_file_name|><|fim▁begin|>/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. 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. A...
* * or in the "license" file accompanying this file. This file 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
<|file_name|>casa-external_twilio_sms.py<|end_file_name|><|fim▁begin|># This is a modified version of original twilio_sms Gluu's script to work with Casa from java.util import Arrays from javax.faces.application import FacesMessage from org.gluu.jsf2.message import FacesMessages from org.gluu.oxauth.security import ...
user_name = credentials.getUsername()
<|file_name|>bloom.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import turtle import random def bloom(radius): turtle.colormode(255) for rad in range(40, 10, -5): for looper in range(360//rad): turtle.up() turtle.circle(radius+rad, rad) turtle.begin_fill() ...
if __name__ == "__main__":
<|file_name|>ErrorSimulationService.java<|end_file_name|><|fim▁begin|>package com.capgemini.resilience.employer.service; public interface ErrorSimulationService { void generateErrorDependingOnErrorPossibility();<|fim▁hole|><|fim▁end|>
}
<|file_name|>lp2pass.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import csv import sys import json import hashlib from subprocess import Popen, PIPE from urlparse import urlparse DEFAULT_GROUP = "lastpass-import" class Record: def __init__(self, d): self.d = d self.password = d['passw...
process = Popen(["pass", "insert", "-m", self.id], stdin=PIPE, stdout=PIPE, stderr=None)
<|file_name|>pulsar_objectstore_test.py<|end_file_name|><|fim▁begin|>from os import makedirs from os.path import join, dirname, exists from string import Template from galaxy.util.bunch import Bunch from galaxy.objectstore import build_object_store_from_config from .test_utils import TempDirectoryTestCase from .test_o...
<|file_name|>math.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ pyextend.core.math ~~~~~~~~~~~~~~~~~~ pyextend core math tools. :copyright: (c) 2016 by Vito. :license: GNU, see LICENSE for more details. """ def isprime(n): """Check the number is prime value. if prime value returns True,...
return True
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/// <reference path="../typings/main.d.ts"/> import {Request, Response} from "express"; var express = require('express'); var util = require('util'); var router = express.Router(); /* GET home page. */<|fim▁hole|> res.render('index', { title: 'Express' }); }); modul...
router.get('/', function(req: Request, res: Response, next: Function) {
<|file_name|>debug.rs<|end_file_name|><|fim▁begin|>use core::sync::atomic::{AtomicUsize, Ordering}; use spin::{Once, RwLock, RwLockReadGuard, RwLockWriteGuard}; use crate::arch::debug::Writer; use crate::event; use crate::scheme::*; use crate::sync::WaitQueue; use crate::syscall::flag::{EventFlags, EVENT_READ, F_GETFL...
let handle = { let handles = handles(); *handles.get(&id).ok_or(Error::new(EBADF))? };
<|file_name|>getSNREClassList.py<|end_file_name|><|fim▁begin|>import urllib.request as urllib from bs4 import BeautifulSoup as bs import unicodedata import pandas as pd import os baseURL='http://snre.ifas.ufl.edu/academics/graduate/courses-syllabi-and-curriculum/' classListFile='majorClassLists/SNREList.csv' html_tit...
# Primary scraping code class_list = []
<|file_name|>joni.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
showWord(["v. ","vin jòn.<br>"])
<|file_name|>mutations.py<|end_file_name|><|fim▁begin|>from django.contrib.auth import authenticate, get_user_model from graphene import AbstractType, relay, Field, String, ObjectType, Union, List from users.jwt_schema import TokensSuccess from users.jwt_util import get_jwt_token from users.schema.definitions import V...
class Meta: types = (Viewer, FormErrors)
<|file_name|>prelude.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//! Traits and essential types inteded for blanket imports. pub use { AppInfoExt, Cast, Continue, IsA, ObjectExt, StaticType, ToValue, };<|fim▁end|>
<|file_name|>TargetClass.java<|end_file_name|><|fim▁begin|>package com.bjorktech.cayman.idea.designpattern.structure.proxy; public class TargetClass implements TargetInterface { @Override public long add(long a, long b) { long temp = a + b; System.out.println(temp); return temp; } <|fim▁hole|> return temp; ...
@Override public long sub(long a, long b) { long temp = a - b; System.out.println(temp);
<|file_name|>generated.pb.go<|end_file_name|><|fim▁begin|>/* Copyright 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 Unless...
<|file_name|>SystemdJournalUtilsTest.java<|end_file_name|><|fim▁begin|>/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.rao2100.starter.utils; import org.junit.After;<|fim...
import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass;
<|file_name|>imagestreamlookup.go<|end_file_name|><|fim▁begin|>package app import ( "fmt" "strings" "github.com/golang/glog" kapi "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/errors" "github.com/openshift/origin/pkg/client" imageapi "github.com/openshift/origin/pkg/image/api" ) // ImageStreamSearch...
} }
<|file_name|>LiNMT-postprocess-text-chunking-rmNP.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Author: Qiang Li # Email: liqiangneu@gmail.compile # Time: 10:27, 03/30/2017 import sys import codecs import argparse import random from io import open argparse.open = open reload(sys) sys....
def create_parser(): parser = argparse.ArgumentParser(
<|file_name|>plot_55_setting_eeg_reference.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ .. _tut-set-eeg-ref: Setting the EEG reference ========================= This tutorial describes how to set or change the EEG reference in MNE-Python. .. contents:: Page contents :local: :depth: 2 As usual w...
# still go back to the unmodified :class:`~mne.io.Raw` object later: # sphinx_gallery_thumbnail_number = 4
<|file_name|>LoLN_convergence_examples_ch04.py<|end_file_name|><|fim▁begin|>import numpy as np import matplotlib.pyplot as plt import pymc as pm def main():<|fim▁hole|> N_samples = range(1, sample_size, 100) for k in range(3): samples = pm.rpoisson(lambda_, size=sample_size) partial_average = ...
sample_size = 100000 expected_value = lambda_ = 4.5
<|file_name|>bytearray_construct_array.py<|end_file_name|><|fim▁begin|># test construction of bytearray from different objects try: from uarray import array except ImportError: try: from array import array except ImportError:<|fim▁hole|> raise SystemExit # arrays print(bytearray(array('b', [...
print("SKIP")
<|file_name|>main.ts<|end_file_name|><|fim▁begin|>import {enableProdMode} from '@angular/core'; import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; import {AppModule} from './app/app.module'; import {environment} from './environments/environment'; if (environment.production) { enableProdMode()...
<|file_name|>wrappers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ werkzeug.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~ Extra wrappers or mixins contributed by the community. These wrappers can be mixed in into request objects to add extra functionality. Example:: from werk...
class DynamicCharsetRequestMixin(object):
<|file_name|>CharacterPlanetResponseTest.java<|end_file_name|><|fim▁begin|>/* * EVE Swagger Interface * An OpenAPI for EVE Online *<|fim▁hole|> * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ pac...
*
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|># Copyright 2014 IBM Corp. # # 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...
domain_specific_drivers_enabled=False) self.assertFalse(getattr(ldap, symptom)()) # No Symptom Detected: Domain configuration from database is enabled