prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>pyside.py<|end_file_name|><|fim▁begin|>""" Sets up the Qt environment to work with various Python Qt wrappers """ # define authorship information __authors__ = ['Eric Hulser'] __author__ = ','.join(__authors__) __credits__ = [] __copyright__ = 'Copyright (c) 2012, Proj...
""" Overloads teh create action method to handle the proper base instance information, similar to the PyQt4 loading system.
<|file_name|>od_glob.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 """ Global variables for onedrive_d. """ import os import sys import logging import atexit import json from calendar import timegm from datetime import timezone, datetime, timedelta from pwd import getpwnam from . import od_ignore_list config_in...
def dump_config(): if update_last_run_timestamp and config_instance is not None:
<|file_name|>video.cpp<|end_file_name|><|fim▁begin|>#include <vector> #include <iostream> #include <SDL/SDL.h> #include <SDL/SDL_gfxPrimitives.h> #include <SDL/SDL_image.h> #include <SDL/SDL_mixer.h> #include "base.h" #include "game.h" #include "video.h" void draw3DLine( SDL_Surface *video, Vec3 &camera, Vec3 &p0, V...
<|file_name|>tamilvu_wordlist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # (C) 2015 Muthiah Annamalai, <ezhillang@gmail.com> # Ezhil Language Foundation # from __future__ import print_function import sys import codecs import tamil import json sys.stdout = codecs.getwriter('utf-8')(sys.stdout) class Wo...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # __init__.py # Copyright (C) 2013 LEAP # # 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 Li...
<|file_name|>Word.java<|end_file_name|><|fim▁begin|>/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package cz.webarchiv.webanalyzer.dictionary; /** * * @author praso */<|fim▁hole|> public String getWord() { return word; } public void setWord...
class Word implements java.lang.Comparable<Word> { private String word;
<|file_name|>goggle-paper.js<|end_file_name|><|fim▁begin|>/* google-paper.js */ 'use strict'; navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; var RAD_2_DEG = 180/Math.PI; function moving_average(period) { var nums = []; return function(num) { nums...
}, function(error){ console.log('stream not found'); }
<|file_name|>AboutDialog.java<|end_file_name|><|fim▁begin|>package com.churches.by.ui; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.Window; import com.churches.by.R; public cla...
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); return inflater.inflate(R.layout.about_dialog, container, false); }
<|file_name|>MLDB-2107-scalar-format.py<|end_file_name|><|fim▁begin|># # MLDB-2107-scalar-format.py # Mathieu Marquis Bolduc, 2017-01-10 # This file is part of MLDB. Copyright 2017 mldb.ai inc. All rights reserved. # from mldb import mldb, MldbUnitTest, ResponseException class MLDB2107ScalarFormatTest(MldbUnitTest): ...
def test_multiple_rows_limit(self): n = mldb.get('/v1/query', q="select x from ds limit 1", format='atom').json() self.assertEqual('B', n)
<|file_name|>mainStaticPersonTask.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: # Purpose: This .py file is the main Framework file # It ranks images of a specific person of int...
print('\nStage 3: %.2f seconds' % elapsed)
<|file_name|>reindeer-race-test.js<|end_file_name|><|fim▁begin|>var expect = require("chai").expect; var reindeerRace = require("../../src/day-14/reindeer-race"); describe("--- Day 14: (1/2) distance traveled --- ", () => { it("counts the distance traveled after 1000s", () => { var reindeerSpecs = [ "Comet...
]; expect(reindeerRace.race(reindeerSpecs, 1000).winnerByDistance.distanceTraveled).to.equal(1120);
<|file_name|>scan.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import cv if __name__ == "__main__": capture = cv.CaptureFromCAM(-1) cv.NamedWindow("image") while True:<|fim▁hole|> k = cv.WaitKey(10) if k % 256 == 27: break cv.DestroyWindow("image")<|fim▁end|>
frame = cv.QueryFrame(capture) cv.ShowImage("image", frame)
<|file_name|>test_sig_source_i.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under ...
####################################################################### # Validate that query returns all expected parameters # Query of '[]' should return the following set of properties
<|file_name|>export-default.js<|end_file_name|><|fim▁begin|>System.register([], function (_export, _context) { "use strict"; _export("default", function () { return 'test'; });<|fim▁hole|> return { setters: [], execute: function () {} }; });<|fim▁end|>
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(collections)]<|fim▁hole|> use opencl::mem::CLBuffer; use std::fmt; fn main() { let ker = include_str!("demo.ocl"); println!("ker {}", ker); let vec_a = vec![0isize, 1, 2, -3, 4, 5, 6, 7]; let vec_b = vec![-7isize, -6, 5, -4, 0, -1, 2, 3]; ...
extern crate opencl;
<|file_name|>Loops.py<|end_file_name|><|fim▁begin|>''' While x is less than 10 it will print x and add 1 to that number, then print it and so on until that condition is false, which is when x equals 10 ''' condition = input('Enter number: ') x = int(condition) print (' ')<|fim▁hole|> print (x) x += 1 ...
print ('While loop:') while x <= 10:
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT) // Copyright (c) 2014 Y. T. CHUNG <zonyitoo@gmail.com> // 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 r...
<|file_name|>Scanner.py<|end_file_name|><|fim▁begin|># Copyright 2007-2010 by Peter Cock. All rights reserved. # Revisions copyright 2010 by Uri Laserson. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included #...
def find_start(self):
<|file_name|>events.rs<|end_file_name|><|fim▁begin|>#[macro_use(with_assets)] extern crate Lattice; use Lattice::window::{Window}; use Lattice::view::{View, Text}; use std::rc::Rc; use std::cell::{RefCell,Cell}; use std::sync::Mutex; #[macro_use] extern crate lazy_static; lazy_static! {<|fim▁hole|>} fn main() { ...
static ref text_clicked: Mutex<Cell<bool>> = Mutex::new(Cell::new(false)); static ref left_hovered: Mutex<Cell<bool>> = Mutex::new(Cell::new(false));
<|file_name|>0020_annotation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-06-13 03:20 from __future__ import unicode_literals import django.contrib.postgres.fields.ranges from django.db import migrations, models import django.db.models.deletion class Migration(migratio...
<|file_name|>spellbook.js<|end_file_name|><|fim▁begin|>/* Spellbook Class Extension */ if (!Array.prototype.remove) { Array.prototype.remove = function (obj) { var self = this; if (typeof obj !== "object" && !obj instanceof Array) { obj = [obj]; } return self.filter(function(e){ if(obj.indexOf(e)<0) { ...
<|file_name|>panel.py<|end_file_name|><|fim▁begin|># Copyright 2015 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.<|fim▁hole|># # Unless required by applicable law or agreed to in writing, software # distributed under the ...
# You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0
<|file_name|>logdata.py<|end_file_name|><|fim▁begin|>import RPi.GPIO as GPIO import os import time import datetime import glob import MySQLdb from time import strftime import serial ser = serial.Serial( port='/dev/ttyACM0', baudrate = 9600, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, b...
f=x.split()
<|file_name|>Person.java<|end_file_name|><|fim▁begin|>package app.intelehealth.client.models.pushRequestApiCall; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import java.util.List; public class Person { @SerializedName("uuid") @Expose private String uuid;...
return birthdate;
<|file_name|>routes.ts<|end_file_name|><|fim▁begin|>import { Routes } from '@angular/router'; import { BookExistsGuard } from './guards/book-exists'; import { FindBookPageComponent } from './containers/find-book-page'; import { ViewBookPageComponent } from './containers/view-book-page'; import { CollectionPageComponen...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var q = require('q'); var _ = require('lodash'); var moment = require('moment'); var trello = require('../libs/trello_client'); var ORGANIZATIONS = [ { id: '4ffb85c372c8548a030144e5', name: 'HuaJiao' }, { id: '4ffb861572c8548a03015a66', name: 'Asimov' }, { id: ...
return q.all(results); }) .then(function (results) {
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 # from __future__ import unicode_literals from os import path from setuptools import setup, find_packages here = path.abspath(path.dirname(__file__)) def readme(): "Falls back to just file().read() on any error, because th...
version='1.0.9', classifiers=[ "Programming Language :: Python :: 2",
<|file_name|>specification.py<|end_file_name|><|fim▁begin|># # Copyright (C) 2009 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version...
# License and may only be used or replicated with the express permission of
<|file_name|>detailsEventCtrl.js<|end_file_name|><|fim▁begin|>angular.module('app.controllers') .controller('detailsEventCtrl', ['$stateParams', '$window', '$http','eventService','personService','commentService','participantService', '$state', '$filter', '$ionicPopup', 'reviewService',// The following is the construct...
} } } ]
<|file_name|>performance.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 actor::{Actor, ActorMessageStatus, ActorRegistry}; us...
struct PerformanceFeatures { withMarkers: bool, withMemory: bool,
<|file_name|>testsetXML2intermediateConverter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python #=============================================================================== # # conversion script to create a mbstestlib readable file containing test specifications # out of an testset file in XML format # #===========...
<|file_name|>RAuditEventRecord.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2010-2013 Evolveum * * 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/lic...
<|file_name|>any.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at<|fim▁hole|>// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache...
<|file_name|>gpioset.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # SPDX-License-Identifier: LGPL-2.1-or-later # # This file is part of libgpiod. # # Copyright (C) 2017-2018 Bartosz Golaszewski <bartekgola@gmail.com> # '''Simplified reimplementation of the gpioset tool in Python.''' import gpiod import sys...
values = []
<|file_name|>demoserver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Server that will accept connections from a Vim channel. # Run this server and then in Vim you can open the channel: # :let handle = ch_open('localhost:8765') # # Then Vim can send requests to the server: # :let response = ch_sendexpr(handle...
print("No socket yet")
<|file_name|>flexbox_sub_layout.rs<|end_file_name|><|fim▁begin|>/*! A very simple application that show how to use a flexbox layout. Requires the following features: `cargo run --example flexbox --features "flexbox"` */ extern crate native_windows_gui as nwg; use nwg::NativeUi; #[derive(Default)] pub struct...
return Ok(ui); } }
<|file_name|>empPath.py<|end_file_name|><|fim▁begin|># Copyright (C) 1998 Ulf Larsson # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at yo...
self.__insert_path( self.__tails, path )
<|file_name|>create-cube-mesh.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import * as babylon from "@babylonjs/core" export const createCubeMesh = (scene: babylon.Scene): babylon.Mesh => { const material = new babylon.StandardMaterial("cube-material", scene) material.emissiveColor = new babylon.Color3(0.1, 0.6, 0.9)...
<|file_name|>bigip_partition.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['previ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># vim:fileencoding=utf8:et:ts=4:sts=4:sw=4:ft=python from django.conf import settings from django.contrib import messages from django.contrib.auth import (login as _login, logout as _logout, authenticate) from django.core.mail import s...
logger_mail.exception(error) raise OkupyError("Can't contact the database") send_mail( '%sAccount Activation' % settings.EMAIL_SUBJECT_PREFIX,
<|file_name|>debug.go<|end_file_name|><|fim▁begin|>package main import ( "bytes" "io" "log" "os" ) // bindata_read reads the given file from disk. // It panics if anything went wrong. func bindata_read(path, name string) []byte { fd, err := os.Open(path) if err != nil { log.Fatalf("Read %s: %v", name, err) }...
"/a/code/go/src/github.com/jteeuwen/go-bindata/testdata/in/a/test.asset", "in/a/test.asset",
<|file_name|>PersistentBuffer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2018 Ericsson AB # # 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.apac...
q.addErrback(error) # Nothing to do return False
<|file_name|>test_submitter_app.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/. import mock import time import json from nose.tools imp...
<|file_name|>cancel.ts<|end_file_name|><|fim▁begin|>/** * @docs https://docs.mollie.com/reference/v2/refunds-api/cancel-refund */ import createMollieClient from '@mollie/api-client'; const mollieClient = createMollieClient({ apiKey: 'test_dHar4XY7LxsDOtmnkVtjNVWXLSlXsM' }); (async () => { try {<|fim▁hole|> con...
const status: boolean = await mollieClient.paymentRefunds.cancel('re_4qqhO89gsT', { paymentId: 'tr_WDqYK6vllg' });
<|file_name|>readme.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate linxal; extern crate ndarray; use linxal::types::{c32, LinxalMatrix};<|fim▁hole|>use linxal::solve_linear::SolveLinear; use ndarray::{arr1, arr2}; fn f1() { let m = arr2(&[[1.0f32, 2.0], [-2.0, 1.0]]); let r = m....
use linxal::eigenvalues::Eigen;
<|file_name|>readsensors.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Questo file legge il file di configurazione, # trova e modifica il parametro eseguendo il rispettivo "write*.py" # Serve per la parte di gestione html in python import cgi import cgitb # Abilita gli errori al server web/http cgitb.enab...
# Scrivo il Titolo/Testo della pagina
<|file_name|>natsort.py<|end_file_name|><|fim▁begin|># This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals<|fim▁hole|> f...
<|file_name|>audio_item.py<|end_file_name|><|fim▁begin|>__author__ = 'bromix' from .base_item import BaseItem class AudioItem(BaseItem): def __init__(self, name, uri, image=u'', fanart=u''): BaseItem.__init__(self, name, uri, image, fanart) self._duration = None self._track_number = None ...
def get_duration(self): return self._duration
<|file_name|>0063_populate_uuid_values.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-09-05 09:13 from __future__ import unicode_literals import uuid from django.core.exceptions import FieldDoesNotExist from django.db import migrations def set_uuid_field(apps, schema_edito...
for model_class in base.get_models(): ids = model_class.objects.values_list('id', flat=True) if ids:
<|file_name|>Status.test.js<|end_file_name|><|fim▁begin|>import React from 'react'; import Status from 'components/Status'; import renderer from 'react-test-renderer'; describe('Status component', () => { function getComponent(piecesLeftCount) { return renderer.create( <Status piecesLeftCount={piecesLeftCo...
it('should show "Done" when no pieces left', () => {
<|file_name|>touch_buttons.cpp<|end_file_name|><|fim▁begin|>/** * Marlin 3D Printer Firmware * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] * * 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...
// Send the touch to the UI (which will simulate the encoder wheel)
<|file_name|>device-id-server.js<|end_file_name|><|fim▁begin|>Meteor.methods({<|fim▁hole|> 'deviceId/isClaimed': function(deviceId) { check(deviceId, String); return isClaimed(deviceId) }, 'deviceId/gen': function() { return gen(); }, 'deviceId/store': function(deviceId) { check(deviceId, Stri...
<|file_name|>tab_jsp.java<|end_file_name|><|fim▁begin|>/* * Generated by the Jasper component of Apache Tomcat * Version: Apache Tomcat/7.0.53 * Generated at: 2015-06-08 03:36:45 UTC * Note: The last modified time of this file was set to * the last modified time of the source file after * generation t...
if (_jspx_eval_f_005fverbatim_005f12 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) { if (_jspx_eval_f_005fverbatim_005f12 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) { out = _jspx_page_context.pushBody(); _jspx_th_f_005fverbatim_005f12.setBodyContent((javax.servlet.jsp.tagext.BodyContent) ...
<|file_name|>base_class.py<|end_file_name|><|fim▁begin|>''' Defines the base class of an electric potential grid. ''' import numpy as np import matplotlib as mpl import matplotlib.pylab as plt from numba import jit # Global dimensions (used for plots) sqc_x = (2., 'cm') # unit length for SquareCable sqc_u = (10., 'V...
new_grid=np.copy(grid) for index, fixed in np.ndenumerate(fix): if fixed: continue new_grid[index] = 0.25*( grid[index[0]-1, index[1]] +
<|file_name|>0050_auto_20181005_1425.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-10-05 14:25 from __future__ import unicode_literals <|fim▁hole|>class Migration(migrations.Migration): dependencies = [("elections", "0049_move_status")] operations = [ mi...
from django.db import migrations
<|file_name|>global.d.ts<|end_file_name|><|fim▁begin|>/// <reference types="segment-analytics" /> import React from "react" import Relay from "react-relay" import sharify from "sharify"<|fim▁hole|> interface Window { /** * This requires the Segment JS client to be exposed as `window.analytics`. */ a...
declare global {
<|file_name|>walletdb.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin developers // Copyright (c) 2014-2015 The Bagcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/lice...
if (pwtx)
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) from . import _wrap_numbers, Symbol, Number, Matrix def symbols(s): """ mimics sympy.symbols """ tup = tuple(map(Symbol, s.replace(',', ' ').split())) if len(tup) ==...
<|file_name|>aligned_parse_reader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """aligned_parse_reader.py: read parsed and aligned files""" __author__ = "Fabien Cromieres" __license__ = "undecided" __version__ = "1.0" __email__ = "fabien.cromieres@gmail.com" __status__ = "Development"<|fim▁hole|> import loggin...
from __future__ import absolute_import, division, print_function, unicode_literals
<|file_name|>TestIndexDeletion.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2002-2011 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU Aff...
firstTx.removeFromIndex( key, value ); assertThat( secondTx.queryIndex( key, value ), contains( node ) );
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/** * webdriverio * https://github.com/Camme/webdriverio * * A WebDriver module for nodejs. Either use the super easy help commands or use the base * Webdriver wire protocol commands. Its totally inspired by jellyfishs webdriver, but the * goal is to make all the...
<|file_name|>dom-portal-host.d.ts<|end_file_name|><|fim▁begin|>import { ComponentFactoryResolver, ComponentRef } from '@angular/core'; import { BasePortalHost, ComponentPortal, TemplatePortal } from './portal'; /** * A PortalHost for attaching portals to an arbitrary DOM element outside of the Angular * application c...
attachTemplatePortal(portal: TemplatePortal): Map<string, any>; dispose(): void; }
<|file_name|>CreateUserInputInterface.java<|end_file_name|><|fim▁begin|>/* * (c) Copyright 2021 Micro Focus * All rights reserved. This program and the accompanying materials * are made available under the terms of the Apache License v2.0 which accompany this distribution. * * The Apache License is available at *...
<|file_name|>pose-predictor.js<|end_file_name|><|fim▁begin|>/* * Copyright 2015 Google 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://www.apache....
break; case PredictionMode.PREDICT: var axisAngle;
<|file_name|>noUndefined.js<|end_file_name|><|fim▁begin|>/* * /MathJax/extensions/TeX/noUndefined.js <|fim▁hole|> * Part of the MathJax library. * See http://www.mathjax.org for details. * * Licensed under the Apache License, Version 2.0; * you may not use this file except in compliance with the License...
* * Copyright (c) 2010 Design Science, Inc. *
<|file_name|>005_cleaner.py<|end_file_name|><|fim▁begin|># 005_cleaner.py ##################################################################### ################################## # Import des modules et ajout du path de travail pour import relatif import sys sys.path.insert(0 , 'C:/Users/WILLROS/Perso/Shade/scri...
for line in list_without_oddities: ref_list.append( StringFormatter( line ) )
<|file_name|>grunt.js<|end_file_name|><|fim▁begin|>/*jshint node:true */ module.exports = function( grunt ) { "use strict"; var entryFiles = grunt.file.expandFiles( "entries/*.xml" ); grunt.loadNpmTasks( "grunt-clean" ); grunt.loadNpmTasks( "grunt-wordpress" ); grunt.loadNpmTasks( "grunt-jquery-content" ); grunt.loa...
"build-resources": { all: grunt.file.expandFiles( "resources/**" ) }, wordpress: grunt.utils._.extend({
<|file_name|>ControlPrinter.cpp<|end_file_name|><|fim▁begin|>// // ControlPrinter.cpp // Tonic // // Created by Morgan Packard on 4/28/13. // Copyright (c) 2013 Nick Donaldson. All rights reserved. // #include "ControlPrinter.h" namespace Tonic { namespace Tonic_{ ControlPrinter_::ControlPrinter_() :mess...
<|file_name|>mocha-ci-reporter.js<|end_file_name|><|fim▁begin|>const JsonReporter = require('./mocha-custom-json-reporter'); const mocha = require('mocha'); const MochaDotsReporter = require('./mocha-dots-reporter'); const MochaJUnitReporter = require('mocha-junit-reporter'); const {Base} = mocha.reporters; /** * @pa...
* @return {MochaDotsReporter} */ function ciReporter(runner, options) {
<|file_name|>sysinfo.py<|end_file_name|><|fim▁begin|>import os from multiprocessing import cpu_count _cpu_count = cpu_count() if hasattr(os, 'getloadavg'): def load_fair(): return 'load', os.getloadavg()[0] / _cpu_count else: from winperfmon import PerformanceCounter from threading import Thread ...
def run(self): while True: pql, pt = self.counter.query()
<|file_name|>sparc64_unknown_linux_gnu.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www....
<|file_name|>manage-account.component.ts<|end_file_name|><|fim▁begin|>/** * Created by yezm on 12/08/2016. */ import {Component, OnDestroy, OnInit} from "@angular/core"; import {AuthService} from "../../shared/auth.service"; import {FormControl, FormGroup, Validators, FormBuilder} from "@angular/forms"; import {Rout...
import {ValidationService} from "../../shared/validation.service"; @Component({ selector: 'manage-account',
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- from __future__ import absolute_import from django.conf.urls import url, include from .views import MonitoringView urlpatterns = [<|fim▁hole|> url(r'^plugins/', include('app.modules.monitoring_nodes.plugins.urls', namespace="plugins")), ur...
url(r'^$', MonitoringView.as_view(), name="index"), url(r'^info/', include('app.modules.monitoring_nodes.info.urls', namespace='info')),
<|file_name|>foundation.dropdown.js<|end_file_name|><|fim▁begin|>/*jslint unparam: true, browser: true, indent: 2 */ ;(function ($, window, document, undefined) { 'use strict'; Foundation.libs.dropdown = { name : 'dropdown', version : '4.3.2', settings : { activeClass: 'open', is_hover: ...
<|file_name|>0434-Number of Segments in a String.py<|end_file_name|><|fim▁begin|>class Solution: def countSegments(self, s: 'str') -> 'int':<|fim▁hole|><|fim▁end|>
return len(s.split())
<|file_name|>atari_dqn.py<|end_file_name|><|fim▁begin|>import argparse import datetime import pathlib import numpy as np import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from mushroom_rl.algorithms.value import AveragedDQN, CategoricalDQN, DQN,\ DoubleDQN, MaxminDQN, ...
arg_alg.add_argument("--max-steps", type=int, default=50000000, help='Total number of collected samples.') arg_alg.add_argument("--final-exploration-frame", type=int, default=1000000, help='Number of collected samples until the exploration'
<|file_name|>headers.py<|end_file_name|><|fim▁begin|>import collections import itertools from marnadi.utils import cached_property, CachedDescriptor class Header(collections.Mapping): __slots__ = 'value', 'params' def __init__(self, *value, **params): assert len(value) == 1 self.value = val...
<|file_name|>solution.py<|end_file_name|><|fim▁begin|>class Solution(object): def findPaths(self, m, n, N, i, j): """ :type m: int :type n: int :type N: int :type i: int :type j: int :rtype: int """<|fim▁hole|> for i in xrange(N): ne...
MOD = 1000000007 paths = 0 cur = {(i, j): 1}
<|file_name|>container_linux.go<|end_file_name|><|fim▁begin|>// +build linux package libcontainer import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "os" "os/exec" "path/filepath" "reflect" "strings" "sync" "syscall" "github.com/Sirupsen/logrus" "github.com/golang/protobuf/proto" "github.com/open...
r, err := newRestoredProcess(int(pid), fds) if err != nil {
<|file_name|>twitter.py<|end_file_name|><|fim▁begin|>from twython import Twython from config import APP_KEY, APP_SECRET def obtain_auth_url(): """Used to app to tweet to my account NOT CALLED ANYWHERE""" twitter = Twython(APP_KEY, APP_SECRET)<|fim▁hole|> print "\n\n\nGo to the following URL to authoriz...
auth = twitter.get_authentication_tokens() oauth_token = auth['oauth_token'] oauth_token_secret = auth['oauth_token_secret']
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import * as debug from 'debug'; import Resolver from '../../resolver'; import { IRemoteUser } from '../../../../models/user'; import acceptFollow from './follow'; import { IAccept, IFollow } from '../../type'; const log = debug('misskey:activitypub'); export default...
<|file_name|>test_commonutils.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function, absolute_import import numpy import pandas from numpy.random.mtrand import RandomState from sklearn.metrics.pairwise import pairwise_distances from hep_ml import commonutils from hep_ml.commonutils import wei...
weights = numpy.array(random.exponential(size=100))
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 ...
def shell_expand_path(path): ''' shell_expand_path is needed as os.path.expanduser does not work when path is None, which is the default for ANSIBLE_PRIVATE_KEY_FILE ''' if path:
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .boolalg import (ITE, And, Equivalent, Implies, Nand, Nor, Not, Or, POSform, SOPform, Xor, bool_map, false, simplify_logic, to_cnf, to_dnf, to_nnf, true) from .inference import satisfiable __all__ = ('IT...
""" Package for handling logical expressions. """
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup setup(name='awstools', version='0.1', description='Simple API for AWS IoT', url='https://github.com/h314to/awstools', author='Filipe Agapito', author_email='filipe.agapito@gmail.com', license='MIT',<|fim...
packages=['awstools'],
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render from django.http import HttpResponse,JsonResponse from django.views import generic from django.views.generic.edit import FormView, CreateView from django.core.urlresolvers import reverse_lazy from django.core.mail import send_mail f...
class LoginRequiredMixin(object): @classmethod
<|file_name|>test_template_use.py<|end_file_name|><|fim▁begin|>from . import *<|fim▁hole|> def test_resized_img_src(self): @self.app.route('/resized_img_src') def use(): return render_template_string(''' <img src="{{ resized_img_src('cc.png') }}" /> '''.strip(...
class TestTemplateUse(TestCase):
<|file_name|>fix_encoding.py<|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. """Collection of functions and classes to fix various encoding problems on multiple platforms w...
GetStdHandle = WINFUNCTYPE(HANDLE, DWORD)(('GetStdHandle', windll.kernel32)) real_output_handle = GetStdHandle(DWORD(output_handle)) if win_handle_is_a_console(real_output_handle):
<|file_name|>constant_condition.rs<|end_file_name|><|fim▁begin|>use eew::EEW; use condition::Condition; pub const TRUE_CONDITION: ConstantCondition = ConstantCondition(true); pub const FALSE_CONDITION: ConstantCondition = ConstantCondition(false); pub struct ConstantCondition(pub bool); impl Condition for ConstantCo...
}
<|file_name|>timer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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...
from calvin.runtime.south.plugins.async import async from calvin.utilities.calvinlogger import get_logger
<|file_name|>while-prelude-drop.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....
use std::string::String; #[deriving(PartialEq)]
<|file_name|>sudoku.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import (unicode_literals, absolute_import, print_function, division) from copy import deepcopy from itertools import combinations class Cell: def __init__(self): self.value = 0 self.row = set() se...
return self.value > 0 @property
<|file_name|>subdivider.cpp<|end_file_name|><|fim▁begin|>// // Copyright 2013 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in // compliance with the Apache License and the following modification to it: // ...
void shim::Subdivider::getRefinedQuads(Buffer* refinedQuads)
<|file_name|>packetio.go<|end_file_name|><|fim▁begin|>package mysql import ( "bufio" "io" . "github.com/wangjild/go-mysql-proxy/log" "net" ) type PacketIO struct { reader io.Reader writer io.Writer Sequence uint8 } func NewPacketIO(conn net.Conn) *PacketIO { p := new(PacketIO) p.reader = bufio.NewReader(c...
data[3] = p.Sequence
<|file_name|>step_delete_images_snapshots.go<|end_file_name|><|fim▁begin|>package ecs import ( "context" "fmt" "log" "github.com/denverdino/aliyungo/common" "github.com/denverdino/aliyungo/ecs" "github.com/hashicorp/packer/helper/multistep" "github.com/hashicorp/packer/packer" ) type stepDeleteAlicloudImageSn...
client := state.Get("client").(*ecs.Client) ui := state.Get("ui").(packer.Ui)
<|file_name|>calls.rs<|end_file_name|><|fim▁begin|>use crate::types::{Error, Params, Value}; use crate::BoxFuture; use std::fmt; use std::future::Future; use std::sync::Arc; /// Metadata trait pub trait Metadata: Clone + Send + 'static {} impl Metadata for () {} impl<T: Metadata> Metadata for Option<T> {} impl<T: Meta...
self(params) } }
<|file_name|>15.2.3.6-3-134.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.6-3-134 description: > Object.defineProperty - 'value' property in 'Attributes' is own accessor ...
var child = new ConstructFun(); Object.defineProperty(child, "value", { get: function () { return "ownAccessorProperty";
<|file_name|>commstatemachine.js<|end_file_name|><|fim▁begin|>/********************************************************************* * * Software License Agreement (BSD License) * * Copyright (c) 2010, Robert Bosch LLC. * All rights reserved. * * Redistribution and use in source and binary forms, with or with...
/** * Make state machine transition to a new state *
<|file_name|>borrowck-wg-borrow-mut-to-imm-3.rs<|end_file_name|><|fim▁begin|>struct Wizard { spells: ~[&'static str] } pub impl Wizard { fn cast(&mut self) { for self.spells.each |&spell| {<|fim▁hole|> } } pub fn main() { let mut harry = Wizard { spells: ~[ "expelliarmus", "expecto patr...
io::println(spell); }
<|file_name|>test_pb.py<|end_file_name|><|fim▁begin|># -*- Mode: Python; test-case-name: flumotion.test.test_pb -*- # vi:si:et:sw=4:sts=4:ts=4 # # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). # All rights reserved. # This file may be distributed and/or modif...
if __name__ == '__main__': unittest.main()