prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>LexException.java<|end_file_name|><|fim▁begin|>package br.com.ceducarneiro.analisadorsintatico;
public class LexException extends Exception {
private char badCh;
private int line, column;
<|fim▁hole|> this.line = line;
this.column = column;
}
@Override
public String to... | public LexException(int line, int column, char ch) {
badCh = ch; |
<|file_name|>test_with_fixture.py<|end_file_name|><|fim▁begin|>"""Tests for `fix.with_fixture`."""
from __future__ import with_statement
import os
import shutil
import tempfile
from types import FunctionType
from fix import with_fixture
def test_exists():
"""`fix.with_fixture` function exists"""
assert is... | def multiple(context): |
<|file_name|>iobuf.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use std::ops::{Deref, DerefMut};
use data_model::IoBufMut;
/// A trait for describing regions of m... | }
/// Convert this `OwnedIoBuf` back into the inner type.
pub fn into_inner<C: From<Box<[u8]>>>(self) -> C { |
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
#![macro_use]
macro_rules! check_pointer... | } |
<|file_name|>classglobal.js<|end_file_name|><|fim▁begin|>var classglobal =
[
[ "Buffer", "df/d84/classglobal.html#a77b5ab3a88955255ac7abc7251919fbc", null ],<|fim▁hole|> [ "run", "df/d84/classglobal.html#a917c15ea7d2eafaa6df0aea5868a86e7", null ],
[ "require", "df/d84/classglobal.html#a9b11defd1000737a5b70b5... | |
<|file_name|>graph.js<|end_file_name|><|fim▁begin|>/**
* Created by faspert on 28.04.2015.
*/
'use strict';
angular.module('gardenApp')
.directive('gvDygraph', function () {
<|fim▁hole|> //replace: 'true', // replace directive by template in html
template: '<div id="graphdiv"></div... | return {
restrict: 'EAC', //E = element, A = attribute, C = class, M = comment
scope: true , //use parent's scope
|
<|file_name|>authenticator_data.cc<|end_file_name|><|fim▁begin|>// Copyright 2017 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 "device/fido/authenticator_data.h"
#include <utility>
<|fim▁hole|>#include "comp... | #include "base/strings/string_number_conversions.h"
#include "components/cbor/diagnostic_writer.h"
#include "components/cbor/reader.h"
#include "components/cbor/writer.h" |
<|file_name|>emu.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|> $routeProvider
.when('/emu',{
templateUrl: 'views/emu.html',
controller: 'emuController',
controllerAs: 'emu'
});
});
})();<|fim▁end|> | ;(function(){
'use strict';
angular.module('TTT')
.config(function($routeProvider){ |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
#
# 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 t... | def deserialize(self, datum):
return ExamplePoint(datum[0], datum[1]) |
<|file_name|>NewDocumentDBConnectionCallout.tsx<|end_file_name|><|fim▁begin|>import React, { useState } from 'react';
import { NewConnectionCalloutProps } from './Callout.properties';
import { useTranslation } from 'react-i18next';
import CustomPivot from './customPivot/CustomPivot';
import RadioButtonNoFormik from '..... | />
{radioState === RadioState.documentAccount && <DocumentDBPivotDataLoader {...props} />} |
<|file_name|>ionic-page.ts<|end_file_name|><|fim▁begin|>/**
* @hidden
* public link interface
*/
export interface IonicPageMetadata {
name?: string;
segment?: string;
defaultHistory?: string[];
priority?: string;
}
/**
* @name IonicPage
* @description
* The Ionic Page handles registering and displaying s... | * Note: Even though the `name` is `detail-page`, the `segment` uses `detail/:id`, and the URL
* will use the `segment`. |
<|file_name|>event_emitter_spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {AsyncTestCompleter, beforeEach, describe, exp... | expect(error).toEqual('Boom'); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust.
// Copyright 2014 Vladimir "farcaller" Pouzanov <farcaller@gmail.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 cop... |
if dx >= dy {
let mut di = dy_x2 - dx; |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets... | })
} |
<|file_name|>pt_pt.js<|end_file_name|><|fim▁begin|>/*!
* froala_editor v3.2.5 (https://www.froala.com/wysiwyg-editor)
* License https://froala.com/wysiwyg-editor/terms/
* Copyright 2014-2020 Froala Labs
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(requir... | |
<|file_name|>atm-outlined.js<|end_file_name|><|fim▁begin|><|fim▁hole|> d: "M8 9v1.5h2.25V15h1.5v-4.5H14V9H8zM6 9H3c-.55 0-1 .45-1 1v5h1.5v-1.5h2V15H7v-5c0-.55-.45-1-1-1zm-.5 3h-2v-1.5h2V12zM21 9h-4.5c-.55 0-1 .45-1 1v5H17v-4.5h1V14h1.5v-3.51h1V15H22v-5c0-.55-.45-1-1-1z"
}), 'AtmOutlined');<|fim▁end|> | import { h } from 'omi';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(h("path", { |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import url, patterns
<|fim▁hole|><|fim▁end|> | urlpatterns = patterns('tutorial.views',
url(r'^$', 'tutorial', name='tutorial'),
) |
<|file_name|>test_udtf.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
#... | |
<|file_name|>PatchController.java<|end_file_name|><|fim▁begin|>package com.jy.controller.workflow.online.apply;
import com.jy.common.ajax.AjaxRes;
import com.jy.common.utils.DateUtils;
import com.jy.common.utils.base.Const;
import com.jy.common.utils.security.AccountShiroUtil;
import com.jy.controller.base.BaseControl... | |
<|file_name|>calc_delta_BC.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Calculate the change in the betweenness centrality of each residue over the
# course of an MD simulation
#
# Script distributed under GNU GPL 3.0
#<|fim▁hole|>import argparse, calc_delta
from lib.cli import CLI
from lib.utils import L... | # Author: David Brown
# Date: 17-11-2016
|
<|file_name|>0054_realm_icon.py<|end_file_name|><|fim▁begin|># Generated by Django 1.10.5 on 2017-02-15 06:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0053_emailchangestatus'),
]
operations = [
migrations.AddField(<|fim▁... | model_name='realm',
name='icon_source',
field=models.CharField( |
<|file_name|>exterior.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/licens... | #![feature(managed_boxes)]
use std::cell::Cell;
use std::gc::{Gc, GC}; |
<|file_name|>mockchain.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -tt
# by skvidal@fedoraproject.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 version 2 of the License, or
# ... | fail_file = resdir + '/fail'
if os.path.exists(success_file):
return 2, None, None, None |
<|file_name|>main_test.go<|end_file_name|><|fim▁begin|>package distribution
import (
"testing"
"github.com/ready-steady/assert"
)
func TestParse(t *testing.T) {
cases := []struct {
line string
success bool
}{
{"Beta(1, 1)", true},
{"beta(0.5, 1.5)", true},
{" Beta \t (1, 1)", true},
{"Gamma(1, 1)"... | {"beta(1, 0)", false},
{"beta(1, 0)", false},
{"uniform()", true}, |
<|file_name|>triggerbinding.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Tekton 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
Unle... |
// triggerBindingNamespaceLister implements the TriggerBindingNamespaceLister
// interface.
type triggerBindingNamespaceLister struct { |
<|file_name|>ledger.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go.
// source: common/ledger.proto
// DO NOT EDIT!
package common
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = ... | |
<|file_name|>flashVars.js<|end_file_name|><|fim▁begin|>//>>built
define("dojox/embed/flashVars",["dojo"],function(_1){
_1.deprecated("dojox.embed.flashVars","Will be removed in 2.0","2.0");
var _2={serialize:function(n,o){
var _3=function(_4){
if(typeof _4=="string"){
_4=_4.replace(/;/g,"_sc_");
_4=_4.replace(/\... | }); |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class LoCatrConfig(AppConfig):<|fim▁hole|><|fim▁end|> | name = 'LoCatr' |
<|file_name|>TestErasureCoderBase.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* ... | |
<|file_name|>en-au.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( 'fakeobjects', 'en-au', {
anchor: 'Anchor',
flash: 'Flash Animation',
... | unknown: 'Unknown Object'
} ); |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
simulation = "L500_NR_tracers"
dirs = {"sim_root_dir" : "/home/fas/nagai/kln26/group_scratch/L500_NR_tracers",
"db_dir" : "..",
"halo_catalog_dir" : "HC.500",
"profiles_dir" : "profiles",
"logs_dir" : "logs" }
hc_ra... | enabled_star_formation = False
enabled_epnoneq = False |
<|file_name|>documentlist.js<|end_file_name|><|fim▁begin|>if (NABUCCO === undefined || !NABUCCO)
{
var NABUCCO = {};
}
(function()
{
NABUCCO.component = NABUCCO.component || {};
NABUCCO.component.CMISDocumentList = function(htmlId)
{
// replace Bubbling.on with NO-OP, so the superclass can't ... | |
<|file_name|>blockcutter_test.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2016 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org... | mockconfig "github.com/hyperledger/fabric/common/mocks/config"
cb "github.com/hyperledger/fabric/protos/common"
ab "github.com/hyperledger/fabric/protos/orderer" |
<|file_name|>test_treeview.py<|end_file_name|><|fim▁begin|>import unittest
import random
import sys
import os
ETEPATH = os.path.abspath(os.path.split(os.path.realpath(__file__))[0]+'/../')
sys.path.insert(0, ETEPATH)
from ete2 import Tree, TreeStyle, NodeStyle, PhyloTree, faces, random_color
from ete2.treeview.faces ... | n.add_face(t_phylo, 0, "aligned") |
<|file_name|>snort-rule-tool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
import sys
import math
from PyQt5 import QtWidgets
from PyQt5 import QtGui
from PyQt5 import QtCore
from mainwindow import Ui_MainWindow
from scapy.all import *
""" dump any string, ascii or encoded, to formatted hex output """
def du... | self.ui.srcPortCombo.currentText(),
self.ui.dirCombo.currentText(),
self.ui.destCombo.currentText(), |
<|file_name|>ciphersuite.rs<|end_file_name|><|fim▁begin|>struct Ciphersuite {
code: u16,
kex_algo: ~str,
sig_algo: ~str,
cipher: ~str,
cipher_keylen: u8,
mac: ~str
}
impl Ciphersuite {
static fn new(suite: u16, kex_algo: ~str, sig_algo: ~str,
cipher: ~str, cipher_keylen:... | |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2019 Joan Marín <Github@JoanMarin>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Tax Group Types",
"category": "Financial",
"version": "10.0.1.0.0",<|fim▁hole|> "website": "https://... | "author": "EXA Auto Parts Github@exaap, "
"Joan Marín Github@JoanMarin", |
<|file_name|>cmp.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
// macro_rules! e {
// ($e:expr) => { $e }
// }
// macro_rules! tuple_impls {
// ($(
// $Tuple:ident {<|fim▁hole|> // $(($idx:tt) -> $T:ident)+
// }
// )+) =>... | |
<|file_name|>test_dependencies.py<|end_file_name|><|fim▁begin|>import pytest
import pytest
from cwltool.utils import onWindows
from .util import get_data, get_main_output, needs_docker
try:
from galaxy.tools import deps
except ImportError:
deps = None
@needs_docker
@pytest.mark.skipif(not deps, reason="ga... |
assert error_code == 0, stderr |
<|file_name|>get_all_networks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | # limitations under the License.
"""This example gets all networks. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>
from patient_evaluation_report import *<|fim▁end|> | |
<|file_name|>test_tasks_helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Unit tests for LMS instructor-initiated background tasks helper functions.
Tests that CSV grade report generation works with unicode emails.
"""
import ddt
from mock import Mock, patch
import tempfile
from openedx.core.djangoa... | [
dict(zip(self.csv_header_row, ['Does Not Exist', 'False', '0', ''])),
dict(zip(self.csv_header_row, ['Cohort 2', 'True', '1', ''])), |
<|file_name|>jft300m_vit_base16_finetune_cifar100.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Uncertainty Baselines 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 Licen... | |
<|file_name|>archives.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { ArchivesRoutingModule } from './archives-routing.module';
import { ArchiveDetailResolve } from './archive-detail/archive-detail-resolve.service';
impo... | import { ArchiveComponent } from './archive/archive.component'; |
<|file_name|>backbonemixin.js<|end_file_name|><|fim▁begin|>/* Taken from a very informative blogpost by Eldar Djafarov:
* http://eldar.djafarov.com/2013/11/reactjs-mixing-with-backbone/
*/
(function() {
'use strict';
module.exports = {
/* Forces an update when the underlying Backbone model instance has
*... | }; |
<|file_name|>FastBloomFilter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
from FastBitSet import FastBitSet
import math
import mmh3
class FastBloomFilter(object):
mask32 = 0xffffffff
mask64 = 0xffffffffffffffff
mask128 = 0xffffffffffffffffffffffffffffffff
... | self.n = int(math.ceil(n))
self.fpr = fpr
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
watdo.tests
~~~~~~~~~~~
This module contains tests for watdo.<|fim▁hole|> :license: MIT, see LICENSE for more details.
'''<|fim▁end|> | This particular file contains tools for testing.
:copyright: (c) 2013 Markus Unterwaditzer |
<|file_name|>unregister.js<|end_file_name|><|fim▁begin|>var expect = require('expect.js');
var helpers = require('../helpers');
var fakeRepositoryFactory = function () {
function FakeRepository() { }
FakeRepository.prototype.getRegistryClient = function () {
return {
unregister: function (... | return helpers.run(unregister).fail(function (reason) { |
<|file_name|>putProducer.go<|end_file_name|><|fim▁begin|>package helpers
import (
"fmt"
"github.com/SpectraLogic/ds3_go_sdk/ds3"
ds3Models "github.com/SpectraLogic/ds3_go_sdk/ds3/models"
helperModels "github.com/SpectraLogic/ds3_go_sdk/helpers/models"
"github.com/SpectraLogic/ds3_go_sdk/sdk_log"
... | defer close(*producer.queue)
// determine number of blobs to be processed
totalBlobCount := producer.totalBlobCount() |
<|file_name|>recipeReport.js<|end_file_name|><|fim▁begin|>var RecipeReport = (function () {
"use strict";
var standartThaaliCount = 100;
var sum = function(array, prop) {
return array.reduce( function(a, b){
return a + b[prop];
}, 0);
};
var recipeReport = function (data, fromDate, toDa... | this.toDate = toDate;
this.recipe = recipe; |
<|file_name|>resource_aws_db_proxy_target.go<|end_file_name|><|fim▁begin|>package aws
import (
"fmt"
"log"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/rds"
"github.com/hashicorp/aws-sdk-go-base/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/... | d.Set("target_group_name", targetGroupName)
d.Set("tracked_cluster_id", dbProxyTarget.TrackedClusterId)
d.Set("type", dbProxyTarget.Type) |
<|file_name|>tracklist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-<|fim▁hole|>from __future__ import unicode_literals
from lxml import html
from tinydb import TinyDB, Query
import requests
from . import get_logger, CONFIG
class TracklistManager(object):
db = TinyDB(CONFIG["tech... | |
<|file_name|>get_defs.py<|end_file_name|><|fim▁begin|>import json
import sys<|fim▁hole|>for e in data.itervalues():
if e['senses'] and e['senses'][0]['definition']:
print u"{0}\t{1}".format(
e['hw'], e['senses'][0]['definition']['sen']).encode('utf-8')<|fim▁end|> |
data = json.load(sys.stdin) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth import logout as auth_logout
from django.contrib.auth.decorators import login_required
from django.http import *
from django.template import Template, Context
from django.shortcuts import render_to_response, redirect, render, RequestContext, Ht... | def logout(request):
auth_logout(request)
return redirect('/') |
<|file_name|>PetRepositoryStubTest.java<|end_file_name|><|fim▁begin|>package com.softserve.app.repository;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.List;<|fim▁hole|>import org.junit.T... | |
<|file_name|>signed_url_builder.rs<|end_file_name|><|fim▁begin|>use crate::blob::generate_blob_uri;
use azure_sdk_core::{
BlobNameRequired, BlobNameSupport, ContainerNameRequired, ContainerNameSupport, No, ToAssign,
Yes,
};
use azure_sdk_storage_core::prelude::*;
use azure_sdk_storage_core::{
shared_access_... | p_blob_name: PhantomData {},
p_signature: PhantomData {},
container_name: self.container_name,
blob_name: self.blob_name, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from common.utils import encapsulate
from documents.models import Document
from documents.permissions import (PERMISSION_DOCUMENT_NEW_VERSION,
PERMISSION_DOCUMENT_CR... |
staging_file_preview = {'text': _(u'preview'), 'class': 'fancybox-noscaling', 'view': 'staging_file_preview', 'args': ['source.source_type', 'source.pk', 'object.id'], 'famfam': 'zoom', 'permissions': [PERMISSION_DOCUMENT_NEW_VERSION, PERMISSION_DOCUMENT_CREATE]}
staging_file_delete = {'text': _(u'delete'), 'view': 's... |
<|file_name|>person.ts<|end_file_name|><|fim▁begin|>export interface Person {
id: number;<|fim▁hole|> weight: number;
profession?: string;
}<|fim▁end|> | name: string;
height: number; |
<|file_name|>gdaldither.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
* $Id: gdaldither.cpp 33715 2016-03-13 08:52:06Z goatbar $
*
* Project: CIETMap Phase 2
* Purpose: Convert RGB (24bit) to a pseudo-colored approximation using
* Floyd... | nBestDist = anDistance[8+6];
} |
<|file_name|>jmx.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License... | - we assume the service using JmxMixin also uses KafkaPathResolverMixin
"""
def __init__(self, num_nodes, jmx_object_names=None, jmx_attributes=None): |
<|file_name|>augment.py<|end_file_name|><|fim▁begin|># -*- test-case-name: txdav.who.test.test_augment -*-
##
# Copyright (c) 2013-2017 Apple Inc. 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 ... | self, *args, **kwds
) |
<|file_name|>args1.rs<|end_file_name|><|fim▁begin|>// args1.rs
use std::env;
<|fim▁hole|>}<|fim▁end|> | fn main() {
let first = env::args().nth(1).expect("please supply an argument");
let n: i32 = first.parse().expect("not an integer!");
// do your magic |
<|file_name|>packing_test.go<|end_file_name|><|fim▁begin|>// Copyright 2020 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library 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... | packed: "0000000000000000000000000000000000000000000000000000000000000001" +
"0000000000000000000000000000000000000000000000000000000000000002" +
"0000000000000000000000000000000000000000000000000000000000000001" +
"0000000000000000000000000000000000000000000000000000000000000002", |
<|file_name|>sub_dataset.py<|end_file_name|><|fim▁begin|>import numpy
import six
from chainer.dataset import dataset_mixin
class SubDataset(dataset_mixin.DatasetMixin):
"""Subset of a base dataset.
SubDataset defines a subset of a given base dataset. The subset is defined
as an interval of indexes, opt... |
return splits |
<|file_name|>connector_test.go<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under... | assertNot(t, len(metadata.TopicMetadata), 0)
if len(metadata.Brokers) > 1 {
t.Skip("Cluster should consist only of one broker for this test to run.")
} |
<|file_name|>clamav.py<|end_file_name|><|fim▁begin|># This file is part of Viper - https://github.com/botherder/viper
# See the file 'LICENSE' for copying permission.
import getopt
try:
import pyclamd
HAVE_CLAMD = True
except ImportError:
HAVE_CLAMD = False
from viper.common.out import *
from viper.commo... | return
found = None
name = 'not found' |
<|file_name|>transfer.rs<|end_file_name|><|fim▁begin|>use params::{List, Metadata, Timestamp};
use resources::Currency;
/// The resource representing a Stripe transfer reversal.
///
/// For more details see https://stripe.com/docs/api#transfer_reversal_object.
#[derive(Debug, Deserialize, Serialize)]
pub struct Transf... | /// For more details see https://stripe.com/docs/api#transfer_object.
#[derive(Debug, Deserialize, Serialize)]
pub struct Transfer {
pub id: String, |
<|file_name|>token_store_test.go<|end_file_name|><|fim▁begin|>package vault
import (
"context"
"encoding/json"
"fmt"
"path"
"reflect"
"sort"
"strings"
"sync"
"sync/atomic"
"testing"
"time"
hclog "github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-uuid"
"github.com/hashicorp/vault/helper/locksutil"
... | t.Fatal(err) |
<|file_name|>Pali.java<|end_file_name|><|fim▁begin|>import java.util.*;
public class Pali {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
String str=sc.next();
StringBuffer buff=new StringBuffer(str).reverse();<|fim▁hole|> }
else
{
... | String str1=buff.toString();
if(str.isequals(str1))
{
System.out.println("Palindrome"); |
<|file_name|>flexberry-wfs-filter.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { default } from 'ember-flexberry-gis/components/flexberry-wfs-filter'; |
<|file_name|>postgresql.py<|end_file_name|><|fim▁begin|>import logging
import traceback
from functools import wraps
import os
import re
from django.conf import settings
from django.db import connection
from django.db.models import ManyToManyField
logger = logging.getLogger(__name__)
def debug_pg_notices(f):
@w... | except ValueError:
context = '' |
<|file_name|>logging.cpp<|end_file_name|><|fim▁begin|>#include "logging.hpp"
#include <fstream>
#include <boost/log/sinks/text_file_backend.hpp>
#include <boost/log/utility/setup/file.hpp>
#include <boost/log/utility/setup/common_attributes.hpp>
#include <boost/log/sinks.hpp>
namespace p2l { namespace common {
//... | ( boost::make_shared< std::ofstream >( "default_log.log" ) );
boost::log::core::get()->add_sink( default_sink );
|
<|file_name|>interner.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ordering;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::ops::Deref;
use Result;
use base::fnv::FnvMap;
use gc::{GcPtr, Gc, Traverseable};
use array::Str;
/// Interned strings which allow for fast equality checks and hashing
#[derive(Copy, Clo... | impl fmt::Display for InternedStr { |
<|file_name|>335. Self Crossing.py<|end_file_name|><|fim▁begin|>class Solution(object):
def isSelfCrossing(self, x):<|fim▁hole|> """
:type x: List[int]
:rtype: bool
"""
inf = float('inf')
n = len(x)
if n < 3:
return False
ruld = [0, 0, 0, 0... | |
<|file_name|>save_results.py<|end_file_name|><|fim▁begin|># argv[1] - file path to main folder (like $HOME/dsge-models)
# argv[2] - name of model (e.g. 'dsf' or 'nk' or 'ca')
from scipy.io import loadmat
from sys import argv
from json import load
TT = 30 # how many periods of results to send
mode... | |
<|file_name|>no-tabs.js<|end_file_name|><|fim▁begin|>/**
* @fileoverview Rule to check for tabs inside a file
* @author Gyandeep Singh
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//---------------------------------------------------------------------... | }
}; |
<|file_name|>resource_aws_cloudformation_stack.go<|end_file_name|><|fim▁begin|>package aws
import (
"fmt"
"log"
"regexp"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/cloudformation"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/terraf... | "DELETE_FAILED",
"ROLLBACK_COMPLETE", |
<|file_name|>inventory.cpp<|end_file_name|><|fim▁begin|>/*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
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... | name = fnd.next("\"");
} else { // No luck, just read a word then |
<|file_name|>CBLoopViewPager.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 Leszek Mzyk
*
* 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/licens... |
@Override |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var yeoman = require('yeoman-generator');
var yosay = require('yosay');
var chalk = require('chalk');
var _ = require('lodash');
module.exports = yeoman.generators.Base.extend({
/**
* Constructor
* @return {undefined}
*/
construct... | gulp: function() {
this.copy('gulpfile.js', 'gulpfile.js'); |
<|file_name|>AtomicFieldUpdaterClass.java<|end_file_name|><|fim▁begin|>package uk.co.automatictester.concurrency.classes.atomic;
import org.testng.annotations.Test;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurre... | latch.await(); |
<|file_name|>r112.py<|end_file_name|><|fim▁begin|>""" Python's random module includes a function choice(data) that returns a
random element from a non-empty sequence. The random module includes
a more basic function randrange, with parametrization similar to
the built-in range function, that return a random choice from... | True, True, True, True, True, True, True, True, True, True, \
True, True, True, True, True, True, True, True, True, True, \
True, True, True, True, True, True, True, True, True, True, \ |
<|file_name|>ViewPagerAdapter.java<|end_file_name|><|fim▁begin|>package com.mbpr.gengjian.playface;
import java.util.List;
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
/**
* Created by gengjian on 15/12/23.
*/
publi... | public int getCount() {
return views.size(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# 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... | from ._models import MultiLanguageInput # type: ignore |
<|file_name|>ConfigLocationLiteVoAssembler.java<|end_file_name|><|fim▁begin|>//#############################################################################
//# #
//# Copyright (C) <2015> <IMS MAXIMS> #
... | ims.core.resource.place.domain.objects.Location domainObject = (ims.core.resource.place.domain.objects.Location) iterator.next();
|
<|file_name|>nsNoDataProtocolContentPolicy.cpp<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 obtai... | }
}
|
<|file_name|>courses_integration_tests.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.ap... | # distributed under the License is distributed on an "AS-IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License. |
<|file_name|>DescribeReplicationGroupsResult.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2017 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 License ... | { |
<|file_name|>parser.py<|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.
# ----------------... | |
<|file_name|>Utils.java<|end_file_name|><|fim▁begin|>package utils;
import java.io.*;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.Cal... | public static String wordFromScanner(Scanner scanner) {
|
<|file_name|>dash_handler_template.py<|end_file_name|><|fim▁begin|>from {{appname}}.handlers.powhandler import PowHandler
from {{appname}}.conf.config import myapp
from {{appname}}.lib.application import app
import simplejson as json
import tornado.web
from tornado import gen
from {{appname}}.pow_dash import dispatcher... | self.set_header('Content-Type', "text/html")
self.render("dash_index.tmpl", dash_block=retval)
# self.success(template="index.tmpl", dash_block=retval, data=res )
|
<|file_name|>tukeys_filter.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import sys
import itertools
from time import time
from lib.modules.base_task import BaseTask
from lib.modules.helper import extract_service_name, get_closest_datapoint
from lib.modules.models import TimeSeriesTuple
class TukeysFilter(BaseTask):
... | """
Outlier Detection using Tukeys Filter Class
""" |
<|file_name|>numberwidget.py<|end_file_name|><|fim▁begin|>import os
from PyQt4.QtCore import pyqtSignal
from PyQt4.QtGui import QComboBox, QDoubleValidator
from configmanager.editorwidgets.core import ConfigWidget
from configmanager.editorwidgets.uifiles.ui_numberwidget_config import Ui_Form
class NumberWidgetConfig... | suffix = config.get('suffix', '')
self.minEdit.setText(min)
self.maxEdit.setText(max) |
<|file_name|>dictionary.cpp<|end_file_name|><|fim▁begin|>// tinygettext - A gettext replacement that works directly on .po files
// Copyright (C) 2006 Ingo Ruhnke <grumbel@gmx.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// a... | if (i != dict.end() && !i->second.empty()) |
<|file_name|>uniprot.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import pytest
from tests.factories import UniprotFactory
<|fim▁hole|>def uniprot_egfr_human():
return UniprotFactory(
uniprot_acc='P00533',
uniprot_id='EGFR_HUMAN',
description='Epidermal growth fact... |
@pytest.fixture |
<|file_name|>portfolio.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';
import { finalize, map } from 'rxjs/operators';
import { environment } from '../../environments/environment';<|fim▁h... |
import * as _ from 'lodash';
@Component({ |
<|file_name|>test_gencumsky.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Fri Jul 27 10:08:25 2018
@author: cdeline
Using pytest to create unit tests for gencumulativesky.<|fim▁hole|>to run coverage tests, run py.test --cov-report term-missing --cov=bifacial_radiance
"""
#from bifacial_radi... | Note that this can't be included in the repo until TravisCI has a Linux version of gencumsky
set up in .travis.yml
to run unit tests, run pytest from the command line in the bifacial_radiance directory |
<|file_name|>soundscape.py<|end_file_name|><|fim▁begin|># Python 3 program for soundscape generation. (C) P.B.L. Meijer 2015
# Direct port of the hificode.c C program
# Last update: October 6, 2015; released under the Creative
# Commons Attribution 4.0 International License (CC BY 4.0),
# see http://www.seeingwithsound... | current_frame += 1 |
<|file_name|>m.js<|end_file_name|><|fim▁begin|>var my = require('my');
var maxHeight = 300, maxWidth = 300;
exports.view = function(data) {
console.log("view: m.js");
console.log(data);
var topic = data.topic;
return(
my.page({title: 'Hello World', scripts:["http://code.jquery.com/jquery-latest.js"]},
... | 'margin-top': vGap,
'margin-left': hGap,
'max-width': thumbWidth,
'max-height': thumbHeight, |
<|file_name|>services.func.js<|end_file_name|><|fim▁begin|>import Services from '../src/lib/services';
const _ = require('lodash');
require('db-migrate-mysql');
const expect = require('unexpected');
const request = require('./request.func');
let rds;
class Email {
// eslint-disable-next-line
sendHtml() {
ret... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.