prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>timelion_vis_params_controller.js<|end_file_name|><|fim▁begin|>define(function (require) {<|fim▁hole|> require('plugins/timelion/directives/expression_directive');
const module = require('ui/modules').get('kibana/timelion_vis', ['kibana']);
module.controller('TimelionVisParamsController', function ($... | |
<|file_name|>hello.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from helper import greeting
greeting("hello world...") |
<|file_name|>TextDealInterfaceService.java<|end_file_name|><|fim▁begin|>package com.jeecg.qywx.core.service;
import com.jeecg.qywx.base.entity.QywxReceivetext;
/**
* 文本处理接口
* @author 付明星
*
*/
public interface TextDealInterfaceService {
/**
* 文本消息处理接口
* @param receiveText 文本消息实体类
*/
void dealTextMessage(Qy... | |
<|file_name|>BinarySearch.java<|end_file_name|><|fim▁begin|><|fim▁hole|>public class BinarySearch {
public static int binarySearch(int arr[], int num, int startIndex,
int endIndex) {
if (startIndex > endIndex) {
return -1;
}
int mid = startIndex + (endIndex - startIndex) / 2;
if (num == arr[mid]) {
r... | import java.util.Scanner;
|
<|file_name|>network_process.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: UTF-8 -*-
'''
Created on Jan 17, 2017
@author: hegxiten
'''
import sys
import geo.haversine as haversine
from imposm.parser import OSMParser
import geo.haversine as haversine
import numpy
import time
from scipy import spat... | |
<|file_name|>de.rs<|end_file_name|><|fim▁begin|>use pest::iterators::Pair;
use pest::Parser as P;
use pest_derive::Parser;
use serde::de;
use serde::forward_to_deserialize_any;
use std::char;
use std::collections::VecDeque;
use std::f64;
use std::io::Read;
use crate::error::{self, Error, Result};
#[derive(Parser)]
#[... | |
<|file_name|>itemCtrl.js<|end_file_name|><|fim▁begin|>function tabCtrl(id) {
var element = document.querySelectorAll('[data-selector="tabbar/tab"]');
for (var i = 0; i < element.length; i++) {<|fim▁hole|> }
}
}
function tabItemCtrl(id) {
var element = document.querySelectorAll('[data-selector="tabbar/item"]');... | if (element[i].dataset.id === id) {
element[i].classList.add('tabbar__tab__active');
} else {
element[i].classList.remove('tabbar__tab__active'); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from distutils.core import setup
from distutils.command.build import build as _build
from distutils.command.install import install as _install
from distutils.command.install_data import install_data as _install_data
from distutils.command.sdist ... |
# If src/compizconfig.pyx exists, build using Cython
if os.path.exists ("src/compizconfig.pyx"): |
<|file_name|>OutHandler.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import java.io.*;
public class OutHandler implements Runnable {
OutHandler(Connection connection) {
this.connection = connection;
}
private Connection connection;
public void run() {}
}<|fim▁end|> | package irc.bot;
|
<|file_name|>web.py<|end_file_name|><|fim▁begin|>from kompromatron.core import app<|fim▁hole|>from kompromatron.views.base import base
# app.register_blueprint(entities)
# app.register_blueprint(relations)
#app.register_blueprint(base)<|fim▁end|> | |
<|file_name|>RedeliveryOnExceptionBlockedDelayTest.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 licens... | template.sendBody("seda:start", "World");
template.sendBody("seda:start", "Camel"); |
<|file_name|>discon_tools.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
from loguru import logger
from pathlib import Path
def check_meta_yaml_for_noarch(fn:Path, text=None):
import re
logger.debug("Checking for noarch")
if text is None:
with open(... | return True
return False |
<|file_name|>hr.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Documents"),
"icon": "icon-star",
"items": [
{
"type": "doctype",
"name": "Employee",
"description": _("Employee records."),
},
{
... | {
"type": "doctype",
"name": "Leave Control Panel",
"label": _("Leave Allocation Tool"), |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod info;
mod releases;
mod releases_delete;<|fim▁hole|><|fim▁end|> | mod releases_finalize;
mod releases_info;
mod releases_list;
mod releases_new; |
<|file_name|>filterdialog.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
Copyright (C) 2003-2009 Robby Stephenson <robby@periapsis.org>
***************************************************************************/
/*************************************... | m_saveFilter->setEnabled(false);
connect(m_saveFilter, &QAbstractButton::clicked, this, &FilterDialog::slotSaveFilter); |
<|file_name|>play_sound.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 2 -*-
# Author: Fábio André Damas <skkeeper at gmail dot com>
from threading import Thread
from subprocess import Popen, PIPE
<|fim▁hole|> Thread.__init__(self)
se... | class PlaySound(Thread):
def __init__(self, filename, volume): |
<|file_name|>test_cargo_compile_plugins.rs<|end_file_name|><|fim▁begin|>use std::fs;
use std::env;
use support::{project, execs};
use support::{COMPILING, RUNNING};
use hamcrest::assert_that;
fn setup() {
}
test!(plugin_to_the_max {
if !::is_nightly() { return }
let foo = project("foo")
.file("Cargo... | "#)
.file("bar/build.rs", r#" |
<|file_name|>SetPEVersion.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 2016-10-20T16:00+08:00
import fnmatch
import glob
import itertools
import os
import re
import subprocess
import sys
import fileutil
# Match version numbers of these formats:
# 1.2.3
# 1.2.3.4
version_number_re = r'([0-9]+(?:.[0-9]... | |
<|file_name|>BC.py<|end_file_name|><|fim▁begin|>"""
compressible-specific boundary conditions. Here, in particular, we
implement an HSE BC in the vertical direction.
Note: the pyro BC routines operate on a single variable at a time, so
some work will necessarily be repeated.
Also note: we may come in here with the a... | elif bc_name == "ramp": |
<|file_name|>collectors_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Test the collector flows."""
import os
from grr.client import vfs
from grr.lib import action_mocks
from grr.lib import aff4
from grr.lib import artifact
from grr.lib import artifact_lib
from grr.lib import artifact_test
from grr.li... | self.assertEqual(fd.__class__.__name__, "AFF4Volume")
|
<|file_name|>0003_auto__del_new__add_news.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration<|fim▁hole|>class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'New'
db.delete_table('news_new')
... | from django.db import models
|
<|file_name|>maintenance_controller.py<|end_file_name|><|fim▁begin|># Copyright (C) 2019 OpenMotics BV
#
# 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 Free Software Foundation, either version 3 of the
# License,... | def stop(self):
# type: () -> None
if self._maintenance_communicator: |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
args = ' '.join(sys.argv[1:])<|fim▁hole|>print(f"""Deprecated as of commit 959939b771. Use flask utility script instead:
$ flask {args}
""")
raise SystemExit(1)<|fim▁end|> | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* Dependencies
* @type {exports}
*/
var fs = require('fs')
, q = require('q')
, _ = require('underscore')
, path = require('path')
, natural = require('natural')
, nounInflector = new natural.NounInflector()
, argv = require('optimist').argv<|fim▁hol... | , path = require('path') |
<|file_name|>auth.js<|end_file_name|><|fim▁begin|>import {
SIGN_IN,<|fim▁hole|> SIGN_IN_SUCCESS,
SIGN_IN_ERROR,
SIGN_OUT,
SIGN_OUT_SUCCESS,
USER_LOGGED,
USER_UNLOGGED
} from '../../constants/action-types';
const INITIAL_STATE = {
isUserSignedIn: false,
isSignOutInProgress: false,
isInProgress: null,... | |
<|file_name|>BiQuad.cpp<|end_file_name|><|fim▁begin|>/***************************************************/
/*! \class BiQuad
\brief STK biquad (two-pole, two-zero) filter class.
This class implements a two-pole, two-zero digital filter.
Methods are provided for creating a resonance or notch in the
freq... | |
<|file_name|>basic_shape.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/. */
//! CSS handling for the specified value of
//! [`basic-s... | PositionComponent::Side(keyword, Some(ref lop)) if !keyword.is_start() => {
if let LengthOrPercentage::Percentage(p) = *to_non_zero_length(lop) { |
<|file_name|>inlines.js<|end_file_name|><|fim▁begin|>/**
* Django admin inlines
*<|fim▁hole|> * Based on jQuery Formset 1.1
* @author Stanislaus Madueke (stan DOT madueke AT gmail DOT com)
* @requires jQuery 1.2.6 or later
*
* Copyright (c) 2009, Stanislaus Madueke
* All rights reserved.
*
* Spiced up with Cod... | |
<|file_name|>table_rowgroup.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/. */
//! CSS table formatting contexts.
#![deny(unsafe_cod... | debug!("assign_inline_sizes({}): assigning inline_size for flow", "table_rowgroup"); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
fs.tests: testcases for the fs module
"""
from __future__ import with_statement
# Send any output from the logging module to stdout, so it will
# be captured by nose and reported appropriately
import sys
import logging
logging.basi... | self.fs.setcontents("dir_a/test.txt", b("testerific"))
self.assert_(check("dir_a"))
self.fs.rename("dir_a", "dir_b") |
<|file_name|>s3_key.py<|end_file_name|><|fim▁begin|>#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache... | |
<|file_name|>qgslegenditem.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
qgslegenditem.cpp
---------------------
begin : January 2007
copyright : (C) 2007 by Martin Dobias
email : wonder.sk at gm... | }
QgsLegend* QgsLegendItem::legend() const
{ |
<|file_name|>slices.go<|end_file_name|><|fim▁begin|><|fim▁hole|>package main
import (
"fmt"
"sort"
)
func main() {
var colors = []string{"Red", "Green", "Blue"}
fmt.Println(colors)
colors = append(colors, "Purple")
fmt.Println(colors)
colors = append(colors[1:len(colors)])
fmt.Println(colors)
colors = a... | |
<|file_name|>client.js<|end_file_name|><|fim▁begin|>(function($){
$(document).ready(function(){
$('.rainbowcake').rainbowcake();
<|fim▁hole|><|fim▁end|> | });
}(jQuery)); |
<|file_name|>autoCommand.py<|end_file_name|><|fim▁begin|>__author__ = 'leviwright'
from mainbot.commands import Command
<|fim▁hole|>class NickServLogin(Command):
arguments = []
permissionLevel = 3
permitExtraArgs = False
manArgCheck = False
defaultArgs = []
callName = "login"
def on_call(... | |
<|file_name|>interfaces.ts<|end_file_name|><|fim▁begin|>export interface SimpleAPIConfig {
}
export interface SimpleAPI {
count: number;
add(n?: number): void;
sub(n?: number): void;<|fim▁hole|><|fim▁end|> | } |
<|file_name|>load.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/licen... | plugins: vec![], |
<|file_name|>interfaceBatcher.go<|end_file_name|><|fim▁begin|>package stream
type RunningCount struct {
cnts []int
}
func NewRunningCount(sz int) *RunningCount {
return &RunningCount{make([]int, 0, sz)}
}
func (rc *RunningCount) GetAverage() int {
sz := len(rc.cnts)
if sz == 0 {
return 0
}
sum := 0
for _, i... | |
<|file_name|>CpuAffinitySet.cc<|end_file_name|><|fim▁begin|>/* Web Polygraph http://www.web-polygraph.org/
* Copyright 2003-2014 The Measurement Factory
* Licensed under the Apache License, Version 2.0 */
#include "base/polygraph.h"
#include "xstd/h/iostream.h"
#include "xstd/h/string.h"
#include "xstd/CpuAffi... | else
CPU_CLR(coreId, &raw);
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2014 Tesora, Inc.
# All Rights Reserved.
#<|fim▁hole|># 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 applicable l... | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
<|file_name|>a65114e48d6f_set_user_last_login_automatically_in_.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
#
... | )
|
<|file_name|>0015_auto__add_field_geonamesmatchinglogmatchedplaces_remark.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... | 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), |
<|file_name|>ded3fd1d7f9d_.py<|end_file_name|><|fim▁begin|>"""empty message
Revision ID: ded3fd1d7f9d
Revises: b70e85abec53
Create Date: 2020-12-30 22:46:59.418950
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'ded3fd1d7f9... | def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('hashfiles', sa.Column('hash_str', mysql.VARCHAR(length=256), nullable=False)) |
<|file_name|>setup_wizard.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, copy
import os
import json
from frappe.utils import cstr, flt, getdate
from fr... |
install_fixtures.install(args.get("country")) |
<|file_name|>rt.rs<|end_file_name|><|fim▁begin|>use super::{proto, BUCKET_MAX, ID, MAX_BUCKETS, MIN_BOOTSTRAP_BKTS, TX_TIMEOUT_SECS};
use crate::tracker;
use byteorder::{BigEndian, ByteOrder, WriteBytesExt};
use chrono::{DateTime, Utc};
use num_bigint::BigUint;
use rand::{self, Rng};
use std::collections::HashMap;
use ... | #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Node {
id: ID, |
<|file_name|>serverlocal.js<|end_file_name|><|fim▁begin|>// Init express server
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var server = require('http').Server(app);
server.listen(3000);
console.log("started listenning on port 3000");
// Subscribe to lexa's router st... | // var onoff = require('onoff');
// var Gpio = onoff.Gpio; |
<|file_name|>align_faces.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Philipp Wagner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... | image = image.crop((int(crop_xy[0]), int(crop_xy[1]), int(crop_xy[0]+crop_size[0]), int(crop_xy[1]+crop_size[1])))
# resize it |
<|file_name|>rawdsttran.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `RAWDSTTRAN` reader"]
pub struct R(crate::R<RAWDSTTRAN_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<RAWDSTTRAN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<RAWD... | #[doc = "Field `CH2` writer - Raw Interrupt Status for channel 2"]
pub struct CH2_W<'a> {
w: &'a mut W,
} |
<|file_name|>watermark.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com timehome@corp.globo.com
from os.path ... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright 2015 Cloudbase Solutions.
# 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... | if obj.returncode and obj.returncode in extra_ok_codes:
obj.returncode = None
|
<|file_name|>MessageCodec.java<|end_file_name|><|fim▁begin|>package net.lightstone.net.codec;
import java.io.IOException;
import net.lightstone.msg.Message;
import org.jboss.netty.buffer.ChannelBuffer;
public abstract class MessageCodec<T extends Message> {
private final Class<T> clazz;
private final int opcode;... | }
public abstract ChannelBuffer encode(T message) throws IOException; |
<|file_name|>csv_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The ezgliding Authors.
//<|fim▁hole|>//
// ezgliding 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, o... | // This file is part of ezgliding. |
<|file_name|>gather_moves.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | assignee_loan_path: @LoanPath, |
<|file_name|>LogicalMetricColumn.java<|end_file_name|><|fim▁begin|>// Copyright 2016 Yahoo Inc.
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms.
package com.yahoo.bard.webservice.data.metric;
/**
* LogicalMetricColumn.
*/
public class LogicalMetricCo... | * @param name The column name
* @param metric The logical metric
* |
<|file_name|>output.js<|end_file_name|><|fim▁begin|>var _privateMethod = babelHelpers.classPrivateFieldLooseKey("privateMethod");
class Foo {
constructor() {
Object.defineProperty(this, _privateMethod, {<|fim▁hole|> value: _privateMethod2
});
this.publicField = babelHelpers.classPrivateFieldLooseBas... | |
<|file_name|>legacy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# Easy AVR USB Keyboard Firmware Keymapper
# Copyright (C) 2018 David Howland
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | ledlayers = [0, 0, 0, 0, 0]
# fixes for older versions (renamed layers) |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Crypto challenge Set1 / Challenge 1
// Convert hex to base64<|fim▁hole|>fn main() {
let args = std::os::args();
if args.len() != 2 {
println!("USAGE: challenge1 HEX_ENCODED_STRING");
} else {
let input = args[1].as_slice();
ma... |
extern crate codec;
#[cfg(not(test))] |
<|file_name|>l3_dvr_db.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 OpenStack Foundation. 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
#
# ht... | vm_port = port_dict.get(fip['port_id'], None) |
<|file_name|>card.py<|end_file_name|><|fim▁begin|>class Card:<|fim▁hole|><|fim▁end|> | count = 0
url = ""
name = ""
sideboard = -1 |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
setup(
# Application name:
name="streaker",
# Version number (initial):
version="0.0.1",
# Application author details:
author="Aldi Alimucaj",
author_email="aldi.alimucaj@gmail.com",
<|fim▁hole|> script... | # Packages
packages=["streaker"],
|
<|file_name|>LicensingStore-test.ts<|end_file_name|><|fim▁begin|>import PluginSDK from "PluginSDK";
import { RequestUtil } from "mesosphere-shared-reactjs";
const SDK = PluginSDK.__getSDK("licensing", { enabled: true });
require("../../SDK").setSDK(SDK);
const LicensingStore = require("../LicensingStore").default;
con... | expect(license.get("gid")).toEqual("foo"); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from . import models<|fim▁end|> | # Copyright 2017 Matmoz d.o.o. (<http://www.matmoz.si>).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
<|file_name|>index_test.js<|end_file_name|><|fim▁begin|>import { test , moduleFor } from 'appkit/tests/helpers/module_for';
import Index from 'appkit/routes/index';
moduleFor('route:index', "Unit - IndexRoute");
test("it exists", function(){<|fim▁hole|><|fim▁end|> | ok(this.subject() instanceof Index);
}); |
<|file_name|>check_static_recursion.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apa... | use ast_map; |
<|file_name|>URLShortenerAPI.java<|end_file_name|><|fim▁begin|>package com.therabbitmage.android.beacon.network;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;<|fim▁hole|>import java.net.URISyntaxException;
import org.apache.http.Header;
import org.apache.http.HttpEntity;... | |
<|file_name|>fix_sensor_config_key.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import unicode_literals<|fim▁hole|>standard_library.install_aliases()
from builtins import *
import emission.core.get_database as edb
def fix_key(check_field, new_key):
print("First entry for "... | from __future__ import division
from __future__ import absolute_import
from future import standard_library |
<|file_name|>ANMs.py<|end_file_name|><|fim▁begin|>'''
Created on Jan 17, 2014
@author: oliwa
'''
import sys as sys
import numpy as np
from prody.dynamics.anm import calcANM, ANM
from prody.dynamics.editing import extendModel, sliceModel
from prody.dynamics.functions import saveModel, loadModel, writeArray
from prody.p... | Ty = self.utils.fill3DArrayWithValue(Ty, 1.0, 1) |
<|file_name|>inverse_op.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2020 PaddlePaddle Authors. 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/li... | protected:
void Apply(GradOpPtr<T> grad) const override {
grad->SetType(this->ForwardOpType() + "_grad");
grad->SetInput("Output", this->Output("Output")); |
<|file_name|>scopes.rs<|end_file_name|><|fim▁begin|>use {ast, typeinf, util};
use core::{Src, CompletionType, Session};
#[cfg(test)] use core;
use std::iter::Iterator;
use std::path::Path;
use std::str::from_utf8;
use util::char_at;
fn find_close<'a, A>(iter: A, open: u8, close: u8, level_end: u32) -> Option<usize> w... | #[test]
fn test_scope_start() {
let src = String::from("
fn myfn() { |
<|file_name|>visualizer.js<|end_file_name|><|fim▁begin|>function playAudioVisualize(track) {
var bars = 50;
var waveResolution = 128;
var style = "bars"; //set default style upon loading here
var audio = new Audio();
var canvas, source, context, analyser, fFrequencyData, barX, barWidth, barHeig... | |
<|file_name|>file_mime_process.cc<|end_file_name|><|fim▁begin|>//--------------------------------------------------------------------------
// Copyright (C) 2014-2015 Cisco and/or its affiliates. All rights reserved.
// Copyright (C) 2012-2013 Sourcefire, Inc.
//
// This program is free software; you can redistribute i... | /* if we got the data end reset state, otherwise we're probably still in the data
* * to expect more data in next packet */
if (done_data)
{ |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import collections
import itertools
import json
import os
import posixpath
import re
import time
from operator import attrgetter
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExi... | |
<|file_name|>RateCalculationSwapLeg.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.product.swap;
import java.io.Serializable;
import java.time.LocalDate;
import java.... | |
<|file_name|>modulebonusafterburner.py<|end_file_name|><|fim▁begin|># moduleBonusAfterburner<|fim▁hole|>#
# Used by:
# Modules from group: Propulsion Module (62 of 127)
type = "active"
runTime = "late"
def handler(fit, module, context):
fit.ship.increaseItemAttr("mass", module.getModifiedItemAttr("massAddition"))... | |
<|file_name|>viewFactory.js<|end_file_name|><|fim▁begin|>// namespaces
var dwv = dwv || {};
dwv.image = dwv.image || {};
/**
* {@link dwv.image.View} factory.
*
* @class
*/
dwv.image.ViewFactory = function () {};
/**
* {@link dwv.image.View} factory. Defaults to local one.
*
* @see dwv.image.ViewFactory
*/
dw... | * @param {dwv.image.Image} image The associated image.
* @returns {dwv.image.View} The new View. |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var parentchild = require('../'),
assert = require('assert');
assert.deepEqual(parentchild('foo'), []);
assert.deepEqual(parentchild({}), []);
assert.deepEqual(parentchild([1, 2, 3]), [['inarray', undefined, 1],
['inarray', undefined, 2],
['inarray', undefined, ... | f: 'baz', |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from tc_python.arule import ARule
from t_core.messages import Packet
from HA import HA
from HAb import HAb
from HTopClass2TableLHS import HTopClass2TableLHS
from HTopClass2TableRHS import HTopClass2TableRHS
r1 = ARule(HTopClass2TableLHS(), HTopClass2TableRHS())
... |
r2 = ARule(HTopClass2TableLHS(), HTopClass2TableRHS())
p = Packet()
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from oldcontrib.media.document.models import Document
class DocumentUpload(forms.ModelForm):
class Meta:
model = Document<|fim▁hole|><|fim▁end|> | fields = ('document',) |
<|file_name|>CustomerConversionGoalOperation.java<|end_file_name|><|fim▁begin|>// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v10/services/customer_conversion_goal_service.proto
package com.google.ads.googleads.v10.services;
/**
* <pre>
* A single operation (update) on a... | throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry); |
<|file_name|>LakeBTCMarketDataJsonTest.java<|end_file_name|><|fim▁begin|>package com.xeiam.xchange.lakebtc.marketdata;
import static org.fest.assertions.api.Assertions.assertThat;
import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal;
import org.junit.Test;
import com.fasterxml.jackson... | } |
<|file_name|>mode.rs<|end_file_name|><|fim▁begin|>use state::State;
use std::marker::PhantomData;
use typeahead::Parse;
pub trait Transition<K>
where
K: Ord,
K: Copy,
K: Parse,
{
fn name(&self) -> &'static str;
fn transition(&self, state: &mut State<K>) -> Mode<K>;
}
#[derive(Clone, Copy, Debug)]
... | }
|
<|file_name|>widgets.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import re
from django.utils.safestring import mark_safe
from django.contrib.admin.widgets import AdminFileWidget
from django.template.defaultfilters import slugify
from django.utils.encoding import smart_text
from unidecode import unidec... | # object that FileField will turn into a ValidationError.
return FILE_INPUT_CONTRADICTION
|
<|file_name|>bigquery.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache... | # under the License.
import hashlib |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from base import MediaFile
<|fim▁hole|>from fields import MediaFileField
from widgets import AdminMediaFileWidget<|fim▁end|> | |
<|file_name|>dump_sdcard.py<|end_file_name|><|fim▁begin|>from goprocam import GoProCamera, constants<|fim▁hole|>gpCam.downloadAll()
gpCam.delete("all")<|fim▁end|> | gpCam = GoProCamera.GoPro()
## Downloads all of the SD card's contents and then formats the sd card.
|
<|file_name|>E0116.rs<|end_file_name|><|fim▁begin|>impl Vec<u8> {}
//~^ ERROR E0116
<|fim▁hole|><|fim▁end|> | fn main() {
} |
<|file_name|>sqlx_test.go<|end_file_name|><|fim▁begin|>// The following environment variables, if set, will be used:
//
// * SQLX_SQLITE_DSN
// * SQLX_POSTGRES_DSN
// * SQLX_MYSQL_DSN
//
// Set any of these variables to 'skip' to skip them. Note that for MySQL,
// the string '?parseTime=True' will be appended to the D... | for rows.Next() {
err = rows.StructScan(p2)
if err != nil {
t.Error(err) |
<|file_name|>func_geometric.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2014-2018 Shi Chi(Mack Stone)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | |
<|file_name|>bitcoin_eu_ES.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="eu_ES" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Tradecoin</sou... | <location line="+3"/>
<source>Sent to</source>
<translation>Honi bidalia: </translation> |
<|file_name|>application.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: J.Y Han
# start
# spawn-fcgi -d /users/hanjiyun/project/geeksoho -f /users/hanjiyun/project/geeksoho/application.py -a 127.0.0.1 -p 9001
#stop
# kill `pgrep -f "/users/hanjiyun/project/geeksoho/applicatio... |
if __name__ == "__main__":
|
<|file_name|>types.ts<|end_file_name|><|fim▁begin|>import {
featureCollection,
lineString,
multiLineString,
// Typescript Definitions
Polygon,
LineString,
MultiLineString,
MultiPolygon,
Feature,
FeatureCollection
} from '@turf/helpers'
import lineStringToPolygon from './'
// Fix... | const poly3: Feature<MultiPolygon> = lineStringToPolygon(fc); |
<|file_name|>destination.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code gener... |
from msrest.serialization import Model |
<|file_name|>fe_field_function.cc<|end_file_name|><|fim▁begin|>// ---------------------------------------------------------------------
//
// Copyright (C) 2007 - 2013 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, a... | #include <deal.II/lac/parallel_block_vector.h>
#include <deal.II/lac/petsc_vector.h>
#include <deal.II/lac/petsc_block_vector.h>
#include <deal.II/lac/trilinos_vector.h> |
<|file_name|>device_mojo_mock_to_media_adapter.cc<|end_file_name|><|fim▁begin|>// Copyright 2016 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 "services/video_capture/device_mojo_mock_to_media_adapter.h"
#inc... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import socket
from .attrtree import AttrTree
from .checks import Checks
config = AttrTree()
# the list of checks
config.install_attr('checks', Checks())
# This is the base granularity (in seconds) for polling
# Each check may then individually be configured to r... | config.install_attr('emails.watchdog_subject', '[DOMAIN] Picomon stopped') |
<|file_name|>gen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from math import *
import sys
import string
k = (sqrt(2.)-1.)*4./3.
chars = []
encoding = []
count = 1
first = 1
def append(s):
chars.append(s)
def rint(x):
return int(round(x))
"""
if x>=0:
return int(x+0.5)
else:
return int(x-0.... | ######################################## |
<|file_name|>index.aot.ts<|end_file_name|><|fim▁begin|>import "./polyfills"
import "self/common/libs/prismjs/prism"
<|fim▁hole|>import { platformBrowser } from "@angular/platform-browser"
import { DemoModuleNgFactory } from "./demo.module.ngfactory"
const platform = platformBrowser()
if (process.env.NODE_ENV =... | import { enableProdMode } from "@angular/core" |
<|file_name|>libsubstkeyword.py<|end_file_name|><|fim▁begin|>#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Craig J. Anderson
#
# 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 Softwar... | |
<|file_name|>vote.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# Copyright (c) 2015 Davide Gessa
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from libcontractvm import Wallet, WalletExplorer, ConsensusManager
from forum im... | try:
print ('Broadcasted:', srMan.vote (pollid, choice))
except:
print ('Error.') |
<|file_name|>iterar.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# -*- coding: utf-8 -*-<|fim▁hole|>from random import randint
from argparse import ArgumentParser
""" Exemplo de retorno de carro e passagem de argumentos. """
parser = ArgumentParser(description='Exemplo de retorno de carro e passagem de argument... |
from time import sleep |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.