prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>subsampling_step.py<|end_file_name|><|fim▁begin|># Copyright 2017 reinforce.io. 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.org...
num_samples = tf.maximum(x=num_samples, y=1)
<|file_name|>test_support.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. 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 * as fs from 'fs'; import * as os from 'os'; import...
} function shouldExist(fileName: string) {
<|file_name|>zpm.py<|end_file_name|><|fim▁begin|># Copyright 2014 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/licenses/LICENSE-2.0 # # ...
"""
<|file_name|>schema.py<|end_file_name|><|fim▁begin|># encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http:# mozilla.org/MPL/2.0/. # from __future__ import absolute_import, divi...
<|file_name|>dmltestgenerated_easyjson.go<|end_file_name|><|fim▁begin|>// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT. package dmltestgenerated import ( json "encoding/json" easyjson "github.com/mailru/easyjson" jlexer "github.com/mailru/easyjson/jlexer" jwriter "github.com/mailru/easyjson...
if in.ColVarchar1 != "" { const prefix string = ",\"col_varchar_1\":" if first { first = false
<|file_name|>custom_entities.rs<|end_file_name|><|fim▁begin|>//! This example demonstrate how custom entities can be extracted from the DOCTYPE!, //! and later use to decode text and attribute values. //!<|fim▁hole|>//! * it only handles internal entities; //! * the regex in this example is simple but brittle; //! * it...
//! NB: this example is deliberately kept simple: //! * it assumes that the XML file is UTF-8 encoded (custom_entities must only contain UTF-8 data)
<|file_name|>foreach.tsx<|end_file_name|><|fim▁begin|>/* * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.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 General Public License as published by * the Free Software Found...
<p className="content"> <a help-topic="create">:help CREATE</a> <a help-topic="delete">:help DELETE</a>
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># ETConf -- web-based user-friendly computer hardware configurator # Copyright (C) 2010-2011 ETegro Technologies, PLC <http://etegro.com/><|fim▁hole|># it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either ver...
# Sergey Matveev <sergey.matveev@etegro.com> # # This program is free software: you can redistribute it and/or modify
<|file_name|>passes.rs<|end_file_name|><|fim▁begin|>use crate::context::{EarlyContext, LateContext}; use rustc_ast as ast; use rustc_data_structures::sync; use rustc_hir as hir; use rustc_session::lint::builtin::HardwiredLints; use rustc_session::lint::LintPass; use rustc_span::symbol::{Ident, Symbol}; use rustc_span:...
/// as `#[allow(...)]`. Called with *all* the attributes of that node.
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * 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 ...
<|file_name|>reconnect_test.go<|end_file_name|><|fim▁begin|>// Copyright 2013-2019 The NATS 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/LICEN...
<|file_name|>basename.rs<|end_file_name|><|fim▁begin|>#![crate_name = "uu_basename"] /* * This file is part of the uutils coreutils package. * * (c) Jimmy Lu <jimmy.lu.2011@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. *...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- from setuptools import setup, find_packages from codecs import open from os import path import re import ast here = path.abspath(path.dirname(__file__)) _version_re = re.compile(r'__version__\s+=\s+(.*)') with open('rad...
install_requires=['exifread', 'termcolor', 'colorama'],
<|file_name|>so-KE.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. 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 */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gu...
['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], ['Kob', 'Lab', 'Sad', 'Afr', 'Sha', 'Lix', 'Tod', 'Sid', 'Sag', 'Tob', 'KIT', 'LIT'],
<|file_name|>massemailtxt.py<|end_file_name|><|fim▁begin|>import os.path import time from django.core.management.base import BaseCommand from django.conf import settings import mitxmako.middleware as middleware from django.core.mail import send_mass_mail import sys import datetime middleware.MakoMiddleware() def...
(user_file, message_base, logfilename, ratestr) = args
<|file_name|>parsecmudict.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- '''CMU dict file parser Copyright (C) 2010 Yosuke Matsusaka Intelligent Systems Research Institute, National Institute of Advanced Industrial Science and Technology (AIST),<|fim▁hole|>''' class CMUDict...
Japan All rights reserved. Licensed under the Eclipse Public License -v 1.0 (EPL) http://www.opensource.org/licenses/eclipse-1.0.txt
<|file_name|>pipeaddflavor_string.go<|end_file_name|><|fim▁begin|>// Code generated by "stringer -type=pipeAddFlavor constants.go"; DO NOT EDIT. package bot import "strconv" func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to gene...
var _pipeAddFlavor_index = [...]uint8{0, 11, 20, 31, 41}
<|file_name|>test_node_handler.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 # # ...
ipaddress = '10.20.0.25'
<|file_name|>control_overcloud.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 # Copyright (c) 2016-2021 Dell Inc. or its subsidiaries. # # 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 # #...
main()
<|file_name|>nutrition.ts<|end_file_name|><|fim▁begin|>import { NutritionInterface } from '../interfaces/nutrition';<|fim▁hole|>import { Injectable } from '@angular/core'; @Injectable() export class Nutrition implements NutritionInterface { public article: Array<Article>; public meal: Array<Meal>; constru...
import { Article } from './article'; import { Meal } from './meal';
<|file_name|>container.go<|end_file_name|><|fim▁begin|>package storage // Copyright 2017 Microsoft Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.ap...
// ContainerProperties contains various properties of a container returned from
<|file_name|>algorithm_is_sorted.py<|end_file_name|><|fim▁begin|><|fim▁hole|>>>> import random >>> random.sample(range(10), 5) [7, 6, 3, 5, 1] >>> all(a < b for a, b in zip(_,_[1:])) False >>><|fim▁end|>
<|file_name|>routes-wallet.js<|end_file_name|><|fim▁begin|>import TheWalletView from '@/views/TheWalletView'; import Dashboard from '@/views/layouts-wallet/TheDashboardLayout'; import Send from '@/views/layouts-wallet/TheSendTransactionLayout'; import NftManager from '@/views/layouts-wallet/TheNFTManagerLayout'; import...
meta: {
<|file_name|>Log.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- """ Provide log related functions. You need to Initialize the logger and use the logger to make logs. Example: >>> logger = Initialize() Use logger.level(\*msg) to log like: >>> logger.error("Pickle data writing Failed.") >>> logger...
def info(self, *args, **kwargs):
<|file_name|>Heavy Hitters.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import sys from collections import defaultdict import itertools import operator from operator import itemgetter counters = defaultdict(int) trueCounters = defaultdict(int) <|fim▁hole|>wc = 0 for line in fr: line = line.strip() wo...
fr = open('allworks','r')
<|file_name|>jquery.fileupload-ui.js<|end_file_name|><|fim▁begin|>/* * jQuery File Upload User Interface Plugin * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2010, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ /* jshint n...
'use strict'; if (typeof define === 'function' && define.amd) { // Register as an anonymous AMD module: define([
<|file_name|>ColorDefinitionDlg.py<|end_file_name|><|fim▁begin|># # Copyright 2001 - 2016 Ludek Smid [http://www.ospace.net/] # # This file is part of Outer Space. # # Outer Space is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fr...
)
<|file_name|>test_hdf5_filters.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2021, Freja Nordsiek # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code mus...
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "juisapp.settings") from django.core.management import execute_from_command_line<|fim▁hole|> execute_from_command_line(sys.argv)<|fim▁en...
<|file_name|>newtype_index.rs<|end_file_name|><|fim▁begin|>#![feature(rustc_attrs, rustc_private, step_trait, min_const_unsafe_fn)] #[macro_use] extern crate rustc_data_structures; extern crate rustc_serialize; use rustc_data_structures::indexed_vec::Idx; <|fim▁hole|> use std::mem::size_of; fn main() { assert_eq...
newtype_index!(struct MyIdx { MAX = 0xFFFF_FFFA });
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># requests-oauth 0.4.0<|fim▁hole|># Original author: Miguel Araujo # Forked from https://github.com/maraujop/requests_oauth # Original license: 3-clause BSD from hook import OAuthHook<|fim▁end|>
# Hacked to support RSA-SHA1 encryption for Atlassian OAuth.
<|file_name|>TimedRebeca2ROSExpressionTransformer.java<|end_file_name|><|fim▁begin|>package org.rebecalang.modeltransformer.ros.timedrebeca; import java.util.HashMap; import java.util.Map; import org.rebecalang.compiler.modelcompiler.corerebeca.CoreRebecaTypeSystem; import org.rebecalang.compiler.modelcompiler.corere...
retValue += "("; for(Expression argument: pExpression.getParentSuffixPrimary().getArguments()) {
<|file_name|>TokenMatcherFactory.java<|end_file_name|><|fim▁begin|>/* * SonarQube * Copyright (C) 2009-2022 SonarSource SA * mailto:info AT sonarsource DOT com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by ...
} public static TokenMatcher anyToken() { // TODO Godin: we can return singleton instance
<|file_name|>HTTP_Service_Handler.cpp<|end_file_name|><|fim▁begin|>// $Id: HTTP_Service_Handler.cpp 82739 2008-09-16 12:20:46Z johnnyw $ #define ACE_BUILD_SVC_DLL #include "ace/OS.h" #include "ace/Get_Opt.h" #include "jaws3/Concurrency.h" #include "HTTP_Service_Handler.h" #include "HTTP_States.h" #include "HTTP_Dat...
JAWS_HTTP_Service_Handler::open (void *) { int result = JAWS_Concurrency::instance ()->putq (this);
<|file_name|>darts_game.js<|end_file_name|><|fim▁begin|>var mongoose = require('mongoose'), _ = require('underscore'), Schema = mongoose.Schema, ObjectId = Schema.ObjectId; var Throw = new Schema({ score: { type: Number, required: true, min: 0, max: 25 }, modifier: { type: Number, required: true, m...
<|file_name|>global_spec.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 */<|fim▁hole|>declare var globalThis: any /** TODO #9100 */; { ...
import {global} from '../../src/util/global'; // Not yet available in TypeScript: https://github.com/Microsoft/TypeScript/pull/29332
<|file_name|>dassault.cpp<|end_file_name|><|fim▁begin|>// license:BSD-3-Clause // copyright-holders:Bryan McPhail /*************************************************************************** Desert Assault Video emulation - Bryan McPhail, mish@tendril.co.uk I'm not sure if one of the alpha blending effects is co...
m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); // 2 mixdassaultlayer(bitmap, sprite_bitmap1, cliprect, 0x0400, 0x0600, 0x400, 0xff); // 8 m_deco_tilegen2->tilemap_1_draw(screen, bitmap, cliprect, 0, 16); // 16 mixdassaultlayer(bitmap, sprite_bitmap1, cliprect, 0x0200, 0x0600, 0x400, 0xff);...
<|file_name|>providers.py<|end_file_name|><|fim▁begin|>""" Helper functions related to the creation, listing, filtering and destruction of providers The list_providers function in this module depend on a (by default global) dict of filters. If you are writing tests or fixtures, you want to depend on this function as a...
<|file_name|>prometheus_defaults.go<|end_file_name|><|fim▁begin|>/* Copyright 2020 The Knative 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....
s.Spec.SetDefaults(ctx) }
<|file_name|>timezone.py<|end_file_name|><|fim▁begin|>"""Phone number to time zone mapping functionality >>> import phonenumbers >>> from phonenumbers.timezone import time_zones_for_number >>> ro_number = phonenumbers.parse("+40721234567", "RO") >>> tzlist = time_zones_for_number(ro_number) >>> len(tzlist) 1 >>> str(t...
<|file_name|>DKTSTruncation.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) Mike Espig * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (a...
<|file_name|>kubefed.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is ...
you may not use this file except in compliance with the License. You may obtain a copy of the License at
<|file_name|>filereader.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use dom::bindings::cell::DOMRefCell; use dom::bindings::co...
#[dom_struct] pub struct FileReader { eventtarget: EventTarget,
<|file_name|>lessonEntity.py<|end_file_name|><|fim▁begin|>__author__ = 'Paolo Bellagente' # Documentation for this module. # # More details. ################################## DATABASE ############################################## from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base f...
# lesson's start hour hour = Column(TIME) # lesson's day of the week coded form 0 to 6 where 0 is monday and 6 is sunday. day = Column(INTEGER)
<|file_name|>errors.js<|end_file_name|><|fim▁begin|>/** * Error for services to through when they encounter a problem with the request. * Distinguishes between a bad service request and a general error */ function ServiceError(message) { this.name = "ServiceError"; this.message = (message || ""); } ServiceError.pr...
*/ function NotFoundError(message) {
<|file_name|>leetcode.125.valid-palindrome.py<|end_file_name|><|fim▁begin|>class Solution(object): def isPalindrome(self, s): """ :type s: str :rtype: bool """ if not s: return True start = 0<|fim▁hole|> end = len(s)-1 s = s.lower()...
<|file_name|>Entry.ts<|end_file_name|><|fim▁begin|>export interface Entry { title: string date: string slug: string url?: string tags: string[] type: EntryType } export enum EntryType { CombinedGitHubReleases, GitHubPullRequest, GithubRelease, GithubRepository, StackOverflowEntry, BlogPost,<|fi...
BlogPostPreview, AppPreview, AppRelease,
<|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 in...
SRE_INFO_CHARSET = 4 # pattern starts with character from given set if __name__ == "__main__": def dump(f, d, prefix):
<|file_name|>do_nothing.py<|end_file_name|><|fim▁begin|>from controlscript import * print "This is a simple control script. It just does nothing and exits successfully." print "Start parameter is %s, additional parameters are %s" % (start, arguments) class DoNothing(ControlAction): """ Control script action for exit...
print
<|file_name|>asset_assign_category.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2012-2014 Didotech (<http://www.didotech.com>) # All Rights Reserved # # This program is free software: you can redistribut...
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { Cordova, CordovaInstance, CordovaCheck, Plugin, InstanceProperty, InstanceCheck, checkAvailability, IonicNativePlugin } from '@ionic-native/core'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/observ...
setMyLocationEnabled(enabled: boolean): void { }
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>from unittest import TestCase from paramiko import SSHException from pyinfra.api import Config, State from pyinfra.api.connect import connect_all from pyinfra.api.exceptions import NoGroupError, NoHostError, PyinfraError from ..paramiko_util import PatchSSHTestCa...
class TestInventoryApi(TestCase):
<|file_name|>struct-no-fields-2.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....
<|file_name|>UTF32_Encoding_Converter.cpp<|end_file_name|><|fim▁begin|>// $Id: UTF32_Encoding_Converter.cpp 80826 2008-03-04 14:51:23Z wotte $ // ====================================================================== // // The actual conversion methods are covered by the copyright information // below. It is not...
<|file_name|>fragment.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/. */ //! The `Fragment` type, which represents the leaves of the ...
/// Tile an image pub fn tile_image(position: &mut Au, size: &mut Au,
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from logbot.daemonizer import Daemonizer from logbot.irc_client import IrcClient<|fim▁hole|>from logbot.logger import Logger from logbot.parser import Parser<|fim▁end|>
<|file_name|>LocalTests.py<|end_file_name|><|fim▁begin|>from Hypotheses import * from ModelSelection import LinearRegression from Test import * sigma = 5 # observation noise sigma ############################################################################## # Synthetic tests ########################################...
lr = LinearRegression(hc, sigma) data = np.arange(0, 5)
<|file_name|>test_blockdown.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Use nose `$ pip install nose` `$ nosetests` """ from hyde.generator import Generator from hyde.site import Site from fswrap import File from pyquery import PyQuery TEST_SITE = File(__file__).parent.parent.child_folder('_test') c...
gen = Generator(s) gen.generate_resource_at_path(bd.path) res = s.content.resource_from_path(bd.path)
<|file_name|>condexpr.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2017 Christoph Heiss * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without lim...
let args = &args[..args.len()-1];
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import * <|fim▁hole|> url(r'^$', view='browse', name='foo.browse'), # Detail URL url(r'^(?P<slug>(?!overview\-)[\w\-\_\.\,]+)/$', view='detail', name='foo.detail'), )<|fim▁end|>
urlpatterns = patterns('foo.views', # Listing URL
<|file_name|>objects.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- def get_instance_children(obj, depth=0, sig=0): """ Récupèration récursive des relations enfants d'un objet @depth: integer limitant le niveau de recherche des enfants, 0=illimité """<|fim▁hole|> # Nom de l'attribut...
children = [] # Pour toute les relations enfants de l'objet for child in obj._meta.get_all_related_objects():
<|file_name|>borrowck-loan-blocks-move-cc.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://w...
<|file_name|>package.py<|end_file_name|><|fim▁begin|>############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, t...
self._append_option(opts, 'tcl') if interface_type == 'python':
<|file_name|>test_settings.py<|end_file_name|><|fim▁begin|># encoding: utf-8 import logging # emplacement ou charger les fichier de configuration par instances INSTANCES_DIR = '/etc/jormungandr.d' # Start the thread at startup, True in production, False for test environments START_MONITORING_THREAD = False<|fim▁hole...
# chaine de connnection à postgresql pour la base jormungandr
<|file_name|>glutin.rs<|end_file_name|><|fim▁begin|>//! Window creation using glutin for gfx. //! //! # Examples //! //! The following code creates a `gfx::Surface` using glutin. //! //! ```no_run //! extern crate glutin; //! extern crate gfx_backend_gl; //! //! fn main() { //! use gfx_backend_gl::Surface; //! ...
impl hal::Surface<B> for Surface { fn get_kind(&self) -> hal::image::Kind { let (w, h, _, a) = get_window_dimensions(&self.window);
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 *-* from collections import OrderedDict from nicepy.utils import ljust_all, pretty_repr def get_failed_msg(compare_method, values, expected_values, names=None, expected_names=None): failed_list = [] names = names or map(str, range(len(va...
if not failed_list: return None msg = 'actual values != expected values:' failed_list = zip(*map(ljust_all, zip(*failed_list)))
<|file_name|>pygeolib.py<|end_file_name|><|fim▁begin|>import sys import collections class GeocoderResult(collections.Iterator): """ A geocoder resultset to iterate through address results. Exemple: results = Geocoder.geocode('paris, us') for result in results: print(result.formatted_addres...
""" Return a (latitude, longitude) coordinate pair of the current result """ location = self.current_data['geometry']['location']
<|file_name|>Log.java<|end_file_name|><|fim▁begin|>package de.vsis.groomba.communication; public class Log { /** * @author Hannes * * Helps to create different log levels for debugging purposes. * */ public final static int OFF = 0; public final static int ERROR = 1; public final static int IN...
<|file_name|>product_channel_exclusivity.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/ads/googleads/v0/enums/product_channel_exclusivity.proto package enums // import "google.golang.org/genproto/googleapis/ads/googleads/v0/enums" import proto "github.com/golang...
func (m *ProductChannelExclusivityEnum) XXX_Size() int { return xxx_messageInfo_ProductChannelExclusivityEnum.Size(m) }
<|file_name|>px_mkfw.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ############################################################################ # # Copyright (C) 2012, 2013 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are per...
bytes = f.read() desc['image_size'] = len(bytes)
<|file_name|>WebPluginContainerTest.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2012 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source ...
, m_layer(adoptPtr(Platform::current()->compositorSupport()->createLayer()))
<|file_name|>operator_pd_full_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 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:/...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>export { default as createShallow } from './createShallow'; export { default as createMount } from './createMount'; export { default as createRender } from './createRender'; export { default as findOutermostIntrinsic, wrapsIntrinsicElement } from './findOutermostIntrin...
export { default as unwrap } from './unwrap';
<|file_name|>document_library_tags.py<|end_file_name|><|fim▁begin|>"""Templatetags for the ``document_library`` app.""" from django import template from ..models import Document register = template.Library() @register.assignment_tag def get_files_for_document(document): """ Returns the available files for ...
:param count: Number of documents to be returned. Defaults to 5.
<|file_name|>remove_issue_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
import flask import webtest
<|file_name|>Main.js<|end_file_name|><|fim▁begin|>o2.xApplication.ConfigDesigner.options = { "multitask": true, "executable": false }; o2.xDesktop.requireApp("ConfigDesigner", "Script", null, false); o2.require("o2.xDesktop.UserData", null, false); o2.xApplication.ConfigDesigner.Main = new Class({ Extends: ...
r.send(); }, maxOrReturnEditor: function(){ if (!this.isMax){
<|file_name|>mc_send.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import socket import struct import sys message = 'very important data' multicast_group = ('224.3.29.71', 10000) # Create the datagram socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Set a timeout so the socket does not block ind...
# to receive data. sock.settimeout(0.2) # Set the time-to-live for messages to 1 so they do not go past the
<|file_name|>all_campaigns.py<|end_file_name|><|fim▁begin|>"""Module to access all emailing campagins.""" import datetime from typing import Any, Dict from urllib import parse from bob_emploi.frontend.api import job_pb2 from bob_emploi.frontend.api import project_pb2 from bob_emploi.frontend.api import user_pb2 from ...
<|file_name|>struct.go<|end_file_name|><|fim▁begin|>package xml2json import ( "strings" ) // Node is a data element on a tree type Node struct { Children map[string]Nodes Data string ChildrenAlwaysAsArray bool } // Nodes is a list of nodes type Nodes []*Node // AddChild appends a n...
}
<|file_name|>benchmark_3_layers_arcpy.py<|end_file_name|><|fim▁begin|>import time import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env.workspace = "" # set your workspace<|fim▁hole|>tic = time.clock() a_file = "random_a.tif" b_file = "random_b.tif" c_file = "random_c.tif" out_file ...
arcpy.env.overwriteOutput = True # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial")
<|file_name|>arrays.js<|end_file_name|><|fim▁begin|>(function() { var _ = typeof require == 'function' ? require('..') : window._; QUnit.module('Arrays'); test('first', function() { equal(_.first([1, 2, 3]), 1, 'can pull out the first element of an array'); equal(_([1, 2, 3]).first(), 1, 'can perform OO...
_.findIndex([{a: 1}], function(a, key, obj) { equal(key, 0); deepEqual(obj, [{a: 1}]); strictEqual(this, objects, 'called with context');
<|file_name|>ScrewTurnPageFile.js<|end_file_name|><|fim▁begin|>var path = require('path') ScrewTurnPageFile.LATEST = -1 ScrewTurnPageFile.compare = compare ScrewTurnPageFile.prototype.isLatest = isLatest ScrewTurnPageFile.prototype.compareTo = compareTo function ScrewTurnPageFile(filename) { var revision = getRev...
<|file_name|>ActuExpendedAdapter.java<|end_file_name|><|fim▁begin|>package com.krealid.starter.adapters; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import and...
ViewHolder holder = new ViewHolder(view);
<|file_name|>test_is.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django.test import SimpleTestCase from localflavor.is_.forms import (ISIdNumberField, ISPhoneNumberField, ISPostalCodeSelect) class ISLocalFlavorTests(SimpleTestCase): def test_IS...
out = '''<select name="foo">
<|file_name|>AlfMenuGroup.js<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2005-2016 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco 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 Softwa...
} } },
<|file_name|>views_query.py<|end_file_name|><|fim▁begin|># coding:utf-8 import json from django.http import HttpResponse from django.shortcuts import render from aircraft_config import AC_WQAR_CONFIG from list2string_and_echarts_function import Echarts_option from list2string_and_echarts_function import LIST_to_STR f...
def ajax_some_para(request): list_str = LIST_to_STR() post_NAME = request.GET.get('value_conf', None) print post_NAME
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.core.urlresolvers import reverse from django.core.mail import send_mail from django.shortcuts import render, redirect from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from .models import ActivateCode impo...
expire_timestamp=expire_time) code_record.save() activate_link = "http://%s%s" % (request.get_host(), reverse(
<|file_name|>blog_post.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, re from frappe.website.website_generator import WebsiteGenerator from frappe.website.render import clear...
self.blog_intro = re.sub("\<[^>]*\>", "", self.blog_intro)
<|file_name|>lambda_function.py<|end_file_name|><|fim▁begin|>import logging from ask import alexa import car_accidents import expected_population logger = logging.getLogger() logger.setLevel(logging.INFO)<|fim▁hole|>def lambda_handler(request_obj, context=None): return alexa.route_request(request_obj) @alexa.def...
<|file_name|>layout_thread.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/. */ //! The layout thread. Performs layout on the DOM, buil...
<|file_name|>ValuesSelectedEvent.java<|end_file_name|><|fim▁begin|>package com.smartgwt.mobile.client.internal.widgets.events; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.HasHandlers;<|fim▁hole|> public class ValuesSelectedEvent extends GwtEvent<ValuesSelectedHandler> { private...
<|file_name|>array.ts<|end_file_name|><|fim▁begin|>/*----------------------------------------------------------------------------- | Copyright (c) 2014-2017, PhosphorJS Contributors | | Distributed under the terms of the BSD 3-Clause License. | | The full license is in the file LICENSE, distributed with this software. ...
* #### Undefined Behavior * A `delta`, `start`, or `stop` which is non-integral. * * #### Example
<|file_name|>run_model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf8 -*- import os import argparse import tensorflow as tf from gym import wrappers from yarll.environment.registration import make class ModelRunner(object): """ Run an already learned model. Currently only suppor...
parser.add_argument("--iterations", default=100, type=int, help="Number of iterations to run the algorithm.")
<|file_name|>test-helpers.js<|end_file_name|><|fim▁begin|>var assert = require('assert'); var Helpers = require('../../lib/Helpers'); var common = require('../common'); <|fim▁hole|> Helpers.escapeQuery(Dialect, "SELECT * FROM abc WHERE LOWER(abc.`stuff`) LIKE 'peaches'"), "SELECT * FROM abc WHERE LOWER(abc.`stuff`) ...
var Dialect = common.getDialect('mysql'); assert.equal(
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from networkx.algorithms.chordal.chordal_alg import *<|fim▁end|>
<|file_name|>TopoVolumeTypeItemProvider.java<|end_file_name|><|fim▁begin|>/** * <copyright> * </copyright> * * $Id$ */ package net.opengis.gml.provider; import java.util.Collection; import java.util.List; import net.opengis.gml.GmlFactory; import net.opengis.gml.GmlPackage; import net.opengis.gml.TopoVolumeType...
* @generated */
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate mml; fn main() {<|fim▁hole|> // let _ = mml::src2both("src", dest.replace("-", "_").as_str()); }<|fim▁end|>
// let dest: String = concat!("target/doc/", env!("CARGO_PKG_NAME")).to_string();
<|file_name|>new_executable.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" "os" "github.com/remeh/mehtadata/db" "github.com/remeh/mehtadata/model" ) func NewExecutable(flags Flags) (int64, bool, error) { // mandatory name := os.Getenv("NAME") filepath := os.Getenv("FILEPATH") platformName := os....
players := os.Getenv("PLAYERS") rating := os.Getenv("RATING") ok := false
<|file_name|>Activator.java<|end_file_name|><|fim▁begin|>package com.gilecode.langlocker; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; /** * The activator class controls the plug-in life cycle */ public class Activator ext...
// The plug-in ID public static final String PLUGIN_ID = "com.gilecode.langlocker"; //$NON-NLS-1$
<|file_name|>synthetic_rope.py<|end_file_name|><|fim▁begin|>import numpy as np import cv2 from scipy import interpolate from random import randint import IPython from alan.rgbd.basic_imaging import cos,sin from alan.synthetic.synthetic_util import rand_sign from alan.core.points import Point """ generates rope using n...
pixel_sum += (image[y][x]/255.0) #if more than 60% of adjacent (2 * rope_w x 2 * rope_w) pixels are white, endpoint is probably lying on rope