prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>staging.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from dasdocc.conf import base<|fim▁end|>
<|file_name|>pylint_extensions.py<|end_file_name|><|fim▁begin|># coding: utf-8 # # Copyright 2018 The Oppia 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 # # ...
called.args.defaults)
<|file_name|>double-anchor.rs<|end_file_name|><|fim▁begin|>// check-pass <|fim▁hole|>/// docs [label][with#anchor#error] //~^ WARNING multiple anchors pub struct S;<|fim▁end|>
// regression test for #73264 // should only give one error
<|file_name|>artifacts_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2020 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 ...
"long-log.txt", "started.json",
<|file_name|>23-inheritance.py<|end_file_name|><|fim▁begin|>class A: def foo(self): print('A.foo()') class B(A): def foo(self): print('B.foo()') class C(A): def foo(self): print('C.foo()')<|fim▁hole|> def foo(self): print('D.foo()') x = D() print(D.__mro__) # (D, B, C, ...
class D(B, C):
<|file_name|>build.js<|end_file_name|><|fim▁begin|>(function() { 'use strict'; var getModulesList = function(modules) { return modules.map(function(moduleName) { return {name: moduleName}; }); }; var jsOptimize = process.env.REQUIRE_BUILD_PROFILE_OPTIMIZE !== undefined ? ...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* * Copyright 2015-2017 Nathan Fiedler * * 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-...
/// Returns {ok, Data}, or {error, Reason} if an error occurs. extern "C" fn image_get_format(env: *mut ErlNifEnv,
<|file_name|>TransitionQuery.java<|end_file_name|><|fim▁begin|>/** * This file is part of the CRISTAL-iSE kernel. * Copyright (c) 2001-2015 The CRISTAL Consortium. All rights reserved. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public Lic...
@Getter @Setter
<|file_name|>test_sched.py<|end_file_name|><|fim▁begin|># Copyright 2015-2015 ARM Limited # # 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|>index.go<|end_file_name|><|fim▁begin|><|fim▁hole|> import ( "github.com/labstack/echo" ) // MakeControllers for main func MakeControllers(e *echo.Echo) { e.GET("/api", homeController) }<|fim▁end|>
package controllers
<|file_name|>OSC_it_IT.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="it_IT"> <context> <name>ConfigureOSC</name> <message> <location filename="configureosc.ui" line="14"/> <source>Configure OSC Plugin</source> <translatio...
<message> <location filename="oscplugin.cpp" line="299"/> <source>Input</source>
<|file_name|>EXACT_SIZE_UNIQUE_TUPLE.py<|end_file_name|><|fim▁begin|>from rambutan3.check_args.seq.RRangeSizeUniqueSequenceMatcher import RRangeSizeUniqueSequenceMatcher from rambutan3.check_args.seq.RSequenceEnum import RSequenceEnum <|fim▁hole|>def EXACT_SIZE_UNIQUE_TUPLE(*, exact_size: int) -> RRangeSizeUniqueSequen...
# noinspection PyPep8Naming
<|file_name|>NURBSPrimitive.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted ...
} if( vOrder<2 )
<|file_name|>issue-14589.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...
<|file_name|>maas.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Adam Stokes <adam.stokes@ubuntu.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or ...
<|file_name|>quote.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/...
// better since the source of the quote may well be in a library that // was not even parsed by this compilation run, that the user has no // source code for (eg. in libsyntax, which they're just _using_).
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is d...
data_files=[('/etc/', ['data/arc.conf'])], cmdclass={'build_doc': BuildDoc}, command_options={'build_doc': {'source_dir': ('setup.py', 'docs/source')}},
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # SymPy documentation build configuration file, created by # sphinx-quickstart.py on Sat Mar 22 19:34:32 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don'...
<|file_name|>controls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2010 Trever Fischer <tdfischer@fedoraproject.org> # # This file is part of modulation. # # modulation is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publish...
"""Pause something that can be continued later"""
<|file_name|>env.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Istio 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 // //...
<|file_name|>0012_auto_20151230_1853.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9 on 2015-12-30 17:53 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion<|fim▁hole|> class Migration(migra...
<|file_name|>packet.py<|end_file_name|><|fim▁begin|>import logging import rlp from utils import big_endian_to_int as idec from utils import int_to_big_endian4 as ienc4 from utils import int_to_big_endian as ienc from utils import recursive_int_to_big_endian import dispatch import sys import signals logger = logging.ge...
0x01 for PoC-2;
<|file_name|>gauge.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -<|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/LICENSE-2.0 # # Unless...
<|file_name|>filter_form.js<|end_file_name|><|fim▁begin|>function setupFilterForm() { // make filter form expandable $('#filter-panel .card-header').on('click', function() { $('#filter-panel .card-body').toggle(200); if($('#filter-panel').hasClass('filter-panel-bottom')) { $('html,bo...
scrollTop: $(document).height() }); }
<|file_name|>config.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Cisco Systems # 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.a...
import click
<|file_name|>deployer.js<|end_file_name|><|fim▁begin|>var site = function (tenantId, options) { var tag, tags, rate, asset, assets, carbon = require('carbon'), store = require('/modules/store.js'), path = '/_system/governance/sites/' + options.provider + '/' + options.name + '/' + options.ve...
"images_banner": options.banner, "images_thumbnail": options.thumbnail }
<|file_name|>reviewValidation.js<|end_file_name|><|fim▁begin|>import checkEmpty from '../helpers/checkEmpty'; const validateReview = { validateFields(req, res, next) { const { content } = req.body; if (checkEmpty(content)) { return res.status(400).json({ status: 'fail',<|fim▁hole|> } }; expor...
message: 'Review content field cannot be empty' }); } next();
<|file_name|>disadvantaged_group_views.py<|end_file_name|><|fim▁begin|>from django.views.generic import ListView, DetailView, CreateView, \ DeleteView, UpdateView from baseapp.models import Disadvantaged_group from django.contrib import auth, messages class Disadvantaged_groupView(o...
return reverse('baseapp_disadvantaged_group_list')
<|file_name|>image_alt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- from holmes.validators.base import Validator from holmes.utils import _ class ImageAltValidator(Validator): @classmethod def get_without_alt_parsed_value(cls, value): result = [] for src, name in ...
<|file_name|>error-dialog.component.ts<|end_file_name|><|fim▁begin|>import { Component, Injectable } from '@angular/core'; import { NgxErrorDialogComponent } from '@renet-consulting/ngx-messenger'; @Injectable({ providedIn: 'root' }) @Component({ selector: 'app-error-dialog', templateUrl: './error-dialog.c...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import collections <|fim▁hole|><|fim▁end|>
def make_enum(name, fields): return collections.namedtuple(name, fields)(*range(len(fields)))
<|file_name|>snmpraw.py<|end_file_name|><|fim▁begin|># coding=utf-8 """ The SNMPRawCollector is designed for collecting data from SNMP-enables devices, using a set of specified OIDs #### Configuration Below is an example configuration for the SNMPRawCollector. The collector can collect data any number of devices by ...
<|file_name|>package.py<|end_file_name|><|fim▁begin|>############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, t...
class UtilMacros(AutotoolsPackage):
<|file_name|>sync_rando.py<|end_file_name|><|fim▁begin|>from django.conf import settings<|fim▁hole|>from django.utils import translation from geotrek.tourism import models as tourism_models from geotrek.tourism.views import TouristicContentViewSet, TouristicEventViewSet from geotrek.trekking.management.commands.sync_r...
<|file_name|>test_change_project_parent.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Akvo Reporting is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < ht...
child_project = root.get_contributor(title='Child project')
<|file_name|>AutoValueProcessor.java<|end_file_name|><|fim▁begin|>package org.gsonformat.intellij.process; import com.intellij.psi.*; import org.apache.http.util.TextUtils; import org.gsonformat.intellij.config.Config; import org.gsonformat.intellij.config.Constant;<|fim▁hole|>import org.gsonformat.intellij.entity.Fie...
<|file_name|>schema.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
#![allow(dead_code)] include!(concat!(env!("OUT_DIR"), "/infer_schema.rs"));
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>extern crate gj; extern crate gjio; extern crate slab; use std::io::{Error, ErrorKind}; use std::rc::{Rc, Weak}; use std::cell::{Cell, RefCell}; use slab::Slab; use gj::{EventLoop, Promise, TaskReaper, TaskSet}; use gjio::{SocketStream, AsyncRead, AsyncWrite}; struc...
if args.len() != 2 { println!("usage: {} HOST:PORT", args[0]); return;
<|file_name|>test_shipments.py<|end_file_name|><|fim▁begin|># This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import decimal import pytest from djan...
@pytest.mark.django_db def test_shipment_creation_with_invalid_unsaved_shipment():
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// ================================================================= // // * WARNING * // // This file is generated! // // Changes made to this file will be overwritten. If changes are // required to the generated code, the ...
//! If you're using the service, you're probably looking for [EmrClient](struct.EmrClient.html) and [Emr](trait.Emr.html).
<|file_name|>0006_experience_temp_subtypes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2016-10-21 13:23 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('exdb', '0005_swap...
]
<|file_name|>ijrois.py<|end_file_name|><|fim▁begin|># Copyright: Luis Pedro Coelho <luis@luispedro.org>, 2012-2018 # License: MIT import numpy as np def read_roi(fileobj): ''' points = read_roi(fileobj) Read ImageJ's ROI format Parameters ---------- fileobj: should be a file-like object ...
# It seems that the roi type field occupies 2 Bytes, but only one is used
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function from os.path import join, split, dirname import os import sys from distutils.dep_util import newer from distutils.msvccompiler import get_build_version as get_msvc_build_version def needs_mingw_ftime_workaround(): #...
config.add_extension('mtrand', sources=[join('mtrand', x) for x in ['mtrand.c', 'randomkit.c', 'initarray.c',
<|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(box_syntax)] #![feature(fnbox)] #![feature(mpsc_select...
<|file_name|>infrastructure_stack.py<|end_file_name|><|fim▁begin|># Copyright 2014 - Numergy # # 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....
# Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
<|file_name|>rn.js<|end_file_name|><|fim▁begin|>define(function () {'use strict'; function rn (n) { return n.toLowerCase().replace(/a$/, ''); } return rn; <|fim▁hole|><|fim▁end|>
});
<|file_name|>el.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2007-2009,2011 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
"ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ") # Valid accelerators
<|file_name|>EmbeddableIDTestServlet.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclip...
<|file_name|>main_test.go<|end_file_name|><|fim▁begin|>package main import ( "testing"<|fim▁hole|>2. identify general edge cases 3. identify edge cases specific on the implementation */ func TestSolution(t *testing.T) { for i, tc := range []struct{ A, B []int expected int }{ // their example {[]int{4, 3, 2...
) /* 1. imagine the usual scenario
<|file_name|>htmltitleelement.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::codegen::Bindings::HTMLTitleEleme...
} }
<|file_name|>tokenize.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The html5ever Project Developers. See the // COPYRIGHT file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license /...
} if tag.self_closing { print!(" \x1b[31m/\x1b[0m");
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render, redirect from django.http import HttpResponseRedirect from .models import SupportProject # Create your views here.<|fim▁hole|>def index( request ): sp = SupportProject.objects.all() if sp.count() == 1: return ...
<|file_name|>shim.go<|end_file_name|><|fim▁begin|>package types import ( "context" pb "btrfs_to_glacier/messages" ) // Represents a line in /proc/self/mountinfo // Many be enriched from info from other places ... type MountEntry struct { Id int // NOT stable across reads of mountinfo Device *Device TreePath...
Name string MapperGroup string // if device belongs to a virtual block device Minor, Major int // Unreliable when taken from /proc/self/mountinfo FsUuid string // Optional
<|file_name|>eq_report_stock.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Odoo Addon, Open Source Management Solution # Copyright (C) 2014-now Equitania Software GmbH(<http://www.equitania.de>). # # This program is fr...
<|file_name|>test_pipeline.py<|end_file_name|><|fim▁begin|>""" Test the pipeline module. """ import numpy as np from scipy import sparse from sklearn.externals.six.moves import zip from sklearn.utils.testing import assert_raises from sklearn.utils.testing import assert_raises_regex from sklearn.utils.testing import as...
def fit(self, X, y, should_succeed=False): self.successful = should_succeed
<|file_name|>error.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details.<|fim▁hole|>import ( "github.com/juju/juju/agent/tools" "github.com/juju/juju/version" ) // UpgradeReadyError is returned by an Upgrader to report that // an upgrade is ready...
package upgrader
<|file_name|>gmail_checker.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Sean Vig # Copyright (c) 2014, 2019 zordsdavini # Copyright (c) 2014 Alexandr Kriptonov # Copyright (c) 2014 Tycho Andersen # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated d...
if(self.status_only_unseen):
<|file_name|>DescribeSpotInstanceRequestsResult.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the...
if (getSpotInstanceRequests() != null) sb.append("SpotInstanceRequests: " + getSpotInstanceRequests() ); sb.append("}"); return sb.toString();
<|file_name|>serverstatus.cpp<|end_file_name|><|fim▁begin|>#include "serverstatus.h" #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <errno.h> #include <unistd.h> #include <syslog.h> #include <string.h> #include <time.h> #include <iostream> #include <fstr...
<|file_name|>package.py<|end_file_name|><|fim▁begin|>############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, t...
# that it was a .zip file with multiple .jar and .so files version('2.18.3', '181b1b0731fd35f0d8bd44677d8787e9', expand=False) version('2.18.0', '20045ff141e4a67512365f0b6bbd8229', expand=False)
<|file_name|>fieldlinesstate.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************************** * * * OpenSpace ...
}
<|file_name|>_lib.js<|end_file_name|><|fim▁begin|>function setupTest( target, event, dataToPaste, externalPassCondition ){ var logNode=document.getElementsByTagName('p')[0].firstChild; logNode.data=''; if( typeof target==='string' ){ if( target.indexOf('.')>-1 ){ // for example "myElementID.firstChild" va...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from iRODSLibrary import iRODSLibrary __version__ = "0.0.4" class iRODSLibrary(iRODSLibrary): """ iRODSLibrary is a client keyword library that uses the python-irodsclient module from iRODS https://github.com/irods/python-irodsclient Examples...
| Connect To Grid | iPlant | data.iplantcollaborative.org | ${1247} | jdoe | jdoePassword | tempZone
<|file_name|>collections.backgroundStyles.js<|end_file_name|><|fim▁begin|>import collectionClass from "./collections.class"; import collectionColor from "./collections.color"; function collectionBackgroundStyles(contentItem) { return ` .${collectionClass(contentItem)} { background-color: #${collectionColor...
<|file_name|>drcProcess.js<|end_file_name|><|fim▁begin|>/** * drcProcess * Created by dcorns on 1/2/15. */ 'use strict'; var RunApp = require('./runApp'); var Server = require('./server'); var parseInput = require('./parseInput'); var CommandList = require('./commandList'); var runApp = new RunApp(); var cmds = new ...
if(obj.cmd.substr(0, 6) === 'login:'){ cnn.loginID = obj.cmd.substr(6); cnn.write('Welcome ' + cnn.loginID + '\r\n');
<|file_name|>core_commands4.cc<|end_file_name|><|fim▁begin|>/***************************************************************************** * Free42 -- an HP-42S calculator simulator * Copyright (C) 2004-2016 Thomas Okken * * This program is free software; you can redistribute it and/or modify * it under the terms...
<|file_name|>test_upstart.py<|end_file_name|><|fim▁begin|>import collections from mock import MagicMock from mock import call from mock import patch from honcho.test.helpers import TestCase from honcho.export.upstart import Export FakeProcess = collections.namedtuple('FakeProcess', 'name') FIX_1PROC = [FakeProcess...
<|file_name|>task_plot3d.py<|end_file_name|><|fim▁begin|>from taskinit import * from mpl_toolkits.mplot3d import axes3d, Axes3D import matplotlib.pyplot as plt from matplotlib.ticker import LinearLocator, FormatStrFormatter import matplotlib.cm as cm import numpy as np from pylab import ion,ioff # plot3d is released u...
P2[s,t-1] = 0.0
<|file_name|>getgroupmembershipforuser.test.js<|end_file_name|><|fim▁begin|>'use strict' const tap = require('tap') const ActiveDirectory = require('../index') const config = require('./config') const serverFactory = require('./mockServer') const settings = require('./settings').getGroupMembershipForUser tap.beforeEa...
const defaultAttributes = ['objectCategory', 'distinguishedName', 'cn', 'description'] const user = settings.users[0]
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import redirect from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse from paste.models import Paste, Language @csrf_exempt <|fim▁hole|>def add(request): print "jojo" if request.method == 'POST': ...
<|file_name|>binary_search.rs<|end_file_name|><|fim▁begin|>fn main() { let nums = vec![1, 3, 5, 7, 9]; let find_me = 5; let result = binary_search(&nums, find_me, 0, nums.len()); println!("Given Array: {:?}", nums); match result { Some(index) => println!("Searched for {} and found index {}...
let mut right: usize = right;
<|file_name|>typeable.js<|end_file_name|><|fim▁begin|>/*syn@0.1.4#typeable*/ var syn = require('./synthetic.js'); var typeables = []; var __indexOf = [].indexOf || function (item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) { return i; } } ...
} }
<|file_name|>linear_weighted_moving_average.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from pyti import catch_errors from pyti.function_helper import fill_for_noncomputable_vals from six.moves import range def linear_weighted_moving_average(data, period): """ Linear Weighted Moving Average. Formula: ...
from __future__ import absolute_import
<|file_name|>interfaces.py<|end_file_name|><|fim▁begin|># orm/interfaces.py # Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ Contains various base c...
if isinstance(token, str): # wildcard token
<|file_name|>chart.js<|end_file_name|><|fim▁begin|>const chart = { format: '{point.name}: {point.y:,.2f}', colorNames: [ 'success', 'info', 'warning', 'danger', 'primary', 'highlight', 'default' ], colors: [], patterns: [], style: {}, plotOptions: function () { return { series: { animation: fals...
)
<|file_name|>diasql.py<|end_file_name|><|fim▁begin|># PyDia SQL.py : SQL dump. # Copy it to /usr/share/dia/python import dia # import sys # import os import string import re import datetime <|fim▁hole|> self.f = None def begin_render(self, data, filename): self.f = open(filename, "w") # ...
class SQLRenderer: def __init__(self):
<|file_name|>_UpdateSpaceRequest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2013-2021 the original author or 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 * * htt...
@JsonIgnore
<|file_name|>db.py<|end_file_name|><|fim▁begin|>import pickle import redis from pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB __all__ = [ 'get_client', 'cache_object', 'get_object' ] def get_client(): client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB) return client...
def get_object(client, key): data = client.get(key)
<|file_name|>expected.js<|end_file_name|><|fim▁begin|>"use strict";<|fim▁hole|>}); exports.default = function () {}; exports.default = foo; exports.default = 42; exports.default = {}; exports.default = []; exports.default = foo; exports.default = class {}; function foo() {} class Foo {} exports.default = Foo; exports...
Object.defineProperty(exports, "__esModule", { value: true
<|file_name|>environment.js<|end_file_name|><|fim▁begin|>"use strict"<|fim▁hole|> try { mentionBotEnvConfig = JSON.parse(process.env.MENTION_BOT_CONFIG); } catch(e) { mentionBotEnvConfig = {}; } return Object.keys(config).reduce((previousValue, key) => { let defaultConfigValue = config[key]; le...
function checkEnvironmentForConfig(config:Object) : Object { let mentionBotEnvConfig;
<|file_name|>J.cpp<|end_file_name|><|fim▁begin|>#include<bits/stdc++.h> using namespace std; typedef long long LL; LL n,m,A,B,C; LL solve1(LL x,LL y){ LL ans=0; ans+=y*max(max(A,B),C); if(x%2==1){<|fim▁hole|> } return ans; } LL solve2(LL x,LL y){ LL ans=0; ans+=x*min(min(A,B),C); if(y%2==1){ ans+=min((y-1)*(A...
ans+=max((x-1)*(A+C)/2,(x-1)*B); }else{ ans+=max((x-2)*(A+C)/2,(x-2)*B); ans+=max(B,min(A,C));
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and does not ...
<|file_name|>comm_adapters.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/l...
fn test_chan_writer() { let (tx, rx) = channel(); let mut writer = ChanWriter::new(tx); writer.write_be_u32(42).unwrap();
<|file_name|>RegisterUserModel.java<|end_file_name|><|fim▁begin|>package marcin_szyszka.mobileseconndhand.models; /** * Created by marcianno on 2016-03-02. */ public class RegisterUserModel {<|fim▁hole|> public RegisterUserModel(){ } }<|fim▁end|>
public String Email; public String Password; public String ConfirmPassword;
<|file_name|>mnist-visualizations.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # File: mnist-visualizations.py """ The same MNIST ConvNet example, but with weights/activations visualization. """ import tensorflow as tf from tensorpack import * from tensorpack.dataflow import dataset ...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>""" * Copyright (c) 2012-2017, Nic McDonald and Adriana Flores * 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 so...
return version_match.group(1)
<|file_name|>strategy.go<|end_file_name|><|fim▁begin|>// +build linux package network import ( "errors" ) var ( ErrNotValidStrategyType = errors.New("not a valid network strategy type") ) var strategies = map[string]NetworkStrategy{ "veth": &Veth{}, "loopback": &Loopback{},<|fim▁hole|>// NetworkStrategy rep...
}
<|file_name|>MathHelper.java<|end_file_name|><|fim▁begin|>package codechicken.lib.math;<|fim▁hole|>//TODO cleanup. public class MathHelper { public static final double phi = 1.618033988749894; public static final double pi = Math.PI; public static final double todeg = 57.29577951308232; public static f...
import net.minecraft.util.math.BlockPos;
<|file_name|>maptune.GoogleV2.js<|end_file_name|><|fim▁begin|>/********************************************************************** map_GoogleV2.js $Comment: provides JavaScript for Google Api V2 calls $Source :map_GoogleV2.js,v $ $InitialAuthor: guenter richter $ $InitialDate: 2011/01/03 $ $Author: guenter...
} } /**
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright 2014 - Intel. # # 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.o...
name = sa.Column(sa.String(80)) status = sa.Column(sa.String(20), nullable=True, default='init') action_meta = sa.Column(sa.String(200), nullable=True) target_id = sa.Column(sa.String(80))
<|file_name|>index.test-d.ts<|end_file_name|><|fim▁begin|>import {expectType} from 'tsd'; import imageType = require('.'); import {ImageTypeResult, ImageType} from '.'; imageType(Buffer.from([0xff, 0xd8, 0xff])); imageType(new Uint8Array([0xff, 0xd8, 0xff])); expectType<ImageTypeResult | null>(imageType(Buffer.from([...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use super::{Storage, StorageResult, StorageError}; use db::storage::Page; use super::{Row, RowBuilder}; // in memory storage. has a bunch of pages in a vector pub struct Memory { pages: Vec<Page> } impl Memory { pub fn new() -> StorageResult<Memory> { O...
}
<|file_name|>Header.tsx<|end_file_name|><|fim▁begin|>import React, { Component } from 'react'; import styled from 'styled-components'; import Container from './Container';<|fim▁hole|>import TopNav from './TopNav'; import logo from '../assets/images/header-logo.png'; const PaddedContainer = Container.extend` paddin...
<|file_name|>LocalizedString.java<|end_file_name|><|fim▁begin|>package com.ocdsoft.bacta.swg.shared.localization; /**<|fim▁hole|> */ public class LocalizedString { }<|fim▁end|>
* Created by crush on 11/21/2015.
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import argparse import collections import io import json import logging import os # pylint: disable=import-error import queue import random import re import requests import sys import traceback import threading import time from...
<|file_name|>derive_invalid_url.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use juniper::GraphQLScalar; #[derive(GraphQLScalar)] #[graphql(specified_by_url = "not an url", transparent)] struct ScalarSpecifiedByUrl(i64); fn main() {}<|fim▁end|>
<|file_name|>FormPanel.java<|end_file_name|><|fim▁begin|>package view; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; import java.awt.event.F...
String year = yearField.getText(); String color = colorField.getText();
<|file_name|>Acceptor.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional information regarding * copyright ownership. The ASF licenses this file to You under the Apac...
/** * Starts this acceptor thread
<|file_name|>bootstrap_commands.py<|end_file_name|><|fim▁begin|># Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license ...
tarball = "%s/rustc-nightly-%s.tar.gz" % (version, host_triple()) base_url = "https://s3.amazonaws.com/rust-lang-ci/rustc-builds" if not self.config["build"]["llvm-assertions"]:
<|file_name|>net.py<|end_file_name|><|fim▁begin|># # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...