prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>no_answer.py<|end_file_name|><|fim▁begin|># encoding=utf-8 from courtesy import courtesy_reply from log_decorator import error_logging<|fim▁hole|>def response(com, answer, **kwargs): return courtesy_reply(('na',), **kwargs)<|fim▁end|>
@error_logging('na')
<|file_name|>acc_lib.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Acc Lib - Used by account contasis pre account line pre Created: 11 oct 2020 Last up: 29 mar 2021 """ import datetime class AccFuncs: @staticmethod def static_method(): # the static method gets passed nothing return ...
return orders, count # get_orders_filter
<|file_name|>simple.rs<|end_file_name|><|fim▁begin|>extern crate pronghorn; use pronghorn::app::App; use pronghorn::{Context, Response}; fn root(_context: Context) -> Response { let mut res = Response::new(); res.set_body("/"); res } fn foo(_context: Context) -> Response { let mut res = Response::new...
fn main() {
<|file_name|>visualizer.js<|end_file_name|><|fim▁begin|>import Boolius from "./boolius"; // which in turn imports all the classes it depends upon import XMLius from "./xmlius"; import Mathius from "./mathius"; window.onload = function () { d3.select("#modeSelect").on("change", function (e) { var selectedMode = d...
[/&&/, "&"], [/AND/i, "&"], [/\|\|/, "|"], // this is the escaped form of ||
<|file_name|>squirrelStartup.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-2016 Yuya Ochiai // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import AutoLaunch from 'auto-launch'; import {app} from 'electron'; function shouldQuitApp(cmd) { if (pro...
} }
<|file_name|>bge.texture.1.py<|end_file_name|><|fim▁begin|>""" Texture Replacement +++++++++++++++++++ Example of how to replace a texture in game with an external image. ``createTexture()`` and ``removeTexture()`` are to be called from a module Python Controller. """ from bge import logic from bge import texture de...
<|file_name|>BaseField.java<|end_file_name|><|fim▁begin|>package com.infox.sysmgr.entity.base; import java.io.Serializable; public class BaseField implements Serializable { private static final long serialVersionUID = 1L; private int hashCode = Integer.MIN_VALUE; // fields private java.lang.String ...
} public java.lang.String getNullable() { return nullable;
<|file_name|>span_length.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/lic...
let err = String::from_utf8_lossy(result.error.as_slice()); // Test both the length of the snake and the leading spaces up to it
<|file_name|>apihelper.go<|end_file_name|><|fim▁begin|>// Package apihelper contains some methods which make working with the http // package a bit nicer package apihelper import ( "encoding/json" "fmt" "io" "net/http" "github.com/mediocregopher/mediocre-api/common" "github.com/mediocregopher/mediocre-api/picky...
// Otherwise send error to client and return false // // * Replace r.Body with a MaxBytesReader which will stop the reading at the
<|file_name|>custom_actions.py<|end_file_name|><|fim▁begin|>import pylogging import os # Logs Dir Absolute Path logs_path = os.path.dirname(os.path.abspath(__file__)) + '/logs/' # Create Logger Instance logger = pylogging.PyLogging(LOG_FILE_PATH = logs_path) def customAction1(type, msg): # Custom Action Goes Here p...
<|file_name|>group.js<|end_file_name|><|fim▁begin|>/*! * Copyright 2012 Sakai Foundation (SF) Licensed under the * Educational Community 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.osedu.org/l...
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><% if (djangoVersion != '2.0') { %> from django.conf.urls import url, include <% } else { %> from django.urls import path, include<|fim▁hole|>from <%= appName %> import views <% if (includeLoginPage == true) { %> from <%= appName %>.forms import AuthenticationForm from ...
<% } %> from django.contrib import admin
<|file_name|>initramfs.rs<|end_file_name|><|fim▁begin|>use std::process::Command; use ask; <|fim▁hole|>pub fn rebuild() -> bool { println!(); println!("Step 4: Update initramfs"); let mut skip_ask = false; if ask::yesno("Are you using mkinitcpio with the default kernel ('linux')?") { let status...
<|file_name|>cluster.py<|end_file_name|><|fim▁begin|>from changes.api.serializer import Crumbler, register from changes.models.node import Cluster @register(Cluster) class ClusterCrumbler(Crumbler):<|fim▁hole|> 'name': instance.label, 'dateCreated': instance.date_created, }<|fim▁end|>
def crumble(self, instance, attrs): return { 'id': instance.id.hex,
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/*price range*/ $('#sl2').slider(); var RGBChange = function() { $('#RGB').css('background', 'rgb('+r.getValue()+','+g.getValue()+','+b.getValue()+')') }; /*scroll to top*/ $(document).ready(function(){ $(function () { $.scrollUp({ scrollName: '...
scrollText: '<i class="fa fa-angle-up"></i>', // Text for element, can contain HTML scrollTitle: false, // Set a custom <a> title if required. scrollImg: false, // Set true to use image
<|file_name|>test_bytes_can_uplink_converter.py<|end_file_name|><|fim▁begin|># Copyright 2020. ThingsBoard # # 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://w...
] tb_data = self.converter.convert(configs, can_data)
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url, include, patterns from . import views from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.conf.urls.static import static from django.conf import settings urlpatterns = patterns('',<|fim▁hole|> url(r'^$', ...
<|file_name|>agent0.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -tt # An incredibly simple agent. All we do is find the closest enemy tank, drive # towards it, and shoot. Note that if friendly fire is allowed, you will very # often kill your own tanks with this code. ##########################################...
sys.exit(-1) # Connect.
<|file_name|>test_currency.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import pytest import six from sqlalchemy_utils import Currency, i18n @pytest.fixture def set_get_locale(): i18n.get_locale = lambda: i18n.babel.Locale('en') @pytest.mark.skipif('i18n.babel is None') @pytest.mark.usefixtures('set...
<|file_name|>routes.rs<|end_file_name|><|fim▁begin|>macro_rules! define { ($name:ident, $value:expr) => ( pub const $name: &'static str = $value;<|fim▁hole|> define!(CONSUMER_HANDSHAKE, "/consumer/"); define!(CONSUMER_NOWPLAY, "/consumer/nowplay"); define!(CONSUMER_SUBMISSIONS, "/consumer/submissions"); def...
); }
<|file_name|>generic-fn-box.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/...
pub fn main() { let x = f(box(GC) 3i); println!("{:?}", *x); }
<|file_name|>201611680890-5.10.py<|end_file_name|><|fim▁begin|># coding: utf-8 # In[ ]: #练习一:文本加密解密(先看有关ASCII码的相关知识以及码表,查维基百科或百度百科) #输入:一个txt文件(假设全是字母的英文词,每个单词之间用单个空格隔开,假设单词最长为10个字母) #加密:得到每个单词的长度 n ,随机生成一个9位的数字,将 n-1 与这个9位的数字连接,形成一个10位的数字, #作为密匙 key 。依照 key 中各个数字对单词中每一个对应位置的字母进行向后移位(例:如过 key 中某数字为 2 , #对应该位置的字母为 a ,...
text = fh.read() fh.close()
<|file_name|>gfx_font6x8.py<|end_file_name|><|fim▁begin|>import pygame<|fim▁hole|>sprite['height'] = 8 def Addr(): return sprite<|fim▁end|>
sprite = {} sprite['image'] = pygame.image.load("test/font6x8_normal_w.png") sprite['width'] = 6
<|file_name|>es7.object.entries.js<|end_file_name|><|fim▁begin|>/* */ var $def = require("./$.def"), $entries = require("./$.object-to-array")(true);<|fim▁hole|> }});<|fim▁end|>
$def($def.S, 'Object', {entries: function entries(it) { return $entries(it);
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import logging class BaseDebugInterface(object): def __init__(self, debuger): self.robotDebuger = debuger self.debugCtx = debuger.debugCtx self.logger = logging.getLogger("rbt.int") self.bp_id = 0 def start(self, settin...
@property def breakpoints(self):
<|file_name|>SliderTransparency.js<|end_file_name|><|fim▁begin|>import React from 'react'; import Slider from 'material-ui/Slider'; /** * The `defaultValue` property sets the initial position of the slider. * The slider appearance changes when not at the starting position. */ const SliderTransparency = (props) => ( ...
<|file_name|>GuiFactory.java<|end_file_name|><|fim▁begin|>package net.infernalized.infernalutils.client.gui; import cpw.mods.fml.client.IModGuiFactory; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import java.util.Set; public class GuiFactory implements IModGuiFactory { @Ove...
@Override
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod cell; mod formula; mod operations;<|fim▁hole|>mod spreadsheet; pub use cell::{Cell, CellRef}; pub use formula::{Application, Formula, Formulas, Number, Range, Textual}; pub use spreadsheet::Spreadsheet;<|fim▁end|>
<|file_name|>issue-3177-mutable-struct.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....
fn main() { let a1 = ~S{ s: true, cant_nest: () };
<|file_name|>ImageAddrMap.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2010 Aldo J. Nunez Licensed under the Apache License, Version 2.0. See the LICENSE text file for details. */ #include "Common.h" #include "ImageAddrMap.h" <|fim▁hole|> namespace MagoST { ImageAddrMap::ImageAddrMap() ...
<|file_name|>listeners.py<|end_file_name|><|fim▁begin|>import io from molotov.api import get_fixture _UNREADABLE = "***WARNING: Molotov can't display this body***" _BINARY = "**** Binary content ****" _FILE = "**** File content ****" _COMPRESSED = ('gzip', 'compress', 'deflate', 'identity', 'br') class BaseListener...
try:
<|file_name|>value.rs<|end_file_name|><|fim▁begin|>//! Deserialization of a `Value<T>` type which tracks where it was deserialized //! from. //! //! Often Cargo wants to report semantic error information or other sorts of //! error information about configuration keys but it also may wish to indicate //! as an error co...
/// /// CLI is preferred over environment, which is preferred over files. pub fn is_higher_priority(&self, other: &Definition) -> bool { match (self, other) {
<|file_name|>GenericBytecode.py<|end_file_name|><|fim▁begin|>#!C:\Python27\python.exe # Filename: GenericBytecode.py # -*- coding: utf-8 -*- import os import Settings ''' Generic Bytecode Simply add, remove or modify bytecode for use in KHMS ''' createFrame = ['aload_0', 'getfield', 'aload_0', 'dup', 'getfield', ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2007, 2008, 2009 VIFF Development Team. # # This file is part of VIFF, the Virtual Ideal Functionality Framework. #<|fim▁hole|># VIFF is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License (L...
<|file_name|>oven.py<|end_file_name|><|fim▁begin|>import RPi.GPIO as gpio from datetime import datetime import time import controller gpio.setmode(gpio.BOARD) # switch_pins = [10, 40, 38] switch = 10 gpio.setup(switch, gpio.OUT, initial=False) # gpio.setup(switch_pins, gpio.OUT, initial=False) def switch_on(): gpi...
switch_on()
<|file_name|>pure_py.py<|end_file_name|><|fim▁begin|>import cython def test_sizeof(): """ >>> test_sizeof() True True True True True """ x = cython.declare(cython.bint) print(cython.sizeof(x) == cython.sizeof(cython.bint)) print(cython.sizeof(cython.char) <= cython.sizeof(cy...
<|file_name|>run-tests-exp.py<|end_file_name|><|fim▁begin|># # This is minimal MicroPython variant of run-tests script, which uses # .exp files as generated by run-tests --write-exp. It is useful to run # testsuite on systems which have neither CPython3 nor unix shell. # This script is intended to be run by the same in...
if r == 0: f = open(".tst.out")
<|file_name|>attr-before-view-item2.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// http://rust-lang.org/COPYRIGHT. // // 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 // ...
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at
<|file_name|>ReactIcon.js<|end_file_name|><|fim▁begin|>import { IconPathDetails } from '../config'; class ReactIcon { constructor(name, component) { this.name = name; this.file = `${IconPathDetails.iconDir}${name}.jsx`; this.component = component; }<|fim▁hole|>} export default ReactIcon;<|fim▁end|>
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// (c) 2015-2017 Productize SPRL <joost@productize.be> //! symbolic-expressions parsing and generating library #![warn(missing_docs)] pub use error::*; pub use sexp::*; mod error; mod formatter; mod sexp; /// symbolic-expression parser code: data -> symbolic-express...
#[cfg(test)] mod test;
<|file_name|>kinetic-v5.1.0.js<|end_file_name|><|fim▁begin|>/* * KineticJS JavaScript Framework v5.1.0 * http://www.kineticjs.com/ * Copyright 2013, Eric Rowell * Licensed under the MIT or GPL Version 2 licenses. * Date: 2014-03-27 * * Copyright (C) 2011 - 2013 by Eric Rowell * * Permission is hereby granted, ...
// added s = 0
<|file_name|>vertex_outside.rs<|end_file_name|><|fim▁begin|>use crate::mock_graph::{ arbitrary::{GuidedArbGraph, Limit}, MockVertex, TestGraph, }; use graphene::{ core::{Ensure, Graph}, impl_ensurer, }; use quickcheck::{Arbitrary, Gen}; use std::collections::HashSet; /// An arbitrary graph and a vertex that is gua...
} }
<|file_name|>cm_cloud_managed_devices.py<|end_file_name|><|fim▁begin|># coding=utf-8 # # Copyright 2016 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
<|file_name|>items.js<|end_file_name|><|fim▁begin|>$(function() { /* We're going to use these elements a lot, so let's save references to them * here. All of these elements are already created by the HTML code produced * by the items page. */ var $orderPanel = $('#order-panel'); var $orderPanelCloseButton ...
/* Add the alert to the alert container. */
<|file_name|>bottomNavigationClasses.d.ts<|end_file_name|><|fim▁begin|>export interface BottomNavigationClasses { /** Styles applied to the root element. */ root: string; } export declare type BottomNavigationClassKey = keyof BottomNavigationClasses; <|fim▁hole|>export declare function getBottomNavigationUt...
<|file_name|>polish.py<|end_file_name|><|fim▁begin|>#(c) 2016 by Authors #This file is a part of ABruijn program. #Released under the BSD license (see LICENSE file) """ Runs polishing binary in parallel and concatentes output """ from __future__ import absolute_import from __future__ import division import logging im...
cfg.vals["err_modes"][error_mode]["subs_matrix"]) hopo_matrix = os.path.join(cfg.vals["pkg_root"],
<|file_name|>tabsExample.tsx<|end_file_name|><|fim▁begin|>/* * Copyright 2015 Palantir Technologies, Inc. All rights reserved. * Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy * of the license at https://github.com/palantir/blueprint/blob/master/LICENSE * and https://github.com/...
protected renderExample() {
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from polymorphic import PolymorphicModel from django.db.models import F from django.core.urlresolvers import reverse from django.contrib.auth.models import...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .config import Config, HentaiHavenConfig, HAnimeConfig, Section<|fim▁hole|><|fim▁end|>
from .last_entry import LastEntry
<|file_name|>module-6-comp.component.spec.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license<|fim▁hole|>import { async, ComponentFixture, Te...
*/
<|file_name|>app.routing.ts<|end_file_name|><|fim▁begin|>import { PageComponent } from './pages/page.component'; import { ModuleWithProviders, NgModule } from '@angular/core'; import { Routes, RouterModule } from '@angular/router'; export const appRoutes: Routes = [ { path: '', redirectTo: 'page',...
exports: [ RouterModule ] })
<|file_name|>Problem_4.java<|end_file_name|><|fim▁begin|>package codejam2016_1st; import java.io.BufferedInputStream; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Comparator; import java.util.Scanner; import java.util.Stack; class Pair { ...
}
<|file_name|>lc0124_binary_tree_maximum_path_sum.py<|end_file_name|><|fim▁begin|>"""Leetcode 124. Binary Tree Maximum Path Sum Hard URL: https://leetcode.com/problems/binary-tree-maximum-path-sum/ Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes f...
def __init__(self, val):
<|file_name|>hijack.go<|end_file_name|><|fim▁begin|>package client import ( "bufio" "crypto/tls" "fmt" "net" "net/http" "net/http/httputil" "net/url" "strings" "time" "github.com/docker/docker/api/types" "github.com/docker/docker/pkg/tlsconfig" "github.com/docker/go-connections/sockets" "github.com/pkg/e...
// on its underlying connection. if conn, ok := c.rawConn.(types.CloseWriter); ok {
<|file_name|>index.js<|end_file_name|><|fim▁begin|>module.exports = { "methods": { "wiki": function(msg, sender, api) { var query = msg.match(/\".+\"/)[0]; query = query.substring(1, query.length-1); var base = "http://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&rawcontinue&redi...
}
<|file_name|>FormInputs.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { FormGroup, ControlLabel, FormControl, Row } from 'react-bootstrap'; function FieldGroup({ label, ...props }: any) { return ( <FormGroup> <ControlLabel>{label}</ControlLabel> <FormControl {...props} /> ...
var row = []; for (var i = 0; i < this.props.ncols.length; i++) { row.push( <div key={i} className={this.props.ncols[i]}>
<|file_name|>core_config.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, unicode_literals core_store_students_programs = False core_store_students_programs_path = 'files_stored' core_experiment_poll_time = 350 # seconds # Ports core_facade_port = 28345 core_facade_server_route =...
core_coordinator_db_name = 'WebLabCoordination2' core_coordinator_db_username = 'weblab'
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" The most important object in the Gratipay object model is Participant, and the second most important one is Ccommunity. There are a few others, but those are the most important two. Participant, in particular, is at the center of everything on Gratipay. """ fr...
Recalculate *_volume fields in paydays table using exchanges table. """
<|file_name|>capitalize.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'capitalize' }) export class CapitalizePipe implements PipeTransform { public transform(data: any) { if (data === null || data === undefined || data === '') return ''; ...
if (data.length === 1) return data.charAt(0).toUpperCase(); return data.charAt(0).toUpperCase() + data.slice(1);
<|file_name|>construct.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/. */ //! Creates flows and fragments from a DOM tree via a botto...
if kid.get_pseudo_element_type() != PseudoElementType::Normal { self.process(&kid);
<|file_name|>bitcoin_es_MX.ts<|end_file_name|><|fim▁begin|><TS language="es_MX" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>Click derecho para editar tu dirección o etiqueta</translation> </message> <m...
<message> <source>Fee:</source>
<|file_name|>float.rs<|end_file_name|><|fim▁begin|>//! Implements vertical floating-point math operations. #[macro_use] mod abs; #[macro_use] mod cos; #[macro_use] mod exp; #[macro_use] mod powf; #[macro_use] mod ln; <|fim▁hole|> #[macro_use] mod mul_adde; #[macro_use] mod recpre; #[macro_use] mod rsqrte; #[mac...
#[macro_use] mod mul_add;
<|file_name|>toolbar-controller.js<|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 ...
var services = { '$scope' : $scope, '$rootScope' : $rootScope, '$http' : $http, '$modal' : $modal, '$q' : $q, '$translate' : $translate, 'editorManager' : editorManager}; FLOWABLE.TOOLBAR.ACTIONS.redo(services); return false;
<|file_name|>methods.py<|end_file_name|><|fim▁begin|>import json from math import ceil from asyncpg import Connection from qllr.common import MATCH_LIST_ITEM_COUNT from qllr.db import cache from qllr.settings import PLAYER_COUNT_PER_PAGE<|fim▁hole|> KEEPING_TIME = 60 * 60 * 24 * 30 SQL_TOP_PLAYERS_BY_GAMETYPE = """ ...
<|file_name|>nth.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use std::ascii::AsciiExt; use super::{Token, Parser, ParserInput...
"n" => parse_b(input, 1), "n-" => parse_signless_b(input, 1, -1), _ => match parse_n_dash_digits(&*value) { Ok(b) => Ok((1, b)),
<|file_name|>state.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: GPL-2.0+ # Copyright 2018 Google, Inc # Written by Simon Glass <sjg@chromium.org> # # Holds and modifies the state information held by binman # import hashlib import re from dtoc import fdt import os from patman import tools from patman imp...
if dtb != main_dtb: yield dtb
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Copyright 2013, Big Switch Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/li...
return policy except Exception: redirect = self.success_url msg = _('Unable to retrieve policy details.')
<|file_name|>rooms.py<|end_file_name|><|fim▁begin|>from classes import * sign = Object('sign', 'To the left is a sign.', 'The sign says: Den of Evil') opening = Room('opening', 'You are standing in front of a cave.', {}, {'sign' : sign}) #sign.set_room(opening) opening_w = Room('opening_w', 'You are standing in fron...
'opening_e' : opening_e,
<|file_name|>DataReaderWriterProvider.java<|end_file_name|><|fim▁begin|>/** * Copyright 2010 - 2022 JetBrains s.r.o. * * 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 * * https://www.apa...
<|file_name|>BezierCurveEditor.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013 - present Adobe Systems Incorporated. All rights reserved. * * 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...
* Paint canvas *
<|file_name|>webframe_test.py<|end_file_name|><|fim▁begin|>import unittest import sys from PySide.QtCore import QObject, SIGNAL, QUrl from PySide.QtWebKit import * from PySide.QtNetwork import QNetworkRequest from helper import adjust_filename, UsesQApplication <|fim▁hole|> class TestWebFrame(UsesQApplication): ...
<|file_name|>test_string.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import import bokeh.util.string as bus class Test_escape(object): def test_default_quote(self): assert bus.escape("foo'bar") == "foo&#x27;bar" assert bus.escape('foo"bar') == "foo&quot;bar" def test_quot...
assert bus.nice_join(["one", "two", "three", "four"], conjuction=None) == "one, two, three, four" def test_sep(self):
<|file_name|>es2020IntlAPIs.ts<|end_file_name|><|fim▁begin|>// @target: es2020 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation const count = 26254.39; const date = new Date("2012-05-24"); function log(locale: string) { console.log( `...
const options1 = { localeMatcher: 'lookup' } as const;
<|file_name|>makedep.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # $Id: makedep.py 1054 2008-12-03 00:38:43Z kena $ import sys import notes thenote = sys.argv[1] outfile = sys.argv[2] notes.init_repo(sys.argv[3:]) note = notes.repo.get(thenote) deps = note.get_deps()<|fim▁hole|>f = file(outfile, 'w') for...
print "%s.txt(note) -> %s(referenced keys)" % (thenote, outfile)
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/** <|fim▁hole|> */ package com.seikomi.janus.services;<|fim▁end|>
* This package contains the services of the server and the locator. * * @author Nicolas SYMPHORIEN (nicolas.symphorien@gmail.com) *
<|file_name|>ColumnsView.java<|end_file_name|><|fim▁begin|>/* * Copyright 2009-2014 PrimeTek. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.<|fim▁hole|> * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
* You may obtain a copy of the License at *
<|file_name|>test_authentication.py<|end_file_name|><|fim▁begin|># coding=utf-8 import logging from unittest.mock import patch from django.contrib.auth import get_user_model from django.test import TestCase from django.conf import settings from accounts.authentication import PersonaAuthenticationBackend, PERSONA_VERI...
self.assertEqual(found_user, new_user)
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>extern crate dirs; use regex::Regex; use std::fs::File; use std::io::prelude::*; use std::path::Path;<|fim▁hole|>use {Creds, Result}; pub fn get_credentials(conf: String) -> Result<Creds> { let mut path = dirs::home_dir().ok_or("Can't get home dir")?; // B...
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""redblue_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to u...
<|file_name|>asset_holder.rs<|end_file_name|><|fim▁begin|>use piston_window::PistonWindow; pub trait AssetHolder<Asset>: Default {<|fim▁hole|><|fim▁end|>
fn load(&mut self, asset_name: &'static str, window: &PistonWindow); fn get(&self, asset_name: &str) -> &Asset; fn get_mut(&mut self, asset_name: &str) -> &mut Asset; }
<|file_name|>venue.rs<|end_file_name|><|fim▁begin|>extern crate wd40; use wd40::venue::HeartbeatRes; use wd40::venue::VenueRes; fn main() { let venue_heartbeat: HeartbeatRes = wd40::venue::heartbeat("TESTEX") .unwrap() .unwrap_or_else(|why| { panic!("deserialization error: {}", why); }); <|fim▁hol...
println!("venue heartbeat res: {:?}", venue_heartbeat); let venue_stocks: VenueRes = wd40::venue::stocks("TESTEX")
<|file_name|>webglshaderprecisionformat.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/. */ #![allow(dead_code)] // https://www.khron...
self.range_max } // https://www.khronos.org/registry/webgl/specs/1.0/#5.12.1
<|file_name|>desktopshell_pl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pl" version="2.1"> <context> <name>main</name> <message> <source>System Preferences</source> <translation>Ustawienia systemu</translation> </message> <message> <source>Ke...
<translation type="unfinished"/>
<|file_name|>test_common.py<|end_file_name|><|fim▁begin|># Copyright 2010 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 # # http...
""" Test suites for 'common' code used throughout the OpenStack HTTP API. """
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from rest_framework import generics from .models import Proj from .serializers import ProjSerializer # Create your views here. class ProjList(generics.ListCreateAPIView): """be report project list""" queryset = Proj.objects.all() serializer_class = ProjSer...
<|file_name|>saveModule.py<|end_file_name|><|fim▁begin|>#pylint: disable=invalid-name from __future__ import (absolute_import, division, print_function) from PyQt4 import QtCore from mantid.simpleapi import * import numpy as n try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): ...
def saveMFT(idx,fname,logs):
<|file_name|>lpi_runescape.cc<|end_file_name|><|fim▁begin|>/* * * Copyright (c) 2011-2016 The University of Waikato, Hamilton, New Zealand. * All rights reserved. * * This file is part of libprotoident. * * This code has been developed by the University of Waikato WAND * research group. For further information ...
} static inline bool match_runescape(lpi_data_t *data, lpi_module_t *mod UNUSED) {
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>/** * Copyright 2015 The AMP HTML 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://...
Chrome_ci: { base: 'Chrome',
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>""" Test cases to cover Accounts-related behaviors of the User API application """ import datetime import hashlib import json from copy import deepcopy<|fim▁hole|>import ddt import pytz from django.conf import settings from django.test.testcases import Transactio...
from unittest import mock
<|file_name|>HTMLTreeBuilder.py<|end_file_name|><|fim▁begin|># # ElementTree # $Id: HTMLTreeBuilder.py 3265 2007-09-06 20:42:00Z fredrik $ # # a simple tree builder, for HTML input # # history: # 2002-04-06 fl created # 2002-04-07 fl ignore IMG and HR end tags # 2002-04-07 fl added support for 1.5.2 and later # 2...
# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
<|file_name|>FileManagerSmallDatapoolTest.java<|end_file_name|><|fim▁begin|>/* * SPDX-License-Identifier: GPL-3.0 * * * (J)ava (M)iscellaneous (U)tilities (L)ibrary * * JMUL is a central repository for utilities which are used in my * other public and private repositories. * * Copyright (C) 2013 Kristian Kuti...
*/ private IDGenerator generator;
<|file_name|>solution_1_wrong.py<|end_file_name|><|fim▁begin|>def calc(): h, l = input().split(' ') mapa = [] for i_row in range(int(h)): mapa.append(input().split(' ')) maior_num = 0 for row in mapa: for col in row: n = int(col) if (n > maior_num): maior_num = n qtd = [0 for i in ra...
print(menor)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from olpc import db class User(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(80)) email = db.Column(db.String(120), unique=True) def __init__(self, name, email): self.name = name self.email = ema...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import os from tornado import gen import tornado.web class DocsHandler(tornado.web.RequestHandler): @gen.coroutine def get(self): version = "{}://{}/docs/version/v1.yml".format( self.request.protocol, self.request.host) self.rend...
<|file_name|>test_long_path.py<|end_file_name|><|fim▁begin|># coding: utf-8 import os import sys from nxdrive.logging_config import get_logger from nxdrive.utils import safe_long_path from tests.common_unit_test import UnitTestCase if sys.platform == 'win32': import win32api log = get_logger(__name__) # Number...
<|file_name|>test_enroll_user_in_course.py<|end_file_name|><|fim▁begin|>""" Test the change_enrollment command line script.""" import ddt import unittest from uuid import uuid4 from django.conf import settings from django.core.management import call_command from django.core.management.base import CommandError from e...
<|file_name|>datatable.js<|end_file_name|><|fim▁begin|>/*** Wrapper/Helper Class for datagrid based on jQuery Datatable Plugin ***/ var Datatable = function () { var tableOptions; // main options var dataTable; // datatable object var table; // actual table jquery object var tableContaine...
<|file_name|>path_encrypt_test.go<|end_file_name|><|fim▁begin|>package transit import ( "context" "testing" "github.com/hashicorp/vault/logical" "github.com/mitchellh/mapstructure" ) // Case1: Ensure that batch encryption did not affect the normal flow of // encrypting the plaintext with a pre-existing key. func...
} resp, err = b.HandleRequest(context.Background(), decReq)
<|file_name|>feed_parse_extractNotoriousOnlineBlogspotCom.py<|end_file_name|><|fim▁begin|>def extractNotoriousOnlineBlogspotCom(item): ''' Parser for 'notorious-online.blogspot.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lowe...
return False
<|file_name|>leaflet.js<|end_file_name|><|fim▁begin|>/* @preserve * Leaflet 1.6.0+Detached: 0c81bdf904d864fd12a286e3d1979f47aba17991.0c81bdf, a JS library for interactive maps. http://leafletjs.com * (c) 2010-2019 Vladimir Agafonkin, (c) 2010-2011 CloudMade */ (function (global, factory) { typeof exports === 'obje...
_onMouseMove: function (e) { if (!this._map || this._map.dragging.moving() || this._map._animatingZoom) { return; }