prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>init_project.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script can generate automate scripts for open source python project.
Scroll to ``if __name__ == "__main__":`` for more info.
"""
from __future__ import print_function
import sys
import datetime
from os im... | author_name = "Sanhe Hu" # IMPORTANT |
<|file_name|>sub_photo_instance_model.js<|end_file_name|><|fim▁begin|>App.SubPhotoInstance = DS.Model.extend({<|fim▁hole|> height: DS.attr('number'),
url: DS.attr('string'),
type: 'sub_photo_instance'
});<|fim▁end|> | width: DS.attr('number'), |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate tcod;
extern crate rand;
use std::cmp;
use tcod::console::*;
use tcod::colors::{self, Color};
use rand::Rng;
// Actual size of the window
const SCREEN_WIDTH: i32 = 80;
const SCREEN_HEIGHT: i32 = 50;
// Size of the map in the window
const MAP_WIDTH: i32 ... | for _ in 0..MAX_ROOMS { |
<|file_name|>test_serial.py<|end_file_name|><|fim▁begin|>"""
Tests for serial.py.
"""
import cPickle
from cStringIO import StringIO
import gzip
import shutil
import tempfile
import unittest
from rdkit import Chem
from rdkit.Chem import AllChem
from vs_utils.utils.rdkit_utils import conformers, serial
class TestMolI... | mols = list(mols) |
<|file_name|>validation.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { IContainer } from '../../../../../model/IContainer';
<|fim▁hole|>import { ElementValidatorBase } from '../../../../../validation/element-validato... | import { FieldMetaItem, MetaInfo } from '../../../../../model/meta/field-meta';
|
<|file_name|>WorldSocket.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2014 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 version 3 of... | ACE_Data_Block db (sizeof (buf),
ACE_Message_Block::MB_DATA,
buf, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import excmem
def pyasm(scope,s):
cp = codePackageFromFile(cStringIO.StringIO(s),PythonConstants)
mem = CpToMemory(cp)
mem.MakeMemory()
mem.BindPythonFunctions(scope)<|fim▁end|> | from x86asm import codePackageFromFile
from x86cpToMemory import CpToMemory
from pythonConstants import PythonConstants
import cStringIO |
<|file_name|>string_serde_test.py<|end_file_name|><|fim▁begin|># syft absolute
import syft as sy
from syft.lib.python.string import String
from syft.proto.lib.python.string_pb2 import String as String_PB
def test_string_serde() -> None:
syft_string = String("Hello OpenMined")
serialized = syft_string._object... | # Check pointer type |
<|file_name|>ufcs-explicit-self-bad.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.apa... | }
}
struct Bar<T> { |
<|file_name|>spherical_harmonics.py<|end_file_name|><|fim▁begin|>import numpy as np
from scipy.special import sph_harm, lpmv
try:
from scipy.misc import factorial
except:
from scipy.special import factorial
def sh(l, m, theta, phi, field='real', normalization='quantum', condon_shortley=True):
if field == '... | # Get the CSH for m and -m, using Condon-Shortley phase (regardless of whhether CS is requested or not) |
<|file_name|>common.js<|end_file_name|><|fim▁begin|>! (function($){
$(function(){
if ($('.haik-config-menu').length){
$('.haik-admin-navbar-inside').prepend('<a class="navbar-brand pull-right" href="#haik_config_slider" id="config_slider_link"><img src="haik-contents/img/haiklogo.png" height="50"></a>'... | |
<|file_name|>Test_ExecutorDispatcher.py<|end_file_name|><|fim▁begin|>""" py.test test of ExecutorDispatcher
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=protected-access
__RCSID__ = "$Id$"
from DIRAC.Core.Utilities.ExecutorDispatc... |
def test_ExecutorState(): |
<|file_name|>production.py<|end_file_name|><|fim▁begin|>from decouple import Csv, config
from dj_database_url import parse as db_url
from .base import * # noqa
DEBUG = False
SECRET_KEY = config('SECRET_KEY')
DATABASES = {
'default': config('DATABASE_URL', cast=db_url),
}
DATABASES['default']['ATOMIC_REQUESTS'... | X_FRAME_OPTIONS = 'DENY'
CSRF_COOKIE_HTTPONLY = True |
<|file_name|>enumeration.rs<|end_file_name|><|fim▁begin|>use crate::model::create::{CreateError, CreateResult};
use crate::model::enumeration::Enumeration;
use crate::model::symbol::Symbol;
use crate::model::Def;
use crate::xsd::restriction::Facet;
use crate::xsd::simple_type::{Payload, SimpleType};
use crate::xsd::{si... | Ok(Some(vec![Def::Enumeration(enm)])) |
<|file_name|>test_credential.py<|end_file_name|><|fim▁begin|>import itertools
import re
import mock # noqa
import pytest
from awx.main.models import (AdHocCommand, Credential, CredentialType, Job, JobTemplate,
Inventory, InventorySource, Project,
WorkflowJobNo... | |
<|file_name|>elasticbeanstalk.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "elasticbeanstalk")]
extern crate rusoto;
use rusoto::elasticbeanstalk::{ElasticBeanstalk, ElasticBeanstalkClient,
DescribeApplicationsMessage};
use rusoto::{DefaultCredentialsProvider, Region};
use rusoto::d... | } |
<|file_name|>level3_model.py<|end_file_name|><|fim▁begin|>from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import xgboost as xgb
import argparse
from os import path
import os
from hyperopt import fmin... |
with open(path.join(save_dir, 'param.pkl'), 'wb') as f_param: |
<|file_name|>app.ts<|end_file_name|><|fim▁begin|>//Question class w/constructor
class Question {
constructor(public ask: string,
public answerChoiceA: string,
public answerChoiceB: string,
public answerChoiceC: string,
public correctAnswer: string,
public points: number = 20)... | alert(`Oops... wrong answer.
Hit "OK" to try again. |
<|file_name|>NoMoreTextException.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012 M. M. Naseri <m.m.naseri@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this<|fim▁hole|> * conditions:
*
* The above copyright notice and this permission notice shall be includ... | * software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do s... |
<|file_name|>test_artificial_128_Logit_MovingAverage_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|>
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "MovingAverage", cycle_length = 12, transform = "Logi... | |
<|file_name|>Font.cpp<|end_file_name|><|fim▁begin|>// Font.cpp: ActionScript Font handling, for Gnash.
//
// Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software
// Foundation, Inc
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public Licen... | |
<|file_name|>base-platform.ts<|end_file_name|><|fim▁begin|>import { ExecuteInCurrentWindow, Inject, mutation, StatefulService } from 'services/core';<|fim▁hole|> TPlatformCapability,
TStartStreamOptions,
TPlatformCapabilityMap,
} from './index';
import { StreamingService } from 'services/streaming';
import { UserS... | import {
EPlatformCallResult,
IPlatformState,
TPlatform, |
<|file_name|>RealmList.cpp<|end_file_name|><|fim▁begin|>/*
* This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information
*
* 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 ... | realm.realmflags = realmflags;
realm.timezone = timezone;
|
<|file_name|>base.py<|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/.
import json
import logging
import platform
from os.path import abspath... | LOGGING_CONFIG = None
# CEF Logging
CEF_PRODUCT = 'Bedrock' |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>#from actstream import action
from django.contrib.auth import get_user_model
from django.db.models.signals import post_save
from django.core.exceptions import ObjectDoesNotExist
from django.dispatch import receiver
from profiles.models import Organisation, Organisati... | Create a new organisation group for the new Organisation |
<|file_name|>MoviesImplWrapper.java<|end_file_name|><|fim▁begin|>package any.ejbtest;
import com.dms.Discriminated;
import java.util.List;
/**
* MoviesImplEjb, 02.03.2015
*
* Copyright (c) 2014 Marius Dinu. All rights reserved.
*
* @author mdinu
* @version $Id$
*/
//@Named
@Discriminated(isResultAggregated = ... | public class MoviesImplWrapper implements Movies {
|
<|file_name|>integration_test.rs<|end_file_name|><|fim▁begin|>mod cli;
#[test]<|fim▁hole|>fn cli_help() {
let out = cli::run(vec!["--help"]).expect("--help failed");
assert_eq!(out.status, 0);
assert!(out.stdout.len() > 0);
assert!(out.stdout.contains("USAGE"));
assert!(out.stderr.is_empty());
}<|f... | |
<|file_name|>if-branch-types.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option.... | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at |
<|file_name|>logger.py<|end_file_name|><|fim▁begin|>import logging
def init_logger():<|fim▁hole|> formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s [in %(pathname)s:%(lineno)d]')
logger = logging.getLogger('redberry')
logger.setLevel(logging.DEBUG)
console = logging.StreamHandler... | |
<|file_name|>reaction.rs<|end_file_name|><|fim▁begin|>use data_sef::*;
use ion::Ion;
use molecule::Molecule;
use trait_element::Element;
use trait_properties::Properties;
use trait_reaction::Reaction;
use types::*;
use std::collections::HashMap;
use std::hash::*;
use std::mem;
use std::ops::*;
#[derive(Debug, Eq, Par... | } |
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import styled from '@emotion/styled';
import space from 'app/styles/space';
import {getListSymbolStyle, listSymbol} from './utils';
type Props = {
children: Array<React.ReactElement>;
symbol?: keyof typeof listSymbol | React.ReactElem... | } |
<|file_name|>RunCommand.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * Copyright (C) 2015. Chris Lutte
*
* 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 License, o... | /*
* Ipsum is a rapid development API for Minecraft, developer by Relicum |
<|file_name|>TravelRecommendation_faster.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
Copyright 2015 Ericsson AB
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/lic... | lat_normalizer(x3), lon_normalizer(x4),
time_normalizer(x5), time_normalizer(x6), |
<|file_name|>kernel_darwin.go<|end_file_name|><|fim▁begin|>//go:build darwin
// +build darwin
// Package kernel provides helper function to get, parse and compare kernel
// versions for different platforms.
package kernel // import "github.com/docker/docker/pkg/parsers/kernel"
import (
"fmt"
"os/exec"
"strings"
)<... | |
<|file_name|>clear_posts_same.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
# __author__ = chenchiyuan
from __future__ import division, unicode_literals, print_function
from django.core.management import BaseCommand
from applications.posts.models import Post
class Command(BaseCommand):
def ... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class MailgunException(Exception):
pass<|fim▁end|> | |
<|file_name|>myLibs.js<|end_file_name|><|fim▁begin|><|fim▁hole|> this.add = function(id, value){
if( id )
this.client[id] = value;
else
throw "Não da pra adicionar um valor [ " + id + " ] ao dicionario hash;";
}
this.remove = function(id){
delete thi... | function ConnectionList(){
this.client = {};
|
<|file_name|>test_cts_collection_inheritance.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
from MyCapytain.resources.collections.cts import XmlCtsTextInventoryMetadata, XmlCtsTextgroupMetadata, XmlCtsWorkMetadata, XmlCtsEditionMetadata, XmlCtsTranslationMetadata<|fim▁hole|> SENECA = f.read()
class ... | from MyCapytain.resources.prototypes.cts.inventory import CtsTextgroupMetadata
with open("tests/testing_data/examples/getcapabilities.seneca.xml") as f: |
<|file_name|>test_methodbinder1.py<|end_file_name|><|fim▁begin|>#####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the... | |
<|file_name|>Range.java<|end_file_name|><|fim▁begin|>package excelcom.api;
import com.sun.jna.platform.win32.COM.COMException;
import com.sun.jna.platform.win32.COM.COMLateBindingObject;
import com.sun.jna.platform.win32.COM.IDispatch;
import com.sun.jna.platform.win32.OaIdl;
import com.sun.jna.platform.win32.OleAuto;... | int getColorIndex() {
Variant.VARIANT colorIndex = this.invoke("ColorIndex");
if(colorIndex.getVarType().intValue() == VT_NULL) { |
<|file_name|>committees.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import re
import lxml.html
from billy.scrape.committees import CommitteeScraper, Committee
from openstates.utils import LXMLMixin
class NYCommitteeScraper(CommitteeScraper, LXMLMixin):
jurisdiction = "ny"
latest_only = True
d... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># This module is free software. You can redistribute it and/or modify it under
# the terms of the MIT License, see the file COPYING included with this
# distribution.
from __future__ import division
"""
main.py -- main program of motif sequence coverage pipeline tool... | print 'jobId:', args.jid,'configfile:', args.confFile |
<|file_name|>SwRegInfo.java<|end_file_name|><|fim▁begin|>package ru.mail.parking.sw2.system;
import com.sonyericsson.extras.liveware.aef.registration.Registration;
import com.sonyericsson.extras.liveware.extension.util.ExtensionUtils;
import com.sonyericsson.extras.liveware.extension.util.registration.RegistrationInfo... |
@Override
public boolean isDisplaySizeSupported(int width, int height) { |
<|file_name|>test_tir_transform_simplify.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to y... | s_init = te.compute((1,), lambda _: tvm.tir.const(0, "int32"))
s_update = te.compute((m + 1,), lambda l: s_state[l - 1] + X[l - 1]) |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ord;<|fim▁hole|>fn chop<T: Ord>(item : T, slice : &[T]) -> i32 {
let length = slice.len();
// Catch empty slices
if length < 1 {
return -1;
}
let mut width = length;
let mut low = 0;
while width > 0 {
let mid_i... | use std::cmp::Ordering::{Less, Equal, Greater};
|
<|file_name|>win32_ops.hpp<|end_file_name|><|fim▁begin|>//
// Boost.Process
//
// Copyright (c) 2006 Julio M. Merino Vidal.
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt.)
//
//!
//! \file boost/p... | # error "Unsupported platform."
#endif
|
<|file_name|>adaptive_play_bot.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class AdaptivePlayBot(HumanBot):
def __init(self):
pass<|fim▁end|> | from human_bot import HumanBot |
<|file_name|>test_client_utils.py<|end_file_name|><|fim▁begin|>from .testlib import TestCase
import argparse
import logging
import os.path
import re
import unittest
from resync.client_utils import init_logging, count_true_args, parse_links, parse_link, parse_capabilities, parse_capability_lists, add_shared_misc_option... | 'a': 'd', 'href': 'h', 'rel': 'u'}) # desired?? |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.conf.urls import url
from plans.views import CreateOrderView, OrderListView, InvoiceDetailView, AccountActivationView, \
OrderPaymentReturnView, CurrentPlanView, UpgradePlanView, OrderView, BillingInfoRedirectView, \
... | PricingView, FakePaymentsView
urlpatterns = [
url(r'^pricing/$', PricingView.as_view(), name='pricing'), |
<|file_name|>start.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import xmlrpc.client
from time import sleep
def remoteCall(func, *args):
try:
ret = func(*args)
return ret<|fim▁hole|>server = xmlrpc.client.ServerProxy("https://localhost:8080", allow_none=True)
sid = remoteCall(server.login, "dj... | except xmlrpc.client.Fault as e:
print(e)
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2016, Met Office
#
# This file is part of Biggus.
#
# Biggus is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either ve... | # You should have received a copy of the GNU Lesser General Public License
# along with Biggus. If not, see <http://www.gnu.org/licenses/>. |
<|file_name|>thread-local-in-ctfe.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org... | // file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT. |
<|file_name|>domrectlist.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::DOMRectListBinding;... | None
} |
<|file_name|>f07.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/LI... | pub fn pat_vec_7() { |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>{% extends 'setup.py.jj2' %}
{%block platform_block%}
{%endblock%}
{%block additional_keywords%}
"plain",
"simple",
"grid",
"pipe",
"orgtbl",
"rst",<|fim▁hole|> "latex_booktabs",
"html",
"json"
{%endblock%}<|fim▁end|> | "mediawiki",
"latex", |
<|file_name|>kindck-copy.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/lic... | |
<|file_name|>air_quality.py<|end_file_name|><|fim▁begin|>"""Support for the Airly air_quality service."""
from homeassistant.components.air_quality import (
ATTR_AQI,
ATTR_PM_2_5,
ATTR_PM_10,
AirQualityEntity,
)
from homeassistant.const import CONF_NAME
from .const import (
ATTR_API_ADVICE,
ATT... | LABEL_PM_2_5_LIMIT = f"{ATTR_PM_2_5}_limit"
LABEL_PM_2_5_PERCENT = f"{ATTR_PM_2_5}_percent_of_limit"
LABEL_PM_10_LIMIT = f"{ATTR_PM_10}_limit" |
<|file_name|>macro-interpolation.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... |
) |
<|file_name|>walletunlock.py<|end_file_name|><|fim▁begin|><|fim▁hole|>access = ServiceProxy("http://127.0.0.1:52398")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)<|fim▁end|> | from jsonrpc import ServiceProxy |
<|file_name|>socket_multiplexer_test.py<|end_file_name|><|fim▁begin|># Copyright 2011-2013 Colin Scott
# Copyright 2011-2013 Andreas Wundsam
#
# Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|># you may not use this file except in compliance with the License.
# You may obtain a copy of the Li... | |
<|file_name|>h4.news.py<|end_file_name|><|fim▁begin|><|fim▁hole|> 'currentLabel': 'up',
'progress_mc': {'currentLabel': '_0'}}}<|fim▁end|> | {'level_mc': {'_txt': {'text': '6'}, |
<|file_name|>eab-api.js<|end_file_name|><|fim▁begin|>/* ----- Login with Fb/Tw ----- */
(function ($) {
function rsvp_after_wordpress_login (data) {
var status = 0;
try { status = parseInt(data.status, 10); } catch (e) { status = 0; }
if (!status) { // ... handle error
//update error by Hoang
if ($("#eab-wordpr... | "action": "eab_get_form", |
<|file_name|>coin_play.py<|end_file_name|><|fim▁begin|># Consider a row of n coins of values v1 . . . vn, where n is even.
# We play a game against an opponent by alternating turns. In each turn,
# a player selects either the first or last coin from the row, removes it
# from the row permanently, and receives the value... | right_choose = coins[r] + min(find_max_val_recur(coins,l + 1,r-1),find_max_val_recur(coins,l,r-2))
return max(left_choose,right_choose) |
<|file_name|>RequestAdministrationPermissionEvent.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012 OBiBa. All rights reserved.
*
* This program and the accompanying materials
* are made available under the terms of the GNU Public... | private final HasAuthorization authorization; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Social content items: messages aka status updates, private messages, etc."""
from __future__ import annotations
import re
from sqlalchemy.orm import relationship
from sqlalchemy.orm.query import Query
from sqlalchemy.schema import Column, ForeignKey
from sqlalche... | __exportable__ = __editable__ + [ |
<|file_name|>stackedlayout.ts<|end_file_name|><|fim▁begin|>/*-----------------------------------------------------------------------------
| Copyright (c) 2014-2015, S. Chris Colbert
|
| Distributed under the terms of the BSD 3-Clause License.
|
| The full license is in the file LICENSE, distributed with this software.... | |
<|file_name|>template.go<|end_file_name|><|fim▁begin|>package command
<|fim▁hole|>
"github.com/atsaki/golang-cloudstack-library"
"github.com/atsaki/lockgate"
"github.com/atsaki/lockgate/cli"
)
var (
TemplateList = cli.Command{
Name: "list",
Help: "List templates",
Args: []cli.Argument{
cli.Argument{
N... | import (
"fmt"
"log" |
<|file_name|>DealSharpProperties.java<|end_file_name|><|fim▁begin|>package cn.xishan.oftenporter.porter.core.init;
import cn.xishan.oftenporter.porter.core.advanced.IConfigData;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import java.util.regex.Matche... | {
String rs; |
<|file_name|>capsule_capsule_manifold_generator.rs<|end_file_name|><|fim▁begin|>use crate::math::Isometry;
use crate::pipeline::narrow_phase::{
ContactDispatcher, ContactManifoldGenerator, ConvexPolyhedronConvexPolyhedronManifoldGenerator,
};
use crate::query::{ContactManifold, ContactPrediction, ContactPreprocesso... | } else {
false
}
} |
<|file_name|>check.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Checks/fixes are bundled in one namespace."""
import logging
from rdflib.namespace import RDF, SKOS
from .rdftools.namespace import SKOSEXT
from .rdftools import localname, find_prop_overlap
def _hierarchy_cycles_visit(rdf, node, parent, b... | "Eliminating redundant hierarchical relationship: " |
<|file_name|>1A - Theatre Square.py<|end_file_name|><|fim▁begin|>from math import *
<|fim▁hole|>m = int(spl[1])
a = int(spl[2])
i = int(ceil(n * 1.0 / a))
j = int(ceil(m * 1.0 / a))
print max(1, i * j)<|fim▁end|> | inp = raw_input()
spl = inp.split()
n = int(spl[0]) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from base64 import b64encode, b64decode
import datetime
import copy
import json
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound, HttpRes... | out = dict()
out['last_cursor'] = last_id
out_items = list() |
<|file_name|>compiler.py<|end_file_name|><|fim▁begin|>import unittest, re
from rexp.compiler import PatternCompiler
class CompilerTestMethods(unittest.TestCase):
def test_compile_1(self):
compiler = PatternCompiler(pattern_set=dict(
TEST=r'\w+'
))
try:
c1 = compile... | |
<|file_name|>test_disconnect_host_volume_create_negative1.py<|end_file_name|><|fim▁begin|>import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.volume_operations as vol_ops
import zstackwoodpecker.test_util as ... | disconnect = False |
<|file_name|>slope_histogram_cumulative_graph.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#/******************************************************************************
# * $Id$
# *
# * Project: GDAL Make Histogram and Cumulative graph from Tab delimited tab as
# generated by gdal_hist.py
#... |
#calculate unscaled values
#df.value = (df.value * 5) - 0.2
#df.ix[df.value < 0] = 0; df |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>import math
import os
import re
import itertools
from types import LambdaType
import pkg_resources
import numpy
from PyQt4 import QtGui, QtCore, QtWebKit
from PyQt4.QtCore import Qt, pyqtSignal as Signal
from PyQt4.QtGui import QCursor, QApplication
import Orange.data... | for i, lab in enumerate(btnLabels): |
<|file_name|>zeroconf.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"log"
"os"
"strings"
"github.com/grandcat/zeroconf"
)<|fim▁hole|> zeroConfName = "Omxremote"
zeroconfService = "_omxremote._tcp"
zeroconfDomain = "local."
zeroconfPort = 8080
)
func startZeroConfAdvertisement(stop chan b... |
var ( |
<|file_name|>streams.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from django.contrib.contenttypes.models import ContentType
from actstream.managers import ActionManager, stream
class MyActionManager(ActionManager):<|fim▁hole|>
@stream
def testfoo(self, object, time=None):
if time i... | |
<|file_name|>voice.go<|end_file_name|><|fim▁begin|>package enums
import (
"encoding/json"
"fmt"
)
type VoiceType int
const (
VoiceType_FM VoiceType = iota
VoiceType_PCM
VoiceType_AL
)
func (t VoiceType) String() string {
s := "unknown"
switch t {
case 0:
s = "FM"
case 1:
s = "PCM"
case 2:
s = "AL"
... |
const ( |
<|file_name|>revisions_test.rs<|end_file_name|><|fim▁begin|>extern crate gitters;
use gitters::objects;
use gitters::revisions;
#[test]
fn full_sha1_resolves_to_self() {
assert_eq!(
Ok(objects::Name("4ddb0025ef5914b51fb835495f5259a6d962df21".to_string())),
revisions::resolve("4ddb0025ef5914b51fb83... | fn multiple_parent_specification_resolves_to_ancestor_sha1() {
assert_eq!(
Ok(objects::Name("3e6a5d72d0ce0af8402c7d467d1b754b61b79d16".to_string())), |
<|file_name|>source.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Rust-GNOME Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
//! Manages available sources of even... | } |
<|file_name|>cache_lru_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Xorm 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 xorm
import (
"testing"
"github.com/go-xorm/core"
"github.com/stretchr/testify/assert... | type CacheObject1 struct {
Id int64 |
<|file_name|>impack_test.go<|end_file_name|><|fim▁begin|>// ImPack - CSS sprites maker
// Copyright (C) 2012 Dmitry Bratus
//
// 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 ... | func TestMakePlacements(t *testing.T) {
pivot := image.Rect(3, 3, 6, 6)
rect := image.Rect(0, 0, 2, 2) |
<|file_name|>LoadableFragment.java<|end_file_name|><|fim▁begin|>package com.wangdaye.common.base.fragment;
import com.wangdaye.common.base.activity.LoadableActivity;
import java.util.List;
/**
* Loadable fragment.
* */
public abstract class LoadableFragment<T> extends MysplashFragment {
<|fim▁hole|> * */
... | /**
* {@link LoadableActivity#loadMoreData(List, int, boolean)}. |
<|file_name|>send-message-suggested-action-dial.py<|end_file_name|><|fim▁begin|>## Copyright 2022 Google LLC
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## https://www.apache.o... | |
<|file_name|>xdg.rs<|end_file_name|><|fim▁begin|>//! XDG Output advertising capabilities
//!
//! This protocol is meant for describing outputs in a way
//! which is more in line with the concept of an output on desktop oriented systems.
use std::{
ops::Deref as _,
sync::{Arc, Mutex},
};
use slog::{o, trace};
... | |
<|file_name|>da.js<|end_file_name|><|fim▁begin|>videojs.addLanguage("da",{
"Play": "Afspil",
"Pause": "Pause",
"Current Time": "Aktuel tid",<|fim▁hole|> "Loaded": "Indlæst",
"Progress": "Status",
"Fullscreen": "Fuldskærm",
"Non-Fullscreen": "Luk fuldskærm",
"Mute": "Uden lyd",
"Unmuted": "Med lyd",
"Playback R... | "Duration Time": "Varighed",
"Remaining Time": "Resterende tid",
"Stream Type": "Stream-type",
"LIVE": "LIVE", |
<|file_name|>helper.py<|end_file_name|><|fim▁begin|>import re
import os, sys
import json
import csv
import shutil
import ctypes
import logging
import datetime
import fileinput
import subprocess
import xml.etree.ElementTree as etree
DEFAULT_HELPER_PATH = "helper"
class Logger(object):
def __init__(s... | kernel32 = ctypes.windll.kernel32
handle = kernel32.OpenProcess(1, 0, p.pid)
return (0 != kernel32.TerminateProcess(handle, 0))
|
<|file_name|>_visible.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="visible", parent_name="heatmapgl", **kwargs):
super(VisibleValidator, self).__init__(
plotly_name=... | values=kwargs.pop("values", [True, False, "legendonly"]),
**kwargs
) |
<|file_name|>tracker_runner.go<|end_file_name|><|fim▁begin|>package builds
import (
"os"
"time"
"github.com/pivotal-golang/clock"
)
//go:generate counterfeiter . BuildTracker
type BuildTracker interface {
Track()
}
type TrackerRunner struct {
Tracker BuildTracker
Interval time.Duration
Clock clock.Clock... | |
<|file_name|>mocks.ts<|end_file_name|><|fim▁begin|>import { MenuItem } from './menu-item-model'; //importo la classe MenuItem così posso usarla qui dentro
export const MENUITEMS: MenuItem[] = [ //esporto un oggetto costante di tipo MenuItem[] che si chiama MENUITEM che contiene
{ //tutte le proprietà degl... | path: "waterplant" |
<|file_name|>clear_page_response.rs<|end_file_name|><|fim▁begin|>use azure_sdk_core::RequestId;
use chrono::{DateTime, Utc};
response_from_headers!(ClearPageResponse,
etag_from_headers -> etag: String,
last_modified_from_headers -> last_modified: DateTime<Utc>,
sequence_nu... | date_from_headers -> date: DateTime<Utc>
); |
<|file_name|>OptionalProcProvider.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2013, impossibl.com
* 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 ... | } |
<|file_name|>test_logdir.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import apt_pkg
import logging
import os
import mock
import sys
import tempfile
import unittest
sys.path.insert(0, "..")
from unattended_upgrade import _setup_logging
class MockOptions:
dry_run = False
debug = False
class TestLogdir(u... | |
<|file_name|>gtype.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Rust-GNOME Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
//! A numerical value which represents... | pub fn is_a(_type: glib_ffi::GType, is_a_type: glib_ffi::GType) -> bool {
unsafe { to_bool(ffi::g_type_is_a(_type, is_a_type)) }
} |
<|file_name|>654121a84a33_.py<|end_file_name|><|fim▁begin|>"""Add Graph and GraphCache models
Revision ID: 654121a84a33
Revises: fc7bc5c66c63
Create Date: 2020-11-16 21:02:36.249989
"""
# revision identifiers, used by Alembic.
revision = '654121a84a33'
down_revision = 'fc7bc5c66c63'
from alembic import op
import sq... | sa.Column('graph_elements', sa.UnicodeText(), nullable=True),
sa.Column('num_nodes', sa.Integer(), nullable=True),
sa.Column('num_edges', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(['sketch_id'], ['sketch.id'], ), |
<|file_name|>startup.py<|end_file_name|><|fim▁begin|>"""
Module for code that should run during LMS startup
"""
# pylint: disable=unused-argument
from django.conf import settings
# Force settings to run so that the python path is modified
settings.INSTALLED_APPS # pylint: disable=pointless-statement
from openedx.c... | |
<|file_name|>migration.go<|end_file_name|><|fim▁begin|>package core
import (
"database/sql"
"strconv"
)
//Migration represents migrations we will run up and down.
type Migration struct {
Identifier int64
Name string
Up func(tx *Tx)
Down func(tx *Tx)<|fim▁hole|>//GetID Returns a string repres... | }
|
<|file_name|>circd.rs<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////////
#![feature(phase)]
extern crate circ_comms;
extern crate irc;
#[phase(plugin, link)] extern crate log;
extern crate time;
//////////////////////////////////////////////////////////////////... |
Config::load(filename).unwrap()
},
_ => panic!("Configuration file must be specified") |
<|file_name|>gpu_mem_tracker.cpp<|end_file_name|><|fim▁begin|>#include "drape/utils/gpu_mem_tracker.hpp"
#include <iomanip>
#include <sstream>
namespace dp
{
std::string GPUMemTracker::GPUMemorySnapshot::ToString() const
{
std::ostringstream ss;
ss << " Summary Allocated = " << m_summaryAllocatedInMb << "Mb\n";
... | allocation.m_count++;
}
} // namespace dp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.