prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>history.go<|end_file_name|><|fim▁begin|>// mauIRC - The original mauIRC web frontend
// Copyright (C) 2016 Tulir Asokan
// 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 ve... | // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for api project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
... | """
import os
import sys |
<|file_name|>control_slider.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/yeison/Documentos/python/developing/pinguino/pinguino-ide/qtgui/gide/bloques/widgets/control_slider.ui'
#
# Created: Wed Mar 4 01:39:58 2015
# by: pyside-uic 0.2.15 runn... | self.horizontalSlider.setTickPosition(QtGui.QSlider.NoTicks)
self.horizontalSlider.setTickInterval(128)
self.horizontalSlider.setObjectName("horizontalSlider") |
<|file_name|>test_mechanism_fslsdn.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Freescale, 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/L... | network_id = '123' |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(improper_ctypes)]
#![allow(missing_copy_implementations)]
#![allow(non_upper_case_globals)]
//! OpenCL bindings for Rust.
extern crate libc;
#[macro_use]
extern crate log;
#[link(name = "OpenCL", kind = "framework")]
#[cfg(target_os = "macos")]
extern { }
#[... | |
<|file_name|>decompression.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2021 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the... | decoder.get_mut().set_position(0);
return Ok(&output[..offset]);
}
|
<|file_name|>clothes_detection_dummy_node.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import rospy
import roslib
roslib.load_manifest('clothing_type_classification')
import actionlib
import clothing_type_classification.msg
import std_msgs
from sensor_msgs.msg import Image
from clothing_type_classification.ms... | def execute_cb(self, goal): |
<|file_name|>recentdocsmenu.cpp<|end_file_name|><|fim▁begin|>/*****************************************************************
Copyright (c) 1996-2000 the kicker authors. See file AUTHORS.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files... | KURL url ( f.readURL() );
if (url.isEmpty()) // What are we to do ? |
<|file_name|>context.spec.ts<|end_file_name|><|fim▁begin|>import { Context } from '../../../src/context/Context';
describe('Context', () => {
describe('Response', () => {
it('should return the response object', () => {
const res: any = 1;
const context = new Context(undefined, res,... | it('should return the request object', () => { |
<|file_name|>0003_auto_20150816_2148.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
('talks', '0002_auto_20150808_2108'),
... | ),
migrations.AlterField(
model_name='talk', |
<|file_name|>queue-cave-reinstall.ts<|end_file_name|><|fim▁begin|>import { actions } from "common/actions";
import { messages } from "common/butlerd";
import { DownloadReason } from "common/butlerd/messages";
import { Watcher } from "common/util/watcher";
import { mcall } from "main/butlerd/mcall";
export default func... | reason: DownloadReason.Reinstall,
queueDownload: true,
fastQueue: true,
}); |
<|file_name|>viz.go<|end_file_name|><|fim▁begin|>package graph<|fim▁hole|> "github.com/docker/docker/engine"
"github.com/docker/docker/image"
)
func (s *TagStore) CmdViz(job *engine.Job) engine.Status {
images, _ := s.graph.Map()
if images == nil {
return engine.StatusOK
}
job.Stdout.Write([]byte("digraph docke... |
import (
"strings"
|
<|file_name|>cs_matrix.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use na::{Matrix4x5, Matrix5x4, CsMatrix};
#[test]
fn cs_transpose() {
let m = Matrix4x5::new(
4.0, 1.0, 4.0, 0.0, 9.0,
5.0, 6.0, 0.0, 8.0, 10.0,
9.0, 10.0, 11.0, 12.0, 0.0,
0.0, 0.0, 1.0, 0.0, 10.0
);
let cs... | #![cfg_attr(rustfmt, rustfmt_skip)]
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>fullname = _('Cosigner Pool')
description = ' '.join([
_("This plugin facilitates the use of multi-signatures wallets."),
_("It sends and receives partially signed transactions from/to your cosigner wallet."),
_("Transactions are encrypted an... | from electrum_vtc.i18n import _ |
<|file_name|>ipblock.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
def ip2str(ip):
l = [
(ip >> (3*8)) & 0xFF,
(ip >> (2*8)) & 0xFF,
(ip >> (1*8)) & 0xFF,
(ip >> (0*8)) & 0xFF,
]
return '.'.join([str(i) for i in l])
def str2ip(line):
a, b, c, d = ... | bitcount = 1
for line in sys.stdin.readlines():
try: |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-<|fim▁hole|>
from setuptools import setup
setup(name='scalegrease',
version='1',
url='https://github.com/spotify/scalegrease',
description='A tool chain for executing batch processing jobs',
packages... | |
<|file_name|>org_writer.go<|end_file_name|><|fim▁begin|>package org
import (
"fmt"
"strings"
"unicode"
"unicode/utf8"
)
// OrgWriter export an org document into pretty printed org document.
type OrgWriter struct {
ExtendingWriter Writer
TagsColumn int
strings.Builder
indent string
}
var emphasisOrgBord... | |
<|file_name|>html.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(unrooted_must_root)]
use dom::bindings::codegen::Bindi... | }
let tree_builder = &self.sink;
tree_builder.trace_handles(&tracer); |
<|file_name|>dstr-async-gen-meth-dflt-ary-init-iter-close.js<|end_file_name|><|fim▁begin|>// This file was procedurally generated from the following sources:
// - src/dstr-binding/ary-init-iter-close.case
// - src/dstr-binding/default/cls-decl-async-gen-meth-dflt.template
/*---<|fim▁hole|>features: [Symbol.iterator, as... | description: Iterator is closed when not exhausted by pattern evaluation (class expression async generator method (default parameters))
esid: sec-class-definitions-runtime-semantics-evaluation |
<|file_name|>repo_branch.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package gitea
import (
"fmt"
"code.gitea.io/gitea/modules/structs"
)
// Branch is equal to struc... | branches := make([]*Branch, 0, 10)
return branches, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/branches", user, repo), nil, nil, &branches)
}
|
<|file_name|>router.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
import config from './config/environment';
import googlePageview from './mixins/google-pageview';
const Router = Ember.Router.extend(googlePageview, {
location: config.locationType
});
Router.map(function() {<|fim▁hole|> this.route('... | this.route('routes', function(){
this.route('route', { path: "/:route-id" }); |
<|file_name|>Program.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2015-2021 Martin Glueck All rights reserved
# Neugasse 2, A--2244 Spannberg, Austria. martin@mangari.org
# #*** <License> ************************************************************#
# This module is free software; you can red... | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. |
<|file_name|>test_smt.py<|end_file_name|><|fim▁begin|>import numpy as np
import amnet
import z3
from numpy.linalg import norm
import sys
import unittest
import itertools
VISUALIZE = True # output graphviz drawings
if VISUALIZE:
import amnet.vis
class TestSmt(unittest.TestCase):
@classmethod
def setU... | phi=y,
onvals=itertools.product(self.floatvals3, repeat=y.indim),
true_f=true_min_aff |
<|file_name|>redis_hash_layer.py<|end_file_name|><|fim▁begin|>import redis
from hashlib import sha1
class RedisHashLayer(object):
"""
A more memory-efficient way to store many small values in redis using hashes.
See http://antirez.com/post/redis-weekly-update-7.html
Note: add these config value to redi... | pipeline = self.connection.pipeline()
keys = self.connection.keys(self.name+"*")
for k in keys: |
<|file_name|>test_decorators.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy.testing import *
from numpy.testing.noseclasses import KnownFailureTest
import nose
def test_slow():
@dec.slow
def slow_func(x,y,z):
pass
assert_(slow_func.slow)
def test_setastest():
@dec.setastest()
... | for j in g1(10):
pass
except KnownFailureTest: |
<|file_name|>GridNearestNeighbor.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
GridNearestNeighbor.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
... | QgsProcessingParameterField.Numeric, |
<|file_name|>cmd_request.py<|end_file_name|><|fim▁begin|>import click
from json import dumps, load
import os
import sys
from tabulate import tabulate
@click.group('request')
@click.pass_context
def cli(ctx):
pass
@cli.command(name='unpause', help='Unpause a request')
@click.argument('request-id')
@click.pass_cont... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup<|fim▁hole|>setup(
name='MKS',
version='0.1.0',
description="A unit system based on meter, kilo, and second",
auth... | |
<|file_name|>SettingsExtensionDocTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2009-2014 Typesafe Inc. <http://www.typesafe.com>
*/
package docs.extension;
//#imports
import akka.actor.Extension;
import akka.actor.AbstractExtensionId;
import akka.actor.ExtensionIdProvider;
import akka.actor.ActorSystem;... | |
<|file_name|>__test.py<|end_file_name|><|fim▁begin|>import unittest
import doctest
import spiralx.fileproc
# -----------------------------------------------------------------------------
def load_tests(loader, tests, ignore):
fileprocTestSuite = unittest.TestSuite()
fileprocTestSuite.addTests(doctest.DocTest... | #suite = get_tests()
#suite.run() |
<|file_name|>SpyUtils.js<|end_file_name|><|fim▁begin|>import assert from './assert'
import { isFunction } from './TestUtils'
function noop() {}
let spies = []
export function createSpy(fn, restore=noop) {
if (fn == null)
fn = noop
assert(
isFunction(fn),
'createSpy needs a function'
)
<|fim▁hole|>... | let targetFn, thrownValue, returnValue |
<|file_name|>bitcoin_af_ZA.ts<|end_file_name|><|fim▁begin|><TS language="af_ZA" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>Skep 'n nuwe adres</translation>
</message>
<message>
<source>Copy the currently sele... | <name>UnitDisplayStatusBarControl</name> |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import os
import re
def setup_python3():
# Taken from "distribute" setup.py
from distutils.filelist import FileList
from distutils import dir_util, file_util, util, log
from os.path import join, exists
tmp_src = j... | **kwargs
) |
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import warnings
from argparse import ArgumentParser
import django
from django.apps import apps
from django.conf import settings
from django.db import connectio... | |
<|file_name|>ServiceTaskSpringDelegationTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2020 Alfresco Software, Ltd.
*
* 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
*
* ... | assertThat(JobTestHelper.areJobsAvailable(managementService)).isTrue();
waitForJobExecutorToProcessAllJobs(5000, 500);
Thread.sleep(1000);
assertThat(runtimeService.getVariable(procInst.getId(), "myVar")).isEqualTo("Activiti BPMN 2.0 process engine"); |
<|file_name|>120_simplify_transaction_log.py<|end_file_name|><|fim▁begin|>"""simplify transaction log
Revision ID: 8c2406df6f8
Revises:58732bb5d14b
Create Date: 2014-08-08 01:57:17.144405
"""
# revision identifiers, used by Alembic.
revision = '8c2406df6f8'<|fim▁hole|>
def upgrade():
conn = op.get_bind()
co... | down_revision = '58732bb5d14b'
from alembic import op
from sqlalchemy.sql import text |
<|file_name|>HttpStatusEncoder.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2007-2015, Kaazing Corporation. 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
*
... | }
@Override |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import os
from django.core.urlresolvers import reverse
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from easy_thumbnails.fields import ThumbnailerImageField
class VisibilityModel(models.Mode... | |
<|file_name|>wjquery.calendar.js<|end_file_name|><|fim▁begin|>/*
* wjquery.calendar 0.1.1
* by composite (wonchu.net@gmail.com)
* http://www.wonchu.net
* This project licensed under a MIT License.
0.1.0 : 최초작성
0.1.1 : 소스정리
*/
(function ($) {
const WCALENDAR_SV = {
ns: "wcalendar",
... | options.targetDate = options.selectDate.clone();
_WCALENDAR.draw($container, options);
$container.show();
|
<|file_name|>perfect.rs<|end_file_name|><|fim▁begin|>use super::lookups;
use cards::card::{Card};
use super::{HandRank};
use super::utils::{card_to_deck_number};
fn simulate_32bit_precision(u: usize) -> usize {
let mask = 0xffffffff;
u & mask
}
// don't use this.
pub fn find_fast(something: usize) -> usize {... | let c1 = Card(Value::Two, Suit::Spades);
let c2 = Card(Value::Two, Suit::Hearts);
let c3 = Card(Value::Two, Suit::Diamonds); |
<|file_name|>sudoku.go<|end_file_name|><|fim▁begin|>package sudoku
import "fmt"
const (
n = 3
N = 3 * 3
)
var (
resolved bool
)
func solveSudoku(board [][]byte) [][]byte {
// box size 3
row := make([][]int, N)
columns := make([][]int, N)
box := make([][]int, N)
res := make([][]byte, N)
for i := 0; i < N; i... |
func permute(board [][]byte, i, j int, row, column, box [][]int) { |
<|file_name|>p62.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
corto = 10
largo = long(corto)
<|fim▁hole|><|fim▁end|> | print type(corto)
print type(largo) |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var fs = require('fs')
// Script directories
var settings = require('./settings.json'); // The settings file
var scriptDir = settings.scriptDir + '/'; // The directory where dota scripts are placed
var scriptDir... | Prepare language files |
<|file_name|>TeraSdk.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Tera Python SDK. It needs a libtera_c.so
TODO(taocipian) __init__.py
"""
from ctypes import CFUNCTYPE, POINTER
from ctypes import byref, cdll, string_at
from ctypes import c_bool, c_char_p, c_void_p
from ctypes import c_uint32, c_int32... | POINTER(POINTER(c_ubyte)),
POINTER(c_uint64)] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#<|fim▁hole|>#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This program is free software: you can redis... | # OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
<|file_name|>XMLWriter.java<|end_file_name|><|fim▁begin|>/*
* #%L
* episodesmanager-services
*
* $Id$
* $HeadURL$
* %%
* Copyright (C) 2009 - 2010 Jean Couteau
* %%
* 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... | } catch (IOException eee) { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var UI = require('ui');
var ajax = require('ajax');
var Vector2 = require('vector2');
var webserver = decodeURIComponent(localStorage.getItem('webserver') ? localStorage.getItem('webserver') : 'webserver');
var qvserver = localStorage.getItem('qvserver') ? localStorag... | |
<|file_name|>Platform.py<|end_file_name|><|fim▁begin|>"""
Copyright 2008-2016 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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; eith... |
def get_colors(self): |
<|file_name|>instructions.rs<|end_file_name|><|fim▁begin|>use crate::ast::AST;
pub use crate::values::ArgumentsType;
pub type Bytecode = Vec<Instruction>;
#[derive(Debug, PartialEq, Clone)]
pub enum Instruction {
Apply,
Argument,
Assignment(String),
Close {
args: Vec<String>,
args_type... | LoadConstant(AST), |
<|file_name|>delete_data_for_sample.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# noinspection PyUnresolvedReferences
import init_django
from django.db import transaction
from common.utils import utcnow
from main.archive import DataArchiver
from main.delete import DataDeleter
from main.models import Ranki... | return 0
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.encoding import (
force_text, python_2_unicode_compatible)
from django.utils.translation import ugettext_la... | |
<|file_name|>issue-43106-gating-of-builtin-attrs.rs<|end_file_name|><|fim▁begin|>//~ NOTE not a function
//~^ NOTE not a foreign function or static
//~^^ NOTE not a function or static
// This test enumerates as many compiler-builtin ungated attributes as
// possible (that is, all the mutually compatible ones), and chec... |
#[macro_use] struct S;
//~^ `#[macro_use]` only has an effect
|
<|file_name|>external_authentication_oauth1.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio 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 So... | return None |
<|file_name|>angles.py<|end_file_name|><|fim▁begin|>import numpy as np
from numba import njit as jit<|fim▁hole|>@jit
def _kepler_equation(E, M, ecc):
return E_to_M(E, ecc) - M
@jit
def _kepler_equation_prime(E, M, ecc):
return 1 - ecc * np.cos(E)
@jit
def _kepler_equation_hyper(F, M, ecc):
return F_to_M... | |
<|file_name|>NavigationHeader.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be fo... | import type { |
<|file_name|>eLTE_Tool.cpp<|end_file_name|><|fim▁begin|>/*Copyright 2015 Huawei Technologies Co., Ltd. All rights reserved.
eSDK is 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... | } |
<|file_name|>angular-tabs.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('angular-tabs', ['angular-tabs-utils'])
.provider('$uiTabs', function () {
/**
*
*/
var TabDefinition = function () {
this.$dirty = false;
this.$selected = fals... | $element.html(locals.$template);
$element.addClass('ui-tab-system-view');
var link = $compile($element.contents()); |
<|file_name|>SubKey.java<|end_file_name|><|fim▁begin|>package org.fnppl.opensdx.security;
/*
* Copyright (C) 2010-2015
* fine people e.V. <opensdx@fnppl.org>
* Henning Thieß <ht@fnppl.org>
*
* http://fnppl.org
*/
/*
* Software license
*
* As far as this file or parts of this file is/a... | |
<|file_name|>crossfade.js<|end_file_name|><|fim▁begin|>//// Copyright (c) Microsoft Corporation. All rights reserved<|fim▁hole|>
(function () {
"use strict";
var page = WinJS.UI.Pages.define("/html/crossfade.html", {
ready: function (element, options) {
runAnimation.addEventListener("click"... | |
<|file_name|>TelicProtocolDecoderTest.java<|end_file_name|><|fim▁begin|>package org.traccar.protocol;
import org.junit.Test;
import org.traccar.ProtocolTest;
public class TelicProtocolDecoderTest extends ProtocolTest {
@Test
public void testDecode() throws Exception {
TelicProtocolDecoder decoder = ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
a class to access the REST API of the website www.factuursturen.nl
"""
import collections
import ConfigParser
from datetime import datetime, date
import re
import requests
from os.path import expanduser
import copy
import urllib
__author_... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from rest_framework import routers
from . import views
router = routers.DefaultRouter(trailing_slash=False)
router.register(r'complaints', views.ComplaintViewSet)<|fim▁hole|><|fim▁end|> |
urlpatterns = router.urls |
<|file_name|>no-capture-arc.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 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|>// <LICEN... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>trailing_zeros.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::integers::PrimitiveInt;
use malachite_base::num::conversion::traits::WrappingFrom;<|fim▁hole|>use platform::Limb;
/// Interpreting a slice of `Limb`s as the limbs of a `Natural` in ascending order, returns the
/// number of tra... | use malachite_base::num::logic::traits::TrailingZeros;
use malachite_base::slices::slice_leading_zeros;
use natural::InnerNatural::{Large, Small};
use natural::Natural; |
<|file_name|>fuzz_runner.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![no_main]
use diem_fuzzer::FuzzTarget;
use libfuzzer_sys::fuzz_target;
use once_cell::sync::Lazy;
use std::process;
static FUZZ_TARGET: Lazy<FuzzTarget> = Lazy::new(|| {
m... | eprintln!( |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|># Copyright 2017 Kevin Howell
#
# This file is part of sixoclock.
#
# sixoclock is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | if args.md5:
filters.append(File.md5 == args.md5)
if args.sha1: |
<|file_name|>issue-21361.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... | assert_eq!(boxed.max(), Some(3));
} |
<|file_name|>RegionWorld.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package net.projectzombie.regionrotation.modules;
import com.sk89q.worldgua... | private final UUID worldUID;
private final boolean isValid;
protected RegionWorld(final UUID worldUID) |
<|file_name|>sysoptions.py<|end_file_name|><|fim▁begin|>"""Options list for system config."""
import os
from collections import OrderedDict
from lutris import runners
from lutris.util import display, system
def get_optirun_choices():
"""Return menu choices (label, value) for Optimus"""
choices = [("Off", "of... | |
<|file_name|>javascript.py<|end_file_name|><|fim▁begin|>import os
import subprocess
import shutil
karma = os.path.join(os.path.dirname(__file__), '../node_modules/.bin/karma')
def javascript_tests():
if not shutil.which('nodejs'):
print("W: nodejs not available, skipping javascript tests")
retur... | |
<|file_name|>hub.js<|end_file_name|><|fim▁begin|>'use strict';
var https = require('https');
var q = require('q');
function logError(error) {
console.log("[Lightify] Error!");
if (error.statusMessage) {
console.log("[Lightify] HTTP Error: " + error.statusCode + " - " + error.statusMessage);
c... | |
<|file_name|>spec.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity 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 ... | |
<|file_name|>SerializableForwardingInjectionPoint.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source
* Copyright 2012, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licens... | * 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
* limitations under the License. |
<|file_name|>static-method-on-struct-and-enum.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
//... | }
}
fn main() { |
<|file_name|>riotwatcher.py<|end_file_name|><|fim▁begin|>from collections import deque
import time
import requests
# Constants
BRAZIL = 'br'
EUROPE_NORDIC_EAST = 'eune'
EUROPE_WEST = 'euw'
KOREA = 'kr'
LATIN_AMERICA_NORTH = 'lan'
LATIN_AMERICA_SOUTH = 'las'
NORTH_AMERICA = 'na'
OCEANIA = 'oce'
RUSSIA = 'ru'
TURKEY = '... | ) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>//
// partial2js
// Copyright (c) 2014 Dennis Sänger
// Licensed under the MIT
// http://opensource.org/licenses/MIT
//
"use strict";
var glob = require('glob-all');
var fs = require('fs');
var path = require('path');
var stream = require('stream');
var ht... | var key = self.uniqueFn( file ); |
<|file_name|>guild.py<|end_file_name|><|fim▁begin|>import os
from holster.enum import Enum
from rowboat.types import Model, SlottedModel, Field, DictField, text, raw, rule_matcher
CooldownMode = Enum(
'GUILD',
'CHANNEL',
'USER',
)
class PluginConfigObj(object):
client = None
class PluginsConfig(M... |
@classmethod
def parse(cls, obj, *args, **kwargs): |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistr... | |
<|file_name|>GVDatabaseHelper.java<|end_file_name|><|fim▁begin|>package com.avygeil.GrandVide;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;<|fim▁hole|>{
private final GrandVide gv;
private final String url;
private final String driverClas... | import java.sql.SQLException;
import java.sql.Statement;
public class GVDatabaseHelper |
<|file_name|>mixin.js<|end_file_name|><|fim▁begin|>import {smartTable} from 'smart-table-core';
//change the structure of returned items
const smartTableExtension = function ({table, tableState, data}) {
const oldChangeRegister = table.onDisplayChange;
//will overwrite the default onDisplayChange
return ... | const itemValues = items.map(i => i.value);
listener(itemValues);
}); |
<|file_name|>similarity_alga.rs<|end_file_name|><|fim▁begin|>use alga::general::{
AbstractGroup, AbstractLoop, AbstractMagma, AbstractMonoid, AbstractQuasigroup,
AbstractSemigroup, Identity, Multiplicative, RealField, TwoSidedInverse,
};
use alga::linear::Similarity as AlgaSimilarity;
use alga::linear::{AffineT... | */
impl<N: RealField + simba::scalar::RealField, D: DimName, R> Transformation<Point<N, D>>
for Similarity<N, D, R> |
<|file_name|>queries.py<|end_file_name|><|fim▁begin|>import psycopg2
from db.enums import *
base = psycopg2.connect("dbname='cardkeepersample' user='andrew' host='localhost' password='1234'")
cursor = base.cursor()
# Wrapped queries in alphabetic order
def active_packs(user_id, start=0, count=10):
query = """SE... | query = """UPDATE user_cards SET status = %s |
<|file_name|>CMakeIcons.java<|end_file_name|><|fim▁begin|>package cmake.icons;
import com.intellij.openapi.util.IconLoader;
import javax.swing.*;
/**<|fim▁hole|>public class CMakeIcons {
public static final Icon FILE = IconLoader.getIcon("/icons/cmake.png");
public static final Icon MACRO = IconLoader.getIco... | * Created by alex on 12/21/14.
*/ |
<|file_name|>test_parameters.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
# STDLIB
from types import MappingProxyType
# THIRD PARTY
import numpy as np
import pytest
# LOCAL
from astropy.cosmology import parameters, realizations
def test_realizations_in_dir():
... | realization. |
<|file_name|>hc.js<|end_file_name|><|fim▁begin|><|fim▁hole|> $(".showcase-wrapper").hide();
$(".showcase-wrapper").fadeIn("slow");
});
/*
var toggle = false;
$('.nav-toggle').on('click', function () {
if (toggle == false) {
$('#sidebar-wrapper').stop().animate({
'left': '4px'
})... | $(document).ready(function() {
$(".container").hide();
$(".container").fadeIn('5000'); |
<|file_name|>feature-gate-link_cfg.rs<|end_file_name|><|fim▁begin|>#[link(name = "foo", cfg(foo))]<|fim▁hole|>fn main() {}<|fim▁end|> | //~^ ERROR: is unstable
extern "C" {}
|
<|file_name|>pageserver.py<|end_file_name|><|fim▁begin|>import tornado.web
import forms
import config
import io
class Index(tornado.web.RequestHandler):
"""
Returns the index page.
"""
def get(self):
form = forms.RecomputeForm()
recomputations_count = io.get_recomputations_count()
... |
def initialize(self):
self.form = forms.FilterRecomputationsForm(self.request.arguments)
self.recomputations = io.load_all_recomputations() |
<|file_name|>common_test.go<|end_file_name|><|fim▁begin|>// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/... |
import ( |
<|file_name|>deactivate_realm.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import print_function
from django.core.management.base import BaseCommand
import sys
from zerver.lib.actions import do_deactivate_realm
from zerver.models import get_realm
class Command(BaseCommand):... | |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>import networkx as nx
import re
<|fim▁hole|> with open(file_path) as ifs:
lines = map(lambda ele: ele.strip(), ifs.readlines())
lines = filter(lambda ele: not ele.startswith('#') and re.match('.*[0-9]+.*[0-9]+', ele), lines)
pair_list = map(... | def get_graph_info(file_path):
def extract_first_two(collection):
return [int(collection[0]), int(collection[1])]
|
<|file_name|>project-card-list.component.ts<|end_file_name|><|fim▁begin|>import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import { PagedList, Project } from '@dev/translatr-model';
import { firstChar } from '@dev/translatr-sdk';
import { trackByFn } from '@translatr/utils... | @Input() showMore = true;
@Input() showMoreLink: any[] | string | null | undefined;
|
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | module.exports = (env = "dev") =>
// you may extend to other env to produce a production build for example
require(`./webpack.${env}.config.js`); |
<|file_name|>sage_methods.py<|end_file_name|><|fim▁begin|>"""
Project: flask-rest<|fim▁hole|>Description: All of the rest methods...
"""
class SageMethod:
GET = 'get'
POST = 'post'
DELETE = 'delete'
PUT = 'put'
ALL = [GET, POST, DELETE, PUT]<|fim▁end|> | Author: Saj Arora |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser ... | # last minute adjustments
# if country is in the guessed properties, make it part of the filename
if 'country' in result: |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Gateway documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 25 06:46:30 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values... | #html_use_smartypants = True |
<|file_name|>backend_termion.rs<|end_file_name|><|fim▁begin|>#[cfg(feature = "termion")]
#[test]
fn backend_termion_should_only_write_diffs() -> Result<(), Box<dyn std::error::Error>> {
use std::{fmt::Write, io::Cursor};
let mut bytes = Vec::new();
let mut stdout = Cursor::new(&mut bytes);
{
us... | } |
<|file_name|>32.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
export = RadarWeather32;<|fim▁end|> | import { RadarWeather32 } from "../../"; |
<|file_name|>formatters.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... | if (record.levelno == logging.DEBUG and
self.conf.logging_debug_format_suffix):
fmt += " " + self.conf.logging_debug_format_suffix |
<|file_name|>recipe.rs<|end_file_name|><|fim▁begin|>use nom::IResult;
// chars
named!(identifier<&str,&str>, re_find_static!(
concat!(
r"^",
r"[\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}]",
r"[\p{Lu}\p{Ll}\p{Lt}\p{Lm}\p{Lo}\p{Nl}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\p{Cf}]*",
)
));
named!(sp <&str,&str>... | assert_eq!(eol(text), IResult::Done("",text));
} |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "houseofdota.production_settings")
from django.core.management import execute_from_command_line<|fim▁hole|><|fim▁end|> |
execute_from_command_line(sys.argv) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.