prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>res_users.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from openerp.osv import osv, fields
import openerp.addons.product.product
class res_users(osv.osv):
_inherit = 'res.users'
_columns = {<|fim▁hole|><|fim▁end|> | 'target_sales_invoiced': fields.integer('Invoiced in Sale Orders Target'),
} |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>package server
import (<|fim▁hole|> "autoscaler/routes"
"autoscaler/scalingengine"
"autoscaler/scalingengine/config"
"code.cloudfoundry.org/cfhttp"
"code.cloudfoundry.org/lager"
"github.com/gorilla/mux"
"github.com/tedsuo/ifrit"
"github.com/tedsuo/ifrit/http_... | "autoscaler/db" |
<|file_name|>router.ts<|end_file_name|><|fim▁begin|>import Vue from 'vue'
import Router from 'vue-router'
import index from '../components/index'
import project from '../components/project/index'
import proAdd from '../components/project/proAdd'
import proList from '../components/project/proList'
import apiList from '.... | import apiEdit from '../components/project/apiEdit'
import apiHistory from '../components/project/apiHistory'
import test from '../components/test' |
<|file_name|>TeamPdfReader.java<|end_file_name|><|fim▁begin|>package me.anthonybruno.soccerSim.reader;
import org.apache.pdfbox.io.RandomAccessFile;
import org.apache.pdfbox.pdfparser.PDFParser;
import org.apache.pdfbox.text.PDFTextStripperByArea;
import java.awt.geom.Rectangle2D;
import java.io.File;
import java.io.... | }
text = moveToNextLine(text);
|
<|file_name|>statuses.js<|end_file_name|><|fim▁begin|>exports.BattleStatuses = {
brn: {
effectType: 'Status',
onStart: function (target, source, sourceEffect) {
if (sourceEffect && sourceEffect.id === 'flameorb') {
this.add('-status', target, 'brn', '[from] item: Flame Orb');
return;
}
this.add('-... | |
<|file_name|>history.js<|end_file_name|><|fim▁begin|>/**
* History.js Core
* @author Benjamin Arthur Lupton <contact@balupton.com>
* @copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
* @license New BSD License <http://creativecommons.org/licenses/BSD/>
*/
(function(window,undefined){
"use strict... | // Unescape hash |
<|file_name|>route.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # TODO: this must be a stub! |
<|file_name|>popup.ts<|end_file_name|><|fim▁begin|>import * as firefox from './firefox';
import * as calcpass2017a from './calcpass2017a';
import {execute_parallel_bcrypt_webworkers} from './execute_parallel_bcrypt_webworkers';
import {stringToUTF8} from './utf8';
import {erase} from './util';
import * as hex from './h... | class Context {
//the scheme, host and port that was in the address bar |
<|file_name|>basicTypesLab.ts<|end_file_name|><|fim▁begin|>let color: string = "green";
let squareSizeNum: number = 100;
let squareSize: string = `${ squareSizeNum }px`;
let button: Element = document.createElement('button');
let div: Element = document.createElement('div');
(div as HTMLElement).style.width = squareSiz... | document.body.appendChild(div); |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>import numpy as np
from menpo.model import PCAModel
from menpo.visualize import print_progress
def prune(weights, n_retained=50):
w_norm = (weights[:, :n_retained] ** 2).sum(axis=1)
# High weights here suggest problematic samples
bad_to_good_index = np.ar... | weights = (np.vstack([model.project(m) for m in meshes]) |
<|file_name|>kubernetes.spec.js<|end_file_name|><|fim▁begin|>/* global describe, beforeEach, it */
const path = require('path');
const assert = require('yeoman-assert');
const helpers = require('yeoman-test');
const fse = require('fs-extra');
const expectedFiles = {
eurekaregistry: [
'./k8s/registry/jhip... | ingressDomain: 'example.com',
clusteredDbApps: [] |
<|file_name|>http.go<|end_file_name|><|fim▁begin|>// Copyright 2015 CoreOS, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//... | Writer: w,
Flusher: w.(http.Flusher),
Closer: c, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
gspread
~~~~~~~
Google Spreadsheets client library.
"""
__version__ = '0.2.1'
__author__ = 'Anton Burnashev'
from .client import Client, login
from .models import Spreadsheet, Worksheet, Cell<|fim▁hole|> Incor... | from .exceptions import (GSpreadException, AuthenticationError,
SpreadsheetNotFound, NoValidUrlKeyFound, |
<|file_name|>watchType.ts<|end_file_name|><|fim▁begin|>/* @internal */
namespace ts {
// Additional tsserver specific watch information
export interface WatchTypeRegistry {
ClosedScriptInfo: "Closed Script info",
ConfigFileForInferredRoot: "Config file for the inferred project root",
<|fim▁... | NodeModulesForClosedScriptInfo: "node_modules for closed script infos in them",
|
<|file_name|>potencia.rs<|end_file_name|><|fim▁begin|>//A potencia elétrica em qualquer circuito é dada por :P = i . v<|fim▁hole|><|fim▁end|> | pub fn f_potencia(u: f64, r: f64) -> f64 { u * r } |
<|file_name|>vaccaleibundgut.py<|end_file_name|><|fim▁begin|>import sys
import os
import glob
import inspect
import pylab as pl
from numpy import *
from scipy import optimize
import pickle
import time
import copy
cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile(inspect.currentframe()))[0]) +... | |
<|file_name|>scrollspy.js<|end_file_name|><|fim▁begin|>(function($, UI) {
"use strict";
var $win = $(window),
$doc = $(document),
scrollspies = [],
checkScrollSpy = function() {
for(var i=0; i < scrollspies.length; i++) {
UI.support.re... | }, $this.options.delay);
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::error::Error;
use std::ffi::OsStr;
use std::fmt;
use std::fs;
use std::io::prelude::*;
use std::os;
use std::path::{Path, PathBuf};
use std::process::Output;
use std::str;
use std::usize;
use rustc_serialize::json::Json;
use url::Url;
use hamcrest... | }
} |
<|file_name|>read_pool.rs<|end_file_name|><|fim▁begin|>// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.
//! Distinct thread pools to handle read commands having different priority levels.
use crate::config::StorageReadPoolConfig;
use crate::storage::kv::{destroy_tls_engine, set_tls_engine, Engine, F... | .build_future_pool() |
<|file_name|>link-documents-return-blockly-component.ts<|end_file_name|><|fim▁begin|>/*
* Lumeer: Modern Data Definition and Processing Platform
*
* Copyright (C) since 2017 Lumeer.io, s.r.o. and/or its affiliates.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of th... | * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<|file_name|>mididevice.py<|end_file_name|><|fim▁begin|>####################################################################################################
# Copyright 2013 John Crawford
#
# This file is part of PatchCorral.
#
# PatchCorral is free software: you can redistribute it and/or modify
# it under the terms ... | def __init__(self, port, name): |
<|file_name|>uva_1260.cpp<|end_file_name|><|fim▁begin|>#include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("in.txt","r",stdin);
int tc,n;
int A[1000],B[1000];
scanf("%d",&tc);
while(tc--)
{
scanf("%d",&n);
int sum=0;
for(int i=0;i<n;i++)
... | }
sum+=B[i];
}
|
<|file_name|>AlignmentTest.java<|end_file_name|><|fim▁begin|>//----------------------------------------------------------------------------//
// //
// A l i g n m e n t T e s t //
// ... | target.translate(to.x, to.y);
|
<|file_name|>ASparkUtil.java<|end_file_name|><|fim▁begin|>/*
* ASpark
* Copyright (C) 2015 Nikolay Platov
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of... | return Pattern.compile("^"+parameterMatcher.replaceAll("([^/]+)")+"$");
}
|
<|file_name|>audio.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import logging
from . import SubprocessHook
logger = logging.getLogger("barython")
class PulseAudioHook(SubprocessHook):
"""<|fim▁hole|> super().__init__(*args, **kwargs, cmd=cmd)<|fim▁end|> | Listen on pulseaudio events with pactl
"""
def __init__(self, cmd=["pactl", "subscribe", "-n", "barython"],
*args, **kwargs): |
<|file_name|>sha1.js<|end_file_name|><|fim▁begin|>/**
*
* Secure Hash Algorithm (SHA1)
* http://www.webtoolkit.info/
*
**/
export function SHA1(msg) {
function rotate_left(n, s) {
var t4 = (n << s) | (n >>> (32 - s));
return t4;
};
function lsb_hex(val) {
var str = "";
... |
var word_array = new Array();
for (i = 0; i < msg_len - 3; i += 4) {
j = msg.charCodeAt(i) << 24 | msg.charCodeAt(i + 1) << 16 | |
<|file_name|>bitrig.rs<|end_file_name|><|fim▁begin|>pub type clock_t = i64;
pub type suseconds_t = i64;
pub type dev_t = i32;
pub type sigset_t = ::c_uint;
pub type blksize_t = ::uint32_t;
pub type fsblkcnt_t = ::c_uint;
pub type fsfilcnt_t = ::c_uint;
pub type pthread_attr_t = *mut ::c_void;
pub type pthread_mutex_t =... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate dyon;
extern crate piston_meta;
use dyon::*;
pub fn test_src(source: &str) {
let mut module = Module::new();
load(source, &mut module).unwrap_or_else(|err| {
panic!("In `{}`:\n{}", source, err);
});
}
pub fn test_fail_src(source: &str)... | test_fail_src("source/typechk/refinement_22.dyon");
test_src("source/typechk/refinement_23.dyon"); |
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Jonathan Eyolfson
use libc::{c_char, c_int, c_void, size_t, uint32_t, uint64_t};
#[repr(C)]
pub type wl_argument = uint64_t;
#[repr(C)]
pub struct wl_array {
pub size: size_t,
pub alloc: size_t,
pub data: *mut c_void,
}
#[repr(C)]
pub ... | pub methods: *const wl_message,
pub event_count: c_int,
pub events: *const wl_message,
} |
<|file_name|>datacatalog_v1_generated_policy_tag_manager_list_policy_tags_sync.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 cop... | page_result = client.list_policy_tags(request=request)
# Handle the response |
<|file_name|>test_runner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls ... | 'wallet_multiwallet.py',
'wallet_multiwallet.py --usecli',
'interface_http.py', |
<|file_name|>regress-900055.js<|end_file_name|><|fim▁begin|>// Copyright 2008 Google Inc. All Rights Reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain th... | assertEquals(42, e("42")); |
<|file_name|>OneFichierCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import re
import time
import pycurl
from module.network.HTTPRequest import BadHeader
from ..internal.Account import Account
class OneFichierCom(Account):
__name__ = "OneFichierCom"
__type__ = "account"
__version__ = "0.2... | premium = None |
<|file_name|>data.js<|end_file_name|><|fim▁begin|>var DATA = {"a" : "b", "c" : "d"};
var RESPONSE = {"vendor":"OpenPolicy","name":"alex","locations":[{"continent":"Europe","country":"Germany","price":5,"latitude":"48.105964","name":"Slot_ger_4","longitude":"11.612549"},{"continent":"Europe","country":"Germany","price"... | var REQUEST = {
"name":"alex", |
<|file_name|>renderers.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
from abc import ABCMeta, abstractmethod
import csv
import os
import re
import subprocess
import sys
import plaid2text.config_manager as cm
from plaid2text.interact import separator_completer, prompt
class Entry:
"""
This represen... | self.transaction['posting_account'] = options.posting_account
self.transaction['cleared_character'] = options.cleared_character
if options.template_file: |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()<|fim▁hole|>setup(
name = "django-pressroom",
version = "0.4.2.1",
url = 'https://github.com/petry/django-pressroom... | |
<|file_name|>QualityService.java<|end_file_name|><|fim▁begin|>package com.fruit.service.management;
import com.fruit.base.BaseService;
import com.fruit.entity.management.Quality;
import java.util.Map;
/**
* 产品质量检测 Service
* @author CSH
*
*/
public interface QualityService extends BaseService<Quality> {
/*... | * @param pageSize
* @param ownid 当id小于0时,表示不采用该条件
* @param params
* @return |
<|file_name|>referenciacatastral.py<|end_file_name|><|fim▁begin|># referenciacatastral.py - functions for handling Spanish real state ids
# coding: utf-8
#
# Copyright (C) 2016 David García Garzón
# Copyright (C) 2016-2017 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it unde... |
More information:
|
<|file_name|>TestScopedEnumType.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ScopedEnumType(TestBase):
mydir = TestBase.compute_mydir(__file__... | |
<|file_name|>test_volume_quotas_negative.py<|end_file_name|><|fim▁begin|># Copyright 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
... | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License. |
<|file_name|>UiPasswordPlugin.py<|end_file_name|><|fim▁begin|>import string
import random
import time
import json
import re
from Config import config
from Plugin import PluginManager
if "sessions" not in locals().keys(): # To keep sessions between module reloads
sessions = {}
def showPasswordAdvice(password):
... | if path.endswith("favicon.ico"): |
<|file_name|>agency.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
let AgencySchema = new Schema({
})
module.exports = mongoose.model('Agency', AgencySchema)<|fim▁end|> | const mongoose = require('mongoose')
const Schema = mongoose.Schema |
<|file_name|>FvSTLAssisstant.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>#include "FvSTLAssisstant.h"<|fim▁end|> | |
<|file_name|>TravelTimeFMM.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Tue Jul 07 09:44:36 2015
@author: Marcus
"""
import pygimli as pg
import numpy as np
from pygimli.physics.traveltime.fastMarchingTest import fastMarch
import matplotlib.pyplot as plt
import time as time
from ... | node_id = boundary.node(1).id()
return node_id, cell_id
|
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>import json
import sys
import logging
import logging.handlers
def load_config():<|fim▁hole|> '''Loads application configuration from a JSON file'''
try:
json_data = open('config.json')
config = json.load(json_data)
json_data.close()
... | |
<|file_name|>upgrade.go<|end_file_name|><|fim▁begin|>package command
import (
"fmt"
"github.com/urfave/cli"
)
func (f *CommandFactory) Upgrade() cli.Command {
return cli.Command{
Name: "upgrade",
Usage: "upgrade a Layer0 instance to a new version",
ArgsUsage: "NAME VERSION",
Flags: []cli.Flag{<|f... | cli.BoolFlag{ |
<|file_name|>isogram.py<|end_file_name|><|fim▁begin|>def is_isogram(s):
""" Determine if a word or phrase is an isogram.
An isogram (also known as a "nonpattern word") is a word or phrase without a repeating letter.
Examples of isograms:
- lumberjacks
- background<|fim▁hole|> """
from coll... | - downstream |
<|file_name|>role.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
desk_properties = ("search_bar", "notifications", "chat", "list_sideba... | info_list = []
for user in users:
user_info, enabled = frappe.db.get_value("User", user.get("user_name"), [field, "enabled"])
if enabled and user_info not in ["admin@example.com", "guest@example.com"]: |
<|file_name|>funcd.py<|end_file_name|><|fim▁begin|># Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# Copyright (c) 2013, Michael Scherer <misc@zarb.org>
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see... |
def connect(self, port=None):
if not HAVE_FUNC: |
<|file_name|>math.hpp<|end_file_name|><|fim▁begin|>#pragma once
#include <cmath>
<|fim▁hole|>const double M_PI = 3.14159265358979323846264338327950288;
#endif
#endif
const double M_2PI = M_PI * 2.0;
inline float _fmod( float x, float y ) { return fmod( fmod( x, y ) + y, y ); }<|fim▁end|> | // windows MinGW fix
#ifdef __MINGW32__
#ifndef M_PI |
<|file_name|>optrecurse.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | |
<|file_name|>VisitorVo.java<|end_file_name|><|fim▁begin|>package com.baidu.disconf.web.service.user.vo;<|fim▁hole|> private Long id;
private String name;
private String role;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String g... |
public class VisitorVo {
|
<|file_name|>tempstorage.py<|end_file_name|><|fim▁begin|>import os.path
from uuid import uuid4
import shutil
import logging
logger = logging.getLogger(__name__)
_MARKER = object()
class FileUploadTempStore(object):
session_storage_slug = 'websauna.tempstore'
def __init__(self, request):
self.tempd... | self.session[self.session_storage_slug] = existing
def clear(self):
data = self.session.pop('substanced.tempstore', {}) |
<|file_name|>AbstractEigenvectorModel.js<|end_file_name|><|fim▁begin|>var clover = new Object();
// JSON: {classes : [{name, id, sl, el, methods : [{sl, el}, ...]}, ...]}
clover.pageData = {"classes":[{"el":46,"id":86762,"methods":[{"el":38,"sc":2,"sl":36}],"name":"AbstractEigenvectorModel","sl":32}]}
// JSON: {test... | clover.testTargets = {}
|
<|file_name|>JavaBinary.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licen... | getBuildTarget()); |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
path = os.path.abspath(__file__)
modpath = os.path.dirname(path)
base_dir = os.getcwd()
install_mode = 'normal'
plus = False
mon = False
venv = "y"
if len(sys.argv) > 1:
if '-django' in sys.argv:
install_mode = 'django'
elif '-dev' in sy... | from __future__ import print_function
import sys
import os
import subprocess |
<|file_name|>sentiment_anaylsis_twitter_data.py<|end_file_name|><|fim▁begin|>from tweepy import API
from tweepy import Cursor
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from textblob import TextBlob
import twitter_credentials
import matplotlib.pyplot as pl... | return ' '.join(re.sub("(@[A-Za-z0-9]+)|([^0-9A-Za-z \t])|(\w+:\/\/\S+)", " ", tweet).split())
def analyze_sentiment(self, tweet): |
<|file_name|>viperpeers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim:fileencoding=utf-8
# Find the best reactor
reactorchoices = ["epollreactor", "kqreactor", "cfreactor", "pollreactor", "selectreactor", "posixbase", "default"]
for choice in reactorchoices:
try:
exec("from twisted.internet import %s ... | self.charset=cpage=self.core_settings['Lang'].split('.')[1]
try: |
<|file_name|>power_button.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import RPi.GPIO as GPIO
import subprocess
# Starting up
GPIO.setmode(GPIO.BCM)
GPIO.setup(3, GPIO.IN)
<|fim▁hole|># Shutting down
subprocess.call(['shutdown', '-h', 'now'], shell=False)<|fim▁end|> | # Wait until power button is off
# Recommended to use GPIO.BOTH for cases with switch
GPIO.wait_for_edge(3, GPIO.BOTH)
|
<|file_name|>unable_module.py<|end_file_name|><|fim▁begin|># coding:utf8
""" <|fim▁hole|>class UnableTest(object):
pass<|fim▁end|> | 无法从上层目录进行导入操作
"""
|
<|file_name|>flotChartServ.js<|end_file_name|><|fim▁begin|>angular.module('n52.core.diagram')
.service('flotChartServ', [
'timeseriesService',
'timeService',
'settingsService',
'flotDataHelperServ',
'$rootScope',
'monthNamesTranslaterServ',
'labelMapperSrvc',
... | requests.push(requestUom);
}
if (elem.parameters && elem.parameters.phenomenon) {
requestLabel = labelMapperSrvc.getMappedLabel(elem.parameters.phenomenon.label); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
<|fim▁hole|><|fim▁end|> | from .__version__ import __version__ |
<|file_name|>FTypeAtomBuilder.java<|end_file_name|><|fim▁begin|>package de.csmath.QT;
import java.util.Collection;
import java.util.List;
/**
* This class builds a FTypeAtom from given parameters.
* @author lpfeiler
*/
public class FTypeAtomBuilder extends QTAtomBuilder {
/**
* @see FTypeAtom#majBrand
... | |
<|file_name|>dns.go<|end_file_name|><|fim▁begin|>package dns
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"strings"
. "github.com/onsi/ginkgo"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/apimachinery/registered"
"k8s.io/k... | s.Spec.ExternalName = externalName
s.Spec.ClusterIP = ""
} |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from datetime import datetime
from django.http import HttpResponse
from smsbrana import SmsConnect
from smsbrana import signals
from smsbrana.const import DELIVERY_STATUS_DELIVERED, DATETIME_FORMAT
from smsbrana.models import SentSms
def smsco... | sms.delivered = True
sms.delivered_date = datetime.strptime(delivered['time'], DATETIME_FORMAT)
sms.save() |
<|file_name|>logFileParser.py<|end_file_name|><|fim▁begin|>""" 1. Parse log file of a webserver
2. Print the filename and number of bytes delivered for 200 responses
"""
import re
import sys
from os import path
import operator<|fim▁hole|>
pattern = re.compile(r'\[(?P<time>.+)\](\s+\")(?P<requestType>\w+)(\s+)(?P<f... | import itertools
log_file_path = "server.log"
log_data = [] |
<|file_name|>algoliasearch.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013 Algolia
* http://www.algolia.com/
*
* 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 restrictio... | },
/*
* Delete an object from the index |
<|file_name|>auth.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 OpenStack, LLC.
#
# 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... | LOG.warn(_LW('manila.api.auth:pipeline_factory is deprecated. Please use '
'manila.api.middleware.auth:pipeline_factory instead.')) |
<|file_name|>transformer.ts<|end_file_name|><|fim▁begin|>/* @internal */
namespace ts {
function getModuleTransformer(moduleKind: ModuleKind): TransformerFactory<SourceFile | Bundle> {
switch (moduleKind) {
case ModuleKind.ESNext:
case ModuleKind.ES2015:
return ... | } |
<|file_name|>test_custom_dm_diam_dm_proj.py<|end_file_name|><|fim▁begin|>import shesha.config as conf
simul_name = "bench_scao_sh_16x16_8pix"
layout = "layoutDeFab_SH"
# loop
p_loop = conf.Param_loop()
p_loop.set_niter(1000)
p_loop.set_ittime(0.002) # =1/500
# geom
p_geom = conf.Param_geom()<|fim▁hole|># tel
p_tel... |
p_geom.set_zenithangle(0.)
|
<|file_name|>compressd.py<|end_file_name|><|fim▁begin|>#import binwalk.core.C
import binwalk.core.plugin
#from binwalk.core.common import *
class CompressdPlugin(binwalk.core.plugin.Plugin):
# '''
# Searches for and validates compress'd data.
# '''
MODULES = ['Signature']
#READ_SIZE = 64
#COMPR... | #self.comp = binwalk.core.C.Library(self.COMPRESS42, self.COMPRESS42_FUNCTIONS)
# This plugin is currently disabled due to the need to move away from supporting C
# libraries and into a pure Python project, for cross-platform support and ease of |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
Requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
... | from logging import NullHandler
except ImportError: |
<|file_name|>pictorial_structures_revisited_main.cpp<|end_file_name|><|fim▁begin|>#if defined(_WIN64) || defined(WIN64) || defined(_WIN32) || defined(WIN32)
#include <windows.h>
#endif
#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#if defined(__unix__) || defined(__unix) || defined(uni... | |
<|file_name|>stock_quant_report.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
###############################################################################
# License, author and contributors information in: #
# __manifest__.py file at the root folder of this module. ... | wizard_id = fields.Many2one('wizard.valuation.stock.inventory', required=True, ondelete='cascade')
location_id = fields.Many2one('stock.location', 'Location')
product_id = fields.Many2one('product.product', 'Product')
product_categ_id = fields.Many2one('product.category', string='Category') |
<|file_name|>fonts.cpp<|end_file_name|><|fim▁begin|>/* Copyright 2013-2017 Matt Tytel
*
* helm 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 la... |
Fonts::Fonts() { |
<|file_name|>MessageTraffic.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
const {
LineChart,
Line,
XAxis,
YAxis,
Tooltip,
} = require('recharts');
export default ({data, type, text}) => (
<div className='lineGraph'>
<h2>Right now:
<span className='rate'>{data[data.length ... | <Line type='monotone' dataKey={type} stroke='#228B22' strokeWidth={2}/> |
<|file_name|>507. Perfect Number.cpp<|end_file_name|><|fim▁begin|>507. Perfect Number
We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself.
Now, given an integer n, write a function that returns true when it is a perfect number and false when it is not.... | Note: The input number n will not exceed 100,000,000. (1e8)
|
<|file_name|>embed.js<|end_file_name|><|fim▁begin|>/*
Sapling pagelink dialog
*/
CKEDITOR.dialog.add( 'embed', function( editor )
{
var plugin = CKEDITOR.plugins.embed;
var pagelink_plugin = CKEDITOR.plugins.pagelink;
return {
title : 'Embed media',
minWidth : 300,
minHeight : 150,
contents : [
{
id... | |
<|file_name|>jdk.nashorn.api.tree.ModuleTree.d.ts<|end_file_name|><|fim▁begin|>declare namespace jdk {
namespace nashorn {
namespace api {
namespace tree {
interface ModuleTree extends jdk.nashorn.api.tree.Tree {<|fim▁hole|> getIndirectExportEntries(): java.util.List<jdk.nashorn.api.tree.E... | getImportEntries(): java.util.List<jdk.nashorn.api.tree.ImportEntryTree>
getLocalExportEntries(): java.util.List<jdk.nashorn.api.tree.ExportEntryTree> |
<|file_name|>api-data.js<|end_file_name|><|fim▁begin|>import supertest from 'supertest';
import { publicChannelName, privateChannelName } from './channel.js';
import { roleNameUsers, roleNameSubscriptions, roleScopeUsers, roleScopeSubscriptions, roleDescription } from './role.js';
import { username, email, adminUserna... | export const apiRoleDescription = `api${ roleDescription }`;
export const reservedWords = [
'admin', |
<|file_name|>receiver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 3 13:38:36 2015
@author: madengr
"""
from gnuradio import gr
import osmosdr
from gnuradio import filter as grfilter # Don't redefine Python's filter()
from gnuradio import blocks
from gnuradio i... | gain = self.quad_demod_gain * 10**(volume_db/20.0) |
<|file_name|>SearchViewSubject.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 Square, Inc.
* Copyright 2016 PKWARE, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at<|fim▁hole... | * |
<|file_name|>tool-list_networks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This bot regenerates the page VEIDs
<|fim▁hole|>
"""
__version__ = '$Id: basic.py 4946 2008-01-29 14:58:25Z wikipedian $'
import wikipedia
import pagegenerators, catlib, re, socket, sys
from iplib import CIDR,... | The following parameters are supported:
-debug If given, doesn't do any real changes, but only shows
what would have been changed. |
<|file_name|>deliver_test.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2016 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/lic... | |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>define(['exports'], function (exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a cl... |
return App;
}();
}); |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
# not sure about line 7
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.... | url(r'^logout/$', 'drinker.views.LogOutRequest'),
url(r'^index/filter/$', 'filter.views.changeBright'), |
<|file_name|>Ge.CorCorporateRow.ts<|end_file_name|><|fim▁begin|>
namespace GestionEquestre.Ge {
export interface CorCorporateRow {
Id?: number;
IsActive?: boolean;
NotArchive?: boolean;
InsertDate?: string;
InsertUserId?: number;
UpdateDate?: string;
UpdateUs... | 'IsActive',
'NotArchive', |
<|file_name|>rnn_cell_wrapper_v2_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 The TensorFlow 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
#
# htt... | |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>#[cfg(test)]
use ::{card, deck, hand};
#[test]
fn create_hand() {
let mut deck = deck::Deck::new();
let mut cards: Vec<card::Card> = vec![];
for _i in 0..5 {
cards.push(deck.draw().unwrap());
}
let hand = hand::Hand::new(cards);
assert... | assert_eq!(hand.has_pair(), false);
}
#[test] |
<|file_name|>wp_deploy.js<|end_file_name|><|fim▁begin|>module.exports = {
dist: {
options: {<|fim▁hole|> }
}
};<|fim▁end|> | plugin_slug: 'simple-user-adding',
svn_user: 'wearerequired',
build_dir: 'release/svn/',
assets_dir: 'assets/' |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_name="rustspec"]
#![crate_type="dylib"]
#![feature(plugin_registrar, rustc_private, collections, core, convert)]
extern crate syntax;
extern crate core;
extern crate rustc;
extern crate rustspec_assertions;
pub use rustspec_assertions::{expect, eq, be_gt, be_g... | |
<|file_name|>options.py<|end_file_name|><|fim▁begin|>'''
This module corresponds to ARDroneLib/Soft/Common/navdata_common.h
'''
import ctypes
import functools
from pyardrone.utils.structure import Structure
uint8_t = ctypes.c_uint8
uint16_t = ctypes.c_uint16
uint32_t = ctypes.c_uint32
int16_t = ctypes.c_int16
int32... |
new_raw_picture = int32_t |
<|file_name|>test_random_graphs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from nose.tools import *
from networkx import *
from networkx.generators.random_graphs import *
class TestGeneratorsRandom():
def smoke_test_random_graph(self):
seed = 42
G=gnp_random_graph(100,0.25,seed)
... |
G=barabasi_albert_graph(100,1,seed) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015-2020 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesse... | pub mod timetracking; |
<|file_name|>alignment.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Bin;
use Buildable;
use Container;
use Widget;
use ffi;
use glib;
use glib::StaticType;
use glib::Value;
use glib::object::... | #[cfg_attr(feature = "v3_14", deprecated)]
fn connect_property_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[cfg_attr(feature = "v3_14", deprecated)] |
<|file_name|>readers.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
import tensorflow.contrib.slim as slim
class BaseReader(object):
def read(self):
raise NotImplementedError()
class ImageReader(BaseReader):
def __init__(self):
self.width = None
self.height = None
def g... |
def set_image_size(self, width, height):
self.width = width |
<|file_name|>extensions.py<|end_file_name|><|fim▁begin|>"""
This module hosts all the extension functions and classes created via SDK.
The function :py:func:`ext_import` is used to import a toolkit module (shared library)
into the workspace. The shared library can be directly imported
from a remote source, e.g. http, ... | arglist = [[0, i] for i in range(len(argnames))] |
<|file_name|>menu.ts<|end_file_name|><|fim▁begin|>import * as h from 'mithril/hyperscript'
import { select } from 'd3-selection'
import { scaleLinear } from 'd3-scale'
import { area as d3Area } from 'd3-shape'
import { axisLeft } from 'd3-axis'
import i18n from '../../i18n'
import router from '../../router'
import { Us... | |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>/**
* This file is part of taolin project (http://taolin.fbk.eu)
* Copyright (C) 2008, 2009 FBK Foundation, (http://www.fbk.eu)
* Authors: SoNet Group (see AUTHORS.txt)
*
* Taolin is free software: you can redistribute it and/or modify
* it under the terms of the... | .append($('<span>') |
<|file_name|>anon_db.py<|end_file_name|><|fim▁begin|>"""Remove any personally identifying information from the database"""
from django.core.management.base import BaseCommand
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django_openid_auth.models import UserOpenID
from rest_fram... | res = InstallerIssueReply.objects.all().update(submitted_by=user)
print("Updated %s issue replies" % res) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.