prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># coding=utf-8
import random
import time
import threading
import unittest
from lru_cache import LruCache
class TesLruCache(unittest.TestCase):
def test_cache_normal(self):
a = []
@LruCache(maxsize=2, timeout=1)
def foo(num):
a... | @LruCache()
def foo(num):
a.append(num)
return num |
<|file_name|>S11.2.4_A1.1_T1.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* Arguments : ()
*
* @path ch11/11.2/11.2.4/S11.2.4_A1.1_T1.js
* @description Function is declared with no FormalParameterList
*/
function f_arg() {
return arguments;<|fim▁hole|>
//CHECK... | } |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# pyspark documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 28 15:17:47 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration valu... | |
<|file_name|>test-011-child-table.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Re... | # names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
# |
<|file_name|>cache.rs<|end_file_name|><|fim▁begin|>use criterion::{criterion_group, criterion_main, Criterion};
use once_cell::sync::Lazy;
use rusttype::gpu_cache::*;<|fim▁hole|>
/// Busy wait 2us
fn mock_gpu_upload(_region: Rect<u32>, _bytes: &[u8]) {
use std::time::{Duration, Instant};
let now = Instant::now... | use rusttype::*; |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use rocket::http::Status;
use rocket::response::{Response, Responder, status};
use rocket_contrib::JSON;<|fim▁hole|>#[derive(Debug)]
pub enum ApiError {
MultipleError(MultipleError),
}
impl<'r> Responder<'r> for ApiError {
fn respond(self) -> Result<Response<'... | use accord::MultipleError;
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext_lazy as _
from taggit.forms import TagField
from places_core.forms import BootstrapBaseForm<|fim▁hole|>
from .models import Category, News
class NewsForm(forms.ModelForm,... | |
<|file_name|>noop_waker.rs<|end_file_name|><|fim▁begin|>//! Utilities for creating zero-cost wakers that don't do anything.
use core::task::{RawWaker, RawWakerVTable, Waker};
use core::ptr::null;
#[cfg(feature = "std")]
use core::cell::UnsafeCell;
unsafe fn noop_clone(_data: *const ()) -> RawWaker {
noop_raw_wake... | thread_local! {
static NOOP_WAKER_INSTANCE: UnsafeCell<Waker> =
UnsafeCell::new(noop_waker()); |
<|file_name|>script3.py<|end_file_name|><|fim▁begin|>def ContinueCurse():<|fim▁hole|> test_note_2 = (int(input("Type Second Test Value: ")))
tmp_note = (((test_note_1 + test_note_2)/2)*0.6)
if ((3 - tmp_note)/0.4) <= 5:
print "Keep Studying :D"
else:
print "Cancel course :/"
print ... | test_note_1 = (int(input("Type first Test Value: "))) |
<|file_name|>kernel_ridge_regression.py<|end_file_name|><|fim▁begin|>from pylab import figure,pcolor,scatter,contour,colorbar,show,subplot,plot,connect
from numpy import array,meshgrid,reshape,linspace,min,max
from numpy import concatenate,transpose,ravel
from modshogun import *
from modshogun import *
from modshogun i... | pcolor(x, y, z, shading='interp')
contour(x, y, z, linewidths=1, colors='black', hold=True)
|
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>from s3authbasic.testing import BaseAppTest, AUTH_ENVIRON
class ViewsTests(BaseAppTest):
def test_validpath(self):
for (path, expect) in (
('/', 'home'),
('/index.html', 'home'),
('/level1', 'level 1'),
... |
class MimeTypeTests(BaseAppTest): |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from d51.django.auth.decorators import auth_required
from django.contrib.sites.models import Site
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.exception... |
if url_to_share is None:
# TODO change to a 400
raise Http404 |
<|file_name|>clientset_generated.go<|end_file_name|><|fim▁begin|>package fake
import (
clientset "github.com/openshift/origin/pkg/image/generated/clientset"
imagev1 "github.com/openshift/origin/pkg/image/generated/clientset/typed/image/v1"
fakeimagev1 "github.com/openshift/origin/pkg/image/generated/clientset/typed... | |
<|file_name|>set_default_list.go<|end_file_name|><|fim▁begin|>package lists
// This file is generated by methodGenerator.
// DO NOT MOTIFY THIS FILE.
import (
"net/url"
"github.com/kawaken/go-rtm/methods"
)
// SetDefaultList returns "rtm.lists.setDefaultList" method instance.
func SetDefaultList(timeline string, ... |
return &methods.Method{Name: name, Params: p}
} |
<|file_name|>VisualisationFragment.java<|end_file_name|><|fim▁begin|>package uq.androidhack.flashspeak;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.su... |
/**
* This interface must be implemented by activities that contain this |
<|file_name|>LupusDataset.py<|end_file_name|><|fim▁begin|>import abc
import math
import numpy
from scipy.io import loadmat
from Configs import Configs
from Paths import Paths
from datasets.LupusFilter import VisitsFilter, \
NullFIlter, TemporalSpanFilter
from infos.Info import Info, NullInfo
from infos.InfoElemen... | feats = patience['features']
targets = patience['targets'] |
<|file_name|>EpworthSleepAssessmentVo.java<|end_file_name|><|fim▁begin|>//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# ... | if(existingErrors != null)
{
for(int x = 0; x < existingErrors.length; x++) |
<|file_name|>test_modeling_mobilebert.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2020 The HuggingFace Team. 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 a... | |
<|file_name|>scenarios.js<|end_file_name|><|fim▁begin|>'use strict';
/* http://docs.angularjs.org/guide/dev_guide.e2e-testing */<|fim▁hole|>describe('my app', function() {
beforeEach(function() {
browser().navigateTo('app/index-old.html');
});
it('should automatically redirect to /view1 when location hash... | |
<|file_name|>policies.py<|end_file_name|><|fim▁begin|># Copyright 2013-2016 DataStax, 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
#
# U... |
IGNORE = 2
"""
This should be returned from the below methods if the failure |
<|file_name|>param_vasicek.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Vasicek parameter class
~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import print_function, division
import numpy as np
from .param_generic import GenericParam
__all__ = ['VasicekParam']
class VasicekParam(... | |
<|file_name|>grading.py<|end_file_name|><|fim▁begin|># pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from common import *
from terrain.steps import reload_the_page
from selenium.common.exceptions import (
InvalidElementStateException, WebDriverException)
from nose.tools import asser... | def set_weight(step, weight): |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import unittest
from fire_risk.models import DIST
class TestDISTModel(unittest.TestCase):
def test_dist_import(self):<|fim▁hole|> 'beyond': 108959L,
'object_of_origin': 383787L,
'room_of_origin': 507378L,
... | floor_extent = False
results = {'floor_of_origin': 126896L, |
<|file_name|>number_op.py<|end_file_name|><|fim▁begin|># encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakosk... | from jx_base.expressions import NumberOp as NumberOp_
from jx_sqlite.expressions import _utils
from jx_sqlite.expressions._utils import SQLang, check
from mo_dots import wrap |
<|file_name|>no_0350_intersection_of_two_arrays_ii.rs<|end_file_name|><|fim▁begin|>struct Solution;
impl Solution {
pub fn intersect(nums1: Vec<i32>, nums2: Vec<i32>) -> Vec<i32> {
// key => num, value => 出现的次数
let mut map = std::collections::HashMap::with_capacity(nums1.len());
for num in n... | .get(pos.0..(pos.0 + max_len)) |
<|file_name|>lib.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/. */
//! This module contains traits in script used generically in the... | extern crate devtools_traits;
extern crate euclid;
extern crate ipc_channel;
extern crate libc; |
<|file_name|>AndroidGenerateDynamicMacros.ts<|end_file_name|><|fim▁begin|>import { Command } from '@expo/commander';
import path from 'path';
import { generateDynamicMacrosAsync } from '../dynamic-macros/generateDynamicMacros';
import { Directories } from '../expotools';<|fim▁hole|>const GENERATED_DIR = path.join(ANDR... |
const EXPO_DIR = Directories.getExpoRepositoryRootDir();
const ANDROID_DIR = Directories.getAndroidDir(); |
<|file_name|>CollectionCodexTest.java<|end_file_name|><|fim▁begin|>/*
* #%L
* FlatPack serialization code
* %%
* Copyright (C) 2012 Perka 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 ... | |
<|file_name|>issue-41803.rs<|end_file_name|><|fim▁begin|>// run-pass
/// A compile-time map from identifiers to arbitrary (heterogeneous) expressions
macro_rules! ident_map {
( $name:ident = { $($key:ident => $e:expr,)* } ) => {
macro_rules! $name {
$(
( $key ) => { $e };
... |
ident_map!(my_map = {
main => 0, |
<|file_name|>RecomputeParameters.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------#
# #
# This file is part of the Parametric Workbench ... | # This program is distributed in the hope that it will be useful, #
# but WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
# GNU General Public License for more details. # |
<|file_name|>Options.java<|end_file_name|><|fim▁begin|>/**
*
* This file is part of Disco.
*
* Disco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your... | gui.setVisible(true);
}
}); |
<|file_name|>model_tests.py<|end_file_name|><|fim▁begin|>from datetime import datetime, timedelta
import json
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django_dynamic_fixture import G, N
from freezegun import freeze_time
from mock import patch
from issue.models i... | self.assertEqual(IssueStatus.Resolved.value, Issue.objects.get(pk=issue.pk).status)
|
<|file_name|>VaultManager.py<|end_file_name|><|fim▁begin|>import os
from PyQt4 import QtCore, QtGui
from Extensions.Global import sizeformat
class SearchWidget(QtGui.QLabel):
def __init__(self, parent):
QtGui.QLabel.__init__(self, parent)
self._parent = parent
self.setSty... | self.sizeLabel = sizeLabel
self.busyIndicatorWidget = busyIndicatorWidget |
<|file_name|>symbols.py<|end_file_name|><|fim▁begin|>import re
import abc
from collections import deque
from copy import copy
from rdp.ast import Node
from rdp.exceptions import ParseError, UnexpectedToken
from rdp.utils import chain
def to_symbol(str_or_symbol, copy_if_not_created=False):
if isinstance(str_or_s... | repr(self.lexeme) |
<|file_name|>loader.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 the authors
*
* This file is part of usb_warrior.
*
* usb_warrior 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... | for(auto& file: _imageMap) {
if(file.second) {
_game->images()->releaseImage(file.second); |
<|file_name|>counts.rs<|end_file_name|><|fim▁begin|>use comment::Comment;
use config::{Config, Utf8Rule};
use count::Count;
use error::{CliError, CliResult};
use fmt::{self, Format};
use fsutil;
use gitignore;
use language::Language;
use regex::Regex;
use std::env;
use std::f64;
use std::fs::File;
use std::io::{self, R... | Ok(())
} |
<|file_name|>photo_shadow.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can re... | to_fp.close()
res = newimg.size
del im |
<|file_name|>json_test.py<|end_file_name|><|fim▁begin|># Rekall Memory Forensics
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.com
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... | def testAllObjectSerialization(self):
for vtype in self.session.profile.vtypes:
obj = self.session.profile.Object(vtype)
self.CheckObjectSerization(obj) |
<|file_name|>add_rack_bunker.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
class CommandAddRackBunker(CommandAddRack):
required_parameters = ["bunker", "row", "column"] |
<|file_name|>sky.cpp<|end_file_name|><|fim▁begin|>/**
* Sky profile implementation
*
* ICRAR - International Centre for Radio Astronomy Research
* (c) UWA - The University of Western Australia, 2016
* Copyright by UWA (in the framework of the ICRAR)
* All rights reserved
*
* Contributed by Aaron Robotham, Rodri... | |
<|file_name|>DisplayBar.java<|end_file_name|><|fim▁begin|>package com.tiketal.overwatch.util;
import org.bukkit.Bukkit;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.entity.Player;
public class DisplayBar {
private BossBar bar;
public DisplayB... | public void setTitle(String title) {
bar.setTitle(title); |
<|file_name|>d0.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | module.exports = function(){ return 'd0' } |
<|file_name|>test_cantact.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Tests for CANtact interfaces
"""
import unittest
import can
from can.interfaces import cantact<|fim▁hole|>
class CantactTest(unittest.TestCase):
def test_bus_creation(self):
bus = can.Bus(channel=0, bustype="cantact", _t... | |
<|file_name|>show_hostlink_hostlink.py<|end_file_name|><|fim▁begin|># -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#<|fim▁hole|>#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | # 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|>main.rs<|end_file_name|><|fim▁begin|>// Mandelbrot set in rust
//
// This code shows how to calculate the set in serial and parallel.
// More parallel versions will be added in the future.
//
// Written by Willi Kappler, grandor@gmx.de
//
// License: MIT
//
//#![feature(plugin)]
//
//#![plugin(clippy)]
//... | let mut image: Vec<u32> = vec![0; (mandel_config.img_size * mandel_config.img_size) as usize];
|
<|file_name|>property_tree_builder.cc<|end_file_name|><|fim▁begin|>// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/trees/property_tree_builder.h"
#include <stddef.h>
#include <map>
#inclu... | SkColor background_color = layer->background_color();
data_for_children->safe_opaque_background_color =
SkColorGetA(background_color) == 255 |
<|file_name|>SendDatagramMessage.java<|end_file_name|><|fim▁begin|>package pl.edu.mimuw.cloudatlas.agent.modules.network;
import java.net.InetAddress;
import pl.edu.mimuw.cloudatlas.agent.modules.framework.SimpleMessage;
public final class SendDatagramMessage extends SimpleMessage<byte[]> {
private InetAddress targ... | } |
<|file_name|>ofQuickTimeGrabber.cpp<|end_file_name|><|fim▁begin|>#include "ofQuickTimeGrabber.h"
#include "ofUtils.h"
#if !defined(TARGET_LINUX) && !defined(MAC_OS_X_VERSION_10_7)
//---------------------------------
#ifdef OF_VIDEO_CAPTURE_QUICKTIME
//---------------------------------
//-----------------------------... | |
<|file_name|>use.rs<|end_file_name|><|fim▁begin|>extern crate proc_macro_examples;
use proc_macro_examples::make_answer;
make_answer!();<|fim▁hole|>fn main() {
assert_eq!(42, answer());
}<|fim▁end|> | |
<|file_name|>linesearch_step.py<|end_file_name|><|fim▁begin|># Copyright 2020 Tensorforce Team. 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.apache.... | arguments_spec (specification): <span style="color:#0000C0"><b>internal use</b></span>.
"""
|
<|file_name|>stored_values.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
@author Luke C
@date Mon Mar 25 09:57:59 EDT 2013
@file ion/util/stored_values.py
'''
from pyon.core.exception import NotFound
import gevent
class StoredValueManager(object):
def __init__(self, container):
self.store = ... | return doc_id, rev
except KeyError as e:
if 'http' in e.message: |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>""".. Ignore pydocstyle D400.
===============
Signal Handlers
===============
"""
from asgiref.sync import async_to_sync<|fim▁hole|>
from django.conf import settings
from django.db import transaction
from django.db.models.signals import post_delete, post_save
from ... | |
<|file_name|>test_optimization.py<|end_file_name|><|fim▁begin|># Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0... | |
<|file_name|>SumLines.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
SumLines.py
---------------------
Date : August 2012<|fim▁hole|>*********************************************************************... | Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com |
<|file_name|>confirm-export.ts<|end_file_name|><|fim▁begin|>import require from 'require';
function getDescriptor(obj: Record<string, unknown>, path: string) {
let parts = path.split('.');
let value: unknown = obj;
for (let i = 0; i < parts.length - 1; i++) {
let part = parts[i]!;
// NOTE: This isn't ent... | desc = null;
} |
<|file_name|>ReferenceToLineMapping.java<|end_file_name|><|fim▁begin|>package hu.eltesoft.modelexecution.m2t.smap.emf;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
/**
* Maps qualified EMF object references to virtual line numbers. Line numbering
* starts fro... |
public int addLineNumber(QualifiedReference reference) { |
<|file_name|>test_server.py<|end_file_name|><|fim▁begin|># Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from common_openstack import OpenStackTest
class ServerTest(OpenStackTest):
def test_server_query(self):
factory = self.replay_flight_data()
p = self.load_policy... | "key": "name", |
<|file_name|>0002_post_slug.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-03-03 01:08
from __future__ import unicode_literals
from django.db import migrations, models
from blog.models import Post
def slugify_all_posts(*args):
for post in Post.objects.all():
p... | model_name='post',
name='slug',
field=models.SlugField(default='', max_length=100),
), |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import os
from configurations import values
from django.conf import global_settings
class DjangoSettings(object):
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = values.SecretValue()
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWE... | |
<|file_name|>msi.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.packaging.msi
The msi packager.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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 t... | |
<|file_name|>styles.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright © 2014-2018 GWHAT Project Contributors
# https://github.com/jnsebgosselin/gwhat
#
# This file is part of GWHAT (Ground-Water Hydrograph Analysis Toolbox).
# Licensed under the terms of the GNU General Public License.
# Standard li... | # database = QFontDatabase()
# print database.families()
|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from "./assignment_service_to_authorization_group";
export * from "./authorization_check_field";
export * from "./authorization_group";
export * from "./authorization_object_class";
export * from "./authorization_object";
export * from "./behavior_definition";... | |
<|file_name|>bootstrap.test.js<|end_file_name|><|fim▁begin|>/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/* eslint-disable max-nested-callbacks */
define([
'jquery',
'mage/backend/bootstrap'
], function ($) {
'use strict';
describe('mage/backend/boot... | ).toBe(1);
});
}); |
<|file_name|>twoview.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////////
//
// Multilayer Feature Graph (MFG), version 1.0
// Copyright (C) 2011-2015 Yan Lu, Dezhen Song
// Netbot Laboratory, Texas A&M University, USA
//
// This program is free software... | opts[1] = 1E-15;
opts[2] = 1E-50; // original 1e-50
opts[3] = 1E-20;
opts[4] = -LM_DIFF_DELTA; |
<|file_name|>linq-vsdoc.js<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------------------------
* linq-vsdoc.js - LINQ for JavaScript
* ver 2.2.0.2 (Jan. 21th, 2011)
*
* created and maintained by neuecc <ils@neue.cc>
* licensed under Microsoft Public License(Ms-PL)
* http://neue.cc... | |
<|file_name|>appmonitor.py<|end_file_name|><|fim▁begin|>"""TBD
"""
import os
import sys
import time
import subprocess
import xmlrpc.client
class ApplicationMonitor(object):
"""Responsible for launching, monitoring, and terminating the FLDIGI application process, using subprocess.Popen()
:param hostname: Th... | args.extend(['--arq-server-address', self.hostname])
args.extend(['--arq-server-port', str(self.port)]) |
<|file_name|>settings.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* app settings factory
* stores the custom user settings and shares it app wide
*/
var app = angular.module('istart');
app.factory('appSettings', ['$q', '$rootScope',function ($q, $rootScope) {
/**
* migrate the old settings from istar... | }
});
return defer.promise;
}, |
<|file_name|>TranslationTool.js<|end_file_name|><|fim▁begin|>Potree.TranslationTool = function(camera) {
THREE.Object3D.call( this );
var scope = this;
this.camera = camera;
this.geometry = new THREE.Geometry();
this.material = new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } );
this.STATE = {... | |
<|file_name|>sha3256_3512.rs<|end_file_name|><|fim▁begin|>macro_rules! make_sha_mod {
($modname:ident, $len:expr, $keccak_new:expr) => {
pub mod $modname {
use self::super::super::hash_string;
use tiny_keccak::{Hasher, Sha3};<|fim▁hole|> |keccak: Sha3| {
... |
hash_func!($keccak_new(),
|keccak: &mut Sha3, buffer: &[u8]| keccak.update(buffer), |
<|file_name|>EnableMetricTimer.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2015-2022, Michael Yang 杨福海 (fuhai999@gmail.com).
* <p>
* 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|>ExifHandler.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////
// Name: ExifHandler.cpp
// Purpose: ExifHandler class
// Author: Alex Thuering
// Created: 30.12.2007
// RCS-ID: $Id: ExifHandler.cpp,v 1.1 2007/12/30 22:45:02 n... | if (entry) {
ExifByteOrder byteOrder = exif_data_get_byte_order(exifData);
orient = exif_get_short(entry->data, byteOrder);
} |
<|file_name|>google_table_repl.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import time
import cStringIO
from PIL import Image
from libmproxy.protocol.http import decoded
import re
def request(context, flow):
try:
logging.debug("request")
if (flow.request.pretty_host(hostheader=True).endswith("docs.... | import logging |
<|file_name|>echidna-manifester.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
'use strict';
// Pseudo-constants:
var DEFAULT_OPTIONS = {
"format": "manifest"
, "compactUrls": true
, "includeErrors": false
, "includeTypes": false
};
// “Global” variables:
var Nightmare = require("nightmare")... | // running directly |
<|file_name|>reference.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline
// Copyright (C) 2015-2020 Matthias Beyer <mail@beyermatthias.de> and contributors
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU... |
use super::*;
use crate::hasher::Hasher;
|
<|file_name|>createSubmit.js<|end_file_name|><|fim▁begin|>var createSubmit = function(name, primus, keyDict) {
return function(event) {
var message = $('#message').val();
if (message.length === 0) {
event.preventDefault();
return;
}
$('#message').val('');
... | |
<|file_name|>0005_auto_20161129_1044.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-29 10:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0004_auto_20161... | ),
] |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at<|fim▁hole|># Unless required by applicab... | #
# http://www.apache.org/licenses/LICENSE-2.0
# |
<|file_name|>bitcoin_lt.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="lt" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About UniverseCoin</source... | <source>UniverseCoin version</source>
<translation>UniverseCoin versija</translation>
</message> |
<|file_name|>downscaling_launcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2
import os, glob
os.chdir( '/workspace/Shared/Tech_Projects/ALFRESCO_Inputs/project_data/CODE/tem_ar5_inputs' )
base_dir = '/workspace/Shared/Tech_Projects/ESGF_Data_Access/project_data/data/prepped'
output_base_dir = '/workspace/Shar... | ' -cru ' + cru_path + ' -at ' + anomalies_calc_type + ' -m ' + 'mean' + ' -dso ' + downscale_operation )
elif 'hur_' in fn:
os.system( 'python hur_ar5_model_data_downscaling.py' + ' -mi ' + os.path.join( root, fn ) + ' -hi ' + historical_fn + ' -o ' + output_dir + \
' -bt ' + '2006-01' + ' -e... |
<|file_name|>mock_store.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use std::collections::HashMap;
use std::sync::{
atomic::{AtomicUsize, Ordering}... | |
<|file_name|>logger.js<|end_file_name|><|fim▁begin|>'use strict';
var
path = require('path'),
express = require('express'),
errors = require('./errors'),
debug = require('debug')('express-toybox:logger'),
DEBUG = debug.enabled;
/**
* logger middleware using "morgan" or "debug".
*
* @param {*|St... | |
<|file_name|>webhook.pb.go<|end_file_name|><|fim▁begin|>// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
/... | |
<|file_name|>DistributedTask.py<|end_file_name|><|fim▁begin|>'''
Created on Feb 22, 2013
@author: u5682
'''
from datetime import datetime
import os, sys, pickle
import subprocess
from time import sleep
import xml.dom.minidom
from xml.dom.minidom import Node
class DistributedTask(object):
'''
classdocs
'''
d... | |
<|file_name|>worker.py<|end_file_name|><|fim▁begin|>import os
import sys
import signal
import argparse
import requests
from urllib.parse import urljoin
from socket import gethostname
from io import BytesIO
from zipfile import ZipFile
from shutil import move, rmtree
from uuid import uuid4
from time import time, sleep
fr... |
if 'error' in module:
del(module['error'])
|
<|file_name|>constant.d.ts<|end_file_name|><|fim▁begin|>import { constant } from "../fp";<|fim▁hole|><|fim▁end|> | export = constant; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 The Debsources developers <info@sources.debian.net>.
# See the AUTHORS file at the top-level directory of this distribution and at
# https://anonscm.debian.org/gitweb/?p=qa/debsources.git;a=blob;f=AUTHORS;hb=HEAD
#
# This file is part of Debsou... | from flask import Blueprint
# naming rule: bp_{dirname} |
<|file_name|>UserPageHandler.java<|end_file_name|><|fim▁begin|>package bdv.server;
import bdv.db.UserController;
import bdv.model.DataSet;
import bdv.util.Render;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ha... | |
<|file_name|>instant_system_tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
... | |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>package ec2
import (
"encoding/base64"
"encoding/xml"
"fmt"
"net/url"
"strconv"
"strings"
"github.com/dynport/gocloud/aws"
)
func NewFromEnv() *Client {
return &Client{
aws.NewFromEnv(),
}
}
type Client struct {
*aws.Client
}
func (client *Client) End... | if ebs.VolumeType != "" {
values.Add(prefix+".VolumeType", ebs.VolumeType)
}
} |
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|># Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import json
import os
import sys
from argparse import ArgumentTypeError
from datetime import datetime, timedelta
from c7n import cli, version, commands
from c7n.resolver import ValuesFr... | |
<|file_name|>performance_lun_metric.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-o... | |
<|file_name|>benchmark_bundle.js<|end_file_name|><|fim▁begin|>// modules are defined as an array
// [ module function, map of requireuires ]
//
// map of requireuires is short require name -> numeric require
//
// anything defined in a previous bundle is accessed via the
// orig method which is the requireuire for prev... | defineProperty( this, '_count', {
'configurable': false,
'enumerable': false,
'writable': true, |
<|file_name|>uicrosslines.cpp<|end_file_name|><|fim▁begin|>// This file is part of VSTGUI. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this
// distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
#include "uicrosslines.h"
#if VSTGUI_LIVE_EDITING
#inclu... | #endif // VSTGUI_LIVE_EDITING |
<|file_name|>DaemonManager.java<|end_file_name|><|fim▁begin|>package com.mhfs.controller.hotplug;
import java.io.File;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.net.SocketException;
import com.mhfs.controller.config.Config;
import com.mhfs.controller.daemon.DaemonMain;
im... | return port;
}
|
<|file_name|>vec.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | // See above for why 'ptr.offset' isn't used
self.end = arith_offset(self.end as *const i8, -1) as *const T; |
<|file_name|>ToStringUtil.java<|end_file_name|><|fim▁begin|>package com.ashokgelal.samaya;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.uti... |
There are two use cases for this class. The typical use case is :
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
setup(
name='zeit.content.gallery',
version='2.9.2.dev0',
author='gocept, Zeit Online',
author_email='zon-backend@zeit.de',
url='http://www.zeit.de/',
description="vivi Content-Type Portraitbox",
... | 'cssselect',
'Pillow',
'gocept.form', |
<|file_name|>account.rs<|end_file_name|><|fim▁begin|>// droplet_limit number The total number of droplets the user may have
// email string The email the user has registered for Digital
// Ocean with
// uuid string The universal identifier for this user
// email_verified boole... | }
|
<|file_name|>InputFactory.hpp<|end_file_name|><|fim▁begin|>// InputFactory.hpp
// KlayGE ÊäÈëÒýÇæ³éÏ󹤳§ Í·Îļþ
// Ver 3.1.0
// °æÈ¨ËùÓÐ(C) ¹¨ÃôÃô, 2003-2005
// Homepage: http://www.klayge.org
//
// 3.1.0
// Ôö¼ÓÁËNullObject (2005.10.29)
//
// 2.0.0
// ³õ´Î½¨Á¢ (2003.8.30)
//
// Ð޸ļǼ
//////////////////////////////... | |
<|file_name|>portal.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.controllers.portal import PortalAccount
from odoo.http import request
class PortalAccount(PortalAccount):<|fim▁hole|>
def _invoice_get_pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.