prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>AggressorAI.cpp<|end_file_name|><|fim▁begin|>/* * This file is part of the CMaNGOS Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Fou...
void AggressorAI::UpdateAI(const uint32 /*diff*/) {
<|file_name|>RunTransformTim.java<|end_file_name|><|fim▁begin|>package fortesting; import java.io.IOException;<|fim▁hole|> /** * Loads data into appropriate tables (assumes scheme already created) * * This will import the tables from my CSVs, which I have on dropbox. Let me * (Tim) know if you...
public class RunTransformTim {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for INSTEON Modems (PLM and Hub).""" import asyncio from contextlib import suppress import logging from pyinsteon import async_close, async_connect, devices from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import CONF_PLAT...
) # If options existed in YAML and have not already been saved to the config entry # add them now
<|file_name|>ntp_snippets_service.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 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 "components/ntp_snippets/ntp_snippets_service.h" #include <algorithm> #include...
<|file_name|>test_append.py<|end_file_name|><|fim▁begin|># TODO.TXT-CLI-python test script # Copyright (C) 2011-2012 Sigmavirus24, Jeff Stein # # 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, ...
# along with this program. If not, see <http://www.gnu.org/licenses/>. # # TLDR: This is licensed under the GPLv3. See LICENSE for more details.
<|file_name|>flex.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/. */ //! Layout for elements with a CSS `display` property of `flex`....
use context::LayoutContext; use display_list_builder::{DisplayListBuildState, FlexFlowDisplayListBuilding}; use euclid::Point2D; use floats::FloatKind;
<|file_name|>friend.go<|end_file_name|><|fim▁begin|>package personal import ( "encoding/xml" "fmt" ) type FriendsArray []Friend func (self FriendsArray) String() (s string) { s = "[" i := 0 m := len(self) for _, f := range self { t := fmt.Sprintf( `{"expertise":"%s", "name":"%s", "userid":%d, "gender":%...
type Friends struct { FriendsArray FriendsArray `xml:"friend"`
<|file_name|>checks.py<|end_file_name|><|fim▁begin|>import os from home.models import ReplicaSet, WhatTorrent, WhatFulltext def run_checks(): errors = [] warnings = [] # Check WhatFulltext integrity def check_whatfulltext(): w_torrents = dict((w.id, w) for w in WhatTorrent.objects.defer('tor...
for replica_set in ReplicaSet.objects.all(): m_torrents = {}
<|file_name|>events.rs<|end_file_name|><|fim▁begin|>use std::sync::mpsc::{Sender, Receiver, channel}; use std::iter::Iterator; use std::error::Error; use error; use frame::events::{ServerEvent as FrameServerEvent, SimpleServerEvent as FrameSimpleServerEvent, SchemaChange as FrameSchemaChange}; use ...
tx: Sender<ServerEvent>, }
<|file_name|>main.js<|end_file_name|><|fim▁begin|>// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. import Vue from 'vue'; import BootstrapVue from 'bootstrap-vue'; import 'bootstrap-vue/dist/bootstrap-vue.css'; import 'bootstrap...
new Vue({
<|file_name|>test_event_recurrence.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.exceptions import UserError import pytz from datetime import datetime, date from dateutil.relativedelta import relativedelta from odoo.tests.c...
'recurrence_update': 'all_events', 'tue': False, 'fri': False,
<|file_name|>power_of_2.rs<|end_file_name|><|fim▁begin|>use integer::Integer; use malachite_base::num::arithmetic::traits::PowerOf2; use malachite_base::num::basic::traits::One; impl PowerOf2<u64> for Integer { /// Computes 2<sup>`pow`</sup>.<|fim▁hole|> /// Additional memory: worst case O(`pow`) /// //...
/// /// Time: worst case O(`pow`) ///
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! The SMTP transport sends emails using the SMTP protocol. //! //! This SMTP client follows [RFC //! 5321](https://tools.ietf.org/html/rfc5321), and is designed to efficiently send emails from an //! application to a relay email server, as it relies as much as possible...
} }
<|file_name|>storage_extensions.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The Kubernetes Authors. 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-...
storage["ingresses"] = ingressStorage storage["ingresses/status"] = ingressStatusStorage } if apiResourceConfigSource.ResourceEnabled(version.WithResource("podsecuritypolicy")) {
<|file_name|>00-fulfills-promise.exp.js<|end_file_name|><|fim▁begin|>var compilerSupport=require('../../src/compilerSupport');var main = function () { var __builder = new compilerSupport.TaskBuilder(), __state = 0, __continue = __builder.CONT, __ex; var data; return __builder.run(function () { switc...
__state = -1; __builder.ret(data); break;
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/lic...
pub enum astencode_tag { // Reserves 0x32 -- 0x45 tag_ast = 0x32,
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import Ember from 'ember-metal/core'; // reexports import Test from 'ember-testing/test'; import Adapter from 'ember-testing/adapters/adapter'; import setupForTesting from 'ember-testing/setup_for_testing'; import require from 'require'; import 'ember-testing/support'...
<|file_name|>AppController.js<|end_file_name|><|fim▁begin|>angular.module('App')<|fim▁hole|> .controller('AppController', function($scope, $http, URL) { $http.get(URL, {headers: {"X-Requested-With" : "XMLHttpRequest"}}) .success(function (response) {$scope.examples = response.examples;}); });...
<|file_name|>test_sass_to_scss.py<|end_file_name|><|fim▁begin|>import logging from unittest import TestCase from sass_to_scss import SassToSCSS class TestSassToSCSS(TestCase): def setUp(self): self.sassy = SassToSCSS(loglevel=logging.DEBUG) def trim_docstring(self, docstring): return '\n'.jo...
<|file_name|>constants.ts<|end_file_name|><|fim▁begin|>/** moduleBank constants * */ import { ModuleCode } from '../types/modules'; export const FETCH_MODULE = 'FETCH_MODULE' as const; // Action to fetch modules export const FETCH_MODULE_LIST = 'FETCH_MODULE_LIST' as const; export const UPDATE_MODULE_TIMESTAMP = 'UPD...
| typeof UPDATE_MODULE_TIMESTAMP | typeof REMOVE_LRU_MODULE | typeof FETCH_ARCHIVE_MODULE;
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[doc = r" Value read from the register"] pub struct R { bits: u32, } #[doc = r" Value to write to the register"] pub struct W { bits: u32, } impl super::IOHCR { #[doc = r" Modifies the contents of the register"] #[inline(always)] pub fn modify<F>(&se...
let mut w = W::reset_value();
<|file_name|>match-arm-statics.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.o...
static NONE: Option<Direction> = None;
<|file_name|>MultiSelect.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2013 Andre Ricardo Schaffer * * 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, includin...
* @return This select element to allow chain calls. * @since 0.3.0 */ MultiSelect deselectByVisibleText(String... texts);
<|file_name|>DatabaseConfig.java<|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 * * https://www.apache.org/licenses/LIC...
if (memoizedHashCode != 0) { return memoizedHashCode; }
<|file_name|>data_key_test.go<|end_file_name|><|fim▁begin|>/* Licensed to the Apache Software Foundation (ASF) under one<|fim▁hole|>to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache...
or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// Copyright 2016 David Lavieri. All rights reserved. // Use of this source code is governed by a MIT License // License that can be found in the LICENSE file. package main import ( "fmt" "github.com/falmar/goradix" ) func main() { radix := goradix.New(false) r...
} // Output: Found node, Value: 100 fmt.Println("Found node, Value: ", value)
<|file_name|>UserInfosModel.py<|end_file_name|><|fim▁begin|>class UserInfoModel(object): PartenaireID = 0 Mail = "" CodeUtilisateur = "" TypeAbonnement = "" DateExpiration = "" DateSouscription = "" AccountExist = False def __init__(self, **kwargs): self.__dict__.update(kwargs) ...
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from .models import Contact # Register your models here.<|fim▁hole|><|fim▁end|>
admin.site.register(Contact)
<|file_name|>basic_effect.py<|end_file_name|><|fim▁begin|>from razer.client import DeviceManager from razer.client import constants as razer_constants # Create a DeviceManager. This is used to get specific devices device_manager = DeviceManager()<|fim▁hole|> # Disable daemon effect syncing. # Without this, the daemon ...
print("Found {} Razer devices".format(len(device_manager.devices))) print()
<|file_name|>BukkitRegistry.java<|end_file_name|><|fim▁begin|>package net.minecraft.server; import java.util.Iterator; import java.util.List; import net.minecraft.src.BiomeGenBase; import cpw.mods.fml.common.registry.IMinecraftRegistry; import cpw.mods.fml.server.FMLBukkitHandler; public class BukkitRegistry implem...
{ addSpawn((Class <? extends net.minecraft.src.EntityLiving >) entityClazz, weightedProb, min, max, spawnList, biomes); }
<|file_name|>test_individual.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 """ test_indivdual.py Test the individual class. Created by Måns Magnusson on 2013-03-07. Copyright (c) 2013 __MyCompanyName__. All rights reserved. """ import sys import os from ped_parser import individual class ...
assert self.mother.sex == 2
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># flake8: noqa: F401 from pandas.core.arrays.sparse.accessor import SparseAccessor, SparseFrameAccessor from pandas.core.arrays.sparse.array import ( BlockIndex, IntIndex, SparseArray,<|fim▁hole|>from pandas.core.arrays.sparse.dtype import SparseDtype<|...
_make_index, )
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from __future__ import print_function from __future__ import unicode_literals import os import sys import time import argparse from datetime import datetime, timedelta, tzinfo from textwrap import dedent import json from random import c...
return ################################## ### THREADING IMPLEMENTATION #####
<|file_name|>console.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- mode: python; sh-basic-offset: 4; indent-tabs-mode: nil; coding: utf-8 -*- # vim: tabstop=4 softtabstop=4 expandtab shiftwidth=4 fileencoding=utf-8 # # Shell command # Copyright 2010, Jeremy Grosser <synack@digg.com> import argparse impor...
Use clusto's hardware port mappings to console to a remote server using the serial console. '''
<|file_name|>qdisc.go<|end_file_name|><|fim▁begin|>package netlink import ( "fmt" "math" ) const ( HANDLE_NONE = 0 HANDLE_INGRESS = 0xFFFFFFF1 HANDLE_CLSACT = HANDLE_INGRESS HANDLE_ROOT = 0xFFFFFFFF PRIORITY_MAP_LEN = 16 ) const ( HANDLE_MIN_INGRESS = 0xFFFFFFF2 HANDLE_MIN_EGRESS = 0xFFFFFFF3...
FlowDefaultRate uint32 FlowMaxRate uint32
<|file_name|>libpath.py<|end_file_name|><|fim▁begin|># coding: utf-8 """Find the path to picasso dynamic library files.""" import os import platform<|fim▁hole|> pass def find_lib_path(): """Find the path to picasso dynamic library files. :return: List of all found library path to picasso :rtype: list(...
import sys class PicassoLibraryNotFound(Exception): """Error thrown by when picasso is not found"""
<|file_name|>builtin_time_vec_generated_test.go<|end_file_name|><|fim▁begin|>// Copyright 2019 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.or...
chunkSize: 128, }, {
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>try: from setuptools import setup except ImportError: from distutils.core import setup setup( name='Unirest', version='1.1.7', author='Mashape', author_email='opensource@mashape.com', packages=['unirest'], url='https://github.com/Mashap...
<|file_name|>AuraSavedData.java<|end_file_name|><|fim▁begin|>package flabs.mods.magitech.aura; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.WorldSavedData; <|fim▁hole|> public static final String nbtName="MagiAura"; public AuraSavedData(String name) { super(name); } @Override p...
public class AuraSavedData extends WorldSavedData{
<|file_name|>PercentageChanceGeneratorTest.java<|end_file_name|><|fim▁begin|>package uk.org.fyodor.generators; import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; import org.junit.Test; import uk.org.fyodor.BaseTest; public class PercentageChanceGeneratorTest extends BaseTest { ...
results.add(percentageChance.next()); } print(p);
<|file_name|>adhoc.py<|end_file_name|><|fim▁begin|># Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __me...
desc="Define and run a single task 'playbook' against" " a set of hosts", epilog="Some modules do not make sense in Ad-Hoc (include,"
<|file_name|>request.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import oauth2 # XXX pumazi: factor this out from webob.multidict import MultiDict, NestedMultiDict from webob.request import Request as WebObRequest __all__ = ['Request'] class Request(WebObRequest): """The OAuth version of the W...
def str_oauth_header(self): extracted = {} # Check for OAuth in the Header if 'authorization' in self.headers:
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------- # Copyright (c) Microsoft. 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 ...
<|file_name|>test_Goulib_interval.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding: utf8 from nose.tools import assert_equal from nose import SkipTest #lines above are inserted automatically by pythoscope. Line below overrides them from Goulib.tests import * from Goulib.interval import * clas...
<|file_name|>Test_CCopasiObject.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (C) 2017 by Pedro Mendes, Virginia Tech Intellectual # Properties, Inc., University of Heidelberg, and University of # of Connecticut School of Medicine. # All rights reserved. # Copyright (C) 2010 - 2016 by Pedro M...
]
<|file_name|>sepp2_test.py<|end_file_name|><|fim▁begin|>from .helper import * import open_cp.gui.predictors.sepp2 as sepp2 import open_cp.gui.predictors.predictor #import datetime @pytest.fixture def analysis_model2(analysis_model): analysis_model.time_range = (datetime.datetime(2017,5,21,12,30), ...
<|file_name|>dev-server.ts<|end_file_name|><|fim▁begin|>import express, { Router } from 'express'; import { Builder, logConfig, Options } from '@storybook/core-common'; import { getMiddleware } from './utils/middleware'; import { getServerAddresses } from './utils/server-address'; import { getServer } from './utils/s...
getMiddleware(options.configDir)(router); app.use(router);
<|file_name|>WhileDirective.java<|end_file_name|><|fim▁begin|>package org.reasm.m68k.assembly.internal; import javax.annotation.Nonnull; import javax.annotation.concurrent.Immutable; import org.reasm.Value; import org.reasm.ValueToBooleanVisitor; /** * The <code>WHILE</code> directive. * * @author Francis Gagné ...
<|file_name|>inner-static.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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<|fim▁hole|>// http://w...
<|file_name|>uicommon.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
def emptyLayout(layout): for i in reversed(range(layout.count())): layout.itemAt(i).widget().setParent(None)
<|file_name|>read.js<|end_file_name|><|fim▁begin|>/* @flow */ 'use strict'<|fim▁hole|> const projectMeta = require('../utils/project-meta.js') const values = require('../values.js') function readCors ( cwd /* : string */ ) /* : Promise<CorsConfiguration | false> */ { return projectMeta.read(cwd) .then((config)...
/* :: import type {CorsConfiguration} from '../../types.js' */
<|file_name|>groups.js<|end_file_name|><|fim▁begin|>// // Webble World 3.0 (IntelligentPad system for the web) // // Copyright (c) 2010-2015 Micke Nicander Kuwahara, Giannis Georgalis, Yuzuru Tanaka // in Meme Media R&D Group of Hokkaido University, Japan. All rights reserved. // // Licensed under the Apache Licens...
} function gToRow(g) {
<|file_name|>cl_DF_digits.cc<|end_file_name|><|fim▁begin|>// float_digits(). // General includes. #include "base/cl_sysdep.h" // Specification. #include "cln/dfloat.h"<|fim▁hole|>// Implementation. #include "float/dfloat/cl_DF.h" namespace cln { CL_INLINE uintC CL_INLINE_DECL(float_digits) (const cl_DF& x) { unus...
<|file_name|>composed.js<|end_file_name|><|fim▁begin|>import { createStore } from 'redux' import { combineReducers } from 'redux';<|fim▁hole|> todos: todoReducer, app: appReducer }) export const store = createStore(todoApp); store.getState() // outputs -> // { // todos: { // todos: [] // }, // app: { //...
import { todoReducer } from '../todo-reducer'; import { appReducer } from '../app-reducer'; const todoApp = combineReducers({
<|file_name|>py_choose.hpp<|end_file_name|><|fim▁begin|>#ifndef __PY_CHOOSE__ #define __PY_CHOOSE__ //--------------------------------------------------------------------------- //<inline(py_choose)> //--------------------------------------------------------------------------- uint32 idaapi choose_sizer(void *self) { ...
if ( pyres == NULL || (res = PyString_AsString(pyres.o)) == NULL ) qstrncpy(buf, "<Empty>", MAXSTR); else
<|file_name|>bind_statement.rs<|end_file_name|><|fim▁begin|>use std::result::Result; use serde_json::*; use super::script::*; use super::bound_script::*; use super::bind_expression::*; use super::binding_environment::*; use super::script_interpreter::*; /// /// Creates an execution error relating to an script statem...
<|file_name|>upgrade_schema.py<|end_file_name|><|fim▁begin|># ============================================================================== # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...
json.dump(data, fp, sort_keys=True, indent=2)
<|file_name|>VarTestCase.java<|end_file_name|><|fim▁begin|>package prolog; import junit.framework.TestCase; import nars.tuprolog.Var; public class VarTestCase extends TestCase { public void testIsAtomic() { assertFalse(new Var("X").isAtomic()); } public void testIsAtom() { assertFalse(new Var("...
<|file_name|>output_test.go<|end_file_name|><|fim▁begin|>package command import ( "io/ioutil" "os" "path/filepath" "strings" "testing" "github.com/hashicorp/terraform/terraform" "github.com/mitchellh/cli" ) func TestOutput(t *testing.T) { originalState := &terraform.State{ Modules: []*terraform.ModuleState...
}, }
<|file_name|>booking.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { Router } from '@angular/router'; import { ToastsManager } from 'ng2-toastr/ng2-toastr'; import { CalendarEvent, CalendarMonthViewComponent, CalendarDayViewComponent, Cale...
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import mozhttpd import mozfile import os import tempfile import unittest class TestBasic(unittest.TestCase): """ Test basic Mozhttpd capabilites """ def test_basic(self): """ Test mozhttpd can serve files """ tempdir =...
unittest.main()
<|file_name|>unicorn.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np class Unicorn(object): def __init__(self): import unicornhathd as unicorn unicorn.rotation(180) unicorn.brightness(0.75) def...
<|file_name|>profiling_support.rs<|end_file_name|><|fim▁begin|>use measureme::{StringComponent, StringId}; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::profiling::SelfProfiler; use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use rustc_hir::definition...
let parent_def_id = DefId { index: parent_index, krate: def_id.krate }; (self.def_id_to_string_id(parent_def_id), 0) }
<|file_name|>taxonomy.py<|end_file_name|><|fim▁begin|>""" Provides classes that represent complete taxonomies, built using components from the taxacomponents module. """ from taxacomponents import Citation, RankTable, Taxon from taxonvisitor import TaxonVisitor from taxonvisitors_concrete import PrintTaxonVisitor, CS...
def loadFromDB(self, pgcur, taxanum=-1, maxdepth=-1):
<|file_name|>database.rs<|end_file_name|><|fim▁begin|>// Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html use crate::err::Result; use rusqlite::{params, Connection, OptionalExtension, Row, Statement, NO_PARAMS}; use std::collections::HashMap;...
<|file_name|>relevanceFusion.py<|end_file_name|><|fim▁begin|>import os import sys import numpy as np from basic.common import checkToSkip def process(options): overwrite = options.overwrite inputeFile = options.inputeFile weightFile = options.weightFile resultFile = options.resultFile ...
fout.write(" ".join(elems[:2]) + " " + str(np.dot(weight, vecs)) + '\n')
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import database from "../api/database"; import * as types from "../actions/ActionTypes" const receiveAspects = aspects => ({ type: types.GET_COMMON_ASPECTS, aspects });<|fim▁hole|> database.getCommonAspects(aspects => { dispatch(receiveAspects(aspects)) })...
export const getCommonAspects = () => dispatch => {
<|file_name|>main.js<|end_file_name|><|fim▁begin|>'use strict'; var assert = require('assert'); var fs = require('fs'); var path = require('path'); describe('responsive-compass-sprite', function() { describe('icon-sprite', function() { function compare(expected, tmp, done) { var baseExpected...
}; it('simple test', function(done) {
<|file_name|>0016_grades_initialdata.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.12 on 2020-05-09 06:28 from django.db import migrations # Can't use fixtures because load_fixtures method is janky with django-tenant-schemas def load_initial_data(apps, schema_editor): Grade = apps.get_model('courses'...
value=9 ) Grade.objects.create( name="10",
<|file_name|>sample_template.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this...
<|file_name|>jheaderarea.cpp<|end_file_name|><|fim▁begin|>#include "precomp.h" #include "jheaderarea.h" #include "private/jheaderarea_p.h" // - JSortFilterProxyModelData - class JSortFilterProxyModelData { public: QMap<int/*column*/, QRegExp> mapRegExp; }; // - class JSortFilterProxyModel - JSortFilterProxyMode...
void JSortFilterProxyModel::setFilterRegExp(int column, const QRegExp &regExp) {
<|file_name|>label_steps.py<|end_file_name|><|fim▁begin|><|fim▁hole|>@when(u'I get the text from the label') def step_impl(context): context.expected_text = context.page.label_id() @when(u'I search for the label by "{how}"') def step_impl(context, how): method = 'label_{0}'.format(how) context.expected_te...
<|file_name|>build.go<|end_file_name|><|fim▁begin|>package main /* * Copyright 2016 ThoughtWorks, 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/licens...
) flag.StringVar(&excludeLib, "excludelib", "", "exclude dependencies in comma separated format, eg github.com/gocd-contrib/fake_agent,github.com/gocd-contrib/fake_server")
<|file_name|>size_of.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use script::dom::characterdata::CharacterData; use script::do...
use script::dom::htmlspanelement::HTMLSpanElement;
<|file_name|>download_samples.py<|end_file_name|><|fim▁begin|>""" RenderPipeline <|fim▁hole|>of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/o...
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy
<|file_name|>noise.py<|end_file_name|><|fim▁begin|>import numpy import random import math from exit_weight import * from privexUtils import resolution<|fim▁hole|> sigma_i = p_exit*sigma/math.sqrt(sum_of_sq) random_sample = random.gauss(0,sigma_i) return random_sample # return 0<|fim▁end|>
#def Noise(sensitivity, epsilon, delta, fingerprint, sigma): def Noise(sigma, fingerprint, sum_of_sq, p_exit):
<|file_name|>l2fib_vppcalls.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Cisco and/or its affiliates. // // 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...
}
<|file_name|>launcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2010-2011 # Drakmail < drakmail@gmail.com > # NomerUNO < uno.kms@gmail.com > # Platon Peacel☮ve <platonny@ngs.ru> # Elec.Lomy.RU <Elec.Lomy.RU@gmail.com> # ADcomp <david.madbox@gmail.com> # # This ...
global q q = Queue()
<|file_name|>SessionFactoryImplementor.java<|end_file_name|><|fim▁begin|>//$Id: SessionFactoryImplementor.java 8754 2005-12-05 23:36:59Z steveebersole $ package org.hibernate.engine; import java.util.Map; import java.util.Set; import java.sql.Connection; import javax.transaction.TransactionManager; import org.hibern...
public NamedSQLQueryDefinition getNamedSQLQuery(String queryName); public ResultSetMappingDefinition getResultSetMapping(String name);
<|file_name|>rule.js<|end_file_name|><|fim▁begin|>const _ = require('lodash') const Joi = require('joi') module.exports = { name: 'href', params: { href: Joi.array().items( Joi.string(), Joi.func().ref() ).min(1) }, setup (params) { params.href = [''].concat(params.href) this._flags...
}
<|file_name|>iterators.ts<|end_file_name|><|fim▁begin|>export class IterationResult<T> { public done: boolean; public value: T | undefined | null; constructor(done: boolean, value: T | undefined) { this.done = done; this.value = value;<|fim▁hole|>} export enum IterationHint { NONE = 0, SKIP_DESCENDANTS = 1 <<...
}
<|file_name|>Create_Modify_Interface.py<|end_file_name|><|fim▁begin|>## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the...
to redefine a submission page for the modifications, but rely on
<|file_name|>VictimCollector.java<|end_file_name|><|fim▁begin|>/* * Copyright 2000-2009 JetBrains s.r.o. * * 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/licen...
if (body != null) { body.accept(this); }
<|file_name|>shared_vec_slice.rs<|end_file_name|><|fim▁begin|>use std::sync::Arc; <|fim▁hole|> pub data: Arc<Vec<u8>>, pub start: usize, pub len: usize, } impl SharedVecSlice { pub fn empty() -> SharedVecSlice { SharedVecSlice::new(Arc::new(Vec::new())) } pub fn new(data: Arc<Vec<u8>>) ...
#[derive(Clone)] pub struct SharedVecSlice {
<|file_name|>bigip_gtm_server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = ...
"""Returns the probes value from the monitor string. The monitor string for a Require monitor looks like this.
<|file_name|>0004_auto_20170726_0019.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models <|fim▁hole|>class Migration(migrations.Migration): dependencies = [ ('jdpages', '0003_auto_20170725_2349'), ] operations =...
<|file_name|>pad.py<|end_file_name|><|fim▁begin|>"""Convenience functions for padding .. versionadded:: 0.1.4 """ from __future__ import division, print_function import numpy as np def _get_pad_left_right(small, large): """Compute left and right padding values. Here we use the convention that if the paddin...
Returns -------
<|file_name|>path.py<|end_file_name|><|fim▁begin|># ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the L...
def relpathto(self, dest):
<|file_name|>summarize.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright 2017 The Kubernetes Authors. # # 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.apac...
<|file_name|>bill.js<|end_file_name|><|fim▁begin|>/*! 一叶孤舟 | qq:28701884 | 欢迎指教 */ var bill = bill || {}; //初始化 bill.init = function (){ if (com.store){ clearInterval(bill.timer); bill.setBillList(com.arr2Clone(com.initMap)); //写入棋谱列表 play.isPlay=false; com.show(); }else { bill.timer = setInterval("bill...
var map = com.arr2Clone(map); for (var i=0; i<map.length; i++){ for (var n=0; n<map[i].length; n++){
<|file_name|>vhtml-tests.ts<|end_file_name|><|fim▁begin|>/** * Tests for Hyperscript */ import h = require('vhtml'); // Empty element // $ExpectType string h('div'); // $ExpectType string h('span', null, 'Hello, world!'); // $ExpectType string h( 'section', { id: 'some-id' }, h('h1', null, 'Title'), ...
h('label', { for: 'foo' }); // Both className and class are supported
<|file_name|>_redis.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import redis import json class Redis(object): def __init__(self, host="localhost", port=6379): self._host = host self._port = port self._redis_cursor = None def conn(self): if se...
<|file_name|>TargetsParams.ts<|end_file_name|><|fim▁begin|>import { ProjectOperationCredentials } from "../ProjectOperationCredentials"; import { RepoFilter } from "../repoFilter"; import { RemoteRepoRef, RepoRef, } from "../RepoId"; import { Credentialed } from "./Credentialed"; import { RemoteLocator } from "...
public abstract sha: string;
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// Copyright 2013 The Prometheus Authors // 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 //...
var cache mapper.MetricMapperCache var err error if cacheSize == 0 {
<|file_name|>debounce.py<|end_file_name|><|fim▁begin|>"""Debouncing provides functions for delaying or skipping a queue `push` subject to a specified debouncing constraint. When used with idempotent operations, this provides a safe and consistent method of throttling queue pushes within Deferrable itself. The debounci...
PUSH_DELAYED = 2 SKIP = 3 def _debounce_key(item):
<|file_name|>add_db.py<|end_file_name|><|fim▁begin|># coding: utf-8 import db_info import db_cancel import db_news import hashlib from tweeter import format_info, format_cancel, format_news import settings log = settings.log def add_info_to_queue(q, *args):<|fim▁hole|> # 更新した数をカウント updated = 0 ...
try:
<|file_name|>simulated_annealing_test.py<|end_file_name|><|fim▁begin|>import unittest import numpy as np import pyoptima as opt class SimulatedAnnealingTest(unittest.TestCase): def test_with_parabola(self): """ Test with a simple parabolic function with 2 variables """ def neighbour_func(params)...
self.assertAlmostEqual(bst_solution['x1'], 0, 2)
<|file_name|>install.py<|end_file_name|><|fim▁begin|># # Copyright (C) 2015 FreeIPA Contributors see COPYING for license # from __future__ import print_function import errno import logging import os import pickle import shutil import sys import tempfile import textwrap import six from ipalib.install import certmon...
installutils.encrypt_file(fname,
<|file_name|>en.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'toolbar', 'en', { toolbarCollapse: 'Collapse Toolbar',<|fim▁hole|> document: 'Document', clipboar...
toolbarExpand: 'Expand Toolbar', toolbarGroups: {
<|file_name|>types.ts<|end_file_name|><|fim▁begin|>/* * The MIT License (MIT) * * Copyright (c) 2020 Looker Data Sciences, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy<|fim▁hole|> * copies of the Software, and to permit persons to whom the Software is * furnished to do so,...
* of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell