prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>_version.py<|end_file_name|><|fim▁begin|>__version_info__ = (2, 4, 2)<|fim▁hole|>__version__ = ".".join(map(str, __version_info__))<|fim▁end|> | |
<|file_name|>PersonAttributeTypeAlgorithm.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2014. The Trustees of Indiana University.
*
* This version of the code is licensed under the MPL 2.0 Open Source license with additional
* healthcare disclaimer. If the user is an entity intending to commercialize any app... | return attributeType;
}
/** |
<|file_name|>mockredis.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# mockredis
#
# This module helps start and stop redis instances for unit-testing
# redis must be pre-installed for this to work
#
import os<|fim▁hole|>import subprocess... | import signal |
<|file_name|>logging.rs<|end_file_name|><|fim▁begin|>extern crate log;
use log::{LogRecord, LogLevel, LogMetadata, SetLoggerError, LogLevelFilter};
<|fim▁hole|>struct SimpleLogger;
impl log::Log for SimpleLogger {
fn enabled(&self, metadata: &LogMetadata) -> bool {
metadata.level() <= LogLevel::Info
}
... | |
<|file_name|>ceil.cc<|end_file_name|><|fim▁begin|>#include <cmath>
#include <iostream>
using namespace std;<|fim▁hole|> int num = 4.4;
cout << ceil(num) << endl;
return 0;
}<|fim▁end|> |
int main()
{ |
<|file_name|>skyTile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Fabien Chereau fchereau@eso.org
#
import gzip
import os
def writePolys(pl, f):
"""Write a list of polygons pl into the file f.
The result is under the form [[[ra1, de1],[ra2, de2],[ra3, de3],[ra4, de4]], [[ra1, de1],[ra2, de2],[ra3, d... | self.imageInfo = StructCredits()
self.imageUrl = None |
<|file_name|>LRUCacheTest.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkLRUCache.h"
#include "Test.h"
struct Value {
Value(int value, int* counter)
: fValue(value)
... | |
<|file_name|>decolar-data.ts<|end_file_name|><|fim▁begin|>'use strict'
/* LIBS */
/* EXEC */
export interface DecolarFare {
raw: {
code: string,
amount: number
},
formatted: {
code: string,
amount: string,
mask: string
}
}
export interface DecolarLocation {
city: {
code: string
... | export interface DecolarItem {
internalId: string,
clusterAlertType: string,
id: string, |
<|file_name|>validatingwebhookconfiguration.go<|end_file_name|><|fim▁begin|>/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/L... | admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" |
<|file_name|>helper_types.go<|end_file_name|><|fim▁begin|>package models
import (
"database/sql/driver"
"errors"
"fmt"
"time"
)
const (
// DefaultLimit is the number of results we will return per page if the user doesn't specify another amount
DefaultLimit = 25
// DefaultLimitString is DefaultLimit but in stri... | }
// ListResponse is a generic list response struct containing values that represent |
<|file_name|>weight.rs<|end_file_name|><|fim▁begin|>use rand::distributions::{IndependentSample, Normal};
use rand::{Closed01, Rng};
/// Represents a connection weight.
#[derive(Debug, Clone, Copy)]
pub struct Weight(pub f64);
impl Weight {
pub fn inv(self) -> Self {
Weight(-self.0)
}
}
impl Into<f64... | high: f64,
low: f64,
} |
<|file_name|>progressBar.js<|end_file_name|><|fim▁begin|><|fim▁hole|> constructor() {
this.bar = null;
}
init(total) {
if (this.bar) {
this.terminate();
}
// Intentionally a noop because node-progress doesn't work well in non-TTY
// environments
if (!process.stdout.isTTY) {
re... | import ProgressBar from "progress";
import padEnd from "lodash/padEnd";
class ProgressBarController { |
<|file_name|>TileAction.js<|end_file_name|><|fim▁begin|>import React from 'react';<|fim▁hole|>const TileAction = ({ children, className, ...rest }) => {
return (
<div className={classNames('tile-action', className)} {...rest}>
{children}
</div>
);
};
/**
* TileAction property types.
*/
TileAction.p... | import { string, node } from 'prop-types';
import classNames from 'classnames';
|
<|file_name|>friends.js<|end_file_name|><|fim▁begin|>import VK from 'VK';
import { VK_API_VERSION } from '../constants';
/**
* Fetch friends.
* @param {Object} options
* @return {Promise<Object>}
*/
export function fetchFriends(options = {}) {
const mergedOptions = {
...options,
order: 'hints',<|fim▁hole... | |
<|file_name|>Understand.js<|end_file_name|><|fim▁begin|>'use strict';
/* jshint ignore:start */
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
/* jshint ignore:end */
var _ = require('lodash'); /* jshint ignore:line */
var AssistantList = require('... | }
});
module.exports = Understand; |
<|file_name|>test_qgseditwidgets.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""QGIS Unit tests for edit widgets.
.. note:: 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 ... | __copyright__ = 'Copyright 2015, The QGIS Project'
# This will get replaced with a git SHA1 when you do a git archive
__revision__ = '$Format:%H$'
|
<|file_name|>Print.java<|end_file_name|><|fim▁begin|>package org.luaj.vm2;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
/**
* Debug helper class to pretty-print lua bytecodes.
* @see Prototype
* @see LuaClosure
*/
public class Print extends Lua
{
/** opcode names */
private static final Str... | }
static void printConstants(PrintStream ps, Prototype f) |
<|file_name|>test_node_children_list.py<|end_file_name|><|fim▁begin|>import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf.models import AbstractNode, NodeLog
from osf.utils import permissions
from osf.utils.sanitize import strip_html
from osf_tests.factories impor... | def user():
return AuthUserFactory()
|
<|file_name|>test_storage_policy.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | |
<|file_name|>content_settings_store.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/api/content_settings/content_settings_store.h"... | |
<|file_name|>Problem1-Multiples_of_3_&_5.py<|end_file_name|><|fim▁begin|>sum=0
for x in range(0,1000):<|fim▁hole|> if(x%3==0 or x%5==0):
sum+=x
print(sum)<|fim▁end|> | |
<|file_name|>SaveManager.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
Copyright (c) 2014 Gorka Suárez García
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Soft... | */
SaveManager::~SaveManager() {}
|
<|file_name|>MapData.java<|end_file_name|><|fim▁begin|>/*
* The MIT License
*
* Copyright 2017 Arnaud Hamon
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, inclu... |
/**
* Remove a child data.
* |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
setup(
name='appserver',
version=version,
description="Sample application server for bilsbrowser",
long_description="""\
""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',... | from setuptools import setup, find_packages
import sys, os
version = '0.1' |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># ENVISIoN
#
# Copyright (c) 2019 Jesper Ericsson
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source cod... | |
<|file_name|>TradeMessage.java<|end_file_name|><|fim▁begin|>package org.tmarciniak.mtp.model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persis... | |
<|file_name|>user.js<|end_file_name|><|fim▁begin|>function ChangeTo(to) {
if (to == "text") {
$('#admincommentlinks').ghide();
$('#admincomment').gshow();
resize('admincomment');
var buttons = document.getElementsByName('admincommentbutton');
for (var i = 0; i < buttons.length; i++) {
buttons[i].setAttrib... | |
<|file_name|>demo_app.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Distributed under CC0 1.0 Universal (CC0 1.0) Public Domain Dedication.
# pylint: disable=ungrouped-imports,wrong-import-position
import os
import sys
import pathlib
import asyncio
import logging
import importlib
import pyuavcan
# Producti... | |
<|file_name|>style-switcher.js<|end_file_name|><|fim▁begin|>/**
* Metis - Bootstrap-Admin-Template v2.2.7
* Author : onokumus
* Copyright 2014
* Licensed under MIT (https://github.com/onokumus/Bootstrap-Admin-Template/blob/master/LICENSE.md)
*/
window.fakeStorage = {
_data: {
},
setItem: function (id, val)... | }; |
<|file_name|>get_plist_text.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
def get_plist_text(cf_bundler_identifier, cf_bundle_name=None,
docset_platform_family=None):
"""TODO"""
cf_bundle_name = cf_bundle_name or cf_bundler_identifier.upper()
docset_platform_family = docset_platform_family or... | |
<|file_name|>file-paths.js<|end_file_name|><|fim▁begin|>import app from 'common/electron/app';
import path from 'path';
/**
* @return the theme's css path
*/
function getThemePath (name) {
return path.join(app.getAppPath(), 'themes', name + '.css');
}
/**
* @return the style's css path
*/
function getStylePath ... | getThemePath,
getStylePath,
getImagePath,
getCustomUserDataPath, |
<|file_name|>delaying_queue_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.<|fim▁hole|>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licen... | |
<|file_name|>context.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>
from collections import defaultdict
_globals = defaultdict(lambda: None)
_globals['callbacks'] = set()
class set_options(object):
""" Set global state within controled context
This lets you specify various global settings in a tightly cont... | Control global computation context
""" |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# python setup.py sdist --format=zip,gztar
from setuptools import setup
import os
import sys
import platform
import imp
import argparse
version = imp.load_source('version', 'lib/version.py')
if sys.version_info[:3] < (3, 4, 0):
sys.exit("... | data_files = []
if platform.system() in ['Linux', 'FreeBSD', 'DragonFly']:
parser = argparse.ArgumentParser() |
<|file_name|>Teacher.js<|end_file_name|><|fim▁begin|>define(function(require) {
// Include parent class
var utility = require('../Helper/utility.js')
var Human = require('./Human.js')
var Teacher = Human.extend({
init: function(firstName, lastName, age, specialty) {
Human.init.appl... | introduce: function() {
return Human.introduce.apply(this) + ", Specialty: " + this.specialty;
}
}); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright 2015 Umbrella Tech.
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 restr... | The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
|
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import markdown from './code.md';
import TheCode from '../../the-code';
import AliceCarousel from '../../../lib/react-alice-carousel';
import './styles..scss';
const itemsLength = Array.from({ length: 5 });
const items = itemsLength.map((... | });
const AutoheightPage = () => {
return ( |
<|file_name|>app_blb_client.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019 Baidu.com, 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/... | port, protocol_type, |
<|file_name|>test_issue_162.py<|end_file_name|><|fim▁begin|>import numpy as np
import pyroomacoustics as pra
def compute_rir(order):
fromPos = np.zeros((3))
toPos = np.ones((3, 1))<|fim▁hole|> room.add_microphone_array(mics)
room.compute_rir()
def test_issue_162_max_order_15():
compute_rir(15)
... | roomSize = np.array([3, 3, 3])
room = pra.ShoeBox(roomSize, fs=1000, absorption=0.95, max_order=order)
room.add_source(fromPos)
mics = pra.MicrophoneArray(toPos, room.fs) |
<|file_name|>DP20150713A.py<|end_file_name|><|fim▁begin|>"""
[2015-07-13] Challenge #223 [Easy] Garland words
https://www.reddit.com/r/dailyprogrammer/comments/3d4fwj/20150713_challenge_223_easy_garland_words/
# Description
A [_garland word_](http://blog.vivekhaldar.com/post/89763722591/garland-words) is one that sta... | onionionionionionionionionionion...
Today's challenge is to write a function `garland` that, given a lowercase word, returns the degree of the word if it's
a garland word, and 0 otherwise.
# Examples |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/// Type implementing arbitrary-precision decimal arithmetic
pub struct Decimal {<|fim▁hole|> // implement your type here
}
impl Decimal {
pub fn try_from(input: &str) -> Option<Decimal> {
unimplemented!("Create a new decimal with a value of {}", input)
... | |
<|file_name|>location.rs<|end_file_name|><|fim▁begin|>header! {
#[doc="`Location` header, defined in"]
#[doc="[RFC7231](http://tools.ietf.org/html/rfc7231#section-7.1.2)"]
#[doc=""]
#[doc="The `Location` header field is used in some responses to refer to a"]
#[doc="specific resource in relation to t... | #[doc="# ABNF"]
#[doc="```plain"]
#[doc="Location = URI-reference"] |
<|file_name|>version.go<|end_file_name|><|fim▁begin|>package containerregistry
import "github.com/Azure/azure-sdk-for-go/version"
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.<|fim▁hole|>
// UserAgent return... | //
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated. |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY ... | pack_list = self.server.GET(path)[1]
return pack_list
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* Main JS file for Jasper behaviours
*/
if (typeof jQuery == 'undefined') {
document.write('<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js"></' + 'script>');
}
(function ($) {
"use strict";
// Header P... | |
<|file_name|>test_settings.py<|end_file_name|><|fim▁begin|>import settings
<|fim▁hole|>globals().update(i for i in settings.__dict__.items() if i[0].isupper())
# Require the mezzanine.accounts app. We use settings.INSTALLED_APPS here so
# the syntax test doesn't complain about an undefined name.
if "mezzanine.accounts... | |
<|file_name|>currentPageId.js<|end_file_name|><|fim▁begin|><|fim▁hole|>const initialState = null
export default function(state = initialState, action = {}) {
switch (action.type) {
case CHANGE_PAGE_ID:
return action.payload
default:
return state
}
}<|fim▁end|> | import {CHANGE_PAGE_ID} from 'actions'
|
<|file_name|>store.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.
use super::*;
use std::collections::BTreeMap;
use kvproto::kvrpcpb::{Context, IsolationLevel};
use collections::HashMap;
use test_storage::{SyncTestStorage, SyncTestStorageBuilder};
use tidb_query_d... | .into_iter()
.filter(Result::is_ok)
.map(Result::unwrap) |
<|file_name|>WXEvent.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 you under t... | mEventBindingArgsValues.clear();
} |
<|file_name|>registry_test.go<|end_file_name|><|fim▁begin|>package main
import (
"github.com/bmorri12/SmartAqua/pkg/models"
"github.com/bmorri12/SmartAqua/pkg/mysql"
"github.com/bmorri12/SmartAqua/pkg/rpcs"
"testing"
)
func testVendor(t *testing.T, r *Registry) {
vendor := &models.Vendor{
VendorName: "t... |
err = r.ValidateProduct("this is a wrong key , you know", reply) |
<|file_name|>OPTIONS.java<|end_file_name|><|fim▁begin|>package rvc.ann;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* @author nurmuhammad
*/
@Retention(RUNTIME)<|fi... | @Target(METHOD)
public @interface OPTIONS {
String value() default Constants.NULL_VALUE;
|
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>import os
# Application constants
APP_NAME = 'job_offers'
INSTALL_DIR = os.path.dirname(os.path.abspath(__file__))
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'<|fim▁hole|># Testing fixtures
JOB_OFFER_FIXTURES = os.path.join(INSTALL_DIR, "fix... | LOG_NAME = os.path.join(INSTALL_DIR, 'job_offers.log')
|
<|file_name|>item.rs<|end_file_name|><|fim▁begin|>use super::*;
use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput};
use crate::punctuated::Punctuated;
use proc_macro2::TokenStream;
#[cfg(feature = "extra-traits")]
use crate::tt::TokenStreamHelper;
#[cfg(feature = "extra-traits")]
use std::hash::{H... | pub attrs: Vec<Attribute>, |
<|file_name|>liststore.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk.
//
// rgtk is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) ... | unsafe { ffi::gtk_list_store_insert_before(self.pointer, iter.get_pointer(),
if sibling.is_none() { ::std::ptr::null_mut()} else { sibling.unwrap().get_pointer() }) }
} |
<|file_name|>full.py<|end_file_name|><|fim▁begin|># Copyright 2013 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.
DEPS = [
'recipe_engine/buildbucket',
'recipe_engine/context',
'recipe_engine/path',
'recipe_engine... | |
<|file_name|>MongoClient.js<|end_file_name|><|fim▁begin|>"use strict";<|fim▁hole|>var Db = require("./Db").Db;
function wrapDb (db) {
return new Db(db);
}
exports.MongoClient = new WrapperBuilder()
.add("connect", {transformations: {1: wrapDb} })
.getWrapper();<|fim▁end|> |
var WrapperBuilder = require("thunkify-object").WrapperBuilder; |
<|file_name|>particle.js<|end_file_name|><|fim▁begin|>// Particle
var position = new Vector(0, 0);
var velocity = new Vector(0, 0);
var size = 42;<|fim▁hole|>
console.log('p', particle);<|fim▁end|> | var mass = 42;
var color = [0, 0, 0];
var particle = new Particle(position, velocity, size, mass, color); |
<|file_name|>forest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
Script: Forest, a simple Python forum script.
Author: Andrew Nelis (andrew.nelis@gmail.com)
OnTheWeb: http://www.triv.org.uk/~nelis/forest
Date: Jun 2010
Version: 1.0.3
A Python CGI script for a basic flat-file based forum.
Getting Started:
* ... | if offset:
new_location += '&offset=%s' % offset
## can't use standard redirect on CGIHTTPServer |
<|file_name|>clientset_test.go<|end_file_name|><|fim▁begin|>package integration
// FIXME: This test is disabled until the generated client sets are fixed to work
// properly with API groups.
/*
import (
"fmt"
"testing"
kapiv1 "k8s.io/kubernetes/pkg/api/v1"
v1buildapi "github.com/openshift/origin/pkg/buil... | projectclient "github.com/openshift/origin/pkg/project/client/clientset_generated/release_v1_5"
testutil "github.com/openshift/origin/test/util"
testserver "github.com/openshift/origin/test/util/server" |
<|file_name|>akPu3CaloJetSequence15_cff.py<|end_file_name|><|fim▁begin|>import FWCore.ParameterSet.Config as cms
from HeavyIonsAnalysis.JetAnalysis.jets.akPu3CaloJetSequence_PbPb_mc_cff import *
#PU jets: type 15
akPu3Calomatch15 = akPu3Calomatch.clone(src = cms.InputTag("akPu3CaloJets15"))
akPu3Caloparton15 = akPu3C... | genJetMatch = cms.InputTag("akPu3Calomatch15"),
genPartonMatch = cms.InputTag("akPu3Caloparton15"), |
<|file_name|>AzureInstanceTemplateParametersV4TestDto.java<|end_file_name|><|fim▁begin|>package com.sequenceiq.it.cloudbreak.dto;
import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.template.AzureInstanceTemplateV4Parameters;
import com.sequenceiq.it.cloudbreak.Prototype;
import com.sequenceiq.it.cl... | |
<|file_name|>QuestionsManager.java<|end_file_name|><|fim▁begin|>package com.github.mikhailerofeev.scholarm.local.services;
import android.app.Application;
import com.github.mikhailerofeev.scholarm.api.entities.Question;
import com.github.mikhailerofeev.scholarm.local.entities.QuestionImpl;
import com.google.gson.Gson;... | try {
Reader inputStreamReader = new InputStreamReader(application.getAssets().open("database.json"));
readQuestions(inputStreamReader);
} catch (IOException e) { |
<|file_name|>CollectionAdapter.java<|end_file_name|><|fim▁begin|>package net.marevalo.flowsmanager;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.Text... | @Override
public Object getItem(int position) { |
<|file_name|>DetourNavMeshQuery.cpp<|end_file_name|><|fim▁begin|>//
// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Per... | |
<|file_name|>escena_menu.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import pilas
archi = open('datos.txt', 'r')
nivel = archi.readline()
pantalla = archi.readline()
idioma = archi.readline()
archi.close()
if idioma == "ES":
from modulos.ES import *
else:
from modulos.EN import *
class EscenaMen... | |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals<|fim▁hole|>
from django.apps import AppConfig
class RfhistoryConfig(AppConfig):
name = 'RFHistory'<|fim▁end|> | |
<|file_name|>oauthreturn.py<|end_file_name|><|fim▁begin|>from flask import request, render_template
from flask.ext.login import current_user, login_user<|fim▁hole|>
@weibo.route('/oauthreturn')
def oauthreturn():
code = request.args.get('code', '')
if code:
client = Client(app.config['API_KEY'], app.config['API_SEC... | from mysite.weibo import Client
from mysite import app, db
from mysite.models import Wuser, User
from . import weibo |
<|file_name|>search.js<|end_file_name|><|fim▁begin|>/*
* Adjust display of page based on search results
*/
function findSearchResults(data, dataLength) {
$("#duplicate_box").remove();
var userString = $("#searchForm #searchField").val();
var minSearchLength = 1;
if (userString.length >= minSearchLength... | // If we're over the minimum length, we may add a new client.
$("#searchForm #addNewClient").prop("disabled", false); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
function valuefy(value) {
if (typeof value !== 'object') {
return (typeof value === 'string') ? `"${value}"` : value;
}
let values = [];
if (Array.isArray(value)) {
for (const v of value) {
values.push(valuefy(v));
}
values = `[${values.... | }
}
return set; |
<|file_name|>gemm.rs<|end_file_name|><|fim▁begin|>//! C := alpha * A * B + beta * C
use complex::Complex;
use {Transpose, blasint, ffi};
/// The signature of `gemm`
pub type Fn<T> = unsafe extern "C" fn (
*const Transpose,
*const Transpose,
*const blasint,
*const blasint,
*const blasint,
*con... |
impl ::Gemm for f32 { |
<|file_name|>interactive.py<|end_file_name|><|fim▁begin|>import curses
from curses.textpad import Textbox, rectangle
import asyncio
import readline
import rlcompleter
<|fim▁hole|># import code
# vars = globals().copy()
# vars.update(locals())
# shell = code.InteractiveConsole(vars)
# shell.interact()
class CursesUi... | # import readline # optional, will allow Up/Down/History in the console |
<|file_name|>cico_meraki.py<|end_file_name|><|fim▁begin|>import requests
# https://github.com/kennethreitz/grequests/issues/103
from gevent import monkey
def stub(*args, **kwargs): # pylint: disable=unused-argument
pass
monkey.patch_all = stub
import grequests
import os
import json
from requests.adapters import HT... |
if outmodel == "":
outmodel = strmodel[0:2] |
<|file_name|>mode-xml.js<|end_file_name|><|fim▁begin|>define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHi... | this.end = {row: 0, column: 0}; |
<|file_name|>cinema_dialog.cc<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
DCP-o-matic is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Fre... | along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>visual_array.rs<|end_file_name|><|fim▁begin|>// rustfmt-indent_style: Visual
// Array layout
fn main() {
let lorem = vec!["ipsum",<|fim▁hole|> "sit",
"amet",
"consectetur",
"adipiscing",
"elit"];
}<... | "dolor", |
<|file_name|>gameplay_system.cpp<|end_file_name|><|fim▁begin|>#include <zombye/core/game.hpp>
#include <zombye/gameplay/camera_follow_component.hpp>
#include <zombye/gameplay/game_states.hpp>
#include <zombye/gameplay/gameplay_system.hpp>
#include <zombye/gameplay/states/menu_state.hpp>
#include <zombye/gameplay/states... | |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>"""Provide common test tools for Z-Wave JS."""
AIR_TEMPERATURE_SENSOR = "sensor.multisensor_6_air_temperature"
HUMIDITY_SENSOR = "sensor.multisensor_6_humidity"
ENERGY_SENSOR = "sensor.smart_plug_with_two_usb_ports_value_electric_consumed_2"
POWER_SENSOR = "sensor.sma... | |
<|file_name|>res_company.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from odoo import api, fields, models, tools
from odoo.exceptions import UserError
import os
from odoo.tools import misc
import re
# 成本计算方法,已实现 先入先出
CORE_COST_METHOD = [('average', u'全月一次加权平均法'),
('std',u'定额成本'),
... |
def _get_logo_impl(self):
''' 默认取 core/static/description 下的 logo.png 作为 logo''' |
<|file_name|>ffi_type.rs<|end_file_name|><|fim▁begin|>use crate::{
analysis::{
c_type::{implements_c_type, rustify_pointers},
namespaces,
rust_type::{Result, TypeError},
},
env::Env,
library::{self, *},
traits::*,
};
use log::{info, trace, warn};
// FIXME: This module needs ... | VarArgs => panic!("Should not reach here"),
};
Ok(inner.into())
} |
<|file_name|>svd.rs<|end_file_name|><|fim▁begin|>///! Truncated singular value decomposition
///!
///! This module computes the k largest/smallest singular values/vectors for a dense matrix.
use super::lobpcg::{lobpcg, LobpcgResult, Order};
use crate::error::Result;
use crate::generate;
use cauchy::Scalar;
use lax::Lap... | |
<|file_name|>real_time_bidding_setting.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v1/common/real_time_bidding_setting.proto
package common
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
wrappers "github.com/golang/p... | 0x1b, 0x2a, 0x9c, 0x83, 0x28, 0xa2, 0x01, 0x17, 0x90, 0x9e, 0xf7, 0x34, 0xed, 0x6e, 0xdb, 0xfd,
0x0b, 0x7d, 0x6d, 0x84, 0xf7, 0xaa, 0xe9, 0xff, 0x97, 0x0f, 0xe9, 0xf1, 0x46, 0x09, 0xfb, 0x64,
0x6a, 0x95, 0x63, 0xfd, 0x23, 0xb6, 0xcf, 0x58, 0x3a, 0x05, 0x1f, 0x2b, 0xe3, 0x4e, 0x92, 0xf3,
0xe4, 0xe2, 0xe8, 0x72, 0xde... |
<|file_name|>长方体表面两点最短距离.cpp<|end_file_name|><|fim▁begin|>int r;
void turn(int i, int j, int x, int y, int z,int x0, int y0, int L, int W, int H) {
if (z==0) { int R = x*x+y*y; if (R<r) r=R;
} else {
if(i>=0 && i< 2) turn(i+1, j, x0+L+z, y, x0+L-x, x0+L, y0, H, W, L);
if(j>=0 && j< 2) turn(i, j+1, x, y0+W+z,... | |
<|file_name|>db_actions.py<|end_file_name|><|fim▁begin|>from requests import HTTPError
from database import Database
import simplejson as json
db = Database.getDatabaseConnection()["cras"]
from log_session import LogSession
import datetime
class DB:
def __init__(self):
pass
@staticmethod
def add_u... | |
<|file_name|>interrupts.rs<|end_file_name|><|fim▁begin|>// "Tifflin" Kernel
// - By John Hodge (thePowersGang)
//
// Core/main.rs
//! Low-level interrupt handling and CPU error handling
//use prelude::*;
#[repr(C)]
/// A handler for an ISR
pub type ISRHandler = extern "C" fn(isrnum: usize,info:*const(),idx:usize);
st... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export * from './results.handler'; |
<|file_name|>tables.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 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/lic... | &['\u{62a}', '\u{64a}']), ('\u{fc76}', &['\u{62b}', '\u{631}']), ('\u{fc77}', &['\u{62b}',
'\u{632}']), ('\u{fc78}', &['\u{62b}', '\u{645}']), ('\u{fc79}', &['\u{62b}', '\u{646}']),
('\u{fc7a}', &['\u{62b}', '\u{649}']), ('\u{fc7b}', &['\u{62b}', '\u{64a}']), ('\u{fc7c}',
&['\u{641}', '\... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot devices."""
from asyncio import Lock
import switchbot # pylint: disable=import-error
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_SENSOR_TYPE, Platform
from homeassistant.core import HomeAssist... | hass.config_entries.async_update_entry(entry, options=options) |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>#!usr/bin/env python
# -*- coding:utf-8 -*-
"""
@author: magic
"""
from django.contrib import admin
from blog.models import User
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext, ugettext_lazy as _
class BlogUserAdmin(UserA... | 'classes': ('wide', ),
'fields': ('username', 'email', 'password1', 'password2'),
}),
) |
<|file_name|>main.C<|end_file_name|><|fim▁begin|>#define OMPI_SKIP_MPICXX 1
#define MPICH_SKIP_MPICXX 1
#include "comm.h"
#include <stdio.h>
#include "cmdLineOptions.h"
#include "h5test.h"
#include "parallel_io.h"
#include "t3pio.h"
Comm P;
void outputResults(CmdLineOptions& cmd, ParallelIO& pio);
int main(int arg... | " S_dne: %12d\n"
" S_auto_max: %12d\n"
" nStripesT3: %12d\n" |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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, eit... | template_uid = pwd.getpwuid(os.stat(b_path).st_uid).pw_name |
<|file_name|>JobStrongAuthSimpleBuilder.java<|end_file_name|><|fim▁begin|>/**
* The MIT License
*
* Copyright (C) 2012 KK.Kon
*
* 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 withou... | |
<|file_name|>script_thread.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/. */
//! The script thread is the thread that owns the DOM i... | }
/// Handles when layout thread finishes all animation in one tick
fn handle_tick_all_animations(&self, id: PipelineId) { |
<|file_name|>test_pandas_hdf.py<|end_file_name|><|fim▁begin|>from os.path import join
from tempfile import mkdtemp
import unittest
from shutil import rmtree
import pandas as pd
from feagen.data_wrappers.pandas_hdf import get_shape_from_pandas_hdf_storer
class Test(unittest.TestCase):
def setUp(self):
sel... | col = [10, 9, 6, 7]
df = pd.DataFrame(0, index=idx, columns=col)
self.hdf_store.put('test', df, format='table')
shape = get_shape_from_pandas_hdf_storer( |
<|file_name|>tclab.py<|end_file_name|><|fim▁begin|>import sys
import time
import numpy as np
try:
import serial
except:
import pip
pip.main(['install','pyserial'])
import serial
from serial.tools import list_ports
class TCLab(object):
def __init__(self, port=None, baud=9600):
... | self.sp.flushOutput()
time.sleep(3)
print('TCLab connected via Arduino on port ' + port)
|
<|file_name|>0025_auto__add_field_diskoffering_available_size_kb.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 forwards(self... | },
u'physical.host': {
'Meta': {'object_name': 'Host'}, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#coding: utf-8
from __future__ import unicode_literals, absolute_import
import logging
import json
from django.utils.dateparse import parse_datetime
from django.utils import timezone
from wechatpy.exceptions import WeChatClientException
from common import wechat_cl... |
logger = logging.getLogger(__name__) |
<|file_name|>15.2.3.3-2-25.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 15.2.3.3-2-25<|fim▁hole|>
var obj = {
"1e-7": 1
};
var desc = Object.getOwnPropertyDescriptor(obj, 1e-7);
as... | description: >
Object.getOwnPropertyDescriptor - argument 'P' is a number that
converts to a string (value is 1e-7)
---*/ |
<|file_name|>framework.py<|end_file_name|><|fim▁begin|># This file is part of ICLS.
#
# ICLS 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 ver... | |
<|file_name|>FilesProcessorService.java<|end_file_name|><|fim▁begin|>package com.ofte.services;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Has... | |
<|file_name|>to_list.hpp<|end_file_name|><|fim▁begin|>// (C) Copyright Edward Diener 2015
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
#if !defined(BOOST_VMD_SEQ_TO_LIST_H... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.