prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core';
import {OnInit, AfterContentInit, AfterViewInit} from '@angular/core';
@Component({
selector: 'yw-app',
template: `
<div class="container-fluid">
<yw-messages [messages]="logMessages">
<header>
... | <p>--- End of messages</p>
</footer>
</yw-messages>
</div> |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>fin = open("routesRaw.txt", "r")
routes = {}
<|fim▁hole|> operationId = xs[2]
stepNumber = int(xs[3].replace("\n", ""))
if (routeId in routes):
routes[routeId].append(operationId)
else:
routes[routeId] = []
routes[routeId].append(operationId)
if (l... | for x in fin:
xs = x.split("\t")
routeId = xs[1]
|
<|file_name|>dnos9.py<|end_file_name|><|fim▁begin|># This file is part of Ansible
#
# Ansible 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 option) any later ve... | description:
- Instructs the module to enter priviledged mode on the remote device
before sending any commands. If not specified, the device will
attempt to excecute all commands in non-priviledged mode. If the value |
<|file_name|>Layout.js<|end_file_name|><|fim▁begin|>// @flow
/* eslint-disable react/no-danger */
// $FlowMeteor
import { find, propEq } from "ramda";
import { Link } from "react-router";
import Split, {
Left,
Right,
} from "../../../components/@primitives/layout/split";
import Meta from "../../../components/share... | account.images
? find(propEq("fileLabel", "2:1"), account.images).cloudfront
: account.image
} |
<|file_name|>unwind-tup.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.
//<|fim▁hole|>// except according to those terms.
// error-pattern:fail
fn fold_local() -> @~[int]{... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed |
<|file_name|>tone_gen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from sys import argv, stderr<|fim▁hole|>e.g.: {program} 64000 442.0 5
""".format(program=argv[0])
if len(argv) < 3 or len(argv) > 4 :
print(usage, file = stderr)
exit(1)
A4 = 0
sample_rate = 0
octaves = 8
try:
A4 = float(argv[2])... |
usage = \
"""
Usage: {program} <sample rate> <A4 freq.> [octaves=8] |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or 'hard to guess string'
SSL_DISVBLE = True
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
SQLALCHEMY_TRACK_MODIFICAT... | |
<|file_name|>ExcelException.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2015 SK holdings Co., Ltd. All rights reserved.
* This software is the confidential and proprietary information of SK holdings.
* You shall not disclose such confidential information and shall use it only in
* accordance with the term... | public ExcelException(String message, String logType) {
super(message, logType); |
<|file_name|>tableDynamicSpec.ts<|end_file_name|><|fim▁begin|>describe('ng-table-dynamic', function() {
interface IPerson {
id?: number;
name?: string;
age: number;
money?: number;
}
interface IExtendedDynamicTableColDef extends NgTable.Columns.IDynamicTableCo... | }
function getNamesAsPromise(/*$column*/) { |
<|file_name|>TableCodec.java<|end_file_name|><|fim▁begin|>package org.broadinstitute.sting.utils.codecs.table;
import org.broad.tribble.Feature;
import org.broad.tribble.readers.LineReader;
import org.broadinstitute.sting.gatk.refdata.ReferenceDependentFeatureCodec;
import org.broadinstitute.sting.utils.GenomeLocParse... | * 1:3 7 8 9
* </pre> |
<|file_name|>CharacterHandler.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public Lice... | |
<|file_name|>0020_modify_citeria.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def add_criteria(apps, schema_editor):
Criterion = apps.get_model('activities', 'Criterion')<|fim▁hole|> ar_name="ال... | StudentClubYear = apps.get_model('core', 'StudentClubYear')
year_2015_2016 = StudentClubYear.objects.get(start_date__year=2015,
end_date__year=2016)
Criterion.objects.create(year=year_2015_2016, |
<|file_name|>reshape.py<|end_file_name|><|fim▁begin|># pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
from pandas.compat import range, zip
from pandas import compat
import itertools
import numpy as np
from pandas.core.series import Series
from pandas.core.frame import DataFrame
from pandas.cor... | self.values = values
self.value_columns = value_columns
|
<|file_name|>release_testing_test.go<|end_file_name|><|fim▁begin|>/*
Copyright The Helm 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<|fim▁hole|>
Unless required by applicable law or agre... |
http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>containers.py<|end_file_name|><|fim▁begin|>import six
import warnings
from .. import errors
from ..utils.utils import (
convert_port_bindings, convert_tmpfs_mounts, convert_volume_binds,
format_environment, normalize_links, parse_bytes, parse_devices,
split_command, version_gte, version_lt,
)
... | def set_config_value(self, key, value):
self.config[key] = value |
<|file_name|>github.com.js<|end_file_name|><|fim▁begin|>if (Zepto.ajax.restore) {
Zepto.ajax.restore();
}
sinon.stub(Zepto, "ajax")
.yieldsTo("success", {
responseStatus : 200,
responseDetails : null,
responseData : {
feed: {
link : "http://github.com",
title : "GitHub Pu... | }
}
}); |
<|file_name|>publisher.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2013, salesforce.com, inc.
// 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... | |
<|file_name|>hold.rs<|end_file_name|><|fim▁begin|>use std::io::{self, Read, Write};
use crate::BufferRedirect;
/// Hold output until dropped. On drop, the held output is sent to the stdout/stderr.
///
/// Note: This will ignore IO errors when printing held output.
pub struct Hold {
buf_redir: Option<BufferRedirect... | read_into(from, stdout.lock());
} else { |
<|file_name|>celery.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import<|fim▁hole|>import os
from celery import Celery
from django.conf import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'assembly.settings.local')
app = Celery('assembly')
app.config_from_object('django.conf:settings... | |
<|file_name|>PartContextMenu.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012-2015 S-Core Co., 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/licens... | |
<|file_name|>O2AInterfaceExample.java<|end_file_name|><|fim▁begin|>/*****************************************************************
<|fim▁hole|>
GNU Lesser General Public License
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as p... | JADE - Java Agent DEvelopment Framework is a framework to develop
multi-agent systems in compliance with the FIPA specifications.
Copyright (C) 2000 CSELT S.p.A.
|
<|file_name|>event_details_converter.py<|end_file_name|><|fim▁begin|>from collections import defaultdict<|fim▁hole|>
from backend.common.consts.api_version import ApiMajorVersion
from backend.common.models.event_details import EventDetails
from backend.common.models.keys import TeamKey
from backend.common.queries.dict_... | from typing import cast, Dict, List, NewType |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from flask import render_template
from . import auth
<|fim▁hole|><|fim▁end|> |
@auth.route('/login')
def login():
return render_template('auth/login.html') |
<|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.
*/
mod checker;
#[cfg(fbcode_build)]
mod facebook;
mod identity;
mod membership;
#[cfg(not(fb... | pub use checker::{
ArcPermissionChecker, BoxPermissionChecker, PermissionChecker, PermissionCheckerBuilder,
};
pub use identity::{MononokeIdentity, MononokeIdentitySet, MononokeIdentitySetExt}; |
<|file_name|>row.rs<|end_file_name|><|fim▁begin|>use blas::{Copy, Gemv};
use Forward;
use onezero::{One, Zero};
use ops::{set, self};
use traits::Transpose as _0;
use traits::{Matrix, Set, Slice, SliceMut};
use {Product, RowMut, Row, RowVec, Scaled, SubMat, Transposed};
// NOTE Core
impl<'a, T> Set<T> for RowMut<'a, ... | fn set(&mut self, rhs: Scaled<Product<Row<T>, SubMat<T>>>) { |
<|file_name|>container_resize_test.go<|end_file_name|><|fim▁begin|>package client // import "github.com/docker/docker/client"
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"net/http"
"strings"
"testing"
"github.com/docker/docker/api/types"
)
func TestContainerResizeError(t *testing.T) {
client := &Client{
... | |
<|file_name|>interrupt.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box;
use collections::string::ToString;<|fim▁hole|>
use system::error::Result;
pub struct InterruptScheme;
static IRQ_NAME: [&'static str; 16] = [
"Programmable Interval Timer",
"Keyboard",
"Cascade",
"Serial 2 and 4",
"Seri... |
use fs::{KScheme, Resource, Url, VecResource}; |
<|file_name|>drive.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0<Paste>
use super::super::VmmAction;
use crate::parsed_request::{checked_id, Error, ParsedRequest};
use crate::request::{Body, StatusCode};
use logger::{In... | |
<|file_name|>stdio.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/... | ///
/// Note that logging macros do not use this stream. Using the logging macros
/// will emit output to stderr, and while they are line buffered the log |
<|file_name|>convolutional.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
import theano
import theano.tensor as T
from theano.tensor.signal import downsample
from .. import activations, initializations
from ..utils.theano_utils import shared_zeros
from ..layers.core imp... | W_regularizer.set_param(self.W)
self.regularizers.append(W_regularizer) |
<|file_name|>privatethreads.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from misago.threads.views.privatethreads import PrivateThreadsView
urlpatterns = patterns('',
url(r'^private-threads/$', PrivateThreadsView.as_view(), name='private_threads'),
url(r'^private-threads... | RemoveThreadParticipantView,
LeaveThreadView)
urlpatterns += patterns('', |
<|file_name|>manual.rs<|end_file_name|><|fim▁begin|>extern crate ralloc;
use std::ptr;
fn main() {
let ptr1 = ralloc::alloc(30, 3);
let ptr2 = ralloc::alloc(500, 20);
assert_eq!(0, ptr1 as usize % 3);
assert_eq!(0, ptr2 as usize % 20);
unsafe {
ptr::write_bytes(ptr1, 0x22, 30);
f... | ralloc::free(ptr1, 30);
ralloc::free(ptr2, 500); |
<|file_name|>NotFound.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
function NotFound() {
return <div>Not found!</div>;
}
<|fim▁hole|><|fim▁end|> | export default NotFound; |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | # installed something.
mkdir(prefix.lib) |
<|file_name|>inner.rs<|end_file_name|><|fim▁begin|>use crate::types::*;
use ndarray::*;
/// Inner Product
///
/// Differenct from `Dot` trait, this take complex conjugate of `self` elements
///
pub trait InnerProduct {
type Elem: Scalar;
/// Inner product `(self.conjugate, rhs)
fn inner<S>(&self, rhs: &Ar... | {
type Elem = A;
fn inner<St: Data<Elem = A>>(&self, rhs: &ArrayBase<St, Ix1>) -> A { |
<|file_name|>cleanup_streams.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand
from stream_analysis.utils import cleanup
<|fim▁hole|> """
help = "Removes streaming data we no longer need."
def handle(self, *args, **options):
cleanup()<|fim▁end|> | class Command(BaseCommand):
"""
Removes streaming data we no longer need. |
<|file_name|>asmwriter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# convert LLVM GenAsmWriter.inc for Capstone disassembler.
# by Nguyen Anh Quynh, 2019
import sys
if len(sys.argv) == 1:
print("Syntax: %s <GenAsmWriter.inc> <Output-GenAsmWriter.inc> <Output-GenRegisterName.inc> <arch>" %sys.argv[0])
sy... | break
|
<|file_name|>PaletteFile.py<|end_file_name|><|fim▁begin|>#
# Python Imaging Library
# $Id$
#
# stuff to read simple, teragon-style palette files
#
# History:
# 97-08-23 fl Created
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1997.
#
# See the README file for information on usage and re... | if not s:
break
if s[0:1] == b"#": |
<|file_name|>resource_aws_apigatewayv2_route_test.go<|end_file_name|><|fim▁begin|>package aws
import (
"fmt"
"strings"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/apigatewayv2"
"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk... | } |
<|file_name|>validators.js<|end_file_name|><|fim▁begin|>/**
* Created by suman on 09/05/16.
*/
var core = require('chanakya'),
http = require('http'),
Q = require('q');
core.validator('isPhoneno', function (message) {
var deferred = Q.defer();
http.get('http://apilayer.net/api/validate?access_key=eba101687... | }); |
<|file_name|>InvertedIndexUtils.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to ... | throws HyracksDataException {
return new PartitionedInMemoryInvertedIndex(memBufferCache, virtualFreePageManager, invListTypeTraits, |
<|file_name|>Python_To_Arduino_Communication.py<|end_file_name|><|fim▁begin|><|fim▁hole|>ser = serial.Serial('COM9', 9600)
ser.write(b'5~')
ser.close()<|fim▁end|> | #!/usr/bin/python
import serial |
<|file_name|>launcher.rs<|end_file_name|><|fim▁begin|>use services::*;
use super::prelude::*;
use models::launcher::*;
use utils::convertor::VecConvertor;
use params::*;
pub fn init_router(router: &mut Router) {
router.get("/api/launcher/check_update/", do_check_update);
router.get("/api/launcher/home/", do_kin... | result.version_name = launcher.version_name;
result.apk_url = launcher.apk_url;
result.update_desc = launcher.update_desc; |
<|file_name|>BindingTest.cc<|end_file_name|><|fim▁begin|>// Copyright 2010 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
//
// http://www.apache.org/licenses/LICENSE-2... | EXPECT_EQ(0, ob1.observe_count_); |
<|file_name|>key_names.go<|end_file_name|><|fim▁begin|><|fim▁hole|>Copyright 2020, Cossack Labs Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
U... | /* |
<|file_name|>10.26.cc<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | //同一个键的值连续存储,使用find产生的迭代器连续删除n次,n是该键对应的值的个数 |
<|file_name|>conf_generator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import sys
import subprocess
import os
import commands
CLIENT_CN = sys.argv[1]
SEP = '==========> '
OVPN_ROOT='/etc/openvpn/'
ERSA=OVPN_ROOT+'easy-rsa-release-2.x/easy-rsa/2.0/keys/'
IP_PLACEHOLDER = 'placeholder_ip'
TA_PLACEHOLDER = 'plac... | conf.close()
open(OVPN_ROOT+'ccd/'+CLIENT_CN, 'w').close()
|
<|file_name|>CmsEntity.java<|end_file_name|><|fim▁begin|>/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (C) Alkacon Software (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU L... |
/**
|
<|file_name|>show_in_website_for_template_item.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import frappe
import frappe.website.render
<|fim▁hole|>def execute():
for item_code in frappe.db.sql_list("""select distinct variant_of from `tabItem`
where variant_of is not null and variant_of !='... | |
<|file_name|>configparser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
#
# AuthorDetector
# Copyright (C) 2013 Larroque Stephen
#
# 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 F... | ## Filter efficiently Javascript-like inline and multiline comments from a JSON file
# Author: WizKid https://gist.github.com/WizKid/1170297 |
<|file_name|>workerTest.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015-2021 Regents of the University of California
#
# 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... | jobDesc1 = createTestJobDesc(1, 2, 3, True, False)
jobDesc2 = createTestJobDesc(1, 2, 3, True, False)
jobDesc3 = createTestJobDesc(1, 2, 3, True, False) |
<|file_name|>exames.server.controller.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
errorHandler = require('./errors.server.controller'),
Exame = mongoose.model('Exame'),
_ = require('lodash');
/**
* Create a Exame
*/
exports.create = function(r... | // };
|
<|file_name|>gen_user_followers.py<|end_file_name|><|fim▁begin|>from datetime import *
from Tweetstream import *
from UserAnalyser import *
from TimeAnalyser import *
import math
import sys
import pickle
#Frequency over the common
def load_list(filein):
d = dict()
for l in filein:
l = eval(l)
d[l[0]] = l[1]
ret... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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:... | |
<|file_name|>Solution2.java<|end_file_name|><|fim▁begin|>package contests;
/**
* Created by sherxon on 2/27/17.
*/
public class Solution2 {
public static void main(String[] args) {
}
static public String shortestPalindrome(String s) {
if (s.length() <= 1) return s;
char[] a = s.toCharA... | i = 0;
}
} |
<|file_name|>up_action.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard W. Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "So... | # The action's image (displayed on tool bar tools etc): |
<|file_name|>ssh.py<|end_file_name|><|fim▁begin|>import os
import subprocess
SSH_OPTIONS = ['-o', 'StrictHostKeyChecking=no', '-o', 'PreferredAuthentications=publickey', '-o', 'PubkeyAuthentication=yes']
def rsync_get_file(uri_from, uri_to, user, host, port, key):
cmd = [
'rsync',
'-e',
'... | cmd = [
'ssh',
'-i', key, |
<|file_name|>b-dummy-module-loader.ts<|end_file_name|><|fim▁begin|>/*!
* V4Fire Client Core
* https://github.com/V4Fire/Client
*
* Released under the MIT license
* https://github.com/V4Fire/Client/blob/master/LICENSE
*/
/**
* [[include:dummies/b-dummy-module-loader/README.md]]
* @packageDocumentation
*/
impo... | functional: true, |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>/* Aurélien DESBRIÈRES
aurelien(at)hackers(dot)camp
License GNU GPL latest */
// Rust experimentations ───────────────┐
// Std Library Result ──────────────────┘
mod checked {
// Mathematical "errors" we want to catch
#[derive(Debug)]
pub enum MathError {
... | |
<|file_name|>toggledlabelframe.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
""""""
import tkinter as tk
from tkinter import ttk
# http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/ttk-LabelFrame.html
__title__ = "ToggledLabelFrame"
__version__ = "1.2.5"
__author__ = "Defla... |
def toggle(self):
"""Switches the LabelFrame to the opposite state."""
self._variable.set(not self._variable.get())
|
<|file_name|>CustomRenderer.py<|end_file_name|><|fim▁begin|>import sys
import wx
import wx.dataview as dv
#import os; print('PID:'+str(os.getpid())); raw_input("Press enter...")
#----------------------------------------------------------------------
class MyCustomRenderer(dv.DataViewCustomRenderer):
def __init__... | return self.value
def GetSize(self):
# Return the size needed to display the value. The renderer |
<|file_name|>doc.py<|end_file_name|><|fim▁begin|># (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# Ansible 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 option... | |
<|file_name|>roundtripper_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The daxxcoreAuthors<|fim▁hole|>// The daxxcore 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 Free Software Foundation, either version 3... | // This file is part of the daxxcore library.
// |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | module.exports = require('./lib/socket.io'); |
<|file_name|>accesslog.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.14.0
// source: envoy/config/filter/accesslog/v2/accesslog.proto
package envoy_config_filter_accesslog_v2
import (
_ "github.com/cncf/xds/go/udpa/anno... | |
<|file_name|>plotting.py<|end_file_name|><|fim▁begin|># being a bit too dynamic
# pylint: disable=E1101
import datetime
import warnings
import re
from math import ceil
from collections import namedtuple
from contextlib import contextmanager
from distutils.version import LooseVersion
import numpy as np
from pandas.uti... | values = values[~com.isnull(values)]
|
<|file_name|>test_indexing.py<|end_file_name|><|fim▁begin|>from datetime import (
datetime,
timedelta,
)
import re
import numpy as np
import pytest
from pandas import (
Index,
NaT,
Timedelta,
TimedeltaIndex,
Timestamp,
notna,
timedelta_range,
to_timedelta,
)
import pandas._test... | |
<|file_name|>resolution_utils.ts<|end_file_name|><|fim▁begin|>import { TILE_SIZE } from '../consts';
export default class ResolutionUtils {
public scale : number;<|fim▁hole|> public canvas : {
width: number,
height: number
};
constructor() {
this.canvas = { width: 0, height: 0 };
this.recalcula... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.<|fim▁hole|>##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, are ... | ## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org |
<|file_name|>confirm.component.ts<|end_file_name|><|fim▁begin|>import { Component, Inject, OnInit } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
interface IConfirmData {
title: string;
content: string;
extraData: {
npcSprite?: number;
okText?: string;
... | selector: 'app-confirm',
templateUrl: './confirm.component.html', |
<|file_name|>uploader.js<|end_file_name|><|fim▁begin|>/*!
* Uploader - Uploader library implements html5 file upload and provides multiple simultaneous, stable, fault tolerant and resumable uploads
* @version v0.5.6
* @author dolymood <dolymood@gmail.com>
* @link https://github.com/simple-uploader/Uploader
* @lice... | |
<|file_name|>codec.rs<|end_file_name|><|fim▁begin|>//! `codec` module contains the `Package` (frame) decoding and an `tokio_core::io::Codec`
//! implementation.
use std::io::{self, Read, Write};
use uuid::Uuid;
use byteorder::{ReadBytesExt, WriteBytesExt, LittleEndian};
use tokio_io::codec::{Encoder, Decoder};
use byt... | } |
<|file_name|>test_life_1_05.rs<|end_file_name|><|fim▁begin|>extern crate game_of_life_parsers;
use std::fs::File;
use game_of_life_parsers::GameDescriptor;
use game_of_life_parsers::Coord;
use game_of_life_parsers::Parser;
use game_of_life_parsers::Life105Parser;
#[test]
fn parse_file() {<|fim▁hole|> let gd: Box<Game... | let file = File::open("tests/life_1_05/glider.life").unwrap();
let mut parser = Life105Parser::new();
|
<|file_name|>renameSelfAndParameterAttribute.py<|end_file_name|><|fim▁begin|>class С:
def __init__(self, x=None):
if x is None:
self.foo = {
'A': {
'x': 0,
'y': 0,
},
}
else: # init was given the previou... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># Python3
from solution1 import urlSimilarity as f
qa = [
('https://codesignal.com/home/test?param1=42¶m3=testing&login=admin',
'https://codesignal.com/home/secret/test?param3=fish¶m1=42&password=admin',
19),
('https://codesignal.com/home/tes... | 'http://example.com/query?varName=value',
3),
('ftp://www', |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>__author__ = 'leif'<|fim▁hole|>admin.site.register(GameExperiment)
admin.site.register(UserProfile)
admin.site.register(MaxHighScore)<|fim▁end|> | from django.contrib import admin
from models import *
|
<|file_name|>dotfiles.py<|end_file_name|><|fim▁begin|>import logging
import tarfile
import tempfile
import os
import fabric.api
import fabric.operations
import cloudenvy.envy
class Dotfiles(cloudenvy.envy.Command):
def _build_subparser(self, subparsers):
help_str = 'Upload dotfiles from your local mach... | else: |
<|file_name|>native.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, ViewEncapsulation } from '@angular/core';
@Component({
selector: 'app-native',
templateUrl: './native.component.html',
styleUrls: ['./native.component.css'],
encapsulation: ViewEncapsulation.Native
})
export class NativeC... | ngOnInit() {
} |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>package compilerapi
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"strings"
)
const (
GoogleEndpointUrl = "http://closure-compiler.appspot.com/compile"
)
// See https://developers.google.com/closure/compiler/docs/api-ref for details ... | strings.NewReader(values.Encode()),
)
if err != nil {
log.Fatalf(err.Error()) |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>package api
import (
"errors"
"fmt"
"net/url"
"path/filepath"
"strings"
utilglog "github.com/openshift/source-to-image/pkg/util/glog"
"github.com/openshift/source-to-image/pkg/util/user"
)
var glog = utilglog.StderrLog
// Image label namespace constants
con... | func (p *PullPolicy) String() string {
if len(string(*p)) == 0 {
return string(DefaultBuilderPullPolicy) |
<|file_name|>provisioner.go<|end_file_name|><|fim▁begin|>// This package implements a provisioner for Packer that executes
// shell scripts within the remote machine.
package shell
import (
"bufio"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"math/rand"
"os"
"strings"
"time"
"github.com/mitchellh/packer/common"
... | } |
<|file_name|>graphics.cpp<|end_file_name|><|fim▁begin|>#include <string>
#include <vector>
#include <stdio.h>
#include "graphics.h"
#include "engine.h"
#include "Lib/BufferedFile.h"
#include "Lib/getvar.h"
using namespace std;
using namespace sf;
int GraphicResources::GetGraphicCount()
{
return Graphics.size() - 1;
... |
if (Index == GraphicCount)
break; |
<|file_name|>engine.py<|end_file_name|><|fim▁begin|>## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2014, 2015 CERN.
##
## Invenio 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 Fo... | """
Extract all the values in the given record referenced in the given query-string
and attach them to self.fields as a list. Return boolean indicating if a query |
<|file_name|>minimax_test.rs<|end_file_name|><|fim▁begin|>use crate::minimax::{Minimax, MinimaxConfig, MinimaxMovesSorting, MinimaxType};
use env_logger;
use oppai_field::construct_field::construct_field;
use oppai_field::player::Player;
use oppai_test_images::*;
use rand::SeedableRng;
use rand_xorshift::XorShiftRng;
... | minimax_test!(mtdf_13, MINIMAX_CONFIG_MTDF, IMAGE_13, 8);
minimax_test!(mtdf_14, MINIMAX_CONFIG_MTDF, IMAGE_14, 8); |
<|file_name|>cacheprovider.py<|end_file_name|><|fim▁begin|>"""
merged implementation of the cache provider
the name cache was not chosen to ensure pluggy automatically
ignores the external pytest-cache
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
imp... | self.lastfailed.pop(report.nodeid)
self.lastfailed.update((item.nodeid, True) for item in report.result)
else:
self.lastfailed[report.nodeid] = True |
<|file_name|>thinkstats2.py<|end_file_name|><|fim▁begin|>"""This file contains code for use with "Think Stats" and
"Think Bayes", both by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, ... | |
<|file_name|>sync.rs<|end_file_name|><|fim▁begin|>// * This file is part of the uutils coreutils package.
// *
// * (c) Alexander Fomin <xander.fomin@ya.ru>
// *
// * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code.
/* Last synced with:... | sync();
}
Ok(())
} |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.conf import settings as settings
from django.contrib.auth.decorators import login_required
from django.core.context_processors import csrf
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http i... | |
<|file_name|>module-info.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015, 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|>ExceptionTwice-out.java<|end_file_name|><|fim▁begin|>class MyException extends RuntimeException{}
class MyClass {
public void foo() throws MyException {
throw new MyException();<caret> <|fim▁hole|>}<|fim▁end|> | } |
<|file_name|>Listener.py<|end_file_name|><|fim▁begin|># PAL
# Listener
# Thomas Elvey
# 0.2<|fim▁hole|>
import math, audioop, time, wave, os
from collections import deque
from pocketsphinx import *
import pyaudio
from VoiceDecoder import VoiceDecoder
class Listener():
def __init__(self):
print "L... | |
<|file_name|>config.rs<|end_file_name|><|fim▁begin|>extern crate serde_json;
use log::LogLevelFilter;
use logger::MetricsLoggerFactory;
use logger::MetricsLogger;
use self::serde_json::Value;
use std::error::Error;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
use std::collections::BTreeMap;
// Th... | let mut file = match File::open(&path) {
Err(why) => {
logger().log(LogLevelFilter::Error, |
<|file_name|>Post.ts<|end_file_name|><|fim▁begin|>import {Entity, PrimaryGeneratedColumn} from "../../../../src";
import {Column} from "../../../../src/decorator/columns/Column";
@Entity()
export class Post {
@PrimaryGeneratedColumn()
id: number;
@Column("timestamp", { precision: 3, default: () => "CURRE... | } |
<|file_name|>matrix.rs<|end_file_name|><|fim▁begin|>use std::ops::{Index, IndexMut};
/// A type shorthand for the lookup key we'll be using, a width/height tuple.
type Idx = (usize, usize);
/// A 2-dimensional matrix of f64 values.
#[derive(Clone, Debug)]
pub struct Matrix {
width: usize,
contents: Vec<f64>,
... | }
} |
<|file_name|>ztypes_linux_mips.go<|end_file_name|><|fim▁begin|>// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build mips,linux
package unix
const (
sizeofPtr = 0x4
sizeofShort = 0x2
sizeofInt ... | |
<|file_name|>webpack.config.production.js<|end_file_name|><|fim▁begin|>var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');<|fim▁hole|> entry: {
app: './src/main.js'
},
output: {
filename: '[name].min.js',
path: path.join(__dirnam... | var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
devtool: 'source-map', |
<|file_name|>MasterSecretRequirementProvider.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import org.grovecity.drizzlesms.service.KeyCachingService;
import org.whispersystems.... | package org.grovecity.drizzlesms.jobs.requirements; |
<|file_name|>LldbThreadResumedEvent.java<|end_file_name|><|fim▁begin|>/* ###
* IP: GHIDRA
*
* 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/LICEN... | * See the License for the specific language governing permissions and |
<|file_name|>test-046.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | class Foo { [prop1]: string; } |
<|file_name|>instmsg.js<|end_file_name|><|fim▁begin|>/* ======================================================================== \
| FORMA - The E-Learning Suite |
| |
| Copyright (c) 2013 (Forma)... | res=res.replace(/\[MAIL\]/, getChatEmoticon("envelope"));
return res;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.