prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>test_account_rest_permissions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of EUDAT B2Share. # Copyright (C) 2017 University of Tuebingen, CERN, CSC, KTH. # # B2Share is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Lice...
res = client.get(url, headers=headers) assert res.status_code == expected_code
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import * as React from "react"; import { VirtualFarmBotProps } from "../../interfaces"; import { BooleanSetting } from "../../../../session_keys"; import { BotFigure } from "./bot_figure"; import { BotTrail } from "./bot_trail"; import { BotPeripherals } from "./bot_p...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* Copyright (c) 2016 Saurav Sachidanand Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the righ...
CR3, CR4,
<|file_name|>homework2-4_csv_ex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding: utf-8 #copyRight by heibanke import csv import re <|fim▁hole|>csvfile = open('beijing_jt.csv','r') reader = csv.reader(csvfile) # reader.next() only can use in py2 next(reader) jt_info = next(reader) prin...
<|file_name|>receipt.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum 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 Free...
"fmt" "io" "math/big"
<|file_name|>test_parsable.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # name: test_parsable.py # author: Harold Bradley III # email: harold@bradleystudio.net # created on: 01/16/2016<|fim▁hole|>A unit test for ext_pylib file module's Parsable m...
# # pylint: disable=invalid-name,no-member """
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import inselect REQUIREMENTS = [ # TODO How to specify OpenCV? 'cv2>=3.1.0', 'numpy>=1.11.1,<1.12', 'Pillow>=3.4.2,<3.5', 'python-dateutil>=2.6.0,<2.7', 'pytz>=2016.7', 'PyYAML>=3.12,<...
for dep in pylibdmtx.EXTERNAL_DEPENDENCIES + pyzbar.EXTERNAL_DEPENDENCIES ] + _qt_files(site_packages)
<|file_name|>BasicPublishMethodHandler.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2005-2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the Lice...
<|file_name|>auto_copy_daemon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ The daemon that calls auto_copy.py uppon optical disc insertion """ import signal import sys import time sys.path.append('/usr/local/bin') import auto_copy SIGNAL_RECEIVED = False def run_daemon(config)...
config: configParser object """ signal.signal(signal.SIGUSR1, signal_handler) while True:
<|file_name|>t411.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals, division, absolute_import from builtins import * # pylint: disable=unused-import, redefined-builtin from flexget import options, plugin from flexget.event import event from flexget.terminal import console from flexget.manager i...
<|file_name|>BookmarkList-mocha.js<|end_file_name|><|fim▁begin|>/*global beforeEach, describe, it,*/ /*eslint no-unused-expressions: 0*/ 'use strict'; require('./testdom')('<html><body></body></html>'); var expect = require('chai').expect; var React = require('react/addons'); var TestUtils = React.addons.TestUt...
<|file_name|>testUtils.ts<|end_file_name|><|fim▁begin|>import { ICompilerOptions } from '../compilerOptions/interfaces'; import { transformModule } from './core/transformModule'; import { generate } from './generator/generator'; import { ASTNode } from './interfaces/AST'; import { ITransformer, ITransformerCommon } fro...
<|file_name|>ClusterFactory.java<|end_file_name|><|fim▁begin|>package org.eggermont.hm.cluster; import cern.colt.matrix.DoubleFactory1D; import cern.colt.matrix.DoubleMatrix1D; import cern.colt.matrix.DoubleMatrix2D; public class ClusterFactory { private final DoubleMatrix2D x; private final DoubleMatrix1D ...
<|file_name|>chip8.rs<|end_file_name|><|fim▁begin|>use std::io::Read; use std::fmt; extern crate rand; use self::rand::Rng; use instruction::{Opcode, Instruction}; use enum_primitive::FromPrimitive; const RAM_SIZE: usize = 4096; const GPR_COUNT: usize = 16; const NUMBER_OF_KEYS: usize = 16; // 60Hz const TIME_STEP...
time_acc: f32, instruction: Instruction,
<|file_name|>script.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Copyright (c) 2013-2014 Bongger Developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/m...
bool IsMine(const CKeyStore &keystore, const CTxDestination &dest) {
<|file_name|>vgg.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015-2016 Anish Athalye. Released under GPLv3. import tensorflow as tf import numpy as np import scipy.io import pdb MEAN_PIXEL = np.array([ 123.68 , 116.779, 103.939]) def net(data_path, input_image): layers = ( 'conv1_1', 'relu1_1', 'co...
'conv3_1', 'relu3_1', 'conv3_2', 'relu3_2', 'conv3_3', 'relu3_3', 'conv3_4', 'relu3_4', 'pool3',
<|file_name|>BSPTree.py<|end_file_name|><|fim▁begin|>from random import randint, seed, choice, random from numpy import zeros, uint8, cumsum, floor, ceil from math import sqrt, log from collections import namedtuple from PIL import Image from logging import info, getLogger class Tree: def __init__(self, leaf): self...
canvas = Canvas(MAP_WIDTH, MAP_HEIGHT) canvas.set_brush("empty")
<|file_name|>temporal_analysis_widget.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- from PyQt5 import QtWidgets from view.analysis_widget import AnalysisWidget # noinspection PyPep8Naming class TemporalAnalysisWidget(AnalysisWidget): # noinspection PyArgumentList def __init...
<|file_name|>CreateProfileForm.py<|end_file_name|><|fim▁begin|><|fim▁hole|>.. moduleauthor:: Dan Schlosser <dan@schlosser.io> """ from flask.ext.wtf import Form from wtforms import StringField, HiddenField from wtforms.validators import URL, Email, Required EMAIL_ERROR = 'Please provide a valid email address.' clas...
""" .. module:: CreateProfileForm :synopsis: A form for completing a user's profile.
<|file_name|>linkmap.py<|end_file_name|><|fim▁begin|># Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.org> # Copyright (C) 2009-2013 Kai Willadsen <kai.willadsen@gmail.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...
from gi.repository import Gtk from meld.misc import get_common_theme from meld.settings import meldsettings
<|file_name|>simplify.py<|end_file_name|><|fim▁begin|># Natural Language Toolkit: POS Tag Simplification # # Copyright (C) 2001-2013 NLTK Project # Author: Steven Bird <stevenbird1@gmail.com> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT # Brown Corpus # http://khnt.hit.uib.no/icame/manuals...
tag = wsj_mapping[tag.lower()]
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Facebook, Inc. and its affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ use super::*; use once_cell::sync::Lazy; use parking_lot::Mutex; use regex::Regex; use std...
<|file_name|>html.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #![allow(unrooted_must_root)] use dom::bindings::codegen::Bindi...
};
<|file_name|>htmlformcontrolscollection.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 https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::codegen::Bindin...
Some(RadioNodeListOrElement::Element(elem)) } else { // Step 4-5
<|file_name|>druid-query.tsx<|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 unde...
}
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Django settings for cbs project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the...
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3',
<|file_name|>eclipse.py<|end_file_name|><|fim▁begin|># Copyright 2014-2015 0xc0170 # # 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 # # Unles...
<|file_name|>p0017_test.py<|end_file_name|><|fim▁begin|>import unittest class Test0017(unittest.TestCase): def test_problem(self): one_to_nine = [3, 3, 5, 4, 4, 3, 5, 5, 4] ten_to_nineteen = [3, 6, 6, 8, 8, 7, 7, 9, 8, 8] twenty_to_ninety = [6, 6, 5, 5, 5, 7, 6, 6] words_len = 0 ...
sum_10_to_19 = sum(ten_to_nineteen) sum_20_to_90 = sum(twenty_to_ninety)
<|file_name|>bitcoin_it.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="it" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Litecoin</source> ...
<location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/>
<|file_name|>Alternative.ts<|end_file_name|><|fim▁begin|>/* * @Author: aaronpmishkin * @Date: 2016-05-25 16:41:41 * @Last Modified by: aaronpmishkin * @Last Modified time: 2016-09-22 20:35:14 */ // Import Utility Classes: import * as Formatter from '../modules/utilities/classes/Formatter'; /* Th...
@description Constructs a new Alternative with no consequences. Objective consequences for the new
<|file_name|>BaseControl.ts<|end_file_name|><|fim▁begin|>// NG2 import { EventEmitter } from '@angular/core'; import { Validators } from '@angular/forms'; // APP import { Helpers } from '../../../utils/Helpers'; import { notify } from '../../../utils/notifier/notifier.util'; import { IMaskOptions } from '../Control'; i...
metaType: string;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># This work was created by participants in the DataONE project, and is # jointly copyrighted by participating institutions in DataONE. For # more information on DataONE, see our web site at http://dataone.org. # # Copyright 2009-2019 DataONE # # Licensed under the...
# http://www.apache.org/licenses/LICENSE-2.0
<|file_name|>response.rs<|end_file_name|><|fim▁begin|>// src/network/rpc/response.rs // Copyright (C) 2017 authors and contributors (see AUTHORS file) // // This file is released under the MIT License. //! This module defines the Response RPC message type. //! //! A Response RPC message is used by a server to send a r...
fn as_vec(&self) -> &Vec<Value> { self.msg.as_vec()
<|file_name|>rpath.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
let mut lib = os::make_absolute(lib); lib.pop(); let mut output = os::make_absolute(output);
<|file_name|>about_packages.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # This is very different to AboutModules in Ruby Koans # Our AboutMultipleInheritance class is a little more comparable # from runner.koan import * # # Package hierarchy of Python Koans project: # # contemplat...
def test_subfolders_become_modules_if_they_have_an_init_module(self): # Import ./a_package_folder/__init__.py from .a_package_folder import an_attribute
<|file_name|>backend_test.go<|end_file_name|><|fim▁begin|>package trace import ( "context" "fmt" "io" "io/ioutil" "net" "os" "path/filepath" "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/stripe/veneur/ssf" ) func benchmarkPlainCombination(backend ...
<|file_name|>cgroup_service_test.py<|end_file_name|><|fim▁begin|>"""Unit test for cgroup_service - Treadmill cgroup service. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import tempfile import unittes...
])
<|file_name|>net.go<|end_file_name|><|fim▁begin|>package daemon import ( "fmt" "os" "strconv" "strings" "time" ) var ( netdir = "/sys/class/net" rxfile = "/sys/class/net/%s/statistics/rx_bytes" txfile = "/sys/class/net/%s/statistics/tx_bytes" ) type Net struct { Rxrate float64 Txrate float64 } func NetRat...
errc := make(chan error) var err error
<|file_name|>Form1Impl.go<|end_file_name|><|fim▁begin|>// 在这里写你的事件 package main import ( "github.com/ying32/govcl/vcl" "github.com/ying32/govcl/vcl/rtl" "github.com/ying32/govcl/vcl/types" "github.com/ying32/govcl/vcl/types/keys" "github.com/ying32/govcl/vcl/types/messages" "github.com/ying32/govcl/vcl/win" ) ...
*/ if msg.Msg == messages.WM_HOTKEY { if msg.WParam == types.WPARAM(f.hotKeyId) { vcl.ShowMessage("按下了Ctrl+F1")
<|file_name|>test.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from test_support import * prove_all(no_fail=True, steps = 400)<|fim▁end|>
<|file_name|>type_converter.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------ # type_converter.py (Section 6.2) #------------------------------------------------------------------------------ #----------------------------------------------------------------...
<|file_name|>learn.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" "io" "io/ioutil" "log" "net" "net/http" ) func main() { http.HandleFunc("/host", hostFinder) http.HandleFunc("/ip", sourceIp) http.HandleFunc("/date", GetJosnTime) fmt.Println("Listening on 0.0.0.0:8000") err := http.ListenAndS...
<|file_name|>sc_main.cpp<|end_file_name|><|fim▁begin|>// -*- SystemC -*- // DESCRIPTION: Verilator Example: Top level main for invoking SystemC model // // This file ONLY is placed under the Creative Commons Public Domain, for // any use, without warranty, 2017 by Wilson Snyder. // SPDX-License-Identifier: CC0-1.0 //==...
#if VM_TRACE // Flush the wave files each cycle so we can immediately see the output // Don't do this in "real" programs, do it in an abort() handler instead
<|file_name|>issue-34947-pow-i32.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 // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache...
#[no_mangle] pub fn issue_34947(x: i32) -> i32 {
<|file_name|>run.py<|end_file_name|><|fim▁begin|><|fim▁hole|> app.run()<|fim▁end|>
from organise import app
<|file_name|>MonsterManager.cpp<|end_file_name|><|fim▁begin|>// // MonsterManager.cpp // LuoBoGuard // // Created by jwill on 16/2/26. // // #include "MonsterManager.hpp" #include "PointConvertCtrl.hpp" MonsterManager* MonsterManager::s_sharedMonsterManager = nullptr; MonsterManager* MonsterManager::getInstance()...
loadMonster(); }
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>var path = require('path'); var webpack = require('webpack'); module.exports = { devtool: 'source-map', entry: [ 'webpack-hot-middleware/client', './index' ], output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js', pub...
plugins: [ new webpack.optimize.OccurenceOrderPlugin(), new webpack.HotModuleReplacementPlugin(),
<|file_name|>DrillDownPathBean.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. * You m...
import javax.xml.bind.annotation.XmlAccessorType;
<|file_name|>topsort.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # −*− coding: UTF−8 −*− # Topological Sorting from collections import defaultdict def topsort(graph): if not graph: return [] # 1. Count every node's dependencies count = defaultdict(int) for node in graph: for...
graph = {
<|file_name|>search.py<|end_file_name|><|fim▁begin|>""" search.py """ from flask import Flask, request, redirect, abort, make_response from flask import render_template, flash import bibserver.dao from bibserver import auth import json, httplib from bibserver.config import config import bibserver.util as util import l...
# look for collection metadata metadata = bibserver.dao.Collection.get_by_owner_coll(self.parts[0],self.parts[1])
<|file_name|>BrowserFactory.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys<|fim▁hole|> class BrowserFactory(object): def create(self, type, *args, **kwargs): return getattr(__import__(type), type)(*args, **kwargs)<|fim▁end|>
sys.path.append('../browser_interface/browser')
<|file_name|>Startup.cpp<|end_file_name|><|fim▁begin|>/* UrchinTSS Copyright (c) Microsoft Corporation All rights reserved. MIT License 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 witho...
} if((result = Command_Unmarshal(
<|file_name|>DropDownPager.js<|end_file_name|><|fim▁begin|>define([ "dojo/_base/declare", "dojo/_base/lang", "dojo/store/Memory", "dojo/query", "dojo/dom-attr", "dijit/_WidgetBase", "dijit/_FocusMixin", "dijit/_TemplatedMixin", "dijit/form/FilteringSelect" ], function(declare, lang, Store, query, domAttr, _Wid...
}); }, //Public-----------------------------------------------------------------------------
<|file_name|>xy_pad.rs<|end_file_name|><|fim▁begin|>use { Backend, Color, Colorable, Frameable, FramedRectangle, FontSize, IndexSlot, Labelable, Line, Mouse, Positionable, Scalar, Sizeable, Text, Widget, }; use num::Float; use widget; use utils::{map_range, va...
fn unique_kind(&self) -> &'static str { KIND
<|file_name|>Test_objdump_addr.py<|end_file_name|><|fim▁begin|>''' Created on Oct 29, 2015 @author: yangke ''' from model.TaintVar import TaintVar from TraceTrackTest import TraceTrackTest class Test_objdump_addr: def test(self):<|fim▁hole|> not_pass_message="ERRORS FOUND IN BINUTILS-2.23 'addr[1]' TEST!" ...
passed_message="BINUTILS-2.23 'addr[1]' TEST PASSED!"
<|file_name|>caprobe.py<|end_file_name|><|fim▁begin|># # Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com # # This file is part of EigenD. # # EigenD is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
def main(): macosx_native.probe_coreaudio(True,True)
<|file_name|>tables.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals from django.core.paginator import Paginator from django.core import urlresolvers from django.utils.html import mark_safe, escape import django_tables2 as tables from django_tables2.tables import Table from dja...
""" This column allows you to pass in a list of links that will form an Action Column
<|file_name|>sat.py<|end_file_name|><|fim▁begin|>"""Class definitions for Speaker Adapted Triphone trainer""" from __future__ import annotations import multiprocessing as mp import os import re import shutil import subprocess import time from queue import Empty from typing import Dict, List, NamedTuple import tqdm f...
else: for args in arguments:
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>""" PynamoDB exceptions """ from typing import Any, Optional import botocore.exceptions class PynamoDBException(Exception): """ A common exception class """ def __init__(self, msg: Optional[str] = None, cause: Optional[Exception] = None) -> Non...
def prepend_path(self, attr_name: str) -> None: self.attr_path = attr_name + '.' + self.attr_path
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>from django.conf import settings BACKENDS = getattr(settings, 'FAIREPART_BACKENDS', ( 'fairepart.backends.facebook.FacebookBackend', 'fairepart.backends.google.GoogleOAuth2Backend', )) RELATION_LIST_PAGINATE_BY = getattr(settings, 'FAIREPART_RELATION_LIST...
GOOGLE_APP_NAME = getattr(settings, 'FAIREPART_GOOGLE_APP_NAME', '')
<|file_name|>web_modform_space_computing.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2010 Fredrik Strömberg <fredrik314@gmail.com>, # Stephan Ehlen <> # Distributed under the terms of the GNU General Public Lic...
r"""
<|file_name|>placeholder.go<|end_file_name|><|fim▁begin|>/* Copyright 2020 The Knative Authors <|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-...
<|file_name|>lxqt-notificationd_cy.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="cy"> <context> <name>NotificationActionsComboWidget</name> <message> <location filename="../notificationwidgets.cpp" line="123"/> <source>Actions:</...
<location filename="../notifyd.cpp" line="274"/> <source>Options</source> <translation type="unfinished"></translation>
<|file_name|>stdio.py<|end_file_name|><|fim▁begin|># Twisted, the Framework of Your Internet # Copyright (C) 2001 Matthew W. Lefkowitz # # 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 Softwar...
<|file_name|>ICacheReplaceEntryProcessor.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2008-2017, Hazelcast, Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License...
<|file_name|>foobar.py<|end_file_name|><|fim▁begin|># Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Python tests originally created or extracted from other peoples work. The # parts were too small to be protected. # # Licensed under the Apache License, Version 2.0 (the "License"); # you ...
#
<|file_name|>ServiceMapParserTest.java<|end_file_name|><|fim▁begin|>package fr.adrienbrault.idea.symfony2plugin.tests; import fr.adrienbrault.idea.symfony2plugin.ServiceMap; import fr.adrienbrault.idea.symfony2plugin.ServiceMapParser; import org.junit.Test; import org.junit.Assert; import java.io.ByteArrayInputStream...
String xmlString = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<container>" + "<service id=\"adrienbrault\" class=\"AdrienBrault\\Awesome\"/>" +
<|file_name|>pull_data.py<|end_file_name|><|fim▁begin|>from path import Path import zipfile import urllib2 Path('tmp').mkdir_p() for model_name in ('seq2seq','seq2tree'): for data_name in ('jobqueries','geoqueries','atis'): fn = '%s_%s.zip' % (model_name, data_name) link = 'http://dong.li/lang2logic/' + fn ...
<|file_name|>cropsl.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''You can easily read off two sample,line coordinates from qview, but ISIS crop wants one sample,line and then offsets. This just takes two coordinates,<|fim▁hole|># Copyright 2016, 2019, Ross A. Beyer (rbeyer@seti.org) # # Licensed under the A...
does the math, and then calls crop.'''
<|file_name|>fg-joomla-to-wordpress-admin.js<|end_file_name|><|fim▁begin|>(function( $ ) { 'use strict'; var that; var fgj2wp = { plugin_id: 'fgj2wp', fatal_error: '', /** * Manage the behaviour of the Skip Media checkbox */ hide_unhide_media: function() { $("#media...
}); },
<|file_name|>mod438.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var value=mod437+1; export default value;<|fim▁end|>
import mod437 from './mod437';
<|file_name|>che-svn.spec.ts<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015-2017 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.ecl...
workspace = cheWorkspace;
<|file_name|>PopularMoviesFragment.java<|end_file_name|><|fim▁begin|>package com.gbaldera.yts.fragments; import android.content.Loader; import com.gbaldera.yts.loaders.PopularMoviesLoader; import com.jakewharton.trakt.entities.Movie; import java.util.List; public class PopularMoviesFragment extends BaseMovieFragme...
<|file_name|>queue.go<|end_file_name|><|fim▁begin|>package main import ( "bytes"<|fim▁hole|> "github.com/bitly/go-nsq" ) // BackendQueue represents the behavior for the secondary message // storage system type BackendQueue interface { Put([]byte) error ReadChan() chan []byte // this is expected to be an *unbuffere...
<|file_name|>debugshell.py<|end_file_name|><|fim▁begin|># debugshell extension """a python shell with repo, changelog & manifest objects""" import mercurial import code def debugshell(ui, repo, **opts): objects = { 'mercurial': mercurial, 'repo': repo, 'cl': repo.changelog, 'mf': r...
} bannermsg = "loaded repo : %s\n" \ "using source: %s" % (repo.root,
<|file_name|>token.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
Ident(sid, Plain) => {
<|file_name|>graph_test.go<|end_file_name|><|fim▁begin|>package report import ( "bytes" "io" "os" "testing" "github.com/remyoudompheng/go-misc/pprof/parser" ) func TestCpuProfileGraph(t *testing.T) { syms := readSymbols("testdata/cpu.prof.symbols") resolve := func(u uint64) string { s, _ := lookup(u, syms); r...
<|file_name|>_hash.py<|end_file_name|><|fim▁begin|>from __future__ import division <|fim▁hole|># X.flags.writeable = False # h = hash(X.tobytes()) # X.flags.writeable = writeable # return h def filehash(filepath): r"""Compute sha256 from a given file.""" import hashlib BUF_SIZE = 65536 ...
# # TODO: document those functions # def array_hash(X): # writeable = X.flags.writeable
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models, DEFAULT_DB_ALIAS, connection from django.contrib.auth.models import User from django.conf import settings class Animal(models.Model): name = models.CharField(max_length=150) latin_name = models.CharField(max_length=150) coun...
# ome models with pathological circular dependencies class Circle1(models.Model):
<|file_name|>hierarchy-utils.js<|end_file_name|><|fim▁begin|>/* * Waltz - Enterprise Architecture * Copyright (C) 2016, 2017, 2018, 2019 Waltz open source project * See README.md for more information * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in complian...
}; }); }
<|file_name|>OutgoingCallListFragment.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2010-2012 Regis Montoya (aka r3gis - www.r3gis.fr) * This file is part of CSipSimple. * * CSipSimple is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as publis...
<|file_name|>naivebayes.py<|end_file_name|><|fim▁begin|>""" Simple implementation of mutinomial Naive Bayes for text classfification. TODO: Apply to 20 Newsgroups, Reuters-21578 datasets """ __author__ = 'Duong Nguyen' __version__ = '0.0' import math import sys<|fim▁hole|> def __init__(self): self.c...
from collections import defaultdict class NaiveBayes(object): """ Multinomial Naive Bayes"""
<|file_name|>MenuChildrenWrapper.spec.js<|end_file_name|><|fim▁begin|>import React from 'react' import {intlEnzyme} from 'tocco-test-util' import MenuChildrenWrapper from './MenuChildrenWrapper' import {StyledMenuChildrenWrapper} from './StyledComponents' describe('admin', () => { describe('components', () => { ...
<|file_name|>traileraddict.py<|end_file_name|><|fim▁begin|>import re from .common import InfoExtractor class TrailerAddictIE(InfoExtractor): _VALID_URL = r'(?:http://)?(?:www\.)?traileraddict\.com/(?:trailer|clip)/(?P<movie>.+?)/(?P<trailer_name>.+)' _TEST = { u'url': u'http://www.traileraddict.com/t...
name = mobj.group('movie') + '/' + mobj.group('trailer_name') webpage = self._download_webpage(url, name)
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|>### # Copyright (c) 2004-2005, Kevin Murphy # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met:<|fim▁hole|># # * Redistributions of source code mu...
<|file_name|>graph_models.py<|end_file_name|><|fim▁begin|>import six import sys from optparse import make_option, NO_DEFAULT from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django_extensions.management.modelviz import generate_dot try: import pygraphviz ...
make_option('--exclude-models', '-X', action='store', dest='exclude_models',
<|file_name|>job_data.py<|end_file_name|><|fim▁begin|>"""Defines the data needed for executing a job""" from __future__ import unicode_literals import logging import os from numbers import Integral from job.configuration.data.data_file import DATA_FILE_PARSE_SAVER, DATA_FILE_STORE from job.configuration.data.exceptio...
<|file_name|>t_model.py<|end_file_name|><|fim▁begin|>"""Tests for GP and SP classes""" import math import unittest import numpy as np from gpkit import (Model, Monomial, settings, VectorVariable, Variable, SignomialsEnabled, ArrayVariable) from gpkit.geometric_program import GeometricProgram from gpk...
x = VectorVariable(2, 'x') y = VectorVariable(2, 'y') prob = Model(cost=(sum(x) + 2*sum(y)), constraints=[x*y >= 1])
<|file_name|>connectionitem.cpp<|end_file_name|><|fim▁begin|>/* Copyright 2012 Arthur de Souza Ribeiro <arthurdesribeiro@gmail.com> Copyright 2012-2013 Lamarque V. Souza <lamarque@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as publi...
void ConnectionItem::setShowMoreChecked(const bool show) {
<|file_name|>Action_GIST.cpp<|end_file_name|><|fim▁begin|>#include <cmath> #include <cfloat> // DBL_MAX #include "Action_GIST.h" #include "CpptrajStdio.h" #include "Constants.h" #include "DataSet_MatrixFlt.h" #include "DataSet_GridFlt.h" #include "DataSet_GridDbl.h" #include "ProgressBar.h" #include "StringRoutines.h" ...
vectors.push_back( MinImagedVec(vec, cent, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd().FracCell())); vec = Vec3(frm.Frm().xAddress() + (order_indices.at(headAtomIndex).at(2) * 3)); vectors.push_back( MinImagedVec(vec, cent, frm.Frm().BoxCrd().UnitCell(), frm.Frm().BoxCrd(...
<|file_name|>Pymolecule.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2016-2017, Zhijiang Yao, Jie Dong and Dongsheng Cao # All rights reserved. # This file is part of the PyBioMed. # The contents are covered by the terms of the BSD license # which is included in the file license.txt, fou...
return res def GetMOE(self): """
<|file_name|>shorten.js<|end_file_name|><|fim▁begin|>var counter = require('mongodb-counter'); var s3redirect = require('./s3redirect'); module.exports = shortener; module.exports.redis = require('./redisStore'); module.exports.mongodb = require('./mongoStore'); module.exports.s3 = s3redirect; module.exports.counter = ...
return {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::env; use std::error::Error; use std::ffi::OsStr; use std::fmt; use std::fs; use std::io::prelude::*; use std::os; use std::path::{Path, PathBuf}; use std::process::Output; use std::str; use std::usize; use url::Url; use hamcrest as ham; use cargo::util::Process...
SymlinkBuilder { dst: dst, src: src } } #[cfg(unix)]
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from avatar.templatetags.avatar_tags import avatar_url from django.conf import settings from django.contrib.auth.models import User from django.core.urlresolvers import reverse from tastypie import fields from tastypie.resources import ModelResource from accounts.models ...
fields = ['username', 'first_name', 'last_name', 'last_login', 'profile']
<|file_name|>management.js<|end_file_name|><|fim▁begin|>$('#new-orders-button').click(function(){ $('#orders-pane').find('div').remove(); $.ajax({ type: 'POST', url: "http://localhost/3k/orders/app/getNewOrders", //data: {activitiesArray : pass_order}, dataType: 'json' }).done(f...
var id = $(this).attr('data-id'); //console.log(id);
<|file_name|>mcs_player.rs<|end_file_name|><|fim▁begin|>extern crate time; extern crate rand; use {Player, MoveResult}; use game_manager::{Game, State}; use gdl::{Move, Score, Role};<|fim▁hole|>/// A Monte Carlo search player. This player should only be used for 2 player, constant sum, /// turn based games. pub struct...
use std::cmp::{max, min};
<|file_name|>sky.rs<|end_file_name|><|fim▁begin|>use std::f32::consts::PI; use cgmath; use cgmath::prelude::*; use rand::Rng; use three::{self, Object}; use COLOR_WHITE; pub struct Sky { pub group: three::Group, } impl Sky { fn make_cloud<R: Rng>( rng: &mut R, factory: &mut three::Factory, ...
[ i as f32 * 15.0, rng.gen::<f32>() * 10.0,
<|file_name|>mid-path-type-params.rs<|end_file_name|><|fim▁begin|>struct S<T> { contents: T, } impl<T> S<T> { fn new<U>(x: T, _: U) -> S<T> { S { contents: x, } } } trait Trait<T> { fn new<U>(x: T, y: U) -> Self; } struct S2 { contents: int, } impl Trait<int> for S2 {...
} fn main() { let _ = S::<int>::new::<float>(1, 1.0);
<|file_name|>AbsAnalyst.py<|end_file_name|><|fim▁begin|>import re<|fim▁hole|> LOGTIME_REGEXP = re.compile("(?P<log_time>\w{4}-\w{2}-\w{2} \w{2}:\w{2}:\w{2})") def __init__(self): raise NotImplemented def isMatch(self, line): raise NotImplemented def doStatistic(self): raise NotImplemented def doAnalyse(s...
import Queue class AbsAnalyst(object): """docstring for AbsAnalyst"""
<|file_name|>smartnet2decode.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ This program decodes the Motorola SmartNet II trunking protocol from the control channel Tune it to the control channel center freq, and it'll spit out the decoded packets. In what format? Who knows. Based on your AIS decoding ...
if __name__ == '__main__': main()