prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>Domain.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2010 The University of Reading * 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|> * 2. Redistributions in ...
* 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer.
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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/l...
<|file_name|>cmap.hpp<|end_file_name|><|fim▁begin|>// MIT License // Copyright (c) 2017 Simon Pettersson // 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 wi...
constexpr auto fourty_four = map[14]; */
<|file_name|>ConnectionPageNetwork.java<|end_file_name|><|fim▁begin|>/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You ...
} } prevDataSource = dataSource;
<|file_name|>accounts_options_browsertest.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 "base/basictypes.h" #include "base/compiler_specific.h" #include "base/...
CrosSettingsProvider* device_settings_provider_; private: DISALLOW_COPY_AND_ASSIGN(AccountsOptionsTest);
<|file_name|>axis.py<|end_file_name|><|fim▁begin|># set S-JTSK axes orientation import matplotlib matplotlib.use('GTKAgg') import matplotlib.pyplot as plt ax=plt.gca() #ax.set_ylim(ax.get_ylim()[::-1]) # direction of axes ax.invert_xaxis() ax.invert_yaxis() # ticks position for tick in ax.xaxis.get_major_ticks():...
<|file_name|>export_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package block import ( "github.com/juju/cmd" "github.com/juju/juju/apiserver/params"<|fim▁hole|>var ( BlockClient = &getBlockClientAPI UnblockClient = &getUnbloc...
"github.com/juju/juju/cmd/envcmd" )
<|file_name|>ProgramsRouter.ts<|end_file_name|><|fim▁begin|>'use strict'; import ProgramsServerController from '../controllers/ProgramsServerController'; import ProgramsPolicy from '../policies/ProgramsPolicy'; class ProgramsRouter { public static getInstance() { return this.instance || (this.instance = new this()...
.all(ProgramsPolicy.isAllowed)
<|file_name|>place-picker.js<|end_file_name|><|fim▁begin|>import {inject, customElement, bindable} from 'aurelia-framework'; import mapsapi from 'google-maps-api'; @customElement('place-picker') // Get an API key from https://developers.google.com/maps/documentation/javascript/get-api-key. @inject(Element, mapsapi('AI...
this.location.lat = place.geometry.location.lat(); this.location.lng = place.geometry.location.lng(); updateMarker(); }
<|file_name|>material_mutation_resolvers.rs<|end_file_name|><|fim▁begin|>use chrono::prelude::*; use async_graphql::{ FieldResult, ID, Context, }; use eyre::{ Context as _, // eyre, // Result }; // use printspool_json_store::Record as _; use printspool_auth::AuthContext; use printspool_json_sto...
let auth: &AuthContext = ctx.data()?; let material_hooks: &crate::MaterialHooksList = ctx.data()?; auth.authorize_admins_only()?;
<|file_name|>_bordercolor.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):<|fim▁hole|> super(BordercolorValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ar...
def __init__( self, plotly_name="bordercolor", parent_name="sankey.hoverlabel", **kwargs ):
<|file_name|>SocialNW.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Author: Rajesh Sinha, Karan Narain # The base class for Twitter and GPlus Objects # import logging import sys from bs4 import BeautifulSoup import urllib2 import re ## Some Important constants _parser = "lxml" ## remember to pip install ...
posters = [] status, soup = self.openAndLoadURL(self.amUrl)
<|file_name|>ServiceFabrikOperation.js<|end_file_name|><|fim▁begin|>'use strict'; const _ = require('lodash'); const config = require('../../../common/config'); const CONST = require('../../../common/constants'); const errors = require('../../../common/errors'); const logger = require('../../../common/logger'); const ...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>""" Forms for the project application """ # Django from django import forms # Third Party from dal import forward from dal.autocomplete import TaggitSelect2 from taggit.forms import TagField # MuckRock from muckrock.core import autocomplete from muckrock.project.mod...
"title", "summary", "image", "tags",
<|file_name|>generic.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 // http://www.apache.org/li...
other: ~[<expr for &other.x>] }]) ~~~
<|file_name|>ScansTest.java<|end_file_name|><|fim▁begin|>package org.nutz.resource; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.util.Collections; import java.util.Comparator; import java.uti...
// @Ignore @Test
<|file_name|>callExpressionTests.ts<|end_file_name|><|fim▁begin|>import { SyntaxKind } from "@ts-morph/common"; import { expect } from "chai"; import { CallExpression } from "../../../../compiler"; import { getInfoFromText } from "../../testHelpers";<|fim▁hole|> describe(nameof<CallExpression>(e => e.getReturnType),...
describe(nameof(CallExpression), () => {
<|file_name|>DefaultGenericCollectionAdaptor.java<|end_file_name|><|fim▁begin|>package net.amygdalum.testrecorder.deserializers.builder; import static java.util.stream.Collectors.toList; import static net.amygdalum.testrecorder.deserializers.Templates.assignLocalVariableStatement; import static net.amygdalum.testrecor...
public abstract Type componentType(T value); public abstract Stream<SerializedValue> elements(T value);
<|file_name|>TestSettings.java<|end_file_name|><|fim▁begin|>/* * JBox2D - A Java Port of Erin Catto's Box2D * * JBox2D homepage: http://jbox2d.sourceforge.net/ * Box2D homepage: http://www.gphysics.com * * This software is provided 'as-is', without any express or implied * warranty. In no event will the auth...
<|file_name|>tablestatus.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-2018 William W. Fisher (at gmail dot com) // This file is distributed under the MIT License. #include "ofp/tablestatus.h" #include "ofp/writable.h" using namespace ofp; bool TableStatus::validateInput(Validation *context) const { size...
if (length < sizeof(TableStatus) + sizeof(TableDesc)) { log_debug("TableStatus too small", length);
<|file_name|>lazyproxy.py<|end_file_name|><|fim▁begin|>class LazyProxy(object): def __init__(self, original_module, original_class, init_args): self._original_module = original_module self._original_class = original_class self._original_init_args = init_args self._instance = None ...
self._instance = class_(**argument_dict) else:
<|file_name|>FontOptions.java<|end_file_name|><|fim▁begin|>/* * Copyright 2000-2016 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/licenses/...
<|file_name|>array.rs<|end_file_name|><|fim▁begin|>use juniper::{ graphql_object, graphql_value, graphql_vars, EmptyMutation, EmptySubscription, GraphQLInputObject, RootNode, }; mod as_output_field { use super::*; struct Query; #[graphql_object] impl Query { fn roll() -> [bool; 3] { ...
struct Input {
<|file_name|>PEMer_Lite_test.cpp<|end_file_name|><|fim▁begin|>#undef SEQAN_ENABLE_TESTING #define SEQAN_ENABLE_TESTING 1 #include <seqan/sequence.h> #include <seqan/basic.h> #include <seqan/file.h> #include "PEMer_Lite.h" int median(candidate &input) // erstellt den median muss noch an struct candidate an...
<|file_name|>STATIC_TEMPLATE_MEMBER_INIT.cpp<|end_file_name|><|fim▁begin|>// checking initialization of static template data memebers template <class T> struct S { static T a;<|fim▁hole|>}; template <class T> T S<T>::a; // <-- NOT initialized template <class T> T S<T>::b = 0; // <-- explicitly initiali...
static T b;
<|file_name|>backdrop.js<|end_file_name|><|fim▁begin|>/*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.0.0-rc5-master-76c6299 */ goog.provide('ng.material.components.backdrop'); goog.require('ng.material.core'); /* * @ngdoc module * @name material.components.backdrop * @de...
* Apply class `opaque` to make the backdrop use the theme backdrop color. * */
<|file_name|>ebill_payment_contract.py<|end_file_name|><|fim▁begin|># Copyright 2019 Camptocamp SA<|fim▁hole|>from odoo import _, api, fields, models from odoo.exceptions import ValidationError class EbillPaymentContract(models.Model): _inherit = "ebill.payment.contract" paynet_account_number = fields.Char(s...
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
<|file_name|>custom_landing_pages_test.py<|end_file_name|><|fim▁begin|># Copyright 2018 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http:/...
def test_parents_landing_page(self): response = self.get_html_response( feconf.CUSTOM_PARENTS_LANDING_PAGE_URL)
<|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 LahCoin</source> ...
<|file_name|>build.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use std::process::Command; use std::env; fn main() { assert!(Command::new("make") .args(&["-f", "makefile.cargo"]) .status() .unwrap() .success()); pri...
/* 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_name|>PracticeQuestions.py<|end_file_name|><|fim▁begin|>"""Chapter 22 Practice Questions Answers Chapter 22 Practice Questions via Python code.<|fim▁hole|> from pythontutorials.books.CrackingCodes.Ch18.vigenereCipher import decryptMessage def main(): # 1. How many prime numbers are there? # Hint: Chec...
"""
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: Unlicense mod device; mod handler; mod pager; const UPPER_VA_BITS: usize = 39; // 512 GB, avoids 1 level const LOWER_VA_BITS: usize = 48; // 256 TB /// Live hardware abstraction layer for integration tests and releases. #[cfg(not(test))] mo...
pub use hal_test::core_id; pub use pager::PageBlockDescriptor; pub use pager::PageDirectory;
<|file_name|>metrics.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0. use std::cell::RefCell; use std::mem; use crate::storage::{kv::PerfStatisticsDelta, FlowStatsReporter, Statistics}; use collections::HashMap; use kvproto::metapb; use raftstore::store::util::build_k...
<|file_name|>CXXII.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 #---------------------------------------------------------------------------- # # Copyright (C) 2015 José Flávio de Souza Dias Júnior # # This file is part of CXXII - http://www.joseflavio.com/cxxii/ # # CXXII is free software: you can redist...
CXXII_Geradores = CXXII_Diretorio + os.sep + 'Geradores' if not os.path.exists(CXXII_Geradores): os.makedirs(CXXII_Geradores)
<|file_name|>openclose.cpp<|end_file_name|><|fim▁begin|>#include "hooks/hooks.H" #include <errno.h> #include <fcntl.h> #include <unistd.h> #include "libdft_api.h" #include "tagmap.h" #include "pin.H" #include "provlog.H"<|fim▁hole|>/* tracks whether path existed before the execution of syscall */ static struct { st...
#include "dtracker.H" #include "osutils.H"
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import os<|fim▁hole|>import threading from flask import Flask app = Flask(__name__) app.config.from_envvar("PEGASUS_METRICS_CONFIG") # This is required for sessions and message flashing app.secret_key = os.urandom(24) import pegasus.metrics.views import pegasus....
import sys import logging
<|file_name|>IssueEvent.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> ...
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # # #
<|file_name|>user-edit.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core'; import { GLOBAL } from '../services/global'; import { UserService } from '../services/user.service'; import { User } from '../models/user'; @Component({ selector: 'user-edit', templateUrl: '../views...
let token = this.token;
<|file_name|>transform_feedback.py<|end_file_name|><|fim▁begin|>'''OpenGL extension NV.transform_feedback This module customises the behaviour of the OpenGL.raw.GL.NV.transform_feedback to provide a more Python-friendly API Overview (from the spec) This extension provides a new mode to the GL, called transform f...
<|file_name|>PyStdlibCanonicalPathProvider.java<|end_file_name|><|fim▁begin|>/* * Copyright 2000-2014 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distribut...
* 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|>g_items.cpp<|end_file_name|><|fim▁begin|>/* This file is part of Jedi Knight 2. Jedi Knight 2 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. Jedi Knight 2 is distributed i...
<|file_name|>delete_specialist_pool_sample.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/L...
name = name
<|file_name|>ores.py<|end_file_name|><|fim▁begin|>from core.rule_core import * from core import yapi from core.config_loader import cur_conf class YunoModule: name = "ores" cfg_ver = None ores_api = yapi.ORES config = [ { "models": { "damaging": {"max_false": 0.1...
for item in revid_data: if "error" in revid_data[item] and "scores" not in revid_data[item]: if i <= 0:
<|file_name|>init.go<|end_file_name|><|fim▁begin|>package models import ( "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "sort" "strings" "github.com/astaxie/beego" "github.com/yaozijian/MiningOpt/distribution" "github.com/yaozijian/relayr" log "github.com/cihub/seelog" ) func Init(webcfg *WebCon...
func (m *manager) readin_task_list() {
<|file_name|>resource_loader.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "content/browser/loader/resource_loader.h" #include "base/command_line.h" #incl...
<|file_name|>cover.js<|end_file_name|><|fim▁begin|>// @flow var React = require('react') var {assign} = require('lodash') import {Source, emptySource} from './model/source' import {displayIf, Colors} from './style' // but get the images at 2x resolution so they can be retina yo // or just get the photos at that rati...
export var CoverTextStyle = { fontSize: 18, }
<|file_name|>value.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Grove Enterprises 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...
// pub fn get_struct(&self) -> Result<&Vec<ScalarValue>> { // match *self { // ScalarValue::Struct(ref v) => Ok(v), // _ => Err(ExecutionError::from("TBD")),
<|file_name|>gulpfile-advanced.js<|end_file_name|><|fim▁begin|>var basePaths = { src: 'public/', dest: 'public.dist/', bower: 'bower_components/' }; var paths = { images: { src: basePaths.src + 'images/', dest: basePaths.dest + 'images/min/' }, scripts: { src: basePaths.src + 'scripts/', des...
<|file_name|>add_file.py<|end_file_name|><|fim▁begin|>import re from __future__ import print_function HEADER_TEMPLATE=r"""/* Copyright 2016, Austen Satterlee This file is part of VOSIMProject. VOSIMProject is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as...
return valid_directories
<|file_name|>tata.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- # ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######. # .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....## # .##.....#.##.....#.##......#...
pass
<|file_name|>pgitemdata.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------- # # This file is part of pygimplib. # # Copyright (C) 2014, 2015 khalim19 <khalim19@gmail.com> # # pygimplib is free software: you can redistribute it and/or modify # it under the ter...
if path_components: path = os.path.join(path, os.path.join(*path_components))
<|file_name|>iter-sum-overflow-overflow-checks.rs<|end_file_name|><|fim▁begin|>// run-pass // ignore-wasm32-bare compiled with panic=abort by default // compile-flags: -C overflow-checks use std::panic; fn main() { let r = panic::catch_unwind(|| {<|fim▁hole|> [1, i32::MAX].iter().sum::<i32>(); }); ...
<|file_name|>u-shapelets_clustering.py<|end_file_name|><|fim▁begin|>''' Created on 15 Aug 2016 <|fim▁hole|>from os import listdir import numpy import json import operator from operator import itemgetter from itertools import islice import math import dis from itertools import islice # TODO: try Livenstein ...
@author: sennikta ''' import os
<|file_name|>bitcoin_ru.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ru" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About VPSCoin</source> <translation>О VPSCoin</transl...
Amount: %2 Type: %3 Address: %4 </source>
<|file_name|>static-mut-foreign.rs<|end_file_name|><|fim▁begin|>// Copyright 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....
<|file_name|>userlist_data.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 def sanitize(time_string): if '-' in time_string: splitter = '-' elif ':' in time_string: splitter = ':' else: return(time_string) (mins, secs) = time_string.strip().split(splitter) return(mins + '.' + secs) def get_co...
with open(filename) as fn: data = fn.readline() return(data.strip().split(','))
<|file_name|>Sequences.cpp<|end_file_name|><|fim▁begin|>#include <seqan/sequence.h> #include <seqan/basic.h> #include <seqan/find_motif.h> #include <seqan/file.h> #include <iostream> using namespace seqan; template<typename TString>//String<char> void countOneMers(TString const& str){ Iterator<TString>::Type StringI...
resize(counter, 26,0);//26 = AlphSize unsigned int normalize =ordValue('a');
<|file_name|>0007_add_descriptions_to_project_and_tasks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10b1 on 2016-09-17 02:14 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('time...
migrations.AddField( model_name='task', name='description',
<|file_name|>objects.py<|end_file_name|><|fim▁begin|>""" TutorialWorld - basic objects - Griatch 2011 This module holds all "dead" object definitions for the tutorial world. Object-commands and -cmdsets are also defined here, together with the object. Objects: TutorialObject Readable Climbable Obelisk LightSource C...
current root positions. """ if self.db.button_exposed: # we found the button by moving the roots
<|file_name|>main.go<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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/LICENS...
<|file_name|>solutions.py<|end_file_name|><|fim▁begin|>__problem_title__ = "Number Rotations" __problem_url___ = "https://projecteuler.net/problem=168" __problem_description__ = "Consider the number 142857. We can right-rotate this number by moving " \ "the last digit (7) to the front of it, g...
<|file_name|>autoxml.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright (C) 2005, TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 3 of the Licen...
errs.append(_("autoxml.read: File '%s' has errors") % uri) raise Error(*errs) def write(self, uri, keepDoc = False, tmpDir = '/tmp',
<|file_name|>classDeclarationBlockScoping1.js<|end_file_name|><|fim▁begin|>//// [classDeclarationBlockScoping1.ts] class C { } { class C { } } //// [classDeclarationBlockScoping1.js] var C = (function () { <|fim▁hole|>}()); { var C_1 = (function () { function C_1() { } ret...
function C() { } return C;
<|file_name|>pairwise.rs<|end_file_name|><|fim▁begin|>#[macro_use] mod utils; inject_indy_dependencies!(); extern crate indyrs as indy; extern crate indyrs as api; use crate::utils::{did, pairwise}; use crate::utils::constants::*; use crate::utils::Setup; use self::indy::ErrorCode; mod high_cases { use super::...
#[test] fn indy_set_pairwise_metadata_works_for_invalid_wallet_handle() { Setup::empty();
<|file_name|>S15.1.2.1_A1.2_T1.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: > If the eval function is called with some argument, then use a first argument es5id: 15.1.2.1_A1.2_T1 d...
---*/
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2015 Alex Maslakov, <http://www.gildedhonour.com>, <http://www.alexmaslakov.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the...
3 }
<|file_name|>Calculator.py<|end_file_name|><|fim▁begin|># Numbers 数字 print(2 + 2) # 4 print(50 - 5*6) # 20 print((50 - 5*6) / 4) # 5.0 print(8/5) # 1.6 print(17 / 3) # 5.666666666666667 float print(17 // 3) # 5 取整 print(17 % 3) # 2 取模 print(5*3+2) ...
<|file_name|>SimulatorStore.js<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2020 Graylog, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the Server Side Public License, version 1, * as published by MongoDB, Inc. * * This program is distributed in the hope...
SimulatorActions.simulate.promise(promise); }, });
<|file_name|>CommandBuilder.py<|end_file_name|><|fim▁begin|>import Utils from Utils import printe <|fim▁hole|> def __init__(self, *command_args): self.command_args = list(command_args) def append(self, *args): for arg in args: if isinstance(arg, str): self.command_a...
class CommandBuilder(object):
<|file_name|>uint.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd. // This file is part of Parity. // Parity is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the ...
hex.push_str(&bytes_hex[1..]); } else { hex.push_str(&bytes_hex);
<|file_name|>image.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/. */ //! CSS handling for the specified value of //! [`image`][image...
} let position = moz_position.unwrap_or(LegacyPosition::center()); return Ok(GenericGradientKind::Radial(shape, GradientPosition::Legacy(position), angle));
<|file_name|>display_controller.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ash/display/display_controller.h" #include <algorithm> #include "ash/ash_s...
break;
<|file_name|>evaluate_quiz.py<|end_file_name|><|fim▁begin|>import os import sys import json from datetime import datetime from django.db import connection, transaction from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from django.utils.translation import ugett...
if question_submission.d is not question_answer.d_is_correct:
<|file_name|>assertion_suite_test.go<|end_file_name|><|fim▁begin|>package assertion_test import ( . "github.com/chai2010/gopkg/database/leveldb/internal/ginkgo" . "github.com/chai2010/gopkg/database/leveldb/internal/gomega" "testing" ) func TestAssertion(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "As...
}
<|file_name|>issue-3860.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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...
return self; }
<|file_name|>getters.js<|end_file_name|><|fim▁begin|>export default { // 购物车的商品数量<|fim▁hole|> cartCommodityCount: state => { const totalCount = state.cartList.reduce((total, commodity) => { return total + Number(commodity.count) }, 0) return totalCount }, removeCommodityCount: state => { co...
<|file_name|>common.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2011-2013 Martijn Kaijser # # 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 Found...
__addonid__ = __addon__.getAddonInfo('id') __addonname__ = __addon__.getAddonInfo('name') __author__ = __addon__.getAddonInfo('author')
<|file_name|>TermsAndConditionsAcceptanceStatusCollectionPage.java<|end_file_name|><|fim▁begin|>// Template Source: BaseEntityCollectionPage.java.tt // ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT Lic...
<|file_name|>fleetworkspace.go<|end_file_name|><|fim▁begin|>/* Copyright 2021 Rancher Labs, 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 Unle...
return &fleetWorkspaceCache{ indexer: c.Informer().GetIndexer(), resource: c.groupResource,
<|file_name|>dist.py<|end_file_name|><|fim▁begin|>"""distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. """ import sys, os, re try: import warnings except ImportError: warnings = None from distutils.errors import * from d...
<|file_name|>memo-card-test.js<|end_file_name|><|fim▁begin|>import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('memo-card', 'Integration | Component | memo card', { integration: true }); test('it renders', function(assert) { assert.expect(2); ...
// Template block usage: this.render(hbs` {{#memo-card}}
<|file_name|>countDenormalization.ts<|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 Unles...
Article.sum('unprocessedCount', query), Article.sum('unmoderatedCount', query), Article.sum('moderatedCount', query),
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>module.exports = (str, count, indent) => indentString(stripIndent(str), count || 0, indent);<|fim▁end|>
const stripIndent = require('strip-indent'); const indentString = require('indent-string');
<|file_name|>newchannel.go<|end_file_name|><|fim▁begin|><|fim▁hole|> // Newchannel triggered when a new channel is created. type Newchannel struct { Privilege []string Channel string `AMI:"Channel"` ChannelState string `AMI:"Channelstate"` ChannelStateDesc string `AMI:"Channelstatedesc"` Caller...
// Package event for AMI package event
<|file_name|>multifilereader.rs<|end_file_name|><|fim▁begin|>use std; use std::io; use std::io::BufReader; use std::fs::File; use std::vec::Vec; pub enum InputSource<'a> { FileName(&'a str), Stdin, #[allow(dead_code)] Stream(Box<io::Read>), } // MultifileReader - concatenate all our input, file or std...
break; } Err(e) => {
<|file_name|>PreReadDatabaseEvent.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * t...
<|file_name|>GoogleCloudDialogflowV2ImportConversationDataOperationMetadata.java<|end_file_name|><|fim▁begin|>/* * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://www.apache.org/lice...
* Timestamp when import conversation data request was created. The time is measured on server * side.
<|file_name|>coordinate.py<|end_file_name|><|fim▁begin|># ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the...
<|file_name|>descrobject.rs<|end_file_name|><|fim▁begin|>use libc::{c_char, c_int, c_void}; use crate::methodobject::PyMethodDef; use crate::object::{PyObject, PyTypeObject, Py_TYPE}; use crate::structmember::PyMemberDef; pub type getter = unsafe extern "C" fn(slf: *mut PyObject, closure: *mut c_void) -> *mut PyObjec...
fn clone(&self) -> wrapperbase { *self } }
<|file_name|>logger.py<|end_file_name|><|fim▁begin|>"""A very simple logger that tries to be concurrency-safe.""" import os, sys import time import traceback import subprocess import select LOG_FILE = '/var/log/nodemanager.func' # basically define 3 levels LOG_NONE=0 LOG_NODE=1 LOG_VERBOSE=2 # default is to log a...
fd = os.open(LOG_FILE, os.O_WRONLY | os.O_CREAT | os.O_APPEND, 0600) if not msg.endswith('\n'): msg += '\n'
<|file_name|>lxqt-panel_sr@latin.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="sr@latin"> <context> <name>ConfigPanelDialog</name> <message> <location filename="../config/configpaneldialog.cpp" line="80"/> <location filename="../...
<message> <location filename="../config/configpaneldialog.ui" line="48"/> <location filename="../config/configpaneldialog.ui" line="82"/>
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for sending data to Emoncms.""" import logging from datetime import timedelta import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import ( CONF_API_KEY, CONF_WHITELIST, CONF_URL, STA...
CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({
<|file_name|>test_linesearch.py<|end_file_name|><|fim▁begin|>""" Tests for line search routines """ from __future__ import division, print_function, absolute_import from numpy.testing import (assert_, assert_equal, assert_array_almost_equal, assert_array_almost_equal_nulp, assert_warns, ...
c += 1 assert_line_wolfe(x, p, s, f, fprime, err_msg=name) assert_(c > 3) # check that the iterator really works...
<|file_name|>utf_8.py<|end_file_name|><|fim▁begin|># uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: utf_8.py """ Python 'utf-8' Codec<|fim▁hole|> (c) Copyright CNRI, All Rights Reserved. NO WARRANTY...
Written by Marc-Andre Lemburg (mal@lemburg.com).
<|file_name|>recipe-580709-1.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- # <https://code.activestate.com/recipes/580709-lines-of-code-loc/> # Basic Lines-Of-Code counter in Python source files, reporting the # number of blank, comment and source code lines and total number of # line...
loc = Loc()
<|file_name|>ActionOutilTrait.java<|end_file_name|><|fim▁begin|>package controler; import java.awt.Color; import java.awt.event.ActionEvent; import java.util.Observable; import java.util.Observer; import javax.swing.AbstractAction; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.s...
* @author Alexandre Thorez * @author Fabien Huitelec
<|file_name|>lightstreamer-adapter.js<|end_file_name|><|fim▁begin|>/* Copyright (c) Lightstreamer Srl Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS...
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|>HistoryComplete.java<|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/. */ package etomica.data.history; /** * History that...
<|file_name|>dicts.js<|end_file_name|><|fim▁begin|>module.exports = { 'ar': require('../../i18n/ar.json'), 'da': require('../../i18n/da.json'), 'de': require('../../i18n/de.json'), 'en': require('../../i18n/en.json'), 'es': require('../../i18n/es.json'), 'fr': require('../../i18n/fr-FR.json'), 'fr-FR': re...
'pt': require('../../i18n/pt.json'), 'pt-BR': require('../../i18n/pt-BR.json'), 'ru': require('../../i18n/ru.json'), 'sv': require('../../i18n/sv.json'),
<|file_name|>autofill_profile.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 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/autofill/core/browser/autofill_profile.h" #include <algorithm> #includ...
// static void AutofillProfile::CreateInferredLabels( const std::vector<AutofillProfile*>& profiles,