prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>EtsyExample.java<|end_file_name|><|fim▁begin|>package com.github.scribejava.apis.examples;
import com.github.scribejava.apis.EtsyApi;
import com.github.scribejava.core.builder.ServiceBuilder;
import com.github.scribejava.core.model.OAuth1AccessToken;
import com.github.scribejava.core.model.OAuth1RequestTo... | } |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>"""
Wikipedia utils.
@author: Faegheh Hasibi (faegheh.hasibi@idi.ntnu.no)
"""
from urllib import quote
class WikipediaUtils(object):
mongo = None
@staticmethod
def wiki_title_to_uri(title):
"""
Converts wiki page title to wiki_uri
... | """
if title: |
<|file_name|>test_word2vec.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models packag... |
def testOnlineLearningAfterSave(self):
"""Test that the algorithm is able to add new words to the
vocabulary and to a trained model when using a sorted vocabulary""" |
<|file_name|>stores.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 ver... | let mut b = AddressBook::new(path.clone());
b.set_name(1.into(), "One".to_owned()); |
<|file_name|>test_gwt.py<|end_file_name|><|fim▁begin|>import unittest
from ..gwt import GwtIO
from ...FileIO import FileIO as psopen<|fim▁hole|>import warnings
class test_GwtIO(unittest.TestCase):
def setUp(self):
self.test_file = test_file = pysal_examples.get_path('juvenile.gwt')
self.obj = GwtI... | from .... import examples as pysal_examples
import tempfile
import os |
<|file_name|>FloatSerializer.java<|end_file_name|><|fim▁begin|>/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2014 TIBCO Software Inc. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license te... | @Override
public void write(Float value, VirtualizationOutput out) throws IOException
{ |
<|file_name|>DeleteConnectionProfileRequest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 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
*
* https://www.apache.... | PARSER, input, extensionRegistry); |
<|file_name|>node_test.go<|end_file_name|><|fim▁begin|>package core
import (
. "github.com/smartystreets/goconvey/convey"
"strings"
"testing"
)
func TestValidateSymbol(t *testing.T) {
Convey("Given a node name validation function", t, func() {
cases := []struct {
title string
name string
success b... | Convey("When validating "+c.title, func() { |
<|file_name|>ShapeCodec.java<|end_file_name|><|fim▁begin|>/*
* Copyright © 2013-2018 Metreeca srl. All rights reserved.
*
* This file is part of Metreeca.
*
* Metreeca is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published
* by the Free ... | model.add(statement(node, Spec.text, Values.literal(pattern.getText())));
model.add(statement(node, Spec.flags, Values.literal(pattern.getFlags()))); |
<|file_name|>splice_mapping.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
import sys
import os
import os.path
import glob
import logging
from utils import *
def splice_mapping( T, configs, audit ):
logging.debug( "Splice mapping..." )
# create the destination for splice alignments if not exists
try:
... | configs['SPLICED_ALIGNER_PATH'] + "/" + R.run + "_%s_ebwt%s" % \
( os.path.basename( configs['SPLICED_ALIGNER']), s ), \
configs['SPLICED_ALIGNER_THREADS'], \ |
<|file_name|>_brier.py<|end_file_name|><|fim▁begin|>import numpy as np
from ._utils import move_axis_to_end, suppress_warnings
def brier_score(observations, forecasts):
"""
Calculate the Brier score (BS)
The Brier score (BS) scores binary forecasts $k \in \{0, 1\}$,
..math:
BS(p, k) = (p_1 ... | _threshold_brier_score_core = _threshold_brier_score_vectorized
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""create and manipulate C data types in Python"""
import os as _os, sys as _sys
__version__ = "1.1.0"
from _ctypes import Union, Structure, Array
from _ctypes import _Pointer
from _ctypes import CFuncPtr as _CFuncPtr
from _ctypes import __version__ as _ctypes_ve... | class c_longlong(_SimpleCData):
_type_ = "q"
_check_size(c_longlong) |
<|file_name|>mapbook.cc<|end_file_name|><|fim▁begin|>/* GNU ddrescue - Data recovery tool
Copyright (C) 2004-2019 Antonio Diaz Diaz.
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, e... | return false; |
<|file_name|>hero-di.component.ts<|end_file_name|><|fim▁begin|>// #docregion
import { Component } from '@angular/core';
import { DataService } from './data.service';
@Component({
selector: 'hero-di',
template: `<h1>Hero: {{name}}</h1>`<|fim▁hole|>export class HeroComponent {
name = '';
constructor(dataServic... | }) |
<|file_name|>stars.rs<|end_file_name|><|fim▁begin|>use futures::prelude::*;
use hubcaps::{Credentials, Github};
use std::env;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
pretty_env_logger::init();
let token = env::var("GITHUB_TOKEN")?;
let github = Github::new(
... | |
<|file_name|>RouteStrategyFactory.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016-2022 ActionTech.
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher.
*/
package com.actiontech.dble.route.factory;
import com.actiontech.dble.route.RouteStrategy;<|fim▁hole|> * RouteStrategyFactory
*
... | import com.actiontech.dble.route.impl.DefaultRouteStrategy;
/** |
<|file_name|>leak-tag-copy.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/l... | |
<|file_name|>partition.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2019-2020 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software F... | // be created during install if it is a role that is created during install and
// the start offsets match. We specifically don't look at anything on the
// structure such as filesystem information since this may be incomplete due to |
<|file_name|>CacheService.test.ts<|end_file_name|><|fim▁begin|>import { CacheService } from '../CacheService';
import { TimeService } from '../../time/TimeService';
import { Config } from '../../../Config';
describe('CacheService', () => {
let timeServiceMock: Partial<TimeService>;
let configMock: Partial<Conf... | |
<|file_name|>shortlex_vecs_length_inclusive_range.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
use malachite_base::bools::exhaustive::exhaustive_bools;
use malachite_base::nevers::nevers;
use malachite_base::tuples::exhaustive::exhaustive_units;
use malachite_base::vecs::exhaustive::shortlex_vecs_length_in... | fn shortlex_vecs_length_inclusive_range_fail() {
shortlex_vecs_length_inclusive_range(1, 0, exhaustive_bools()); |
<|file_name|>insert.rs<|end_file_name|><|fim▁begin|>use database::Database;
use database::Errors;<|fim▁hole|>use database::errors::log_n_wrap;
use database::Errors::{NotFound, Conflict};
use std::vec::Vec;
use serde_json::Value;
use serde_json;
use rand;
impl Database {
/// Inserts the record to the given path.
... | |
<|file_name|>workerglobalscope.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::Bindings::FunctionBindi... | |
<|file_name|>aiplatform_v1beta1_generated_endpoint_service_deploy_model_async.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... | # Generated code. DO NOT EDIT!
#
# Snippet for DeployModel
# NOTE: This snippet has been automatically generated for illustrative purposes only. |
<|file_name|>ui_reactor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import time
import logging
import argparse
from Queue import Queue
from threading import Thread
from salt.utils.event import LocalClientEvent
LOGGER = logging.getLogger()
MAX_TIMEOUT_VALUE=60*5
def __parse_record(event):
pay... | |
<|file_name|>newtype-temporary.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.o... | |
<|file_name|>lumina-fm_tr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="tr">
<context>
<name>BMMDialog</name>
<message>
<location filename="../BMMDialog.ui" line="14"/>
<source>Manage Bookmarks</source>
<translation>Yer İ... | |
<|file_name|>check_unused.rs<|end_file_name|><|fim▁begin|>//
// Unused import checking
//
// Although this is mostly a lint pass, it lives in here because it depends on
// resolve data structures and because it finalises the privacy information for
// `use` items.
//
// Unused trait imports can't be checked until the m... | |
<|file_name|>getEmitOutputTsxFile_React.ts<|end_file_name|><|fim▁begin|>/// <reference path="fourslash.ts" />
// @BaselineFile: getEmitOutputTsxFile_React.baseline
// @declaration: true
// @sourceMap: true
// @jsx: react
// @Filename: inputFile1.ts
// @emitThisFile: true
////// regular ts file
//// var t: n... | //// declare var React: any;
|
<|file_name|>0009_auto__add_field_xform_shared_data.py<|end_file_name|><|fim▁begin|># encoding: 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):
# Adding field 'XForm.shared_d... | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': { |
<|file_name|>sta.rs<|end_file_name|><|fim▁begin|>use crate::arch::cpu::Cpu;
use crate::utils::bit_utils::*;
pub fn zeropage(cpu: &mut Cpu) -> (u8, u8) {
let (addr, ilen) = decode_zeropage!(cpu);
cpu.memory.store(addr as u16, cpu.registers.a_reg);
(3, ilen)
}
pub fn zeropage_x(cpu: &mut Cpu) -> (u8, u8) {
... | let (addr, ilen) = decode_absolute!(cpu); |
<|file_name|>compute_penalty.py<|end_file_name|><|fim▁begin|>import numpy as np
__all__ = ['compute_penalties']
def compute_penalty(kk, clusters):
'''Takes kk.clusters (clusters currently assigned)
and computes the penalty'''
if clusters is None:
clusters = kk.clusters
#print(cluster... | # print('num_clusters', num_clusters)
# #This now only depends on the number of clusters |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp');
gulp.task('default', function() {
console.log("Currently there are no available tasks. There will be!");
});
/**
* Builds the client files into a jar and moves it to the 'build/client' folder.
*/
/*
gulp.task('build-client', function... | |
<|file_name|>deploy_test.go<|end_file_name|><|fim▁begin|>package command
import (
"testing"
"github.com/funkygao/assert"
"github.com/funkygao/gocli"
)
func TestValidateLogDirs(t *testing.T) {
d := Deploy{Ui: &cli.BasicUi{}}
type fixture struct {
dirs string
expected string
}
fixtures := []fixture{
{... | }
for _, f := range fixtures {
assert.Equal(t, f.expected, d.validateLogDirs(f.dirs))
} |
<|file_name|>KrollPropertyChange.java<|end_file_name|><|fim▁begin|>/**
* Appcelerator Titanium Mobile
* Copyright (c) 2010 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
package org.appceler... | }
} |
<|file_name|>0003_auto__add_field_collective_slug__add_field_action_slug.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwa... | |
<|file_name|>railforest_weinsa.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# UPE Programming competiton 2015-11-1 "railforest" solution by Avi Weinstock
import re
import sys
INFINITY = float('inf')
line_to_ints = lambda line: [int(x, 10) for x in re.split(' *', line)]
def solver(width, height, grid):
p... | if x+dx < 0 or x+dx >= width: |
<|file_name|>mconf.py<|end_file_name|><|fim▁begin|># Copyright 2014-2016 The Meson development team
# 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/LICENS... | raise e
return 0 |
<|file_name|>labels.js<|end_file_name|><|fim▁begin|>// A database of labels
define(['util', 'label'],
function(Util, Label)
{
var Labels = function()
{
this.getURL = '/annotate.database.getlabels';
this.addURL = '/annotate.database.addlabel';
this.saveLabelURL = '/annotate.database.savelabel';
this.... |
this.databaseByName[newname] = label; |
<|file_name|>orange_fpgrowth.py<|end_file_name|><|fim▁begin|># coding: utf-8
# python 3.5
import Orange
from orangecontrib.associate.fpgrowth import *
import pandas as pd
import numpy as np
import sys
import os
from collections import defaultdict
from itertools import chain
from itertools import combinations
from itert... | bunbo += 1
rules_target = [] |
<|file_name|>QuarkusLiquibaseConnectionProvider.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2021 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance w... | |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# test --create
command += oiiotool ("--create 320x240 3 -d uint8 -o black.tif")
command += oiiotool ("--stats black.tif")
# test --pattern constant
command += oiiotool ("--pattern constant:color=.1,.2,.3,1 320x240 4 -o constant.tif")
command += ... | "-line:color=0.25,0,0,0.25 10,60,250,20 " +
"-line:color=0.5,0,0,0.5 10,62,250,100 " +
"-line:color=1,0,0,1 10,64,250,400 " +
"-line:color=0,1,0,1 250,100,10,184 " + |
<|file_name|>issue498.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: issue498.proto
package issue449
import (
bytes "bytes"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto"
proto "github.com/gogo/pro... | |
<|file_name|>dialog.inversify.ts<|end_file_name|><|fim▁begin|>import { TYPES } from 'core/app/types'
import { StateManager } from 'core/dialog'
import { ContainerModule, interfaces } from 'inversify'
import { DecisionEngine } from './decision-engine'
import { DialogEngine } from './dialog-engine'
import { FlowService ... | |
<|file_name|>index.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from flask import render_template
from .. import lastuser_ui<|fim▁hole|> return render_template('index.html.jinja2')<|fim▁end|> |
@lastuser_ui.route('/')
def index(): |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate rand;
use std::io;
use rand::Rng;
use std::cmp::Ordering;
fn main() {
println!("Guess the number!");
let secret_number = rand::thread_rng().gen_range(1, 101);
loop {
println!("Please input your guess.");<|fim▁hole|>
let mut gu... | |
<|file_name|>Rgaa22Rule01021Test.java<|end_file_name|><|fim▁begin|>/*
* Asqatasun - Automated webpage assessment
* Copyright (C) 2008-2019 Asqatasun.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Fre... | consolidate("Rgaa22.Test.1.2-3NMI-03").getValue());
assertEquals(TestSolution.NOT_APPLICABLE,
consolidate("Rgaa22.Test.1.2-4NA-01").getValue());
assertEquals(TestSolution.NOT_APPLICABLE, |
<|file_name|>WSDLtoASP.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"os"
"encoding/xml"
"io/ioutil"
"strings"
"strconv"
)
type atomService struct {
RDec []element
SDec string
Spec spec
Sign sign
FuncR funcR
NonFuncR nonFuncR
}
type element struct {
Name string
Type... |
// -----------------portType-------------------- |
<|file_name|>integration.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 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.apache.org/licenses/LICENS... | helper, err := master.NewEtcdHelper(etcdClient, "")
if err != nil { |
<|file_name|>meta.go<|end_file_name|><|fim▁begin|>package fbaOutbound
// Address 邮寄地址信息
type Address struct {
Name string `json:"Name" label:"收件人的姓名"`
Line1 string `json:"Line1" label:"街道地址信息"`
Line2 string `json:"Line2" label:"其他街道地址信息"`
Line3 string `json:... | type UpdateFulfillmentOrderItem struct {
SellerSKU string `json:"SellerSKU" label:""`
SellerFulfillmentOrderItemId string `json:"SellerFulfillmentOrderItemId" label:""` |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var subdomain = require('express-subdomain');
var express = require('express');
var app = express();
var router = express.Router();
var moment = require('moment');
var time = moment();
var timeFormat = time.format('HH:mm:ss');<|fim▁hole|>});
app.listen(3000);
console.lo... | app.get('/', function(req, res) {
res.sendFile(__dirname + '/index.html'); |
<|file_name|>switchcase.py<|end_file_name|><|fim▁begin|>'''
Analysis plugin for supporting WorkspaceEmulators during analysis pass.
Finds and connects Switch Cases, most specifically from Microsoft.
'''
import envi
import envi.archs.i386 as e_i386
import vivisect
import vivisect.analysis.generic.codeblocks as vagc
de... | naming for all cases because naming wants to indicate larger context.
(future)If indiroffbase is not None, the indirection "database" is analyzed for naming
''' |
<|file_name|>Report.ts<|end_file_name|><|fim▁begin|>export class Report {<|fim▁hole|> query: string;
status: string;
lastRun: Date;
count: number;
}<|fim▁end|> | fields: string;
tables: string; |
<|file_name|>gumshoe.js<|end_file_name|><|fim▁begin|>/*!
* gumshoe v4.0.1
* A simple, framework-agnostic scrollspy script.
* (c) 2019 Chris Ferdinandi
* MIT License
* http://github.com/cferdinandi/gumshoe
*/
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], (function (... | * Initialize the current instantiation
* @param {Object} options User options and settings
*/ |
<|file_name|>0408_identity_provider_external_id.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from sentry.utils.query import RangeQuerySetWrapperWithProgressBar
class M... | 'Meta': {'unique_together': "(('project', 'short_id'),)", 'object_name': 'Group', 'db_table': "'sentry_groupedmessage'", 'index_together': "(('project', 'first_release'),)"}, |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>#![allow(unused_imports)]
use rustc_serialize::json;
#[test]
fn reply_keyboard_markup() {
use ReplyKeyboardMarkup as RKM;
// Test default values
assert_eq!(RKM::default(), RKM {
keyboard: Vec::new(),
resize_keyboard: None,
one_time_... | let x = RM::KeyboardHide(false);
assert_eq!(json::encode(&x).unwrap(),
r#"{"hide_keyboard":true,"selective":false}"#.to_string());
|
<|file_name|>webpack.config.prod.js<|end_file_name|><|fim▁begin|>// For info about this file refer to webpack and webpack-hot-middleware documentation
// For info on how we're generating bundles with hashed filenames for cache busting: https://medium.com/@okonetchnikov/long-term-caching-of-static-assets-with-webpack-1e... |
export default { |
<|file_name|>l5_hipotenusas.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
def soma_hipotenusas(n):
chipotenusa=1
somahipot=[]
while chipotenusa <=n:
cat1 = 1
while cat1 <=n:<|fim▁hole|> cat2=1
cat1+=1
while cat2 <=n:
if (cat1**2 + cat2... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Parsimonious's public API. Import from here.
Things may move around in modules deeper than this one.
<|fim▁hole|>from parsimonious.exceptions import (ParseError, IncompleteParseError,
VisitationError, UndefinedLabel,
... | """ |
<|file_name|>v3_stop_application_command_test.go<|end_file_name|><|fim▁begin|>package experimental
import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccversion"
"code.cloudfoundry.org/cli/integration/helpers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
. "github.c... | |
<|file_name|>backend.ts<|end_file_name|><|fim▁begin|>import {RootState} from '../reducers/rootReducer'<|fim▁hole|>export const selectBackend = (state: RootState) => state.backend<|fim▁end|> | |
<|file_name|>web.py<|end_file_name|><|fim▁begin|>import lxml
import requests
def requests_session():
"""
Get a suitable requests session for use in SmartBot.
In particular, this sets the `User-Agent` header to the value of
'SmartBot'.
"""
session = requests.Session()
session.headers.updat... | page = requests_session().post("http://sprunge.us", data=payload) |
<|file_name|>default-events.cpp<|end_file_name|><|fim▁begin|>/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; yo... | |
<|file_name|>bug-2470-bounds-check-overflow-2.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... | |
<|file_name|>CreateWorkspace.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************<|fim▁hole|> CreateWorkspace.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya
... | |
<|file_name|>_date_nl.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2004-2006 Donald N. Allingham
#
# 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... | #-------------------------------------------------------------------------
#
# Register classes |
<|file_name|>common.spec.ts<|end_file_name|><|fim▁begin|>/*
* The MIT License
*
* Copyright 2019 Azarias Boutin.
*
* 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, ... | * copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* |
<|file_name|>set.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Wandoujia Inc. All Rights Reserved.
// Licensed under the MIT (MIT-LICENSE.txt) license.
package service
import "github.com/wandoulabs/redis-port/pkg/redis"
// SADD key member [member ...]
func (h *Handler) SAdd(arg0 interface{}, args [][]byte) (redi... | if err != nil {
return toRespError(err) |
<|file_name|>eroTypeahead.js<|end_file_name|><|fim▁begin|>import React, {Component} from 'react';
import {Typeahead} from 'react-bootstrap-typeahead';
import {inject, observer} from 'mobx-react';
import {action, toJS, autorunAsync} from 'mobx';
import myClient from '../agents/client'
require('react-bootstrap-typeahead... |
state = { |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse, HttpResponseForbidden
from django.core.cache import cache<|fim▁hole|>
def autocomplete_category(request):
if not request.is_ajax():
return HttpResponseForbidden()
name = request.GET.get('q',None)
limit = reques... | from inboxtix.util import get_api_tree |
<|file_name|>136.single_number.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Given an array of integers, every element appears twice except for one. Find
that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it
without using extra memory?
"""
__author__ = 'ye... | |
<|file_name|>metadata_builder.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2021 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.o... |
"""Base abstract class for metadata builders.""" |
<|file_name|>test_dsd.py<|end_file_name|><|fim▁begin|># Copyright 2015 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either v... | # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. |
<|file_name|>ncp_hals.py<|end_file_name|><|fim▁begin|>"""
Nonnegative CP decomposition by Hierarchical alternating least squares (HALS).
Author: N. Benjamin Erichson <erichson@uw.edu>
"""
import numpy as np
import numba
from tensortools.operations import unfold, khatri_rao
from tensortools.tensors import KTensor
fro... | _hals_update(U[n], grams, Xmkr, n not in negative_modes) |
<|file_name|>house2.cpp<|end_file_name|><|fim▁begin|>#include "house2.h"
int House2::objCount = 0;
GImage *House2::image = nullptr;
House2::House2(int x, int y)
{
posx = x;<|fim▁hole|> width = 336;
height = 366;
if(!objCount)
image = new GImage("./assets/house-a.gif",width,height,GImage::IS_TRAN... | posy = y; |
<|file_name|>adrive.py<|end_file_name|><|fim▁begin|>"""audio driver subsystem"""
from os.path import exists
from os import environ
from subprocess import check_call
from functools import partial
from .drive import Driver
import click
DRIVE_QUEUE = 'a.drive'
CTL_PATH = '{}/.config/pianobar/ctl'.format(environ['HOME']... | check_call(['pianoctl'], stdout=null) |
<|file_name|>echoserver.py<|end_file_name|><|fim▁begin|>import asyncio
import logging
import concurrent.futures
class EchoServer(object):
"""Echo server class"""
def __init__(self, host, port, loop=None):
self._loop = loop or asyncio.get_event_loop()
self._server = asyncio.start_server(self.h... | if and_loop:
self._loop.close()
|
<|file_name|>isolated_process.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | |
<|file_name|>28_05.js<|end_file_name|><|fim▁begin|>GoogleElectionMap.shapeReady({name:"28_05",type:"state",state:"28_05",bounds:[],centroid:[],shapes:[
{points:[
{x:32.8810559124534,y: 24.5253494052583}
,
{x:32.8804366855404,y: 24.5250018993236}
,
{x:32.8804349320052,y: 24.5250021192127}
,
{x:32.8800699675051,y: 24.525... | {x:32.8808786484259,y: 24.4644191570506}
,
{x:32.8799215940977,y: 24.4644392481401}
, |
<|file_name|>makeAsyncFunc.ts<|end_file_name|><|fim▁begin|>import Fiber = require('../fibers');
import Promise = require('bluebird');
import _ = require('lodash');
import types = require('../types');
import Config = require('./config');
import FiberMgr = require('./fiberManager');
import RunContext = require('./... | if (runContext.resolver) runContext.resolver.resolve({ value: expr, done: false });
Fiber.yield();
}
|
<|file_name|>NetInterfaceRemovedEvent.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2011, 2020 Eurotech and/or its affiliates and others
*
* This program and the accompanying materials are made
* available under the terms of the E... | /** |
<|file_name|>ZookeeperConfigUtil.java<|end_file_name|><|fim▁begin|>/*
* Copyright 1999-2018 Alibaba Group Holding 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://w... | if (appName.startsWith("/")) {
stringBuilder.append(appName);
} else {
stringBuilder.append("/") |
<|file_name|>option.rs<|end_file_name|><|fim▁begin|>use super::Id;
pub struct OptionId<T> {
id: Id<T>,
}
<|fim▁hole|> } else {
OptionId { id: Id::invalid() }
}
}
}
impl<T> Into<Option<Id<T>>> for OptionId<T> {
fn into(self) -> Option<Id<T>> {
if self.id.is_valid() {
... | impl<T> From<Option<Id<T>>> for OptionId<T> {
fn from(id: Option<Id<T>>) -> Self {
if let Some(id) = id {
OptionId { id } |
<|file_name|>node.py<|end_file_name|><|fim▁begin|># Ant
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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, includi... | self.ant.request_message(0, messageId)
_logger.debug("done requesting message %#02x", messageId)
return self.wait_for_special(messageId) |
<|file_name|>grpc_asyncio.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | Generally, you only need to set this if you're developing
your own client library. |
<|file_name|>stream_search.py<|end_file_name|><|fim▁begin|>"""
Поиск значений в последовательностях
"""
def second_max(num_list):
if len(num_list) < 2:
raise IndexError
pair = (num_list.pop(), num_list.pop())
max1, max2 = max(pair), min(pair)
while num_list:
val = num_list.pop()
... | max1 = val |
<|file_name|>stock.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute ... | def _get_stock(self, cr, uid, ids, field_name, arg, context=None):
""" Gets stock of products for locations
@return: Dictionary of values |
<|file_name|>Filter.js<|end_file_name|><|fim▁begin|>WGL.internal.Filter = function() {
var manager = WGL.getManager();
var GLU = WGL.internal.GLUtils;
manager.setFilter(this);
this.rastersize = manager.r_size ;
this.lastDim ="";
this.filterProgram1d = GLU.compileShaders("filter1d_vShader", "filter1d_fSh... | gl.bindTexture(gl.TEXTURE_2D, filterTexture[thatID]);
gl.uniform1i(this.filterProgram.indexText, 1); |
<|file_name|>mockimaplib.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
from imaplib import ParseFlags
# mockimaplib: A very simple mock server module for imap client APIs
# Copyright (C) 2014 Alan Etkin <spametki@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# ... | self.spam[self._mailbox][int(query.strip()) - 1],
]
elif query[1:-1].strip().isdigit(): |
<|file_name|>authRouter.js<|end_file_name|><|fim▁begin|>/**
* Created by trebollo on 6/2/16.
*/
var express = require('express');
var router = express.Router();
// Check auth on every resource
router.get('*', function(req, res, next) {<|fim▁hole|>module.exports = router;<|fim▁end|> | //console.log('Checking AUTH permissions for request ' + req.method + ' - ' + req.baseUrl);
next();
});
|
<|file_name|>trait-default-method-bound.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... |
trait A {
fn g(&self) -> int { 10 }
} |
<|file_name|>ecgReader.py<|end_file_name|><|fim▁begin|>import sys
from datetime import datetime, timedelta
from array import array
from numpy import hsplit, asarray
class ECG:
'''Checks validity of selected .ecg file. If it is valid .ecg file creates an instance with all the data stored in .ecg file'''
def __... | ecgBytesArray = ecgBytesArray.reshape(-1,self.numberOfLeads) |
<|file_name|>cap10.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#encoding=utf-8
import os
try:
f = file('blah','r')
except IOError,e:
print 'could not open file:',e
<|fim▁hole|> try:
return float(obj)
except ValueError:
pass
ccfile = None
log = file('log.txt','w+')
try:
cc... | def safe_float(obj): |
<|file_name|>City.ts<|end_file_name|><|fim▁begin|>export class City {
constructor(public Id: number, public Name: string, public Fk_countryId : number ) { }<|fim▁hole|><|fim▁end|> | } |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>import gpib
class PARWriteError(Exception):
pass
class PARReadError(Exception):
pass
class PARCellWorking(Exception):
pass
<|fim▁hole|>class Poll:
COMMAND_DONE = 1
COMMAND_ERROR = 2
CURVE_DONE = 4
OVERLOAD = 16
SWEEP_DONE ... | |
<|file_name|>send_pack.go<|end_file_name|><|fim▁begin|>// Package test implements common test suite for different transport
// implementations.
//
package test
import (
"bytes"
"io"
"io/ioutil"
"gopkg.in/src-d/go-git.v4/fixtures"
"gopkg.in/src-d/go-git.v4/plumbing"
"gopkg.in/src-d/go-git.v4/plumbing/format/pack... | s.checkRemoteHead(c, endpoint, fixture.Head)
}
func (s *SendPackSuite) TestSendPackOnNonEmpty(c *C) { |
<|file_name|>azure_rm_keyvaultsecret.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'m... | |
<|file_name|>mapoperations.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"strings"
)
func map_operations() {
//initialization
m := make(map[string]int)
//insert
m["Answer"] = 42
fmt.Println("The value:", m["Answer"])
//insert
m["Answer"] = 48
fmt.Println("The value:", m["Answer"... | v, ok := m["Answer"]
fmt.Println("The value:", v, "Present?", ok)
|
<|file_name|>shared.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';<|fim▁hole|>@NgModule({
exports: [
CommonModule,
FormsModule
]
})
export class SharedModule {}<|fim▁en... | |
<|file_name|>exos_facts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# (c) 2018 Extreme Networks Inc.
#
# 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 ... | - Tested against EXOS 22.5.1.7
options:
gather_subset:
description: |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""pint_journal_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views<|fim▁hole|> 1. Add an import: from my_app import views
2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.