prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>info_result.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 G... | // Generates a extension for the `Result<T, E>`, named `DebugResult` which has functionality to
// print either `T` or `E` via `info!()`.
generate_result_logging_extension!(
InfoResult, |
<|file_name|>SpeedMeter.py<|end_file_name|><|fim▁begin|># -*- coding: iso-8859-1 -*-
# --------------------------------------------------------------------------- #
# SPEEDMETER Control wxPython IMPLEMENTATION
# Python Code By:
#
# Andrea Gavana, @ 25 Sep 2005
# Latest Revision: 10 Oct 2005, 22.40 CET
#
#
# TODO List/C... | |
<|file_name|>psmetrics.py<|end_file_name|><|fim▁begin|># $Id$
# Christopher Lee clee@users.sourceforge.net
# based upon pdfmetrics.py by Andy Robinson
from . import fontinfo
from . import latin1MetricsCache
##############################################################
#
# PDF Metrics
# This is a preamble to give ... | |
<|file_name|>BatchCommand.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 JBoss, by Red Hat, 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/l... | |
<|file_name|>elementIdElements.js<|end_file_name|><|fim▁begin|>/**
*
* Search for multiple elements on the page, starting from an element. The located
* elements will be returned as a WebElement JSON objects. The table below lists the
* locator strategies that each server should support. Elements should be returned... | })
return result
}) |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
fn main() {<|fim▁hole|><|fim▁end|> | println!("cargo:rustc-flags=-l mscoree");
} |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! FFI bindings to d3d9.
#![cfg(windows)]
extern crate winapi;
use winapi::*;
#[cfg(any(target_arch = "x86", target_arch = "x86_64", target_arch = "arm"))]
extern "system" {
pub fn D3... | pub fn Direct3DCreate9Ex(SDKVersion: UINT, arg1: *mut *mut IDirect3D9Ex) -> HRESULT; |
<|file_name|>ticketing.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
logbook.ticketing
~~~~~~~~~~~~~~~~~
Implements long handlers that write to remote data stores and assign
each logging message a ticket id.
:copyright: (c) 2010 by Armin Ronacher, Georg Brandl.
:license: BSD, see... | time.sleep(0.1)
self.database = database
|
<|file_name|>multi_vms_file_transfer.py<|end_file_name|><|fim▁begin|>import time, os, logging
from autotest.client import utils
from autotest.client.shared import error
from virttest import remote, utils_misc
@error.context_aware
def run_multi_vms_file_transfer(test, params, env):
"""
Transfer a file back and... | 1) Boot up two VMs .
2) Create a large file by dd on host. |
<|file_name|>BenchmarkTest10564.java<|end_file_name|><|fim▁begin|>/**
* OWASP Benchmark Project v1.1
*
* This file is part of the Open Web Application Security Project (OWASP)
* Benchmark Project. For details, please see
* <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>... |
response.getWriter().printf(java.util.Locale.US,bar,obj);
} // end doPost |
<|file_name|>test_alias.py<|end_file_name|><|fim▁begin|>import os
from cauldron.test import support
from cauldron.test.support import scaffolds
class TestAlias(scaffolds.ResultsTest):
"""..."""
def test_unknown_command(self):
"""Should fail if the command is not recognized."""
r = support.r... | """..."""
|
<|file_name|>es.js<|end_file_name|><|fim▁begin|>MessageFormat.locale.es = function ( n ) {<|fim▁hole|> return "other";
};<|fim▁end|> | if ( n === 1 ) {
return "one";
} |
<|file_name|>AnswerGenerator.java<|end_file_name|><|fim▁begin|>/**
*
*/
package qa.AnswerFormation;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Queue;
import qa.IQuestion;
import qa.Utility;
/**
* @author Deepak
*
*/
public class AnswerGenerato... | /**
*
*/
|
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';<|fim▁hole|>import { CovalentLayoutModule, CovalentStepsModule, CovalentDataTableModule, CovalentMessageModule } from ... | import { HttpModule } from '@angular/http';
import { MaterialModule } from '@angular/material';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015, The Radare Project. All rights reserved.
// See the COPYING file at the top-level directory of this distribution.
// Licensed under the BSD 3-Clause License:
// <http://opensource.org/licenses/BSD-3-Clause>
// This file may not be copied, modifie... | |
<|file_name|>val_or_vec.rs<|end_file_name|><|fim▁begin|>use std::{iter, ptr, vec};
use serde::de::{
self,
value::{Error, SeqDeserializer},
Deserializer, IntoDeserializer,
};
#[derive(Debug)]
pub enum ValOrVec<T> {
Val(T),
Vec(Vec<T>),
}
impl<T> ValOrVec<T> {
pub fn push(&mut self, new_val: T)... | // we instead use ptr::write to set self to Self::Vec.
ValOrVec::Val(val) => {
let mut vec = Vec::with_capacity(2);
// Safety: since the vec is pre-allocated, push can't panic, so |
<|file_name|>try_regexp.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
import logging
from flexget import options, plugin
from flexget.event import event
... | |
<|file_name|>net.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env Python
import time
import sys
if len(sys.argv) > 1:
INTERFACE = sys.argv[1]
else:
INTERFACE = 'eth1'
STATS = []
print 'Interface:',INTERFACE
def rx():
ifstat = open('/proc/net/dev').readlines()
for interface in ifstat:
#print '-... | |
<|file_name|>event.py<|end_file_name|><|fim▁begin|># encoding: utf-8
#
# Copyright 2017 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... | self.objects.update(other.objects)
return [self]
if not self.mergeable(other): |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or mo... | 'portal',
], |
<|file_name|>SqlRuntimeTester.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 un... | check(factory, sap.sql, SqlTests.ANY_TYPE_CHECKER,
SqlTests.ANY_PARAMETER_CHECKER, SqlTests.ANY_RESULT_CHECKER);
} catch (Throwable ex) {
// get the real exception in runtime check |
<|file_name|>page_test.py<|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.
import logging
from telemetry.page.actions import all_page_actions
from telemetry.page.actions imp... | self.page_successes = []
self.page_failures = [] |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import Base... | return self.get_provider().sociallogin_from_response(request,
extra_data)
|
<|file_name|>plot_capecod_onlevel.py<|end_file_name|><|fim▁begin|>"""
=====================================
Include On-leveling into Cape Cod
=====================================
This example demonstrates how to incorporate on-leveling into the `CapeCod`
estimator. The on-level approach emulates the approach taken b... | 'rate_change': [.02, .02, .02, .02, .05, .075, .15, .1, -.2, -.2]
})
|
<|file_name|>classify.rs<|end_file_name|><|fim▁begin|>#![feature(core, core_float)]
extern crate core;
#[cfg(test)]
mod tests {
use core::num::Float;
use core::num::FpCategory::{self, Nan, Infinite, Zero, Subnormal, Normal};
// #[derive(Copy, Clone, PartialEq, Debug)]
// #[stable(feature = "rust1", s... | fn classify_test4() {
let value: f32 = f32::zero();
let result: FpCategory = value.classify(); |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>import { Message } from "botkit";
import { Intent, Entity } from "../index";
export interface DialogFlowMessage extends Message {
/**
* The top intent of the message.
*/
topIntent: Intent,
/**
* A list of possible intents.
*/
i... | |
<|file_name|>layout_assignment.cc<|end_file_name|><|fim▁begin|>/* Copyright 2017 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
http://www.apache.o... | // Set layouts of the instructions' shapes. |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | if count is not None: |
<|file_name|>fat.rs<|end_file_name|><|fim▁begin|>use alloc::vec::Vec;
use core::mem;
use crate::address::Align;
#[repr(packed)]
pub struct BPB {
jmp_instr: [u8; 3],
oem_identifier: [u8; 8],
bytes_per_sector: u16,
sectors_per_cluster: u8,
resd_sectors: u16,
fat_count: u8,
root_di... | b
} else {
|
<|file_name|>log_handlers.py<|end_file_name|><|fim▁begin|>from logging.handlers import BaseRotatingHandler
import string
import time
import datetime
import os
class TimePatternRotatingHandler(BaseRotatingHandler):
def __init__(self, filename, when, encoding=None, delay=0):
self.when = string.upper(when)
... | if self.mock_dt is not None:
return self.mock_dt
|
<|file_name|>item6.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python
a=['red','orange','yellow','green','blue','purple']
odds=a[::2]
evens=a[1::2]
print odds
print evens
x=b'abcdefg'
y=x[::-1]
print y
c=['a','b','c','d','e','f']
d=c[::2]
e=d[1:-1]<|fim▁hole|><|fim▁end|> | print e |
<|file_name|>eventflags_string.go<|end_file_name|><|fim▁begin|>// Code generated by "bitstringer -type=EventFlags"; DO NOT EDIT
package perffile
import "strconv"
func (i EventFlags) String() string {
if i == 0 {
return "0"
}
s := ""
if i&EventFlagClockID != 0 {
s += "ClockID|"
}
if i&EventFlagComm != 0 {
... | s += "Pinned|" |
<|file_name|>strings.js<|end_file_name|><|fim▁begin|>define({<|fim▁hole|> sidebarTitle: 'Legend',
modalAboutTitle: 'About',
modalAboutContent: 'The goal of this application boilerplate is to demonstrate how to build a mapping application that utilizes the best parts of Dojo (AMD modules, classes and widgets,... | root: ({
appTitle: 'Dojo Bootstrap Map',
navBasemaps: 'Basemaps',
navAbout: 'About', |
<|file_name|>bcbio_fastq_umi_prep.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Convert 3 fastq inputs (read 1, read 2, UMI) into paired inputs with UMIs in read names
Usage:
bcbio_fastq_umi_prep.py single <out basename> <read 1 fastq> <read 2 fastq> <umi fastq>
or:
bcbio_fastq_umi_prep.py autopair [<li... | sp = parser.add_subparsers(title="[sub-commands]") |
<|file_name|>settings.spec.js<|end_file_name|><|fim▁begin|>/* eslint prefer-arrow-callback: 0, func-names: 0, 'react/jsx-filename-extension': [1, { "extensions": [".js", ".jsx"] }] */
import React from 'react';
import assert from 'assert';
import { shallow } from 'enzyme';
import sinon from 'sinon';
import DisplayName... | const publicChecked = wrapper.find('input[type="radio"]').last().props().defaultChecked;
assert.equal(privateChecked, collectionWithoutDefaultSubject.private);
assert.notEqual(publicChecked, collectionWithoutDefaultSubject.private); |
<|file_name|>harvest.py<|end_file_name|><|fim▁begin|>import re
import click
from lancet.utils import hr
@click.command()
@click.argument("query", required=False)
@click.pass_obj
def projects(lancet, query):
"""List Harvest projects, optionally filtered with a regexp."""
projects = lancet.timer.projects()
... | if match is None: |
<|file_name|>UniqueLbPortViolationException.java<|end_file_name|><|fim▁begin|>package org.openstack.atlas.service.domain.exception;
public class UniqueLbPortViolationException extends PersistenceServiceException {
private final String message;
public UniqueLbPortViolationException(final String message) {<|fim... | this.message = message;
}
|
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component, ViewChild } from '@angular/core';
import { jqxNumberInputComponent } from '../../../../../jqwidgets-ts/angular_jqxnumberinput';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {... | };
} |
<|file_name|>AbstractFileOutput.java<|end_file_name|><|fim▁begin|>package com.debugtoday.htmldecoder.output;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedE... | if (!parentFile.exists()) {
parentFile.mkdirs();
} |
<|file_name|>gridportfoliodividend.js<|end_file_name|><|fim▁begin|>define(['./alasqlportfoliodividenddata', './monthstaticvalues', './bankdatadividend', './dateperiod'], function(alasqlportfoliodividenddata, monthstaticvalues, bankdatadividend, dateperiod) {
var gridData = [];
var gridId;
var months = mont... | |
<|file_name|>http.rs<|end_file_name|><|fim▁begin|>use hyper::{Client, Error};
use hyper::client::Response;
use hyper::header::ContentType;
use hyper::method::Method;
/// Makes a DELETE request to etcd.
pub fn delete(url: String) -> Result<Response, Error> {
request(Method::Delete, url)
}
/// Makes a GET request t... | pub fn post(url: String, body: String) -> Result<Response, Error> { |
<|file_name|>sql_to_sheets.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 A... |
def execute(self, context: Any) -> None:
self.log.info("Getting data") |
<|file_name|>exceptions.js<|end_file_name|><|fim▁begin|>import { ListWrapper } from 'angular2/src/facade/collection';
import { stringify, isBlank } from 'angular2/src/facade/lang';
import { BaseException, WrappedException } from 'angular2/src/facade/exceptions';
function findFirstClosedCycle(keys) {
var res = [];
... | *
* expect(() => injector.get("one")).toThrowError();
* ``` |
<|file_name|>object_is.js<|end_file_name|><|fim▁begin|>Object.is(1, 1);
Object.is(1, 2);
Object.is(1, {});
Object.is(1, NaN);
Object.is(0, 0);
Object.is(0, -0);
Object.is(NaN, NaN);
Object.is({}, {});
var emptyObject = {};
var emptyArray = [];
Object.is(emptyObject, emptyObject);
Object.is(emptyArray, emptyArray);
Obj... | var b: string = Object.is('a', 'a'); |
<|file_name|>attenuator.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | |
<|file_name|>pattern_correlation.py<|end_file_name|><|fim▁begin|>"""
This file is part of pyCMBS.
(c) 2012- Alexander Loew
For COPYING and LICENSE details, please refer to the LICENSE file
"""
"""
development script for pattern correlation analysis
"""
from pycmbs.diagnostic import PatternCorrelation
from pycmbs.data... | import numpy as np |
<|file_name|>paint_preview_base_service.cc<|end_file_name|><|fim▁begin|>// Copyright 2019 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 "components/paint_preview/browser/paint_preview_base_service.h"
#include... | std::move(callback).Run(CaptureStatus::kCaptureFailed, {}); |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-06-02 20:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):<... | |
<|file_name|>subscriber.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use crate::action::CloudSyncTrigger;
use crate::config::CommitCloudConfig;
use crate:... |
#[allow(unused_macros)] |
<|file_name|>rom_nist384_32.rs<|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 ... | use nist384::big::NLEN;
use super::super::arch::Chunk;
use types::{ModType, CurveType, CurvePairingType, SexticTwist, SignOfX};
|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export { KeyValueCache } from './KeyValueCache';<|fim▁hole|><|fim▁end|> | export { InMemoryLRUCache } from './InMemoryLRUCache'; |
<|file_name|>get_active_creative_wrappers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at... | __author__ = ('Nicholas Chen',
'Joseph DiLallo')
|
<|file_name|>test-load.js<|end_file_name|><|fim▁begin|>/*global describe, beforeEach, it*/
'use strict';
<|fim▁hole|>
describe('video generator', function () {
it('can be imported without blowing up', function () {
var app = require('../app');
assert(app !== undefined);
});
});<|fim▁end|> | var assert = require('assert'); |
<|file_name|>TestRtiOpCode.py<|end_file_name|><|fim▁begin|>from Chip import OpCodeDefinitions
from Tests.OpCodeTests.OpCodeTestBase import OpCodeTestBase
class TestRtiOpCode(OpCodeTestBase):<|fim▁hole|><|fim▁end|> | def test_execute_rti_implied_command_calls_and_method(self):
self.assert_opcode_execution(OpCodeDefinitions.rti_implied_command, self.target.get_rti_command_executed) |
<|file_name|>regions-variance-invariant-use-covariant.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... | struct Invariant<'a> { |
<|file_name|>orf.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2016 Johannes Köster, Martin Larralde.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! One-way orf finder algorithm.
//!
//! Complex... | //! # Example
//!
//! ``` |
<|file_name|>syntax-extension-regex-unused.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://... | |
<|file_name|>test_uitypes.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement
import sys
import unittest
import maya.cmds as cmds
import pymel.core as pm
import pymel.core.uitypes as ui
if not hasattr(pm, 'currentMenuParent'):
def currentMenuParent():
return ui.PyUI(cmds.setParent(q=1, m... | self.assertEqual(pm.currentParent(), cl)
self.assertEqual(pm.currentParent(), rl) |
<|file_name|>config.rs<|end_file_name|><|fim▁begin|>use std::io::prelude::*;
use std::fs::File;
use std::path::Path;
use std::io::{Error, ErrorKind};
use toml;
#[derive(Clone)]
pub struct Config {
config: toml::Value,
}
<|fim▁hole|>impl Config {
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Config, Error... | |
<|file_name|>graph.rs<|end_file_name|><|fim▁begin|>use std::vec::Vec;
use gnuplot::*;
/// Draws a graph with x-axis indicating the iteration number and
/// y-axis showing the cost at that iteration.
pub fn draw_cost_graph(fg : &mut Figure, cost_history : &Vec<f64>) {
let mut x = Vec::with_capacity(cost_history.len(... | .show_contours_custom(true, true, Linear, Fix("Decision Boundary"), [0.0f64].iter()); |
<|file_name|>log_entry.py<|end_file_name|><|fim▁begin|># TODO: Yes need to fix this violation of visibility
from functools import partial
from jarvis_cli.client.common import _get_jarvis_resource, _post_jarvis_resource, \
_put_jarvis_resource, query
def _construct_log_entry_endpoint(event_id):
return "events/... | |
<|file_name|>custom.js<|end_file_name|><|fim▁begin|>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),<|fim▁hole|> })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-... | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
<|file_name|>zh-tw.py<|end_file_name|><|fim▁begin|># coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',... | |
<|file_name|>base_module.py<|end_file_name|><|fim▁begin|>from abc import ABCMeta
from up.utils.up_logger import UpLogger
class BaseModule(metaclass=ABCMeta):
LOAD_ORDER = 0
def __init__(self, silent=False):
self.__silent = silent
self.__logger = UpLogger.get_logger()
self.__up = Non... | def class_name(self):
"""
|
<|file_name|>sti.go<|end_file_name|><|fim▁begin|>package sti
import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"regexp"
"strings"
"time"
"github.com/openshift/source-to-image/pkg/api"
"github.com/openshift/source-to-image/pkg/build"
"github.com/openshift/source-to-image/pkg/build/strat... | utilstatus.ReasonGenericS2IBuildFailed,
utilstatus.ReasonMessageGenericS2iBuildFailed,
) |
<|file_name|>filters.py<|end_file_name|><|fim▁begin|>import django_filters
from django_filters import rest_framework as filters
from django_rv_apps.apps.believe_his_prophets.models.spirit_prophecy_chapter import SpiritProphecyChapter, SpiritProphecyChapterLanguage
from django_rv_apps.apps.believe_his_prophets.models.... | def filter_date(self, queryset, name, value): |
<|file_name|>EstimatorsTest.java<|end_file_name|><|fim▁begin|>package cz.cuni.lf1.lge.ThunderSTORM.estimators;
import cz.cuni.lf1.lge.ThunderSTORM.detectors.CentroidOfConnectedComponentsDetector;
import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.EllipticGaussianPSF;
import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.... | import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.SymmetricGaussianPSF;
import cz.cuni.lf1.lge.ThunderSTORM.filters.CompoundWaveletFilter;
import cz.cuni.lf1.lge.ThunderSTORM.FormulaParser.FormulaParserException; |
<|file_name|>struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses... | |
<|file_name|>AssertionGenerator.js<|end_file_name|><|fim▁begin|>import UnexpectedHtmlLike from 'unexpected-htmllike';
import React from 'react';
import REACT_EVENT_NAMES from '../reactEventNames';
const PENDING_TEST_EVENT_TYPE = { dummy: 'Dummy object to identify a pending event on the test renderer' };
function getD... | const PENDING_EVENT_IDENTIFIER = this._PENDING_EVENT_IDENTIFIER;
|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import os
import csv
def get_value_or_default(value, default=None):
result = value.strip()
if len(result) == 0:
result = default
return result
def read_csv_file(csv_file_name,
delimiter,
quote_char='"', <|fim▁... | skip_header=True,
encoding='latin-1'):
print(csv_file_name) |
<|file_name|>app.py<|end_file_name|><|fim▁begin|>import json
import os.path
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../scripts'))
from flask import Flask, render_template, request
from py2neo import neo4j
from ollie import pipeline
app = Flask(__name__)
"""@app.route('/render', method=... | app.run() |
<|file_name|>AzeriteArmor.ts<|end_file_name|><|fim▁begin|>import { OvaleDebug } from "./Debug";
import { Ovale } from "./Ovale";
import aceEvent from "@wowts/ace_event-3.0";
import { LuaObj, LuaArray, wipe, pairs, tostring, lualength, ipairs } from "@wowts/lua";
import { sort, insert, concat } from "@wowts/table";
impo... | this.RegisterMessage("Ovale_EquipmentChanged", "ItemChanged")
this.RegisterEvent("AZERITE_EMPOWERED_ITEM_SELECTION_UPDATED")
this.RegisterEvent("PLAYER_ENTERING_WORLD") |
<|file_name|>mlaunch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import argparse
import functools
import json
import os
import re
import signal
import socket
import ssl
import subprocess
import sys
import threading
import time
import warnings
from collections import defaultdict
from operator import itemgett... | tag, number = tag.split() |
<|file_name|>CSCI567_hw5_fall16.py<|end_file_name|><|fim▁begin|># coding: utf-8
'''
Name : ThammeGowda Narayanaswamy
USCID: 2074669439
'''
import math
from scipy.stats import multivariate_normal
import numpy as np
from matplotlib import pyplot as plt
import matplotlib.patches as mpatches
import scipy as sp
from scipy ... |
def update_theta(self, P):
weights = P.sum(axis=0)/P.sum() |
<|file_name|>UdfExecutionFailureInfo.java<|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 re... | public String getType()
{
return type; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (c) 2013 Clione Software
# Copyright (c) 2010-2013 Cidadania S. Coop. Galega
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁hole|>#
# Unl... | # You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>SynchronizedThreading.java<|end_file_name|><|fim▁begin|>package com.wjiec.learn.reordering;
public class SynchronizedThreading {
private int number = 0;
private boolean flag = false;
public synchronized void write() {
number = 1;
flag = true;
}
public synchronized i... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/* */
"format cjs";
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @module
* @description
* Entry point... | export { MockLocationStrategy } from './mock_location_strategy'; |
<|file_name|>f_expression.py<|end_file_name|><|fim▁begin|>#######################################################################
#
# Author: Gabi Roeger
# Modified by: Silvia Richter (silvia.richter@nicta.com.au)
# (C) Copyright 2008: Gabi Roeger and NICTA
#
# This file is part of LAMA.
#
# LAMA is free software; you ... | exp = parse_expression(alist[2]) |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var fs = require('fs');
var os=require('os');
var express = require('express'),
// wine = require('./routes/wines');
user = require('./services/user');
contact = require('./services/contact');
inbox = require('./services/inbox');
outbox = require('./ser... | var app = express();
|
<|file_name|>default.rs<|end_file_name|><|fim▁begin|>use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
use rustc_ast::ptr::P;
use rustc_ast::walk_list;
use rustc_ast::EnumDef;
use rustc_ast::VariantData;
use rustc_ast::{Expr, MetaItem};
use rustc_errors::Applicability;
use rustc_expand::base::{Anno... |
match summary {
Unnamed(ref fields, is_tuple) => {
if !is_tuple { |
<|file_name|>create_dns_zone.py<|end_file_name|><|fim▁begin|>from lib.action import PyraxBaseAction
from lib.formatters import to_dns_zone_dict
__all__ = [
'CreateDNSZoneAction'
]<|fim▁hole|>class CreateDNSZoneAction(PyraxBaseAction):
def run(self, name, email_address, ttl=None, comment=None):
cdns = s... | |
<|file_name|>execute_action.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 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/ash/file_system_provider/operations/execute_action.h"
#include <algo... | } |
<|file_name|>dispatch.py<|end_file_name|><|fim▁begin|># Copyright 2017-2020 The GPflow Contributors. 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... | "Instead, create your own subclass of gpflow.posteriors.AbstractPosterior "
"and register an implementation of gpflow.posteriors.get_posterior_class "
"that returns your class." |
<|file_name|>AtomicState.cpp<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * License, or (at your option) any later version.
*
* 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 ... | * 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 the |
<|file_name|>CitiesAdapter.java<|end_file_name|><|fim▁begin|>package com.ruenzuo.weatherapp.adapters;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextV... | |
<|file_name|>0003_auto_20161206_0538.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-06 05:38
from __future__ import unicode_literals<|fim▁hole|>from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0002_h... | |
<|file_name|>BlockModelRenderer.java<|end_file_name|><|fim▁begin|>package org.craft.client.render.blocks;
import java.util.*;
import java.util.Map.Entry;
import com.google.common.collect.*;
import org.craft.blocks.*;
import org.craft.blocks.states.*;
import org.craft.client.*;
import org.craft.client.models.*;
impor... | |
<|file_name|>RR_action_server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, University of California, Berkeley
# All rights reserved.
# Authors: Cameron Lee (cameronlee@berkeley.edu) and Dmitry Berenson (
berenson@eecs.berkeley.edu)
#
# Redi... | # modification, are permitted provided that the following conditions |
<|file_name|>foo.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | alert("foo!"); |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import numpy as np
from astropy.coordinates import EarthLocation, SkyCoord
__all__ = ['MWA_LOC', 'MWA_FIELD_EOR0', 'MWA_FIELD_EOR1', 'MWA_FIELD_EOR2',
'MWA_FREQ_EOR_ALL_40KHZ', 'MWA_FREQ_EOR_ALL_80KHZ',
'MWA_FREQ_EOR_HI_40KHZ', 'MWA_FREQ_EOR_H... | MWA_FREQ_EOR_ALL_80KHZ = np.arange(138.915, 195.275, 0.08) |
<|file_name|>rollup.config.js<|end_file_name|><|fim▁begin|>import typescript from 'rollup-plugin-typescript'
import bundleWorker from 'rollup-plugin-bundle-worker'
export default {
input: 'src/index.ts',
output: {<|fim▁hole|> file: 'docs/nonogram.js',
format: 'iife',
},
name: 'nonogram',
plugins: [
... | |
<|file_name|>integration-tests.ts<|end_file_name|><|fim▁begin|>import * as chai from 'chai';
import * as chaiAsPromised from 'chai-as-promised';
import {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLInt,
GraphQLBoolean,
} from 'graphql';
import {SubscriptionManager} from 'graphql-subscriptions';
... | const callback = () => null;
subManager.subscribe({query, operationName: 'X', callback}).then(subId => {
expect(subId).to.be.a('number'); |
<|file_name|>fetch_update_findings.py<|end_file_name|><|fim▁begin|>import json
import django
import urllib3
if __name__ == '__main__':
django.setup()
from infrastructure.models import Server, CustomField
from resourcehandlers.aws.models import AWSHandler
from common.methods import set_progress
from django.core.s... | corresponding CloudBolt server record. |
<|file_name|>name.rs<|end_file_name|><|fim▁begin|>use super::errors::{ErrorKind, Result};
use failchain::{bail, ensure};
use serde::de::{Deserialize, Deserializer, Error as SerdeDeError};
use std::borrow::Borrow;
use std::fmt;
use std::fmt::Debug;
use std::fmt::Display;
use std::ops::Deref;
use std::result::Result as S... |
impl Display for WadName {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { |
<|file_name|>Threshold.java<|end_file_name|><|fim▁begin|>// Catalano Imaging Library
// The Catalano Framework
//
// Copyright © Diego Catalano, 2015
// diego.catalano at live.com
//
// This library is free software; you can redistribute it and/or
<|fim▁hole|>// modify it under the terms of the GNU Lesser G... | |
<|file_name|>ConnectionActivity.java<|end_file_name|><|fim▁begin|>package se.dsv.waora.deviceinternetinformation;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widg... | NetworkInfo activeNetwork = manager.getActiveNetworkInfo();
|
<|file_name|>Pomeranian.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache Licens... | import javax.ejb.TransactionManagement;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.event.Observes;
|
<|file_name|>useInputValueToggle.js<|end_file_name|><|fim▁begin|>import { computed, toRefs } from '@vue/composition-api'
export const useInputValueToggleProps = {
label: {
type: String
},
options: {
type: Array,
default: () => ([
{ value: 0 },
{ value: 1, color: 'var(--primary)' }
])
... | [value]: { promise: mappedPromise } = {} // map promise |
<|file_name|>sale.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2011 Raphaël Valyi, Renato Lima, Guewen Baconnier, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models, fields
class ExceptionRule(models.Model):
_inherit = 'exception.rule'
ru... |
def _sale_get_lines(self): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.