prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>milestones_helpers.py<|end_file_name|><|fim▁begin|>"""
Utility library for working with the edx-milestones app
"""
from django.conf import settings
from django.utils.translation import gettext as _
from edx_toggles.toggles import SettingDictToggle
from milestones import api as milestones_api
from milestone... | """
Queries milestones subsystem to see if the specified course is gated on one or more milestones,
and if those milestones can be fulfilled via completion of a particular course content module |
<|file_name|>packageHandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import piksemel
import os
def updateGConf (filepath, remove=False):
parse = piksemel.parse (filepath)
schemaList = list()
for xmlfile in parse.tags ("File"):
path = xmlfile.getTagData ("Path")
# Only interested... | |
<|file_name|>fit.py<|end_file_name|><|fim▁begin|>"""
Poisson time series penalised likelihood regression
via the Berman Turner device
"""
from . import weighted_linear_model
from . import design_nonlattice as design
from math import ceil
import numpy as np
from importlib import reload
design = reload(design)
class ... | cum_obs=self.cum_obs_,
basis_lag=self.basis_lag_,
big_n_hat=self.big_n_hat_, |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""
Urls for idea app
"""
from django.conf.urls import url
from openedx.features.idea.api_views import FavoriteAPIView
from openedx.features.idea.views import ChallengeLandingView, IdeaCreateView, IdeaDetailView, IdeaListingView
urlpatterns = [
url(
r'^ove... | url(
r'^(?P<pk>[0-9]+)/$', |
<|file_name|>Xml2ClassRule.java<|end_file_name|><|fim▁begin|>/*
* SPDX-License-Identifier: GPL-3.0
*
*
* (J)ava (M)iscellaneous (U)tilities (L)ibrary
*
* JMUL is a central repository for utilities which are used in my
* other public and private repositories.
*
* Copyright (C) 2013 Kristian Kutin
*
* This pr... | |
<|file_name|>inspection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from openerp import models, fields, api
from datetime import datetime, timedelta, date
from dateutil.relativedelta import relativedelta
class Inspection(models.Model):
_name = 'property.inspection'
_order = 'date desc'
_inheri... | _name = 'property.inspection.request'
_order = 'date desc'
|
<|file_name|>clopath_synapse_spike_pairing.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# clopath_synapse_spike_pairing.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | syn_weights = np.array(syn_weights) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from python_vlookup import * |
<|file_name|>draw_mothbrain.py<|end_file_name|><|fim▁begin|>import vtk
import math
def get_screenshot(renWin, filename):
renWin.Render()
w2if = vtk.vtkWindowToImageFilter()
w2if.SetInput(renWin)
w2if.Update()
writer = vtk.vtkPNGWriter()
writer.SetFileName(filename)
writer.SetInput(w2if.GetO... | |
<|file_name|>YatinSection.js<|end_file_name|><|fim▁begin|>import Html from "./Html";
import { YatinSelectMin, YatinSelectMax } from "../parts/YatinSelect";
<|fim▁hole|>export default class YatinSection extends Html {
constructor(min="", max="") {
super();
var $yatinSection = $(`
<section class="yat... | |
<|file_name|>jwt-cli.rs<|end_file_name|><|fim▁begin|>include!("../src/main.rs");
#[cfg(test)]
mod tests {
use super::{
create_header, decode_token, decoding_key_from_secret, encode_token,
encoding_key_from_secret, is_payload_item, is_timestamp_or_duration, parse_duration_string,
App, Decode... | "object={\"foo\": \"bar\"}", |
<|file_name|>compositor.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 AnimationTickType;
use CompositorMsg as ConstellationM... | |
<|file_name|>IQVectorGenerator.py<|end_file_name|><|fim▁begin|>from math import ceil
import numpy as np
from ipywidgets import widgets
from tqdm.notebook import tqdm
from matplotlib import pyplot as plt
import lib.iq_mixer_calibration
from drivers import IQAWG
from lib.data_management import load_IQMX_calibration_dat... | if "dac_overridden" in parameters_dict:
self._dac_overridden = parameters_dict["dac_overridden"]
else:
self._dac_overridden = False |
<|file_name|>lrn_op_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. 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://www.apach... | shape = [4, 4, 4, 4]
p = array_ops.placeholder(dtypes.float32, shape=shape)
inp_array = np.zeros(shape).astype("f") |
<|file_name|>011_Container_With_Most_Water.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
class Solution:
def maxArea(self, height):
"""
:type height: List[int]
:rtype: int
"""
i, j = 0, len(height)-1
l, r = height[i], height[j]
maxArea = (j - i) * min... | |
<|file_name|>trace.js<|end_file_name|><|fim▁begin|>var randomBytes = require('mz/crypto').randomBytes;
module.exports = function* trace(next) {
this.id = yield randomBytes(24);
var ctx = this;
var req = this.req;
var res = this.res;
// request start
this.trace('time.start');
// request en... | |
<|file_name|>dbtool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
from __future__ import print_function
import sys
import os
import urllib
import argparse
import xml.etree.ElementTree as ET
def warn(*msgs):
for x in msgs: print('[WARNING]:', x, file=sys.stderr)
class PDBTM:
def __init__(self, filename):
... | f.close()
|
<|file_name|>process.rs<|end_file_name|><|fim▁begin|>use std::io::process::{Command,ProcessOutput};
fn main() {
// Initial command `rustc`
let mut cmd = Command::new("rustc");
// append the "--version" flag to the command
cmd.arg("--version");
// The `output` method will spawn `rustc --version`, w... | } else {
// `err` also has type `Vec<u8>`
let s = String::from_utf8_lossy(err.as_slice());
|
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>import inspect
from functools import total_ordering
def yield_once(iterator):
"""
Decorator to make an iterator yield each result only once.
:param iterator: Any iterator
:return: An iterator that yields every result only once at most.
... | argspec = inspect.getfullargspec(function)
annotations = argspec.annotations
argnames = argspec.args |
<|file_name|>VRTSceneManagerImpl.java<|end_file_name|><|fim▁begin|>// Copyright © 2017 Viro Media. All rights reserved.
//
// 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 restr... | // the following conditions: |
<|file_name|>font_context.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/. */
extern crate app_units;
extern crate gfx;
extern crate s... |
#[test]
fn test_font_group_is_cached_by_style() { |
<|file_name|>test_ui.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import openerp.tests
inject = [
"./../../../website/static/src/js/website.tour.test.js",
"./../../../website_event_sale/static/src/js/website.tour.event_sale.js",
]
class TestUi(openerp.tests.HttpCase):
def test_admin(self):
self.pha... | |
<|file_name|>test_archive_util.py<|end_file_name|><|fim▁begin|>"""Tests for distutils.archive_util."""
__revision__ = "$Id: test_archive_util.py 86596 2010-11-20 19:04:17Z ezio.melotti $"
import unittest
import os
import tarfile
from os.path import splitdrive
import warnings
from distutils.archive_util import (check_... | try:
make_tarball(splitdrive(base_name)[1], '.')
finally: |
<|file_name|>lvsb.py<|end_file_name|><|fim▁begin|>"""
Higher order classes and functions for Libvirt Sandbox (lxc) container testing
:copyright: 2013 Red Hat Inc.
"""
import datetime
import time
import logging
import lvsb_base
# This utility function lets test-modules quickly create a list of all
# sandbox aggregate... | """
Return list of instantiated lvsb_testsandboxes classes from params
:param params: an undiluted Params instance |
<|file_name|>amf.py<|end_file_name|><|fim▁begin|># Copyright (c) The AcidSWF Project.
# See LICENSE.txt for details.
"""
Support for creating a service which runs a web server.
@since: 1.0
"""
import logging
from twisted.python import usage
from twisted.application import service
from acidswf.service import create... | |
<|file_name|>linalg.py<|end_file_name|><|fim▁begin|>"""Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, d... | The costs for the two different parenthesizations are as follows::
|
<|file_name|>psd.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:\Coding\Python\PythonPackageLinks\dataquick\plugins\visualizations\ui\psd.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
#<|fim▁hole|># 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
... | # Copyright © 2013 Intel
#
# Author: Shuangtai Tian <shuangtai.tian@intel.com>
# |
<|file_name|>contrib_estimator_predictor.py<|end_file_name|><|fim▁begin|># Copyright 2016 The TensorFlow Authors. 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
#
# ... | from tensorflow.contrib.predictor import predictor
from tensorflow.python.framework import ops |
<|file_name|>field.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>// utility for field
require('./globals');
var consts = require('./consts'),
c = consts.shorthand,
time = require('./compiler/time'),
util = require('./util'),
schema = require('./schema/schema');
var vlfield = module.exports = {};
... | |
<|file_name|>0010_auto_20151019_1410.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.utils.timezone import utc
import datetime
class Migration(migrations.Migration):
dependencies = [
('content', '0009_au... | migrations.AlterField( |
<|file_name|>problem_001.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function #, unicode_literals
"""
Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples
of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of ... | for k in basis:
if not i % k: |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>import csv
import os
import random
import svm_classifier
def get_classifier_filename(classifier_name):
dir_name = os.path.dirname(os.path.realpath(__file__))
return os.path.join(dir_name, 'classifiers', classifier_name + '.pkl')
def get_image_split(csv_f... | if row[1] == 'level':
continue
# uncomment this to get only two categories |
<|file_name|>MemoryAdapter.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 salesforce.com, 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.or... | * @returns {Promise} when sweep completes
*/
MemoryAdapter.prototype.sweep = function() { |
<|file_name|>fire.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////////
//
// Copyright 2016 RWS Inc, All Rights Reserved
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of version 2 of the GNU General Public Li... | ////////////////////////////////////////////////////////////////////////////////
// Update object
//////////////////////////////////////////////////////////////////////////////// |
<|file_name|>ElementalVariableValue.C<|end_file_name|><|fim▁begin|>/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* ... | if (_element && (_element->processor_id() == processor_id()))
{
_subproblem.prepare(_element, _tid); |
<|file_name|>TestCommon.py<|end_file_name|><|fim▁begin|># vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2020 Andrew Ziem
# https://www.bleachbit.org
#
# 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 Sof... | self.assertExists(abs_dir)
self.assertEqual(os.path.expanduser(abs_dir), abs_dir) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
setup(
name='Bioloid',
version='0.1.0',
author='Dave Hylands',<|fim▁hole|> packages=['bioloid'],
scripts=[],
url='http://pypi.python.org/pypi/Bioloid/',
license='LICENSE',
description='Provides access to ... | author_email='dhylands@gmail.com', |
<|file_name|>RemoveFormatTest.ts<|end_file_name|><|fim▁begin|>import { GeneralSteps, Logger, Pipeline, Step } from '@ephox/agar';
import { TinyApis, TinyLoader } from '@ephox/mcagar';
import SilverTheme from 'tinymce/themes/silver/Theme';
import { UnitTest } from '@ephox/bedrock';
import RemoveFormat from 'tinymce/core... | }];
|
<|file_name|>xmlrpcclient.py<|end_file_name|><|fim▁begin|>#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software ... | while 1:
try: |
<|file_name|>compile.ts<|end_file_name|><|fim▁begin|>import * as fs from "fs"
import * as path from "path"
import * as ts from "typescript"
const coffee = require("coffeescript")
const less = require("less")
import {argv} from "yargs"
import {collect_deps} from "./dependencies"
const mkCoffeescriptError = (error: any... | target: ts.ScriptTarget.ES5,
lib: [ |
<|file_name|>Mob.cpp<|end_file_name|><|fim▁begin|>//////////////////////////////////////////////////////////////////////////////
// This file is part of the Journey MMORPG client //
// Copyright © 2015-2016 Daniel Allendorf //
// ... | } |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for ross project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.dja... | ROOT_URLCONF = 'ross.urls'
TEMPLATES = [
{ |
<|file_name|>test_patternchain.py<|end_file_name|><|fim▁begin|># test_patternchain.py -- Tests for Pattern Chains
"""Tests for Pattern Chain objects"""
from morph import (
pattern,
patternchain
)
from morph.pattern import (
LiteralPattern,
NumericCounterPattern,
)
from morph.patternchain import (
... |
class FilePatternChainTestCase(TestCase):
def testApply(self): |
<|file_name|>EditingTest.cpp<|end_file_name|><|fim▁begin|>//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 wi... | |
<|file_name|>inscription_criteria_lkpLocalServiceClpInvoker.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
*
* This library 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 Fr... | private String[] _methodParameterTypes4; |
<|file_name|>_vpn_link_connections_operations.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 informat... | |
<|file_name|>eq_op.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::{multispan_sugg, span_lint, span_lint_and_then};
use clippy_utils::source::snippet;
use clippy_utils::ty::{implements_trait, is_copy};
use clippy_utils::{ast_utils::is_useless_with_eq_exprs, eq_expr_value, higher, in_macro, is_expn_of};
u... | |
<|file_name|>verify.go<|end_file_name|><|fim▁begin|>// Copyright 2011 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 x509
import (
"strings"
"time"
"unicode/utf8"
)
type InvalidReason int
const (
// NotAuthoriz... | var childChains [][]*Certificate
childChains, ok := cache[intermediateNum] |
<|file_name|>xarray.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Vendor core functionality used from xarray.
This code has been reproduced with modification under the terms of the Apache Lice... | |
<|file_name|>test_overcloud_roles.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 applica... | # Verify
self.assertEqual(response.status_int, 200) |
<|file_name|>queue.js<|end_file_name|><|fim▁begin|>function Queue(capacity) {
this.q = new Array(capacity);
this.next = 0;
this.size = 0;
this.isFull = function() {
return this.size >= this.q.length;
}
this.isEmpty = function() {
return this.size <= 0;
}
this.push = function(elt) {
if (th... | return this;
} |
<|file_name|>commonDefs.hpp<|end_file_name|><|fim▁begin|>#ifndef _COMMON_DEFS_<|fim▁hole|>enum FLASH_TYPE {SIMPLE };
enum SIM_TYPE {LIQDENSITY, VAPDENSITY, TPFLASH, PT_DIAGRAM, DEW_POINT, BUBBLE_POINT, PUREPSAT};
#endif<|fim▁end|> | #define _COMMON_DEFS_
enum EOS_TYPE {SRK, VDW, PR, GHC};
|
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Switchbot bot."""
from __future__ import annotations
import logging
from typing import Any
from switchbot import Switchbot # pylint: disable=import-error
import voluptuous as vol
from homeassistant.components.switch import (
DEVICE_CLASS_SWITCH,... |
@property
def is_on(self) -> bool: |
<|file_name|>_color.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="icicle.outsidetextfont", **kwargs
):
super(ColorValidator, self).__init__(<|fim▁hole|... | plotly_name=plotly_name,
parent_name=parent_name,
array_ok=kwargs.pop("array_ok", True),
edit_type=kwargs.pop("edit_type", "plot"), |
<|file_name|>children.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from .request import Request
from .response import Response
from .stat import Stat
from .primitives import Bool, UString, Vector
class GetChildrenRequest(Request):
"""
"""
opcode = 8
parts = (
("pat... | ("path", UString),
("watch", Bool),
)
|
<|file_name|>AbstractIntegralNumberEditor.java<|end_file_name|><|fim▁begin|>/*
* 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, or
* (at your option) ... | resetChosenOption();
if (!((JSpinner) m_CustomEditor).getValue().equals(getValue()))
((JSpinner) m_CustomEditor).setValue(getValue());
} |
<|file_name|>ZeppelinSparkClusterTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file t... | @Test
public void zRunTest() throws IOException {
// create new note
Note note = ZeppelinServer.notebook.createNote(); |
<|file_name|>Cdrom.py<|end_file_name|><|fim▁begin|># encoding: utf-8
# module apt_pkg
# from /usr/lib/python3/dist-packages/apt_pkg.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
"""
Classes and functions wrapping the apt-pkg library.
The apt_pkg module provides several classes and functions for accessing
the fu... |
Try to identify the CD-ROM and if successful return the hexadecimal
CDROM-ID (and a integer version suffix separated by -) as a
string. Otherwise, return None or raise an error. |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^upload/election/(?P<election>[^/]+)/post/(?P<post_id>[^/]+)/$',
views.CreateDocumentView.as_view(),
name='upload_document_view'),
... | views.DocumentView.as_view(),
name='uploaded_document_view'),
] |
<|file_name|>pascale.cpp<|end_file_name|><|fim▁begin|>/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can r... | } |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django import forms as django_forms
from django.core.urlresolvers import reverse
from django.http import Http404
import commonware
import waffle
from rest_framework import exceptions, response, serializers, status, viewsets
from rest_framework.decorators import d... | status=status.HTTP_400_BAD_REQUEST)
form.save(app)
return Response(status=status.HTTP_200_OK) |
<|file_name|>StringLiteral.java<|end_file_name|><|fim▁begin|>/*-------------------------------------------------------------------------------------------------
_______ __ _ _______ _______ ______ ______
|_____| | \ | | |______ | \ |_____]
| | | \_| | ______| |_____/ |_____]
Copyright (c) ... | return DataType.varchar();
} |
<|file_name|>CellType.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the ... | package org.apache.accumulo.monitor.util.celltypes;
import java.io.Serializable; |
<|file_name|>no_command.py<|end_file_name|><|fim▁begin|>from difflib import get_close_matches
from thefuck.utils import sudo_support, get_all_executables, get_closest
@sudo_support
def match(command, settings):
return 'not found' in command.stderr and \
bool(get_close_matches(command.script.split(' ')[... | |
<|file_name|>WebSecurityConfig.java<|end_file_name|><|fim▁begin|>package cz.plichtanet.honza;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annota... | |
<|file_name|>Chapter6.py<|end_file_name|><|fim▁begin|># coding:utf-8
# 函数式编程
def add(a, b):
return a + b
def fprintf(fmt, *args):
"""args is tuple"""
print fmt % args
print "{0:s}".format("ljinshuan")
fprintf("%s,%d,%s", "xxx", 1, "gerg")
def fprintf(fmt, **args):
"""args is map"""
print arg... | |
<|file_name|>aws_ebs_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors All rights reserved.
<|fim▁hole|> http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOU... | 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
|
<|file_name|>decorator.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
Since functions are function instances you can wrap them
Allow you to
- modify arguments
- modify function
- modify results
"""
call_count = 0
def count(func):
def wrapper(*args, **kw):
global call_count
call_count += 1
... | self.function = function
def __call__(self, *args, **kw):
def wrapper(*args, **kw): |
<|file_name|>Checked.ts<|end_file_name|><|fim▁begin|>import { Optional } from '@ephox/katamari';
import { SugarElement } from '../node/SugarElement';
import * as SelectorFind from '../search/SelectorFind';
const set = (element: SugarElement<HTMLInputElement>, status: boolean): void => {
element.dom.checked = status;... | |
<|file_name|>report.cpp<|end_file_name|><|fim▁begin|>#include "report.h"
#include "../opt_mps.h"
#include <general/iter.h>
#include <tid/tid.h>
#include <tools/common/log.h>
/* clang-format off */
void tools::finite::opt::reports::print_bfgs_report(){
if (tools::log->level() > spdlog::level::debug) return;
if ... | |
<|file_name|>movie-search.interface.ts<|end_file_name|><|fim▁begin|>export interface MovieSearch {
query: string;<|fim▁hole|> year?: number;
page?: number;
}<|fim▁end|> | |
<|file_name|>ftpmirror.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
#
# @refer
# http://svn.python.org/projects/python/trunk/Tools/scripts/ftpmirror.py
# @note
#
"""
Mirror a remote ftp subtree into a local directory tree.
usage: ftpmirror [-v] [-q] [-i] [-m] [-n] [-r] [-s pat]
[-l usernam... | if skip:
continue
fullname = os.path.join(localdir, name)
if not rmok: |
<|file_name|>download.py<|end_file_name|><|fim▁begin|>import cgi
import email.utils
import hashlib
import getpass
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
import pip
from pip.backwardcompat import urllib, urlparse, raw_input
from pip.exceptions import InstallationE... | |
<|file_name|>ReporteFumigacionFacade.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package bc;
import be.ReporteFumigacion;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceCo... |
public ReporteFumigacionFacade() {
super(ReporteFumigacion.class);
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>""" Setup file """
import os
from setuptools import find_packages, setup
HERE = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(HERE, "README.rst")) as f:
README = f.read()
with open(os.path.join(HERE, "CHANGES.rst")) as f:
CHANGES = f.rea... | tests_require=REQUIREMENTS + REQUIREMENTS_TEST,
) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='pfile-tools',<|fim▁hole|> author='Nathan Vack',
author_email='njvack@wisc.edu',
license='BSD License',
url='https://github.com/njvack/pfile-tools',
package... | version='0.5.0', |
<|file_name|>PackageEdit.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export function PackageEdit(authoring) {
return {
templateUrl: 'scripts/apps/packaging/views/sd-package-edit.html',
link: function(scope) {
scope.limits = authoring.limits;
scope._editable = scope.origItem._... | import {isPublished} from 'apps/archive/utils';
PackageEdit.$inject = ['authoring']; |
<|file_name|>feature-gate-generators.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at<|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENS... | // http://rust-lang.org/COPYRIGHT. |
<|file_name|>zh_cn.py<|end_file_name|><|fim▁begin|># !/usr/bin/python
# coding=utf-8
#
# @Author: LiXiaoYu
# @Time: 2013-10-17
# @Info: lang
_lang = {
'_MODULE_NOT_EXIST_':'无法加载模块',
'_ERROR_ACTION_':'非法操作',
'_LANGUAGE_NOT_LOAD_':'无法加载语言包',
'_TEMPLATE_NOT_EXIST_':'模板不存在',
'_MODULE_':'模块',
'_ACTIO... | '_OPERATION_FAIL_':'操作失败!',
'_OPERATION_SUCCESS_':'操作成功!',
'_SELECT_NOT_EXIST_':'记录不存在!',
'_EXPRESS_ERROR_':'表达式错误', |
<|file_name|>issue-25394.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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... | #![allow(dead_code)]
#[derive(Debug)]
struct Row<T>([T]); |
<|file_name|>PartyFavor.java<|end_file_name|><|fim▁begin|>//: pony/PartyFavor.java
package pokepon.pony;
import pokepon.enums.*;
/** Party Favor
* Good def and spa, lacks Hp and Speed
*
* @author silverweed
*/
public class PartyFavor extends Pony {
public PartyFavor(int _level) {
super(_level);
name = ... | learnableMoves.put("Dodge",1);
}
} |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "anigma1.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above imp... | try:
import django
except ImportError:
raise ImportError( |
<|file_name|>transmute_64bit.rs<|end_file_name|><|fim▁begin|>// ignore-32bit
#[warn(clippy::wrong_transmute)]
fn main() {
unsafe {
let _: *const usize = std::mem::transmute(6.0f64);
let _: *mut usize = std::mem::transmute(6.0f64);<|fim▁hole|>}<|fim▁end|> | } |
<|file_name|>sample.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from fast_guided_filter import blur
print("hello")<|fim▁end|> | import sys
sys.path.insert(0,'../') |
<|file_name|>generic.py<|end_file_name|><|fim▁begin|># encoding: utf-8
from __future__ import unicode_literals
import os
import re
import sys
from .common import InfoExtractor
from .youtube import YoutubeIE
from ..compat import (
compat_etree_fromstring,
compat_urllib_parse_unquote,
compat_urlparse,
... | new\s+SWFObject\(
)
(["\']) |
<|file_name|>container_create.py<|end_file_name|><|fim▁begin|>import optparse
import pyrax
import swiftclient
from django.core.management.base import BaseCommand, CommandError
from cumulus.settings import CUMULUS
def cdn_enabled_for_container(container):
"""pyrax.cf_wrapper.CFClient assumes cdn_connection.
... | optparse.make_option("-p", "--private", action="store_true", default=False,
dest="private", help="Make a private container."),)
|
<|file_name|>apfs_file_system.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the file system implementation using pyfsapfs."""
import unittest
from dfvfs.lib import definitions
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import context
from dfvfs... |
def tearDown(self):
"""Cleans up the needed objects used throughout the test."""
self._resolver_context.Empty() |
<|file_name|>v8_attributes.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Google 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:
#
# * Redistributions of source code must retain the... | inherits_interface(base_idl_type, 'Node') or
# A self-reference is unnecessary.
attribute.name == 'self' or |
<|file_name|>progressbarSpec.js<|end_file_name|><|fim▁begin|>/*jshint unused: vars */
/*
define(['angular', 'angular-mocks', 'app'], function(angular, mocks, app) {
'use strict';
describe('Directive: progressBar', function () {
// load the directive's module
beforeEach(module('oslerApp.directives.Progress... | })); |
<|file_name|>PointDistribution.js<|end_file_name|><|fim▁begin|>/**
* This module is used to create different point distributions that can be<|fim▁hole|> *
* @class PointDistribution
*/
"use strict";
import Poisson from "poisson-disk-sample";
import Vector from "../geometry/Vector";
import Rectangle from "../geome... | * turned into different tile sets when made into a graph format. There are
* various different distributions that can be used to create interesting
* tile patterns when turned into a voronoi diagram. |
<|file_name|>20.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { TrafficFlow20 as default } from "../../"; |
<|file_name|>test_router.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 VMware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | relations = {
'LogicalRouterStatus':
{'_href': '/ws.v1/lrouter/%s/status' % router_id, |
<|file_name|>xparentn.js<|end_file_name|><|fim▁begin|>// xParentN 2, Copyright 2005-2007 Olivier Spinelli
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL
function xParentN(e, n)
{
while (e && n--) e = e.parentNode;
return e;
<|fim▁hole|><|fim▁end|> | } |
<|file_name|>_winreg.py<|end_file_name|><|fim▁begin|>def __load():
import imp, os, sys
try:
dirname = os.path.dirname(__loader__.archive)
except NameError:
dirname = sys.prefix<|fim▁hole|> mod = imp.load_dynamic(__name__, path)
## mod.frozen = 1
__load()
del __load<|fim▁end|> | path = os.path.join(dirname, '_winreg.pyd')
#print "py2exe extension module", __name__, "->", path |
<|file_name|>runtimeCache.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Stores metadata about images which are built to encorporate changes to subuser images which are required in order to implement various permissions.
"""
#external imports
import os
import json
#internal imports
from subuserlib.classe... | |
<|file_name|>ServletServiceApi.java<|end_file_name|><|fim▁begin|>package org.aksw.servicecat.web.api;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.aksw.servicecat.core.ServiceAnalyzerProcessor;
import org.spr... | @Autowired
private ServiceAnalyzerProcessor processor; |
<|file_name|>PerformanceSpriteTest.cpp<|end_file_name|><|fim▁begin|>#include "PerformanceSpriteTest.h"
enum {
kMaxNodes = 50000,
kNodesIncrease = 250,
TEST_COUNT = 7,
};
enum {
kTagInfoLayer = 1,
kTagMainLayer = 2,
kTagMenuLayer = (kMaxNodes + 1000),
};
static int s_nSpriteCur... | |
<|file_name|>Default_Settings.py<|end_file_name|><|fim▁begin|>#Sequences of actual rotors used in WWII, format is name, sequences, turnover notch(es)
rotor_sequences = {
'I': ('EKMFLGDQVZNTOWYHXUSPAIBRCJ', ('Q')),
'II': ('AJDKSIRUXBLHWTMCQGZNPYFVOE', ('E')),
'III': ('BDFHJLCPRTXVZNYEIWGAKMUSQO', ('V'... | score_x = 1
return score_x
|
<|file_name|>test-configController.js<|end_file_name|><|fim▁begin|><|fim▁hole|>"use strict";
var assert = require("assert"),
Promise = require("promise"),
_ = require("underscore"),
configController = require('../controllers/configController.js');
describe('configController', function() {
it('init should load... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.