prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>list40_c.hpp<|end_file_name|><|fim▁begin|>#ifndef AUTOBOOST_MPL_LIST_LIST40_C_HPP_INCLUDED
#define AUTOBOOST_MPL_LIST_LIST40_C_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http:... | |
<|file_name|>validation.py<|end_file_name|><|fim▁begin|>import re
import mimetypes
<|fim▁hole|>def validate_markdown_flavour(value):
return value in ('markdown', 'markdown_strict', 'markdown_phpextra',
'markdown_github', 'markdown_mmd', 'commonmark')
def validate_mimetype_image(value):
# ... | |
<|file_name|>__init__.py<|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.
# --------------... |
def load_params(_): |
<|file_name|>comp-3766.component.spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/<|fim▁hole|>import { async, ComponentFixture, Te... | |
<|file_name|>intron_exon_reads.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
Example from pybedtools documentation (:ref:`third example`) to count \
reads in introns and exons using multiple CPUs.
"""
from __future__ import print_function
import pybedtools
import argparse
import os
import sys
import multiproc... | |
<|file_name|>buffer.ts<|end_file_name|><|fim▁begin|>// Specifically test buffer module regression.
import {
Buffer as ImportedBuffer,
SlowBuffer as ImportedSlowBuffer,
transcode,
TranscodeEncoding,
constants,
kMaxLength,
kStringMaxLength,
Blob,
} from 'buffer';
const utf8Buffer = new Bu... | // Imported Buffer from buffer module works properly
{
const b = new ImportedBuffer('123'); |
<|file_name|>velocity.js<|end_file_name|><|fim▁begin|>/*! VelocityJS.org (1.2.1). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
/*************************
Velocity jQuery Shim
*************************/
/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @licen... | |
<|file_name|>day09.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
""" 2018 AOC Day 09 """
import argparse
import typing
import unittest
class Node(object):
''' Class representing node in cyclic linked list '''
def __init__(self, prev: 'Node', next: 'Node', value: int):
''' Create a node with... | node = Node(None, None, 0) # type: ignore
node._prev = node
node._next = node |
<|file_name|>string.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016 Boucher, Antoni <bouanto@zoho.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, incl... | *
* The above copyright notice and this permission notice shall be included in all |
<|file_name|>AVComponentCollection.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> * The number of items in the collection.
*/
public readonly length: number;
/**
* Return the item at position index in the collection.
*
* @param index The index of the item to be returned
... | declare namespace OIPF {
export class AVComponentCollection {
/** |
<|file_name|>component_jni_registrar.cc<|end_file_name|><|fim▁begin|>// Copyright 2016 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 "components/spellcheck/browser/android/component_jni_registrar.h"
#include ... | #include "base/android/jni_registrar.h"
#include "components/spellcheck/browser/spellchecker_session_bridge_android.h"
namespace spellcheck { |
<|file_name|>_configuration.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.
# Code genera... | self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs) |
<|file_name|>cite.js<|end_file_name|><|fim▁begin|>// Script by Bo Tranberg
// http://botranberg.dk
// https://github.com/tranberg/citations
//
// This script requires jQuery and jQuery UI
$(function() {
// Inser html for dialog just before the button to open it
var butt = document.getElementById('citations');
... | // Determine number of authors
var numAuthors = 0
for (i=0; i<metas.length; i++) {
if (metas[i].getAttribute("name") == "citation_author") { |
<|file_name|>example_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 someonegg. All rights reserscoreed.
// Use of this source code is goscoreerned by a BSD-style
// license that can be found in the LICENSE file.
package skiplist_test
import (
"fmt"
"github.com/someonegg/gocontainer/skiplist"<|fim▁hole|>
typ... | //"math/rand"
//"time"
) |
<|file_name|>JSONWorldDataHelper.java<|end_file_name|><|fim▁begin|>// --------------------------------------------------------------------------------------------------
// Copyright (c) 2016 Microsoft Corporation
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and... | + sfw.readStat((StatBase)StatList.distanceSwumStat) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.p... | 'requests==2.8.1'
] |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015-2020 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Less... | ($msg:expr) => { };
($fmt:expr, $($arg:tt)+) => { };
} |
<|file_name|>interface.rs<|end_file_name|><|fim▁begin|>// Copyleft (ↄ) meh. <meh@schizofreni.co> | http://meh.schizofreni.co
//
// This file is part of screenruster.
//
// screenruster is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the ... | }
} |
<|file_name|>ConcurrentLinkedQueueExtendsHandler.java<|end_file_name|><|fim▁begin|>package com.mocha.util.queue;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
/**
* <strong>Title : ConcurrentLinkedQueueExtendsHandler <... | * @param c
* collection containing elements to be added to this queue
* @return <tt>true</tt> if this queue changed as a result of the call
|
<|file_name|>lxqt-config-globalkeyshortcuts_ar.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ar">
<context>
<name>DefaultModel</name>
<message>
<location filename="../default_model.cpp" line="51"/>
<source>Command</source>
... | <translation>السلوك عند وجود عدّة إجراءات:</translation>
</message> |
<|file_name|>AverageSlopeToDivide.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2011-2012 Dr. John Lindsay <jlindsay@uoguelph.ca>
*
* 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, ei... | + numUpslopeFlowpaths);
totalFlowpathLength.setValue(y, x,
totalFlowpathLength.getValue(y, x)
+ flowpathLengthToAdd); |
<|file_name|>basic-aliasing.js<|end_file_name|><|fim▁begin|>var Shapes;
(function (Shapes) {
var Polygons;
(function (Polygons) {
var Triangle = (function () {
function Triangle() {
}
return Triangle;
})();
Polygons.Triangle = Triangle;
var Squ... | }
return Square;
})(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-<|fim▁hole|># Filename: lychee/__init__.py
# Purpose: Initialize Lychee.
#
# Copyright (C) 2016, 2017 Christopher Antila
#
# This program is free software: you can redistribute it and/or modi... | #--------------------------------------------------------------------------------------------------
# Program Name: Lychee
# Program Description: MEI document manager for formalized document control
# |
<|file_name|>mesh.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright © 2017 No0n3Left <no0n3left@gmail.com>
*
* This file is part of Remnant
*
* Remnant 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... | |
<|file_name|>IBehaviourTreeBlackboard.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 Rubén Héctor García (raiben@gmail.com)
*
* This program is free software: you can redistribute it and/or modify<|fim▁hole|> * it under the terms of the GNU General Public License as published by
* the Free Software Found... | |
<|file_name|>EntityCacheImpl.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 b... | if (classCache == null) {
classCache = findClassCacheByCheckingSubclasses(entityClass); |
<|file_name|>camera.py<|end_file_name|><|fim▁begin|>"""Support for Axis camera streaming."""
from homeassistant.components.camera import SUPPORT_STREAM
from homeassistant.components.mjpeg.camera import (
CONF_MJPEG_URL,
CONF_STILL_IMAGE_URL,
MjpegCamera,
filter_urllib3_logging,
)
from homeassistant.con... | |
<|file_name|>ExaquteTaskPyCOMPSs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2002-2019 Barcelona Supercomputing Center (www.bsc.es)
#
# 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 th... | |
<|file_name|>ua_handler.js<|end_file_name|><|fim▁begin|>var fs = require('fs'), path = require('path');
var uaList = fs.readFileSync(path.join(__dirname, 'ua.txt'));
uaList = uaList.toString().split('\n');
var OSs = {};
var browsers = {};
var browserVersions = {};
var unknown = [];
var osMatch = {
ios: /iOS|iPhon... | opera_mobile: /opera mini|opera mobi/i,
opera_mini: /opera mini/i,
blackberry: /blackberry/i
}; |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.contrib.flatpages.admin import FlatpageForm, FlatPageAdmin
from django.contrib.flatpages.models import FlatPage
## OOPS this is a custom widget that works for initializing
## tinymce instances on stacked and tabular inlines
... | }
class PageAdmin(FlatPageAdmin): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python<|fim▁hole|># -*- coding: utf-8 -*-
#
# Copyright 2010 TÜBİTAK UEKAE
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt.<|fim▁end|> | |
<|file_name|>BattleGroundHandler.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
*
* 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 versio... | return;
}
|
<|file_name|>collect.py<|end_file_name|><|fim▁begin|># (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import logging
import requests
logger = logging.getLogger(__name__)
def collect_filters(url):
"""Re... | |
<|file_name|>launchtree_loader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
from roslaunch.xmlloader import XmlLoader, loader
from rosgraph.names import get_ros_namespace
from rqt_launchtree.launchtree_context import LaunchtreeContext
class LaunchtreeLoader(XmlLoader):
def _include_tag(self, ta... | if param_file != '':
ros_config.pop_level()
context.add_rosparam(tag.attributes.get('command', 'load'), param_filename, level_name) |
<|file_name|>268-missing-number.py<|end_file_name|><|fim▁begin|>class Solution(object):
def missingNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
xor = len(nums)
for i, n in enumerate(nums):
xor ^= n
xor ^= i
return xor... | s = Solution()
for i in inputs:
print s.missingNumber(i) |
<|file_name|>simple.js<|end_file_name|><|fim▁begin|>const Homeassistant = require('./../index')
// Connect to home-assistant
let ha = new Homeassistant({
host: '192.168.1.166'
})
ha.connect()
.then(() => {
// subscribe to state changes
ha.on('state:media_player.spotify', data => {
console.log(data)
... | }) |
<|file_name|>steamstoreprice.py<|end_file_name|><|fim▁begin|>from steamstoreprice.exception import UrlNotSteam, PageNotFound, RequestGenericError
from bs4 import BeautifulSoup
import requests
class SteamStorePrice:
def normalizeurl(self, url):
"""
clean the url from referal and other stuff
... |
def normalizeprice(self, price):
""" |
<|file_name|>scrape.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
... | |
<|file_name|>test_udp_socket.rs<|end_file_name|><|fim▁begin|>use mio::*;
use mio::udp::*;
use bytes::{Buf, RingBuf, SliceBuf, MutBuf};
use super::localhost;
use std::str;
const LISTENER: Token = Token(0);
const SENDER: Token = Token(1);
pub struct UdpHandler {
tx: UdpSocket,
rx: UdpSocket,
msg: &'static s... |
impl Handler for UdpHandler { |
<|file_name|>build.py<|end_file_name|><|fim▁begin|>from abc import ABC, abstractmethod
from .utils import FileUtils, LoggingUtils
import os
import subprocess
class Build(ABC):
def __init__(self, configuration):
super().__init__()
self.configuration = configuration
@abstractmethod
def bef... | self._revert_git_file(_source_pathname) |
<|file_name|>camera.cpp<|end_file_name|><|fim▁begin|>#include "camera.h"
#include "../window.h"
D3DXMATRIX Camera::GetViewMatrix()
{
if (recalculateViewMatrix)
updateViewMatrix();
return viewMatrix;
}
D3DXMATRIX Camera::GetProjectionMatrix()
{
if (recalculateProjectionMatrix)
updateProjectionMat... | px /= proj._11;//proj matrix actually
|
<|file_name|>005_tle_error.py<|end_file_name|><|fim▁begin|>class Solution(object):
def longestPalindrome(self, s):
max_len = 0
max_str = ''
if len(s) <= 2:
return s
for i, ch in enumerate(s):
delta = 1
count = 0
# center is ch
... | |
<|file_name|>thermal_monitor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# vim: ai:ts=4:sw=4:sts=4:et:fileencoding=utf-8
#
# Thermal monitor
#
# Copyright 2013 Michal Belica <devel@beli.sk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | # |
<|file_name|>jquery.jvectormap.init.js<|end_file_name|><|fim▁begin|>/**
* Theme: Simple Admin Template
* Author: Coderthemes
* VectorMap
*/
! function($) {
"use strict";
var VectorMap = function() {
};
VectorMap.prototype.init = function() {
//various examples
$('#world-map-markers').vectorMap({
map :... | name : 'Antigua and Barbuda'
}, { |
<|file_name|>uu_cases_regular.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from tools.factories import generator_factory
import ctypes
basic_cases = [
[b'%U\n', ctypes.c_long(0)],
[b'% U\n', ctypes.c_long(0)],
[b'%+U\n', ctypes.c_long(0)],
[b'%-U\n', ctypes.c_long(0)],
[b'%0U\n', ctypes... | {
'name': 'U tests - basics.',
'cases': mixed_cases |
<|file_name|>QuantileTransform.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 Transform;
import Objects.TagList;
import java.util... | return m / (float)(m_QuantileVector.size() - 1);
|
<|file_name|>SvgViewBoxFilter.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Requirements
* @ignore
*/
const Filter = require('./Filter.js').Filter;
const PathesConfiguration = require('../../model/configuration/PathesConfiguration.js').PathesConfiguration;
const assertParameter = require('../../utils/assert.j... | return scope.applyCallbacks(result, arguments); |
<|file_name|>reshape.d.ts<|end_file_name|><|fim▁begin|>import { NDArrayMath } from '../../math/math';<|fim▁hole|>import { SummedTensorArrayMap, TensorArrayMap } from '../tensor_array_map';
import { Operation } from './op';
export declare class Reshape<T1 extends NDArray, T2 extends NDArray> extends Operation {
priv... | import { NDArray } from '../../math/ndarray';
import { Tensor } from '../graph'; |
<|file_name|>resize.rs<|end_file_name|><|fim▁begin|>use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::thread;
use crossbeam_channel::Sender;
use signal_hook::iterator::Signals;
/// This starts a new thread to listen for SIGWINCH signals
#[allow(unused)]
pub fn start_resize_thread(
resize... | |
<|file_name|>allcall.py<|end_file_name|><|fim▁begin|>"""
Decode all-call reply messages, with downlink format 11
"""
from pyModeS import common
def _checkdf(func):
"""Ensure downlink format is 11."""
def wrapper(msg):
df = common.df(msg)
if df != 11:
raise RuntimeError(
... | return IC
@_checkdf |
<|file_name|>Cert_5_6_01_NetworkDataRegisterBeforeAttachLeader.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | #!/usr/bin/env python
# |
<|file_name|>test_drive.py<|end_file_name|><|fim▁begin|>import os, sys
import tempfile
import unittest as unittest0
try:
unittest0.skipUnless
unittest0.skip
except AttributeError:
import unittest2 as unittest
else:
unittest = unittest0<|fim▁hole|>
from winsys import fs
class TestDrive (unittest.TestCase):
#... | del unittest0
import win32file |
<|file_name|>celery.py<|end_file_name|><|fim▁begin|>import os
from celery import Celery
from django.apps import apps, AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'confi... |
@app.task(bind=True) |
<|file_name|>marked.js<|end_file_name|><|fim▁begin|>import { RocketChat } from 'meteor/rocketchat:lib';
import { Random } from 'meteor/random';
import _ from 'underscore';
import s from 'underscore.string';
import hljs from 'highlight.js';
import _marked from 'marked';
const renderer = new _marked.Renderer();
let msg... | });
return token; |
<|file_name|>install_py_dlls.hpp<|end_file_name|><|fim▁begin|>/*
This source file is part of KBEngine
For the latest info, see http://www.kbengine.org/
Copyright (c) 2008-2012 KBEngine.
KBEngine is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as publ... | #endif // KBE_INSTALL_PY_DLLS_HPP |
<|file_name|>connectionSizeScript.js<|end_file_name|><|fim▁begin|>$(function() {
$("#childGrid").jqGrid(
{
url : "TBCcnsizePrm.html?getGridData",datatype : "json",mtype : "GET",colNames : [ 'Conn Id',getLocalMessage('water.connsize.frmDt'), getLocalMessage('water.connsize.toDt'), getLocalMessage('water.conns... | |
<|file_name|>instr_extractps.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn extractps_1() {
run_test(&In... | |
<|file_name|>core.go<|end_file_name|><|fim▁begin|>/*
Package core implements the IpfsNode object and related methods.
Packages underneath core/ provide a (relatively) stable, low-level API
to carry out most IPFS-related tasks. For more details on the other
interfaces and how core/... fits into the bigger IPFS picture... | Peerstore pstore.Peerstore // storage for other Peer instances |
<|file_name|>remote_test.go<|end_file_name|><|fim▁begin|>package selenium
import (
"flag"
"fmt"
"net/http"
"strings"
"testing"
)
var grid = flag.Bool("test.grid", false, "skip tests that fail on Selenium Grid")
var executor = flag.String("test.executor", defaultExecutor, "executor URL")
var browserName = flag.St... | url1 := serverURL
wd.Get(url1)
|
<|file_name|>test_artificial_128_None_MovingMedian_12_12_100.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
<|fim▁hole|><|fim▁end|> |
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 12); |
<|file_name|>win_find.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same ... | paths: C:\Temp
get_checksum: yes
checksum_algorithm: sha256
|
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>// Copyright 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
// http://www.apache.org/licenses/L... | |
<|file_name|>gecko.mako.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/. */
// `data` comes from components/style/properties.mako.rs; ... |
if self.gecko.mAnimations[index].mIterationCount.is_infinite() {
AnimationIterationCount::Infinite
} else { |
<|file_name|>solutions.py<|end_file_name|><|fim▁begin|>__problem_title__ = "Maximum Integer Partition Product"
__problem_url___ = "https://projecteuler.net/problem=374"
__problem_description__ = "An integer partition of a number is a way of writing as a sum of " \
"positive integers. Partition... | s = Solution()
print(s.solution1()) |
<|file_name|>turn.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Nathan Harmon
# https://github.com/nharmon/bogie-five
#
# Turn program
#
from Motion import *
import sys
if __name__ == '__main__':<|fim▁hole|> if len(sys.argv) < 2:
exit("Must specify target image file")
try:
drive = Dri... | |
<|file_name|>term_weight.rs<|end_file_name|><|fim▁begin|>use Term;
use query::Weight;
use core::SegmentReader;
use query::Scorer;
use postings::SegmentPostingsOption;<|fim▁hole|>use Result;
pub struct TermWeight {
pub num_docs: u32,
pub doc_freq: u32,
pub term: Term,
pub segment_postings_options: Segme... | use postings::SegmentPostings;
use super::term_scorer::TermScorer; |
<|file_name|>feed_save.js<|end_file_name|><|fim▁begin|>// Render home page and json data
<|fim▁hole|> // Import json data
var logData = require("../data/log.json");
// Set ateFoodGroup to numerical values
var ateGrains;
if(req.body.ateGrains == null){ateGrains = 0;}
else ateGrains = 1;
var ateFruit;
if(req.b... | exports.view = function(req, res){ |
<|file_name|>logging.py<|end_file_name|><|fim▁begin|>import logging.handlers
import os
_pabotlog = logging.getLogger('PABot')
_pabotlog.setLevel(logging.DEBUG)
_logPath = os.path.abspath("./logging/pabot.log")
_formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s')
_consoleStreamHand... |
def LogPABotError(message):
_pabotlog.error(message) |
<|file_name|>CUtils.java<|end_file_name|><|fim▁begin|>/*
*
*/
package org.utilities;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executor... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(asm)]
#![feature(const_fn)]
#![feature(proc_macro)]
#![no_std]
extern crate cast;
extern crate cortex_m;
extern crate cortex_m_rtfm as rtfm;
extern crate blue_pill;
extern crate numtoa;
use blue_pill::stm32f103xx::Interrupt;
use cortex_m::peripheral::SystCl... |
use mma8652fc::MMA8652FC;
use ssd1306::SSD1306;
use state::{ConfigPage, Keys, State, StateMachine}; |
<|file_name|>compare_the_triplets.py<|end_file_name|><|fim▁begin|>#!/bin/python3
import sys<|fim▁hole|> alist = [a0, a1, a2]
blist = [b0, b1, b2]
clist = zip(alist, blist)
for pair in clist:
if pair[0] > pair[1]:
score[0] += 1
elif pair[0] < pair[1]:
score[1] += 1... |
def solve(a0, a1, a2, b0, b1, b2):
score = [0, 0] |
<|file_name|>PageUnderConstruction.js<|end_file_name|><|fim▁begin|>import React from 'react';<|fim▁hole|>export default () => {return <h1>Page Under Construction</h1>}<|fim▁end|> | |
<|file_name|>vendor_only_svd.py<|end_file_name|><|fim▁begin|># Put libraries such as Divisi in the PYTHONPATH.
import sys, pickle, os
sys.path = ['/stuff/openmind'] + sys.path
from csc.divisi.cnet import *
from csc.divisi.graphics import output_svg
from vendor_db import iter_info
from csamoa.corpus.models import *
from... | return False
|
<|file_name|>modules.js<|end_file_name|><|fim▁begin|>/*Generated by KISSY Module Compiler*/
config({<|fim▁hole|><|fim▁end|> | 'editor/plugin/unordered-list': {requires: ['editor','editor/plugin/list-utils/btn']}
}); |
<|file_name|>cache_test.rs<|end_file_name|><|fim▁begin|>use super::*;
use envmnt;
use std::env;
use std::path::PathBuf;
#[test]
fn load_from_path_exists() {
let cwd = env::current_dir().unwrap();
let path = cwd.join("examples/cargo-make");
let cache_data = load_from_path(path);
assert_eq!(cache_data.l... | |
<|file_name|>ScheduleProvider.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010 Google 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/... | case VENDORS_SEARCH: {
final String query = Vendors.getSearchQuery(uri);
return builder.table(Tables.VENDORS_SEARCH_JOIN_VENDORS_TRACKS) |
<|file_name|>CodersStrikeBack.java<|end_file_name|><|fim▁begin|>package com.basicalgorithms.coding_games;
import java.util.HashSet;
import java.util.Objects;
import java.util.Scanner;
import java.util.Set;
/**
* Original question: https://www.codingame.com/multiplayer/bot-programming/coders-strike-back
*/
public cl... | from = lastCheckpoint;
}
lastCheckpoint = nextCheckpoint;
} |
<|file_name|>itemmeasures2lineitems.py<|end_file_name|><|fim▁begin|>import sys
sentid_prev = 0
first_line = True
first_word = True<|fim▁hole|> word_ix = row.index('word')
sentid_ix = row.index('sentid')
first_line = False
else:
word = row[word_ix]
sentid = row[sentid_ix]
... |
for line in sys.stdin:
row = line.strip().split()
if first_line: |
<|file_name|>sepcomp-extern.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/... | |
<|file_name|>0013_add_law_merged_into.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Law.merged_into'
db.... | 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'})
},
'mks.party': { |
<|file_name|>automata.rs<|end_file_name|><|fim▁begin|>use automata::{M, State, StateSet, Alphabet, Delta, to_delta};
use automata_min::minify;
use automata_operators::afndl_to_afd;
fn prefix_state(prefix: &String, s: &State) -> String {
let mut name: String = prefix.clone();
name.push_str(s);
name
}
fn p... |
let m_actual = prefix_automata(&"A".to_string(), &m); |
<|file_name|>Command.java<|end_file_name|><|fim▁begin|>package patterns.behavioral.command;
// General interface for all the commands
public abstract class Command {
public abstract void execute();<|fim▁hole|><|fim▁end|> | } |
<|file_name|>assets.py<|end_file_name|><|fim▁begin|>"""
Asset compilation and collection.
"""
from __future__ import print_function
import argparse
from paver.easy import sh, path, task, cmdopts, needs, consume_args, call_task
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandl... |
def coffeescript_files():
""" |
<|file_name|>step_create_instance.go<|end_file_name|><|fim▁begin|>package ecs
import (
"context"
"encoding/base64"
"fmt"
"io/ioutil"
"strconv"
"github.com/hashicorp/packer/common/uuid"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
"github.com/al... | instances, err := client.DescribeInstances(describeInstancesRequest)
if err != nil {
return halt(state, err, "") |
<|file_name|>glusterfs.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 Red Hat, 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
#
# http://ww... | self._mounted_shares.append(share) |
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|># file test_fedora/test_models.py
#
# Copyright 2011 Emory University Libraries
#
# 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 a... | self.assertEqual(None, self.obj.image._raw_content())
self.assertFalse(self.obj.image.isModified(),
"isModified should return False for image datastream after it has been saved")
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub(crate) mod inner;
mod port;<|fim▁hole|>mod io;
pub mod buffer;
pub use self::port::*;
pub use self::io::*;<|fim▁end|> | |
<|file_name|>demo8.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributio... |
if __name__ == "__main__": |
<|file_name|>signal_linux_arm.go<|end_file_name|><|fim▁begin|>// Copyright 2013 The Go 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 runtime
import (
"runtime/internal/sys"
"unsafe"
)
type sigctxt struct {
info *siginf... | func (c *sigctxt) r4() uint32 { return c.regs().r4 }
func (c *sigctxt) r5() uint32 { return c.regs().r5 }
func (c *sigctxt) r6() uint32 { return c.regs().r6 }
func (c *sigctxt) r7() uint32 { return c.regs().r7 } |
<|file_name|>latex_codec.py<|end_file_name|><|fim▁begin|>"""latex.py
Character translation utilities for LaTeX-formatted text.
Usage:
- unicode(string,'latex')
- ustring.decode('latex')
are both available just by letting "import latex" find this file.
- unicode(string,'latex+latin1')
- ustring.decode('latex+latin... | yield delta+2,c
elif t == '\\mbox':
for delta,c in self.candidates(offset+1): |
<|file_name|>issue-2526-a.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/li... |
// xfail-fast
// aux-build:issue-2526.rs |
<|file_name|>Parameter.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 Global Biodiversity Information Facility (GBIF)
*
* 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
*
* htt... | |
<|file_name|>decrementOperatorWithUnsupportedBooleanType.ts<|end_file_name|><|fim▁begin|>// -- operator on boolean type
var BOOLEAN: boolean;
function foo(): boolean { return true; }
class A {
public a: boolean;
static foo() { return true; }
}
module M {
export var n: boolean;
}
var objA = new A();
// b... | |
<|file_name|>schema.go<|end_file_name|><|fim▁begin|>package ignition
// This schema structure is based on github.com/coreos/ignition/config/v2_2/types/schema.go
// Due to issue with unmarshalling embedded anonymous nested structures,
// this file removes such structures.
// Changed types: Directory, File, Link.
type C... | type Link struct {
Filesystem string `json:"filesystem,omitempty" yaml:"filesystem,omitempty"`
Group *NodeGroup `json:"group,omitempty" yaml:"group,omitempty"` |
<|file_name|>base_noeud.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source c... | def afficher(self, personnage=None):
"""Retourne un affichage du masque pour les joueurs.""" |
<|file_name|>reftypes.py<|end_file_name|><|fim▁begin|># ------------------------------------------------------------------------------
# Copyright (c) 2010-2013, EVEthing team
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the fo... | if new:
RefType.objects.bulk_create(new)
return True |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
from setuptools import setup, find_packages
import streamkinect2.version as meta
# Utility function to read the README file.
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = me... | "Development Status :: 3 - Alpha", |
<|file_name|>dependency-injection.js<|end_file_name|><|fim▁begin|>/*! MVW-Injection (0.2.5). (C) 2015 Xavier Boubert. MIT @license: en.wikipedia.org/wiki/MIT_License */
(function(root) {
'use strict';
var DependencyInjection = new (function DependencyInjection() {
var _this = this,
_interfaces = {};
... | |
<|file_name|>gdcvault.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
HEADRequest,
sanitized_Request,
urlencode_postdata,
)
class GDCVaultIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?gdcvault\.com/play/... | 'title': 'How to Create a Good Game - From My Experience of Designing Pac-Man',
}, |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This program is free software; you can redistribute it and/or<|fim▁hole|>#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PA... | # modify 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. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.