prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>logger.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
use crate::PythonLogLevel;
use std::collections::HashMap;
use std::convert::TryInto;
use std::fmt::Write as FmtWrite;
use std::fs::{Fi... | let use_color = destination.stderr_use_color(); |
<|file_name|>card_actions.py<|end_file_name|><|fim▁begin|>from typing import Any, Dict, Mapping, Optional, Tuple
from .exceptions import UnknownUpdateCardAction
SUPPORTED_CARD_ACTIONS = [
u'updateCard',
u'createCard',
u'addLabelToCard',
u'removeLabelFromCard',
u'addMemberToCard',
u'removeMembe... | def get_renamed_card_body(payload: Mapping[str, Any], action_type: str) -> str:
data = { |
<|file_name|>friend_posts.js<|end_file_name|><|fim▁begin|>Template.friendPosts.onCreated(function() {
Bisia.Notification.resetNotify('note', 'post');
})
Template.friendPosts.helpers({
getPost: function(postId) {
var post = Posts.findOne(postId);
if (post) {
var user = Users.findOne({ '_id': post.authorId }, {... | |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>use gl_generator::{Api, Fallbacks, Profile, Registry};
use std::env;
use std::fs::File;
use std::path::PathBuf;
fn main() {
let target = env::var("TARGET").unwrap();
let dest = PathBuf::from(&env::var("OUT_DIR").unwrap());
println!("cargo:rerun-if-changed... | println!("cargo:rustc-link-lib=framework=OpenGLES");
let mut file = File::create(&dest.join("gles2_bindings.rs")).unwrap();
Registry::new(Api::Gles2, (2, 0), Profile::Core, Fallbacks::None, []) |
<|file_name|>ds.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016 Benjamin Fry <benjaminfry@me.com>
*
* 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/... | );
|
<|file_name|>env_check.py<|end_file_name|><|fim▁begin|>import os
import shutil
from android_build_system.pre_checks.base import BaseCheck
from android_build_system.config import AAPT, ZIPALIGN
class EnvCheck(BaseCheck):
def __init__(self):
super().__init__("Env check")
def _check(self):
retu... | def __init__(self, cmd):
self.cmd = cmd |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package config
import (
"fmt"
"github.com/BurntSushi/toml"
"time"
)
var (
// ConfigFile - default config file
ConfigFile = "config/main.toml"
// AppVersion - current major app version
AppVersion = "1.0.0"
// Cfg - global config state
Cfg = &Config{}
)
cons... | func LoadConfig(file string, cliParams *Config) (*Config, error) { |
<|file_name|>packetcache.cc<|end_file_name|><|fim▁begin|>/*
* This file is part of PowerDNS or dnsdist.
* Copyright -- PowerDNS.COM B.V. and its contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of version 2 of the GNU General Public License as
* published ... |
auto& mc = getMap(val.qname);
|
<|file_name|>trailers.rs<|end_file_name|><|fim▁begin|>//! Module implementing the evaluation of "trailer" parts of terms,
//! such as indexing or function call syntax.
use eval::{self, api, Context, Eval, Value};
use eval::model::Invoke;
use eval::model::value::{ArrayRepr, ObjectRepr, StringRepr};
use parse::ast::{Fun... | |
<|file_name|>duration.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import {
Fragment as F,
useEffect,
createRef,
useState,<|fim▁hole|>
import { Slider, Input } from 'antd';
import { Tyr } from 'tyranid/client';
import { mapPropsToForm, onTypeChange } from './type';
import { getValue } from... | RefObject,
} from 'react'; |
<|file_name|>Dots.js<|end_file_name|><|fim▁begin|>Clazz.declarePackage ("org.jmol.shapespecial");
Clazz.load (["org.jmol.shape.AtomShape", "org.jmol.atomdata.RadiusData", "org.jmol.util.BitSet"], "org.jmol.shapespecial.Dots", ["java.util.Hashtable", "org.jmol.constant.EnumVdw", "org.jmol.geodesic.EnvelopeCalculation", ... | |
<|file_name|>743.go<|end_file_name|><|fim▁begin|>// UVa 743 - The MTM Machine
package main
import (
"fmt"
"os"
"strings"
)
func produce(s string) string {
if s == "2" {
return s
}
return s[1:]
}
func associate(s string) string {
if s == "" {
return s
}
return s + "2" + s
}
func solve(s string) string ... | if s := solve(fmt.Sprint(n)); s != "" {
fmt.Fprintln(out, s) |
<|file_name|>httpclient.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Never Lee. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package goyar
import (
"bytes"
"encoding/binary"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"... | |
<|file_name|>CapForce.py<|end_file_name|><|fim▁begin|># Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redist... | |
<|file_name|>terminal.rs<|end_file_name|><|fim▁begin|>//! Support for terminal symbols
use crate::status::Result;
use crate::status::Status;
/// This is a simple expression with no dependencies with other rules
#[derive(Debug, PartialEq, Clone)]
pub enum Terminal {
/// Literal string
Literal(String),
/////... |
impl<'a> Status<'a> { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[cfg(unix)]
mod unix;
#[cfg(unix)]
pub use self::unix::*;<|fim▁hole|>
#[cfg(windows)]
mod windows;
#[cfg(windows)]
pub use self::windows::*;<|fim▁end|> | |
<|file_name|>data_source_google_compute_backend_service_test.go<|end_file_name|><|fim▁begin|>package google
import (
"fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
)
func TestAccDataSourceComputeBackendS... | rs, ok := s.RootModule().Resources[rsName]
if !ok {
return fmt.Errorf("can't find resource called %s in state", rsName)
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: mec<|fim▁end|> | |
<|file_name|>HypertiesNotFoundException.java<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * 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 required by applicable law or agreed to in writing, ... | * Copyright 2015-2016 INESC-ID
*
* Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for hashring 3.2
// Project: https://github.com/3rd-Eden/node-hashring
// Definitions by: superzheng <https://github.com/medns>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="no... |
/**
* Returns a range of servers. Could be useful for replication. |
<|file_name|>rpcapi.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, 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
#
# ... | |
<|file_name|>test_neutron_resources.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | ('Subnet', 'OS::Neutron::Subnet'),
('RouterInterface', 'OS::Neutron::RouterInterface'),
('Server', 'OS::Nova::Server')] |
<|file_name|>RequestToGameExecutor.java<|end_file_name|><|fim▁begin|>package org.magcruise.gaming.executor.api.message;
import org.magcruise.gaming.lang.Message;
import org.magcruise.gaming.lang.SConstructor;
public interface RequestToGameExecutor extends Message {
@Override
public SConstructor<? extends RequestTo... | public default SConstructor<? extends RequestToGameExecutor> toConstructor() {
return toConstructor(ToExpressionStyle.DEFAULT);
} |
<|file_name|>demo-zwave-react.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015-2016 Contributors as noted in the AUTHORS file
#
# 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... | |
<|file_name|>rtconfig.py<|end_file_name|><|fim▁begin|>import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides ... | |
<|file_name|>prometheus_stats_collector_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Lint as: python3
"""Tests for PrometheusStatsCollector."""
from absl import app
from grr_response_core.stats import stats_test_utils
from grr_response_server import prometheus_stats_collector
from grr.test_lib import... | |
<|file_name|>postcss-font-family.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports.name = 'cssnano/postcss-minify-font-values';
module.exports.tests = [{
message: 'should unquote font names',
fixture: 'h1{font-family:"Helvetica Neue"}',
expected: 'h1{font-family:Helvetica Neue}'
}, {
message... | fixture: 'h1{font-family:"Ahem!"}',
expected: 'h1{font-family:Ahem\\!}' |
<|file_name|>cscpi.hpp<|end_file_name|><|fim▁begin|><|fim▁hole|>#ifndef NT2_INCLUDE_FUNCTIONS_SCALAR_CSCPI_HPP_INCLUDED
#define NT2_INCLUDE_FUNCTIONS_SCALAR_CSCPI_HPP_INCLUDED
#include <nt2/trigonometric/include/functions/scalar/cscpi.hpp>
#endif<|fim▁end|> | |
<|file_name|>const-bound.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... |
// Make sure const bounds work on things, and test that a few types
// are const.
|
<|file_name|>rdp.py<|end_file_name|><|fim▁begin|>import subprocess
import os
import dialog
class RDP():
def __init__(self):
self.d = dialog.Dialog(dialog="dialog")
self.storage_path = os.path.expanduser("~/LidskjalvData")
def show_rdp_menu(self, site, host):
# """ """
# FIXME... | # sys.exit(1)
while True:
choices = []
choices.append(["", " "]) |
<|file_name|>issue-39211.rs<|end_file_name|><|fim▁begin|>#![feature(associated_consts)]
trait VecN {
const DIM: usize;<|fim▁hole|>trait Mat {
type Row: VecN;
}
fn m<M: Mat>() {
let a = [3; M::Row::DIM];
//~^ ERROR constant expression depends on a generic parameter
}
fn main() {
}<|fim▁end|> | } |
<|file_name|>validate.go<|end_file_name|><|fim▁begin|>package command
import (
"context"
"strings"
"github.com/hashicorp/packer/packer"
"github.com/posener/complete"
)
type ValidateCommand struct {
Meta
}
func (c *ValidateCommand) Run(args []string) int {
ctx, cleanup := handleTermInterrupt(c.Ui)
defer clea... | }
func (c *ValidateCommand) RunContext(ctx context.Context, cla *ValidateArgs) int {
packerStarter, ret := c.GetConfig(&cla.MetaArgs) |
<|file_name|>NoSuchEntityException.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. 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.
* A copy of the License is lo... | import com.amazonaws.AmazonServiceException;
/**
* |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __version__='0.5.1' |
<|file_name|>equi_leader.py<|end_file_name|><|fim▁begin|>"""
https://codility.com/programmers/task/equi_leader/
"""
from collections import Counter, defaultdict
<|fim▁hole|> def _is_equi_leader(i):
prefix_count_top = running_counts[top]
suffix_count_top = total_counts[top] - prefix_count_top
... |
def solution(A): |
<|file_name|>qurawl.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Qurawl Main"""
####
from __future__ import absolute_import
from __future__ import unicode_literals
import itertools as it
import random as rand
import difflib as diff
####
import common.debugit as debugit
import qurawl.regparse as rp
fr... |
def make_command(parse_info, phrases=('verb', 'obverb', 'object', 'direct')):
"""Reconstruct a valid command."""
# use verb 'move' as default |
<|file_name|>interfaces.rs<|end_file_name|><|fim▁begin|>use std::os::raw::c_void;
use com_rs::{IID, IUnknown};
use winapi::{BOOL, DWORD, HANDLE, HRESULT, HWND, LPCWSTR, LUID, RECT,
SECURITY_ATTRIBUTES, UINT};
use super::super::dxgi1_0::*;
use super::enums::*;
use super::structs::*;
extern {
static ... | interface IDXGIResource1: IDXGIResource, IDXGIDeviceSubObject, IDXGIObject,
IUnknown { |
<|file_name|>slider.py<|end_file_name|><|fim▁begin|># This file contains the slider widget
import pygame
from transcendence.graphics.widget import Box
from transcendence.graphics.button import Button
from transcendence.graphics.progressbar import ProgressBar<|fim▁hole|>from transcendence import util
class Slider(Box)... | import transcendence.graphics as graphics |
<|file_name|>FakeListPicker.cpp<|end_file_name|><|fim▁begin|>/*
Copyright_License {
XCSoar Glide Computer - http://www.xcsoar.org/
Copyright (C) 2000-2015 The XCSoar Project
A detailed list of copyright holders can be found in the file "AUTHORS".
This program is free software; you can redistribute it and/or
... | GNU General Public License for more details.
You should have received a copy of the GNU General Public License |
<|file_name|>tellstickduo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
AGO_TELLSTICK_VERSION = '0.0.9'
"""
############################################
#
# Tellstick Duo class
#
# Date of origin: 2014-01-25
#
__author__ = "Joakim Lindbom"
__copyright__ = "Copyright 2014, Joakim Lindbom"
__credits__ = ["Joa... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from app import app
import argparse
import os
import routes
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Run the MightySpring backend server.')
parser.add_argument('--debug',
'-d',
... | '-b', |
<|file_name|>p12_integer_to_roman.py<|end_file_name|><|fim▁begin|># author: Fei Gao
#
# Integer To Roman
#
# Given an integer, convert it to a roman numeral.
# Input is guaranteed to be within the range from 1 to 3999.
class Solution:
# @return a string
def intToRoman(self, n):
roman_numeral_map = (
... | ('IV', 4), |
<|file_name|>DDTownLoader.py<|end_file_name|><|fim▁begin|>import TownLoader
import DDStreet
from toontown.suit import Suit
class DDTownLoader(TownLoader.TownLoader):
def __init__(self, hood, parentFSM, doneEvent):
TownLoader.TownLoader.__init__(self, hood, parentFSM, doneEvent)
self.streetClass = ... | Suit.loadSuits(2) |
<|file_name|>console.rs<|end_file_name|><|fim▁begin|>use front::stdlib::value::{Value, ResultValue, to_value, from_value};
use front::stdlib::function::Function;
use std::io::stdio::stderr;
use time::{now, strftime};
/// Print a javascript value to the standard output stream
pub fn log(args:Vec<Value>, _:Value, _:Value... | pub fn _create(global : Value) -> Value {
js!(global, {
"log": Function::make(log, ["object"]), |
<|file_name|>strukt.rs<|end_file_name|><|fim▁begin|>use {value,types,Value,Expression,ExpressionTrait,Type};
use std;
#[derive(Clone,Debug,PartialEq,Eq)]
pub struct Struct
{
fields: Vec<Value>,
}
impl Struct
{
pub fn new(fields: Vec<Value>) -> Self {
Struct {
fields: fields,
}
... | impl Into<Expression> for Struct
{
fn into(self) -> Expression { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='reddit_gold',
description='reddit gold',
version='0.1',
author='Chad Birch',
author_email='chad@reddit.com',
packages=find_packages(),
install_requires=[
'r2'... | entry_points={ |
<|file_name|>test_extended_status.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | req = webob.Request.blank(url) |
<|file_name|>test_session.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this soft... | |
<|file_name|>model_tests.py<|end_file_name|><|fim▁begin|>import six
from decimal import Decimal as D
from oscar.core.loading import get_model
from django.test import TestCase
from oscar.test import factories, decorators
from oscar.apps.partner import abstract_models
Partner = get_model('partner', 'Partner')
PartnerA... | """
Partner wrappers are deprecated. This testcase will be removed/rewritten
in Oscar 0.7.
""" |
<|file_name|>formatUtil.js<|end_file_name|><|fim▁begin|><|fim▁hole|>"use strict";
const chalk = require("chalk");
const readline = require("readline");
/**
* Fill screen with blank lines, move to "0" afterwards and clear screen afterwards.
* Note that it is still possible to "scroll back" afterwards.
*
* Function... | |
<|file_name|>value.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use uuid::Uuid;
use IntoBytes;
use super::*;
use std::convert::Into;
use std::hash::Hash;
use std::cmp::Eq;
use std::fmt::Debug;
/// Types of Cassandra value: normal value (bits), null value and not-set value
#[derive(Debug, Clone)]
pub... | |
<|file_name|>test_create_reply.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
from wechatpy.replies import TextReply, create_reply
class CreateReplyTestCase(unittest.TestCase):
def test_create_reply_with_text_not_render(self):
text = "test"
reply = create_reply(text, rend... | |
<|file_name|>asciidoc2html.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# ... | print("Keeping modified sources in {}.".format(self._homedir),
file=sys.stderr)
sys.exit(1)
|
<|file_name|>test_telnet.py<|end_file_name|><|fim▁begin|># -*- test-case-name: twisted.conch.test.test_telnet -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.telnet}.
"""
from __future__ import absolute_import, division
from zope.interface import implementer
... | L{Deferred} returned by L{TelnetProtocol.do} fires with an |
<|file_name|>loops-for.rs<|end_file_name|><|fim▁begin|>// Implements http://rosettacode.org/wiki/Loops/For
// not_tested<|fim▁hole|>fn main() {
for i in iter::range_inclusive(1u, 5) {
for _ in iter::range_inclusive(1u, i) {
print!("*")
}
println!("")
}
}<|fim▁end|> |
use std::iter;
|
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Utilities for dealing with text encodings
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full ... | # won't need to make changes all over IPython. |
<|file_name|>vimeo.py<|end_file_name|><|fim▁begin|># ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
import copy
import json
import re
from svtplay_dl.error import ServiceError
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.fetcher.http import HTTP
from svtplay_dl.se... | player_url = page_config["player"]["config_url"]
else:
yield ServiceError(f"Can't find video file for: {self.url}") |
<|file_name|>image.py<|end_file_name|><|fim▁begin|>'''
Created on Dec 31, 2011
@author: fli
'''
import logging
import base64
import urllib
import simplejson
from urllib2 import urlopen, URLError, Request
from weibonews.utils.decorators import perf_logging
_LOGGER = logging.getLogger('weibonews.external')
_ACCESS_URL... | except URLError, err:
_LOGGER.error("[Image Compress Service] Error: %s, url %s, data %s" % (err, server_url, data))
return None |
<|file_name|>carpaccio.go<|end_file_name|><|fim▁begin|>package main
type Order struct {
Prices []float32
Quantities []int
Country string
Reduction string
}
type Reply struct {<|fim▁hole|><|fim▁end|> | Total float32 `json:"total"`
} |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate proc_macro;
use proc_macro::TokenStream;
use quote::quote;
use syn;
#[proc_macro_derive(HelloMacro)]
pub fn hello_macro_derive(input: TokenStream) -> TokenStream {
// Construct a representation of Rust code as a syntax tree<|fim▁hole|> let ast = syn... | // that we can manipulate |
<|file_name|>post_github_pr_comment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""Utility program to post a comment to a github PR"""
import argparse
import json
import os
import sys
import urllib.parse
from urllib.error import HTTPError, URLError
from urllib.request import urlopen, Request
def _parse_arg... | |
<|file_name|>estimated-input-latency-test.js<|end_file_name|><|fim▁begin|>/**
* @license Copyright 2018 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... | describe('#calculateRollingWindowEIL', () => {
it('uses a 5s rolling window', async () => {
const events = [
{start: 7500, end: 10000, duration: 2500}, |
<|file_name|>StorageAccountUpdateParameters.java<|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 information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package co... |
/**
* Network rule set.
*/ |
<|file_name|>redis.go<|end_file_name|><|fim▁begin|>package dao
import (
"context"
"fmt"
"go-common/app/service/main/thumbup/model"
"go-common/library/cache/redis"
"go-common/library/log"
"go-common/library/xstr"
)<|fim▁hole|>func hashStatsKey(businessID, originID int64) string {
return fmt.Sprintf("stats_o_%d_... | |
<|file_name|>RawInput.cpp<|end_file_name|><|fim▁begin|>/* LilyPad - Pad plugin for PS2 Emulator
* Copyright (C) 2002-2014 PCSX2 Dev Team/ChickenLiver
*
* PCSX2 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
* Soft... | } |
<|file_name|>rule_cache.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 https://mozilla.org/MPL/2.0/. */
//! A cache from rule node to computed values, in order t... | break;
} |
<|file_name|>login.routes.ts<|end_file_name|><|fim▁begin|>import { Route } from '@angular/router';
import { LoginComponent } from './index';
export const LoginRoutes: Route[] = [
{
path: 'login',
component: LoginComponent
}<|fim▁hole|><|fim▁end|> | ]; |
<|file_name|>js_xQakYN1JdEe2CVqj3lwGPtFTa7lWeqakpJ85uyNlf0c.js<|end_file_name|><|fim▁begin|>// $Id: form.js,v 1.15 2010/04/09 12:24:53 dries Exp $
(function ($) {
/**
* Retrieves the summary for the first element.
*/
$.fn.drupalGetSummary = function () {
var callback = this.data('summaryCallback');
return (this[... | }
// Bind AJAX behaviors to all items showing the class.
$('.use-ajax:not(.ajax-processed)').addClass('ajax-processed').each(function () { |
<|file_name|>helper.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Arsham Shirvani <arshamshirvani@gmail.com>. All rights reserved.
// Use of this source code is governed by the Apache 2.0 license
// License that can be found in the LICENSE file.
package reader
import (
"time"
"github.com/arsham/expipe/datatype... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class GatcoException(SanicException):
pass<|fim▁end|> | from sanic.exceptions import * |
<|file_name|>PanelDeathScreen.go<|end_file_name|><|fim▁begin|>/*
Displays information when the player is defeated.
*/
package main
import "fmt"
import "termbox-go"
type PanelDeathScreen struct { }
func (p *PanelDeathScreen) ProcessInput(g *Game, ch rune, key termbox.Key) *InputResult {
result := &InputResult... | switch ch {
// Quit |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render_to_response
from django.template import RequestContext
<|fim▁hole|>
return render_to_response('home/index.html',
context_instance=RequestContext(request),
)<|fim▁end|> | def index_view(request): |
<|file_name|>cfssl_signer_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 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... | t.Fatal(err)
}
// there is some jitter that we need to tolerate |
<|file_name|>http.go<|end_file_name|><|fim▁begin|>package action
import (
"io/ioutil"
"net/http"
"strings"
"fmt"
)
type Http struct {
config *ActionConfig
}
func (h *Http) Run() (*Result, error) {
url := h.config.Params.GetString("url")
if url == "" {
return nil, fmt.Errorf("url parameter required")
}
me... | bodyBytes, err := ioutil.ReadAll(resp.Body) |
<|file_name|>deriving-clone-enum.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.<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT... | //
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
<|file_name|>EasyIntro.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Alireza Eskandarpour Shoferi
*
* 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/... | }
|
<|file_name|>interview.model.js<|end_file_name|><|fim▁begin|>const interviewSchema = require('./interview.schema');
const InterviewModel = require('mongoose').model('Interview', interviewSchema);<|fim▁hole|>module.exports = InterviewModel;<|fim▁end|> | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
##################################################################################
#
# This program is part of OSRFramework. You can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | import osrframework.utils.general as general
class OSRFrameworkException(Exception): |
<|file_name|>iron-validatable-behavior-extracted.js<|end_file_name|><|fim▁begin|>/**
* Use `Polymer.IronValidatableBehavior` to implement an element that validates user input.
*
* ### Accessiblity
*
* Changing the `invalid` property, either manually or by calling `validate()` will update the
* `aria-i... | |
<|file_name|>system_info.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# @author xupingmao <578749341@qq.com>
# @since 2020/08/22 21:54:56
# @modified 2022/02/26 10:40:22
import xauth
import xtemplate
import xutils
import os
import re
import sys
import platform
import xconfig
from xutils import dateutil
from x... | |
<|file_name|>HatenaRssFeed.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit} from 'angular2/core';
import {HatenaRssFeed, HatenaRssFeedService} from './HatenaRssFeed.service';
@Component({
selector: 'hatena-rss-feed',
templateUrl: '/app/template/hatena-rss-feed.html'
})
export class H... | ngOnInit() {
this.newHatenaRssFeed = {
Title : "",
|
<|file_name|>RecordNodeOpenSessionEvent.java<|end_file_name|><|fim▁begin|><|fim▁hole|>
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.shards.session.OpenSessionEvent;
import java.sql.SQLException;
public class RecordNodeOpenSessionEvent implements OpenSessionEvent {
publ... | package org.hivedb.hibernate; |
<|file_name|>node.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/L... | /// Unfortunately, the extra power afforded by being generic also means that safety can technically |
<|file_name|>jquery.harvesterInlineEditor.js<|end_file_name|><|fim▁begin|>(function ($, undefined) {
$.widget("ui.HarvesterInlineEditor", $.ui.CiteInlineEditor, {
options: {
},
_refreshView: function () {
this._super();
//var item = this.option('item');
this.element.empty();
this.initEditor();... |
this.saveButton.on('click', function() {
eval(self.options.saveCallback)(); |
<|file_name|>transaction.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from .exceptions import TransactionValidationError
AVAIABLE_PAYMENT_METHOD = ['credit_card', 'boleto']
def validate_transaction(attrs):
if len(attrs) <=... |
class Transaction():
def __init__(self, requester): |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import "github.com/hashicorp/packer/packer/plugin"
import "github.com/jetbrains-infra/packer-builder-vsphere/iso"
func main() {
server, err := plugin.Server()
if err != nil {
panic(err)
}<|fim▁hole|> if err != nil {
panic(err)
}
server.Serve()
}<... | err = server.RegisterBuilder(new(iso.Builder)) |
<|file_name|>Logger.java<|end_file_name|><|fim▁begin|>/* ************************************************************************
#
# DivConq
#
# http://divconq.com/
#
# Copyright:
# Copyright 2014 eTimeline, LLC. All rights reserved.
#
<|fim▁hole|># Authors:
# * Andy White
#
**********************... | # License:
# See the license.txt file in the project's top-level directory for details.
#
|
<|file_name|>teapot.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate glium;
extern crate glium_sdl2;
extern crate sdl2;
use glium::Surface;
mod support;
fn main() {
use glium_sdl2::DisplayBuild;
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
v... | |
<|file_name|>rpcapi.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Intel, 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
#
# ... | version='1.6')
def migrate_volume(self, ctxt, volume, dest_host, force_host_copy):
host_p = {'host': dest_host.host, |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from mock import Mock
from cabot.cabotapp import defs
from datetime import datetime
def build_absolute_url(relative_url):
"""Prepend https?://host to a url, useful for links going into emails"""
return '{}://{}{}'.format(setti... | :return: Mock emulating a service with 1 failing check
"""
check_mock = Mock()
check_mock.configure_mock(id=0, pk=0, name='Alert Testing Check', active=True, |
<|file_name|>XMPPInterface.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
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; either version 3 of the License,
or (at your opt... | self.logDebug("pyLoad XMPP: Stream Error: %s" % err)
def get_message_handlers(self):
"""Return list of (message_type, message_handler) tuples. |
<|file_name|>InfoResponse.java<|end_file_name|><|fim▁begin|>package com.deleidos.framework.monitoring.response;
public class InfoResponse {
public static final String PATH = "/proxy/${APP_ID}/ws/v2/stram/info";
public static class Stats {
public int allocatedContainers;
public int plannedContainers;
public... | |
<|file_name|>_x.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="x", parent_name="splom.marker.colorbar", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
... | min=kwargs.pop("min", -2),
**kwargs |
<|file_name|>generator.js<|end_file_name|><|fim▁begin|>import SubGenerator2 from "stimpak-subgenerator-2";
export default class SubGenerator {
setup(stimpak) {
stimpak
.use(SubGenerator2)<|fim▁hole|> })
.render("**/*", `${__dirname}/templates`);
}
}<|fim▁end|> | .prompt({
type: "input",
name: "promptName",
message: "You should not see this" |
<|file_name|>abstract_serializable.cpp<|end_file_name|><|fim▁begin|>#include "abstract_serializable.h"
using namespace json;
<|fim▁hole|>json::__abstract_serializable__::__abstract_serializable__() {}
std::map<std::string, std::function<json::__abstract_serializable__*()> > json::__abstract_serializable__::dictionary... | |
<|file_name|>objects.py<|end_file_name|><|fim▁begin|>import _metagam3d
from _metagam3d import AxisAlignment, AlignmentType
from metagam3d.channels import blocking
from metagam3d.scripts import m3d_expr
from concurrence import Tasklet
class LoadError(Exception):
pass
class Object(_metagam3d.Object):
def __init... | "Get parameter object for given parameter id"
try:
return self._params[paramid]
except KeyError: |
<|file_name|>pw_protocol.rs<|end_file_name|><|fim▁begin|>use slog;
use erased_serde;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Expedition {
pub id: u64,
pub ship_count: u64,
pub origin: String,
pub destination: String,
pub owner: u64,
pub turns_remaining: u64,
}
#[derive(Debug... |
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Command {
pub origin: String, |
<|file_name|>bitcoin_zh_HK.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_HK" version="2.0">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About StartUpcoin Core</source>
<translation ty... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
<|fim▁hole|> url='https://github.com/tantale/bumpversion_demo',
license='MIT License',
author='Tantale',
author_email='tantale.solution@gmail.com',
description='Demonstration of ``bumpversion`` usage in the context of... | setup(
name='bumpversion_demo',
version='0.1.0',
packages=[''], |
<|file_name|>test_tree.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Created by: Lee Bergstrand (2018)
Description: A simple unittest for testing the genome_property_tree module.
"""
import json
import unittest
from copy import deepcopy
from pygenprop.database_file_parser import parse_genome_property
fr... | "notes": null, "children": []},
{"id": "GenProp0092", "name": "Coenzyme F420 utilization", "type": "GUILD", "description": null, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.