prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>config_tags.py<|end_file_name|><|fim▁begin|>from django import template
from system.models import Configuration
register = template.Library()
@register.assignment_tag
def get_config(conf_name=None):<|fim▁hole|> c = Configuration.get_by_name_all_fields(conf_name)
if not c:
return None
... | if conf_name is None:
raise Exception("Invalid config name")
|
<|file_name|>wtforms_utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio 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 Foun... |
class AutocompleteField(TextField): |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!env/bin/python
from app import app
import sys
port = 5000
debug = True<|fim▁hole|>app.run(debug = debug, port = port)<|fim▁end|> | if len(sys.argv) == 3:
debug = sys.argv[1] == 'debug'
port = int(sys.argv[2])
|
<|file_name|>provider.py<|end_file_name|><|fim▁begin|>from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class ShopifyAccount(ProviderAccount):
pass<|fim▁hole|> id = 'shopify'
... |
class ShopifyProvider(OAuth2Provider): |
<|file_name|>input_manager.cpp<|end_file_name|><|fim▁begin|>/*****************************************************************************
* slider_manager.cpp : Manage an input slider
*****************************************************************************
* Copyright (C) 2000-2005 the VideoLAN team
* $Id: in... | #include "video.hpp"
#include <vlc_meta.h>
|
<|file_name|>loadsettings.hh<|end_file_name|><|fim▁begin|>// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
// vi:set ts=4 sts=4 sw=4 noet :
//
// Copyright 2010, 2012 wkhtmltopdf authors
//
// This file is part of wkhtmltopdf.
//
// wkhtmlt... | int jsdelay; |
<|file_name|>issue.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package gitea
import (
"bytes"
"encoding/json"
"fmt"
"time"
)
// StateType issue state type
type Stat... | |
<|file_name|>direct_logging.cpp<|end_file_name|><|fim▁begin|>// This program sends logging records directly to the server, rather
// than going through the client logging daemon.
#include "ace/SOCK_Connector.h"<|fim▁hole|>#include "ace/OS_NS_time.h"
#include "ace/OS_NS_stdlib.h"
#include "ace/OS_NS_unistd.h"
#include ... | #include "ace/Log_Record.h"
#include "ace/Log_Msg.h" |
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>use std::cell::RefCell;
use std::fmt;
use std::rc::Rc;
use syntax::abi;
pub use self::Global::*;
pub use self::Type::*;
pub use self::IKind::*;
pub use self::FKind::*;
#[derive(Clone)]
pub enum Global {
GType(Rc<RefCell<TypeInfo>>),
GComp(Rc<RefCell<CompInfo... |
#[derive(Clone, PartialEq)]
pub struct TypeInfo {
pub name: String, |
<|file_name|>ExampleConfigCase.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Adaptris Ltd.
*
* 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/license... |
import com.adaptris.annotation.Removal; |
<|file_name|>trivial-bounds-lint.rs<|end_file_name|><|fim▁begin|>#![feature(trivial_bounds)]
#![allow(unused)]
#![deny(trivial_bounds)]
<|fim▁hole|>
trait Y<T>: Copy {}
trait Z {
type S: Copy;
}
// Check only the bound the user writes trigger the lint
fn trivial_elaboration<T>() where T: X<i32> + Z<S = i32>, i32:... | struct A where i32: Copy; //~ ERROR
trait X<T: Copy> {} |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import FixtureSet from '../../FixtureSet';
import TestCase from '../../TestCase';
import PasswordTestCase from './PasswordTestCase';
const React = window.React;
function NumberInputs() {
return (
<FixtureSet title="Password inputs">
<TestCase
titl... | |
<|file_name|>pn_port_cos_bw.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = ... | |
<|file_name|>service_check.py<|end_file_name|><|fim▁begin|>"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache ... | |
<|file_name|>ColorCodingModifier.cpp<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////////
//
// Copyright (2013) Alexander Stukowski
//
// This file is part of OVITO (Open Visualization Tool).
//
// OVITO is free software; you can redistribute it and/or modify
... | if(!image.scaled(legendWidth, legendHeight, Qt::IgnoreAspectRatio, Qt::FastTransformation).save(imageFilename, fileDialog.imageInfo().format())) { |
<|file_name|>PancakeNode.hpp<|end_file_name|><|fim▁begin|>/**
* \file PancakeNode.hpp<|fim▁hole|> *
*
* \author eaburns
* \date 18-01-2010
*/
#include "search/Node.hpp"
#include "pancake/PancakeTypes.hpp"
#include "pancake/PancakeState.hpp"
#if !defined(_PANCAKE_NODE_H_)
#define _PANCAKE_NODE_H_
typedef Node<Pa... | * |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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
//
// http://www.apache.org/licenses/... | |
<|file_name|>Reset.tsx<|end_file_name|><|fim▁begin|>// part:@sanity/base/reset-icon
import React from 'react'
const strokeStyle = {
stroke: 'currentColor',
strokeWidth: 1.2,
}
const ResetIcon = () => (
<svg
data-sanity-icon
viewBox="0 0 25 25"
fill="none"
xmlns="http://www.w3.org/2000/svg"
... | style={strokeStyle}
/> |
<|file_name|>JsonOutputStreamSerializer.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2015 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "JsonOutputStreamSerializer.h"
#include <... | return (*this)(hex, name);
}
|
<|file_name|>add.py<|end_file_name|><|fim▁begin|>import forge
from forge.models.groups import Group
class Add(object):
def __init__(self,json_args,session):<|fim▁hole|> raise forge.ArgumentError()
self.name = json_args['name']
self.distribution = json... | if type(json_args) != type({}):
raise TypeError("JSON Arg must be dict type")
if 'name' and 'distribution' not in json_args.keys(): |
<|file_name|>interfaces.ts<|end_file_name|><|fim▁begin|>export interface JCDecauxParams {
contractName?: string;
urlApi?: string;
timeout?: number;
}
export interface RequestParams {
apiKey?: string;
contract?: string;
}
export interface Position {
lat: number;
lng: number;
}
export interface Contract ... | address: string,
position: Position, |
<|file_name|>utilities.py<|end_file_name|><|fim▁begin|># Copyright (c) 2020, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/spherical_functions/blob/master/LICENSE>
### NOTE: The functions in this file are intended purely for inclusion in the Grid class. In
### particular, they assume that th... | This method uses `spinsfast` to convert values on an equiangular grid to mode weights. |
<|file_name|>NGAboutBox.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2005–2012 Goethe Center for Scientific Computing - Simulation and Modelling (G-CSC Frankfurt)
* Copyright (c) 2012-2015 Goethe Center for Scientific Computing - Computational Neuroscience (G-CSC Frankfurt)
*
* This file is part of NeuGen... | * the source code of NeuGen. The copyright statement/attribution may not be removed.
* |
<|file_name|>TextFiles.java<|end_file_name|><|fim▁begin|>/*----------------------------------------------------------------------------*
* This file is part of Pitaya. *
* Copyright (C) 2012-2016 Osman KOCAK <kocakosm@gmail.com> *
* ... | * {@code File} using the system's default charset. |
<|file_name|>snowball.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Natural Language Toolkit: Snowball Stemmer
#
# Copyright (C) 2001-2015 NLTK Project
# Author: Peter Michael Stahl <pemistahl@gmail.com>
# Peter Ljunglof <peter.ljunglof@heatherleaf.se> (revisions)
# Algorithms: Dr Martin Porter <m... | |
<|file_name|>check-api-contrail-9081.py<|end_file_name|><|fim▁begin|># !/usr/bin/python
#
# Copyright 2016 Mirantis, 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
#
# ... | val.dispatch()
if __name__ == '__main__': |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for cv project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see<|fim▁hole|>"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_M... | https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ |
<|file_name|>group.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 cause incor... | }
tracing.EndSpan(ctx, sc, err) |
<|file_name|>SundayQuickSearcher.java<|end_file_name|><|fim▁begin|>/*
* Copyright Matt Palmer 2011-2013, All rights reserved.
*
* This code is licensed under a standard 3-clause BSD license:
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the foll... |
// Get objects needed to search:
final int[] safeShifts = backwardInfo.get(); |
<|file_name|>ua_program_state_machine_type.ts<|end_file_name|><|fim▁begin|>/**
* @module node-opcua-address-space
*/
// tslint:disable:no-empty-interface
import { InstantiateObjectOptions, UAMethod, UAObject, UAObjectType } from "node-opcua-address-space-base";<|fim▁hole|>export interface UAProgramStateMachineEx exte... | import { UAFiniteStateMachine, UAProgramStateMachine, UAProgramStateMachine_Base } from "node-opcua-nodeset-ua";
import { UAStateMachineEx, UAStateMachineType } from "./ua_state_machine_type";
|
<|file_name|>tp.py<|end_file_name|><|fim▁begin|>from pylab import *
from math import exp, sqrt
from image import *
from filters import *
from nibabel import load
import numpy
import image_processing
import image as img
import os
# This module generates
class C:
#a Config class, just a collection of constants
... | def read_image(filename,extension):
if (extension=='gz'): |
<|file_name|>factory.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless... | */ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Contact: Jacob Schreiber ( jmschreiber91@gmail.com )
"""
For detailed documentation and examples, see the README.
"""
# Make our dependencies explicit so compiled Cython code won't segfault trying
# to load them.
import networkx, matplotlib.pyplot, s... | # __init__.py: Yet Another Bayes Net library |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | default_app_config = 'users.apps.UserConfig' |
<|file_name|>LoginPage.js<|end_file_name|><|fim▁begin|>/**
* Created by uzysjung on 2016. 10. 21..
*/
import React, { PropTypes,Component } from 'react';
import Box from '../../components/widget/Box'
import { Link, browserHistory } from 'react-router'
import superagent from 'superagent';
import { Form , FormGroup, Co... | }
}; |
<|file_name|>file.go<|end_file_name|><|fim▁begin|>package command<|fim▁hole|> "strings"
"github.com/bitrise-io/go-utils/pathutil"
)
// CopyFile ...
func CopyFile(src, dst string) error {
// replace with a pure Go implementation?
// Golang proposal was: https://go-review.googlesource.com/#/c/1591/5/src/io/ioutil/io... |
import (
"errors"
"os" |
<|file_name|>genomemapper_wrapper.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
"""
Runs GenomeMapper on single-end or paired-end data.<|fim▁hole|>import optparse, os, sys, tempfile
def stop_err( msg ):
sys.stderr.write( "%s\n" % msg )
sys.exit()
def __main__():
#Parse Command Line
parser = opt... | """
|
<|file_name|>Cogs.py<|end_file_name|><|fim▁begin|>import os
from lib.base_plugin import BasePlugin
from lib.paths import SteamCloudPath, SteamGamesPath
class CogsPlugin(BasePlugin):
Name = "Cogs"
support_os = ["Windows"]<|fim▁hole|> def backup(self, _):
_.add_folder('Data', os.path.join(SteamCloudP... | |
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>#![allow(unstable)]
extern crate hyper;
extern crate test;
use test::Bencher;
use std::old_io::net::ip::Ipv4Addr;
use hyper::method::Method::Get;
use hyper::server::{Request, Response};
<|fim▁hole|>fn request(url: hyper::Url) {
let req = hyper::client::Request::... | static PHRASE: &'static [u8] = b"Benchmarking hyper vs others!";
|
<|file_name|>SAPI_Locations.java<|end_file_name|><|fim▁begin|>/*
* This file is part of NucleusFramework for Bukkit, licensed under the MIT License (MIT).
*
* Copyright (c) JCThePants (www.jcwhatever.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and assoc... | public <T extends Collection<NamedLocation>> T getScriptLocations(T output) {
PreCon.notNull(output);
return Nucleus.getScriptManager().getLocations().getAll(output); |
<|file_name|>token.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | pub struct InternedString {
string: RcStr,
} |
<|file_name|>textdecoder.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 dom::bindings::codegen::Bindings::TextDecoderBinding;... | DecoderTrap::Strict
} else { |
<|file_name|>mutability-inherits-through-fixed-length-vec.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-APACH... |
fn test1() { |
<|file_name|>mod.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... | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
<|file_name|>example.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub fn after(start: DateTime) -> DateTime {
start + Duration::seconds(1_000_000_000)
}<|fim▁end|> | use time::{Duration, PrimitiveDateTime as DateTime};
|
<|file_name|>htmldialogelement.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 dom::bindings::cell::DOMRefCell;
use dom::bindi... | // https://html.spec.whatwg.org/multipage/#dom-dialog-open
make_bool_setter!(SetOpen, "open"); |
<|file_name|>material.rs<|end_file_name|><|fim▁begin|>//many more properties
//http://en.wikipedia.org/wiki/List_of_materials_properties
pub struct Material{
opacity:u8,<|fim▁hole|> density:u8,//specific weight
specularity:u8,
refraction:u8,
hardness:u8,
}
impl Material{
pub fn new(&self, opaci... | |
<|file_name|>else-if-brace-style-closing-next-line.rs<|end_file_name|><|fim▁begin|>// rustfmt-single_line_if_else_max_width: 0
// rustfmt-else_if_brace_style: ClosingNextLine
fn main() {
if false
{
();
();
}
if false // lone if comment
{
();
();
}
let a =
... | {
0x0
}; |
<|file_name|>toString.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { isString, isNumber } from '../is';
/**
* @param {any} value
* @returns {string};
*/
export const toString = (value: any): string => {
switch (true) {
case isString(value):
return value;
case isNumber(value):
return String(value);... | |
<|file_name|>script.js<|end_file_name|><|fim▁begin|>$(document).ready(function () {
$(window).on('load', function() {
let pathname = window.location.pathname.split('/')
// console.log(pathname)
if(pathname[1]==='operador') {
$('#home').addClass('active')
let action = pathname[2].split('-')
... | }
}) |
<|file_name|>submaker_supersu.py<|end_file_name|><|fim▁begin|>from .submaker import Submaker
import zipfile
import os
import shutil
import logging
logger = logging.getLogger(__name__ )
class SuperSuSubmaker(Submaker):
def make(self, workDir):
supersuZipProp = self.getTargetConfigProperty("root.methods.su... | for arch in targetArchs:
self.__addDirToZip(newSuperSuZip, os.path.join(tmpDir, arch), arch)
if not includeApk: |
<|file_name|>saxutils.py<|end_file_name|><|fim▁begin|>"""
A library of useful helper classes to the saxlib classes, for the
convenience of application and driver writers.
$Id: saxutils.py,v 1.19 2001/03/20 07:19:46 loewis Exp $
"""
import types, sys, urllib, urlparse, os, string
import handler, _exceptions, xmlreader... | def escape(data, entities={}):
"""Escape &, <, and > in a string of data. |
<|file_name|>partial-relation.rs<|end_file_name|><|fim▁begin|>// edition:2018
// run-pass
async fn lotsa_lifetimes<'a, 'b, 'c>(a: &'a u32, b: &'b u32, c: &'c u32) -> (&'a u32, &'b u32)
where 'b: 'a
{
drop((a, c));
(b, b)<|fim▁hole|>}
fn main() {
let _ = lotsa_lifetimes(&22, &44, &66);
}<|fim▁end|> | |
<|file_name|>directives.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('BattleShipApp.directives', []).<|fim▁hole|> elm.text(version);
};
}]);<|fim▁end|> | directive('appVersion', ['version', function (version)
{
return function (scope, elm, attrs)
{ |
<|file_name|>wayknew.py<|end_file_name|><|fim▁begin|>from json import dumps
import requests
d = {'yolar': 535, 'galaxy': 536, 'solar': 551, 'swordkeeper': 552, 'civilization': 553, 'CurvatureDrive': 554,
'singer': 555, 'hdfragments': 556, 'evans': 557, 'dagon': 558, 'di-foil': 559, 'dimension': 560, 'farmer': 56... | def write_to_wayknew(repo_name, str_doc):
if repo_name not in d.keys():
print('article not in wayknew, please create a null article in wayknew!') |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | '''Contains AJAX apps of mother app''' |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from distutils.core import setup
setup(
name='py-viitenumero',
version='1.0',
description='Python module for generating Finnish national payment reference number',
author='Mohanjith Sudirikku Hannadige',
a... | ) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | require('./loader.jsx'); |
<|file_name|>plotfixEND1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys<|fim▁hole|> print(s)
retval = os.system(s)
return retval
def main():
alphas = range(-8,9)
orders = [1]
machs = [0.55,0.65,0.75,0.85,0.95,1.05]
#now, we need to recursively move everybody back
for order i... | import glob
def mysystem(s): |
<|file_name|>node-cfg.js<|end_file_name|><|fim▁begin|>'use strict';
var $ = require('jquery');
require('./github-node-cfg.js');
var AddonHelper = require('js/addonHelper');
<|fim▁hole|><|fim▁end|> | $(window.contextVars.githubSettingsSelector).on('submit', AddonHelper.onSubmitSettings); |
<|file_name|>fmStats.cpp<|end_file_name|><|fim▁begin|>/***********************************************************************************
Copyright (C) 2016 Mohammad D. Mottaghi
Under the terms of the MIT license, permission is granted to anyone to use, copy,
modify, publish, redistribute, and/or sell copies of ... | Series1->Clear();
tag_frequency = new long[total_html_tags+1];
memset(tag_frequency, 0, (total_html_tags+1) * sizeof(long)); |
<|file_name|>iclimate_functions.go<|end_file_name|><|fim▁begin|>package ig
import "fmt"
// SetTempTarget will set the temperature that the room should be kept to
func (ic *IntelliClimate) SetTempTarget(target float64) error {
return fmt.Errorf("not implemented")<|fim▁hole|>func (ic *IntelliClimate) SetCO2Target(targ... | }
// SetCO2Target will set the CO2 levels in PPM that the room should be kept to |
<|file_name|>parse.rs<|end_file_name|><|fim▁begin|>//! Utilities for defining a JSON parser.
use util::Id;
use std::cell::RefCell;
use std::collections::{ HashMap, HashSet };
use std::error::Error as StdError;
use std::fmt::{ Display, Debug, Error as FmtError, Formatter };
use std::hash::Hash;
use std::rc::Rc;
use st... | format!("Array<{}>", T::description())
}
fn parse(path: Path, source: &mut JSON) -> Result<Self, ParseError> {
// Otherwise, parse as an actual array. |
<|file_name|>rules.js<|end_file_name|><|fim▁begin|>'use strict';
/* jshint -W098 */
angular.module('mean.rules').controller('RulesController', ['$scope', '$stateParams', '$location', '$http','Global', 'Rules', 'MeanUser','Circles','Groups',
function($scope, $stateParams, $location, $http, Global, Rules, MeanUser,Cir... | } else { |
<|file_name|>move.js<|end_file_name|><|fim▁begin|><|fim▁hole|> return {
restrict: 'E',
scope: {
selection: '=',
type: '@',
ngConfirmMessage: '@',
ngConfirm: '&'
},
link: function(scope, element, attrs) {
scope.myFunction = ... | function move(Restangular, $uibModal, $q, notification, $state,$http) {
'use strict';
|
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for retry 0.10
// Project: https://github.com/tim-kos/node-retry
// Definitions by: Stan Goldmann <https://github.com/krenor>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
export interface RetryOper... | */
unref?: boolean; |
<|file_name|>Statistics.cpp<|end_file_name|><|fim▁begin|>#include "Statistics.hpp"
#include "CaptureInstance.hpp"
#include "MainWindow.hpp"
#include "ui_Statistics.h"
using namespace EPL_Viz;
using namespace EPL_DataCollect;
Statistics::Statistics(MainWindow *parent) : QDialog(parent), ui(new Ui::Statistics), mw(pare... | |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>/*
* Glue - Robust Go and Javascript Socket Library
* Copyright (C) 2015 Roland Singer <roland.singer[at]desertbit.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publish... | }
}
// Run starts the server and listens for incoming socket connections. |
<|file_name|>files_2.js<|end_file_name|><|fim▁begin|>var searchData=
[
['checksyscall_2eh',['CheckSysCall.h',['../db/d19/_check_sys_call_8h.html',1,'']]],<|fim▁hole|><|fim▁end|> | ['classid_2eh',['ClassID.h',['../dc/d14/_class_i_d_8h.html',1,'']]],
['comparator_2eh',['Comparator.h',['../d7/d0c/_comparator_8h.html',1,'']]]
]; |
<|file_name|>EditHero.js<|end_file_name|><|fim▁begin|>import React from 'react';
const EditHero = props => {
if (props.selectedHero) {
return (
<div>
<div className="editfields">
<div>
<label>id: </label>
{props.addingHero
? <input
t... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Create your views here.
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext, loader
from django.core.urlresolvers import reverse
from django.shortcuts import render, get_object_or_404
from django.utils import timezone... | return render(request, 'polls/detail.html', { |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() {
// ANCHOR: here
enum IpAddrKind {
V4,
V6,
}
struct IpAddr {
kind: IpAddrKind,
address: String,
}
<|fim▁hole|> address: String::from("127.0.0.1"),
};
let loopback = IpAddr {
kind: Ip... | let home = IpAddr {
kind: IpAddrKind::V4, |
<|file_name|>DbPBS.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import os
import abc
import shelve
from pprint import pprint
from cloudmesh_base.tables import dict_printer
from cloudmesh_base.Shell import Shell
from cloudmesh_base.util import banner
from cloudmesh_base.util import path_expand... |
qsub = False |
<|file_name|>TransitionHLAPI.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2009-2016 Université Paris Ouest and Sorbonne Universités,
Univ. Paris 06 - CNRS UMR 7606 (LIP6)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public ... | |
<|file_name|>041First Missing Positive.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Given an unsorted integer array, find the first missing positive integer.
#
# For example,
# Given [1,2,0] return 3,
# and [3,4,-1,1] return 2.
# [1,3,4,2,5,8,9,7]
# Your algorithm should run in O(n) time and uses constant ... | |
<|file_name|>_blob_containers_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
... | |
<|file_name|>symmetric-difference.py<|end_file_name|><|fim▁begin|><|fim▁hole|>[_, ms, _, ns] = list(sys.stdin)
ms = set(int(m) for m in ms.split(' '))
ns = set(int(n) for n in ns.split(' '))
print(sep='\n', *sorted(ms.difference(ns).union(ns.difference(ms))))<|fim▁end|> | import sys
|
<|file_name|>hello_canvas.rs<|end_file_name|><|fim▁begin|>//! Basic hello world example, drawing
//! to a canvas.
use ggez::event;
use ggez::graphics::{self, Color};
use ggez::{Context, GameResult};
use glam::*;
use std::env;
use std::path;
struct MainState {
text: graphics::Text,
canvas: graphics::Canvas,
... | |
<|file_name|>ZadatProblemAction.java<|end_file_name|><|fim▁begin|>/**
*
*/
package cz.geokuk.core.napoveda;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.net.MalformedURLException;
import java.net.URL;
import cz.geokuk.core.program.FConst;
import cz.geokuk.framework.Action0;
import ... |
} |
<|file_name|>Main.js<|end_file_name|><|fim▁begin|>Ext.define('TrackApp.view.main.Main', {
extend: 'Ext.panel.Panel',
requires: [
'Ext.resizer.Splitter'<|fim▁hole|>
xtype: 'app-main',
controller: 'main',
viewModel: {
type: 'main'
},
title: 'Oslo-Bergen til fots',
header: {
titlePosition: 0,
... | ], |
<|file_name|>soap.go<|end_file_name|><|fim▁begin|>package soap
import (
"bytes"
"crypto/tls"
"fmt"
"io/ioutil"<|fim▁hole|>)
//BasicAuthGet adds basic auth and perform a request to path
func BasicAuthGet(path, username, password string) ([]byte, int, error) {
request, err := BasicAuthRequest(path, username, passw... | "net/http"
"encoding/xml"
"strings"
"encoding/json" |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|>"""Additional form validators
"""
# future imports
from __future__ import absolute_import
# stdlib import
import re
from StringIO import StringIO
# third-party imports
from PIL import Image
from wtforms import ValidationError
from wtforms import validators
# P... | )
elif width and width != i.size[0]: |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>import React from 'react'
import { Router, Route, hashHistory } from 'react-router'
import Home from './components/ui/Home'
import About from './components/ui/About'
import MemberList from './components/ui/MemberList'
import { Left, Right, Whoops404 } from './compon... | const routes = ( |
<|file_name|>ipv4-drb.cc<|end_file_name|><|fim▁begin|>#include "ns3/log.h"
#include "ipv4-drb.h"
namespace ns3 {
NS_LOG_COMPONENT_DEFINE("Ipv4Drb");
NS_OBJECT_ENSURE_REGISTERED (Ipv4Drb);
TypeId
Ipv4Drb::GetTypeId (void)<|fim▁hole|> .SetParent<Object>()
.SetGroupName ("Internet")
.AddConstructor<Ip... | {
static TypeId tid = TypeId("ns3::Ipv4Drb") |
<|file_name|>theoretical.py<|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/.
"""
Define the Expansion Valve component.
"""
from scr.logic.c... | outlet_node = self.get_outlet_node(id_outlet_node) |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for made_with_twd_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` ... | that later delegates to the Django one. For example, you could introduce WSGI |
<|file_name|>0020_rename_index_relationship.py<|end_file_name|><|fim▁begin|>from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('form_processor', '0019_allow_closed_by_null'),
]
<|fim▁hole|> model_name='commcarecaseindexsql',
old_name='rela... | operations = [
migrations.RenameField( |
<|file_name|>AnyOf_test.cpp<|end_file_name|><|fim▁begin|>/*
* AnyOf_test.cpp<|fim▁hole|> * Author: ljeff
*/
#include "AnyOf.h"
namespace algorithm {
} /* namespace algorithm */<|fim▁end|> | *
* Created on: Jan 30, 2016 |
<|file_name|>kegg_database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Tue May 31 10:57:02 2016
@author: noore
"""
import bioservices.kegg
import pandas as pd
kegg = bioservices.kegg.KEGG()
cid2name = kegg.list('cpd')
cid2name = filter(lambda x: len(x) == 2, map(lambda l : l.split('\t'), c... | else:
cid2chebi.at[cid, 'ChEBI'] = ChEBI[0] |
<|file_name|>Student.java<|end_file_name|><|fim▁begin|>public class Student {
private String namn;<|fim▁hole|> private int födelseår, status, id;
public Student(){}
public String getNamn() {
return namn;
}
public void setNamn(String nyNamn) {
namn=nyNamn;
}
public int getId() {
return id;
}
public vo... | |
<|file_name|>vpcmpgtw.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
fn vpcmpgtw_1() {
run_test(&Instruction { mnemonic: Mnemonic::VPCMPG... | fn vpcmpgtw_3() { |
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>"""Non-application-specific convenience methods for GPkit"""
import numpy as np
def te_exp_minus1(posy, nterm):
"""Taylor expansion of e^{posy} - 1
Arguments
---------
posy : gpkit.Posynomial
Variable or expression to exponentiate
nterm :... | |
<|file_name|>query.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#! /usr/bin/env python
import os
import sys
from IPython.terminal.embed import InteractiveShellEmbed
from mongoalchemy.session import Session
HERE = os.path.abspath(os.path.dirname(__file__))
ROOT = os.path.join(HERE, '..')
sys.path.append(ROOT)
from se... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Tink-Rust Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-... | pub use json_io::*;
mod manager;
pub use manager::*; |
<|file_name|>vue-resource.common.js<|end_file_name|><|fim▁begin|>/*!
* vue-resource v1.5.3
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
'use strict';
/**
* Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis)
*/
var RESOLVED = 0;
var REJECTED = 1;
var PENDING = 2;
... | type: 'abort'
});
};
|
<|file_name|>test_gzip_cache.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''Core plugins unit tests'''
import os
import tempfile
import unittest
import time
from contextlib import contextmanager
from tempfile import mkdtemp
from shutil import rmtree
from hashlib import md5
import gzip_cache
@contextmana... | f.write('A' * 24) # under this length, compressing is useless and create_gzip_file will not create any file |
<|file_name|>change_version_number.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
## \file change_version_number.py
# \brief Python script for updating the version number of the SU2 suite.
# \author A. Aranake
# \version 5.0.0 "Raven"<|fim▁hole|>#
# SU2 Developers: Prof. Juan J. Alonso's group at Stanford U... | #
# SU2 Original Developers: Dr. Francisco D. Palacios.
# Dr. Thomas D. Economon. |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* Created by fengyuanzemin on 17/2/15.
*/
import Vue from 'vue';
import Vuex from 'vuex';
import * as actions from './actions';
import * as mutations from './mutations';
Vue.use(Vuex);
const state = {
isShow: false,
msg: '出错了',
isBig: true,
token: local... | |
<|file_name|>LatexLintBear.py<|end_file_name|><|fim▁begin|>from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.DistributionRequirement import (
DistributionRequirement)
@linter(executable='chktex',
output_format='regex',
output_regex=r'(?P<severity>Error|W... | '%k %n in {0} line %l: %m!n'.format(filename), |
<|file_name|>init.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC 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
*/
// import zone.js from npm here because integration test will load ... | // TODO(alexeagle): maybe remove that check?
require('reflect-metadata'); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.