prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>AppleMac.java<|end_file_name|><|fim▁begin|>package clearvolume.utils; import java.awt.Image; import java.awt.Window; import java.lang.reflect.Method; public class AppleMac { // final static com.apple.eawt.Application cApplication = // com.apple.eawt.Application.getApplication(); static Class<?> cClas...
if (!isMac()) return false;
<|file_name|>team.service.ts<|end_file_name|><|fim▁begin|>import {Injectable} from "@angular/core"; import {HttpClient} from './httpClient.service'; import {NotificationsService} from './notifications.service'; import {User} from '../models/user.model'; import {Team} from '../models/team.model'; import {Observable...
deleteTeam(team_id: string){ return this.httpClient.post('/api/v1/teams/delete', {team_id: team_id}).map(res=>res.json()).map(res => {
<|file_name|>genconfig.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding=utf8 """Utility script for generating sqlstore configs sample settings file: ################# starts ##################### default_params = { 'roles': ['m', 's', 'b', 'g', 'h'], 'rw_user': { 'user': 'rw_user', ...
<|file_name|>manager.py<|end_file_name|><|fim▁begin|>""" Custom manager for HelpEntry objects. """ from django.db import models from src.utils import logger, utils __all__ = ("HelpEntryManager",) class HelpEntryManager(models.Manager): """ This HelpEntryManager implements methods for searching and manipul...
return topics
<|file_name|>mail.py<|end_file_name|><|fim▁begin|>from email.mime.text import MIMEText from smtplib import SMTP class Gmail(object): """Send an email with Google Mail Can easily be used with other providers by editing the server and port in send() Args: credentials (tuple): (username, passwo...
message['From'] = self.user
<|file_name|>parse.go<|end_file_name|><|fim▁begin|>package postgresql import ( "bytes" "fmt" "github.com/spf13/viper" "io" "strconv" ) func readInt32(c *PGConn) uint32 { var ret uint32 = uint32(c.buf[c.idx+0]) ret <<= 8 ret += uint32(c.buf[c.idx+1]) ret <<= 8 ret += uint32(c.buf[c.idx+2]) ret <<= 8 ret +=...
ret <<= 8 ret += uint16(c.buf[c.idx+1])
<|file_name|>russian.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="ru"> <context> <name>EMBLGenbankAbstractDocument</name> <message> <location filename="../src/EMBLGenbankAbstractDocument.cpp" line="56"/> <source>The file contain...
<message>
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os import setuptools module_path = os.path.join(os.path.dirname(__file__), 'url_for_s3.py') version_line = [line for line in open(module_path) if line.startswith('__version__')][0] __version__ = version_line.split('__version__ = ')[-1][1:][:-2...
url="https://github.com/Jaza/url-for-s3", author="Jeremy Epstein",
<|file_name|>helper.rs<|end_file_name|><|fim▁begin|>use chrono::FixedOffset; use std::iter::Extend; use super::error::{ParseErrorKind,ParseError,ParseResult}; fn get_text(str: &Vec<char>,begin: usize, end: usize) -> String { let slice = &str[begin..end]; let mut result = String::new(); result.extend(slice.i...
<|file_name|>ping.rs<|end_file_name|><|fim▁begin|>// This file is generated by rust-protobuf 2.6.2. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy)] #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(box_pointers)] #![allow(dead_code)] #![allow(m...
pub unknown_fields: ::protobuf::UnknownFields, pub cached_size: ::protobuf::CachedSize, }
<|file_name|>logger-service.js<|end_file_name|><|fim▁begin|>import { Response } from 'aurelia-fetch-client'; import toastr from 'toastr'; /** * Defines the logger service that provides logging/messaging capabilities. */ export class LoggerService { /** * @function {logApiError} * @param {Fault} fault - The http fa...
if (fault.message) message = fault.message; fault.json()
<|file_name|>cache_test.py<|end_file_name|><|fim▁begin|>import unittest from magnumfe import * set_log_active(False) class CacheTest(unittest.TestCase): def test_initial_update(self): mesh = UnitCubeMesh(1,1,1) state = State(mesh) cache = Cache() self.assertTrue(cache.requires_update(state)) de...
state.t = 1.0
<|file_name|>items.py<|end_file_name|><|fim▁begin|>import json from bson.errors import InvalidId from flask import Blueprint, jsonify, request, g item_api = Blueprint('itemApi', __name__) def get_item_as_object(item) -> dict: return_item = { "_id": str(item['_id']), "name": item['name'], ...
# create items list items_list = [] # create response
<|file_name|>actions-builder.js<|end_file_name|><|fim▁begin|>'use strict'; const _ = require('lodash'); const Promise = require('bluebird'); const fs = require('fs-extra'); const wd = require('wd'); const StateError = require('../errors/state-error'); const find = require('./find-func').find; module.exports = class ...
_pushAction(method, action) { let stackHolder = {};
<|file_name|>a_star.cc<|end_file_name|><|fim▁begin|>#include <util/logger.h> #include "a_star.h" namespace math { a_star::a_star(point const &start, point const &goal, scorer_t const &scorer): start_(start), goal_(goal), scorer_(scorer), failed_(false) { } a_star::~a_star() { } void a_star::calculate_path() { ...
void a_star::start()
<|file_name|>lengths_top_k_ops_test.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals<|fim▁hole|> from caffe2.python import core from hypothesis import given import caffe2.python.hypothesis...
<|file_name|>controller.js<|end_file_name|><|fim▁begin|>var model = require(__dirname + '/../models/model.js'); var controller = function() {}; //create new user function create(id) {<|fim▁hole|> apiCallsMade: 0 }); return newUser; } function getUser(id, cb) { model.findOne({ //find by unique id id: id ...
var newUser = new model({ id: id, currentCowntt: 0,
<|file_name|>Sheets.py<|end_file_name|><|fim▁begin|>from JumpScale import j from Sheet import * class Sheets(j.tools.code.classGetBase()): def __init__(self): self.__jslocation__ = "j.tools.worksheets" self.sheets = {} self.sheetsByCategory = {} self.sheetNames = [] def new(s...
total = total * value return total
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 import requests import time import json """ ansible 运行结果回调 """ class CallbackModule(object): def v2_runner_item_on_ok(self, *args, **kwargs): # time.sleep(10) # print args for i in dir(args[0]): ...
# # print args
<|file_name|>settings.component.spec.ts<|end_file_name|><|fim▁begin|>/* tslint:disable:no-unused-variable */ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser';<|fim▁hole|> import { SettingsComponent } from './settings.component'; describe('HomeComp...
import { DebugElement } from '@angular/core';
<|file_name|>CaveLevel.rube-scriptLog-150418-162907.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//Started script log at 04/18/15 16:29:07<|fim▁end|>
<|file_name|>WsPlugin.js<|end_file_name|><|fim▁begin|>const Assigner = require('assign.js') let assigner = new Assigner() const fp = require('fastify-plugin') const WebSocket = require('ws') const url = require('url') module.exports = { addWSServer: function (paths, wsOptions = {}) { return fp((fastify, opts, nex...
<|file_name|>TestVideoSubscriber.ts<|end_file_name|><|fim▁begin|>import {EventSubscriber} from "../../../../../../src/decorator/listeners/EventSubscriber"; import {EntitySubscriberInterface} from "../../../../../../src/subscriber/EntitySubscriberInterface"; import {InsertEvent} from "../../../../../../src/subscriber/ev...
* Called after entity insertion. */ beforeInsert(event: InsertEvent<any>) { console.log(`BEFORE ENTITY INSERTED: `, event.entity);
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os import glob<|fim▁hole|> """ Post install script for pyCUDA applications to warm the cubin cache """ import pycuda.autoinit from pycuda.compiler import SourceModule CACHE_DIR = os.path.join(install_path, 'cache') if not os.path.exist...
from setuptools import setup from setuptools.command.install import install def post_install(install_path):
<|file_name|>050_new-server-api-routes.spec.ts<|end_file_name|><|fim▁begin|>import * as chai from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import { join } from 'path'; import * as temp from 'temp'; import { Headers } from '@angular/http'; import { execSilent, exec, abstruse, killAllProcesses } from '...
<|file_name|>stats.rs<|end_file_name|><|fim▁begin|>use std::default::Default; use std::ops::{Add}; /// Stats specifies static bonuses for an entity. Stats values can be added /// together to build composites. The Default value for Stats must be an /// algebraic zero element, adding it to any Stats value must leave tha...
// ranged weapon should *not* have the ranges added together. // On the other hand a "sniper scope" trinket could be a +2 range // type dealie. ranged_range: self.ranged_range + other.ranged_range,
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version...
pub mod tendermint; pub mod null_engine; pub use self::account::Account;
<|file_name|>test_dispatch.py<|end_file_name|><|fim▁begin|>import pytest import urllib.error from urlpathlib import UrlPath def test_scheme(): # does not raise NotImplementedError<|fim▁hole|> with pytest.raises(NotImplementedError): UrlPath('http:///tmp/test').touch() def test_scheme_not_listed(): ...
UrlPath('/dev/null').touch() def test_scheme_not_supported():
<|file_name|>35.py<|end_file_name|><|fim▁begin|>from math import sqrt def is_prime(x): for i in xrange(2, int(sqrt(x) + 1)): if x % i == 0: return False return True def rotate(v): res = []<|fim▁hole|> u = str(v) while True: u = u[1:] + u[0] w = int(u) ...
<|file_name|>gen-destructors-neg.rs<|end_file_name|><|fim▁begin|>#![allow( dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals )] <|fim▁hole|>pub struct Foo { pub bar: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_Foo() { assert_eq!( ::std::mem::size_of::<Fo...
#[repr(C)] #[derive(Debug, Default)]
<|file_name|>struct.js<|end_file_name|><|fim▁begin|>Nectar.createStruct("test", "a:string", "b:int", "c:double");<|fim▁hole|>{ var testStruct = Nectar.initStruct("test"); testStruct.NStruct("test").a = "Hello Struct!"; console.log(testStruct.NStruct("test").a); return testStruct } var retStruct = Test(); retStruct...
function Test()
<|file_name|>fileNaming.py<|end_file_name|><|fim▁begin|>""" You are given an array of desired filenames in the order of their creation. Since two files cannot have equal names, the one which comes later will have an addition to its name in a form of (k), where k is the smallest positive integer such that the obtained n...
Example
<|file_name|>update-role.6.x.py<|end_file_name|><|fim▁begin|># Download the Python helper library from twilio.com/docs/python/install import os from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account # To set up environmental variables, see http://twil.io/secure account = os.envir...
print(role.friendly_name)
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # from django.contrib import admin # from tribus.web.cloud.models import * # class PaqueteAlin(admin.TabularInline):<|fim▁hole|># class AdminMantenedor(admin.ModelAdmin): # fieldsets = ( # ('Nombre del mantenedor', { # 'clas...
# model = Paquete # extra = 0 #
<|file_name|>scribe_test.go<|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<|fim▁hole|>// Contributor: Aaron Meihm ameihm@mozilla.com [:alm] package scribe /* import "github.com/mozilla/mig/module...
// file, You can obtain one at http://mozilla.org/MPL/2.0/. //
<|file_name|>UTM2Geo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 17/2/2015 @author: Antonio Hermosilla Rodrigo. @contact: anherro285@gmail.com @organization: Antonio Hermosilla Rodrigo. @copyright: (C) 2015 by Antonio Hermosilla Rodrigo @version: 1.0.0 ''' import sys f...
self.__msgBoxErr.setText("Debe introducir un valor para la Y UTM.") self.__msgBoxErr.exec_() return try:
<|file_name|>sentry_activity.py<|end_file_name|><|fim▁begin|>""" sentry.templatetags.sentry_activity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging f...
try:
<|file_name|>okcash_sr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="sr" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Okcash</source> <translation>О Okcash-u</transla...
<translation type="unfinished"/>
<|file_name|>make-cert.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright 2015 Rackspace, 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/licens...
'-key', SERVER_KEY_PATH,
<|file_name|>pattern_constraints.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- # # electrode: numeric tools for Paul traps # # Copyright (C) 2011-2012 Robert Jordens <jordens@phys.ethz.ch> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General P...
The value is forced exactly (not proportional) to `offset`. """ def __init__(self, value=None, min=None, max=None, offset=None): self.value = value
<|file_name|>speech_to_text.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 th...
used.
<|file_name|>productiontiles.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { NgaModule } from '../../theme/nga.module'; import { Ng2SmartTableModule } from 'ng2-smart-table';<|fi...
import { ProductionTiles } from './productiontiles.component' import { ProductionTileDetails } from './productiontiledetails/productiontiledetails.component' import { routing } from './productiontiles.routing'
<|file_name|>lib.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/. */ #![feature(custom_derive)] #![feature(plugin)] #![feature(step_tr...
<|file_name|>delete_permission_response.rs<|end_file_name|><|fim▁begin|>use crate::from_headers::*;<|fim▁hole|>#[derive(Debug, Clone, PartialEq)] pub struct DeletePermissionResponse { pub charge: f64, pub activity_id: uuid::Uuid, pub session_token: String, pub content_path: String, pub alt_content_p...
use azure_sdk_core::errors::AzureError; use azure_sdk_core::session_token_from_headers; use http::HeaderMap;
<|file_name|>alg_misc.rs<|end_file_name|><|fim▁begin|>use crate::seeded_rng; use euclid::{point2, rect, Point2D, Rect}; use num::{Float, One, Zero}; use rand::distributions::{Distribution, Standard, Uniform}; use rand::Rng; use std::error::Error; use std::fmt; use std::hash::Hash; use std::ops::{Add, AddAssign, Div, Mu...
<|file_name|>generate-ios-source-and-headers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import subprocess import re import os import errno import collections import sys class Platform(object): pass sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)') def sdkinfo(sdkname): ret = {} for line in subpr...
class simulator_platform(Platform):
<|file_name|>dellAnalyzer.ts<|end_file_name|><|fim▁begin|>import fs from 'fs'; import cheerio from 'cheerio'; import { Analyzer } from './crowller'; interface Course { title: string; count: number; } interface CourseResult { time: number; data: Course[]; } interface Content { [propName: number]: Course[]; ...
fileContent[courseInfo.time] = courseInfo.data; return fileContent; }
<|file_name|>clone.rs<|end_file_name|><|fim▁begin|>#![feature(core)] extern crate core; #[cfg(test)] mod tests { use core::clone::Clone; // pub trait FixedSizeArray<T> { // /// Converts the array to immutable slice // fn as_slice(&self) -> &[T]; // /// Converts the array to mutable sli...
<|file_name|>webrender_helpers.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/. */ // TODO(gw): This contains helper traits and implem...
mix_blend_mode::T::saturation => webrender_traits::MixBlendMode::Saturation, mix_blend_mode::T::color => webrender_traits::MixBlendMode::Color, mix_blend_mode::T::luminosity => webrender_traits::MixBlendMode::Luminosity,
<|file_name|>test_raster.py<|end_file_name|><|fim▁begin|># coding=utf-8 """**Tests for safe raster layer class** contains tests for QGIS specific methods. See test_io.py also """ __author__ = 'Dmitry Kolesov <kolesov.dm@gmail.com>' __revision__ = '$Format:%H$' __date__ = '28/12/2013' __license__ = "GPL" __copy...
'Expected %s extent, got %s' % (qgis_extent, layer_exent))
<|file_name|>watch-mem-usage.py<|end_file_name|><|fim▁begin|># collect data about max memory usage of processes matching some patterns<|fim▁hole|>#cmdPattern='.*cc1plus.*src/([a-zA-Z0-9_-]\.cpp).*' cmdPattern=r'.*cc1plus.* (\S+/)?([^/ ]+\.cpp).*' # group in the pattern which identifies the process (e.g. source code fi...
import psutil, re, operator, time, sys sampleTime=.5 # seconds # matching lines will be taken in account
<|file_name|>VueCarte.java<|end_file_name|><|fim▁begin|>package tinymonkeys.vue; import java.awt.Color; import java.awt.Graphics; import javax.swing.JPanel; /** * Classe du panneau de la carte. * * @version 1.0 * @author Camille Constant * */ public class VueCarte extends JPanel { /** * UID auto-généré. ...
return this.xGrille; }
<|file_name|>productNamesImport.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or ...
<|file_name|>tcpsock.go<|end_file_name|><|fim▁begin|>package main import ( "bytes" "errors" "fmt" "io" "math" "math/rand" "net" "strconv" "sync" "time" ) const ( SERVER_NETWORK = "tcp" SERVER_ADDRESS = "127.0.0.1:8085" DELIMITER = '\t' ) var wg sync.WaitGroup var logSn = 1 ...
f64Resp := cbrt(i32Req) respMsg := fmt.Sprintf("The cube root of %d is %f.", i32Req, f64Resp) n, err := write(conn, respMsg)
<|file_name|>shift-various-types.rs<|end_file_name|><|fim▁begin|>// run-pass // Test that we can do shifts by any integral type. struct Panolpy { i8: i8, i16: i16, i32: i32, i64: i64, isize: isize, u8: u8, u16: u16, u32: u32, u64: u64, usize: usize, } <|fim▁hole|>fn foo(p: &Pa...
<|file_name|>cuon-simple-server-install.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.7 # cuon_server install import os, sys, platform import subprocess, shlex, shutil import commands import locale import pwd, grp from gi.repository import Gtk<|fim▁hole|> class cssi(): def __init__(self, user=None): ...
import ConfigParser
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for th...
info = (self.setParameterString, self.getParameterString)
<|file_name|>last_will.rs<|end_file_name|><|fim▁begin|>use qos::QoS; #[derive(Debug, Clone, PartialEq)] pub struct LastWill { pub topic: String, pub message: String, pub qos: QoS, pub retain: bool<|fim▁hole|><|fim▁end|>
}
<|file_name|>urls_defaultblog.py<|end_file_name|><|fim▁begin|>""" URL routing for blogs, entries and feeds<|fim▁hole|>from feeds import LatestEntriesByBlog, LatestEntries #, EntryComments from models import Blog from views import generic_blog_entry_view, blog_detail from viewpoint.settings import USE_CATEGORIES, DEFAUL...
""" from django.conf.urls.defaults import patterns, url from django.conf import settings
<|file_name|>cell.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/licen...
//! struct RcBox<T> { //! value: T,
<|file_name|>find_key_relation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from gensim.models import word2vec from gensim import models import jieba import codecs import io from collections import Counter import operator import numpy f = codecs.open("target_article.txt",'r','utf8') content = f.readlines(...
acc_data = dict() map_words = []
<|file_name|>player.py<|end_file_name|><|fim▁begin|># Copyright Vinicius Castanheira (vncastanheira@gmail.com) - 2012 # This program is a part of the Noir Game. # This program is under the Gnu LGPL. from pygame import * from pyganim import * from entity import Entity from bullet import Bullet class Player(Entity): ...
<|file_name|>mldata.py<|end_file_name|><|fim▁begin|>"""Automatically download MLdata datasets.""" # Copyright (c) 2011 Pietro Berkes # License: Simplified BSD import os from os.path import join, exists import re import numpy as np import scipy as sp from scipy import io from shutil import copyfileobj import urllib2 ...
else: for name in col_names:
<|file_name|>solution.py<|end_file_name|><|fim▁begin|>import numpy<|fim▁hole|> arr = numpy.array(list(map(float, input().split()))) x = float(input()) value = numpy.polyval(arr, x) print(value)<|fim▁end|>
<|file_name|>Generator.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2011,2012,2013,2014 Samuel Audet * * This file is part of JavaCPP. * * JavaCPP 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,...
return out && constant ? null : adapterInfo; }
<|file_name|>simple.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/licenses...
let me = &mut *self as *mut SimpleTask; let cur_dupe = &*cur_task as *Task;
<|file_name|>test_io_ilg.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from polyglotdb.io import inspect_ilg from polyglotdb.io.helper import guess_type from polyglotdb.exceptions import DelimiterError, ILGWordMismatchError from polyglotdb import CorpusContext def test_inspect_ilg(ilg_test_dir): basic_path = os...
import pytest import os import sys
<|file_name|>vocabulary.cc<|end_file_name|><|fim▁begin|>#include "vocabulary.h" namespace extractor { Vocabulary::~Vocabulary() {} int Vocabulary::GetTerminalIndex(const string& word) { int word_id = -1; #pragma omp critical (vocabulary) { auto it = dictionary.find(word); if (it != dictionary.end()) { ...
<|file_name|>app.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #-*- coding: utf-8 -*- from __future__ import unicode_literals import sqlite3 from flask import Flask, render_template, g, current_app, request from flask.ext.paginate import Pagination app = Flask(__name__)<|fim▁hole|>def before_request(): g....
app.config.from_pyfile('app.cfg') @app.before_request
<|file_name|>pre_NAMD.py<|end_file_name|><|fim▁begin|># pre_NAMD.py # Creates the files used for NAMD based on the .pdb file dowloaded from PDB bank # # Usage: # python pre_NAMD.py $PDBID # # $PDBID=the 4 characters identification code of the .pdb file # # Input: # $PDBID.pdb: .pdb file downloaded from PDB bank # ...
print("Calculate center coordinates...") cmdline = '\"'+ vmd + '\"' +' -dispdev text -eofexit < '+ tclpath + 'get_center.tcl' + ' ' + '-args' + ' '+ pdbid +'>> '+ logfile os.system(cmdline)
<|file_name|>import_path.go<|end_file_name|><|fim▁begin|>package gosrc import ( "encoding/json" "encoding/xml" "errors" "fmt" "io" "net/http" "os" "regexp" "runtime" "strings" ) // Adapted from github.com/golang/gddo/gosrc. // RuntimeVersion is the version of go stdlib to use. We allow it to be // differen...
<|file_name|>_127WordLadder.java<|end_file_name|><|fim▁begin|>package PracticeLeetCode; <|fim▁hole|>import java.util.Set; public class _127WordLadder { psvm }<|fim▁end|>
import java.util.HashSet; import java.util.LinkedList; import java.util.Queue;
<|file_name|>i18n-inlining.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { BuilderContext } from '@angular-devkit/architect'...
return !hasErrors; }
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from aat.models import RecognizerPreTrainedData class DefaultDetectionForm(forms.Form): title = "Please specify the directory containing your videos" #video = forms.FileField(required=True, widget=forms.ClearableFileInput()) video...
required=True, initial=False) transcription = forms.CharField(widget=forms.HiddenInput(),
<|file_name|>srv0srv.cc<|end_file_name|><|fim▁begin|>/***************************************************************************** Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, 2009 Google Inc. Copyright (c) 2009, Percona Inc. Portions of this file contain modificat...
/* make sure that there is enough reusable space in the redo
<|file_name|>reminders.py<|end_file_name|><|fim▁begin|>import time import json import os # Returns the list of reminders as dict. # @return reminders - Python Dictionary def get_reminders(): file = "{}/reminders.json".format(os.path.dirname(os.path.realpath(__file__))) with open(file, "r") as data_file: ...
reminders = get_reminders() if reminders.get(nick): print(reminders.get(nick))
<|file_name|>_agg_raster.cpp<|end_file_name|><|fim▁begin|>/* # (C) British Crown Copyright 2015 - 2020, Met Office # # This file is part of agg-regrid. # # agg-regrid is free software: you can redistribute it and/or modify it under<|fim▁hole|># (at your option) any later version. # # agg-regrid is distributed in the ho...
# the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or
<|file_name|>tekcoin_nb.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="nb" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About tekcoin</sourc...
<location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Rediger listen over adresser og deres merkelapper</translation> </message>
<|file_name|>TestDataFormatterGlobals.py<|end_file_name|><|fim▁begin|>""" Test lldb data formatter subsystem. """ from __future__ import print_function import os import time import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil class Gl...
# Execute the cleanup function during test case tear down. self.addTearDownHook(cleanup)
<|file_name|>test_image_metadata.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation # 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 # # ...
@mock.patch(CHK_QUOTA_STR)
<|file_name|>logical_geometry.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/. */ //! Geometry in flow-relative space. use euclid::{P...
-> LogicalRect<T> { start.debug_writing_mode.check(mode);
<|file_name|>animation.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap; use ggez::Context; use serde_derive::{Deserialize, Serialize}; use warmy; use loadable_macro_derive::{LoadableRon, LoadableYaml}; #[derive(Default, Debug, Clone, Serialize, Deserialize)] pub struct SpriteData { pub sprites: Has...
<|file_name|>nested-matchs.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...
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed
<|file_name|>AuthorizationServerConfiguration.java<|end_file_name|><|fim▁begin|>/* * Copyright 2016 Pivotal Software, 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 * * htt...
.authenticationManager(authenticationManager); }
<|file_name|>case.rs<|end_file_name|><|fim▁begin|>use super::super::ArgumentSplitter; use std::fmt::{self, Display, Formatter}; #[derive(Debug, PartialEq)] pub(crate) enum CaseError<'a> { NoBindVariable, NoConditional, ExtraBind(&'a str), ExtraVar(&'a str), } impl<'a> Display for CaseError<'a> { f...
Ok((Some("test"), Some("test"), Some("exists".into()))), parse_case("test @ test if exists") );
<|file_name|>webpack.example.config.js<|end_file_name|><|fim▁begin|>// this will build and serve the examples var path = require('path'); var webpack = require('webpack'); module.exports = { entry: { app: './examples/js/app.js', vendors: ['webpack-dev-server/client?http://localhost:3004', 'webpack/hot/only-...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ zine.forms ~~~~~~~~~~ The form classes the zine core uses. :copyright: (c) 2010 by the Zine Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from copy import copy from datetime import...
return widget class EditCategoryForm(_CategoryBoundForm):
<|file_name|>iter.go<|end_file_name|><|fim▁begin|>package pmgo <|fim▁hole|>import mgo "gopkg.in/mgo.v2" type IterManager interface { All(result interface{}) error Close() error Done() bool Err() error For(result interface{}, f func() error) (err error) Next(result interface{}) bool Timeout() bool } type Iter s...
<|file_name|>VirtualizedList-test.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015-present, Facebook, Inc.<|fim▁hole|> * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the P...
* All rights reserved. *
<|file_name|>ligerForm.js<|end_file_name|><|fim▁begin|>/** * jQuery ligerUI 1.1.9 * * http://ligerui.com * * Author daomi 2012 [ gd_star@163.com ] * */ (function ($) { $.fn.ligerForm = function () { return $.ligerui.run.call(this, "ligerForm", arguments); }; $.ligerDefaults = $.ligerDefau...
<|file_name|>splashscreen.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2013 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "splashscreen.h" #include "clientversion.h" #include "util...
QString titleText = QString(QApplication::applicationName()).replace(QString("-testnet"), QString(""), Qt::CaseSensitive); // cut of testnet, place it as single object further down QString versionText = QString("Version %1 ").arg(QString::fromStdString(FormatFullVersion())); QString copyrightText1...
<|file_name|>azure_cleanup.py<|end_file_name|><|fim▁begin|>import argparse import sys import traceback as tb from datetime import datetime from cfme.utils.path import log_path from cfme.utils.providers import list_provider_keys, get_mgmt def parse_cmd_line(): parser = argparse.ArgumentParser(argument_default=Non...
format(pip_template)) report.write("\n".join(str(k) for k in pip_list))
<|file_name|>csslint-node.js<|end_file_name|><|fim▁begin|>/*! CSSLint v0.10.0 Copyright (c) 2016 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. 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 ...
}); }
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""urlconf for the base application""" from django.conf.urls import url, patterns urlpatterns = patterns('base.views',<|fim▁hole|>)<|fim▁end|>
url(r'^$', 'home', name='home'),
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Normalize whitespace and Unicode forms in Python 3. Functions: normalize_space() -- collapse whitespace and trim normalize_unicode() -- return specified Unicode normal form """ __author__ = 'Tom Elliott' __copyright__ = 'Copyright ©️ 2017 New York University' _...
logger.debug('vi: {}'.format(repr(vi)))
<|file_name|>basic_events.py<|end_file_name|><|fim▁begin|>""" Small event module ======================= """ import numpy as np import logging logger = logging.getLogger(__name__) from ...utils.decorators import face_lookup from ...geometry.sheet_geometry import SheetGeometry from ...topology.sheet_topology import...
merge_vertices, detach_vertices, increase, decrease,
<|file_name|>domain.rs<|end_file_name|><|fim▁begin|>use std::collections::HashSet; use crate::validation::common::ValidationError; use crate::structure::domain::DomainDocument; #[derive(Debug)] pub struct Validation {} impl Validation { pub fn validate(doc: &DomainDocument) -> Vec<ValidationError> { let ...
message: format!("Domain : Entity '{entity}' contains a reference to non-existent entity '{reference}'", entity=entity.name, reference=&reference.name), paths: vec![
<|file_name|>day_4.rs<|end_file_name|><|fim▁begin|>use std::borrow::Cow; use std::str::Chars; use std::iter::Peekable;<|fim▁hole|> let mut chars = (*src).chars().peekable(); parse_expression(chars.by_ref()) } fn parse_expression(chars: &mut Peekable<Chars>) -> f64 { let mut result = parse_term(chars.by_ref(...
pub fn evaluate<'s>(src: Cow<'s, str>) -> f64 {
<|file_name|>query.py<|end_file_name|><|fim▁begin|>from textx.exceptions import TextXSemanticError def query_processor(query): if not query.condition is None: query.condition.conditionName = adapter_for_query(query) for query in query.parent.queries: if (not hasattr(query, 'property')) and...
self.rangeFrom = rangeFrom self.rangeTo = rangeTo
<|file_name|>issue-11881.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/lic...