prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>StrategyExpertAdvisor.java<|end_file_name|><|fim▁begin|>package de.voidnode.trading4j.strategyexpertadvisor;
import java.time.Instant;
import java.util.Optional;
import de.voidnode.trading4j.api.Broker;
import de.voidnode.trading4j.api.ExpertAdvisor;
import de.voidnode.trading4j.api.Failed;
import de.voi... | * @param creator
* Used to place pending orders. |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig
<|fim▁hole|> name = 'fund'<|fim▁end|> |
class FundConfig(AppConfig): |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from django.forms.models import inlineformset_factory
from cruditor.forms import (
CruditorFormsetFormMixin, CruditorFormsetMixin, CruditorTapeformMixin)<|fim▁hole|>
class PersonForm(CruditorTapeformMixin, forms.ModelForm):
reminder =... | from examples.store.models import Person, RelatedPerson
|
<|file_name|>file_reloading.js<|end_file_name|><|fim▁begin|>// Compiled by ClojureScript 1.7.170 {}
goog.provide('figwheel.client.file_reloading');
goog.require('cljs.core');
goog.require('goog.string');
goog.require('goog.Uri');
goog.require('goog.net.jsloader');
goog.require('cljs.core.async');
goog.require('goog.obj... | }),figwheel.client.file_reloading.current_links.call(null)))); |
<|file_name|>add_with_op.py<|end_file_name|><|fim▁begin|>def add_without_op(x, y):
while y !=0:
carry = x & y
x = x ^ y
y = carry << 1<|fim▁hole|>
def main():
x, y = map(int, input().split())
add_without_op(x, y)
if __name__ == "__main__":
main()<|fim▁end|> |
print(x) |
<|file_name|>guiSelectCode.py<|end_file_name|><|fim▁begin|>import sys
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5 import uic
from . import guiStart
from . import guiCompileSuccess
# sys.path.insert(1, 'C:/Users/GuSan/Desktop/powerOverWhelming/project/src/comp_exec')
from ..comp_exec import validation
from .... |
def setupUi(self, SelectCode):
SelectCode.setObjectName("SelectCode")
SelectCode.resize(1300, 1100) |
<|file_name|>seccomp_default.go<|end_file_name|><|fim▁begin|>// +build linux,seccomp
package seccomp // import "github.com/docker/docker/profiles/seccomp"
import (
"github.com/docker/docker/api/types"
"golang.org/x/sys/unix"
)
func arches() []types.Architecture {
return []types.Architecture{
{
Arch: typ... | "getpriority",
"getrandom",
"getresgid", |
<|file_name|>subscription.go<|end_file_name|><|fim▁begin|>package apimanagement
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may caus... | if err != nil {
err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "GetEntityTag", nil, "Failure preparing request") |
<|file_name|>auto-generate-readme.py<|end_file_name|><|fim▁begin|>from pathlib import Path
class MarkdownParser():
def __init__(self, text):
self.text = text
self.lines = text.split('\n')
def title(self):
return self.lines[0].split(' ')[1]
def header(self, name, level, include_h... | overview = self.header('Overview', 2)
overview = overview.split('\n')
overview = '\n'.join(overview[1:]) # remove the first line |
<|file_name|>PipelineLogger.py<|end_file_name|><|fim▁begin|>__author__ = 'Sulantha'
import logging
class PipelineLogger:
logFunctions={'info':logging.info,
'debug':logging.debug,
'warning':logging.warning,
'error':logging.error,
'critical':logging.cri... | logging.getLogger(moduleName) |
<|file_name|>fakegit.go<|end_file_name|><|fim▁begin|>package fakegit // import "github.com/docker/docker/internal/test/fakegit"
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"os/exec"
"path/filepath"
"github.com/docker/docker/internal/test"
"github.com/docker/docker/internal/test/fakecontext... | Logf(string, ...interface{})
}
type skipT interface { |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _base = require('./base');
var _base2 = _interopRequireDefault(_base);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }<|fim▁hole|>var c... | |
<|file_name|>evaluate_graph_reconstruction.py<|end_file_name|><|fim▁begin|>try: import cPickle as pickle
except: import pickle
from gem.evaluation import metrics
from gem.utils import evaluation_util, graph_util
import networkx as nx
import numpy as np
def evaluateStaticGraphReconstruction(digraph, graph_embedding,
... |
def expGR(digraph, graph_embedding,
X, n_sampled_nodes, rounds, |
<|file_name|>update.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate protocoll;
extern crate test;
use test::Bencher;
use protocoll::Map;
use std::collections::HashMap;
#[bench]
fn imperative(b: &mut Bencher) {
let sent = "a short treatise on fungi";
<|fim▁hole|> let counter = letter... | b.iter(|| {
let mut letters = HashMap::new();
for ch in sent.chars() { |
<|file_name|>common.js<|end_file_name|><|fim▁begin|>/**********************************************************
* Common JS function calls. *
* Copyright © 2001-2007 E-Blah. *
* Part of the E-Blah Software. Released under the GPL. *
* ... | |
<|file_name|>hotplug_event_handler_x11.cc<|end_file_name|><|fim▁begin|>// Copyright 2014 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 "ui/events/platform/x11/hotplug_event_handler_x11.h"
#include <X11/extens... | std::string event_node = dev_node_path.BaseName().value();
if (event_node.empty() || !StartsWithASCII(event_node, "event", false))
return false; |
<|file_name|>data_collection_util.py<|end_file_name|><|fim▁begin|>import requests
from bs4 import BeautifulSoup
import pyprind
import json
import collections
import os
import codecs
import mathscinet
def make_mappers(profile):
"""
return mappers for id and mathscinet id
"""
gear_mathsci_mapper = {}
... | citation_matrix[(author_id, key)] = person[cit_size_key][key]
|
<|file_name|>bgp_netconf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁ho... | # You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# |
<|file_name|>geobricks_trmm_qgis_pt.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="2.0">
<context>
<name>geobricks_trmm_qgis</name>
<message>
<location filename="../geobricks_trmm_qgis.py" line="283"/>
<source>TRMM Data Downloader</source>
... | |
<|file_name|>borrowck-fixed-length-vecs.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<|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
//... | |
<|file_name|>upgrade.py<|end_file_name|><|fim▁begin|># upgrade.py - test the upgrade transaction using RPM
#
# Copyright (C) 2012 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; e... | }
|
<|file_name|>encode.rs<|end_file_name|><|fim▁begin|>/// get three u8 characters and convert to 4 indexes of ALPHABET table
fn encode_block(block: &[u8]) -> [u8; 4] {
let mut bitvec: u32 = 0xff_00_00_00;
// first char place in second octet of bitvec
// second char to third, etc.
for (i, chr) in block.it... | |
<|file_name|>private-variant-reexport.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.a... | |
<|file_name|>tcpclient_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2014 Facebook
#
# 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... | def test_immediate_success(self):
conn, future = self.start_connect(self.addrinfo)
self.assertEqual(list(self.connect_futures.keys()),
[(AF1, 'a')]) |
<|file_name|>test_claim.py<|end_file_name|><|fim▁begin|>from uuid import uuid4
from django.test import TestCase
from casexml.apps.case.cleanup import claim_case, get_first_claim
from casexml.apps.case.mock import CaseBlock
from casexml.apps.case.util import post_case_blocks
from corehq.apps.case_search.models import... | create=True, |
<|file_name|>test_problem16_1.py<|end_file_name|><|fim▁begin|>import io
import math
import random
from contextlib import redirect_stdout
from unittest import TestCase
from hamcrest import *
from array_util import get_random_unique_array
from chapter16.problem16_1 import greedy_make_change, make_change, print_change
f... | expected_change_size = get_min_change_size_bruteforce(n, d)
actual_change_sum = sum(actual_change[i] * d[i] for i in between(1, d.length)) |
<|file_name|>JLink.py<|end_file_name|><|fim▁begin|>import ctypes
class JLinkException(Exception): pass
class JLink(object):
"Jlink api"
revser = 0
def __init__(self, dllpath):
self.jlink = ctypes.cdll.LoadLibrary(dllpath)
self.tif_select(1)
self.set_speed(1000)
s... | buf=ctypes.create_string_buffer(length)
ret=self.jlink.JLINKARM_ReadMem(startaddress,length, buf) |
<|file_name|>docker.go<|end_file_name|><|fim▁begin|>package docker
import (
"archive/tar"
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/user"
"path/filepath"
"sort"
"strconv"
"strings"
"syscall"
"github.com/easeway/langx.go/mapper"
hm "github.com/evo-cloud/hmake/project"
"github.com/evo-cloud/hmake/... | |
<|file_name|>combine_test.py<|end_file_name|><|fim▁begin|>'''
Created on 2013-01-22
@author: levi
'''
import unittest
import time
from path_condition_generator import PathConditionGenerator
from t_core.matcher import Matcher
from t_core.rewriter import Rewriter
from t_core.iterator import Iterator
from t_core.messa... | |
<|file_name|>copy.rs<|end_file_name|><|fim▁begin|>extern crate rimd;
use rimd::{SMF,SMFError,SMFWriter};
use std::env::{args,Args};
use std::path::Path;
fn main() {
let mut args: Args = args();
args.next();
let pathstr = match args.next() {
Some(s) => s,
None => { panic!("Need a source pat... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"github.com/monax/hoard/v8/project"
)<|fim▁hole|>func main() {
fmt.Println(project.History.MustChangelog())
}<|fim▁end|> | |
<|file_name|>indentRangeProvider.test.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license informat... | });
test('Fold two levels', () => { |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
/**
* Created by jackrosenhauer on 5/5/15.
*/
public class Main {
public static void main(String[] args){
final int DEFAULT_PORT = 8080; // For security reasons, only root can use ... | |
<|file_name|>colorvaluepicker.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2007 John Dyer (http://johndyer.name)
MIT style license
*/
if (!window.Refresh) Refresh = {};
if (!Refresh.Web) Refresh.Web = {};
Refresh.Web.ColorValuePicker = Class.create();
Refresh.Web.ColorValuePicker.prototype = {
initiali... | },
|
<|file_name|>15.9.5.13-3.js<|end_file_name|><|fim▁begin|>/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* 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/. */
... | Date: 12 november 1997 |
<|file_name|>randomize_tweet_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
<|fim▁hole|>import codecs
import random
# this is the path of the folder that will contain the tweet files
tweets_folder = os.path.join("D:", os.sep, "Documents", "PycharmProjects",
"easy_gro... | import os
|
<|file_name|>Test_dwf_compressed_lanczos_reorg_synthetic.cc<|end_file_name|><|fim▁begin|>/*************************************************************************************
Grid physics library, www.github.com/paboyle/Grid
Source file: ./tests/Test_dwf_compressed_lanczos_reorg.cc
Copyright (C) 2017
... | public:
typedef iVector<CComplex,nbasis > CoarseSiteVector; |
<|file_name|>testf0seqnrcalculation.py<|end_file_name|><|fim▁begin|>"""
Example usage:
python3 testf0seqnrcalculation.py 548659 \
../testdata/sample_data_548659/L548659.parset \
../testdata/sample_data_548659/file-sizes.txt \
../testdata/sample_data_548659/f0seqnr-sizes.txt
"""
import os
impo... | |
<|file_name|>most_popular_repo.py<|end_file_name|><|fim▁begin|>from ..gitpub import gitpub
def sort_repos(repo_list):
"""
Sort the repo_list using quicksort
Parameters
----------------------------------
repo_list : [gitpub.Repository()]
Array of friends (loaded from the input file)
===... | sorted_repos = main() |
<|file_name|>SlackCommandResource.java<|end_file_name|><|fim▁begin|>package org.railwaystations.api.resources;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.StringUtils;
import org.railwaystations.api.PhotoImporter;
import org.railwaystations.api.StationsRepository;
import org.r... | } |
<|file_name|>str.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use std::from_str::FromStr;
use std::hash::{Hash, sip};
use std::... | |
<|file_name|>pattern.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Tiger Soldier
#
# This file is part of OSD Lyrics.
#
# OSD Lyrics 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 Found... | |
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (C) 2017 Francisco Acosta <francisco.acosta@inria.fr><|fim▁hole|># General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
sys.path.append(os.path.join(os.environ['RIOTB... | #
# This file is subject to the terms and conditions of the GNU Lesser |
<|file_name|>Extended_GetIn_EventHandlers.hpp<|end_file_name|><|fim▁begin|>class Extended_GetIn_EventHandlers
{<|fim▁hole|> class StaticMGWeapon
{
class ace_ifa3staticweapon
{
getIn = "_this call ace_ifa3staticweapon_fnc_getIn";
};
};
class StaticMortar
{
class ace_ifa3staticweapon
{
getIn = "_this ... | |
<|file_name|>rename.py<|end_file_name|><|fim▁begin|>import os.path
import os
import random<|fim▁hole|> # This is taken from mercurial
try:
os.rename(src, dst)
except OSError, err:
# If dst exists, rename will fail on windows, and we cannot
# unlink an opened file. Instead, the destina... |
def rename(src, dst):
"Atomic rename on windows." |
<|file_name|>restful_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 Maciej Chałapuk
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... | createResourceAndServeARequest(router, "/test", "/", fakeController, w)
}
|
<|file_name|>test_list.py<|end_file_name|><|fim▁begin|>import pytest
from swimlane.exceptions import ValidationError
def test_getattr_fallback(mock_record):
"""Verify cursor __getattr__ falls back to AttributeError for unknown cursor + list methods"""
with pytest.raises(AttributeError):
getattr(mock_... | """List length validation check""" |
<|file_name|>vars.go<|end_file_name|><|fim▁begin|>//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, m... | return nil
} |
<|file_name|>t001_basic.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from runtest import TestBase
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'abc', """
# DURATION TID FUNCTION<|fim▁hole|> [28141] | b() {
[28141] | c() {
0.753 u... | 62.202 us [28141] | __cxa_atexit();
[28141] | main() {
[28141] | a() { |
<|file_name|>LogMediatorInputConnectorItemProvider.java<|end_file_name|><|fim▁begin|>/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.wso2.developerstudio.eclipse.gmf.esb.provider;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse... | * <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ |
<|file_name|>texture.py<|end_file_name|><|fim▁begin|>"""
Methods to characterize image textures.
"""
import numpy as np
from ._texture import _glcm_loop, _local_binary_pattern
def greycomatrix(image, distances, angles, levels=256, symmetric=False,
normed=False):
"""Calculate the grey-level co-o... | References |
<|file_name|>ShardExceptions.cpp<|end_file_name|><|fim▁begin|>/*
* File: ShardExceptions.cpp<|fim▁hole|> *
* Created on October 22, 2015, 8:00 PM
*/
#include "ShardExceptions.hpp"
using namespace gripperz::shards;<|fim▁end|> | * Author: dagothar |
<|file_name|>bitcoin_sk.ts<|end_file_name|><|fim▁begin|><TS language="sk" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Kliknutím pravým tlačidlom upraviť adresu alebo popis</translation>
</message>
<mes... | |
<|file_name|>exceptions.rs<|end_file_name|><|fim▁begin|>use crate::calculate::*;
use std::io;
#[cfg(test)]
use std::path::Path;
use std::path::PathBuf;
use thiserror::Error;
// Custom IO Error messages for the IO errors we encounter.
// New constructors should be added to wrap any new IO errors.
// The desired output ... | |
<|file_name|>FeedReaderNotify.cpp<|end_file_name|><|fim▁begin|>/****************************************************************
* RetroShare GUI is distributed under the following license:
*
* Copyright (C) 2012 by Thunder
*
* This program is free software; you can redistribute it and/or
* modify it under th... | * of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, |
<|file_name|>UserService.ts<|end_file_name|><|fim▁begin|>angular
.module('services')
.service('UserService', UserService);
UserService.$inject = ['$resource', '$q'];
function UserService($resource, $q) {
var resource = $resource('', {}, {
get_current_user: {
method: 'GET',
... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
import sys, os
version = '1.0.0'
setup(name='brica1',
version=version,
description="",
long_description="""\<|fim▁hole|>""",
classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=l... | |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#define PI 3.141592f
#include <iostream>
#include <cmath>
#include "circulo.h"
#include <string>
using namespace std;
ostream& operator<<(ostream &Saida, circulo &c1)
{
Saida << "Raio: " << c1.get_raio() << endl;
Saida << "Diâmetro: " << c1.get_raio()*2 << endl;
S... | |
<|file_name|>per.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
import os
import pandas as pd
import config
import pandas
import re
import math
from modules.valuations.valuation import Valuation
# 현 EPS 과거 5년 PER 평균을 곱한 값
class PER(Valuation):
def __init__(self, valuation):
data = valuation.get_data()
... | Valuation.__init__(self, data, json)
self.set_json('PER', self.valuate())
|
<|file_name|>converters.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Module containing functions for converting biofloat DataFrames to other formats
from collections import OrderedDict
def to_odv(df, odv_file_name, vars=None):
'''Output biofloat DataFrame in Ocean Data View spreadsheet format to
... | |
<|file_name|>whoami.rs<|end_file_name|><|fim▁begin|>#![crate_id(name="whoami", version="1.0.0", author="KokaKiwi")]
/*<|fim▁hole|> * (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/* last syn... | * This file is part of the uutils coreutils package.
* |
<|file_name|>ApplicationTest.java<|end_file_name|><|fim▁begin|>package com.practise.androidstuff;
import android.app.Application;
import android.test.ApplicationTestCase;
/**<|fim▁hole|> * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest exten... | |
<|file_name|>custom.js<|end_file_name|><|fim▁begin|>(function ($) {
// Navigation scrolls
$('.navbar-nav li a').bind('click', function (event) {
$('.navbar-nav li').removeClass('active');
$(this).closest('li').addClass('active');
var $anchor = $(this);
var nav = $($anchor.attr... | |
<|file_name|>simple-grid.directive.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../typings/app.d.ts" />
module app.components.simpleGrid {
'use strict';
class SimpleGridDirective implements ng.IDirective {
bindToController: boolean = false;
controller: string = 'SimpleGridController';
scope = {
... | if (!angular.isDefined(newVal) || newVal === null || newVal.length === 0) {
return;
} |
<|file_name|>uaisosettings.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
* Copyright (c) 2014-2015 Leandro T. C. Melo (ltcmelo@gmail.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser... | {
if (!m_d->m_widget) {
m_d->m_widget = new QWidget;
m_d->m_page = new Ui::UaisoSettingsPage; |
<|file_name|>test_monitor.py<|end_file_name|><|fim▁begin|>from landscape.client.tests.helpers import LandscapeTest<|fim▁hole|>
class TestMonitorUpgraders(LandscapeTest):
def test_monitor_upgrade_manager(self):
self.assertEqual(type(monitor.upgrade_manager), UpgradeManager)<|fim▁end|> | from landscape.client.patch import UpgradeManager
from landscape.client.upgraders import monitor |
<|file_name|>inline-trait-method.rs<|end_file_name|><|fim▁begin|>// compile-flags: -Z span_free_formats
fn main() {
println!("{}", test(&()));
}<|fim▁hole|> x.y()
}
trait X {
fn y(&self) -> u32 {
1
}
}
impl X for () {
fn y(&self) -> u32 {
2
}
}<|fim▁end|> |
// EMIT_MIR inline_trait_method.test.Inline.after.mir
fn test(x: &dyn X) -> u32 { |
<|file_name|>sdl_initerror.cpp<|end_file_name|><|fim▁begin|>#include "sdl_initerror.hpp"
///
/// \brief SDL_InitError::SDL_InitError - Initializes the custom exception class, gets the most recent error message
///
SDL_InitError::SDL_InitError():
exception(), msg(SDL_GetError()) {}
///
/// \brief SDL_InitError::SD... | |
<|file_name|>coupler_ring.py<|end_file_name|><|fim▁begin|>from typing import Optional
import gdsfactory as gf
from gdsfactory.component import Component
from gdsfactory.components.bend_euler import bend_euler
from gdsfactory.components.coupler90 import coupler90 as coupler90function
from gdsfactory.components.coupler_... | |
<|file_name|>shortcuts.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
export default Ember.Controller.extend({
shortcuts:
[
{
title: "Task Editor",
combos: [
{
set: [["ctl","sh","del"]],
description: "delete focused task"
},
... | { |
<|file_name|>test_openstack.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# OpenCraft -- tools to aid developing and hosting free software projects
# Copyright (C) 2015 OpenCraft <xavier@opencraft.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU A... | call.flavors.find(disk=40, ram=4096),
call.images.find(name='Ubuntu 12.04'),
call.servers.create('test-vm', 'test-image', 'test-flavor', key_name=None) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Crate which contain the virtual machine which executes gluon programs
#![doc(html_root_url = "https://docs.rs/gluon_vm/0.18.0")] // # GLUON
#![recursion_limit = "1024"]
#[macro_use]
extern crate collect_mac;
#[doc(hidden)]
pub extern crate frunk_core;
#[macro_use]
e... | |
<|file_name|>pass.rs<|end_file_name|><|fim▁begin|>extern crate env_logger;
extern crate gluon_base as base;
extern crate gluon_parser as parser;
extern crate gluon_check as check;
use base::ast::{self, Expr, Pattern, Typed};
use base::pos::{BytePos, Span};
use base::types::{self, Field, Generic, Kind, Type};
use sup... | let result = support::typecheck(text); |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2017 Maha Farhat<|fim▁hole|># the Free Software Foundation, either version 3 of the 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 impli... | #
# 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 |
<|file_name|>private-impl-method.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... | pub impl Foo {
priv fn foo(&self) {}
}
} |
<|file_name|>IRTaskCreator.java<|end_file_name|><|fim▁begin|>package com.github.wglanzer.redmine;
import java.util.function.Consumer;
/**
* Interface that is able to create background-tasks
*
* @author w.glanzer, 11.12.2016.
*/
public interface IRTaskCreator
{
/**
* Executes a given task in background
*
... |
/**
* Indicator-Interface to call back to UI |
<|file_name|>unboxed-closure-sugar-default.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://... | }
trait Eq<X: ?Sized> { fn same_types(&self, x: &X) -> bool { true } }
impl<X: ?Sized> Eq<X> for X { } |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, find_packages
with open('pypd/version.py') as version_file:
exec(compile(version_file.read(), version_file.name, 'exec'))
options = {
'name': 'pypd',
'version': __version__,
'packages': find_packages... |
setup(**options) |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component, HostListener } from '@angular/core';
import { RedditService } from '../../shared/services/reddit.service';
import { Comment } from '../../shared/models/comment';
@Component({
selector: 'my-app',
templateUrl: 'app/components/main/app.com... | |
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class IsBuilding(BasePermission):
"""Checks if a current building (preselected by middleware)
has been assigned for this user"""
def has_permission(self, request, view):
return request.building is not None<|fim▁end|> | from rest_framework.permissions import BasePermission |
<|file_name|>addrutil.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library 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 Fre... | return nil
}
} |
<|file_name|>withLatestFrom.d.ts<|end_file_name|><|fim▁begin|>import { WithLatestFromSignature } from '../../operator/withLatestFrom';
declare module '../../Observable' {<|fim▁hole|> withLatestFrom: WithLatestFromSignature<T>;
}
}<|fim▁end|> | interface Observable<T> { |
<|file_name|>slice_memory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2022 F4PGA Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | |
<|file_name|>b256H2O.py<|end_file_name|><|fim▁begin|># the problem described below was fixed in 9758!
# keep_htpsit=False fails since 9473,
# on some installations (?) with:
# case A (see below in the code):
# RuntimeError: Could not locate the Fermi level!
# or the energies from the 2nd one behave strange, no conve... | # iter: 4 18:23:58 +2.4 -0.9 -1040.851545 216 11 |
<|file_name|>TestNativeCosRelaxed.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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:... | * distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>image_action.rs<|end_file_name|><|fim▁begin|>use super::action::Action;
use super::image::Image;
use crate::method::{Create, Get, List};
use crate::request::{ImageActionRequest, ImageRequest};
use crate::STATIC_URL_ERROR;
use serde::Serialize;
use std::fmt::Display;
const IMAGE_ACTIONS_SEGMENT: &str = "ac... | "type": "transfer",
"region": region, |
<|file_name|>lint_qcstatem_qcsscd_valid.go<|end_file_name|><|fim▁begin|>/*
* ZLint Copyright 2021 Regents of the University of Michigan
*
* 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... | return &lint.LintResult{Status: lint.Error, Details: errString}
}
} |
<|file_name|>xess_fp_wizard.py<|end_file_name|><|fim▁begin|># MIT license
#
# Copyright (C) 2015 by XESS Corp.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, i... | (-w + b, -h), (-w, -h + b)])
|
<|file_name|>config.js<|end_file_name|><|fim▁begin|>define(function(){
var config = {};<|fim▁hole|> config.app = 'pregapp'; // Your App name
//config.jqueryMobileTheme = "/francine/css/theme.css";
//config.jqueryMobilePath="/francine/js/jquery.mobile-1.2.0";
//config.jqueryMobileCss="/francine/css/... | |
<|file_name|>swfScriptType.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> * WHEEL (Workflow in Hierarchical distributEd parallEL)
*
* Copyright (c) 2016-2017 Research Institute for Information Technology(RIIT), Kyushu University. All rights reserved.
* Copyright (c) 2016-2017 Advanced Institute for Computational Scien... | /* |
<|file_name|>user-activity.service.spec.ts<|end_file_name|><|fim▁begin|>import { TestBed, inject } from '@angular/core/testing';
import { UserActivityService } from './user-activity.service';
describe('UserActivityService', () => {<|fim▁hole|> beforeEach(() => {
TestBed.configureTestingModule({
providers: ... | |
<|file_name|>MethodNode.java<|end_file_name|><|fim▁begin|>/*
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2007 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provi... | n = invisibleParameterAnnotations == null
? 0 |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>__author__ = 'Conscience'
from django.conf.urls import url
from django.contrib import admin
from . import views
<|fim▁hole|> url(r'^$', views.post_list, name='post_list'),
url(r'^post/(?P<pk>[0-9]+)/$', views.post_detail, name='post_detail'),
url(r'^post/$', ... | urlpatterns = [ |
<|file_name|>GoldStandardFormat.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2013 Christian Wiwie.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3... | |
<|file_name|>quotas_command.go<|end_file_name|><|fim▁begin|>package v2
<|fim▁hole|> "code.cloudfoundry.org/cli/command/translatableerror"
)
type QuotasCommand struct {
usage interface{} `usage:"CF_NAME quotas"`
}
func (QuotasCommand) Setup(config command.Config, ui command.UI) error {
return nil
}
func (QuotasComm... | import (
"code.cloudfoundry.org/cli/command" |
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>package openid
import (
"fmt"
"net/http"
"github.com/dgrijalva/jwt-go"
)
// SetupErrorCode is the type of error code that can
// be returned by the operations done during middleware setup.
type SetupErrorCode uint32
// Setup error constants.
const (
SetupError... | |
<|file_name|>SqlTruncateTable.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2017-2019 Dremio Corporation
*
* 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.apach... |
@Override
public List<SqlNode> getOperandList() { |
<|file_name|>bootstrap.ts<|end_file_name|><|fim▁begin|>/// <reference path="../typings/_custom.d.ts" /><|fim▁hole|>// Angular 2
import {bootstrap} from 'angular2/angular2';
/*
* Bindings provided by Angular
*/
import {FORM_BINDINGS, ELEMENT_PROBE_BINDINGS} from 'angular2/angular2';
import {ROUTER_BINDINGS, routerBind... | |
<|file_name|>IntellicutList.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2007 BUSINESS OBJECTS SOFTWARE LIMITED
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Re... | |
<|file_name|>cachesvr.py<|end_file_name|><|fim▁begin|>"""A simple memcache-like server.
The basic data structure maintained is a single in-memory dictionary
mapping string keys to string values, with operations get, set and
delete. (Both keys and values may contain Unicode.)
This is a TCP server listening on port 54... | ARGS.add_argument( |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.