prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>DateColumn.java<|end_file_name|><|fim▁begin|>/* * Project Scelight * * Copyright (c) 2013 Andras Belicza <iczaaa@gmail.com> * <|fim▁hole|> */ package hu.scelight.gui.page.replist.column.impl; import hu.scelight.gui.icon.Icons; import hu.scelight.gui.page.replist.column.BaseColumn; import hu...
* This software is the property of Andras Belicza. * Copying, modifying, distributing, refactoring without the author's permission * is prohibited and protected by Law.
<|file_name|>test_doccer.py<|end_file_name|><|fim▁begin|>''' Some tests for the documenting decorator and support functions ''' from __future__ import division, print_function, absolute_import import sys import pytest from numpy.testing import assert_equal from scipy.misc import doccer # python -OO strips docstring...
@decorator
<|file_name|>axe4.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 # http://axe.g0v.tw/level/4 import urllib2, re lines = []; last_url = None<|fim▁hole|> for index in range(1, 25): url = "http://axe-level-4.herokuapp.com/lv4/" if index == 1 \ else "http://axe-level-4.herokuapp.com/lv4/?page=...
<|file_name|>emitente.py<|end_file_name|><|fim▁begin|>from base import Entidade from pynfe.utils.flags import CODIGO_BRASIL class Emitente(Entidade): # Dados do Emitente # - Nome/Razao Social (obrigatorio) razao_social = str() # - Nome Fantasia nome_fantasia = str() # - CNPJ (obrigatorio) ...
endereco_bairro = str() # - CEP endereco_cep = str()
<|file_name|>count.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # NOTES # This script will count the number of tweets within an output.txt file import re<|fim▁hole|> regex = re.compile("\n\n"); newlinenewline = regex.findall(output.read()); print len(newlinenewline);<|fim▁end|>
output = open("output.txt", "r");
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "bufio" "flag" "fmt" "github.com/nutrun/lentil" "log" "os" "strings" ) var listener *bool = flag.Bool("listen", false, "Start listener") var help *bool = flag.Bool("help", false, "Show help") var mailto *string = flag.String("mailto", "", ...
msg, e := NewMessage(executable, arguments, *mailto, *workdir, *stdout, *stderr, "localignore", 0, 0) if e != nil { fmt.Fprintln(os.Stderr, e)
<|file_name|>ratelimit.py<|end_file_name|><|fim▁begin|>import functools from pluss.app import app from pluss.util.cache import Cache RATE_LIMIT_CACHE_KEY_TEMPLATE = 'pluss--remoteip--ratelimit--1--%s' <|fim▁hole|> def wrapper(*args, **kwargs): ratelimit_key = RATE_LIMIT_CACHE_KEY_TEMPLATE % flask.request.r...
def ratelimited(func): """Includes the wrapped handler in the global rate limiter (60 calls/min).""" @functools.wraps(func)
<|file_name|>network_menu_icon.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 "chrome/browser/chromeos/status/network_menu_icon.h" #include <algorithm> #in...
const int kBadgeLeftX = 0; const int kBadgeTopY = 0; int StrengthIndex(int strength, int count) {
<|file_name|>GlobalFilterFreeMarkerFilter.java<|end_file_name|><|fim▁begin|>/* * Mentawai Web Framework http://mentawai.lohis.com.br/ * Copyright (C) 2005 Sergio Oliveira Jr. (sergio.oliveira.jr@gmail.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GN...
* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
<|file_name|>schema.py<|end_file_name|><|fim▁begin|>import logging from marshmallow import ValidationError, post_load from marshmallow_jsonapi import Schema, fields from timeswitch.auth.dao import User class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger(__name__).addHandl...
def make_user(self, data): return User(**data)
<|file_name|>equal_method.go<|end_file_name|><|fim▁begin|>package assertions import ( "reflect" "github.com/smartystreets/logging" ) type equalityMethodSpecification struct { a interface{} b interface{} aType reflect.Type bType reflect.Type equalMethod reflect.Value log *logging.Logger } func newEquality...
this.aType = this.aType.Elem() }
<|file_name|>ClientPartitionService.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2008-2017, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at ...
* distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and
<|file_name|>portals.cpp<|end_file_name|><|fim▁begin|>/* =========================================================================== Doom 3 GPL Source Code Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company. Copyright (C) 2015 Robert Beckebans This file is part of the Doom 3 GPL Source Code (?Doom 3 Sou...
<|file_name|>search.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2017 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file ...
from aquilon.utils import force_int
<|file_name|>DirectEntryScroll.py<|end_file_name|><|fim▁begin|>__all__ = ['DirectEntryScroll'] from pandac.PandaModules import *<|fim▁hole|>from DirectEntry import * class DirectEntryScroll(DirectFrame): def __init__(self, entry, parent = None, **kw): optiondefs = ( ('pgFunc', PGVirtua...
import DirectGuiGlobals as DGG from DirectScrolledFrame import * from DirectFrame import *
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>'use strict'; const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CleanWebpackPlugin = require('clean-webpack-plugin'); module.exports = { debug: true, context: path.join(__dirname, '/client'), entry: { app...
};
<|file_name|>base_views.py<|end_file_name|><|fim▁begin|>import json from os import linesep<|fim▁hole|>from django.conf import settings from django.core.mail import send_mail from django.contrib.auth.decorators import login_required from django.contrib.messages.views import SuccessMessageMixin from django.utils import ...
from urllib2 import Request, urlopen from string import capwords
<|file_name|>shaders.ts<|end_file_name|><|fim▁begin|>interface IShaderAsset { Key: string; GetPath: () => string; }<|fim▁hole|><|fim▁end|>
export class Shaders { // Add Shaders Here (supports .frag files only) }
<|file_name|>spellerPuzzle.py<|end_file_name|><|fim▁begin|>#!/bin/env python2.7 # -*- coding: utf-8 -*- # This file is part of AT-Platform. # # EPlatform 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...
elif line[ :line.find('=')-1 ] == 'voice': pass
<|file_name|>subdirsprojectwizard.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of Qt Creator. ** ** Commercial License Usa...
Core::GeneratedFiles SubdirsProjectWizard::generateFiles(const QWizard *w, QString * /*errorMessage*/) const
<|file_name|>unit.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyliblo - Python bindings for the liblo OSC library # # Copyright (C) 2007-2011 Dominic Sacré <dominic.sacre@gmx.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the ...
def tearDown(self): del self.server
<|file_name|>servlet.py<|end_file_name|><|fim▁begin|># Copyright 2013 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. class RequestHeaders(object): '''A custom dictionary impementation for headers which ignores the case...
return (self.headers.get('Location'), self.status == 301) def IsNotFound(self): return self.status == 404
<|file_name|>firehose.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "firehose")] extern crate rusoto_core; extern crate rusoto_firehose; use rusoto_core::Region; use rusoto_firehose::{KinesisFirehose, KinesisFirehoseClient, ListDeliveryStreamsInput}; #[tokio::test]<|fim▁hole|> let client = KinesisFirehoseClien...
async fn should_list_delivery_streams() {
<|file_name|>masq.py<|end_file_name|><|fim▁begin|># Copyright (c) Metaswitch Networks 2015. All rights reserved. import logging from calico.felix.actor import Actor, actor_message from calico.felix.futils import IPV4, IPV6 from calico.felix.ipsets import Ipset, FELIX_PFX _log = logging.getLogger(__name__) ALL_POOLS...
async=True)
<|file_name|>client_vcs.go<|end_file_name|><|fim▁begin|>package cdsclient import ( "context" "github.com/ovh/cds/sdk" ) // VCSConfiguration get the vcs servers configuration func (c *client) VCSConfiguration() (map[string]sdk.VCSConfiguration, error) { var vcsServers map[string]sdk.VCSConfiguration if _, err := ...
return nil, err
<|file_name|>lsm303d.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2017 Intel Corporation. # # The MIT License # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "S...
print("Accelerometer x:", data[0], end=' ') print(" y:", data[1], end=' ') print(" z:", data[2], end=' ') print(" g")
<|file_name|>static-website.fr.js<|end_file_name|><|fim▁begin|>'use strict'; /** * @ngdoc service * @name ortolangMarketApp.STATIC_WEBSITE_FR * @description * # STATIC_WEBSITE_FR * Constant in the ortolangMarketApp. */ angular.module('ortolangMarketApp') .constant('STATIC_WEBSITE_FR', { STATIC_WEBSIT...
TERMS_OF_USE: 'Conditions générales d’utilisation', USAGE_RULES: 'Règles de bonne conduite',
<|file_name|>rcc-f1f3l1.go<|end_file_name|><|fim▁begin|>// +build f10x_ld f10x_ld_vl f10x_md f10x_md_vl f10x_hd f10x_hd_vl f10x_xl f10x_cl f303xe l1xx_md l1xx_mdp l1xx_hd l1xx_xl package dma import ( "stm32/hal/raw/rcc" ) func (p *DMA) enableClock(_ bool) { bit := bit(p, &rcc.RCC.AHBENR.U32, rcc.DMA1ENn) bit.Set...
func (p *DMA) reset() {}
<|file_name|>posl.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from functools import partial from PyQt5 import QtWidgets, QtCore from controller.gensec.dialogs.processes.information import Information from view.dialogs.base_dialog import Base...
<|file_name|>get-with-headers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """This does HTTP GET requests given a host:port and path and returns a subset of the headers plus the body of the result.""" from __future__ import absolute_import, print_function import json import os import sys from edenscm.mercu...
status = request(sys.argv[1], sys.argv[2], sys.argv[3:])
<|file_name|>CmdReceiver.cpp<|end_file_name|><|fim▁begin|>#include "CmdReceiver.h" #include <cstdio> #include "Engine.h" using namespace adv; CommandReceiver::CommandReceiver() : mStopRequested(false), mMultiline(false){ } CommandReceiver::~CommandReceiver(){ while (!mQueue.empty()){ Command c =...
} free(c.str); } }
<|file_name|>tissue_classification.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Script example of tissue classification """ from __future__ import print_function # Python 2/3 compatibility imp...
<|file_name|>better-expected.rs<|end_file_name|><|fim▁begin|>fn main() { let x: [isize 3]; //~ ERROR expected one of `!`, `(`, `+`, `::`, `;`, `<`, or `]`, found `3`<|fim▁hole|><|fim▁end|>
}
<|file_name|>test_config.py<|end_file_name|><|fim▁begin|># coding=utf-8 """ CERMMorse : test_config 5/7/2017 : 11:32 PM Author : James L. Key """ from unittest import TestCase from readconfig import Config __author__ = 'James L. Key'<|fim▁hole|> class TestConfig(TestCase): def setUp(self): self.conf = Con...
__project__ = 'CERMMorse'
<|file_name|>mobileengine_request.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2018 TinEye. All rights reserved worldwide. from .matchengine_request import MatchEngineRequest class MobileEngineRequest(MatchEngineRequest): """ Class to send requests to a MobileEngine API. Addin...
{'error': [],
<|file_name|>two_macros.rs<|end_file_name|><|fim▁begin|>#[macro_export] macro_rules! m { ($($t:tt)*) => { $($t)* } }<|fim▁hole|>macro_rules! n { ($($t:tt)*) => { $($t)* } }<|fim▁end|>
#[macro_export]
<|file_name|>jsb_cocos2d_extension.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013-2016 Chukong Technologies Inc. * * 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 restri...
<|file_name|>test_shellcheck.py<|end_file_name|><|fim▁begin|>from lintreview.review import Problems from lintreview.review import Comment from lintreview.tools.shellcheck import Shellcheck from lintreview.utils import in_path from unittest import TestCase from unittest import skipIf from nose.tools import eq_ <|fim▁hol...
shellcheck_missing = not(in_path('shellCheck'))
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod backpropagation_; mod util; /// Implementation of backpropagation trainers. /// pub mod backpropagation { pub use trainer::backpropagation_::{ SeqEpochTrainer, SeqErrorAverageTrainer, BatchEpochTrainer };<|fim▁hole|> /// Multithreaded implementati...
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' #from sc2casts_parser import * from sc2casts_client import * import json from pprint import * parser = SC2CastsParser() client = SC2CastsClient() TEST_DATA_DIR = 'data' # test cases: def test_titles(): pass # test cases: def test_cas...
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class ContactFormConfig(AppConfig): """The default AppConfig for admin which does autodiscovery.""" name = 'django_contact'<|fim▁hole|><|fim▁end|>
verbose_name = _("Contact")
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var entityMap = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': '&quot;', "'": '&#39;', "/": '&#x2F;' }; function escapeHTML(string) { return String(string).replace(/[&<>"'\/]/g, function (s) { return entityMap[s]; }); } function escapeC...
menuToggle.addEventListener('click', function () {
<|file_name|>unionnodestream.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ use anyhow::Error; use changeset_fetcher::ArcChangesetFetcher; use context::Co...
<|file_name|>test_sqlite.js<|end_file_name|><|fim▁begin|>var fs = require('fs'); var daff = require('daff'); var assert = require('assert'); var Fiber = null; var sqlite3 = null; try { Fiber = require('fibers'); sqlite3 = require('sqlite3'); } catch (err) { // We don't have what we need for accessing the s...
}
<|file_name|>uievent.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::EventBinding::EventMeth...
use dom::window::Window; use servo_util::str::DOMString; use std::cell::Cell;
<|file_name|>GroebnerBaseFGLMExamples.java<|end_file_name|><|fim▁begin|>/* * $Id$ */ package edu.jas.gbufd; import java.io.IOException; import java.io.Reader; import java.io.StringReader; import java.math.BigInteger; import java.util.Arrays; import java.util.Collections; import java.util.List; //import junit.fram...
<|file_name|>embedded_spec.go<|end_file_name|><|fim▁begin|>package restapi // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "encoding/json" ) // SwaggerJSON embedded version of the swagger document used at generation time v...
"/pets/findByTags": { "get": {
<|file_name|>DCIBT.py<|end_file_name|><|fim▁begin|>class TreeNode: def __init__(self, x): self.val = x self.left = None class Solution: def distributeCoins(self, root: TreeNode) -> int: total = 0 def dfs(node): if not node: return 0 ...
return node.val + L + R - 1 dfs(root) return total
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-12-31 23:57 from __future__ import unicode_literals import autoslug.fields from django.conf import settings from django.db import migrations, models<|fim▁hole|> class Migration(migrations.Migration):...
import django.db.models.deletion
<|file_name|>mod_power_of_2_square.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::arithmetic::traits::{ ModPowerOf2Square, ModPowerOf2SquareAssign, Parity, ShrRound, Square, WrappingSquare, }; use malachite_base::num::basic::integers::PrimitiveInt; use malachite_base::num::basic::traits::Zero; use malachi...
}
<|file_name|>mgr.go<|end_file_name|><|fim▁begin|>package ussn import ( "errors" "fmt" "log" "time" "github.com/AsynkronIT/protoactor-go/actor" "github.com/rolevax/ih/ako/model" "github.com/rolevax/ih/nodoka" ) var ( rec map[model.Uid]*ussn = make(map[model.Uid]*ussn) water []string // optimize ...
} }
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/** * @file * <a href="https://travis-ci.org/Xotic750/has-to-string-tag-x" * title="Travis status"> * <img * src="https://travis-ci.org/Xotic750/has-to-string-tag-x.svg?branch=master" * alt="Travis status" height="18"> * </a> * <a href="https://david-dm.org/Xot...
* @license {@link <https://opensource.org/licenses/MIT> MIT} * @module has-to-string-tag-x
<|file_name|>Image.tsx<|end_file_name|><|fim▁begin|>import { css } from 'glamor' import React, { Component, ImgHTMLAttributes } from 'react' import { ResourceProviderContext } from '../ResourceProvider' import View, { IViewProps } from '../View' interface IImage { /** Alternative image to use */ alt?: string /**...
/> )}
<|file_name|>0006_remove_sqlcommtrackconfig_couch_id.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.28 on 2020-05-03 02:00 from __future__ import unicode_literals <|fim▁hole|> class Migration(migrations.Migration): dependencies = [ ('commtrack', '0005_populate_config_mod...
from django.db import migrations
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Core models.""" import re from email.header import Header from django.conf import settings from django.db import models from django.urls import reverse from django.utils.encoding import force_str, smart_bytes, smart_text from django.utils.functional import cached...
"account",
<|file_name|>presentation.js<|end_file_name|><|fim▁begin|>(function(){ var slides = [ {title: 'Работы для отдела Клиентского сервиса и сапорта ФС\nТикетная админка, админка массовых сбоев', works: [ {img: 'i/works/ticket-admin.png', description: '<div class="presentation_mb10"><strong>Тикетная админка...
<|file_name|>Token.py<|end_file_name|><|fim▁begin|>from kinds import lowercase_first_word class Token(object): """ Represents the specification for a Token in the TokenSyntax file. """ def __init__(self, name, kind, text=None, is_keyword=False): self.name = name self.kind = kind ...
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>$(function () { $('div').browser();<|fim▁hole|><|fim▁end|>
});
<|file_name|>ScrollListViewTest.py<|end_file_name|><|fim▁begin|>import PyQtExtras from PyQt5.QtWidgets import QFrame, QApplication import sys <|fim▁hole|> main_frame = QFrame() list_view = PyQtExtras.ListScrollArea(main_frame) list_view.add_item_by_string('Item 1') list_view.add_item_by_string('Item...
def main(args): app = QApplication([])
<|file_name|>tstate-loop-break.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.o...
fn is_even(i: int) -> bool { (i%2) == 0 }
<|file_name|>error-festival.rs<|end_file_name|><|fim▁begin|>enum Question { Yes, No, } mod foo { const FOO: u32 = 0; } fn main() { let x = "a"; x += 2; //~^ ERROR E0368 y = 2; //~^ ERROR E0425 x.z();<|fim▁hole|> //~^ ERROR E0600 foo::FOO; //~^ ERROR E0603 0u32 as c...
//~^ ERROR E0599 !Question::Yes;
<|file_name|>cssgroupingrule.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>/* 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 crate::dom::bindings::codegen::Bindin...
<|file_name|>winetheme.py<|end_file_name|><|fim▁begin|># coding: utf8 # winetheme.py # 9/29/2013 jichi if __name__ == '__main__': import debug debug.initenv() import features if features.WINE: from sakurakit.skdebug import dwarn MAC_THEME = { 'ActiveBorder' : "240 240 240", 'ActiveTitle' : "240 240 2...
<|file_name|>SppComApi.ElevationConfig.1.js<|end_file_name|><|fim▁begin|>class sppcomapi_elevationconfig_1 { constructor() { // ISPPLUA Elevated () {get} this.Elevated = undefined; // bool IsElevated () {get} this.IsElevated = undefined; // _ElevationConfigOptions Mode () {...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime from dateutil import relativedelta from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.db.models import Q, Count from django_tables2 import Re...
query_desc += ' opis:' + opis kategorija = form.cleaned_data['kategorija'] if kategorija is not None:
<|file_name|>dock_tools.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 #-*- coding: utf-8 -*- from PyQt4 import QtCore from PyQt4 import QtGui from widget import Button, Label class ToolsWidget(QtGui.QWidget): """ widget cantaining tools buttons """ def __init__(self, project): QtGui.QWidget...
self.moveB.setChecked(False) self.selectB.setChecked(False) self.project.toolChangedSign.emit()
<|file_name|>range_arg.rs<|end_file_name|><|fim▁begin|>use std::ops::{Range, RangeFrom, RangeTo, RangeFull}; pub struct RangeArg { pub start: usize, pub end: Option<usize>, } impl RangeArg { pub fn len(&self, len: usize) -> usize { self.end.unwrap_or(len) - self.start } } impl From<Range<usiz...
RangeArg { start: r.start, end: None,
<|file_name|>ComboBoxMixin.js<|end_file_name|><|fim▁begin|>define([ "dojo/_base/declare", // declare "dojo/Deferred", "dojo/_base/kernel", // kernel.deprecated "dojo/_base/lang", // lang.mixin "dojo/store/util/QueryResults", "./_AutoCompleterMixin", "./_ComboBoxMenu", "../_HasDropDown", "dojo/text!./templates/...
// for backwards compatibility. store: null, =====*/
<|file_name|>workqueue.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/. */ //! A work queue for scheduling units of work across thread...
use rand::{Rng, XorShiftRng}; use std::cast; use std::comm;
<|file_name|>flock.rs<|end_file_name|><|fim▁begin|>use std::fs::{File, OpenOptions}; use std::io; use std::io::{Read, Seek, SeekFrom, Write}; use std::path::{Display, Path, PathBuf}; use termcolor::Color::Cyan; use crate::util::errors::{CargoResult, CargoResultExt}; use crate::util::paths; use crate::util::Config; us...
path.as_ref(), OpenOptions::new().read(true).write(true).create(true),
<|file_name|>HttpClientConfiguration.java<|end_file_name|><|fim▁begin|>/* * Autosleep * Copyright (C) 2016 Orange * Authors: Benjamin Einaudi benjamin.einaudi@orange.com * Arnaud Ruffin arnaud.ruffin@orange.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use ...
@Override
<|file_name|>wnaffect.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Clement Michard (c) 2015 """ import os import sys import nltk from emotion import Emotion from nltk.corpus import WordNetCorpusReader import xml.etree.ElementTree as ET class WNAffect: """WordNet-Affect ressource.""" def __...
<|file_name|>ssh.py<|end_file_name|><|fim▁begin|># (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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 p...
<|file_name|>HTTPResponseBuilder.java<|end_file_name|><|fim▁begin|>package com.acs.wave.router; import com.acs.wave.router.constants.ProtocolVersion; import com.acs.wave.router.constants.RedirectStatus; import com.acs.wave.router.functional.BodyWriter; import com.acs.wave.router.constants.ResponseStatus; import com.ac...
} public Optional<HTTPResponse> errorOption(ResponseStatus errorCode) { return Optional.of(error(errorCode));
<|file_name|>tar.go<|end_file_name|><|fim▁begin|>// Copyright 2014 go-dockerclient authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package docker import ( "fmt" "io" "io/ioutil" "os" "path" "path/filepath" "strings" "github...
srcPath, err := filepath.Abs(srcPath) if err != nil { return nil, err }
<|file_name|>marked.js<|end_file_name|><|fim▁begin|>import Marked from 'marked' import hljs from 'highlight.js' const renderer = new Marked.Renderer() export const toc = [] renderer.heading = function(text, level) { var slug = text.toLowerCase().replace(/\s+/g, '-') toc.push({ level: level, slug: slug, ...
return text }
<|file_name|>leaflet-routing-machine.js<|end_file_name|><|fim▁begin|>/*! leaflet-routing-machine - v3.2.1 - 2016-10-11 * Copyright (c) 2013-2016 Per Liedman * Distributed under the ISC license */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="func...
L.Routing = L.Routing || {};
<|file_name|>s3translate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Translation API @copyright: 2012-14 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (t...
pickle.dump(indices, f)
<|file_name|>0003_auto_20160131_0706.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings....
<|file_name|>proxy_test.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package osenv_test import ( "os" gc "launchpad.net/gocheck" "launchpad.net/juju-core/juju/osenv" "launchpad.net/juju-core/testing/testbase" ) type proxySuite stru...
<|file_name|>WarmUpResultClassifierEvent.java<|end_file_name|><|fim▁begin|>package eu.darken.myolib.processor.classifier; import eu.darken.myolib.processor.BaseDataPacket; import eu.darken.myolib.tools.ByteHelper; public class WarmUpResultClassifierEvent extends ClassifierEvent { /** * Possible warm-up resul...
if (warmUpResult.getValue() == warmUpResultValue) { mWarmUpResult = warmUpResult; break; }
<|file_name|>thunk.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/...
pub trait Invoke<A=(),R=()> { fn invoke(self: Box<Self>, arg: A) -> R; }
<|file_name|>kangrouter.py<|end_file_name|><|fim▁begin|>import time from tsm.common.app import exception import requests import json from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAdapter KANGROUTER_WEBSERVICE_APPLICATION_ROOT="/kangrouter/srv/v1" class KangRouterClient: ...
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/** * [remove: removes an object from the DOM tree] */ Element.prototype.remove = function () { this.parentNode.removeChild(this) } /** * [remove: removes a series of objects from the DOM tree] */ NodeList.prototype.remove = HTMLCollection.prototype.remove = funct...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate lazy_static; extern crate rustc_serialize; use rustc_serialize::json::Json; use std::error::Error; use std::path::Path; use std::fs::File; use std::io::Read; pub mod common; pub mod install; pub mod scanner; pub mod connection; pub mod message...
ver.to_string() }
<|file_name|>Map.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2015-2017 The Open Source Geospatial Foundation * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Li...
* @private
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models class Salary(models.Model): id = models.AutoField(primary_key = True) bh = models.CharField(max_length = 10) xm = models.CharField(max_length = 12) status = models.CharField(max_length = 8) class Meta: db_tabl...
def __str__(self): return self.id
<|file_name|>binary_sensor.py<|end_file_name|><|fim▁begin|>"""Support for MySensors binary sensors.""" from homeassistant.components import mysensors from homeassistant.components.binary_sensor import ( DEVICE_CLASSES, DOMAIN, BinarySensorDevice) from homeassistant.const import STATE_ON SENSORS = { 'S_DOOR': '...
<|file_name|>sitemap.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Sitemap builder """ import json, os from treelib import Tree from optimus.conf import settings class SitemapError(Exception): pass class PageSitemap(object): """ Construct ressource page to build and published sitemap ...
pages.append(self.view( title=leaf_name, template_name=datas['link'],
<|file_name|>test_courier.py<|end_file_name|><|fim▁begin|>from greencouriers.tests import * class TestCourierController(TestController): def test_index(self): response = self.app.get(url(controller='courier', action='index'))<|fim▁hole|><|fim▁end|>
# Test response...
<|file_name|>dev.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 # -*- coding: utf-8 -*- #external imports import sys import optparse import json import os import uuid import subprocess #internal imports import subuserlib.commandLineArguments import subuserlib.profile import subuserlib.paths <|fim▁hole|> descripti...
subuserExecutable = os.path.join(subuserlib.paths.getSubuserDir(),"logic","subuser") def parseCliArgs(realArgs): usage = "usage: subuser dev <args> DEV-IMAGE-NAME"
<|file_name|>infobar_gtk.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2009 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 "chrome/browser/gtk/infobar_gtk.h" #include <gtk/gtk.h> #include "app/gfx/gtk_util...
<|file_name|>argand.ts<|end_file_name|><|fim▁begin|>class Argand { <|fim▁hole|> public zoom: number = 3; private points: mathjs.Complex[] = []; private gridSize: number = 150; constructor() { } addPoint(z: mathjs.Complex) { this.points.push(z); } zoomIn(): void { thi...
public center: mathjs.Complex = math.complex(1, 1); // distance from center to right edge
<|file_name|>slideBox.unit.js<|end_file_name|><|fim▁begin|>/** * Test the side menu directive. For more test coverage of the side menu, * see the core Ionic sideMenu controller tests. */ describe('Ionic Angular Slide Box', function() { var el, compile, rootScope, timeout; beforeEach(module('ionic')); beforeE...
'</div>' + '</ion-slide>' + '<ion-slide>' + '<div class="box yellow">' +
<|file_name|>core.go<|end_file_name|><|fim▁begin|>package core import ( "bytes" "encoding/hex" "encoding/json" "fmt" "io/ioutil" "net/http" "strconv" "strings" "time" "github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/tendermint/tendermint/account" ptypes "github.com/eris-ltd/mint-client/God...
return nil, err } var pubKey account.PubKeyEd25519 var unbondAddrBytes []byte
<|file_name|>select.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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...
<|file_name|>wf-const-type.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/l...
struct NotCopy;
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod context; pub mod elf;<|fim▁hole|>pub mod tss;<|fim▁end|>
pub mod intex; pub mod memory; pub mod paging; pub mod regs;
<|file_name|>trait_def.rs<|end_file_name|><|fim▁begin|>use crate::ich::{self, StableHashingContext}; use crate::traits::specialization_graph; use crate::ty::fast_reject; use crate::ty::fold::TypeFoldable; use crate::ty::{Ty, TyCtxt}; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_hir::definitions::DefPat...
return result; }
<|file_name|>service.py<|end_file_name|><|fim▁begin|>import uuid from motey.models.image import Image from motey.models.service_state import ServiceState class Service(object): """ Model object. Represent a service. A service can have multiple states, action types and service types. """ def __in...