prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_malloc_72b.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__delete_int64_t_malloc_72b.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete.la...
#include "std_testcase.h" #include <vector> using namespace std;
<|file_name|>input.go<|end_file_name|><|fim▁begin|>package audio import ( "encoding/binary" "io" "sync" "player/logger" ) // A input takes an audio input source and writes it to // an audio output source type Input struct { // Audo input input io.Reader // Audio output output Writer // Orchestration channel...
frames := make([]int16, FRAMES_PER_BUFFER) if err := binary.Read(i.input, binary.LittleEndian, frames); err != nil { switch err {
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render # Create your views here. from .models import Course, Student, StudentCourse from .serializers import CourseSerializer, StudentSerialiser from rest_framework import viewsets from rest_framework.decorators import detail_route, list...
<|file_name|>u32x4.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. #![cfg_attr(feature = "cargo-cli...
// Copyright 2015 blake2-rfc Developers // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
<|file_name|>VenueHash.ts<|end_file_name|><|fim▁begin|>import {LocationHash} from "./LocationHash"; /** * Created by hypfer on 08.06.17.<|fim▁hole|> return "VenueHash"; } Title: string; Address: string; Foursquare_id: string; constructor(id: string, ownerID: number, DbId: string, Source: n...
*/ export class VenueHash extends LocationHash { protected getHashType(): string {
<|file_name|>imports.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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/license...
<|file_name|>create-internal-ssl-certs.py<|end_file_name|><|fim▁begin|># This script has to run using the Python executable found in: # /opt/mgmtworker/env/bin/python in order to properly load the manager # blueprints utils.py module. import argparse import logging import utils class CtxWithLogger(object): logg...
utils.ctx = CtxWithLogger()
<|file_name|>3_biathlontoken.js<|end_file_name|><|fim▁begin|>const Nodelist = artifacts.require("./Nodelist.sol"); const BiathlonNode = artifacts.require("./BiathlonNode.sol"); const SecondNode = artifacts.require("./SecondNode.sol"); const BiathlonToken = artifacts.require("./BiathlonToken.sol"); const Ownable = artif...
<|file_name|>AlwaysLowestAdaptationLogic.cpp<|end_file_name|><|fim▁begin|>/* * AlwaysLowestAdaptationLogic.cpp ***************************************************************************** * Copyright (C) 2014 - VideoLAN authors * * This program is free software; you can redistribute it and/or modify it<|fim▁hole...
* under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version.
<|file_name|>GuiInventoryTFC.java<|end_file_name|><|fim▁begin|>package com.bioxx.tfc2.gui; import java.awt.Rectangle; import java.util.Collection; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.inventory.GuiContainerCreative; import net.minecraft.clie...
*/ public void updateScreen() { if (this.mc.playerController.isInCreativeMode())
<|file_name|>complementGraphTest.py<|end_file_name|><|fim▁begin|>__author__ = 'bruno' import unittest import algorithms.graphs.complementGraph as ComplementGraph class TestComplementGraph(unittest.TestCase): def setUp(self): pass <|fim▁hole|> 'b': {'a': 1, 'c': 1, 'd': 1}, ...
def test_complement_graph_1(self): graph = {'a': {'b': 1, 'c': 1},
<|file_name|>EncoderUserModesComponent.py<|end_file_name|><|fim▁begin|># http://remotescripts.blogspot.com """ Track Control User Modes component originally designed for use with the APC40. Copyright (C) 2010 Hanz Petrov <hanz.petrov@gmail.com> This program is free software: you can redistribute it and/or modify it un...
self._encoder_device_modes.set_controls_and_buttons(self._param_controls, self._modes_buttons)
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>import { ModuleWithProviders } from "@angular/core"; export * from './src/app/services/image-lazy-load.service'; export * from './src/app/services/web-worker.service'; export * from './src/app/directives/image-lazy-load.directive';<|fim▁hole|><|fim▁end|>
export declare class ImageLazyLoadModule { static forRoot(configuredProviders: Array<any>): ModuleWithProviders; }
<|file_name|>strategy.go<|end_file_name|><|fim▁begin|>package buildconfiginstantiate import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" apirequest "k8s.io/apiserver/pkg/endpoints/request" "k8s.io/kubernetes/pkg/api/legacyscheme" buildapi "github.com/openshift/origin/pkg/bu...
func (strategy) PrepareForCreate(ctx apirequest.Context, obj runtime.Object) { } // Canonicalize normalizes the object after validation.
<|file_name|>pyfile_transfer.py<|end_file_name|><|fim▁begin|>''' Created on 10/5/2015 @author: johnPortella @version: 1.0 ''' import paramiko, os from ftplib import FTP #from config_parser import ConfigUtils class PyFileTransfer(object): ''' def __init__(self, transfName): transfConf = ConfigUt...
self.__t.get(filename, os.path.join(localDirectory, filename)) self.__t.chdir(None)
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). #![deny(warnings)] // Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted acros...
mod client; mod server;
<|file_name|>render_api.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/. */ #![deny(missing_docs)] use std::cell::Cell; use std::fmt;...
<|file_name|>api.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # Copyright (C) Zing contributors. # # This file is a part of the Zing project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for c...
<|file_name|>bom_textdoc.py<|end_file_name|><|fim▁begin|># This file is part of Invenio. # Copyright (C) 2007, 2008, 2009, 2010, 2011, 2014 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 Free Software Foundation; eit...
of the document. @rtype: string
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>""" WSGI config for tumuli project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ """<|fim▁hole|> import os from django.core.wsgi impo...
<|file_name|>a.js<|end_file_name|><|fim▁begin|><|fim▁hole|>print('this is a'); print(__FILE__, __LINE__, __DIR__); load('./b.js'); // 不能简单的加载同目录的 b,因为 engine.get(FILENAME) 未变<|fim▁end|>
<|file_name|>cfgs-on-items.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....
<|file_name|>transform_assignable_fragment_spreads_in_updatable_queries.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use common::{NamedItem, W...
Program, Selection, Transformed, Transformer, };
<|file_name|>cpu.rs<|end_file_name|><|fim▁begin|>use anyhow::{anyhow, Result}; use cnx::text::{Attributes, Text}; use cnx::widgets::{Widget, WidgetStream}; use std::fs::File; use std::io::BufRead; use std::io::BufReader; use std::time::Duration; use tokio::time; use tokio_stream::wrappers::IntervalStream; use tokio_str...
}]; Ok(texts)
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
pub mod route;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from aiohttp import web from aiohttp_session import get_session, SESSION_KEY as SESSION_COOKIE_NAME from aioweb.middleware.csrf.templatetags import CsrfTag, CsrfRawTag from aioweb.util import awaitable from aioweb.modules.template.backends.jinja2 import APP_KEY as ...
<|file_name|>cvedbsync.py<|end_file_name|><|fim▁begin|>"""Update vulnerability sources.""" from selinon import StoragePool from f8a_worker.base import BaseTask<|fim▁hole|>from f8a_worker.workers import CVEcheckerTask class CVEDBSyncTask(BaseTask): """Update vulnerability sources.""" def components_to_scan(se...
from f8a_worker.enums import EcosystemBackend from f8a_worker.models import Ecosystem from f8a_worker.solver import get_ecosystem_solver, OSSIndexDependencyParser
<|file_name|>finalGraph.py<|end_file_name|><|fim▁begin|>import sys, math, os import matplotlib.pyplot as plt def main(): # Check that there's at least one argument if len(sys.argv) < 2: print("Usage python {} <file1> [<file2> ...]".format(sys.argv[0])) return 1 # Automatically detect i...
with open(species, "r") as fread: for line in fread:
<|file_name|>PostProcessing.cpp<|end_file_name|><|fim▁begin|>#include <iostream> #include <string> #include <stdio.h> #include <stdlib.h> #include <fstream> #include <sstream> #include <sys/stat.h> #include "Constants.h" #include "Converting.cpp" #include "ProcessVideoRecording.cpp" #include "ProcessScreenRecording.cp...
if (i + 1 < argc) { gazeTrackingAlgo = argv[++i];
<|file_name|>RenameExampleClassPlugin.java<|end_file_name|><|fim▁begin|>/** * Copyright 2006-2017 the original author or 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...
* <dt>searchString</dt> * <dd>Example$</dd> * <dt>replaceString</dt>
<|file_name|>analyzeMissingDates.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node var http = require('http'); var moment = require('moment'); var server = undefined; var threshold = undefined; var units = undefined; if (!isValid(process.argv)) { console.error('invalid arguments, expected hostname threshold and un...
var result = [];
<|file_name|>geo-util.js<|end_file_name|><|fim▁begin|>define([ 'gmaps', 'config', 'leaflet', 'leaflet-pip', 'app-state' ], function (gmaps, config, L, leafletPip, appState) { "use strict";<|fim▁hole|> var geocoder = new gmaps.Geocoder(), // simplifies place name for geocoder to get better result...
<|file_name|>HedgeFunction.cpp<|end_file_name|><|fim▁begin|>/* fuzzylite (R), a fuzzy logic control library in C++. Copyright (C) 2010-2017 FuzzyLite Limited. All rights reserved. Author: Juan Rada-Vilela, Ph.D. <jcrada@fuzzylite.com> This file is part of fuzzylite. fuzzylite is free software: you can redistribu...
return _function.membership(x); }
<|file_name|>Sound.cpp<|end_file_name|><|fim▁begin|>#include "Sound.h" #include <Windows.h> #include "DigitalGraffiti.h" Sound::Sound(void) <|fim▁hole|>{ // Find music and sound files std::string exeDir = DigitalGraffiti::getExeDirectory(); DigitalGraffiti::getFileList(exeDir + "\\sound\\instructions\\*", in...
<|file_name|>user.go<|end_file_name|><|fim▁begin|>package handler import ( "strconv" "github.com/dinever/golf" "github.com/dingoblog/dingo/app/model" ) func registerUserHandlers(app *golf.Application, routes map[string]map[string]interface{}) { app.Get("/api/users", APIUsersHandler) routes["GET"]["users_url"] =...
<|file_name|>StorageService.java<|end_file_name|><|fim▁begin|>package com.nowgroup.scspro.service.cat; import com.nowgroup.scspro.dto.cat.Storage; import com.nowgroup.scspro.dto.geo.State; import com.nowgroup.scspro.service.BaseService;<|fim▁hole|> State getStateInStorage(int id); }<|fim▁end|>
public interface StorageService extends BaseService<Storage> {
<|file_name|>security_groups.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import attr from navmazing import NavigateToAttribute, NavigateToSibling from widgetastic.widget import View, Select from widgetastic_manageiq import ( Accordion, BaseEntitiesView, BootstrapSelect, BreadCrumb, ItemsToolBarViewSele...
message="Wait Security Group to appear", num_sec=400, timeout=1000, delay=20,
<|file_name|>motionSmoother.H<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright held by origi...
ClassName("motionSmoother"); // Constructors
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use crate::document_loader::{DocumentLoader, LoadType}; use crat...
Some(DOMString::from(String::from(system_id))), doc, );
<|file_name|>file.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolu...
params['path'] = os.path.join(params['path'], basename) # state should default to file, but since that creates many conflicts, # default state to 'current' when it exists.
<|file_name|>x-point.ts<|end_file_name|><|fim▁begin|>import { Point } from "./point"; export class XPoint extends Point { constructor(wording: string) { super(wording); this.text.anchor.x = 0.5;<|fim▁hole|> } public draw(): void { this.clear(); this.lineStyle(1, 0x0000FF, 1...
<|file_name|>2_6_lists_functions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # recurso de referencia: http://www.tutorialspoint.com/python/python_lists.htm lista_de_asignaturas_teoricas = [ 'matematicas', 'lengua castellana'] # el la funcion len() es usado para obtener la cantidad de elementos en una lis...
# hallar elemento de menor valor en una lista con numeros print "elemento de menor valor" print min(lista_de_numeros) # 1
<|file_name|>GitHasVersionRule.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2014 Will Thames <will@thames.id.au> # # 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,...
from ansiblelint.rules import AnsibleLintRule
<|file_name|>board.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- #-----------------------------------------------------------------------# # # # This file is part of the Horus Project # # ...
# Date: August, November 2014 # # Author: Jesús Arroyo Torrens <jesus.arroyo@bq.com> # # # # This program is free software: you can redistribute it and/or modify #
<|file_name|>partial.rs<|end_file_name|><|fim▁begin|>use std::borrow::Cow; use std::collections::HashMap; use serde_json::value::Value as Json; use crate::block::BlockContext; use crate::context::{merge_json, Context}; use crate::error::RenderError; use crate::json::path::Path; use crate::output::Output; use crate::r...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (C) 2009-2010 Nicolas P. Rougier # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, ...
:type: int ''')
<|file_name|>torrent.py<|end_file_name|><|fim▁begin|>""" PyroScope - Controller "torrent". Copyright (c) 2009 The PyroScope Project <pyroscope.project@gmail.com><|fim▁hole|> it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or...
This program is free software; you can redistribute it and/or modify
<|file_name|>0005_auto_20170402_1502.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-02 15:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('talks', '0004_auto_2017...
operations = [ migrations.AlterField(
<|file_name|>tfrecordio_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the ...
_TFRecordUtil.read_record(self._as_file_handle(record)) def test_masked_crc32c(self): self.assertEqual(0xfd7fffa, _TFRecordUtil._masked_crc32c(b'\x00' * 32))
<|file_name|>subst.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/licenses/...
<|file_name|>slice.rs<|end_file_name|><|fim▁begin|>use super::{ToRuby, ToRubyResult}; use sys::{rb_ary_new_capa, rb_ary_push}; impl<'a, T> ToRuby for &'a [T] where &'a T: ToRuby { fn to_ruby(self) -> ToRubyResult { let ary = unsafe { rb_ary_new_capa(self.len() as isize) }; for item in self { ...
} Ok(ary)
<|file_name|>duckduckgo2html.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """Retrieve results from the DuckDuckGo zero-click API in simple HTML format.""" import json as jsonlib import logging import re import urllib.request, urllib.error, urllib.parse __version__ = (1, 0, 0) def results2html(results, r...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn main() { let mut my_struct = MyStruct { my_field1: 0, my_field2: 0, my_field3: 0, my_field4: 0, my_field5: 0, }; my_struct.my_field1 = 7; assert_eq!(7, my_struct.my_field1); assert_eq!(0, my_struct.my_fiel...
<|file_name|>feedback_vote.js<|end_file_name|><|fim▁begin|>var smidig = smidig || {}; smidig.voter = (function($) { var talk_id, $form, $notice, $loader; function supports_html5_storage() { try { return 'localStorage' in window && window['localStorage'] !== null; } catch (e) { return false; ...
$.each(a, function() { if (o[this.name] !== undefined) { if (!o[this.name].push) {
<|file_name|>Movies.js<|end_file_name|><|fim▁begin|>enyo.kind({ name: "Remote.Movies",<|fim▁hole|> onPlay: "", }, components: [ {kind: "PageHeader", components: [ {name: "headerText", kind: enyo.VFlexBox, content: "", flex: 1 }, {name: "back...
kind: "VFlexBox", events: {
<|file_name|>show_reply_thumbnails.js<|end_file_name|><|fim▁begin|>//================================================ // show_reply_thumbnails.js // Author: @iihoshi //================================================ (function ($, jn) { var my_filename = 'show_reply_thumbnails.js'; // プラグイン情報 ここから // プラグイン情報の初期化 ...
'ja' : 'リプライサムネイル表示', 'en' : 'Show thumbnails in reply chain' },
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>// #docplaster // #docregion // Import the native Angular services. import { Component } from '@angular/core'; import { Title } from '@angular/platform-browser'; @Component({<|fim▁hole|> `<p> Select a title to set on the current HTML document: </p> ...
selector: 'app-root', template:
<|file_name|>331_srtp_prefer_rtp_avp.py<|end_file_name|><|fim▁begin|><|fim▁hole|># $Id: 331_srtp_prefer_rtp_avp.py 2081 2008-06-27 21:59:15Z bennylp $ import inc_sip as sip import inc_sdp as sdp # When SRTP is NOT enabled in pjsua, it should prefer to use # RTP/AVP media line if there are multiple m=audio lines sdp = ...
<|file_name|>ColumnChooserTable.component.js<|end_file_name|><|fim▁begin|>import React from 'react'; import PropTypes from 'prop-types'; import ColumnChooserRow from '../ColumnChooserRow'; import { columnsPropTypes } from '../../columnChooser.propTypes'; const ColumnChooserTable = ({ columns = [], id, onChangeCheckbox...
<|file_name|>category.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import...
if manufacturers: filters["manufacturer__in"] = manufacturers
<|file_name|>default.js<|end_file_name|><|fim▁begin|>Meteor.startup(function () { }); Deps.autorun(function(){<|fim▁hole|>});<|fim▁end|>
Meteor.subscribe('userData');
<|file_name|>general.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import time #import struct from pycket import impersonators as imp from pycket import values, values_string from pycket.cont import continuation, loop_label, call_cont from pycket.arity import Arity ...
return return_value(default_read_handler, env, cont) else:
<|file_name|>command-test.js<|end_file_name|><|fim▁begin|>var Table = require ('../table.js'); var Command = require('../command.js'); require('../actions/report-action.js'); require('../actions/move-action.js'); require('../actions/right-action.js'); require('../actions/left-action.js'); require('../actions/place-acti...
test.equal(ctx.robot.y, 3); test.equal(ctx.robot.f.getName(), 'NORTH');
<|file_name|>update_placements.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # h...
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
<|file_name|>DownloadTransformer.java<|end_file_name|><|fim▁begin|>package org.apache.cocoon.transformation; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Map; import j...
String[] pHosts = nonProxyHostsRE.replaceAll("\\.", "\\\\.").replaceAll("\\*", ".*").split("\\|"); nonProxyHostsRE = "";
<|file_name|>strconv.go<|end_file_name|><|fim▁begin|>// This file is part of MuMax, a high-performance micromagnetic simulator. // Copyright 2011 Arne Vansteenkiste and Ben Van de Wiele. // Use of this source code is governed by the GNU General Public License version 3 // (as published by the Free Software Foundat...
<|file_name|>XMLControl.py<|end_file_name|><|fim▁begin|>from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import os import xml.etree.ElementTree from xml.etree.cElementTree import ElementTree, Element, SubElement from xm...
elem.tail = i else: if level and (not elem.tail or not elem.tail.strip()): elem.tail = i
<|file_name|>82.py<|end_file_name|><|fim▁begin|>idade = 12 if idade < 4: preco = 0 elif idade < 18: preco = 5 elif idade < 65: preco = 10 else: preco = 5 print('Seu custo de admissão e R$' + str(preco) + '.') ''' Foi adicionado mais bloco de instrução elif<|fim▁hole|>seja acima de 65 executa o último b...
para idades abaixo de 65. Se caso a idade for maior que 18 e menor que 65 o bloco e executado, caso a idade
<|file_name|>rust.rs<|end_file_name|><|fim▁begin|>extern crate proc_macro; extern crate phrases as sayings; extern crate syn; #[macro_use] extern crate quote;<|fim▁hole|> use sayings::japanese::greetings as ja_greetings; use sayings::japanese::farewells::*; use sayings::english::{self, greetings as en_greetings, farewe...
<|file_name|>WorldDaoTest.java<|end_file_name|><|fim▁begin|>package com.github.ssindelar.ps2parser; import static org.fest.assertions.api.Assertions.assertThat; import org.testng.annotations.Test; import com.github.ssindelar.ps2parser.data.world.WorldResponse; import com.github.ssindelar.ps2parser.data.world.status....
@Test
<|file_name|>data_notes.py<|end_file_name|><|fim▁begin|># Copyright 2015 Diamond Light Source Ltd. # # 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/LICEN...
* ``end`` is shape[dim]
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>var events = require('events'); var request = require('request'); var zlib = require('zlib'); var iconv = require('iconv-lite'); var async = require('async'); var imagesize = require('imagesize'); var moment = require('moment'); var _ = require('underscore'); var cach...
<|file_name|>gallery.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////// // Name: src/ribbon/gallery.cpp // Purpose: Ribbon control which displays a gallery of items to choose from // Author: Peter Cawley // Modified by: // Created: 2...
if(m_active_item) { if(m_art && m_art->GetFlags() & wxRIBBON_BAR_FLOW_VERTICAL) pos.x += m_scroll_amount;
<|file_name|>EventFOV.java<|end_file_name|><|fim▁begin|>package ca.wescook.wateringcans.events; import ca.wescook.wateringcans.potions.ModPotions; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.client.event.FOVUpdateEvent; import net.mine...
// Get player data double playerSpeed = player.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getAttributeValue();
<|file_name|>documenttype.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 dom::bindings::codegen::Bindings::DocumentTypeBindin...
<|file_name|>dashboard.ctrl.js<|end_file_name|><|fim▁begin|>(function(){ 'use strict'; angular.module('GamemasterApp') .controller('DashboardCtrl', function ($scope, $timeout, $mdSidenav, $http) { $scope.users = ['Fabio', 'Leonardo', 'Thomas', 'Gabriele', 'Fabrizio', 'John', 'Luis', 'Kate', 'Max'];...
<|file_name|>generate.py<|end_file_name|><|fim▁begin|>import click from .. import templates<|fim▁hole|> pass @generate.command() @click.argument('name') @click.option('--path', required=True) @click.pass_context def blueprint(ctx, name, path): app = ctx.obj templates.extract_template( 'snippets/blu...
@click.group() def generate():
<|file_name|>about_loader.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 file_loader; use hyper::header::ContentType; use hyp...
use net_traits::ProgressMsg::Done;
<|file_name|>pagelayout.py<|end_file_name|><|fim▁begin|>""" PageLayout ========== .. image:: images/pagelayout.gif :align: right The :class:`PageLayout` class is used to create a simple multi-page layout, in a way that allows easy flipping from one page to another using borders. :class:`PageLayout` does not curr...
page = self.children[-p - 1] if touch.ud['page'] == 'previous':
<|file_name|>fingerprint.rs<|end_file_name|><|fim▁begin|>use std::fs::{self, File, OpenOptions}; use std::io::prelude::*; use std::io::{BufReader, SeekFrom}; use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex}; use filetime::FileTime; use core::{Package, Target, Profile}; use util; use util::{CargoResult, Fre...
let new = dir(cx, pkg, kind); let loc = new.join(&filename(target, profile)); info!("fingerprint at: {}", loc.display());
<|file_name|>exception_ex.py<|end_file_name|><|fim▁begin|>from cinder.exception import * from cinder.i18n import _ class ProviderMultiVolumeError(CinderException): msg_fmt = _("volume %(volume_id)s More than one provider_volume are found") <|fim▁hole|>class ProviderMultiSnapshotError(CinderException): msg_fmt ...
<|file_name|>logging.go<|end_file_name|><|fim▁begin|>package event<|fim▁hole|>import ( "time" "github.com/go-kit/kit/log" ) type logService struct { logger log.Logger next Service } // LogServiceMiddleware given a Logger wraps the next Service with logging capabilities. func LogServiceMiddleware(logger log.Log...
<|file_name|>IFrameNavigator.js<|end_file_name|><|fim▁begin|>// Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. import { Log } from './Log.js'; import { IFrameWindow } from './IFrameWindow.js'; ...
<|file_name|>cell-command-standard.py<|end_file_name|><|fim▁begin|>import sys, os, subprocess, tempfile, shlex, glob result = None d = None def format_msg(message, headline): msg = "Line {0}:\n {1}\n{2}:\n{3}"\ .format(PARAMS["lineno"], PARAMS["source"], headline, message) return msg try: #print(...
if return_mode == "stderr" and process.stderr: if monitor_preliminary: return_preliminary(curr_stderr_data)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>## # Copyright 2012-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https...
<|file_name|>binnode.rs<|end_file_name|><|fim▁begin|>use std::collections::Bitv; use BinGraph; /// Contains a binary state and the choices. #[deriving(PartialEq, Eq, Show, Clone)] pub struct BinNode { /// The state composed of bits. pub state: Bitv, /// The choices represented as bits that can be flipped. ...
} /// Call closure for each available choice.
<|file_name|>ReadableList.java<|end_file_name|><|fim▁begin|>package com.salesmanager.shop.model.entity; import java.io.Serializable; public abstract class ReadableList implements Serializable { /** * */<|fim▁hole|> private int number;//number of record in current page private long recordsTotal;//total number...
private static final long serialVersionUID = 1L; private int totalPages;//totalPages
<|file_name|>inheritanceTest.py<|end_file_name|><|fim▁begin|>__author__ = 'http://www.python-course.eu/python3_inheritance.php' class Person: def __init__(self, first, last): self.firstname = first self.lastname = last def Name(self):<|fim▁hole|> class Employee(Person): def __init__(sel...
return self.firstname + " " + self.lastname
<|file_name|>syntax_definition.rs<|end_file_name|><|fim▁begin|>//! Data structures for representing syntax definitions //! //! Everything here is public becaues I want this library to be useful in super integrated cases //! like text editors and I have no idea what kind of monkeying you might want to do with the data. ...
if let Some(sub) = substituter(val) {
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from miniURL.models import Redirection #Pour faire un formulaire depuis un modèle. (/!\ héritage différent) class RedirectionForm(forms.ModelForm): class Meta: model = Redirection fields = ('real_url', 'pseudo') # Pour ré...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub struct Actor { x: i32, y: i32 } impl Actor { fn follow(self, dir: &Direction) -> Actor { match *dir { Direction::North => Actor { x: self.x, y: self.y + 1 }, Direction::East => Actor { x: self.x + 1, y: self.y }, ...
<|file_name|>attr-derive.rs<|end_file_name|><|fim▁begin|>// aux-build:derive-foo.rs // pp-exact // Testing that both the inner item and next outer item are // preserved, and that the first outer item parsed in main is not // accidentally carried over to each inner function #[macro_use] extern crate derive_foo; #[deri...
<|file_name|>kEdge.js<|end_file_name|><|fim▁begin|>'use strict'; var ANONYMOUS_USER_ID = "55268521fb9a901e442172f8"; var mongoose = require('mongoose'); //var Promise = require("bluebird"); var dbService = require('@colabo-knalledge/b-storage-mongo'); <|fim▁hole|> function resSendJsonProtected(res, data) { // http...
var mockup = { fb: { authenticate: false }, db: { data: false } }; var accessId = 0;
<|file_name|>test_auth_resources.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz> # Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com> # Copyright (C) 2014-2017 Alejandro Alonso <alejandr...
<|file_name|>vector_utils.py<|end_file_name|><|fim▁begin|>import numpy as np from scipy.sparse import csr_matrix, coo_matrix def save_sparse_csr(filename,array): np.savez(filename,data = array.data ,indices=array.indices, indptr =array.indptr, shape=array.shape ) def load_sparse_csr(filename): lo...
micro_f1 = 2*micro_precision*micro_recall / (micro_precision+micro_recall) scores["micro_precision"] = micro_precision
<|file_name|>atmelavr.py<|end_file_name|><|fim▁begin|># Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. """ Builder for Atmel AVR series of microcontrollers """ from os.path import join from time import sleep from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default, ...
<|file_name|>devtools.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 devtools_traits::{AutoMargins, CachedConsoleMessage, Cac...
id: PipelineId) { if let Some(win) = documents.find_window(id) { win.Location().reload_without_origin_check();
<|file_name|>ecdsa_signer_key_manager.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Tink-Rust 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....
fn validate_key_format( key_format: &tink_proto::EcdsaKeyFormat, ) -> Result<(tink_proto::EcdsaParams, tink_proto::EllipticCurveType), TinkError> {
<|file_name|>colorful.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ pygments.styles.colorful ~~~~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by CodeRay. :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.s...
Generic.Inserted: "#00A000",
<|file_name|>exitHandlers.js<|end_file_name|><|fim▁begin|>/* * The contents of this file are subject to the OpenMRS Public License * Version 1.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://license.openmrs.org * * Software dis...
*/