prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>users.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from rest.views.blocks.base import BlockSSDataTables, ResourceBlockAction
from consts import EDIT, CONFIRM, EDIT_MULTIPLE, VIEW
from lib.shortcuts import render_to_response, render_to_xml_resp... | }) |
<|file_name|>sgiar.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.sgiar
Tool-specific initialization for SGI ar (library archive). If CC
exists, static libraries should be built with it, so the prelinker has
a chance to resolve C++ template instantiations.
There normally shouldn't be any need to import this mod... | |
<|file_name|>tweet_list.go<|end_file_name|><|fim▁begin|>package tweet
import (
"common"
"encoding/json"
"appengine"
"appengine/urlfetch"
"bytes"
"fmt"
"io/ioutil"
"net/http"
)
//Show tweets in array(slice) by paging whit a uid.
//When uid==0 then show all. Show also tweets of user self by his uid.
func Sho... | |
<|file_name|>ximultistream_test.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2007, Mathieu Champlon
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met :
*
* ... | |
<|file_name|>zh-hk.js<|end_file_name|><|fim▁begin|>//! moment.js locale configuration
//! locale : Chinese (Hong Kong) [zh-hk]
//! author : Ben : https://github.com/ben-lin
//! author : Chris Lam : https://github.com/hehachris
//! author : Konstantin : https://github.com/skfd
;(function (global, factory) {
typeof e... | mm : '%d 分鐘',
h : '1 小時',
hh : '%d 小時', |
<|file_name|>test_text_tools.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import pytest
from greek_stemmer.tools.text_tools import *
class TestParseText:
def test_parse_word_receives_no_string(self):
assert parse_word(None) == ''
# check accents removal and uppercase letters
parse_... | |
<|file_name|>MetaChangeFromDefaultRule.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018, Ansible Project
from ansiblelint.rules import AnsibleLintRule
<|fim▁hole|> shortdesc = 'meta/main.yml default values should be changed'
field_defaults = [
('author', 'your name'),
('description', 'your d... |
class MetaChangeFromDefaultRule(AnsibleLintRule):
id = '703' |
<|file_name|>sprite_system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2017-2020 Richard Hull and contributors
# See LICENSE.rst for details.
"""
Simplified sprite animation framework.
.. note:: This module is an evolving "work-in-progress" and should be treated
as such until suc... | |
<|file_name|>plot_pr_bar.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2015-2017 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... | metricList.append([val.strip() for val in vals[0].split(',')])
labelList.append(' '.join(vals[1:])) |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>"""Constants used in Mackup."""
# Current version
VERSION = '0.8.7'
# Support platforms
PLATFORM_DARWIN = 'Darwin'
PLATFORM_LINUX = 'Linux'
# Directory containing the application configs<|fim▁hole|>APPS_DIR = 'applications'
# Mackup application name
MACKUP_APP_N... | |
<|file_name|>notifications_helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License... | |
<|file_name|>aligner.py<|end_file_name|><|fim▁begin|># Copyright 2016-2017 Alan F Rubin, Daniel C Esposito
#
# This file is part of Enrich2.
#
# Enrich2 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, eit... | #
# Enrich2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import os.path
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth import get_user_model
from avatar.settings import AVATAR_DEFAULT_URL, AVATAR_MAX_AVATARS_PER_USER
from avatar.util ... | self.failIfEqual(response.context['upload_avatar_form'].errors, {})
def testNormalImageUpload(self): |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>//================================================================
/**
* Experimental Features<|fim▁hole|> * @preferred
*/
//================================================================
import * as experimental from "./module";
export default experimental;
expo... | *
* @packageDocumentation
* @module std.experimental |
<|file_name|>waymo_decoder.py<|end_file_name|><|fim▁begin|># Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#... | # TODO(bencaine): Refactor visualizations to reflect new structure. |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
import hashlib
import os
import random
import re
import string
import time
from django import forms, dispatch
from django.conf import settings
from django.contrib.auth.models import User as DjangoUser
from django.core import validators
f... | display_name = name |
<|file_name|>034_cascade_folder_deletes_to_imapuid.py<|end_file_name|><|fim▁begin|>"""cascade folder deletes to imapuid
Otherwise, since this fk is NOT NULL, deleting a folder which has associated
imapuids still existing will cause a database IntegrityError. Only the mail
sync engine does such a thing. Nothing else sh... | revision = '350a08df27ee'
down_revision = '1eab2619cc4f' |
<|file_name|>unsized2.rs<|end_file_name|><|fim▁begin|>// run-pass
#![allow(unconditional_recursion)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_imports)]
// Test sized-ness checking in substitution.
use std::marker;
// Unbounded.
fn f1<X: ?Sized>(x: &X) {
f1::<X>(x);
}
fn f2<X>(x: &X) {
... | }
// Bounded.
trait T { fn dummy(&self) { } } |
<|file_name|>WriterChannel.java<|end_file_name|><|fim▁begin|>package com.rodbate.httpserver.nioserver.old;
<|fim▁hole|>
public interface WriterChannel {
}<|fim▁end|> | |
<|file_name|>rest.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.0
Unless re... | }
|
<|file_name|>config_test.go<|end_file_name|><|fim▁begin|>package soundcloud
// Copy this to config_test.go (its ignored by git)
// And fill in your test clientID, clientSecret, authorization token and secret
// You can get the client information from http://developers.soundcloud.com/you/apps
// And you'll have to auth... |
var TestConfig map[string]interface{} = map[string]interface{}{
"client_id": "f6212fc8e1e90501e7cece44f78b8f43",
"client_secret": "45d1d26f8399fc4c19abcf14d3830ff2", |
<|file_name|>ex2.py<|end_file_name|><|fim▁begin|># A comment
# Anything after # is ignored by python<|fim▁hole|>print "This won't not run"<|fim▁end|> | print "I could have code like this." # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece of code
# print "This won't run" |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "boot.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above impor... | import os |
<|file_name|>policies.js<|end_file_name|><|fim▁begin|>/**
* Policy mappings (ACL)
*
* Policies are simply Express middleware functions which run **before** your controllers.
* You can apply one or more policies to a given controller, or protect just one of its actions.
*
* Any policy file (e.g. `authenticated.js`... | |
<|file_name|>cfixed_string.rs<|end_file_name|><|fim▁begin|>use std::borrow::{Borrow, Cow};
use std::ffi::{CStr, CString};
use std::fmt;
use std::mem;
use std::ops;
use std::os::raw::c_char;
use std::ptr;
const STRING_SIZE: usize = 512;
/// This is a C String abstractions that presents a CStr like
/// interface for in... | }
}
|
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for gamesapi project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs... |
NOSE_ARGS = [ |
<|file_name|>neural_nets.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | |
<|file_name|>uninhabited_enum_branching.rs<|end_file_name|><|fim▁begin|>//! A pass that eliminates branches on uninhabited enum variants.
use crate::MirPass;
use rustc_data_structures::stable_set::FxHashSet;
use rustc_middle::mir::{
BasicBlock, BasicBlockData, Body, Local, Operand, Rvalue, StatementKind, SwitchTar... | ) -> FxHashSet<u128> {
match &layout.variants {
Variants::Single { index } => { |
<|file_name|>workflow.gift.card.e2e.spec.js<|end_file_name|><|fim▁begin|>describe('GiftCard Purchase Workflow', function () {
'use strict';
function waitForUrlToChangeTo (urlRegex) {
var currentUrl;
return browser.getCurrentUrl().then(function storeCurrentUrl (url) {
currentUrl = url;
}
).the... | element(by.css('.btn-block-primary')).click();
});
|
<|file_name|>ListUtil.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012 Krawler Information Systems Pvt Ltd
* All rights reserved.
*
* 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 Foundatio... | |
<|file_name|>block.rs<|end_file_name|><|fim▁begin|>/*
copyright: (c) 2013-2019 by Blockstack PBC, a public benefit corporation.
This file is part of Blockstack.
Blockstack is free software. You may redistribute or modify
it under the terms of the GNU General Public License as published by
the Free Software Found... | microblock_pubkey_hash: Hash160([0u8; 20]),
}
} |
<|file_name|>widgets.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2016 Christian Geier et al.
#
# 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
# withou... | self._select_last_selectable() |
<|file_name|>inner_orientation.py<|end_file_name|><|fim▁begin|>import tkinter.filedialog as tkFileDialog
import numpy as np
from numpy import sin,cos
import os
def InnerOrientation(mat1,mat2):
"""
mat1 为像素坐标,4*2,mat2为理论坐标4*2,
h0,h1,h2,k0,k1,k2,这六个参数由下列矩阵定义:
[x]=[h0]+[h1 h2] [i]
[y]=[k0]+[k1 k2] [j]... |
def openkbfile(): |
<|file_name|>test_cursor.py<|end_file_name|><|fim▁begin|># Copyright 2014, 2015 SAP SE.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http: //www.apache.org/licenses/LICENSE-2.0
#
# Unl... | cursor.execute("SELECT COUNT(*) FROM %s" % TABLE)
assert cursor.fetchone() == (0,)
cursor.execute("INSERT INTO %s VALUES('Hello World')" % TABLE) |
<|file_name|>prism_stop.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 required by applicable law... | service_stop_cmd = os.path.join(base_dir, 'bin', 'service_stop.py')
subprocess.call(['python', service_stop_cmd, 'prism']) |
<|file_name|>workbench.service.ts<|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 required ... | |
<|file_name|>recorderWorker.js<|end_file_name|><|fim▁begin|>var recLength = 0,
recBuffers = [],
sampleRate;
this.onmessage = function(e){
switch(e.data.command){
case 'init':
init(e.data.config);
break;
case 'record':
record(e.data.buffer);
break;
case 'exportWAV':
expor... | break;
case 'clear':
clear(); |
<|file_name|>grid.cpp<|end_file_name|><|fim▁begin|>/* This file is part of Dilay
* Copyright © 2015-2018 Alexander Bau
* Use and redistribute under the terms of the GNU General Public License
*/
#include <array>
#include <glm/gtx/norm.hpp>
#include "dynamic/mesh.hpp"
#include "isosurface-extraction/grid.hpp"
#includ... | else
{ |
<|file_name|>groupbox.py<|end_file_name|><|fim▁begin|>from collections import namedtuple
from cairo import LINE_JOIN_ROUND
from zorro.di import di, dependency, has_dependencies
from tilenol.groups import GroupManager
from tilenol.commands import CommandDispatcher
from .base import Widget
from tilenol.theme import The... | if nval != self._state: |
<|file_name|>no_0501_find_mode_in_binary_search_tree.rs<|end_file_name|><|fim▁begin|>use crate::common::TreeNode;
use std::cell::RefCell;
use std::rc::Rc;
struct Answer {
base: i32,
count: u32,
max_count: u32,
v: Vec<i32>,
}
impl Answer {
fn new() -> Self {
Answer {
base: 0,
... | pub fn find_mode(root: Option<Rc<RefCell<TreeNode>>>) -> Vec<i32> {
if root.is_none() {
return vec![]; |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var bind = require('bind');
var debug = require('debug')('uj:app');
var Entity = require('./entity');
var inherit = require('inherit');
/**
* Initialize a new `App` with `options`.
*
* @param {Object} options
*/
function App (options) {
this.defaults = {}
this... | |
<|file_name|>Raid_TheObsidianSanctum.cpp<|end_file_name|><|fim▁begin|>/*
* ArcScripts for ArcEmu MMORPG Server
* Copyright (C) 2009 ArcEmu Team <http://www.arcemu.org/>
* Copyright (C) 2008-2009 Sun++ Team <http://www.sunscripting.com/>
*
* This program is free software: you can redistribute it and/or modify
* it... | case 3:
pCreatureAI->Emote("All will be reduced to ash!", Text_Yell, 14103);
break;
}; |
<|file_name|>0394-Decode String.py<|end_file_name|><|fim▁begin|>class Solution:
def decodeString(self, s: str) -> str:
St = []
num = 0
curr = ''
for c in s:
if c.isdigit():
num = num*10 + int(c)
elif c == '[':
St.append([num, cu... | return result |
<|file_name|>rfb.py<|end_file_name|><|fim▁begin|>"""
RFB protocol implementattion, client side.
Override RFBClient and RFBFactory in your application.
See vncviewer.py for an example.
Reference:
http://www.realvnc.com/docs/rfbproto.pdf
(C) 2003 cliechti@gmx.net
MIT License
"""
# flake8: noqa
import sys
import math... |
data = self._zlib_stream.decompress(block)
it = iter(data) |
<|file_name|>WKBReader.cpp<|end_file_name|><|fim▁begin|>/**********************************************************************
* $Id: WKBReader.cpp 2022 2007-09-14 15:25:29Z csavage $
*
* GEOS - Geometry Engine Open Source
* http://geos.refractions.net
*
* Copyright (C) 2005-2006 Refractions Research Inc.
*
* ... | return result;
}
Point * |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
from glob import glob
from WebPlayer2LocalPlayer import __version__
APP = ['WebPlayer2LocalPlayer.py']
DATA_FILES = [
('images', glob('images/*.png')),
]
OPTIONS = {
'argv_emulation': True,
'includes': [
'sip',
... | |
<|file_name|>path-builder.spec.ts<|end_file_name|><|fim▁begin|>import { Core } from '../core';
import { Service } from '../service';
import { PathBuilder } from './path-builder';
import { JsonapiConfig } from '../jsonapi-config';
import { StoreService as JsonapiStore } from '../sources/store.service';
import { Http as ... | |
<|file_name|>exp_design.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from collections import defaultdict as ddict
import os.path as op
def enum(**enums):
"""#enumeration
#backward compatible
:param enums:
"""
return type('Enum', (), enums)
IONISATION_MODE = enum(NEG=-1,... | """ |
<|file_name|>backend.export.service.ts<|end_file_name|><|fim▁begin|>import { Injectable, Inject } from '@angular/core';
import {Headers, Http, RequestMethod, RequestOptions, Response, ResponseContentType} from '@angular/http';
import { ValueMinerAPIUrl, ValueMinerExportAPIUrl, ValueMinerMessagingAPIUrl } from '../token... | });
})
.catch((error: any) => {
if (error.status === 401) { |
<|file_name|>performancepainttiming.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::Performa... | DOMString::from("paint"),
start_time,
0.)
} |
<|file_name|>api-menu-spec.js<|end_file_name|><|fim▁begin|>const assert = require('assert')
const {ipcRenderer, remote} = require('electron')
const {BrowserWindow, Menu, MenuItem} = remote
const {closeWindow} = require('./window-helpers')
describe('menu module', function () {
describe('Menu.buildFromTemplate', func... | }, {
label: 'c',
id: 'c',
position: 'endof=letters' |
<|file_name|>signals.rs<|end_file_name|><|fim▁begin|>use super::{
error::TomlHelper,
functions::Return,
gobjects::GStatus,
ident::Ident,
parameter_matchable::Functionlike,<|fim▁hole|>};
use crate::{
library::{self, Nullable},
version::Version,
};
use log::error;
use std::str::FromStr;
use to... | parsable::{Parsable, Parse}, |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | require( ['build/index'] ); |
<|file_name|>literals.rs<|end_file_name|><|fim▁begin|>fn main() {
// 整数相加
println!("1 + 2 = {}", 1u32 + 2);<|fim▁hole|>
// 整数相减
println!("1 - 2 = {}", 1i32 - 2);
// 试一试 ^ 尝试将 `1i32` 改为 `1u32`,体会为什么类型声明这么重要
// 短路的布尔类型的逻辑运算
println!("true AND false is {}", true && false);
println!("true O... | |
<|file_name|>test_list.py<|end_file_name|><|fim▁begin|>import sys
tests=[
("testExecs/testReaction.exe","",{}),
("python","test_list.py",{'dir':'Wrap'}),
]
longTests=[
]
if __name__=='__main__':
import sys
from rdkit import TestRunner<|fim▁hole|><|fim▁end|> | failed,tests = TestRunner.RunScript('test_list.py',0,1)
sys.exit(len(failed)) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys
import pymongo
from flask import Flask<|fim▁hole|>
# Fix messy code
reload(sys)
sys.setdefaultencoding('utf-8')
app = Flask(__name__, instance_relative_config=True)
app.config.from_object('config')
app.config.from_pyfile('confi... | |
<|file_name|>nodes.js<|end_file_name|><|fim▁begin|>/** @module utils/nodes */
/**
* The default testnet node
*
* @type {string}
*/
let defaultTestnetNode = 'http://bob.nem.ninja:7778';
/**
* The default mainnet node
*
* @type {string}
*/
let defaultMainnetNode = 'http://alice6.nem.ninja:7778';
/**
* The def... | *
* @type {string}
*/ |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>"""A client for the REST API of imeji instances."""
import logging
from collections import OrderedDict
import requests
from six import string_types
from pyimeji import resource
from pyimeji.config import Config
log = logging.getLogger(__name__)
class ImejiError(Exc... | |
<|file_name|>TestTernary4.java<|end_file_name|><|fim▁begin|>package jadx.tests.integration.conditions;<|fim▁hole|>
import static jadx.tests.api.utils.assertj.JadxAssertions.assertThat;
@SuppressWarnings("CommentedOutCode")
public class TestTernary4 extends SmaliTest {
// @formatter:off
/*
private Set test(HashMap... |
import org.junit.jupiter.api.Test;
import jadx.tests.api.SmaliTest; |
<|file_name|>BuildImports.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2019 EventGhost Project <http://www.eventghost.org/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as ... | # with EventGhost. If not, see <http://www.gnu.org/licenses/>.
|
<|file_name|>circuit_breaker.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
from time import time
from threading import Lock
from functools import wraps
STATE_CLOSED = "closed"
STATE_OPEN = "open"
STATE_HALF_OPEN = "half-open"
def get_now():
return int(time())
class CircuitBreakerError(Exception):
... | |
<|file_name|>ReadSensorsOwfs.py<|end_file_name|><|fim▁begin|># ReadSensorsOwfs.py
###########################################################<|fim▁hole|># Class handles loading of thermometer sensor information #
# from the interface exposed by the owfs fuse #
# module. ... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from darkoob.book import views as book_views
urlpatterns = patterns('',
url(r'^(?P<book_id>\d+)/(?P<book_title>[a-zA-Z0-9\-_]+)/$', book_views.page, name='book_page'),
url(r'^look/$', book_views.book_lookup),
... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>"""Prepare rendering of popular smart grid actions widget"""
from apps.widgets.smartgrid import smartgrid
def supply(request, page_name):
"""Supply view_objects content, which are the popular actions from the smart grid game."""
_ = request
num_result... | count = len(popular_tasks)
return {
"popular_tasks": popular_tasks, |
<|file_name|>rcinput.py<|end_file_name|><|fim▁begin|>class RCInput():
CHANNEL_COUNT = 14
channels = []
def __init__(self):
for i in range(0, self.CHANNEL_COUNT):
try:
f = open("/sys/kernel/rcio/rcin/ch%d" % i, "r")
self.channels.append(f)
exce... | def read(self, ch):
value = self.channels[ch].read()
position = self.channels[ch].seek(0, 0)
return value[:-1] |
<|file_name|>workloadgroup.gen.go<|end_file_name|><|fim▁begin|>// Copyright Istio 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... | DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error |
<|file_name|>EnterKeyCeFalseTest.ts<|end_file_name|><|fim▁begin|>import { Pipeline } from '@ephox/agar';
import { LegacyUnit, TinyLoader } from '@ephox/mcagar';
import HtmlUtils from '../../module/test/HtmlUtils';
import Tools from 'tinymce/core/api/util/Tools';
import Theme from 'tinymce/themes/modern/Theme';
import {... | |
<|file_name|>comment-emoji.pipe.ts<|end_file_name|><|fim▁begin|>import { shortnameToImage, } from 'emojione';
import { PipeTransform, Pipe } from "@angular/core";
@Pipe({<|fim▁hole|>export class CommentEmojiPipe implements PipeTransform {
transform(value: string) {
if (!value) {
return value;... | name: 'emojione'
}) |
<|file_name|>preprocessing.py<|end_file_name|><|fim▁begin|># Lint as: python3
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... |
def _one_hot(index):
onehot = np.zeros([go.N * go.N + 1], dtype=np.float32) |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from os.path import abspath, basename, dirname, join, normpath
from sys import path
import markdown
"""Common settings and globals."""
# PATH CONFIGURATION
# Absolute filesystem path to the Django project directory:
DJANGO_ROO... | 'PORT': '', |
<|file_name|>test_admin.py<|end_file_name|><|fim▁begin|>"""
Tests course_creators.admin.py.
"""
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.admin.sites import AdminSite
from django.http import HttpRequest
import mock
from course_creators.admin import CourseCreatorA... | )
self.assertEquals(self.studio_request_email, sent_mail.from_email)
self.assertEqual([self.studio_request_email], sent_mail.to)
else: |
<|file_name|>color.rs<|end_file_name|><|fim▁begin|>use std::ops::{Add, Mul};
use std::iter::Sum;
#[derive(Copy, Clone, Serialize, Deserialize)]
pub struct Color(pub f64, pub f64, pub f64);
pub const RED: Color = Color(1.0, 0.0, 0.0);
pub const GREEN: Color = Color(0.0, 1.0, 0.0);
pub const BLUE: Color = Color(0.0, 0.... | impl Mul<f64> for Color { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { default } from "./Paragraph"; |
<|file_name|>ClusterDef.java<|end_file_name|><|fim▁begin|>// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.<|fim▁hole|> public ClusterDef(String name) { this.name = name; }
public String getName() { return name; }
public String getRoute() { return "[Cont... | package com.yahoo.vespaclient;
public class ClusterDef {
private final String name; |
<|file_name|>lookup_tests.py<|end_file_name|><|fim▁begin|>import unittest
import os
from os.path import dirname
import sys
import json
from rtree import index
from . import ROOT
from geotweet.mapreduce.utils.lookup import project, SpatialLookup
testdata = os.path.join(dirname(os.path.abspath(__file__)), 'testdata')... | self.assertIsNotNone(found, error)
def assert_none(self, point):
found = self.location.get_object(point) |
<|file_name|>regions-fn-bound.rs<|end_file_name|><|fim▁begin|>// xfail-test
// xfail'd because the first error does not show up.
// 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 Ap... | // Here, x, y, and z are free. Other letters
// are bound. Note that the arrangement |
<|file_name|>png.py<|end_file_name|><|fim▁begin|>import decimal
import sys
import steel
from steel import chunks
COMPRESSION_CHOICES = (
(0, 'zlib/deflate'),
)
RENDERING_INTENT_CHOICES = (
(0, 'Perceptual'),
(1, 'Relative Colorimetric'),
(2, 'Saturation'),
(3, 'Absolute Colorimetric')... | (0, '<No Interlacing>'),
(1, 'Adam7'),
)
|
<|file_name|>TeLspNlriParser.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is availabl... | |
<|file_name|>visuals.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import * as ReactDOM from "react-dom";
import * as Utils from "./utils";
/** small wrapper for bootstrap form groups */
export class FormGroup extends React.Component<{
label: string, children?: any, id?:string, isStatic?:boolean
... | <div className="form-group"> |
<|file_name|>Event.java<|end_file_name|><|fim▁begin|>package pl.yourempire.api.event;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class Event
{
private static Map<Class<Event>, ArrayList<ListenerCal... | |
<|file_name|>entry_completion.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Rust-GNOME Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
//! GtkEntryCompletion — Co... | } |
<|file_name|>sequences_lok.cpp<|end_file_name|><|fim▁begin|>/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you... |
for (int i = 0; i < 2; ++i) { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from os.path import join, dirname
from setuptools import setup<|fim▁hole|> version = '0.2.3',
description = 'Client Library for Firebase Cloud Messaging using XMPP',
long_description = open(join(dirname(__file__), 'README.txt')).read(),
install_requires=['sleekx... |
setup(
name = 'xmppgcm',
packages = ['xmppgcm'], # this must be the same as the name above |
<|file_name|>unittest.js<|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 th... | run: function() {
try {
try {
if (!this.isWaiting) this.setup.bind(this)(); |
<|file_name|>htmliframeelement.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 document_loader::{LoadBlocker, LoadType};
use d... |
let browsing_context_id = match self.browsing_context_id() {
None => return warn!("Navigating unattached iframe."),
Some(id) => id, |
<|file_name|>alert.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | alert("XSS from JS file"); |
<|file_name|>lib.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/LI... | #![feature(macro_rules)] |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># ===========================================================================
# eXe config
# Copyright 2004-2006, University of Auckland
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Licens... | if self.configParser.has_option('system', \
'assumeMediaPlugins'):
value = system.assumeMediaPlugins.strip().lower()
|
<|file_name|>test_capture.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function
# note: py.io capture tests where copied from
# pylib 1.4.20.dev2 (rev 13d9af95547e)
from __future__ import with_statement
import pickle
import os
import sys
from io import UnsupportedOperation
im... | old = sys.stdout, sys.stderr, sys.stdin |
<|file_name|>xdiff_file_patch.js<|end_file_name|><|fim▁begin|>function xdiff_file_patch (file, patch, dest, flags) {
<|fim▁hole|> // - depends on: xdiff_string_patch
// - depends on: file_get_contents
// - depends on: file_put_contents
file = this.file_get_contents(file);
patch = this.... | // http://kevin.vanzonneveld.net
// + original by: Brett Zamir (http://brett-zamir.me)
// % note 1: Depends on file_put_contents which is not yet implemented
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for RFXtrx devices."""
import asyncio
import binascii
from collections import OrderedDict
import copy
import logging
import RFXtrx as rfxtrxmod
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.com... | data = entry.data.copy()
data[CONF_DEVICES] = copy.deepcopy(entry.data[CONF_DEVICES]) |
<|file_name|>connectToStore.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'
import {Component, ComponentClass, createElement} from 'react'
import * as PropTypes from 'prop-types'
import {connect} from 'react-redux'
import {Store} from '../store'
import ComputedState from '../model/ComputedState'
functi... | |
<|file_name|>rmxfguid.rs<|end_file_name|><|fim▁begin|>// Copyright © 2017 winapi-rs developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in th... | 0xf6f23f43, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3}
DEFINE_GUID!{TID_D3DRMCoords2d,
0xf6f23f44, 0x7686, 0x11cf, 0x8f, 0x52, 0x00, 0x40, 0x33, 0x35, 0x94, 0xa3} |
<|file_name|>DragViewActivity.java<|end_file_name|><|fim▁begin|>package com.example.customviewdemo;
import android.app.Activity;<|fim▁hole|>public class DragViewActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.... | import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Headers container, and common header fields.
//!
//! hyper has the opinion that Headers should be strongly-typed, because that's
//! why we're using Rust in the first place. To set or get any header, an object
//! must implement the `Header` trait from this module. S... | } |
<|file_name|>infinite-scroll-immediate.e2e-spec.ts<|end_file_name|><|fim▁begin|>import { imageCompare } from '../../common/image-compare';
import { InfiniteScrollImmediatePage } from './infinite-scroll-immediate.po.spec';
describe('Infinite Scroll (Immediate) Tests', () => {
let page: InfiniteScrollImmediatePage;... | expect(await page.getNumberOfEmployees()).toEqual(20);
|
<|file_name|>colors.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>/**
* Copyright (C) 2021 3D Repo Ltd
*
* 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 the Free Software Foundation, either version 3 of the
* ... | |
<|file_name|>NumberAxisBuilder.java<|end_file_name|><|fim▁begin|>/*
* DateAxisBuilder.java
*
* Created on March 17, 2007, 10:17 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package com.thecoderscorner.groovychart.axis;
import java.beans.Introspection... | private static final Logger logger = Logger.getLogger(NumberAxisBuilder.class.getPackage().getName());
|
<|file_name|>URLSerializer.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 fi... | self.__field = field
def importValue(self, struct):
return URL(struct.get(field)) |
<|file_name|>replace_0_with_5.py<|end_file_name|><|fim▁begin|># Part of Cosmos by OpenGenus Foundation
def replace_0_5_iterative(user_input):
modified = []
for i in user_input:
if i == "0":
modified.append("5")
else:
modified.append(i)
return "".join(modified)
def... | print("Modified number: " + new_str)
print("\n----- Python Replace Approach -----")
new_str = replace_0_5_pythonic(user_input) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.