prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>hw6_starter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- u""" Основной скрипт запуска ДЗ. Данный скрипт призван запускать на выполнение домашнее задание #6. """ __author__ = "Elena Sharovar" __date__ = "2014-11-23" from hw6_solution1 import modifier def runner(): ...
runner()
<|file_name|>services.ts<|end_file_name|><|fim▁begin|>// Rethink Services import { UserAvailabilityService } from './rethink/userAvailability.service';<|fim▁hole|>import { ConnectorService } from './rethink/connector.service'; import { RethinkService } from './rethink/rethink.service'; import { ChatService } from './re...
<|file_name|>buck_test.py<|end_file_name|><|fim▁begin|>from buck import format_watchman_query_params, glob_internal, LazyBuildEnvPartial from buck import subdir_glob, BuildFileContext from pathlib import Path, PurePosixPath, PureWindowsPath import os import shutil import tempfile import unittest class FakePathMixin(o...
<|file_name|>DBNNodeExtendable.java<|end_file_name|><|fim▁begin|>/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2022 DBeaver Corp and others * * 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 cop...
import java.util.List;
<|file_name|>box.rs<|end_file_name|><|fim▁begin|>// edition:2021 // run-pass // Test precise capture when using boxes struct MetaData { x: String, name: String } struct Data { m: MetaData } struct BoxedData(Box<Data>); struct EvenMoreBoxedData(Box<BoxedData>); // Mutate disjoint paths, one inside one outside the clo...
let mut c = || {
<|file_name|>rust_completer.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 ycmd contributors # # This file is part of ycmd. # # ycmd 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 th...
response.raise_for_status()
<|file_name|>fill-in.js<|end_file_name|><|fim▁begin|>import getElement from './-get-element'; import isFormControl from './-is-form-control'; import { __focus__ } from './focus'; import settled from '../settled'; import fireEvent from './fire-event'; import { nextTickPromise } from '../-utils'; /** Fill the provided...
}
<|file_name|>TestPlantComment.java<|end_file_name|><|fim▁begin|>package umm3601.plant; import com.mongodb.MongoClient; import com.mongodb.client.FindIterable; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; import org.bson.Document; import org.bson.types.ObjectId; import org.junit.B...
filterDoc.append("_id", new ObjectId("58d1c36efb0cac4e15afd278"));
<|file_name|>_pathfix.py<|end_file_name|><|fim▁begin|>""" Hack to get scripts to run from source checkout without having to set PYTHONPATH. """ import sys from os.path import dirname, join, abspath <|fim▁hole|>project_path = abspath(join(db_path, "..")) sys.path.insert(0, project_path)<|fim▁end|>
db_path = dirname(__file__)
<|file_name|>app.js<|end_file_name|><|fim▁begin|>MapSearchApp.init = function () { var realEstates = MapSearchApp.Repositories.realEstateRepository.getAll(); var pageView = new MapSearchApp.Views.PageView({ collection: realEstates });<|fim▁hole|> MapSearchApp.trigger("afterRender"); }; $(functio...
pageView.render(); $(".js-app").html(pageView.$el);
<|file_name|>SupplementalInfoRetriever.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2010 ZXing 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.apach...
final void append(String itemID, String source, String[] newTexts, String linkURL) { StringBuilder newTextCombined = new StringBuilder();
<|file_name|>api_demo_pdos_broadening.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt plt.style.use("seaborn-colorblind") import galore import galore.plot vasprun = './test/MgO/vasprun.xml.gz' xmin, xmax = (-10, 2) fig = plt.figure() for i, l in enumerate(n...
plotting_data = galore.process_pdos(input=[vasprun], lorentzian=l, xmin=xmin, xmax=xmax) galore.plot.plot_pdos(plotting_data, ax=ax) ax.legend().set_visible(False)
<|file_name|>ControllerMain.py<|end_file_name|><|fim▁begin|>""" Main controller. """ import json from Server.Importer import ImportFromModule class ControllerMain(ImportFromModule("Server.ControllerBase", "ControllerBase")): """ Main controller. """ def ShowPage(self, uriParameters, postedParamet...
Echo the incomming text. """ self.SetOutput(json.dumps(uriParameters, indent=4))
<|file_name|>31.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from typing import List """ 31. Next Permutation https://leetcode.com/problems/next-permutation/ """ class Solution: def nextPermutation(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. ...
def main(): sol = Solution()
<|file_name|>TheSpidersWeb.js<|end_file_name|><|fim▁begin|>const PlotCard = require('../../plotcard.js'); class TheSpidersWeb extends PlotCard { setupCardAbilities(ability) { this.reaction({ limit: ability.limit.perPhase(1), when: { onClaimApplied: event => event.pla...
this.untilEndOfPhase(ability => ({ targetController: 'current', effect: ability.effects.mayInitiateAdditionalChallenge('intrigue')
<|file_name|>k8s_openstack_monitor_manager.py<|end_file_name|><|fim▁begin|># coding: utf-8 import threading import time from datetime import datetime from flask import Flask from influxdb import InfluxDBClient from oslo_service import periodic_task from oslo_config import cfg from oslo_log import log from oslo_servi...
"fields": { "value": metrics["value"], }
<|file_name|>test_container_acl_negative.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # 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 # ...
@classmethod def resource_setup(cls): super(ObjectACLsNegativeTest, cls).resource_setup() cls.test_auth_data = cls.os_operator.auth_provider.auth_data
<|file_name|>deeplearning_examplerun.py<|end_file_name|><|fim▁begin|># Specify the response and predictor columns y = "C785" x = train.names[0:784] # We encode the response column as categorical for multinomial classification train[y] = train[y].asfactor() test[y] = test[y].asfactor() # Train a Deep Learning model an...
epochs=10)
<|file_name|>videoframe.rs<|end_file_name|><|fim▁begin|>use buffer::Buffer; use ffi::*; use std::mem; use std::slice::from_raw_parts; pub struct VideoFrame{ vf: GstVideoFrame, buffer: Buffer } pub struct VideoPlane<'a>{ vf: &'a GstVideoFrame, p: usize } pub struct VideoComponent<'a>{ vf: &'a GstVideoFrame...
<|file_name|>json.rs<|end_file_name|><|fim▁begin|>#[derive(Debug, Deserialize)] /// A user object returned from the API pub struct User{ /// The username of the user pub username: String } #[derive(Debug, Deserialize)] /// An object containing the ID of something newly created pub struct Id<T> { /// The ID...
use ::errors::HueError;
<|file_name|>network_benches.rs<|end_file_name|><|fim▁begin|>#![feature(test)] extern crate test; #[macro_use] extern crate timeit; extern crate collenchyma as co; extern crate leaf; #[cfg(feature = "cuda")] mod cuda { use test::Bencher; use co::prelude::*; use std::sync::{Arc, RwLock}; use leaf::lay...
// Layer: conv4/relu let mut conv4_relu_cfg = LayerConfig::new("conv4/relu", LayerType::ReLU); conv4_relu_cfg.add_input("conv4_preac");
<|file_name|>junos_config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type A...
else:
<|file_name|>cascade_mask_rcnn_x101_32x8d_fpn_mstrain_3x_coco.py<|end_file_name|><|fim▁begin|>_base_ = './cascade_mask_rcnn_r50_fpn_mstrain_3x_coco.py' model = dict( backbone=dict( type='ResNeXt', depth=101, groups=32, base_width=8, num_stages=4, out_indices=(0, 1, 2...
dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32),
<|file_name|>issue5358.go<|end_file_name|><|fim▁begin|>// errorcheck // Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // issue 5358: incorrect error message when using f(g()) form on ... args. package main ...
}
<|file_name|>ambiguity.rs<|end_file_name|><|fim▁begin|>// edition:2018 #![allow(non_camel_case_types)] use std::io; //~^ ERROR `std` is ambiguous <|fim▁hole|> pub struct io; } fn main() {}<|fim▁end|>
mod std {
<|file_name|>PluginException.java<|end_file_name|><|fim▁begin|>package org.eso.ias.plugin; /** * The exception returned by the Plugin * @author acaproni * */ public class PluginException extends Exception { public PluginException() { } public PluginException(String message) { super(message); } public Plu...
}
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>//jshint strict: false module.exports = function(config) { config.set({ basePath: './app', files: [ 'bower_components/angular/angular.js', 'bower_components/angular-route/angular-route.js', 'bower_components/angular-mocks/angular-mock...
], autoWatch: true,
<|file_name|>sti_incremental.go<|end_file_name|><|fim▁begin|>package builds import ( "fmt" "path/filepath" "strings" "time" g "github.com/onsi/ginkgo" o "github.com/onsi/gomega" "k8s.io/kubernetes/test/e2e" exutil "github.com/openshift/origin/test/extended/util" ) var _ = g.Describe("default: S2I incrementa...
o.Expect(err).NotTo(o.HaveOccurred()) g.By("starting a test build using the image produced by the last build")
<|file_name|>prefixed_command_runner.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import os import os.path import subprocess<|fim▁hole|>from pre_commit.util import cmd_output class PrefixedCommandRunner(object): """A PrefixedCommandRunner allows you to run subprocess commands with ...
<|file_name|>selection.rs<|end_file_name|><|fim▁begin|>use crate::session::{Session, State, AES_IV_LEN}; use log::{debug, error}; use protocol::messages::connection::ServerSelectionMessage; impl Session { pub async fn select_server(&mut self, server_id: i16) -> std::io::Result<u8> { use protocol::constants...
.map(|gs| gs.status())
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Copyright 2019 Authors of Cilium //<|fim▁hole|>// You may obtain a copy of the License at // // 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 ...
// Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.
<|file_name|>CallbackGenerator.java<|end_file_name|><|fim▁begin|>/* * Copyright 2003,2004 The Apache Software Foundation * * 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:...
* See the License for the specific language governing permissions and
<|file_name|>jsx.js<|end_file_name|><|fim▁begin|>function foo() { throw <Bar />; } function foo() {<|fim▁hole|> function foo() { throw <Bar baz={baz} />; } function foo() { throw <Bar baz={baz}>foo</Bar>; } function foo() { throw <></>; } function foo() { throw <>foo</>; }<|fim▁end|>
throw <Bar>baz</Bar>; }
<|file_name|>populate.py<|end_file_name|><|fim▁begin|># The MIT License (MIT) # Copyright (c) 2014-2015 CNRS # 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 w...
# create new corpus
<|file_name|>codegen.rs<|end_file_name|><|fim▁begin|>#![feature(plugin_registrar, rustc_private, slice_patterns, plugin)] #![plugin(quasi_macros)] extern crate rustc_plugin; extern crate syntax; #[macro_use] extern crate lazy_static; extern crate quasi; use std::collections::HashMap; use std::sync::Mutex; use syntax...
}
<|file_name|>Database.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- __author__ = 'Sean Yu' __mail__ = 'try.dash.now@gmail.com' import sqlite3 def CreateTable(dbname, table,table_define): db = sqlite3.connect(dbname) cu=db.cursor() cu.execute("""create table %s ( %s )"""%(table,table_define)) ...
result=None
<|file_name|>make_interpolator.cc<|end_file_name|><|fim▁begin|>#include "estimation/sensors/make_interpolator.hh" namespace estimation { geometry::spatial::TimeInterpolator make_accel_interpolator( const std::vector<TimedMeasurement<jet_filter::AccelMeasurement>>& accel_meas, const ImuModel& imu_model)...
<|file_name|>console.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2019 Jason White // // 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 limitation ...
Ok(())
<|file_name|>test_security_group.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation # # 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.apach...
# 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 CONDITIONS OF ANY KIND, either express or implied. See the
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::io; use std::fmt; use std::error::Error; /// Result type for using with [`EmuleadError`]. pub type EmuleadResult<T> = Result<T, EmuleadError>; /// Error type using for the project errors. #[derive(Debug)] pub enum EmuleadError { /// IO Error Io(io::E...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate plugin_system; use plugin_system::{M, Pluggable, Plugin1Options, Plugins}; use std::thread; use std::time::Duration; fn main() { let m = M::new(); let mut pl_app = Pluggable::new(m); pl_app.load_plugin(Plugins::Plugin1(Plugin1Options::new(1)));...
pl_app.stop(); }
<|file_name|>bg.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'iframe', 'bg', { border: 'Показва рамка на карето', noUrl: 'Моля въведете...
toolbar: 'IFrame' } );
<|file_name|>allocator_stats.hpp<|end_file_name|><|fim▁begin|>// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #ifndef OPENCV_CORE_ALLOCATOR_STATS_HPP #define OPENCV_CORE_ALL...
<|file_name|>Recognizer.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2012-2016 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # from antlr4.RuleContext import RuleContext from antlr4.Token import To...
# consistent with the ATN state passed in. This way we always know # where we are in the ATN as the parser goes along. The rule
<|file_name|>product.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from odoo.exceptions import ValidationError from odoo import models, api, _ <|fim▁hole|> """ Copy the function from product_configurator to show price using price list. To Fix : - Extra price For Attribute value - ...
class ProductProduct(models.Model): _inherit = 'product.product' _rec_name = 'config_name'
<|file_name|>day_01.rs<|end_file_name|><|fim▁begin|>use std::iter::FromIterator; type Link<T> = Option<Box<Node<T>>>; struct Node<T> { item: T, next: Link<T>, } impl <T> Node<T> { fn new(item: T, next: Link<T>) -> Link<T> { Some(Box::new(Node { item, next })) } } pub struct Stack<T> { he...
}) }
<|file_name|>store_test.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from __future__ import unicode_literals import io import os.path import sqlite3 import mock import pytest import six from pre_commit.store import _get_default_directory from pre_commit.store import Store from pre_commit.ut...
ret = _get_default_directory() assert ret == os.path.join(os.path.expanduser('~/.cache'), 'pre-commit')
<|file_name|>charity_repository_test.py<|end_file_name|><|fim▁begin|>from givabit.backend.charity import Charity from givabit.backend.errors import MissingValueException, MultipleValueException from givabit.test_common import test_data from givabit.test_common import test_utils class CharityRepositoryTest(test_utils....
self.all_charities = [test_data.c1, test_data.c2, test_data.c3, test_data.c4]
<|file_name|>prefixes.js<|end_file_name|><|fim▁begin|>(function() { var add, crispedges, feature, flexbox, fullscreen, gradients, logicalProps, prefix, readOnly, resolution, result, sort, writingMode, slice = [].slice; sort = function(array) { return array.sort(function(a, b) { var d; a = a.spl...
for (version in versions) { support = versions[version];
<|file_name|>Shapes.java<|end_file_name|><|fim▁begin|>/* * www.javagl.de - Flow * * Copyright (c) 2012-2017 Marco Hutter - http://www.javagl.de * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to dea...
<|file_name|>multichecksum.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __author__ = "Andrew Hankinson (andrew.hankinson@mail.mcgill.ca)" __version__ = "1.5" __date__ = "2011" __copyright__ = "Creative Commons Attribution" __license__ = """The MIT License Permission is hereby granted, free of...
usage = "%prog [options] arg1 arg2" parser.add_option("-a", "--algorithm", action="store", help="checksum algorithm to use (sha1|md5)") parser.add_option("-c", "--encoding", action="store", help="File encoding to write manifest") parser.add_option("-u", "--update", action="store_true", help="Only update...
<|file_name|>gear.js<|end_file_name|><|fim▁begin|>'use strict'; angular.module('myApp.gear', ['ngRoute']) <|fim▁hole|>.config(['$routeProvider', function($routeProvider) { $routeProvider.when('/gear', { templateUrl: 'gear/gear.html', controller: 'GearCtrl' }); }]) .controller('GearCtrl', ['$scope','$http'...
<|file_name|>chrome_version_info.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "chrome/common/chrome_version_info.h" #include "base/basictypes.h" #include...
std::string VersionInfo::ChromiumReleaseVersion() const { return CHROMIUM_RELEASE_VERSION; }
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # -*- coding: utf-8 -*- from __future__ import print_function import datetime import glob import os import re import sys import subprocess from picard import __version__, compat if sys.version_info < (2, 6): print("*** You need Python 2.6 o...
if not message.id or not isinstance(message.id, unicode): continue
<|file_name|>interfaces.go<|end_file_name|><|fim▁begin|>package batchaiapi // Copyright (c) Microsoft and contributors. 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...
<|file_name|>let_statement.rs<|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...
fn parses_let_statement_with_number_expression() { let mut parser = Parser::new(Lexer::new("let l:var = 15"));
<|file_name|>request.rs<|end_file_name|><|fim▁begin|>//! AWS API requests. //! //! Wraps the Hyper library to send PUT, POST, DELETE and GET requests. extern crate lazy_static; use std::env; use std::io::Read; use std::io::Error as IoError; use std::error::Error; use std::fmt; use std::collections::HashMap; use hype...
} if log_enabled!(Debug) { let payload = request.payload().map(|mut payload_bytes| {
<|file_name|>issue-27949.rs<|end_file_name|><|fim▁begin|>// run-pass // // At one time, the `==` operator (and other binary operators) did not // support subtyping during type checking, and would therefore require // LHS and RHS to be exactly identical--i.e. to have the same lifetimes. // // This was fixed in 1a7fb7dc7...
<|file_name|>dropletConfig.js<|end_file_name|><|fim▁begin|>var msg = require('./locale'); var api = require('./apiJavascript.js'); var paramLists = require('./paramLists.js'); module.exports.blocks = [ {func: 'setDroid', parent: api, category: '', params: ['"R2-D2"'], dropdown: { 0: ['"random"', '"R2-D2"', '"C-3PO"'...
{func: 'setSpritePosition', parent: api, category: '', params: ["0", "7"], noAutocomplete: true },
<|file_name|>decode_codepoint.d.ts<|end_file_name|><|fim▁begin|>export default function decodeCodePoint(codePoint: number): string;<|fim▁hole|><|fim▁end|>
//# sourceMappingURL=decode_codepoint.d.ts.map
<|file_name|>queued.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2016 Sandstorm Development Group, Inc. and contributors // Licensed under the MIT License: // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"),...
fn new_call(&self, interface_id: u64, method_id: u16,
<|file_name|>subst.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/...
// The root type that is being substituted, if available. root_ty: Option<Ty<'tcx>>, // Depth of type stack
<|file_name|>test_db.py<|end_file_name|><|fim▁begin|>""" The following tests that db connections works properly. Make sure the default configurations match your connection to the database<|fim▁hole|> from StreamingSQL.db import create_connection, execute_command from StreamingSQL.fonts import Colors, Formats """Defaul...
""" import pymysql import warnings warnings.filterwarnings("ignore")
<|file_name|>ViewModelGlideRequest.java<|end_file_name|><|fim▁begin|>package com.ov3rk1ll.kinocast.ui.util.glide; import com.ov3rk1ll.kinocast.data.ViewModel; <|fim▁hole|> private String type; public ViewModelGlideRequest(ViewModel viewModel, int screenWidthPx, String type) { this.viewModel = viewMode...
public class ViewModelGlideRequest { private ViewModel viewModel; private int screenWidthPx;
<|file_name|>sandbox_mixture_slf.py<|end_file_name|><|fim▁begin|>import numpy as np from snob import mixture_slf as slf n_samples, n_features, n_clusters, rank = 1000, 50, 6, 1 sigma = 0.5 true_homo_specific_variances = sigma**2 * np.ones((1, n_features)) rng = np.random.RandomState(321) U, _, _ = np.linalg.svd(r...
true_means = rng.randn(n_clusters, n_features) for index in range(n_clusters): X[indices==index] += true_means[index]
<|file_name|>plugin.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2008- Samuli JŠrvelŠ * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse....
wd.close(); if (code == 205) { that.env.dialog().showConfirmation({
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> 10 }<|fim▁end|>
#[no_mangle] pub extern fn rust_hello_world() -> i32 { println!("Hello, I'm in Rust code! I'm about to return 10.");
<|file_name|>14balt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ Find characters deep in the expanded string, for fun. """ import sys from collections import Counter def real_step(s, rules): out = "" for i in range(len(s)): out += s[i] k = s[i:i+2] if k in rules: ...
else: s = real_step(s[h:], rules) idx -= sz - 1
<|file_name|>sendkeys_test.py<|end_file_name|><|fim▁begin|>import os import sys import random import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test repo_root = os.path.abspath(os.path.join(__file__, "../../..")) sys.path.insert(1, os.path.join(repo_root, "tools", "webdr...
if __name__ == "__main__":
<|file_name|>NativeCarbon.cc<|end_file_name|><|fim▁begin|>// Copyright 2010 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-...
0, kHIThemeTextTruncationNone, 0, false }; CFStringRef title = ::HIViewCopyText(view_ref_); float width, height;
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const admin = require('firebase-admin'); const DATABASE_URL = process.env.DATABASE_URL || 'https://dailyjack-8a930.firebaseio.com'; // const DATABASE_URL = 'https://dailyjack-d2fa0.firebaseio.com'; const jackDB = (config = {}) => { const app = admin.initializeApp({...
.transaction(rate => (rate ? null : true)) );
<|file_name|>TrikSonarSensor.ts<|end_file_name|><|fim▁begin|>/* * Copyright Vladimir Zakharov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.<|fim▁hole|> * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required...
* You may obtain a copy of the License at
<|file_name|>test_mlab_on_unix.py<|end_file_name|><|fim▁begin|>import sys sys.path = ['../src/'] + sys.path import unittest from mlab.mlabwrap import MatlabReleaseNotFound class TestMlabUnix(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_version_discovery(se...
assert len(instances.pick_latest_release()) > 0 with self.assertRaises(MatlabReleaseNotFound): mlab_inst = instances.get_mlab_instance('R2010c')
<|file_name|>inferno.js<|end_file_name|><|fim▁begin|>/*! * inferno v0.7.3 * (c) 2016 Dominic Gannaway * Released under the MPL-2.0 License. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? defi...
} : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
<|file_name|>Practica1Conver.py<|end_file_name|><|fim▁begin|>def main(): print "hola" print "Como te llmas?" nombre = raw_input() print "Buenos dias", nombre print "Que edad tienes?" edad = raw_input()<|fim▁hole|><|fim▁end|>
print "que bien te conservas para tener", edad main()
<|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/. */ #![deny(unsafe_code)] extern crate gfx; extern crate ipc_channel...
<|file_name|>filename.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # Copyright 2014 Simone Campagna # # 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/l...
<|file_name|>IframeMousetrap.js<|end_file_name|><|fim▁begin|>define(['mousetrap'], function(Mousetrap){ 'use strict'; var utils = require('util'), instances = [] ; function IframeMousetrap(a){ var self = new Mousetrap(a); /*self._instanceId = instances.push(this); self._originalHandleKey =...
self._handleKey = IframeMousetrap.prototype._handleKey;*/ self.handleKey = IframeMousetrap.prototype.handleKey; self.shutdown = IframeMousetrap.prototype.shutdown;
<|file_name|>geometry.py<|end_file_name|><|fim▁begin|>import os import json import arcpy import types import general from .._abstract import abstract ######################################################################## class SpatialReference(abstract.AbstractGeometry): """ creates a spatial reference instance "...
<|file_name|>extrameta.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime import hashlib from scrapy_proj.helpers import * class SanatatePipelineExtraMeta(object):<|fim▁hole|> if act_type == None: raise scrapy.exceptions.DropItem item['type'] = act_type engrol ...
def process_item(self, item, spider): item['institution'] = spider.name act_type = LegalHelper.get_type_from_title(item['title'])
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate syntex; extern crate syntex_syntax; use syntex::Registry; use syntex_syntax::ast; use syntex_syntax::codemap::Span; use syntex_syntax::ext::base::{ExtCtxt, MacEager, MacResult};<|fim▁hole|>use syntex_syntax::parse::token::InternedString; pub fn expand_hel...
use syntex_syntax::ext::build::AstBuilder;
<|file_name|>cmd_list.py<|end_file_name|><|fim▁begin|>import click from do_cli.contexts import CTX from do_cli.commands.common import host_commands @click.command('list') @click.option('-f', '--force-refresh', is_flag=True, help='Pull data from the API') @click.option('-h', '--host-names', help='Comma separated list ...
--host-names -h Comma separated list of host names
<|file_name|>blottner_viscosity_unit.C<|end_file_name|><|fim▁begin|>//-----------------------------------------------------------------------bl- //-------------------------------------------------------------------------- // // Antioch - A Gas Dynamics Thermochemistry Library // // Copyright (C) 2013 The PECOS Developm...
mu.reset_coeffs( a2, b2, c2 );
<|file_name|>content_encoding.rs<|end_file_name|><|fim▁begin|>use brotli::enc::backward_references::{BrotliEncoderParams, BrotliEncoderMode}; use brotli::enc::BrotliCompress as brotli_compress; use flate2::write::{DeflateEncoder, GzEncoder}; use flate2::Compression as Flate2Compression; use iron::headers::{QualityItem,...
fn $str_fn_name(dt: &str) -> Option<Vec<u8>> { let mut cmp = $constructor(Vec::new()); cmp.write_all(dt.as_bytes()).ok().and_then(|_| cmp.finish().ok())
<|file_name|>test_new_instance.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.models import User from django.test import TestCase, Client from django.urls import reverse # Declaration of Username and Password username = 'admin' password = 'Test1234$' """ Method to replicate ~~~~~~~~~~~~~~~~~~~ 1. Bring up a...
2. Try and log in as the admin user Expected Results
<|file_name|>year.rs<|end_file_name|><|fim▁begin|>// // imag - the personal information management suite for the commandline // Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Les...
end >= *dt }); let tags_filter = move |fle: &FileLockEntry| {
<|file_name|>solr_query_integration_tests.rs<|end_file_name|><|fim▁begin|>extern crate url; extern crate heliotrope; use url::Url; use heliotrope::{SolrClient, SolrQuery}; <|fim▁hole|> #[test] fn simple_query_test() { let url = Url::parse("http://localhost:8983/solr/test/").unwrap(); let client = SolrClient::n...
<|file_name|>TDNode.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010, 2011, 2012 mapsforge.org * * 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,...
<|file_name|>header.dist.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go from "header.proto" // DO NOT EDIT! package protorpc import proto "goprotobuf.googlecode.com/hg/proto" import "os" // Reference proto & os imports to suppress error if it's not otherwise used. var _ = proto.GetString var _ os...
}
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>$(function () { // Prepare demo data var data = [ { "hc-key": "dm-lu", "value": 0 }, { "hc-key": "dm-ma", "value": 1 }, { "hc-key": "dm-pk", "value":...
},
<|file_name|>blob_storage.rs<|end_file_name|><|fim▁begin|>extern crate futures; use indy::IndyError;<|fim▁hole|> pub fn open_reader(type_: &str, config_json: &str) -> Result<i32, IndyError> { blob_storage::open_reader(type_, config_json).wait() } pub fn open_writer(type_: &str, config_json: &str) -> Result<i32, I...
use indy::blob_storage; use self::futures::Future;
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var sourcemaps = require('gulp-sourcemaps'); var source = require('vinyl-source-stream'); var buffer = require('vinyl-buffer'); var browserify = require('browserify'); var watchify = require('watchify'); var babel = require('babelify'); v...
}); gulp.task('default', ['templates', 'vendor', 'styles', 'icons', 'connect', 'watch']);
<|file_name|>InputChannelTemplate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import print_function # Form implementation generated from reading ui file 'InputChannelTemplate.ui' # # Created: Sun Feb 22 13:29:16 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in...
font.setBold(False) font.setWeight(50)
<|file_name|>TurnTest.java<|end_file_name|><|fim▁begin|>package ru.istolbov; import org.junit.Test; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertThat; /** * Test. * @author istolbov * @version $Id$ */ public class TurnTest { /** * Test turn back array. */ @Test public...
final int[] resultArray = turn.back(testArray); assertThat(resultArray, is(targetArray)); } /**
<|file_name|>test_logging.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Copyright 2001-2012 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright no...
# Test %-formatting r = self.get_record()
<|file_name|>improc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Image processing and feature extraction functions. """ import cv2 import numpy as np def pad_image(im, width, height, border=255): """pad char image in a larger image""" xoff = abs(int((im.shape[1] - width) / 2)) yoff = ab...
# cv2.imshow("image", image)
<|file_name|>common.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import getopt import json import locale import os import re import sys from urllib import request, parse import platform import threading from .version import __version__ from .util import log, sogou_proxy_server, get_filename, unescape_html d...
def ungzip(data):
<|file_name|>update-plugin.ts<|end_file_name|><|fim▁begin|>import {PluginBase, Workflow, StepNode} from "cwl-svg"; import {AppHelper} from "../../../core/helpers/AppHelper"; import {StepModel} from "cwlts/models"; export class UpdatePlugin extends PluginBase { private css = { plugin: "__plugin-updat...
return; }
<|file_name|>loop_control.py<|end_file_name|><|fim▁begin|>def main():<|fim▁hole|> print(c, end='') else: print(' else') print() for i in range(10, 0, -1): print(i, end=' ') if __name__ == "__main__": main()<|fim▁end|>
s = 'this is a string' for c in s:
<|file_name|>test_api_utils.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 NTT, OpenStack Foundation # # 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/license...
class TestAPIUtils(base.SqlTestCase):