prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>pipette_config.py<|end_file_name|><|fim▁begin|>from __future__ import annotations from dataclasses import dataclass import logging import json import numbers from typing import (Any, Dict, List, Union, Tuple, Sequence, TYPE_CHECKING) from opentrons import config from opentrons.config i...
# meant for use-cases where we may only be given an update
<|file_name|>deployment.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 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 Unl...
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. func (c *deployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{}
<|file_name|>swf.js<|end_file_name|><|fim▁begin|>YUI.add('swf', function (Y, NAME) { /** * Embed a Flash applications in a standard manner and communicate with it * via External Interface. * @module swf */ var Event = Y.Event, SWFDetect = Y.SWFDetect, Lang = Y.Lang, uA = Y.UA, ...
} } /**
<|file_name|>test_itempage.py<|end_file_name|><|fim▁begin|>import unittest import json import os from pywikibase import ItemPage, Claim try: unicode = unicode except NameError: basestring = (str, bytes) class TestItemPage(unittest.TestCase): def setUp(self): with open(os.path.join(os.path.split...
<|file_name|>nocompile_driver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (c) 2011 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. """Implements a simple "negative compile" test for C++ on linux. Som...
'suite_name': config['suite_name'], 'terminate_timeout': now + NCTEST_TERMINATE_TIMEOUT_SEC,
<|file_name|>drop.rs<|end_file_name|><|fim▁begin|>struct Droppable { name: &'static str, } // This trivial implementation of `drop` adds a print to console. impl Drop for Droppable { fn drop(&mut self) { println!("> Dropping {}", self.name); } } fn main() { let _a = Droppable { name: "a" }; ...
{
<|file_name|>S163_L641_MissingRange.py<|end_file_name|><|fim▁begin|>''' Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges. Have you met this question in a real interview? Example Example 1 Input: nums = [0, 1, 3, 50, 75], lower = 0 and uppe...
return r
<|file_name|>DataControl.js<|end_file_name|><|fim▁begin|>class DataControl { constructor() { this.appData updateData() } updateData() { this.appData = fetcherama()<|fim▁hole|> lib.fetch(`http://localhost:8080/api/class/getNearbyClasses/${coor.long}/${coor.lat}`, opt, data => { if (data.suc...
} fetcherama() {
<|file_name|>extern.rs<|end_file_name|><|fim▁begin|>#[repr(C)] struct Normal { x: i32, y: f32, }<|fim▁hole|> fn bar(a: Normal); }<|fim▁end|>
extern "C" { fn foo() -> i32;
<|file_name|>test_freebase_support_query.py<|end_file_name|><|fim▁begin|># # Copyright 2012 Markus Pielmeier # # This file is part of tagfs. #<|fim▁hole|># 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 your option) any late...
# tagfs is free software: you can redistribute it and/or modify
<|file_name|>storageprovisioner_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package storageprovisioner_test import ( "sort" "github.com/juju/errors" "github.com/juju/names" jc "github.com/juju/testing/checkers" gc "gopkg.in/ch...
Message: `filesystem attachment "2" on "0" not provisioned`,
<|file_name|>module.js<|end_file_name|><|fim▁begin|>/** * @module ngeo.routing.module */ import ngeoRoutingRoutingComponent from 'ngeo/routing/RoutingComponent.js'; import './routing.less'; /** * @type {angular.Module} */ const exports = angular.module('ngeoRoutingModule', [ ngeoRoutingRoutingComponent.module.n...
export default exports;
<|file_name|>AnalyticsMetadataTypeJsonUnmarshaller.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014-2019 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...
<|file_name|>sessionQuizView.tsx<|end_file_name|><|fim▁begin|>import * as React from "react"; import { connect } from "react-redux"; import { Link } from "react-router" import * as MediaQuery from "react-responsive" import DashboardContainer from "../../containers/dashboard/dashboardContainer" import PresentationConta...
type Props = StateProps & ActionProps; export class View extends React.Component<Props, any> {
<|file_name|>native.go<|end_file_name|><|fim▁begin|>// Copyright 2019 Jeremy Edwards // // 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|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RGdsfmt(RPackage): """R Interface to ...
<|file_name|>trace_macros.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/li...
<|file_name|>activity.py<|end_file_name|><|fim▁begin|>""" The MIT License (MIT) Copyright (c) 2015-present Rapptz 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 wi...
<|file_name|>flat-map-observable-scalar.js<|end_file_name|><|fim▁begin|>var RxOld = require("rx"); var RxNew = require("../../../../index"); module.exports = function (suite) { var oldFlatMapWithCurrentThreadScheduler = RxOld.Observable.range(0, 25, RxOld.Scheduler.currentThread).flatMap(RxOld.Observable.return(0...
}) .add('new flatMap (scalar Observable) with current thread scheduler', function () {
<|file_name|>TestController.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in ...
sys.stdout.write("removing trust settings for the HTTP server certificate... ") sys.stdout.flush()
<|file_name|>httpd_test.go<|end_file_name|><|fim▁begin|>// Copyright 2020 The gVisor 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/LICE...
Name: "concurrency",
<|file_name|>run_deploy_jar_intergration_test.py<|end_file_name|><|fim▁begin|># Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import textwrap from textwrap import dedent from pants.engine.internals.native_engine import FileDigest from p...
result = run_pants(args)
<|file_name|>InternalFilter.java<|end_file_name|><|fim▁begin|>/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache Li...
return new InternalFilter(name, docCount, subAggregations); }
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>from django.test import TestCase<|fim▁hole|>from morelia.decorators import tags from smarttest.decorators import no_db_testcase from tasks.factories import TaskFactory, UserFactory @no_db_testcase @tags(['unit']) class TaskGetAbsoluteUrlTest(TestCase): '''...
<|file_name|>MemoDao.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * This file is part of OpenNMS(R). * * Copyright (C) 2012 The OpenNMS Group, Inc. * OpenNMS(R) is Copyright (C) 1999-2012 The OpenNMS Group, Inc. * * OpenNMS(R) is a registered t...
* OpenNMS(R) is distributed in the hope that it will be useful,
<|file_name|>app.js<|end_file_name|><|fim▁begin|>(function() { function config($stateProvider, $locationProvider) { $locationProvider .html5Mode({ enabled: true, requireBase: false }); $stateProvider .state('landing', { ...
<|file_name|>client_json.rs<|end_file_name|><|fim▁begin|>#![deny(warnings)] extern crate hyper; #[macro_use] extern crate serde_derive; extern crate serde; extern crate serde_json; use hyper::Client; use hyper::rt::{self, Future, Stream}; fn main() { let url = "http://jsonplaceholder.typicode.com/users".parse().u...
<|file_name|>arithmetic.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate nom; use nom::{IResult,digit}; // Parser definition use std::str; use std::str::FromStr; // We parse any expr surrounded by parens, ignoring all whitespaces around those named!(parens<i64>, ws!(delimited!( tag!("("), expr, tag!(")") )...
// We read an initial factor and for each time we find // a * or / operator followed by another factor, we do // the math by folding everything
<|file_name|>arffio.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python ''' Arff loader for categorical and numerical attributes, based on scipy.io.arff.arffloader With minor changes for this project (eg. categorical attributes are mapped onto integers and whole dataset is returned as numpy array of floats) If any ...
while not rows or rows[0][0] == '%': raw = row_iter.next() rows = raw.split(delim)
<|file_name|>typescript.js<|end_file_name|><|fim▁begin|>define("ace/snippets/typescript",["require","exports","module"],function(e,t,n){"use strict";t.snippetText="",t.scope="typescript"}); (function() { window.require(["ace/snippets/typescript"], function(m) { ...
module.exports = m; } }); })();
<|file_name|>makeseeds.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Generate pnSeed[] from Pieter's DNS seeder # NSEEDS=600 import re import sys from subprocess import check_output def main(): lines = sys.stdin.readlines() ips = [] pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\...
<|file_name|>ensurePositiveDelayProps.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) Facebook, Inc. and its affiliates. *<|fim▁hole|> * */ import invariant from 'fbjs/lib/invariant'; var ensurePositiveDelayProps = function ensurePositiveDelayProps(props) { invariant(!(props.delayPressIn < 0 || props.delayPr...
* This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. *
<|file_name|>65.test.js<|end_file_name|><|fim▁begin|>import test from 'ava'; import Server from '../../src/server'; import IO from '../../src/socket-io'; test.cb('mock socket invokes each handler with unique reference', t => { const socketUrl = 'ws://roomy'; const server = new Server(socketUrl); const socket = n...
socket.on('custom-event', handler3); // not expected socket.on('connect', () => {
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import re import subprocess import sys import tempfile CC = "gcc" CFLAGS = "-fmax-errors=4 -std=c99 -pipe -D_POSIX_C_SOURCE=200809L -W -Wall -Wno-unused-variable -Wno-unused-parameter -Wno-unused-label -Wno-unused-value -Wno-unused...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from __future__ import with_statement #------------------------------------------------------------------------------- import unittest from xml.etree.ElementTree import fromstring #----------------------------------------------------------...
x = XMLBuilder('utf-8',format = True) with x.root():
<|file_name|>personResult.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behav...
serializedName: 'persistedFaceIds', type: { name: 'Sequence',
<|file_name|>cache.rs<|end_file_name|><|fim▁begin|>#[serde(rename_all = "camelCase")] #[derive(Debug, Deserialize, Serialize)] pub struct PurgeOptions { pub max_age: Option<i32>,<|fim▁hole|>pub struct GetCacheOptions { pub no_cache: Option<bool>, // Skip usage of cache, pub no_update: Option<bool>, /...
} #[serde(rename_all = "camelCase")] #[derive(Debug, Deserialize, Serialize, Clone)]
<|file_name|>ooc.tsx<|end_file_name|><|fim▁begin|>import { FeatureColorInput, Feature } from "../base"; <|fim▁hole|> description: "The color of your OOC messages.", component: FeatureColorInput, };<|fim▁end|>
export const ooccolor: Feature<string> = { name: "OOC color", category: "CHAT",
<|file_name|>mongodb_data_test.go<|end_file_name|><|fim▁begin|>package mongodb import ( "testing" "time" "github.com/influxdata/telegraf/testutil" "github.com/stretchr/testify/assert"<|fim▁hole|> func TestAddNonReplStats(t *testing.T) { d := NewMongodbData( &StatLine{ StorageEngine: "", Time: ...
) var tags = make(map[string]string)
<|file_name|>grpc_version.py<|end_file_name|><|fim▁begin|># Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are<|fim▁hole|># # * Redistributions of source code must retain t...
# met:
<|file_name|>hosts_test.go<|end_file_name|><|fim▁begin|>package opts import ( "fmt" "testing" ) func TestParseHost(t *testing.T) { invalid := []string{ "anything", "something with spaces", "://", "unknown://", "tcp://:port", "tcp://invalid", "tcp://invalid:port", } valid := map[string]string{ ""...
"0.0.0.0": "Invalid bind address format: 0.0.0.0", "tcp:a.b.c.d": "Invalid bind address format: tcp:a.b.c.d", "tcp:a.b.c.d/path": "Invalid bind address format: tcp:a.b.c.d/path",
<|file_name|>MIEApplication.java<|end_file_name|><|fim▁begin|>package com.github.gilz688.mifeditor; import com.github.gilz688.mifeditor.proto.MIEView; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; import javafx.scene.layout.AnchorPane; import javafx.stage.Sta...
final MIEView view = (MIEView) loader.getController();
<|file_name|>xprod.test.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> describe('xprod', () => { describe('[a] -> [b]', () => { it('-> [ (a, b) ]', () => { const xs = [ 1, 2, 3 ] const ys = [ 'a', 'b', 'c' ] assert.deepEqual( xprod(xs, ys), [ [ 1, 'a' ], [ 1, 'b' ], [ 1, 'c' ], [ ...
import * as assert from 'assert' import { xprod } from './xprod'
<|file_name|>extension.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 super::WebGLExtensions; use canvas_traits::webgl::WebGL...
/// Creates the DOM object of the WebGL extension. fn new(ctx: &WebGLRenderingContext) -> DomRoot<Self::Extension>;
<|file_name|>LoginActivity.java<|end_file_name|><|fim▁begin|>/* * Licensed to Cloudkick, Inc ('Cloudkick') under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * Cloudkick licenses this file to You under the A...
default: progress.dismiss(); Toast.makeText(LoginActivity.this, "An Error Occurred Retrieving Your Accounts", Toast.LENGTH_LONG).show(); };
<|file_name|>test_telemetry_full.py<|end_file_name|><|fim▁begin|>""" telemetry full tests. """ import platform import sys from unittest import mock import pytest import wandb def test_telemetry_finish(runner, live_mock_server, parse_ctx): with runner.isolated_filesystem(): run = wandb.init() run....
# hf in finish modules but not in init modules assert telemetry and 11 not in telemetry.get("1", [])
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.contrib.auth.models import AbstractUser from django.db import models<|fim▁hole|> @python_2_unicode_compatible class User(AbstractUser): # First Name and Last Name do not cover name patterns # around the globe. name = ...
from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _
<|file_name|>trait-resolution-breakage.rs<|end_file_name|><|fim▁begin|>// check-pass trait Trait<T> { const ASSOC_CONST: usize = 0; } impl Trait<()> for u8 {} // `u8::ASSOC_CONST` is resolved today, but will be ambiguous // under lazy normalization.<|fim▁hole|> todo!() } fn main() {}<|fim▁end|>
fn foo<T, U>() -> [(T, U); u8::ASSOC_CONST] where u8: Trait<T> + Trait<U>, {
<|file_name|>lastfm.js<|end_file_name|><|fim▁begin|>//require last.fm api client var LastFmNode = require('lastfm').LastFmNode; //get api keys from config file var config = require('../config.js'); //save.js to save json var save = require('../save.js'); // fs to open json var fs = require('fs'); //initialize api clie...
var music = new Object;
<|file_name|>reading_scalar_data.tests.ts<|end_file_name|><|fim▁begin|>import { expect } from 'chai'; import { ModelApiManager } from '../../api/manager'; import * as models from '../__fixtures__/models'; import { graphql, GraphQLSchema } from 'graphql'; import { ModelManager, fields } from 'rev-models'; import { creat...
apiManager.register(models.Comment, { operations: ['read'] }); api = new GraphQLApi(apiManager);
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os from setuptools import setup, find_packages with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os....
version='0.1', packages=[ 'poloniex',
<|file_name|>line_plot.py<|end_file_name|><|fim▁begin|># # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Jockey 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, or (a...
for pair in self.data:
<|file_name|>webhosting.py<|end_file_name|><|fim▁begin|>""" Implementation of the WebhostingService API endpoint """ from transip.client import MODE_RW, Client class WebhostingService(Client): """ Transip_WebhostingService """ def __init__(self, *args, **kwargs): super().__init__('WebhostingS...
return self._simple_request('modifyMailBox', domain, mailbox, mode=MODE_RW)
<|file_name|>widget.js<|end_file_name|><|fim▁begin|>WAF.define('WakendoColorPicker', ['waf-core/widget', 'wakendoCore'], function(widget, $) { 'use strict'; var KendoColorPicker = widget.create('WakendoColorPicker', { value: widget.property({ type: 'string' }), flat: widget.prope...
},
<|file_name|>pe572-idempotent-matrices.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 """572. Idempotent matrices https://projecteuler.net/problem=572 A matrix $M$ is called idempotent if $M^2 = M$. Let $M$ be a three by three matrix : $M=\begin{pmatrix} a & b & c\\\ d & e & f\\\ g &h &i\\\ \e...
<|file_name|>mismatch.hpp<|end_file_name|><|fim▁begin|>// $Author: benine $ // $Date$ // $Log$ // Contains the mismatch class for afin #ifndef MISMATCH_H #define MISMATCH_H //////////////////////////////////////////////\ // Mismatch Class: ////////////////////////////> ////////////////////////////////////////////// /...
// return length int get_length();
<|file_name|>specs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 import re import copy import humanfriendly import json import jsonpickle from lain_sdk.yaml.parser import ProcType, resource_instance_name from .utils import get_system_volumes_from_etcd class AppType: Normal = 'app' Service = 'service' ...
<|file_name|>render.rs<|end_file_name|><|fim▁begin|>use std::{cmp, fmt, io}; #[cfg(feature = "termcolor")] use termcolor::{ColorSpec, WriteColor}; use crate::{Doc, DocPtr}; /// Trait representing the operations necessary to render a document pub trait Render { type Error; fn write_str(&mut self, s: &str) ->...
<|file_name|>find_moves_faster.rs<|end_file_name|><|fim▁begin|>///This is an attempt to port the Edax move generation function to rust. #[allow(non_snake_case)] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] pub fn fast_find_moves(P : u64, O : u64) -> u64 { const mask_7e : u64 = 0x7e7e7e7e7e7e7e7eu64; ...
pand %mm6, %mm0 shrl $1, %ecx
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use super::{Block, ListItem, Span}; trait JoinHelper<I> where I: Iterator, { fn j(self, sep: &'static str) -> String; } impl<I> JoinHelper<I> for I where I: Iterator<Item = String>, { fn j(self, sep: &'static str) -> String { self.collect::<Vec<...
format!(
<|file_name|>addAudios.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, ViewChild, Inject } from '@angular/core'; import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; import { environment } from '../../../../../../en...
} }
<|file_name|>vtopo.py<|end_file_name|><|fim▁begin|>''' Virtual topology ''' class VTopo(object): ''' Attributes: - switches : virtual switch list - links : virtual links ''' def __init__(self): super(VTopo, self).__init__() self.isStart = False self.switches = [] ...
pass
<|file_name|>img_to_queue.py<|end_file_name|><|fim▁begin|>import socket import random from PIL import Image import json import sys, getopt import math import pika # Screen VARS offset_x = 80 offset_y = 24 screen_width = 240 screen_height = 240 # Internal options queueAddress = '' fileName = '' workers = 36 Matrix =...
<|file_name|>underline.icon.js<|end_file_name|><|fim▁begin|>(function ()<|fim▁hole|> window.AgidoMockups = window.AgidoMockups || {}; AgidoMockups.icons = AgidoMockups.icons || {}; AgidoMockups.icons.underline = new Kinetic.Group({name: "underlineIcon", width: 18, height: 20}); AgidoMockups.icons.underli...
{
<|file_name|>private_client_test.go<|end_file_name|><|fim▁begin|>package clients import ( "gopkg.in/jarcoal/httpmock.v1" "reflect" "testing" "time" ) // // // func Test_GetAccountReportStatus(t *testing.T) { // Setup the mocks httpmock.Activate() defer httpmock.DeactivateAndReset() // Mock the time request ...
"end_date": "2014-11-30T23:59:59.000Z"
<|file_name|>drivers-list.js<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2015 Stratio (http://stratio.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 * * http://www.ap...
vm.driversData.splice(index, 1); vm.successMessage.text = '_DRIVER_DELETE_OK_';
<|file_name|>add.py<|end_file_name|><|fim▁begin|>import wx import eos.db import gui.mainFrame from gui import globalEvents as GE from gui.fitCommands.calc.module.projectedAdd import CalcAddProjectedModuleCommand from gui.fitCommands.helpers import InternalCommandHistory, ModuleInfo<|fim▁hole|> def __init__(self, f...
from service.fit import Fit class GuiAddProjectedModuleCommand(wx.Command):
<|file_name|>stats.js.src.js<|end_file_name|><|fim▁begin|>/* global define */ define([ 'jquery', 'marionette' ], function($, Marionette) { var CountItem = Marionette.ItemView.extend({ tagName: 'tr', template: 'stats/count-item' }); var CountList = Marionette.CompositeView.extend(...
} this.$('[data-sort=' + this.collection._sortAttr + ']') .removeClass(this.collection._sortDir);
<|file_name|>baseLine.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>declare function configCreate(winWidth: number, customStyles: any): any; export default configCreate;<|fim▁end|>
import "core-js/fn/object/assign";
<|file_name|>ex14_49_TEST.cpp<|end_file_name|><|fim▁begin|>#include "ex14_49.h" int main() { Date date(12, 4, 2015);<|fim▁hole|><|fim▁end|>
if (static_cast<bool>(date)) std::cout << date << std::endl; }
<|file_name|>issue-17431-6.rs<|end_file_name|><|fim▁begin|>use std::sync::Mutex; enum Foo { X(Mutex<Option<Foo>>) } //~^ ERROR recursive type `Foo` has infinite size impl Foo { fn bar(self) {} }<|fim▁hole|> fn main() {}<|fim▁end|>
<|file_name|>grove_sound_sensor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Jetduino Example for using the Grove Sound Sensor and the Grove LED # # The Jetduino connects the Jetson and Grove sensors. You can learn more about the Jetduino here: http://www.NeuroRoboticTech.com/Projects/Jetduino # # Module...
<|file_name|>coyoneda.js<|end_file_name|><|fim▁begin|>// Video: https://www.youtube.com/watch?v=WH5BrkzGgQY const daggy = require('daggy') const compose = (f, g) => x => f(g(x)) const id = x => x //===============Define Coyoneda========= // create constructor with props 'x' and 'f' // 'x' is our value, 'f' is a fun...
//===============Lift a functor in (Array) and achieve Loop fusion========= console.log( `Coyoneda.lift([1,2,3]).map(x => x * 2).map(x => x - 1).lower() : `,
<|file_name|>util.js<|end_file_name|><|fim▁begin|>function char2int(c) { return c.charCodeAt(0); } var hexD = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' ]; hexD = ['0'].concat(hexD); function hex(number) { var str = ""; str = hexD[number&0xf] + str str = hexD[(number...
<|file_name|>options.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict import copy import operator from functools import partial, reduce, update_wrapper import warnings from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import widge...
post_url = reverse('admin:%s_%s_changelist' % (opts.app_label, opts.model_name), current_app=self.admin_site.name) preserved_filters = self.get_preserved_filters(request)
<|file_name|>almanac.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2009, 2011, 2012 Tom Keffer <tkeffer@gmail.com> # # See the file LICENSE.txt for your full rights. # # $Revision: 1046 $ # $Author: tkeffer $ # $Date: 2013-02-21 06:38:26 -0800 (Thu, 21 Feb 2013) $ # """Almanac data This module can o...
>>> print almanac.next_vernal_equinox 20-Mar-2010 10:32
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use self::index_pool::IndexPool; pub use self::debug_draw::DebugDraw; pub use self::timer::Timer; use cgmath::*; use std::ops::Mul; use std::f32; mod index_pool; mod timer; pub mod debug_draw; // // Global tuning constants based on meters-kilograms-seconds (MKS) u...
// q = self, r = rhs
<|file_name|>DocumentPartByPathController.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package com.indoqa.daisy.cocoon.controller; import org.apache.cocoon.rest.controller.annotation.SitemapParameter; import org.apache.cocoon.rest.controller.response.RestResponse; import org.apache.cocoon.rest.controller.response.URL...
<|file_name|>ExpandingToolBar.cpp<|end_file_name|><|fim▁begin|>/********************************************************************** Audacity: A Digital Audio Editor ExpandingToolBar.cpp Dominic Mazzoni *******************************************************************//** \class ExpandingToolBar \brief A...
// The grabber doesn't count! if (mGrabber && mGrabber->GetRect().Contains(localMouse)) result = false;
<|file_name|>WeaponHandler.java<|end_file_name|><|fim▁begin|>/** * MegaMek - Copyright (C) 2004,2005 Ben Mazur (bmazur@sev.org) * * 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 v...
nDamage = Math.max(0, nDamage - treeAbsorbs); server.tryClearHex(entityTarget.getPosition(), treeAbsorbs, ae.getId());
<|file_name|>0079_auto_20160620_1418.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.db import models, migrations def sector_validation(apps, schema_editor): """ Remove sector from RSR validation set """ ProjectEditorValidation = apps.get_model('rsr', 'ProjectEditorValidation') sector_validators ...
# -*- coding: utf-8 -*-
<|file_name|>test_module_onboarding.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright (c) 2020, Frappe Technologies and Contributors # License: MIT. See LICENSE # import frappe import unittest class TestModuleOnboarding(unittest.TestCase): pass<|fim▁end|>
# -*- coding: utf-8 -*-
<|file_name|>GlobalIOThread.cpp<|end_file_name|><|fim▁begin|>/* Copyright_License { XCSoar Glide Computer - http://www.xcsoar.org/ Copyright (C) 2000-2015 The XCSoar Project A detailed list of copyright holders can be found in the file "AUTHORS". This program is free software; you can redistribute it and/or ...
delete io_thread; io_thread = nullptr;
<|file_name|>text.py<|end_file_name|><|fim▁begin|>""" This module implements the TextResponse class which adds encoding handling and discovering (through HTTP headers) to base Response class. See documentation in docs/topics/request-response.rst """ from w3lib.encoding import html_to_unicode, resolve_encoding, \ ...
def body_as_unicode(self):
<|file_name|>test_pass_alter_op_layout.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...
y = relay.nn.conv2d(y, weight1, channels=32, kernel_size=(3, 3), padding=(1, 1),
<|file_name|>buttonwidget.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_B...
connect(signalMapper, SIGNAL(mapped(QString)), //! [1] //! [2]
<|file_name|>daemon_windows.go<|end_file_name|><|fim▁begin|>package daemon import ( "encoding/json" "errors" "fmt" "os" "path/filepath" "runtime" "strings" "github.com/Sirupsen/logrus" "github.com/docker/docker/container" "github.com/docker/docker/daemon/graphdriver" "github.com/docker/docker/dockerversion...
named, err := reference.ParseNamed(name) if err != nil { return err
<|file_name|>ClipboardUtil.java<|end_file_name|><|fim▁begin|>package io.mattw.youtube.commentsuite.util; import java.awt.*; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection;<|fim▁hole|> public class ClipboardUtil { private Clipboard syst...
import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOException; import java.util.List; import java.util.stream.Collectors;
<|file_name|>json.go<|end_file_name|><|fim▁begin|>/* Copyright 2016-2017 Vector Creations Ltd * * 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/LICE...
)
<|file_name|>multi.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either versi...
// Check syncing. let sync_client = generate_dummy_client_with_spec_and_data(Spec::new_validator_multi, 0, 0, &[]);
<|file_name|>microworld.js<|end_file_name|><|fim▁begin|>'use strict'; var maxBot = 11; var mode; var mw = {}; var mwId; function getMwId() { mwId = $.url().segment(4); } function isNewMicroworld() { return ($.url().segment(3) === 'new'); } function showStatusTableOptions() { var behaviour_name = $(this)...
}); } function cloneMicroworld() {
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ //! Python bindings for native blackbox logging. use std::ops::Deref; use blackbox::even...
.into_iter() .map(|id| id.0)
<|file_name|>network.rs<|end_file_name|><|fim▁begin|>use std::io; use std::io::Cursor; use std::convert::From; use std::str::FromStr; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}; use regex::Regex; use byteorder::{NetworkEndian, ReadBytesExt, WriteBytesExt}; use error::{SocketError, Result}; use util::slice...
res.ok_or(From::from(SocketError::ParseAddrFailed(format!("{}:{}", ip, port)))) }
<|file_name|>bi_level_img_threshold.py<|end_file_name|><|fim▁begin|>#author: Nadezhda Shivarova #date created: 30/11/15 #Description: Perform Bi-Level Image Threshold on a histogram to determine the optimal threshold level #Using the algorithm in the paper Bi Level Img Thresholding, Antonio dos Anjos import numpy as n...
while (I_s != I_e): if (W_r > W_l): W_r = W_r - hist[I_e]
<|file_name|>test_xl_cell_to_rowcol_abs.py<|end_file_name|><|fim▁begin|>############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2022, John McNamara, jmcnamara@cpan.org # import unittest from ...utility imp...
<|file_name|>base_test.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017 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<|fim▁hole|># # Unless required by applicable l...
# # http://www.apache.org/licenses/LICENSE-2.0
<|file_name|>ohai.py<|end_file_name|><|fim▁begin|>""".""" <|fim▁hole|><|fim▁end|>
def get_systeminfo(resource, config, interactive=False): """.""" return {'ohai': 'there!'}
<|file_name|>UserService.java<|end_file_name|><|fim▁begin|>package com.etop.service; import com.etop.dao.UserDAO; import com.etop.pojo.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.Serializable; import java.util.HashMap; import java....
/** * 用户服务,与dao进行对接
<|file_name|>avpclc.cpp<|end_file_name|><|fim▁begin|>/* Copyright 2007 nVidia, 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 Unless required by a...
break; case 'e': noerrfile = false; break;
<|file_name|>config.example.js<|end_file_name|><|fim▁begin|>// # Ghost Configuration // Setup your Ghost install for various environments // Documentation can be found at http://support.ghost.org/config/ var path = require('path'), config; config = { // ### Production // When running Ghost in the...
// service: 'Mailgun', // auth: { // user: '', // mailgun username // pass: '' // mailgun password