prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>IntArrayWorker.java<|end_file_name|><|fim▁begin|>package lab;
public class IntArrayWorker
{
/** two dimensional matrix */
private int[][] matrix = null;
/** set the matrix to the passed one
* @param theMatrix the one to use
*/
public void setMatrix(int[][] theMatrix)
{
m... | {
|
<|file_name|>gdiplus.cpp<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////////
// Name: src/msw/gdiplus.cpp
// Purpose: implements wrappers for GDI+ flat API
// Author: Vadim Zeitlin
// Created: 2007-03-14
// Copyright: (c) 2007 Vadim Zei... | m(TransformPoints, (GpGraphics *graphics, GpCoordinateSpace destSpace, GpCoordinateSpace srcSpace, GpPointF *points, INT count), (graphics, destSpace, srcSpace, points, count)) \
m(TransformPointsI, (GpGraphics *graphics, GpCoordinateSpace destSpace, GpCoordinateSpace srcSpace, GpPoint *points, INT count), (gr... |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use cpython::*;
use cpython_ext::{PyPath, ResultPyErrExt, Str};
pub fn init_module(py: Pyth... | let m = PyModule::new(py, &name)?; |
<|file_name|>test-success.py<|end_file_name|><|fim▁begin|>"""
Test connecting to a server.
"""
from gabbletest import exec_test
import constants as cs
def test(q, bus, conn, stream):
conn.Connect()
q.expect('dbus-signal', signal='StatusChanged', args=[cs.CONN_STATUS_CONNECTING, cs.CSR_REQUESTED])<|fim▁hole|> ... | q.expect('stream-authenticated')
q.expect('dbus-signal', signal='PresenceUpdate',
args=[{1L: (0L, {u'available': {}})}]) |
<|file_name|>file.dot.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: file.dot.proto
/*
Package filedotname is a generated protocol buffer package.
It is generated from these files:
file.dot.proto
It has these top-level messages:
M
*/
package filedotname
import pro... | dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
}
return dAtA |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn pe009() -> usize {
let stop:usize = 1000;
for a in 0 .. stop {
for b in a+1 .. stop {
for c in b+1 .. stop {
if a+b+c == stop {
if a*a + b*b == c*c {
return a*b*c<|fim▁hole|> ... | }
}
}
} |
<|file_name|>DcgEval.py<|end_file_name|><|fim▁begin|># This file is part of Lerot.
#
# Lerot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any la... | from .AbstractEval import AbstractEval
class DcgEval(AbstractEval): |
<|file_name|>AnnisGraphToolsTest.java<|end_file_name|><|fim▁begin|>package org.corpus_tools.annis.gui.visualizers.component.tree;
<|fim▁hole|>import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull... | |
<|file_name|>expr-alt-box.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... | fn test_box() { |
<|file_name|>xSlider.js<|end_file_name|><|fim▁begin|>/*
* @fileOverview xSlider
* @version 1.5.1
* @date 2016-2-25
* @author Xinbo Shang
*
*/
"use strict";
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as anonymous module.
define(['jquery']... | var xSlider = function(element, options) {
this.CONTAIN = $(element), //the warp of the widget |
<|file_name|>Semaphore.hh<|end_file_name|><|fim▁begin|>#pragma once
/* This file is part of Imagine.
Imagine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opti... |
class Semaphore : public SemaphoreImpl
{
public: |
<|file_name|>_stochastic_gradient.py<|end_file_name|><|fim▁begin|># Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification, regression and One-Class SVM using Stochastic Gradient
Descent (SGD).
"""
import num... | classes=classes, |
<|file_name|>MInOutLineMA.java<|end_file_name|><|fim▁begin|>/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
* This program i... |
/**
* Parent Constructor
* @param parent parent
|
<|file_name|>minimap-bookmarks.js<|end_file_name|><|fim▁begin|>/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS201: Simplify complex destructure assignments
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const { C... | const binding = new MinimapBookmarksBinding(minimap, bookmarks)
this.bindings.set(minimap.id, binding) |
<|file_name|>mootools.more.js<|end_file_name|><|fim▁begin|>// MooTools: the javascript framework.
// Load this file's selection again by visiting: http://mootools.net/more/f0c28d76aff2f0ba12270c81dc5e8d18
// Or build this file again with packager using: packager build More/Assets More/Hash.Cookie
/*
---
script: More.... | },
onerror: function(){
counter++; |
<|file_name|>opusabout.py<|end_file_name|><|fim▁begin|># Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
# PyQt4 includes for python bindings to QT
from PyQt4.QtCore import QString, QUrl
from PyQt4.QtGui import QDialog, QDesktopServices
# UI specif... |
def on_docPushButton_released(self): |
<|file_name|>typings.d.ts<|end_file_name|><|fim▁begin|>/* SystemJS module definition */
declare var module: NodeModule;
interface NodeModule {
id: string;
<|fim▁hole|>declare module '*.json' {
const value: any;
export default value;
}<|fim▁end|> | [ key: string ]: any;
}
|
<|file_name|>browser.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright(C) 2009-2016 Romain Bignon
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# t... | # GNU Lesser General Public License for more details. |
<|file_name|>os.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust.<|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... | // Copyright 2014 Vladimir "farcaller" Pouzanov <farcaller@gmail.com> |
<|file_name|>BitcoinLikeKeychain.hpp<|end_file_name|><|fim▁begin|>/*
*
* BitcoinLikeKeychain
* ledger-core
*
* Created by Pierre Pollastri on 17/01/2017.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledger
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this softwar... | bool isSegwit() const;
bool isNativeSegwit() const; |
<|file_name|>Year.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public ... | }
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
This package contains different `unittests <https://docs.python.org/3/library/unittest.html>`_ for the project.
Those tests help to validate difficult pieces of the software.
"""<|fim▁hole|>__license__ = "GPLv3"<|fim▁end|> |
__author__ = 'Wuersch Marcel' |
<|file_name|>averaging_regressor_test.py<|end_file_name|><|fim▁begin|>import pprint as pp
import pandas as pd
from sklearn.linear_model import Ridge, Lasso<|fim▁hole|>from ionyx.contrib import AveragingRegressor
from ionyx.datasets import DataSetLoader
print('Beginning averaging regressor test...')
data, X, y = DataS... | from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import GridSearchCV, KFold, cross_val_score
from sklearn.svm import LinearSVR |
<|file_name|>test_asarandom.py<|end_file_name|><|fim▁begin|>import os
import unittest
from urlparse import urlparse
from paegan.utils.asarandom import AsaRandom
class AsaRandomTest(unittest.TestCase):
def test_create_random_filename(self):
temp_filename = AsaRandom.filename(prefix="superduper", suffix=".nc... | assert name.index("superduper") == 0
assert ext == ".nc" |
<|file_name|>filter.ts<|end_file_name|><|fim▁begin|>import {Operator} from '../Operator';
import {Subscriber} from '../Subscriber';
import {Observable} from '../Observable';
/**
* Filter items emitted by the source Observable by only emitting those that
* satisfy a specified predicate.
*
* <span class="informal">L... | * @method filter
* @owner Observable
*/ |
<|file_name|>coverart_listview.py<|end_file_name|><|fim▁begin|># -*- Mode: python; coding: utf-8; tab-width: 4; indent-tabs-mode: nil; -*-
#
# Copyright (C) 2012 - fossfreedom
# Copyright (C) 2012 - Agustin Carrasco
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU... | def initialise(self, album_manager):
if self._has_initialised: |
<|file_name|>XYZ.js<|end_file_name|><|fim▁begin|>var should = require("should");
var Mat3x3 = require("./Mat3x3");
var Barycentric3 = require("./Barycentric3");
var Logger = require("./Logger");
(function(exports) {
var verboseLogger = new Logger({
logLevel: "debug"
});
////////////////// construc... | z: 3.9
}).should.True;
});
it("XYZ.of(pt) should return an XYZ object for given point", function() { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var PgQuery = require('bindings')('pg-query');
module.exports = {
parse: function(query) {
var result = PgQuery.parse(query);
if (result.query) {
result.query = JSON.parse(result.query);
}
if (result.error) {
var err = new Error(result.... | err.context = result.error.context;
|
<|file_name|>CloudFrontDistributionConfiguration.java<|end_file_name|><|fim▁begin|>package ch.cyberduck.core.cloudfront;
/*
* Copyright (c) 2002-2013 David Kocher. All rights reserved.
* http://cyberduck.ch/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU G... | @SuppressWarnings("unchecked") |
<|file_name|>compile_rules.py<|end_file_name|><|fim▁begin|>import re
import sys
import traceback
import copy
import json
from distutils import file_util
from grammalecte.echo import echo
DEF = {}
FUNCTIONS = []
JSREGEXES = {}
WORDLIMITLEFT = r"(?<![\w.,–-])" # r"(?<![-.,—])\b" seems slower
WORDLIMITRIGHT = r"(... | sCode = sCode.replace(".end()", ".end[0]")
sCode = sCode.replace(".start()", ".index")
sCode = sCode.replace("m.group()", "m[0]")
sCode = re.sub("\\.start\\((\\d+)\\)", ".start[\\1]", sCode) |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/**
* @file ui/core/styleguide/index//html/01-body/40-main/main.js
* @description Listeners on the body, iframe, and rightpull bar.
*/
/* istanbul ignore if */
if (typeof window === 'object') {
document.addEventListener('DOMContentLoaded', () => {
const $orgs =... |
// Handle manually resizing the viewport.
// 1. On "mousedown" store the click location.
// 2. Make a hidden div visible so that the cursor doesn't get lost in the iframe. |
<|file_name|>toggle-trait-fn.rs<|end_file_name|><|fim▁begin|>#![crate_name = "foo"]
// Trait methods with documentation should be wrapped in a <details> toggle with an appropriate
// summary. Trait methods with no documentation should not be wrapped.
//
// @has foo/trait.Foo.html
// @has - '//details[@class="rustdoc-... |
/// is_documented_optional is documented |
<|file_name|>getGeneDescLocal_Illumina.py<|end_file_name|><|fim▁begin|>import pandas as pd
def closeFunc():
print('''Type 'quit' and press enter to exit program''')
answer = input(': ')
if answer == 'quit':<|fim▁hole|>def oligosList():
oligosPath = input('Path to the file containing the list of probes:... | quit()
else:
closeFunc()
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Parsing and interpretation for unoptimized Brainfuck abstract syntax trees.
//!
//! In `bfi` by default, this pass runs before run-length encoding and peephole optimization. To
//! run the unoptimized AST directly and skip all optimization, pass `--ast` flag.
//!
//!... | ///
/// # Invariants |
<|file_name|>simplifications_common.py<|end_file_name|><|fim▁begin|># ----------------------------- #
# Common simplifications passes #
# ----------------------------- #
from miasm2.expression.modint import mod_size2int, mod_size2uint
from miasm2.expression.expression import *
from miasm2.expression.expression_helper... | e = ExprOp('+', *args) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponseRedirect
from django.shortcuts import redirect
from django.urls import reverse_lazy, reverse
from django.views.generic import ListView, DetailView, FormView, CreateView, \
UpdateView
from django.views.generic.base import Template... | |
<|file_name|>p2p-nfc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Example nfcpy to wpa_supplicant wrapper for P2P NFC operations
# Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import os
import sys
impor... | sel.add_carrier(message[0], "active", message[1:])
found = True
break
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md><|fim▁hole|>extern crate winapi;
use winapi::*;
extern "system" {
}<|fim▁end|> | //! FFI bindings to glmf32.
#![no_std]
#![experimental] |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for react-router-bootstrap
// Project: https://github.com/react-bootstrap/react-router-bootstrap
// Definitions by: Vincent Lesierse <https://github.com/vlesierse>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference ... | |
<|file_name|>roman_to_decimal.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <cstdlib>
#include <map>
using std::map;
using std::cout;
using std::endl;
using std::cerr;
using std::string;
#define MAXROMAN 7
typedef map<char,int> roman_mapvals;
typedef roman_mapvals::const_iterator roman_mapiter;
int... | cerr << "FAILED: input contains non-Roman character "<< endl;
exit(EXIT_FAILURE);
}
|
<|file_name|>wegas-helper.js<|end_file_name|><|fim▁begin|>/*
* Wegas
* http://wegas.albasim.ch
*
* Copyright (c) 2013, 2014, 2015 School of Business and Engineering Vaud, Comem
* Licensed under the MIT License
*/
/**
* @fileoverview
* @author Francois-Xavier Aeberhard <fx@red-agent.com>
* @author Cyril Junod <... | * Java hashCode implementation
* @param {String} value to hash
* @returns {Number}
*/ |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>package text
import (<|fim▁hole|><|fim▁end|> | _ "qiniupkg.com/text/tpl.v1"
) |
<|file_name|>reverse-string.rs<|end_file_name|><|fim▁begin|>//! Tests for reverse-string
//!
//! Generated by [script][script] using [canonical data][canonical-data]
//!
//! [script]: https://github.com/exercism/rust/blob/master/bin/init_exercise.py
//! [canonical-data]: https://raw.githubusercontent.com/exercism/probl... | fn test_empty_string() {
process_reverse_case("", ""); |
<|file_name|>osm_field.js<|end_file_name|><|fim▁begin|>/* jQuery OSM field
2014 by Thomas netAction Schmidt for Sinnwerkstatt
https://www.sinnwerkstatt.com/<|fim▁hole|>(function ($) {
$.fn.osmfield = function () {
return this.each(function () {
// Create HTML elements for osmfield
... | MIT License */ |
<|file_name|>ioapic.rs<|end_file_name|><|fim▁begin|>use core::ptr::write_volatile;
use core::ptr::read_volatile;
use kernel::mm::*;
const REG_ID: u32 = 0x00;
const REG_VER: u32 = 0x01;
const REG_ARB: u32 = 0x02;
const fn reg_redtbl_low(num: u32) -> u32 {
0x10 + (2*num)
}
const fn reg_redtbl_high(num: ... | }
fn write(&self, reg: u32, value: u32) {
if let Some(base) = self.ioapic_base { |
<|file_name|>settings_api_bubble_helpers.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 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/browser/ui/extensions/settings_api_bubble_helpers.h"
#inclu... |
void MaybeShowExtensionControlledHomeNotification(Browser* browser) {
#if defined(OS_WIN) || defined(OS_MACOSX)
ShowSettingsApiBubble(BUBBLE_TYPE_HOME_PAGE, browser); |
<|file_name|>inferno.js<|end_file_name|><|fim▁begin|>(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.Inferno = global.Inferno || {})));
}(this, (functi... | node = b[bStart];
|
<|file_name|>CoAPTxRequestPacketTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2017, Digi International Inc.
*
* 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... |
// Verify the result. |
<|file_name|>login.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
<|fim▁hole|>import { LoginComponent } from './login.component';
@NgModule({
declarations: [
LoginComponent
],
imports: [
CommonModule,
LoginRoutingModul... | import { LoginRoutingModule } from './login-routing.module'; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.postgres.fields.jsonb import JSONField
class Supplier(models.Model):
name = models.CharField(max_length=50)
tax_id = models.CharField(max_length=10)
def __str__(self):
return self.name
class Bar... | def sale_price(self):
return self.info.get('sale_price', '')
@property |
<|file_name|>gsm0338.py<|end_file_name|><|fim▁begin|># vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
""" Python Character Mapping Codec based on gsm0338 generated from './GSM0338.TXT' with gencodec.py.
With extra sauce to deal with the 'multibyte' extensions!
"""#"
import codecs
import re
### Codec APIs
#
# S... | u'\xe6' # 0x1D -> LATIN SMALL LETTER AE
u'\xdf' # 0x1E -> LATIN SMALL LETTER SHARP S (German) |
<|file_name|>bitcoin_pt_BR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About EvilCoin</source>
<translation>Sobre o Ev... | </message> |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
exports.ContainerBuilder = require('./CqrsContainerBuilder');
exports.EventStream = require('./EventStream');
exports.CommandBus = require('./CommandBus');
exports.EventStore = require('./EventStore');
exports.AbstractAggregate = require('./AbstractAgg... | |
<|file_name|>goagent.go<|end_file_name|><|fim▁begin|>package goagent
import (
"bytes"
"crypto/tls"
"encoding/json"
"errors"
"io/ioutil"
"log"
"net/http"
"net/url"
"os/exec"
)
const updateSecretFromAgentPath = "/mitro-core/api/internal/UpdateSecretFromAgent"
const phantomCommand = "phantomjs"
// Top level re... | }
postResponse, err := c.client.Post(c.internalURL+path, "application/json", bytes.NewReader(serialized))
if err != nil { |
<|file_name|>canteraTest.py<|end_file_name|><|fim▁begin|>import unittest
import os
import numpy
from rmgpy.tools.canteraModel import findIgnitionDelay, CanteraCondition, Cantera
from rmgpy.quantity import Quantity
import rmgpy
class CanteraTest(unittest.TestCase):
def testIgnitionDelay(self):
"""
T... | reactorType='IdealGasReactor' |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Web Editor Utils
# (see https://mukit.at).
#<|fim▁hole|>#
# This program is distributed in the hope... | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version. |
<|file_name|>UtestPlatform.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2007, Michael Feathers, James Grenning, Bas Vodde and Timo Puronen
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are me... | |
<|file_name|>shell.py<|end_file_name|><|fim▁begin|># The MIT License (MIT)
#
# Copyright (c) 2016 Frederic Guillot
#
# 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, inclu... |
return parser
|
<|file_name|>file_operations.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import grp
import tempfile
from django.conf import settings
from utilities import encoding
import shutil
import zipfile
gid = None
if (settings.USEPRAKTOMATTESTER):
gid = grp.getgrnam('praktomat').gr_gid
def makedirs(... | def create_file(path, content, override=True, binary=False):
""" """
dirname = os.path.dirname(path) |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/* global window */
import React from 'react'
import NProgress from 'nprogress'
import PropTypes from 'prop-types'
import { connect } from 'dva'
import { Helmet } from 'react-helmet'
import { withRouter } from 'dva/router'
let lastHref
const App = ({ children, dispatch... | location: PropTypes.object,
dispatch: PropTypes.func, |
<|file_name|>issue-11612.rs<|end_file_name|><|fim▁begin|>// check-pass
#![allow(dead_code)]
// #11612
// We weren't updating the auto adjustments with all the resolved
// type information after type check.
// pretty-expanded FIXME #23616
trait A { fn dummy(&self) { } }
struct B<'a, T:'a> {
f: &'a T
}<|fim▁hole|>... | |
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub fn set_panic_hook() {
// When the `console_error_panic_hook` feature is enabled, we can call the
// `set_panic_hook` function at least once during initialization, and then
// we will get better error messag... | #[cfg(feature = "console_error_panic_hook")]
console_error_panic_hook::set_once(); |
<|file_name|>jquery.waituntilexists.js<|end_file_name|><|fim▁begin|>;(function ($, window) {<|fim▁hole|>
var intervals = {};
var removeListener = function(selector) {
if (intervals[selector]) {
window.clearInterval(intervals[selector]);
intervals[selector] = null;
}
};
var found = 'waitUntilExists.found';
/*... | |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2012, Martin Angers & Contributors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must... |
* property.go : methods that inspect and get the node's properties values.
- Attr()
- Html() |
<|file_name|>build_test.go<|end_file_name|><|fim▁begin|>package gexec_test
import (
"os"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
)
var packagePath = "./_fixture/firefly"
var _ = Describe(".Build", func() {
Context("when there have been previous calls to Build", func... | )
|
<|file_name|>test_path_groups.py<|end_file_name|><|fim▁begin|>import nose
import angr
import logging
l = logging.getLogger("angr_tests.path_groups")
import os
location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
addresses_fauxware = {
'armel': 0x8524,
'armhf': 0x1... | def run_fauxware(arch, threads): |
<|file_name|>deleteTranslations.js<|end_file_name|><|fim▁begin|>'use strict';
//Translations service used for translations REST endpoint<|fim▁hole|> }, {
update: {
method: 'PUT'
}
});
}
]);<|fim▁end|> | angular.module('mean.translations').factory('deleteTranslations', ['$resource',
function($resource) {
return $resource('deleteTranslations/:translationId', {
translationId: '@_id' |
<|file_name|>execute.spec.js<|end_file_name|><|fim▁begin|>var chai = require('chai');
chai.use(require('chai-fs'));
var expect = chai.expect
var execute = require('../');
describe('execute', function() {
it('should exist', function() {
expect(execute).to.exist;
});
it('should return a promise', function() ... | }, function() { |
<|file_name|>BreakfastDiningRounded.js<|end_file_name|><|fim▁begin|>import createSvgIcon from './utils/createSvgIcon';
import { jsx as _jsx } from "react/jsx-runtime";<|fim▁hole|>export default createSvgIcon( /*#__PURE__*/_jsx("path", {
d: "M18 3H6C3.79 3 2 4.79 2 7c0 1.48.81 2.75 2 3.45V19c0 1.1.9 2 2 2h12c1.1 0 2-.... | |
<|file_name|>bitcoin_cs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="cs" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About CrackCoin</source>
<translation>O CrackCoinu</t... | |
<|file_name|>0021_auto_20151008_1526.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def from_election_to_elections(apps, schema_editor):
# We can't import the Person model directly as it may be a newer
# version than th... |
dependencies = [ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// This file is part of Rubik.
// Copyright Peter Beard, licensed under the GPLv3. See LICENSE for details.
//
//! Algorithms for solving Rubik's cubes
use super::cube::{Cube, Move};
/// Trait for things that can solve Rubik's cubes
pub trait Solver {
/// Calculate ... | }
|
<|file_name|>progressbar.py<|end_file_name|><|fim▁begin|>""" progressbar2 related utils"""
from codekit.codetools import warn
from public import public
from time import sleep
import progressbar
import functools
@public
def setup_logging(verbosity=0):
"""Configure progressbar sys.stderr wrapper which is required ... | progressbar.Bar(), ' ', progressbar.AdaptiveETA(),
]
return progressbar.ProgressBar(widgets=widgets, max_value=max_value) |
<|file_name|>CtrlActionWorkspaceSaveAsOracle.java<|end_file_name|><|fim▁begin|>package com.supermap.desktop.framemenus;
import com.supermap.desktop.Application;
import com.supermap.desktop.Interface.IBaseItem;
import com.supermap.desktop.Interface.IForm;
import com.supermap.desktop.implement.CtrlAction;
import com.sup... | } |
<|file_name|>mocks.rs<|end_file_name|><|fim▁begin|>use crate::{
cart::Cart,
rom::{CHR_BANK_SIZE, PRG_BANK_SIZE},
};
pub struct CartMock {
pub prg: [u8; PRG_BANK_SIZE],
pub chr: [u8; CHR_BANK_SIZE],
}
impl Default for CartMock {
fn default() -> Self {
CartMock {
prg: [0; PRG_BAN... | chr: [0; CHR_BANK_SIZE],
} |
<|file_name|>unop-move-semantics.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... |
!*n; //~ ERROR: cannot move out of borrowed content
use_imm(n); use_mut(m); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from "react";
import styled from "styled-components";
import Img from "gatsby-image";
import { graphql } from "gatsby";
import Center from "../components/center";
import ResponsiveContainer from "../components/responsive-container";
import Inset from "../c... | font-size: 2.5rem;
max-width: 22ch;
margin-top: 0; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[derive(Debug)]
pub enum HammingError {
FirstLonger,
SecondLonger,
}
pub fn hamming_distance(a: &str, b: &str) -> Result<u64, HammingError> {
if a.len() > b.len() {
Err(HammingError::FirstLonger)
} else if a.len() < b.len() {<|fim▁hole|> ... | |
<|file_name|>geth.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 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... | |
<|file_name|>metaDataProvider.js<|end_file_name|><|fim▁begin|>import external from '../../../externalModules.js';
import getNumberValues from './getNumberValues.js';
import parseImageId from '../parseImageId.js';
import dataSetCacheManager from '../dataSetCacheManager.js';
import getImagePixelModule from './getImagePix... | let columnCosines = null;
if (imageOrientationPatient) {
rowCosines = [ |
<|file_name|>OpTEST.hpp<|end_file_name|><|fim▁begin|>/*
*
* Copyright (c) 2015-2017 Stanislav Zhukov
*
* 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... | int GetOpcode() const override;
}; |
<|file_name|>vic_memory.rs<|end_file_name|><|fim▁begin|>// This file is part of zinc64.
// Copyright (c) 2016-2019 Sebastian Jastrzebski. All rights reserved.
// Licensed under the GPLv3. See LICENSE file in the project root for full license text.
use zinc64_core::{Ram, Rom, Shared, SharedCell};
pub struct VicMemory ... | let full_address = self.base_address.get() | address;
let zone = full_address >> 12;
match zone { |
<|file_name|>featurestore_service.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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... | - ``online_serving_config.fixed_node_count``: Supports
``=``, ``!=``, ``<``, ``>``, ``<=``, and ``>=``
comparisons. |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react';
import { storiesOf } from '@storybook/react';
import moment from 'moment';
import {
withKnobs,
number,
object,
boolean,
text,
select,
date,
array,
color,
files,
} from '../../src';
const stories = storiesOf('Example of Kn... | const favoriteNumber = number('Favorite Number', 42);
const comfortTemp = number('Comfort Temp', 72, { range: true, min: 60, max: 90, step: 1 });
|
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|># Copyright (c) 2008 Mikeal Rogers
#
# 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/LIC... | requestcontext['REVISION'] = git.revision |
<|file_name|>system.py<|end_file_name|><|fim▁begin|>import math
import inspect
import numpy as np
import numpy.linalg as linalg
import scipy as sp
import scipy.optimize
import scipy.io
from itertools import product
import trep
import _trep
from _trep import _System
from frame import Frame
from finput import Input
from... | identifier can be the input name, index, or the
input itself. Raise an exception if no match is found. |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/**
* @author Oleksandr Prunyak (987456987p@gmail.com)
* @version $Id$
* @since 0.1<|fim▁hole|><|fim▁end|> | */
package ru.job4j.loop; |
<|file_name|>changes_listeners.js<|end_file_name|><|fim▁begin|>// This code (and its parent process in changes.js) is a Node.JS listener
// listening to CouchDB's _changes feed, and is derived from
// https://github.com/mikeal/node.couch.js and
// http://dominicbarnes.us/node-couchdb-api/api/database/changes.html
// It... | options.output_array = []
}
}) |
<|file_name|>partner.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Author: OpenDrive Ltda
# Copyright (c) 2013 Opendrive Ltda
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the w... | # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# |
<|file_name|>DOMActions.ts<|end_file_name|><|fim▁begin|>
module tsp.DOMActions {
try {<|fim▁hole|> global.refs.moduleTarget = tsp;
} finally { }
const fsa = FileSystemActions;
const ca = CommonActions;
const pa = ParserActions;
//#region DOM Actions
export interface IUglify {
... | require('./Refs'); |
<|file_name|>semisemver.go<|end_file_name|><|fim▁begin|>package utility
import (
"fmt"
"regexp"
"strconv"
"strings"
)
var semisemverLetter = regexp.MustCompile(`^([\d]+)\.([\d]+)\.([\d]+)([a-z]+)$`)<|fim▁hole|>func RewriteSemiSemVer(version string) string {
match := semisemverLetter.FindStringSubmatch(version)
... |
// for limited purpose of internal filtering/sorting non-standard semvers |
<|file_name|>test_track_view.py<|end_file_name|><|fim▁begin|>from rest_framework import status
from rest_framework.test import APITestCase, APIClient
from django.core.urlresolvers import reverse
<|fim▁hole|>
class TestTrackView(APITestCase):
fixtures = ['directory', 'file', 'playlist', 'track', 'user']
def s... | from cherrymusic.apps.core.models import User, Track
from cherrymusic.apps.api.v1.serializers import TrackSerializer
from cherrymusic.apps.api.v1.tests.views import UNAUTHENTICATED_RESPONSE |
<|file_name|>class_peta_poco_1_1_factory.js<|end_file_name|><|fim▁begin|>var class_peta_poco_1_1_factory =
[<|fim▁hole|><|fim▁end|> | [ "ProviderName", "class_peta_poco_1_1_factory.html#ab3fd0d733879b1a810f8d5e3731c721b", null ]
]; |
<|file_name|>rpa_ul_128.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
RPA Unlikelihood (128 model)
"""
from parlai.zoo.light_whoami... |
def download(datapath):
download_with_model_type(datapath, 'rpa_ul_128', 'v1.0') |
<|file_name|>rust_project.rs<|end_file_name|><|fim▁begin|>//! Library for generating rust_project.json files from a `Vec<CrateSpec>`
//! See official documentation of file format at https://rust-analyzer.github.io/manual.html
use std::collections::{BTreeMap, BTreeSet, HashMap};
use std::io::ErrorKind;
use std::path::P... | |
<|file_name|>asteroid-timer.en_GB.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fr">
<context>
<name></name>
<message id="id-app-launcher-name">
<location filename="asteroid-timer.desktop.h" line="6"/><|fim▁hole|></context>
</TS><|fim▁en... | <source>Timer</source>
<translation>Timer</translation>
</message> |
<|file_name|>0035_auto__del_field_trial_max_participants.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Trial.max... | 'group_a_expected': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'group_b': ('django.db.models.fields.TextField', [], {}),
'group_b_desc': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'group_b_impressed'... |
<|file_name|>path.rs<|end_file_name|><|fim▁begin|>use std::cmp;
use std::fmt::{self, Debug, Formatter};
use std::fs;
use std::io::prelude::*;
use std::path::{Path, PathBuf};
use filetime::FileTime;
use git2;
use glob::Pattern;
use core::{Package, PackageId, Summary, SourceId, Source, Dependency, Registry};
use ops;
u... | Ok(repo) => { |
<|file_name|>02-index-power.py<|end_file_name|><|fim▁begin|><|fim▁hole|>index_power=lambda a,n:a[n]**n if n<len(a)else-1<|fim▁end|> | |
<|file_name|>entry.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/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.