prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>l3_agentschedulers_db.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 OpenStack Foundation.
# 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
#... | candidates=candidates)
if not new_agent: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from . import orderpoint_generator<|fim▁end|> | |
<|file_name|>netconf_config.py<|end_file_name|><|fim▁begin|>#
# Copyright 2016 Peter Sprygada <psprygada@ansible.com>
#<|fim▁hole|># the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WA... | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by |
<|file_name|>TSIGRecord.java<|end_file_name|><|fim▁begin|>// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
package org.xbill.DNS;
import java.io.*;
import java.util.*;
import org.xbill.DNS.utils.*;
/**
* Transaction Signature - this record is automatically generated by the
* resolver. TSIG records... | ((other[4] & 0xFF) << 8) +
((other[5] & 0xFF) ); |
<|file_name|>borrowck-closures-two-mut.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Tests that two closures cannot simultaneously have mutable
// access to the variable, whether that mutable access be used
// for direct assignment or for taking mutable ref. Issue #6801.
fn to_fn_mut<F: FnMut()>(f: F) -> F { f }
f... | |
<|file_name|>ecg.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017, MD2K Center of Excellence
# 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 th... | :param fs: sampling frequency
:param range_for_checking : The peaks are checked within a range of fs/10 to get the maximum value within that range
:return: final R peak array |
<|file_name|>ovnclients.py<|end_file_name|><|fim▁begin|># Copyright 2018 Red Hat, 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
#
# Unl... | lrouter = ovn_nbctl.lrouter_add(name) |
<|file_name|>filter.go<|end_file_name|><|fim▁begin|>package filter
import (
"errors"
"path/filepath"
"strings"
)
// ErrBadString is returned when Match is called with the empty string as the
// second argument.
var ErrBadString = errors.New("filter.Match: string is empty")
// Match returns true if str matches the... | ok, err := filepath.Match(patterns[i], strs[offset+i]) |
<|file_name|>CSV2polyconvertXML.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
@file CSV2polyconvertXML.py
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2008-07-17
@version $Id: CSV2polyconvertXML.py 22608 2017-01-17 06:28:54Z behrisch $
Converts a given CSV-file that contains a list of p... | it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or |
<|file_name|>experiment_configuration.py<|end_file_name|><|fim▁begin|>__author__ = 'leif'
import os
import socket
import logging
import logging.config
import logging.handlers
from autocomplete_trie import AutocompleteTrie
from ifind.search.engines.whooshtrec import Whooshtrec
from experiment_setup import ExperimentSet... | stopwords_file=stopword_file, |
<|file_name|>feed_parse_extractQuillofkarnikaWordpressCom.py<|end_file_name|><|fim▁begin|>def extractQuillofkarnikaWordpressCom(item):
'''
Parser for 'quillofkarnika.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower... | ('Loiterous', 'Loiterous', 'oel'),
]
|
<|file_name|>apple_template.go<|end_file_name|><|fim▁begin|>package genconfig
const mobileConfigTemplate = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<d... | |
<|file_name|>RecipientFactory.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2011 Whisper Systems
*
* 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... | |
<|file_name|>extensions.py<|end_file_name|><|fim▁begin|>from flask_pymongo import PyMongo
from flask_cors import CORS<|fim▁hole|>
mongo = PyMongo()
cors = CORS()<|fim▁end|> | |
<|file_name|>taobaomm.py<|end_file_name|><|fim▁begin|>#_*_coding: utf-8 _*_
#__author__ = 'Alihanniba'
import urllib.request
# from urllib.request import urlopen
import urllib.error
import re
import os
import taobaotool
import time
class Spider:
def __init__(self):
self.siteUrl = 'http://mm.taobao.com/jso... | u = urllib.request.urlopen(imgUrl) |
<|file_name|>release.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
# Copyright (c) 2008-2012, David P. D. Moss. All rights reserved.
#
# Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------... | For details on the latest updates and changes, see :-
http://github.com/drkjam/netaddr/blob/rel-0.7.x/CHANGELOG |
<|file_name|>test_skip_checkpoint_abort_transaction.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the under the Apache License, Version 2.0 (the "License");
you may not use this f... | gpstop -air" % os.environ["GPHOME"])
cmd.run(validateAfter=True)
|
<|file_name|>test_base85.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from anima.render.arnold import base85
import unittest
import struct
class Base85TestCase(unittest.TestCase):
"""tests the base85 module
"""
def setup(self):
"""setup the test<|fim▁hole|>
def test_arnold_b85_enc... | """
pass |
<|file_name|>S7.8.3_A3.4_T4.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* DecimalLiteral :: DecimalIntegerLiteral. DecimalDigigts ExponentPart
*
* @path ch07/7.8/7.8.3/S7.8.3_A3.4_T4.js<|fim▁hole|>//CHECK#0
if (0.0E-1 !== 0) {
$ERROR('#0: 0.0E-1 === 0');
}
//CH... | * @description ExponentPart :: E -DecimalDigits
*/
|
<|file_name|>user_service_steps.py<|end_file_name|><|fim▁begin|>from behave import given, when, then
from genosdb.models import User
from genosdb.exceptions import UserNotFound
# 'mongodb://localhost:27017/')
@given('a valid user with values {username}, {password}, {email}, {first_name}, {last_name}')
def step_impl(... | context.user_service.update(user.to_json())
else:
raise UserNotFound(username, "User was not found") |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as publ... | self.plugin.leftMouseButtonDown = True |
<|file_name|>lees_edwards.hpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2010,2012,2016 The ESPResSo project
Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010
Max-Planck-Institute for Polymer Research, Theory Group
This file is part of ESPResSo.
ESPResSo is free software: you can redistri... | |
<|file_name|>PrismaState.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#|... | #| the Free Software Foundation, either version 3 of the License, or | |
<|file_name|>banded.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2015 Johannes Köster, Vadim Nazarov, Patrick Marks
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Banded Smith-Waterman alignmen... | //!
//! // In addition to the standard modes (Global, Semiglobal and Local), a custom alignment
//! // mode is supported which supports a user-specified clipping penalty. Clipping is a
//! // special boundary condition where you are allowed to clip off the beginning/end of |
<|file_name|>caffe.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import imp
import os
import platform
import re
import subprocess
import sys
from . import option_list
from digits import device_query
from digits.utils import ... | else:
flavor = 'BVLC'
return version_string, flavor |
<|file_name|>test_expand_path.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).<|fim▁hole|>
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
... | |
<|file_name|>test_list.py<|end_file_name|><|fim▁begin|>import sys
tests=[
("testExecs/testFeatures.exe","",{}),<|fim▁hole|>longTests=[
]
if __name__=='__main__':
import sys
from rdkit import TestRunner
failed,tests = TestRunner.RunScript('test_list.py',0,1)
sys.exit(len(failed))<|fim▁end|> | ]
|
<|file_name|>NameCredit.cc<|end_file_name|><|fim▁begin|>/* --------------------------------------------------------------------------
libmusicbrainz4 - Client library to access MusicBrainz
Copyright (C) 2011 Andrew Hawkins
This file is part of libmusicbrainz4.
This library is free software; you can redi... | |
<|file_name|>ExpiryRunnerTest.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 und... |
private final SimpleString qName2 = new SimpleString("ExpiryRunnerTestQ2");
|
<|file_name|>exchange.js<|end_file_name|><|fim▁begin|>"use strict";
require("./setup");
var exchange = require("../src/exchange"),
assert = require("assert"),
config = require("config"),
async = require("async");
describe("Exchange", function () {
describe("rounding", function () {
it("should roun... | // change one of the exchange rates to test for the reload
var originalGBP = fx.rates.GBP;
fx.rates.GBP = 123.456; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import<|fim▁hole|>from .base import * # NOQA
from .manager import IntegrationManager # NOQA
default_manager = IntegrationManager()
all = default_manager.all
get = default_manager.get
exists = default_manager.exists
register = defa... |
from .analytics import * # NOQA |
<|file_name|>fields.py<|end_file_name|><|fim▁begin|># gazetteer.fields
# Copyright 2016, James Humphry
# 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 2 of the License, or
# ... | |
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""Constants for the Aftership integration."""
from __future__ import annotations
from datetime import timedelta
from typing import Final
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
DOMAIN: Final = "aftership"<|fim▁hole|>
BASE: Fin... |
ATTRIBUTION: Final = "Information provided by AfterShip"
ATTR_TRACKINGS: Final = "trackings" |
<|file_name|>ExamResultQueryBuilder.java<|end_file_name|><|fim▁begin|>package br.org.otus.laboratory.project.builder;
import java.util.ArrayList;
import java.util.List;
import org.bson.Document;
import org.bson.conversions.Bson;
import com.google.gson.GsonBuilder;
public class ExamResultQueryBuilder {
private Ar... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const landingText = (
``
)<|fim▁hole|> are passionate about building a better web experience and delivering quality
code to our clients`
)<|fim▁end|> |
const aboutText = (
`We are a team of expert web developers coming from diverse backgrounds who |
<|file_name|>walls.py<|end_file_name|><|fim▁begin|>from PyQt4 import QtGui, QtCore
class Walls(QtGui.QGraphicsPixmapItem):
def __init__(self, name):
super(Walls, self).__init__()
self.setPixmap(QtGui.QPixmap(name))
def create_walls():
obstacles = []
wall1 = Walls("./resources/images/obs... | wall14 = Walls("./resources/images/obstacle9.png")
wall14.setPos(368, 102) |
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from datetime import datetime, timedelta
import json
import mock
import time
from django.conf import settings
from django.core import mail
from olympia import amo
from olympia.abuse.models import AbuseReport
from olympia.access.models im... | |
<|file_name|>triangular_matrix.rs<|end_file_name|><|fim▁begin|>#![doc="Implements the triangular matrix data-type
"]
// std imports
use std::ptr;
use std::mem;
use std::fmt;
// external imports
use num::traits::{Zero, One};
use alloc::heap::allocate;
// complex numbers
use num::complex::{Complex32, Complex64};
// l... | assert_eq!(r, matrix_cw_i64(1,4, &[1, 1, 1, 1])); |
<|file_name|>page-accueil.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PageAccueilComponent } from './page-accueil.component';
describe('PageAccueilComponent', () => {
let component: PageAccueilComponent;
let fixture: ComponentFi... | declarations: [ PageAccueilComponent ] |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>(function() {
function config($stateProvider, $locationProvider) {
$locationProvider
.html5Mode({
enabled: true,
requireBase: false
});
$stateProvider
.state('landing', {
url: '/',
controller: 'LandingCtrl as la... | |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|># Django Imports
from django.db.models.signals import post_save
from django.dispatch import receiver
# Python Imports
from logging import getLogger
# Local Imports
from .models import Person, PersonAttribute, PersonIdentifier, PersonIdentifierAttribute, GroupIdentifi... |
# Implementation
@receiver(post_save, sender=Person) |
<|file_name|>pyrsyncgui.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
'''
*
* Copyright (C) 2013 Simone Denei <simone.denei@gmail.com>
*
* This file is part of pyrsyncgui.
*
* pyrsyncgui is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publi... | #
# GUI Configuration
|
<|file_name|>html5-routes-test.js<|end_file_name|><|fim▁begin|>var browser_history_support = (window.history != null ? window.history.pushState : null) != null;
createTest('Nested route with the many children as a tokens, callbacks should yield historic params', {
'/a': {
'/:id': {
'/:id': function(a, b) {... | shared.fired.push('a');
}
}
} |
<|file_name|>matchers.go<|end_file_name|><|fim▁begin|>package main
import (
"regexp"
"strings"
)
var segmentEntryRegexp = regexp.MustCompile("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\.[0-9a-f]{8}$")
func any(_ string) bool {
return true
}
func isBinary(name string) bool {
return strings.Ha... | return func(name string) bool {
return normalizeSegmentID(id) == normalizeSegmentID(entryNameToSegmentID(name))
}
} |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from django.views.decorators.csrf import csrf_exempt
from . import views
urlpatterns = [
url(r"^$", csrf_exempt(views.SamlView.as_view())),
url(r"^metadata/$", views.serve_metadata),<|fim▁hole|>]<|fim▁end|> | |
<|file_name|>borrowck_errors.rs<|end_file_name|><|fim▁begin|>use rustc_errors::{struct_span_err, DiagnosticBuilder, DiagnosticId};
use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_span::{MultiSpan, Span};
impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
crate fn cannot_move_when_borrowed(&self, span: Span, d... | struct_span_err!( |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENS... | |
<|file_name|>benchmarks.py<|end_file_name|><|fim▁begin|>""" The benchmarks below are useful for testing performance when making changes to the maze algorithms. """
from datetime import datetime
from sysconfig import get_python_version
from timeit import Timer
from mazelib import __version__ as version
# CONFIG
SIZES =... | for generator in GENERATORS:
for solver in SOLVERS:
row += 1 |
<|file_name|>0009_auto_20150110_2012.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('commerce', '0008_auto_20150110_2000'),
]
operations = [
... | |
<|file_name|>day10.py<|end_file_name|><|fim▁begin|>from math import floor
def score_syntax_errors(program_lines):
points = {')': 3, ']': 57, '}': 1197, '>': 25137}
s = 0
scores_auto = []
for line in program_lines:
corrupted, stack = corrupted_character(line)
if corrupted:
... | if char in lookup:
stack.append(char)
elif char in lookup_close:
expected = stack.pop() |
<|file_name|>friendship.py<|end_file_name|><|fim▁begin|>from riotwatcher import *
from time import sleep
import logging
log = logging.getLogger('log')
def getTeamOfSummoner( summonerId, game ):
for p in game['participants']:
if p['summonerId'] == summonerId:
return p['teamId']
def getSummonerIdsO... | sleep(10)
rqs = 0
log.debug('matches of summoner '+str(id)+': '+str(len(matchlist)))
|
<|file_name|>compiler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generator for C++ structs from api json files.
The purpose of this tool is... | cpp_bundle_generator = CppBundleGenerator(root,
api_model,
api_defs, |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>'''
Created on 17/2/2015
@author: PC06
Primer cambio en el proyecto
'''
from include import app
<|fim▁hole|><|fim▁end|> | if __name__ == '__main__':
app.run("127.0.0.1", 9000, debug=True) |
<|file_name|>filter_tests.py<|end_file_name|><|fim▁begin|># coding=utf-8
from django.test import TestCase, override_settings
from merepresenta.models import Candidate, NON_WHITE_KEY, NON_MALE_KEY
from merepresenta.tests.volunteers import VolunteersTestCaseBase
from backend_candidate.models import CandidacyContact
from ... | |
<|file_name|>users.js<|end_file_name|><|fim▁begin|>'use strict'
const db = require('APP/db')
const User = db.model('users')
const {mustBeLoggedIn, forbidden,} = require('./auth.filters')
<|fim▁hole|> .catch(next))
.post('/', (req, res, next) =>
User.create(req.body)
.then(user => res.status(201).json(user))
.... | module.exports = require('express').Router()
.get('/', forbidden('only admins can list users'), (req, res, next) =>
User.findAll()
.then(users => res.json(users)) |
<|file_name|>SparqlExpressionBuilder.java<|end_file_name|><|fim▁begin|>//Copyright (c) 2014 by Disy Informationssysteme GmbH
package net.disy.eenvplus.tfes.modules.sparql.expression;
import com.hp.hpl.jena.sparql.expr.E_LogicalAnd;
import com.hp.hpl.jena.sparql.expr.E_LogicalOr;
import com.hp.hpl.jena.sparql.expr.Expr... | |
<|file_name|>Gui.hpp<|end_file_name|><|fim▁begin|>#include <SFML-utils/gui/Configuration.hpp>
#include <SFML-utils/gui/Widget.hpp>
///buttons
#include <SFML-utils/gui/Button.hpp>
#include <SFML-utils/gui/TextButton.hpp>
#include <SFML-utils/gui/SpriteButton.hpp>
//Containers
#include <SFML-utils/gui/Container.hpp>
#in... | #include <SFML-utils/gui/HLayout.hpp>
#include <SFML-utils/gui/VLayout.hpp>
namespace sfutils { |
<|file_name|>ws_FourClass_100_RidgeClassifier_oracle_code_gen.py<|end_file_name|><|fim▁begin|>from sklearn2sql_heroku.tests.classification import generic as class_gen
<|fim▁hole|><|fim▁end|> | class_gen.test_model("RidgeClassifier" , "FourClass_100" , "oracle") |
<|file_name|>shell.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
import argparse
import os
import sys
import yaml
from . import VERSION
import actions
import core
import exception
from utils import log
def error(errtype, msg, code=42):
sys.stderr.write("{t.red}[ERROR] {t.yellow}{er}: {msg}"
... | except Exception as e:
err = type(e).__name__ |
<|file_name|>shell.py<|end_file_name|><|fim▁begin|># Copyright 2012-2013 OpenStack Foundation
#
# 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... | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations |
<|file_name|>driver.go<|end_file_name|><|fim▁begin|>package graphdriver
import (
"errors"
"fmt"
"os"
"path"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/archive"
)
type FsMagic uint32
const (
FsMagicBtrfs = FsMagic(0x9123683E)
FsMagicAufs = FsMagic(0x61756673)
)
type InitFunc ... | func checkPriorDriver(name, root string) { |
<|file_name|>netezzaSource.js<|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.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause incorrect beha... | * string (or Expression with resultType string).
*/
constructor() {
super(); |
<|file_name|>test_variable_manager.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fo... | '/etc/ansible/inventory1': """
[group2:children] |
<|file_name|>test_04-lattice_boltzmann_part2.py<|end_file_name|><|fim▁begin|># Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 Founda... | |
<|file_name|>mod.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/. */
//! Shaper encapsulates a specific shaper, such as Harfbuzz,
//! ... | use text::glyph::GlyphStore;
pub use text::shaping::harfbuzz::Shaper;
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, find_packages
from os import path
# www.pythonhosted.org/setuptools/setuptools.html
<|fim▁hole|> description="Program for plotting powder diffraction patterns and background subtraction",
author="Stef Smeets... | setup(
name="lines",
version="1.4.0", |
<|file_name|>IContestCollectionCard.java<|end_file_name|><|fim▁begin|>package org.xcolab.client.contest.pojo;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.xcolab.client.contest.pojo.tables.pojos.ContestCollectionCard;
@JsonDeserialize(as = ContestCollectionCard.class)
public interface... | |
<|file_name|>AuthenticationProfileNotFoundExceptionUnmarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. 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. ... | |
<|file_name|>dellemc_idrac_nic.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# _*_ coding: utf-8 _*_
#
# Dell EMC OpenManage Ansible Modules
#
# Copyright © 2017 Dell Inc. or its subsidiaries. All rights reserved.
# Dell, EMC, and other trademarks are trademarks of Dell Inc. or its
# subsidiaries. Other trademark... | TypeHelper.convert_to_enum(module.params['nic_failover'], |
<|file_name|>cmd.rs<|end_file_name|><|fim▁begin|>use types::{ToRedisArgs, FromRedisValue, Value, RedisResult,
ErrorKind, from_redis_value};
use connection::ConnectionLike;
#[derive(Clone)]
enum Arg<'a> {
Simple(Vec<u8>),
Cursor,
Borrowed(&'a [u8]),
}
/// Represents redis commands.
#[derive(Cl... | }
/// Works similar to `arg` but adds a cursor argument. This is always |
<|file_name|>local_rate_limit.rs<|end_file_name|><|fim▁begin|>/*
* Copyright 2020 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
*
* http://www.apache.org/licenses/LICE... | config::{Builder as ConfigBuilder, Filter},
endpoint::Endpoint,
filters::local_rate_limit,
test_utils::TestHelper, |
<|file_name|>label_column.js<|end_file_name|><|fim▁begin|>goog.provide('recoil.ui.widgets.table.LabelColumn');<|fim▁hole|>goog.require('recoil.frp.Behaviour');
goog.require('recoil.frp.struct');
goog.require('recoil.ui.BoolWithExplanation');
goog.require('recoil.ui.widgets.LabelWidget');
goog.require('recoil.ui.widgets... | |
<|file_name|>CSVUtils.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 ... | *
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software |
<|file_name|>mexican_wave.py<|end_file_name|><|fim▁begin|>#Kunal Gautam<|fim▁hole|>
def wave(str):
li=[]
for i in range(len(str)):
x=list(str)
x[i]=x[i].upper()
li.append(''.join(x))
return [x for x in li if x!=str]<|fim▁end|> | #Codewars : @Kunalpod
#Problem name: Mexican Wave
#Problem level: 6 kyu |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import datetime
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.list import ListView
from django.views.generic.base import View
from django.utils.translation import ugettext as _
from django.http import Http404, HttpResponseRedirect... | |
<|file_name|>invalidblockrequest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.test_framework impo... |
if __name__ == '__main__': |
<|file_name|>db_test.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include "leveldb/db.h"
#include "leveldb/filter_p... | if (miter->Valid() != dbiter->Valid()) {
fprintf(stderr, "step %d: Mismatch at end of iterators: %d vs. %d\n",
step, miter->Valid(), dbiter->Valid());
ok = false; |
<|file_name|>EnableDomainAutoRenewResult.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License i... |
@Override |
<|file_name|>compareLocales.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = function(localeA, localeB, options) {
options = options || {};
if (typeof localeA !== 'object' || typeof localeB !== 'object') {
throw new Error('s18n: `localeA` and `localeB` must be objects.');
}
var localeAMissin... | localeA[hashA],
localeB[hashA]
] |
<|file_name|>animation_example_spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.<|fim▁hole|> *
* 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
*/
import {$, browser, by, element, Expec... | |
<|file_name|>password-reset-init.service.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular<|fim▁hole|>
function PasswordResetInit($resource) {
var service = $resource('api/account/reset_password/init', {}, {});
return service;
}
})();<|fim▁end|> | .module('gpmrApp')
.factory('PasswordResetInit', PasswordResetInit);
PasswordResetInit.$inject = ['$resource']; |
<|file_name|>test_request_queue.py<|end_file_name|><|fim▁begin|>from functools import partial
from time import sleep
from mock import call, Mock
from scrapy.crawler import Crawler
from scrapy.http import Request
from scrapy import log, signals
from scrapy.settings import Settings
from scrapy.spider import BaseSpider
f... | |
<|file_name|>chromium.gpu.recipe_autogen.py<|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.
DEPS = [
'depot_tools/bot_update',
'chromium',
'depot_tools/gclient',
'recip... | raise api.step.StepFailure("Builder unsupported by recipe.")
else: |
<|file_name|>CustomResultIterator.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2009-2015 xinjunli (micromagic@sina.com).
*
* 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
*
* ... | this.rowNum++;
|
<|file_name|>player_reinforce_rnn_2.py<|end_file_name|><|fim▁begin|>from players.player import player
from auxiliar.aux_plot import *
import random
from collections import deque
import sys
sys.path.append('..')
import tensorblock as tb
import numpy as np
import tensorflow as tf
# PLAYER REINFORCE RNN
class player_... | input = 'Cost',
learning_rate = self.LEARNING_RATE,
name = 'Optimizer' ) |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011-2015 Slack
#
# 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 r... | # |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from redisca.frontend import views
app_name = 'frontend'
urlpatterns = [<|fim▁hole|><|fim▁end|> | url(r'^$', views.template_list, name='template_list'),
url(r'^([a-zA-Z0-9_\./\-]+)$', views.static_template, name='template'),
] |
<|file_name|>test_rl_accel.py<|end_file_name|><|fim▁begin|>__version__=''' $Id'''
__doc__='''basic tests.'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, printLocation
setOutDir(__name__)
import unittest
def getrc(defns,depth=1):
from sys import getrefcount, _getframe
f = _getframe(depth... | if G is not G0 or G is L: break
LL.append(L) |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.conf import settings
from django.contrib import admin
if 'django.contrib.auth' in settings.INSTALLED_APPS:
from tastypie.models import ApiKey
class ApiKeyInline(admin.StackedInline):
model = ApiKey
extra = 0
ABSTR... | |
<|file_name|>autoregressive_layers.py<|end_file_name|><|fim▁begin|>import numpy as np
import six
import tensorflow as tf
from tensorflow_probability.python.bijectors.masked_autoregressive import (
AutoregressiveNetwork, _create_degrees, _create_input_order,
_make_dense_autoregressive_masks, _make_masked_constra... | # Input-to-hidden, hidden-to-hidden, and hidden-to-output layers:
# [..., self._event_size] -> [..., self._hidden_units[0]].
# [..., self._hidden_units[k-1]] -> [..., self._hidden_units[k]].
# [..., self._hidden_units[-1]] -> [..., event_size * self._params]. |
<|file_name|>var_dir_ind_reg.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use pest::Error;
use var_instr::variable::{Variable, AsComplete, LabelNotFound};
use var_instr::variable::FromPair;<|fim▁hole|>use machine::instruction::mem_size::MemSize;
use machine::instruction::parameter::{Direct, Indirect, ... | |
<|file_name|>runtime.rs<|end_file_name|><|fim▁begin|>use crate::{
ast::AST,
compiler::compile_single,
errors::Error,
parser::{parse, ParseError},
values::RcValue,
vm::VM,
};
use std::{fs, path::Path};
pub struct Runtime {<|fim▁hole|> pub fn new() -> Runtime {
Runtime { vm: VM::new() ... | vm: VM,
}
impl Runtime { |
<|file_name|>sorted-list.py<|end_file_name|><|fim▁begin|># -----------------------------------------------------------
# compares the creation of sorted lists using the python
# bisect module, and the "usual" way
#o
# (C) 2015 Frank Hofmann, Berlin, Germany
# Released under GNU Public License (GPL)
# email frank.hofma... | for element in range(200000):
# choose a number between 0 and 1000
newNumber = random.randint(0, 1000) |
<|file_name|>func.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from unidecode import unidecode
import os, sys
from hashlib import md5 as hasher
import binascii
import settings
def gen_flattened_list(iterables):
for item in iterables:
if hasattr(item, '__iter__'):
for i in item:
... | # -*- coding: utf8 -*-
import re |
<|file_name|>auth.rs<|end_file_name|><|fim▁begin|>use base64::{decode_config, URL_SAFE};
use hyper::header;<|fim▁hole|>use crate::{
base::{ctx::Ctx, middleware::MiddleWare, response, HeaderGetStr, Request, Response},
config::Auth,
handlers::method_maybe_proxy,
};
#[derive(Debug, Clone)]
pub struct Authenti... |
use std::{net::SocketAddr, str};
|
<|file_name|>背包问题.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <cstring>
#define MAXN 40
struct Node
{
int volume;
int weight;
} ;
using namespace std;
Node test[MAXN];
int Max[MAXN];
int limit, number;
int dp( int );
<|fim▁hole|>{
cout << "Please iuput number: ";
cin >> number;
... | int main( void ) |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
// require('crash-reporter').start();
// Keep a global reference of the window... | |
<|file_name|>visit_ast.rs<|end_file_name|><|fim▁begin|>//! The Rust AST Visitor. Extracts useful information and massages it into a form
//! usable for `clean`.
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::... | |
<|file_name|>eos_vlan.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (c) 2015, Arista Networks, 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 sou... | if result: |
<|file_name|>runserver.py<|end_file_name|><|fim▁begin|>from swappr import app
<|fim▁hole|><|fim▁end|> | app.run(debug=True, host="0.0.0.0", port=9000) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.