prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>font_icon.rs<|end_file_name|><|fim▁begin|>use crate::{ proc_macros::IntoRenderObject, render_object::*, utils::{Brush, Point, Rectangle}, }; /// The `FontIconRenderObject` holds the font icons inside /// a render object. #[derive(Debug, IntoRenderObject)] pub struct FontIconRenderObject; impl...
<|file_name|>display_top_prons.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|># 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/LI...
# # Copyright 2013 CSIR Meraka HLT and Multilingual Speech Technologies (MuST) North-West University #
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const fs = require('fs'); const dns = require('dns'); const argv = require('yargs').argv; const Seismometer = require('./seismometer'); const Communicator = require('./communicator'); function assertOnline() { return new Promise((fulfill, reject) => { dns.resolv...
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ##############################################################################<|fim▁hole|># OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you ca...
#
<|file_name|>OpennmsKafkaProducer.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2018-2020 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2020 The OpenNMS Group, Inc. * * OpenNMS(R)...
return; } dataSync.handleAlarmSnapshot(alarms); }
<|file_name|>get_state_events_for_empty_key.rs<|end_file_name|><|fim▁begin|>//! [GET /_matrix/client/r0/rooms/{roomId}/state/{eventType}](https://matrix.org/docs/spec/client_server/r0.6.0#get-matrix-client-r0-rooms-roomid-state-eventtype) use ruma_api::ruma_api; use ruma_events::EventType; use ruma_identifiers::RoomId...
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export * from './signup.component';
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup setup( name='megad-mqtt-gw', version='0.3', description='Gateway between MQTT queue and MegaD devices (http://ab-log.ru)', author='rs', author_email='repalov@gmail.com', url='https://github.com/repalov/megad-mqt...
license='Apache License', classifiers=[ 'Development Status :: 4 - Beta',
<|file_name|>pherf-standalone.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ############################################################################ # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for ...
hbase_env_cmd = None if os.name == 'posix': hbase_env_path = os.path.join(hbase_config_path, 'hbase-env.sh')
<|file_name|>ActivityTests.py<|end_file_name|><|fim▁begin|>import base64 import json from django.test import TestCase from django.conf import settings from django.core.urlresolvers import reverse from ..views import register, statements, activities class ActivityTests(TestCase): @classmethod def setUpClass(c...
def test_head_wrong_activity(self):
<|file_name|>order.py<|end_file_name|><|fim▁begin|>from ..cw_model import CWModel class Order(CWModel): def __init__(self, json_dict=None): self.id = None # (Integer) self.company = None # *(CompanyReference) self.contact = None # (ContactReference) self.phone = None ...
self.description = None # (String)
<|file_name|>fix.js<|end_file_name|><|fim▁begin|>$(document).ready(function() { ///*определение ширины скролбара // создадим элемент с прокруткой var div = document.createElement('div'); div.style.overflowY = 'scroll'; div.style.width = '50px'; div.style.height = '50px'; div.style.position = 'a...
} if (fix_flag === false) { if (rect2.top + height*2 < 0) {
<|file_name|>lint-obsolete-attr.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<|fim▁hole|>// <LICENS...
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
<|file_name|>get.go<|end_file_name|><|fim▁begin|>package eureka import ( "encoding/xml" "strings" ) func (c *Client) GetApplications() (*Applications, error) { response, err := c.Get("apps") if err != nil { return nil, err } var applications *Applications = new(Applications) err = xml.Unmarshal(response.Body...
} var applications *Applications = new(Applications) err = xml.Unmarshal(response.Body, applications) return applications, err
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
__author__ = 'donstrata'
<|file_name|>gene_test.go<|end_file_name|><|fim▁begin|>package alignmentprofile import "testing" func TestGeneMatching(t *testing.T) { matchingCases := []struct { g Gene s string }{<|fim▁hole|> {Gene("A"), "a"}, {Gene("A"), "A"}, {Gene("A"), " a "}, {Gene("A"), "A "}, } for _, c := range matchingCases ...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>""" This file includes commonly used utilities for this app. """ from datetime import datetime today = datetime.now() year = today.year month = today.month day = today.day<|fim▁hole|> def front_image(instance, filename): # file will be uploaded to MEDIA_ROOT/pr...
# Following are for images upload helper functions. The first two are used for product upload for the front and back. # The last two are used for design product upload for the front and back.
<|file_name|>issue-333.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distri...
// 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
<|file_name|>background.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
declare var chrome: any;
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>/* * Qt REST Client * Copyright (C) 2014 Emílio Simões * * 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 License,...
<|file_name|>skiplist_tests.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2014-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <chain.h> #include <util.h> #include <test/test_bitcoin...
// Build a branch that splits off at block 49999, 50000 blocks long.
<|file_name|>media_queries.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 std::ascii::AsciiExt; use cssparser::{Token, Parser...
test_media_rule("@media fridge and (max-width: 52px) { }", |list, css| { assert!(list.media_queries.len() == 1, css.to_owned()); let q = &list.media_queries[0];
<|file_name|>pysickle.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' Copyright (C) 2014 Janina Mass 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 License, or (at...
if not toKeep:
<|file_name|>script.js<|end_file_name|><|fim▁begin|>if ( !window.console ) window.console = { log:function(){} }; jQuery(document).ready(function($) { console.log('Keep being awesome.');<|fim▁hole|><|fim▁end|>
});
<|file_name|>stream.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses...
fn take_to_wake(&mut self) -> SignalToken {
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from django.contrib.sites.models import RequestSite from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ from .models import RegistrationProfile from opps.core.admin import apply_opps_rul...
search_fields = ('user__username', 'user__first_name', 'user__last_name', 'user__email') def activate_users(self, request, queryset): """
<|file_name|>sets.js<|end_file_name|><|fim▁begin|>'use strict'; /*global require, after, before*/ var async = require('async'), assert = require('assert'), db = require('../mocks/databasemock'); describe('Set methods', function() { describe('setAdd()', function() { it('should add to a set', function(done) { ...
assert.equal(err, null); assert.equal(arguments.length, 1);
<|file_name|>base_repo.py<|end_file_name|><|fim▁begin|># Copyright 2015 FUJITSU LIMITED # (C) Copyright 2016 Hewlett Packard Enterprise Development LP # # 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 Licen...
WHERE aa.alarm_definition_id = %s and aa.alarm_state = %s""" self._find_alarm_state_sql = \ """SELECT state FROM alarm
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import json from idpproxy.social.oauth import OAuth import oauth2 as oauth #from xml.etree import ElementTree as ET import logging logger = logging.getLogger(__name__) __author__ = 'rohe0002' class LinkedIn(OAuth): def __init__(self, client_id, client_secret, ...
logger.debug("userinfo: %s" % res) res["user_id"] = info_set["oauth_token"]
<|file_name|>CGDeclCXX.cpp<|end_file_name|><|fim▁begin|>//===--- CGDeclCXX.cpp - Emit LLVM Code for C++ declarations --------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0...
const CGFunctionInfo &FI =
<|file_name|>complex.rs<|end_file_name|><|fim▁begin|>// Implements http://rosettacode.org/wiki/Arithmetic/Complex // not_tested extern crate num; use num::complex::Complex; fn main() { let a = Complex::new(-4.0f32, 5.0); let b = Complex::new(1.0f32, 1.0); println!("a = {}", a); println!("b = {}", b)...
<|file_name|>ProjectExplorerContentProvider.java<|end_file_name|><|fim▁begin|>/** * Aptana Studio * Copyright (c) 2005-2012 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions). * Please see the license.html included with this distribution for de...
} private boolean shouldUpdateActions(IResourceDelta delta)
<|file_name|>chunk_sparse_matrix_14.cc<|end_file_name|><|fim▁begin|>// --------------------------------------------------------------------- // // Copyright (C) 2004 - 2013 by the deal.II authors // // This file is part of the deal.II library. // // The deal.II library is free software; you can use it, redistribute // ...
i<sizeof(chunk_sizes)/sizeof(chunk_sizes[0]);
<|file_name|>identifiers.d.ts<|end_file_name|><|fim▁begin|>import { CompileIdentifierMetadata, CompileTokenMetadata } from './compile_metadata'; export interface IdentifierSpec { name: string;<|fim▁hole|> static ANALYZE_FOR_ENTRY_COMPONENTS: IdentifierSpec; static ElementRef: IdentifierSpec; static NgMod...
moduleUrl: string; runtime: any; } export declare class Identifiers {
<|file_name|>globals_dup.js<|end_file_name|><|fim▁begin|>var globals_dup = [ [ "a", "globals.html", null ], [ "b", "globals_0x62.html", null ], [ "c", "globals_0x63.html", null ], [ "d", "globals_0x64.html", null ], [ "e", "globals_0x65.html", null ], [ "f", "globals_0x66.html", null ], [ "g...
[ "o", "globals_0x6f.html", null ],
<|file_name|>faq.py<|end_file_name|><|fim▁begin|># modusite # Copyright (c) 2006-2010 Phil Christensen # http://modu.bubblehouse.org # # from modu.persist import storable class FAQ(storable.Storable): def __init__(self):<|fim▁hole|> store.ensure_factory('user') user = store.load_one('user', id=self.answered_by) ...
super(FAQ, self).__init__('faq') def get_answerer(self): store = self.get_store()
<|file_name|>pek1dclasses.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Created on Thu Jun 05 13:55:13 2014 @author: Alison Kirkby """ import mtpy.core.edi as mtedi import os import os.path as op import numpy as np import matplotlib.pyplot as plt import scipy.interpolate as si import mtpy.utils.excepti...
self.inmodel_list.append(inmodel) except IOError: print("inmodel file not found")
<|file_name|>0004.py<|end_file_name|><|fim▁begin|>''' A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99. Find the largest palindrome made from the product of two 3-digit numbers. ''' nums = range(999, 99, -1)<|fim▁hole|>answer = max(pa...
allProducts = [x * y for x in nums for y in nums] palindromeProducts = [p for p in allProducts if str(p) == str(p)[::-1]]
<|file_name|>117PopulatingNextRightPointersInEachNodeII.py<|end_file_name|><|fim▁begin|># Definition for binary tree with next pointer. # class TreeLinkNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # self.next = None class Solution: # @para...
parent = parent.next
<|file_name|>common.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/licenses...
let rs = @mut false; let visit_expr: @fn(@ast::expr, &&flag: @mut bool,
<|file_name|>best_hrid_test.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google LLC<|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 distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDI...
# # 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
<|file_name|>test33.py<|end_file_name|><|fim▁begin|>'d' def x(): print j j = 0 <|fim▁hole|><|fim▁end|>
def y(): for x in []: print x
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
return json_response(out) ows_endpoints = OWSListView.as_view()
<|file_name|>get_user_input.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2012-2014 Carlos Pais * * 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 License, or * ...
} void GetUserInput::setVariable(const QString & var)
<|file_name|>ObjectConstants.js<|end_file_name|><|fim▁begin|>(function () { "use strict"; /** * This module have an ability to contain constants. * No one can reinitialize any of already initialized constants */ var module = (function () { var constants = {}, hasOwnProper...
/** * Constant getter
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Unit tests for reverse URL lookups. """ from __future__ import unicode_literals import sys import threading import unittest from admin_scripts.tests import AdminScriptTestCase from django.conf import settings from django.conf.urls import ...
with self.assertRaises(NoReverseMatch): reverse('test-ns1:blahblah:urlobject-view') def test_normal_name(self):
<|file_name|>libyaLow.js<|end_file_name|><|fim▁begin|>// (c) ammap.com | SVG (in JSON format) map of Libya - Low // areas: {id:"LY-WD"},{id:"LY-BU"},{id:"LY-DR"},{id:"LY-SR"},{id:"LY-BA"},{id:"LY-WA"},{id:"LY-JA"},{id:"LY-HZ"},{id:"LY-TB"},{id:"LY-MZ"},{id:"LY-ZA"},{id:"LY-NQ"},{id:"LY-JI"},{id:"LY-SB"},{id:"LY-MI"},{i...
"d":"M130.21,52.3L113.27,45.72L49.73,89.52L41.79,104.37L46.11,145.4L29.96,167.38L0.52,181.25L19.71,210.79L27.74,267.82L58.63,267.48L82.24,254.85L103.09,272.05L134.7,269.17L123.5,240.9L116.48,156.44L135.27,124.88L130.21,52.3z"
<|file_name|>issue-980.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. //<|fim▁hole|>// except according to those terms. use std::cell::RefCell; use std::gc::{Gc, GC}; en...
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use crate::lexer::TokenKind; use crate::node::*; use crate::syntax_error::Synta...
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-10-18 12:59 from django.db import migrations, models import django.db.models.deletion import taggit.managers import wagtail.search.index class Migration(migrations.Migration): initial = True ...
bases=(models.Model, wagtail.search.index.Indexed), ), migrations.CreateModel(
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" ) func SumArray(arr []uint64) uint64 { var sum uint64 for _, i := range arr { sum += i } return sum } func main() { var count uint64 fmt.Scan(&count) array := make([]uint64, count)<|fim▁hole|> for i := range array { fmt.Scan(&ar...
<|file_name|>test_smtp.py<|end_file_name|><|fim▁begin|>import sys import smtplib <|fim▁hole|>def output((code, msg)): sys.stdout.write('%s %s\n' % (code, msg)) sys.stdout.flush() smtp = smtplib.SMTP('localhost', 2500) output(smtp.ehlo('moon.localdomain')) print smtp.esmtp_features output(smtp.mail('Damien Chur...
<|file_name|>main.js<|end_file_name|><|fim▁begin|>'use strict'; describe('Controller: MainCtrl', function() { // load the controller's module beforeEach(module('actionatadistanceApp')); var MainCtrl,<|fim▁hole|> scope = {}; MainCtrl = $controller('MainCtrl', { $scope: scope }); })); it('s...
scope; // Initialize the controller and a mock scope beforeEach(inject(function($controller) {
<|file_name|>udup_ablation.py<|end_file_name|><|fim▁begin|>from collections import defaultdict, Counter from pathlib import Path import argparse import sys, copy import networkx as nx import numpy as np from lib.conll import CoNLLReader, DependencyTree from pandas import pandas as pd OPEN="ADJ ADV INTJ NOUN PROPN VERB...
if h != d: s.add_edge(h,d) return s
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os basedir=os.path.abspath(os.path.dirname(__file__))#get basedir of the project WTF_CSRF_ENABLED = True SECRET_KEY = 'you-will-guess' #for database # SQLALCHEMY_DATABASE_URI = 'mysql:///' + os.path.join(basedir, 'app.db') SQLALCHEMY_...
<|file_name|>clarify_brightcove_bridge.py<|end_file_name|><|fim▁begin|>from collections import Counter<|fim▁hole|>MAX_METADATA_STRING_LEN = 2000 def default_to_empty_string(val): return val if val is not None else '' class ClarifyBrightcoveBridge: def __init__(self, clarify_client, bc_client): self...
from clarify_python.helper import get_embedded_items, get_link_href
<|file_name|>0026_add_access_control_tables.py<|end_file_name|><|fim▁begin|>from redash.models import db, Change, AccessPermission, Query, Dashboard from playhouse.migrate import PostgresqlMigrator, migrate if __name__ == '__main__': if not Change.table_exists(): Change.create_table() if not AccessPe...
try: migrate( migrator.add_column('queries', 'version', Query.version), migrator.add_column('dashboards', 'version', Dashboard.version)
<|file_name|>xmlwitch.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement import sys from xml.sax import saxutils from keyword import kwlist as PYTHON_KWORD_LIST is_py2 = sys.version[0] == '2' if is_py2: from StringIO import StringIO else: from io import StringIO __all__ = ['Bui...
def _nameprep(self, name): """Undo keyword and colon mangling""" name = Element.PYTHON_KWORD_MAP.get(name, name)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from jupyter_server.utils import url_path_join as ujoin from .config import Lmod as LmodConfig from .handler import default_handlers, PinsHandler def _jupyter_server_extension_paths(): return [{"module": "jupyterlmod"}] # Jupyter Extension points def _jupyt...
nbapp.log.info("Loading lmod extension") lmod_config = LmodConfig(parent=nbapp) launcher_pins = lmod_config.launcher_pins
<|file_name|>people_fr_CA.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fr_CA" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About People</source> <translation>Au sujet de P...
<source>You need the Wallet Recovery Phrase to restore this wallet. Write it down and keep them somewhere safe. You will be asked to confirm the Wallet Recovery Phrase in the next screen to ensure you have written it down correctly</source>
<|file_name|>workitem-detailpage.ts<|end_file_name|><|fim▁begin|>import * as ui from '../../ui'; import { WorkItemQuickPreview } from './workitem-quickpreview';<|fim▁hole|> }<|fim▁end|>
export class WorkItemDetailPage extends WorkItemQuickPreview { detailPageDiv = new ui.BaseElement(this.$('#wi-detail-form'), 'wi detail page');
<|file_name|>disk_manager.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 U...
noMnt, mntErr = b.mounter.IsLikelyNotMountPoint(volPath) if mntErr != nil { glog.Errorf("IsLikelyNotMountPoint check failed: %v", mntErr) return err
<|file_name|>classification-svc-iris.py<|end_file_name|><|fim▁begin|>import numpy as np from sklearn import datasets, svm <|fim▁hole|>iris = datasets.load_iris() iris_X = iris.data iris_y = iris.target # Set aside the first 10 data points as test data indicies = np.random.permutation(len(iris_X)) iris_X_train = iri...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 sourc...
<|file_name|>closure.rs<|end_file_name|><|fim▁begin|>fn main(){ let is_even = |x| { x%2==0<|fim▁hole|> println!("{} is even ? {}",no,is_even(no)); }<|fim▁end|>
}; let no = 13;
<|file_name|>Exercise 3.py<|end_file_name|><|fim▁begin|># Exercise 3 # creating a simple loop<|fim▁hole|> #set the start value i = 0 upper_range=10 for i in range(upper_range): print(str(i+1)+ " this is a loop")<|fim▁end|>
# print out 1 thru 10
<|file_name|>mut_ref.rs<|end_file_name|><|fim▁begin|>// Compiler: // // Run-time: // stdout: 2 // 7 // 6 // 11 #![allow(unused_attributes)] #![feature(auto_traits, lang_items, no_core, start, intrinsics, track_caller)] #![no_std] #![no_core] /* * Core */ // Because we don't have core yet. #[lang = "...
fn add(self, rhs: Self) -> Self { self + rhs
<|file_name|>SSFP.py<|end_file_name|><|fim▁begin|>from mdt import CompartmentTemplate from mdt.lib.post_processing import DTIMeasures __author__ = 'Robbert Harms' __date__ = '2017-08-03' __maintainer__ = 'Robbert Harms' __email__ = 'robbert@xkls.nl' __licence__ = 'LGPL v3' class SSFP_Ball(CompartmentTemplate): ...
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import importlib.util import logging import os import warnings from os import getenv from typing import Any, Optional, Mapping, ClassVar log = logging.getLogger(__name__) default_settings_dict = { 'connect_timeout_seconds': 15, 'read_timeout_seconds': 30,...
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 Alon Swartz <alon@turnkeylinux.org> # # This file is part of OctoHub. # # OctoHub 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; ei...
pass
<|file_name|>exp_entries.py<|end_file_name|><|fim▁begin|># coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. """ This module defines Entry classes for containing experimental data. """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Material...
raise ValueError("List of Thermodata does not contain enthalpy "
<|file_name|>default.js<|end_file_name|><|fim▁begin|>/* * Lupus in Tabula * ...un progetto di Edoardo Morassutto * Contributors: * - 2014 Edoardo Morassutto <edoardo.morassutto@gmail.com> */ var path = ""; var APIdir = path + "/api"; var errorCount = 0; var lastError = 0; var lastNotificationUpdate = null; fu...
<|file_name|>pendingChain.go<|end_file_name|><|fim▁begin|>package internal<|fim▁hole|> import G "github.com/ionous/sashimi/game" // PendingChain implements runtime.IChain, it fills out the chained callback if the user links one in. type PendingChain struct { //node **ChainedCallback src *GameEventAdapter } func New...
<|file_name|>errors.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (C) 2008 Osmo Salomaa # # 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 License, ...
Something expected to be ``True`` was ``False``.
<|file_name|>sysvinit.rs<|end_file_name|><|fim▁begin|>use std::result::Result; use backend::Backend; use backend::command::Command; use provider::error::Error; use provider::Output; use provider::service::shell::ShellProvider; #[derive(Clone, Debug)] pub struct SysVInit; impl ShellProvider for SysVInit { fn is_r...
<|file_name|>ClientSignaler.ts<|end_file_name|><|fim▁begin|>import * as SimplePeer from "simple-peer"; import { IState } from "../redux/State"; import { AbstractSignaler, IOfferMessage, IResponseMessage } from "./AbstractSignaler"; interface IResponseStore { id: string; signalData: SimplePeer.SignalData; }<|fi...
<|file_name|>FeatureIterator.cpp<|end_file_name|><|fim▁begin|>#include "FeatureIterator.h" #include "Random.h" #include <functional> namespace dungeon { //////////////////////////////////////////////////////////////////////////////// // ADJUSTERS //////////////////////////////////////////////////////////////////////...
int IForward::next() { ++mCurrent;
<|file_name|>tumble.go<|end_file_name|><|fim▁begin|>package demo import ( _ "fmt" cp "github.com/eka-tel72/go-chipmunk62/chipmunk" ) /* #include <stdlib.h> int Random(void) { return rand(); } void Seed(unsigned int i) { srand(i); } */ import "C" type tumble struct { *demoClass rogueBoxBody *cp.Body } var t...
b := cp.V(-200, 200)
<|file_name|>159. Longest Substring with At Most Two Distinct Characters.java<|end_file_name|><|fim▁begin|>public class Solution { public int lengthOfLongestSubstringTwoDistinct(String s) { int[] map = new int[128]; int count = 0, start = 0, end = 0, d = 0; while (end < s.length()) { ...
<|file_name|>package_spec.js<|end_file_name|><|fim▁begin|>var search = require('./helpers/search'), authoring = require('./helpers/pages').authoring,<|fim▁hole|> describe('package', () => { beforeEach(() => { monitoring.openMonitoring(); }); it('increment package version', () => { monit...
monitoring = require('./helpers/monitoring');
<|file_name|>proton.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache L...
def get_object(self):
<|file_name|>Item.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2004-2006, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/community/licensing.shtml */ dojo...
<|file_name|>ResourcesTester.java<|end_file_name|><|fim▁begin|>package net.community.chest.test.gui; import java.io.BufferedReader; import java.io.PrintStream; import net.community.chest.Triplet; import net.community.chest.awt.dom.converter.InsetsValueInstantiator; import net.community.chest.awt.layout.gridbag.Extende...
{
<|file_name|>default_census_cat_transforms.py<|end_file_name|><|fim▁begin|># PopGen 1.1 is A Synthetic Population Generator for Advanced # Microsimulation Models of Travel Demand # Copyright (C) 2009, Arizona State University # See PopGen/License DEFAULT_PERSON_PUMS2000_QUERIES = [ "alter table person_pums add c...
<|file_name|>client.py<|end_file_name|><|fim▁begin|><|fim▁hole|> def __init__(self, mac): self.__mac__ = mac def hub(self, hub): return Hub(self.__mac__, hub)<|fim▁end|>
from .hub import Hub class Client(object):
<|file_name|>Lowest_Common_Ancestor.py<|end_file_name|><|fim▁begin|># Find the Lowest Common Ancestor (LCA) in a Binary Search Tree # A Binary Search Tree node class Node: # Constructor to initialise node def __init__(self, data): self.data = data self.left = None self.right = None c...
<|file_name|>test.js<|end_file_name|><|fim▁begin|>/* global require, describe, it */ 'use strict'; // MODULES // var // Expectation library: chai = require( 'chai' ), // Matrix data structure: matrix = require( 'dstructs-matrix' ), // Validate a value is NaN: isnan = require( 'validate.io-nan' ), // Cast typ...
<|file_name|>test_jvm_app.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os from builtins import ...
def test_bundle_filemap_dest_byglobs(self):
<|file_name|>liveness-issue-2163.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...
fn main() {
<|file_name|>Tax_Card.java<|end_file_name|><|fim▁begin|>/** */ package TaxationWithRoot; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Tax Card</b></em>'. * <!-- end-user-doc --> * * <p> ...
void setJobs_place_of_work(Town value);
<|file_name|>loader.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2017 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0...
<|file_name|>test_active_config_holder.py<|end_file_name|><|fim▁begin|># This file is part of the ISIS IBEX application. # Copyright (C) 2012-2016 Science & Technology Facilities Council. # All rights reserved. # # This program is distributed in the hope that it will be useful. # This program and the accompanying mater...
<|file_name|>mapping.py<|end_file_name|><|fim▁begin|>''' This module is part of ngs_backbone. This module provide mapping related analyses Created on 15/03/2010 @author: peio ''' # Copyright 2009 Jose Blanca, Peio Ziarsolo, COMAV-Univ. Politecnica Valencia # This file is part of franklin. # franklin is free software:...
gatk_path = osettings['gatk_path']
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import pytest import sys import logging from sqlalchemy import create_engine import zk.model.meta as zkmeta import zkpylons.model.meta as pymeta from zkpylons.config.routing import make_map from paste.deploy import loadapp from webtest import TestApp from paste....
<|file_name|>crypto.d.ts<|end_file_name|><|fim▁begin|>/** * The `crypto` module provides cryptographic functionality that includes a set of * wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify functions. * * ```js * const { createHmac } = await import('crypto'); * * const secret = 'abcdefg'; ...
<|file_name|>request.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 ReferrerPolicy; use hyper::header::Headers; use hyper::me...
/// A request [destination](https://fetch.spec.whatwg.org/#concept-request-destination)
<|file_name|>get_locals.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import rospy import actionlib from actionlib_msgs.msg import * from geometry_msgs.msg import PoseStampted import yaml import os import os.path class GetLocals: def __init__(self): rospy.Subscriber('move_base_simple/goal', PoseStampted,...
yaml_file.write(yaml.dump(self.data, default_flow_style = False)) rospy.loginfo('Point Saved!') rospy.loginfo('\nPLEASE, SEND A GOAL WITH NAV 2D GOAL USING GRAPHIC USER INTERFACE TO SAVE A POINT!\n') else:
<|file_name|>codeUtility.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: latin-1 -*- # Copyright 2015 Oeyvind Brandtsegg # # This file is part of the Signal Interaction Toolkit # # The Signal Interaction Toolkit is free software: you can redistribute it and/or modify # it under the terms o...
('LfRoll', (20, 500, 90, 1, 1)), ('Mix', (0.0, 1.0, 1.0, 1, 0.01)) ]
<|file_name|>binlog_purge_ms.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. # # 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; version ...
"").format(cmd_str, cmd_opts, "binlog_purge{0}.log".format(2)) res = self.run_test_case(0, cmds, comment)
<|file_name|>mklivestatus.py<|end_file_name|><|fim▁begin|><|fim▁hole|>PORT = 6557<|fim▁end|>
# Configs for mk-livestatus lookup scripts HOST = [ 'nagios', 'nagios1' ]