prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""TailorDev Biblio
Bibliography management with Django.<|fim▁hole|>"""
__version__ = "2.0.0"
default_app_config = "td_biblio.apps.TDBiblioConfig"<|fim▁end|> | |
<|file_name|>gai-print.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
'use strict';
var colors = require('ansicolors')
var table = require('text-table')
if (process.argv.length < 3) {<|fim▁hole|>} else {
var steps= require(process.argv[2]).steps
print(steps);
}
function fromStdin() {
var data = [];
func... | fromStdin(); |
<|file_name|>edit_post.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {PostOptions} from '@support/ui/component';
import {isAndroid} from '@support/utils';
class EditPostScreen {
testID = {
editPostScre... | await this.closeEditPostButton.tap(); |
<|file_name|>_insert_trc_infoDetail.hpp<|end_file_name|><|fim▁begin|>// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
<|fim▁hole|>START_ATF_NAMESPACE
namespace Detail
{
extern ::std::array<hook_record, 1> _insert_trc_info_functions... | #include <common/common.h>
#include <_insert_trc_infoInfo.hpp>
|
<|file_name|>target_dashboard.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use crate::{
components::{
dashboard::{dashboard_container, performance_container},
d... |
pub enum TargetDashboard { |
<|file_name|>0009_brewpispark_spark_time.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0008_auto_20150405_1435'),
]
operations = [
migrations.AddField(
... | from __future__ import unicode_literals |
<|file_name|>ABI41_0_0AndroidDialogPickerProps.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "ABI41_0_0AndroidDialogPickerProps.h"
#in... | } // namespace ABI41_0_0facebook |
<|file_name|>table_row.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/. */
//! CSS table formatting contexts.
#![deny(unsafe_code)]
... | |
<|file_name|>DBParVal.java<|end_file_name|><|fim▁begin|>package br.com.zpi.lrws.conn;
import java.io.Serializable;
<|fim▁hole|> public String value = null;
}<|fim▁end|> | public class DBParVal implements Serializable{
private static final long serialVersionUID = 1L;
public String param = null; |
<|file_name|>run_command_document.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# C... | |
<|file_name|>ContentService.ts<|end_file_name|><|fim▁begin|>import { Element } from "./Element"
import * as request from "request-promise-native"
import { Environment } from "../environment"
export default class ContentService {
static createContent = function (name: string, typeId: string, elements: any[]) {
... | static create = async function (content: any) {
console.log("CREATING CONTENT")
console.log("ENVIRONMENT COOKIE" + Environment.cookie)
try { |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import os
import sys
import subprocess
import pkg_resources
try:
import pkg_resources
_has_pkg_resources = True
except:
_has_pkg_resources = False
try:
import svn.local
_has_svn_local = True
except:
_has... |
Returns a dictionary keyed (by default) with the filename |
<|file_name|>aci_bd.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | state: absent
tenant: prod
bd: web_servers
''' |
<|file_name|>SingleLine.after.py<|end_file_name|><|fim▁begin|>def x():<|fim▁hole|><|fim▁end|> | print "bar"
print "foo"
print "xyzzy" |
<|file_name|>xmlhttprequest.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::cell::DOMRefCell;
use dom::bindings... | // perhaps should be handled by the resource_loader?
spawn_named("XHR:Cors".to_owned(), move || {
let response = req2.http_fetch(); |
<|file_name|>tuple-struct-destructuring.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<|fim▁hole|>//... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>facebook_mysql.py<|end_file_name|><|fim▁begin|># __author__ = MelissaChan
# -*- coding: utf-8 -*-
# 16-4-16 下午10:53
import MySQLdb
def connect(id,name,gender,region,status,date,inter):
try:
conn = MySQLdb.connect(host='localhost',user='root',passwd=' ',port=3306)
cur = conn.cursor()
... | # |
<|file_name|>gpu_vector.rs<|end_file_name|><|fim▁begin|>//! Wrapper for an OpenGL buffer object.
use std::mem;
use gl;
use gl::types::*;
use resource::gl_primitive::GLPrimitive;
#[path = "../error.rs"]
mod error;
struct GLHandle {
handle: GLuint
}
impl GLHandle {
pub fn new(handle: GLuint) -> GLHandle {
... | |
<|file_name|>CWE762_Mismatched_Memory_Management_Routines__delete_wchar_t_malloc_22a.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__delete_wchar_t_malloc_22a.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete.la... |
/* goodB2G1() - use badsource and goodsink by setting the static variable to false instead of true */
void goodB2G1Sink(wchar_t * data);
|
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>from functools import wraps
from django.shortcuts import get_object_or_404, redirect
from django.http import Http404, HttpResponseForbidden, HttpResponseBadRequest
from autodidact.models import *
def needs_course(view):
@wraps(view)
def wrapper(request, c... | |
<|file_name|>checkout.py<|end_file_name|><|fim▁begin|># Copyright 2006 John Duda
# This file is part of Infoshopkeeper.
# Infoshopkeeper 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 2 of t... | |
<|file_name|>1451-Rearrange Words in a Sentence.py<|end_file_name|><|fim▁begin|>import collections
class Solution:
def arrangeWords(self, text: str) -> str:<|fim▁hole|> table = collections.defaultdict(list)
for word in words:
table[len(word)].append(word)
result = []
for k... | words = text.split() |
<|file_name|>viewModelDecorations.js<|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.... | inlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration);
}
} |
<|file_name|>macro-only-syntax.rs<|end_file_name|><|fim▁begin|>// force-host
// no-prefer-dynamic
// These are tests for syntax that is accepted by the Rust parser but
// unconditionally rejected semantically after macro expansion. Attribute macros
// are permitted to accept such syntax as long as they replace it with... | // unsafe extern {
// type T; |
<|file_name|>expected.js<|end_file_name|><|fim▁begin|>var foo = arr.map(v => ({
x: v.bar,<|fim▁hole|> y: v.bar * 2
}));
var fn = () => ({}).key;<|fim▁end|> | |
<|file_name|>xencreate.py<|end_file_name|><|fim▁begin|>"""
Virtualization installation functions.
Currently somewhat Xen/paravirt specific, will evolve later.
Copyright 2006-2008 Red Hat, Inc.
Michael DeHaan <mdehaan@redhat.com>
Original version based on virtguest-install
Jeremy Katz <katzj@redhat.com>
Option handl... | if not no_gfx:
guest.set_graphics("vnc")
else:
guest.set_graphics(False) |
<|file_name|>instance_metadata.rs<|end_file_name|><|fim▁begin|>//! The Credentials Provider for an AWS Resource's IAM Role.
use async_trait::async_trait;
use hyper::Uri;
use std::time::Duration;
use crate::request::HttpClient;
use crate::{
parse_credentials_from_aws_service, AwsCredentials, CredentialsError, Prov... | ///
/// # Examples
/// |
<|file_name|>repair_test.py<|end_file_name|><|fim▁begin|>import time
import pytest
import logging
from repair_tests.repair_test import BaseRepairTest
since = pytest.mark.since
logger = logging.getLogger(__name__)
LEGACY_SSTABLES_JVM_ARGS = ["-Dcassandra.streamdes.initial_mem_buffer_size=1",
... | default_install_dir = self.cluster.get_install_dir() |
<|file_name|>pencil_et.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="et" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../app/ui/aboutdialog.ui" line="26"/>
<source>About</source>
<comment>About Dialog Window Title</com... | </message> |
<|file_name|>TreeHasher.py<|end_file_name|><|fim▁begin|>import itertools
import os<|fim▁hole|>class TreeHasher():
"""uses BlockHasher recursively on a directory tree
Input and output generators are in the format: ( relative-filepath, chunk_nr, hexdigest)
"""
def __init__(self, block_hasher):
... | |
<|file_name|>xbmc.js<|end_file_name|><|fim▁begin|>angular.module( 'remote.xbmc-service' , [] )
.service( 'XBMCService', function( $log,$http,Storage ){
//http://kodi.wiki/view/JSON-RPC_API/v6
var XBMC = this,
settings = (new Storage("settings")).get();
url = 'http://' + settings.ip + '/',<|fim▁hole|>
//url = '... | command = {id: 1, jsonrpc: "2.0" };
|
<|file_name|>ProcessManagedBean.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1998-2010 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source is free softw... | |
<|file_name|>search.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 or agree... | release.all_versions, key=lambda r: packaging.version.parse(r), reverse=True
)
obj["latest_version"] = release.latest_version |
<|file_name|>messages.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Nebula, 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
#
# ... |
def debug(request, message, extra_tags='', fail_silently=False):
"""Adds a message with the ``DEBUG`` level.""" |
<|file_name|>jquery.countdown.min.js<|end_file_name|><|fim▁begin|>/*
* jQuery The Final Countdown plugin v1.0.0 beta
* http://github.com/hilios/jquery.countdown
*
* Copyright (c) 2011 Edson Hilios
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated d... | if(event.value) {
event.value = event.value.toString();
}
break; |
<|file_name|>_FactoryFinderProviderFactory.java<|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 ... | " Default strategy using thread context class loader will be used.", e);
}
}
} |
<|file_name|>capture.pb.validate.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-validate
// source: envoy/data/tap/v2alpha/capture.proto
// DO NOT EDIT!!!
package v2
import (
"bytes"
"errors"
"fmt"
"net"
"net/mail"
"net/url"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/gogo/protob... | |
<|file_name|>regex.py<|end_file_name|><|fim▁begin|>import re
from utilRegex import database
class regex:
def __init__(self, botCfg):
"""class initialization function
"""
#intitialize database variables
self.db = database()
#initialize regex variables
self.phrase = ... | ' FROM phraseprint()' + \
' f(id bigint, phrase text, username text)') |
<|file_name|>sdc_firewall.py<|end_file_name|><|fim▁begin|>#
# Authors: Robert Abram <robert.abram@entpack.com>
#
# Copyright (C) 2015-2017 EntPack
# see file 'LICENSE' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public... | |
<|file_name|>ptr_in_fnptr.rs<|end_file_name|><|fim▁begin|>#[cxx::bridge]
mod ffi {
unsafe extern "C++" {
fn f(callback: fn(p: *const u8));<|fim▁hole|> }
}
fn main() {}<|fim▁end|> | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use ffmpeg::frame;
use openal::{Error, Listener};
use openal::source::{self, Stream};
use game::State;
use settings;
pub struct Sound<'a> {
settings: settings::Audio,
<|fim▁hole|> listener: Listener<'a>,
}
impl<'a> Sound<'a> {
pub fn new(settings: &settings::Audio) ... | music: Option<Stream<'a>>,
timestamp: i64,
|
<|file_name|>extract_test_data.py<|end_file_name|><|fim▁begin|>import csv
import loremipsum
import random
import re
from encoded.loadxl import *
class Anonymizer(object):
"""Change email addresses and names consistently
"""
# From Colander. Not exhaustive, will not match .museum etc.
email_re = re.co... | google='google', |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function (grunt) {
var idVideo = 0;
var examples = require('./node_modules/grunt-json-mapreduce/examples');
var _ = require('underscore');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cfg: {
... | |
<|file_name|>ppsspp_zh-cn.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="zh_CN">
<context>
<name>Controls</name>
<message>
<source>Controls</source>
<comment>Controls window title</comment>
<translation type="obsolete">控制器... | </message>
<message>
<location filename="../Debugger/debugger_displaylist.ui" line="156"/>
<source>Step</source> |
<|file_name|>selectors.test.ts<|end_file_name|><|fim▁begin|>import { extractPartsFromPath } from './selectors';
describe('router/selectors', () => {
describe('extractPartsFromPath', () => {
it('return pathName, query and parse store data from window.location', () => {
const store = { useHash: false } as an... | |
<|file_name|>issue-3683.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/lice... | |
<|file_name|>bot.py<|end_file_name|><|fim▁begin|>#-*- coding: utf- -*-
import os
import sys
import random
import time
import json
import wikiquote
import tuitear
from threading import Thread
CONGIG_JSON = 'bots.json'
# Variable local, para modificar el intervalo real cambiar la configuración
INTERVALO = 1<|fim▁hole|... | |
<|file_name|>passability.py<|end_file_name|><|fim▁begin|># Passability types.
#
# @author Oktay Acikalin <oktay.acikalin@gmail.com>
# @copyright Oktay Acikalin
# @license MIT (LICENSE.txt)
# from json import load
from collections import OrderedDict
# from os.path import splitext, dirname, join
from os.path import... | |
<|file_name|>config.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | pub const MEMORY_REGIONS_MAX: usize = 8; |
<|file_name|>LogbackServiceLogEventAppenderTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright to the original author or 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
*
* ... | * distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>0005_parentrelation_signature.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [<|fim▁hole|> migrations.AddField(
model_name='parentrelati... | ('users', '0004_auto_20150428_2142'),
]
operations = [ |
<|file_name|>Location.java<|end_file_name|><|fim▁begin|>package grid;
import java.util.Comparator;
import world.World;
/*
* AP(r) Computer Science GridWorld Case Study:
* Copyright(c) 2002-2006 College Entrance Examination Board
* (http://www.collegeboard.com).
*
* This code is free software; you can redistri... | dr = 1;
}
else if (adjustedDirection == SOUTH) |
<|file_name|>numpy-examples.py<|end_file_name|><|fim▁begin|>import numpy as np
# Inner (or dot) product
a = np.array([1,2])
b = np.array([3,4])
np.inner(a, b)
a.dot(b)
# Outer product
a = np.array([1,2])
b = np.array([3,4])
np.outer(a, b)
# Inverse
m = np.array([[1,2], [3,4]])
np.linalg.inv(m)
# Inner (or dot) pro... | # Covariance
X = np.random.randn(100,3)
np.cov(X.T) |
<|file_name|>sistema.js<|end_file_name|><|fim▁begin|>/**
*<|fim▁hole|>});
/*
* Función que permite bloquear la pantalla mientras esta procesando
*/
$(function () {
$(document).ajaxStart($.blockUI).ajaxStop($.unblockUI);
});
/*
* Función que bloquea la tecla F5 y Enter de la pagina y detectar tecla arriba y ... | * @author xedushx
*/
$(document).bind("touchmove", function (event) {
event.preventDefault(); |
<|file_name|>water-triple-ind.py<|end_file_name|><|fim▁begin|>from gen import *
##########
# shared #
##########
flow_var[0] = """
(declare-fun tau () Real)
(declare-fun x1 () Real)
(declare-fun x2 () Real)
(declare-fun x3 () Real)
"""
flow_dec[0] = """
(define-ode flow_1 ((= d/dt[x1] (/ (- 5 (* (* 0.5 (^ (* 2 9.806... | |
<|file_name|>test_shutil.py<|end_file_name|><|fim▁begin|># Copyright (C) 2003 Python Software Foundation
import unittest
import shutil
import tempfile
import sys
import stat
import os
import os.path
from os.path import splitdrive
from distutils.spawn import find_executable, spawn
from shutil import (_make_t... | finally:
shutil.rmtree(src_dir)
shutil.rmtree(os.path.dirname(dst_dir))
|
<|file_name|>system_tests_policy_oversize_basic.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... | |
<|file_name|>market-selection.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit} from '@angular/core';<|fim▁hole|>import {MarketCardType} from '../market-card-type';
import {MarketService} from '../market.service';
import {Expansion} from '../expansion';
import { GameModeService } from '../game-mode.s... | import {MarketCard} from '../market-card'; |
<|file_name|>UniformBuffer.cpp<|end_file_name|><|fim▁begin|>#include "UniformBuffer.hpp"
#include <iostream>
#include <cstring>
UniformBuffer::UniformBuffer(const void* data, unsigned int size, VkDevice device, VkPhysicalDevice physicalDevice, VkDescriptorPool descriptorPool, VkShaderStageFlags flags) : Buffer(device... | memcpy(mappedMemory, data, size);
vkUnmapMemory(device, bufferMemory);
} |
<|file_name|>test_init.py<|end_file_name|><|fim▁begin|>"""Test Agent DVR integration."""
from unittest.mock import AsyncMock, patch
from agent import AgentError
from homeassistant.components.agent_dvr.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssi... | assert not hass.data.get(DOMAIN)
async def test_async_setup_entry_not_ready(hass: HomeAssistant): |
<|file_name|>service.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify<|fim▁hole|>// Parity is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even t... | // 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 option) any later version.
|
<|file_name|>extract_patches.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import os
from math import sqrt
from os.path import expanduser
def extract_patches(path, filename, out_path, patch_size, stride, visualize):
img = mpimg.imread(path+fi... | grid_size = int(sqrt(len(patches)))
name, ext = os.path.splitext(filename) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod apps;
pub mod scope;
mod user;
<|fim▁hole|><|fim▁end|> | pub use self::user::{SignedInUser, SignedInUserWithEmail}; |
<|file_name|>caret_jump.py<|end_file_name|><|fim▁begin|>import sublime
import sublime_plugin
OPTIONS_LAST_REGEX = "jump_caret_last_regex"
class CaretJumpCommand(sublime_plugin.TextCommand):
def run(self, edit, jump=True, jump_to=None, repeat_previous_jump=False):<|fim▁hole|> for sel in view.sel():
... | view = self.view
def get_next_sels(user_input):
new_sels = [] |
<|file_name|>sandboxSignalMapper.py<|end_file_name|><|fim▁begin|>from PyQt4 import QtGui, QtCore
class Window(QtGui.QMainWindow):
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.mapper = QtCore.QSignalMapper(self)
self.toolbar = self.addToolBar('Foo')
self.toolbar.setToolB... | |
<|file_name|>color.cpp<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: GPL-2.0<|fim▁hole|>#include "color.h"
#include <QMap>
#include <array>
// Note that std::array<QColor, 2> is in every respect equivalent to QColor[2],
// but allows assignment, comparison, can be returned from functions, etc.
static QMap<c... | |
<|file_name|>api.js<|end_file_name|><|fim▁begin|>(function (root, factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory(require('jquery'), require('../common/utility'));
} else {
root.api = factory(root.jQuery, root.utility);
}
}(this, function ($, util) {
// API
var... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt lice... | source("../../shared/qtcreator.py")
# test New Qt Quick Application build and run for release and debug option
def main(): |
<|file_name|>spinner.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (5c017c9) from gir-files (71d73f0)
// DO NOT EDIT
use Widget;
use ffi;
use glib;
use glib::Value;
use glib::object::Downcast;<|fim▁hole|>
glib_wrapper! {
pub struct Spinner(Object<ffi::GtkSpinner>): Widget;
match fn {
... | use glib::object::IsA;
use glib::translate::*;
use gobject_ffi; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// The code below is a stub. Just enough to satisfy the compiler.
// In order to pass the tests you can add-to or change any of this code.
#[allow(unused_variables)]<|fim▁hole|>pub fn convert(input: &str) -> Result<String, ()> {
unimplemented!();
}<|fim▁end|> | |
<|file_name|>ex_integer.go<|end_file_name|><|fim▁begin|>package atoms
import (
"fmt"
"hash/fnv"
"math/big"
"github.com/corywalker/expreduce/pkg/expreduceapi"
)
// Integer numbers represented by big.Int
type Integer struct {
Val *big.Int
cachedHash uint64
}
/*func (f *Integer) StringForm(params ToString... | if thisInt.Val.Cmp(otherConv.Val) != 0 { |
<|file_name|>buddy.py<|end_file_name|><|fim▁begin|>__author__ = "Steffen Vogel"
__copyright__ = "Copyright 2015, Steffen Vogel"
__license__ = "GPLv3"
__maintainer__ = "Steffen Vogel"
__email__ = "post@steffenvogel.de"
"""
This file is part of transWhat
transWhat is free software: you can redistribute it and/or modi... | else:
status = protocol_pb2.STATUS_ONLINE |
<|file_name|>doc.go<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | // Package maths provides basic operations with floats and vectors
package maths |
<|file_name|>exercise11_4_2.py<|end_file_name|><|fim▁begin|>import math
Deleted = math.inf
def hash_delete(T, k, h):
m = T.length
i = 0
while True:
j = h(k, i, m)
if T[j] == k:
T[j] = Deleted
return<|fim▁hole|> i = i + 1
if T[j] is None or i == m:
... | |
<|file_name|>audio_low_latency_output_mac.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/audio/mac/audio_low_latency_output_mac.h"
#include <CoreSer... | output_device_id_(kAudioObjectUnknown), |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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... | if not isinstance(entry, dict):
# restore the basedir in case this error is caught and handled |
<|file_name|>TransformBase64DecodeTest.java<|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
... | * under the License.
*/
package org.apache.xml.security.test.dom.transforms.implementations; |
<|file_name|>requests.ts<|end_file_name|><|fim▁begin|>// https://developer.mozilla.org/ja/docs/Web/API/Navigator/doNotTrack
export function enable(): boolean {
const w: any = window
const dnt: string = w.navigator.doNotTrack || w.doNotTrack<|fim▁hole|> return false
}
return true
}
export function get(
url... | if (dnt === '1' || dnt === 'yes') { |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
REDMINE_SERVER_URL = getattr(settings, 'REDMINE_SERVER_URL', 'https://localhost')<|fim▁end|> | from django.conf import settings |
<|file_name|>header.js<|end_file_name|><|fim▁begin|>import $ from 'jquery';
import { router } from 'src/router';
import './header.scss';
export default class Header {
static selectors = {
button: '.header__enter',
search: '.header__search'
};
constructor($root) {
this.elements = {... | |
<|file_name|>schematic_type_map.py<|end_file_name|><|fim▁begin|>'''
Created on Mar 20, 2011
@author: frederikns
'''
from model.flyweight import Flyweight
from collections import namedtuple
from model.static.database import database
from model.dynamic.inventory.item import Item
class SchematicTypeMap(Flyweight):
d... | schematic_type = namedtuple("schematic_type", "item, is_input") |
<|file_name|>atom_installer.py<|end_file_name|><|fim▁begin|># Author: Ahmed Husam Elsers
# Email: ahmed.elsersi@gmail.com
# This is a Python3 script to install/upgrade Atom for Linux (Fedora, Ubuntu)
# Check The Host Linux Distro (Fedora/Ubuntu)
# Check if Atom installed or Not
# If Installed:
# check the lat... | |
<|file_name|>environ.py<|end_file_name|><|fim▁begin|>"""
Django-environ allows you to utilize 12factor inspired environment
variables to configure your Django application.
"""
import json
import logging
import os
import re
import sys
import warnings
from django.core.exceptions import ImproperlyConfigured
from six.mov... | @classmethod
def cache_url_config(cls, url, backend=None): |
<|file_name|>tokenizer.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 Couchbase, 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/licenses/LICENSE-2.0
... | }
tokenizer, err := tokenizerConstructor(config, cache)
if err != nil { |
<|file_name|>App.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { Provider } from 'react-redux';
import Home from './app/Home';
import { store } from './app/store';
declare const module: any;<|fim▁hole|> <Home />
</Provider>
);
if (module.hot) {
module.hot.accept();
}
export default App;<... | const App = () => (
<Provider store={store}> |
<|file_name|>ShowTitleTrueTestCase.java<|end_file_name|><|fim▁begin|>package fr.jmini.asciidoctorj.testcases;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.Arrays;
import java.util.Collections;
import java.uti... | |
<|file_name|>radio.min.js<|end_file_name|><|fim▁begin|>((bbn)=>{let script=document.createElement('script');script.innerHTML=`<div :class="['bbn-iblock', componentClass]">
<input class="bbn-hidden"
ref="element"
:value="modelValue"
:disabled="disabled"
:required="required"
>
<d... | |
<|file_name|>test_div_bool.py<|end_file_name|><|fim▁begin|>import numpy as np
from parakeet import jit, testing_helpers
@jit
def true_divided(x):
return True / x
def test_true_divided_bool():
testing_helpers.expect(true_divided, [True], True)<|fim▁hole|> testing_helpers.expect(true_divided, [2], 0)
def... |
def test_true_divided_int():
testing_helpers.expect(true_divided, [1], 1) |
<|file_name|>pip.rs<|end_file_name|><|fim▁begin|>use std::old_io::BufferedReader;
use std::old_io::EndOfFile;
use std::old_io::fs::File;
use super::super::context::{BuildContext};
use super::super::packages;
use super::generic::{run_command_at_env, capture_command};
pub fn scan_features(ver: u8, pkgs: &Vec<String>) ... | "-m".to_string(), "pip".to_string(),
"install".to_string(), |
<|file_name|>HomeGraphService.java<|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 appl... | * |
<|file_name|>StreamService.py<|end_file_name|><|fim▁begin|>from Source import Source
from Components.Element import cached
from Components.SystemInfo import SystemInfo
from enigma import eServiceReference
StreamServiceList = []
class StreamService(Source):
def __init__(self, navcore):
Source.__init__(self)
self.... | |
<|file_name|>parser.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/. */
//! The context within which CSS code is parsed.
use context:... | modes.remove($b); |
<|file_name|>scala.js<|end_file_name|><|fim▁begin|>"use strict";
define("ace/snippets/scala", ["require", "exports", "module"], function (require, exports, module) {
"use strict";
<|fim▁hole|> exports.snippetText = undefined;
exports.scope = "scala";
});<|fim▁end|> | |
<|file_name|>res_users.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import requests
from odoo.addons.microsoft_calendar.models.microsoft_sync import microsoft_calendar_token
from datetime import timedelta
from odoo im... | for user in users:
_logger.info("Calendar Synchro - Starting synchronization for %s", user)
try:
user.with_user(user).sudo()._sync_microsoft_calendar(microsoft) |
<|file_name|>test_sdist.py<|end_file_name|><|fim▁begin|>"""Tests for distutils.command.sdist."""
import os
import tarfile
import unittest
import warnings
import zipfile
from os.path import join
from textwrap import dedent
from test.test_support import captured_stdout, check_warnings, run_unittest
# zlib is not used he... | def test_make_distribution(self):
# check if tar and gzip are installed |
<|file_name|>PrimitiveTypeImpl.java<|end_file_name|><|fim▁begin|>/**
*/
package es.um.nosql.streaminginference.NoSQLSchema.impl;
import es.um.nosql.streaminginference.NoSQLSchema.NoSQLSchemaPackage;
import es.um.nosql.streaminginference.NoSQLSchema.PrimitiveType;
import org.eclipse.emf.common.notify.Notification;
i... | |
<|file_name|>stack.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""stack.py: Stack implementation"""
__author__ = 'Rohit Sinha'
class Stack:
def __init__(self):
self.items = []
def isEmpty(self):
return self.items == []
def push(self, item):
self.items.append(item)
... | s.push(5)
s.push('Hello')
print(s.peek())
s.push(True) |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>use proc_macro2::TokenStream;
use quote::quote;
use std::env;
use std::fs::File;
use std::io::{prelude::*, BufReader, BufWriter};
use std::path::Path;
fn get_data_file(path_fragment: &str) -> BufReader<File> {
println!("cargo:rerun-if-changed=../data/{}", path_fra... | "Code page 1254 (Windows Latin 5 (Turkish))", |
<|file_name|>script.py<|end_file_name|><|fim▁begin|>from nider.core import Font
from nider.core import Outline
from nider.models import Header
from nider.models import Paragraph
from nider.models import Linkback
from nider.models import Content
from nider.models import TwitterPost
# TODO: change this fontpath to the... | font=Font(roboto_font_folder + 'Roboto-Bold.ttf', 30),
text_width=40,
align='left',
color='#ededed' |
<|file_name|>ui-icon_spec.js<|end_file_name|><|fim▁begin|>/* -*- javascript -*- */
"use strict";
import {StageComponent} from 'aurelia-testing';
import {bootstrap} from 'aurelia-bootstrapper';
import {LogManager} from 'aurelia-framework';
import {ConsoleAppender} from 'aurelia-logging-console';
import {customMatchers}... | beforeEach(() => { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.