prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>application.js<|end_file_name|><|fim▁begin|>import Ember from "ember";
const { Route } = Ember;
const set = Ember.set;
export default Route.extend({
setupController() {
this.controllerFor('mixinStack').set('model', []);
let port = this.get('port');
port.on('objectInspector:updateObject', th... | const details = options.details, |
<|file_name|>interfaces.js<|end_file_name|><|fim▁begin|><|fim▁hole|>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=interfaces.js.map<|fim▁end|> | // @ag-grid-community/react v25.1.0 |
<|file_name|>ResearcherLink.java<|end_file_name|><|fim▁begin|>/**
Copyright 2008 University of Rochester
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.apach... | public void setParentFolder(ResearcherFolder parentFolder) {
this.parentFolder = parentFolder;
}
|
<|file_name|>test_segmentgroup.py<|end_file_name|><|fim▁begin|># -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- http://www.mdanalysis.org
# Copyright (c) 2006-2016 The MDAnalysis Development Team and cont... | s.segids = 'ADK'
assert_equal(self.universe.segments.segids, ['ADK'], |
<|file_name|>runtime_test.rs<|end_file_name|><|fim▁begin|>// use std::env;
// #[test]
// fn trybuild_tests()
// {
// println!( "current_dir : {:?}", env::current_dir().unwrap() );
// // let t = trybuild::TestCases::new();<|fim▁hole|>// // t.pass( "rust/test/former/test/basic_runtime.rs" );
// }
mod basic_runtim... | |
<|file_name|>align.rs<|end_file_name|><|fim▁begin|>s_no_extra_traits! {
#[allow(missing_debug_implementations)]
#[repr(align(8))]
pub struct max_align_t {
priv_: [f64; 3]<|fim▁hole|><|fim▁end|> | }
} |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(box_syntax)]
#![feature(fnbox)]
#![feature(drain)]
#![feature(catch_panic)]
#![deny(missing_docs, dead_code)]<|fim▁hole|>//! when attempting to do concurrent/parallel programming.
//!
//! This includes a thread pool, a multi-producer/multi-consumer queue, a t... |
//! Ferrous Threads Crate
//!
//! This crate contains a number of different structs and functions that are of use |
<|file_name|>demo_satpy_fog.py<|end_file_name|><|fim▁begin|>from __future__ import division
from __future__ import print_function
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageEnhance
import nwcsaf
import numpy as np
from satpy import Scene, find_files_and_readers
fro... | base_dir_nwc = "/data/cinesat/in/eumetcast1/"
#base_dir_nwc = "/data/cinesat/in/safnwc_v2016/"
elif len(sys.argv) == 6:
year = int(sys.argv[1]) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015-2020 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the Li... | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details. |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# libmypaint documentation build configuration file, created by
# sphinx-quickstart2 on Wed Jun 13 23:40:45 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration va... | |
<|file_name|>1417_Weighing_Problem.py<|end_file_name|><|fim▁begin|># 1417. Weighing Problem
# Gives nn coins, each weighing 10g, but the weight of one coin is 11g. There
# is now a balance that can be accurately weighed. Ask at least a few times
# to be sure to find the 11g gold coin.
#
# Example
# Given n = 3, return... | # coins and place them on the two ends of the balance for the second
# weighing. The gold coin at the heavy end is 11g gold coins.
|
<|file_name|>EquippedBadgeSettings_pb2.py<|end_file_name|><|fim▁begin|># Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Settings/Master/EquippedBadgeSettings.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor... | from google.protobuf import reflection as _reflection |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
$(function() {
$(document).ajaxError((event, xhr) => {
console.error(xhr.responseJSON.error_message);
});
});
function basename(str) {
let base;
base = str.substring(str.lastIndexOf("\/") + 1);
base = str.substring(str.lastI... | });
} |
<|file_name|>SpinnerNumberField.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2014 Bruno Medeiros and other Contributors.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of ... | }
public SpinnerNumberField setValueMaximum(int maximum) {
spinner.setMaximum(maximum);
|
<|file_name|>new_data_to_atlas_space.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import os.path
from nipype.interfaces.utility import IdentityInterface, Function
from nipype.interfaces.io import SelectFiles, DataSink, DataGrabber
from nipype.pipeline.engine import Workflow, Node, MapNode
from nipyp... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# EnergiScore Web Documentation documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 9 11:19:34 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possi... | pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = [] |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import decimal
import json
from datetime import date, datetime, time
import dateutil.parser
from django.conf import settings
from django.db.models import Model
from versions.models import Versionable
DEFAULTS = {
'user_mail_required': {
'default': 'Fal... | elif as_type is not None and issubclass(as_type, Model):
return as_type.objects.get(pk=value)
return value
|
<|file_name|>dns_2.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>#[test]
fn parse_query() {
let data = include_bytes!("../assets/captures/dns_2_query.bin");
let question = Question::new("google.com.", QType::ByType(Type::AAAA), Class::Internet)
.unwrap();
let msg = Message::parse(&data[..]).unwrap();
... | extern crate martin;
use martin::*;
|
<|file_name|>ExternalEventAttendee.java<|end_file_name|><|fim▁begin|>package se.tmeit.app.model;
import com.google.auto.value.AutoValue;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
<|fim▁hole|>public abstract class ExternalE... | /**
* Model object for attendees of an external event.
*/
@AutoValue |
<|file_name|>resource_osc_api_gateway_method_response_test.go<|end_file_name|><|fim▁begin|>package osc
import (
"fmt"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/apigateway"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hash... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![recursion_limit = "1024"] // for error_chain!
extern crate rand;
extern crate scopeguard;
#[macro_use]<|fim▁hole|>extern crate toml;
extern crate download;
extern crate semver;
#[cfg(windows)]
extern crate winapi;
#[cfg(windows)]
extern crate winreg;
#[cfg(windows)]... | extern crate error_chain;
extern crate rustc_serialize;
extern crate sha2;
extern crate url; |
<|file_name|>test_hb.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function, absolute_import
from io import StringIO
import tempfile
import numpy as np
from numpy.testing import assert_equal, \
assert_array_almost_equal_nulp
from scipy.sparse import coo_matrix, csc_matrix, rand
from sc... | (np.array([[36, 70, 88, 17, 29, 44, 69, 18, 24, 51],
[0, 4, 58, 61, 61, 72, 72, 73, 99, 99]])))) |
<|file_name|>foot.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { FootComponent } from './foot.component';
describe('FootComponent', () => {
let component: FootComponent;
let fixture: ComponentFixture<FootComponent>;
beforeEach(a... | fixture = TestBed.createComponent(FootComponent); |
<|file_name|>mechonMamre.py<|end_file_name|><|fim▁begin|>from bs4 import BeautifulSoup as Soup
import json
import re
import requests
from common import *
from nltk.corpus import words
entries = []
WEBSITE = 'http://www.mechon-mamre.org/jewfaq/glossary.htm'
SITE_TITLE = "Mechon Mamre"
source_object = {"site":WEBSITE, "... | |
<|file_name|>DeploymentReadyAction.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/codedeploy/model/DeploymentReadyAction.h>
#include <aws/core/utils/HashingUtils.h>
#include <aws/core/Globals.h>
#incl... | case DeploymentReadyAction::CONTINUE_DEPLOYMENT:
return "CONTINUE_DEPLOYMENT"; |
<|file_name|>KafkaCP.py<|end_file_name|><|fim▁begin|>__author__ = 'asifj'
import logging
from kafka import KafkaConsumer
import json
import traceback
from bson.json_util import dumps
from kafka import SimpleProducer, KafkaClient
from utils import Utils
logging.basicConfig(
format='%(asctime)s.%(msecs... | inputs = consumer.fetch_messages()
'''for message in consumer:
|
<|file_name|>commands.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 <Aclapi.h>
#include <windows.h>
#include <stddef.h>
#include <string>
#include "sandbo... | |
<|file_name|>uStripDesign.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# @Author: Marco Benzi <marco.benzi@alumnos.usm.cl>
# @Date: 2015-06-07 19:44:12
# @Last Modified 2015-06-09
# @Last Modified time: 2015-06-09 16:07:05
# ==========================================================================
# Thi... | |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
|jedi| is mostly being tested by what I would call "Blackbox Tests". These
tests are just testing the interface and do input/output testing. This makes a
lot of sense for |jedi|. Jedi supports so many different code structures, that
it is just s... |
TEST_COMPLETIONS = 0
TEST_DEFINITIONS = 1 |
<|file_name|>a5.rs<|end_file_name|><|fim▁begin|>fn main() { // Ciclos loop es un iterador infinito al menos que se ponga "break;"
// quita los comentarios de las lineas para ver la sentencia break temrinar el loop al llegar X a 5.
// let mut x: i32 = 0;
loop {
println!("Precione Ctrl + C para terminar... | |
<|file_name|>signrawtransactions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test transaction signing using the sig... | """Create and sign a valid raw transaction with one input. |
<|file_name|>acl.py<|end_file_name|><|fim▁begin|>import struct
import uuid
from enum import IntEnum
from typing import List, Optional, Set
from .sid import SID
class ACEFlag(IntEnum):
""" ACE type-specific control flags. """
OBJECT_INHERIT = 0x01
CONTAINER_INHERIT = 0x02
NO_PROPAGATE_INHERIT = 0x04... | |
<|file_name|>client.js<|end_file_name|><|fim▁begin|>"use strict";
var React = require("react");
var MainView = require("../views/MainView");
var MainElement = document.getElementById("main");
var socket = require("socket.io-client")();
var Store = require("../views/Store");
var omit = require("lodash/object/omit");
s... | }); |
<|file_name|>test_purchase_request.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2016 Eficent Business and IT Consulting Services S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).
from openerp.tests import common
from openerp.tools import SUPERUSER_ID<|fim▁hole|> def set... |
class TestPurchaseRequest(common.TransactionCase):
|
<|file_name|>DefaultSeverityFacet.tsx<|end_file_name|><|fim▁begin|>/*
* SonarQube
* Copyright (C) 2009-2022 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by ... | |
<|file_name|>prework--numpy-ultraquick-tutorial.py<|end_file_name|><|fim▁begin|>"""
## NumPy UltraQuick Tutorial
[source](https://colab.research.google.com/github/google/eng-edu/blob/main/ml/cc/exercises/numpy_ultraquick_tutorial.ipynb?utm_source=mlcc)
> create/manipulate vectors and matrices
"""
## import module a... | ## populate arrays with random numbers
### 'randint' for integers
rand_ints_between_10_and_50 = np.random.randint(low=10, high=51, size=(5))
print(rand_ints_between_10_and_50) |
<|file_name|>Nodelink.java<|end_file_name|><|fim▁begin|>/**
Eubrazil Scientific Gateway
Copyright (C) 2015 CMCC
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 License, or
(at... | @JsonPropertyOrder({
"node",
|
<|file_name|>EventTypes.js<|end_file_name|><|fim▁begin|>/* Copyright (C) 2011-2014 Mattias Ekendahl. Used under MIT license, see full details at https://github.com/developedbyme/dbm/blob/master/LICENSE.txt */
dbm.registerClass("dbm.thirdparty.facebook.constants.EventTypes", null, function(objectFunctions, staticFunctio... | staticFunctions.AUTH_LOGIN = "auth.login";
staticFunctions.AUTH_RESPONSE_CHANGE = "auth.authResponseChange";
staticFunctions.AUTH_STATUS_CHANGE = "auth.statusChange";
staticFunctions.AUTH_LOGOUT = "auth.logout"; |
<|file_name|>MapEvictAllCodec.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* htt... | import {BitsUtil} from '../util/BitsUtil';
import {ClientMessage, Frame, PARTITION_ID_OFFSET} from '../protocol/ClientMessage';
import {StringCodec} from './builtin/StringCodec'; |
<|file_name|>config.go<|end_file_name|><|fim▁begin|><|fim▁hole|>// Copyright 2018 Authors of Cilium
//
// 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/license... | |
<|file_name|>post.py<|end_file_name|><|fim▁begin|>class Post(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
<|fim▁hole|><|fim▁end|> | def __iter__(self):
return iter(self.__dict__) |
<|file_name|>client.py<|end_file_name|><|fim▁begin|># Copyright 2015 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
#
# Unless ... | elif 'copy' in config:
return CopyJob.from_api_repr(resource, self)
elif 'extract' in config:
return ExtractTableToStorageJob.from_api_repr(resource, self) |
<|file_name|>mock_test.go<|end_file_name|><|fim▁begin|>package evoli
import "math/rand"
type crosserMock struct {
}
func (c crosserMock) Cross(parent1, parent2 Individual) (child1, child2 Individual, err error) {<|fim▁hole|> return NewIndividual(w*parent1.Fitness() + (1-w)*parent2.Fitness()),
NewIndividual((1-w)*p... | w := 0.1 + 0.8*rand.Float64() |
<|file_name|>io.rs<|end_file_name|><|fim▁begin|>use core::cmp::PartialEq;
use core::ops::{BitAnd, BitOr, Not};
pub trait Io {
type Value: Copy + PartialEq + BitAnd<Output = Self::Value> + BitOr<Output = Self::Value> + Not<Output = Self::Value>;
fn read(&self) -> Self::Value;
fn write(&mut self, value: Sel... |
impl<I: Io> WriteOnly<I> {
pub const fn new(inner: I) -> WriteOnly<I> { |
<|file_name|>globalize.culture.zh-HK.js<|end_file_name|><|fim▁begin|>/*
* Globalize Culture zh-HK
*
* http://github.com/jquery/globalize
*
* Copyright Software Freedom Conservancy, Inc.
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* This file was generated by the Globa... | |
<|file_name|>parse-complex-macro-invoc-op.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://w... | // <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. |
<|file_name|>menus.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Module handling report menus contents"""
from contextlib import contextmanager
import attr
from navmazing import NavigateToAttribute
from widgetastic.widget import Text
from widgetastic_patternfly import Button
from . import CloudIntelRepor... | view = self.go_to_group(group)
view.reports_tree.click_path("Top Level", folder, subfolder) |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/*jslint browser: true*/
/*global Tangram, gui */
map = (function () {
'use strict';
var locations = {
'Yangon': [16.8313077,96.2187007,7]
};
var map_start_location = locations['Yangon'];
/*** Map ***/
var map = L.map('map',
... | ); |
<|file_name|>widgets.py<|end_file_name|><|fim▁begin|>"""
HTML Widget classes
"""
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
import copy
from itertools import chain
from django.conf import settings
from django.utils.datastructures import MultiValueDict, MergeDict
from django... | |
<|file_name|>TestROIStencil.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# A script to test the vtkROIStencilSource
reader = vtk.vtkPNGReader()
reader.SetDataSpacing(0.8,0.8,1.5)
reader.S... | imgWin.AddRenderer(imager4)
imgWin.SetSize(512,512)
imgWin.Render()
|
<|file_name|>twitter.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import absolute_import
import flask
import auth
import config
import model
import util
from main import app
twitter_config = dict(
access_token_url='https://api.twitter.com/oauth/access_token',
authorize_url='https://api.twitt... | base_url='https://api.twitter.com/1.1/', |
<|file_name|>decoder.py<|end_file_name|><|fim▁begin|># Copyright 2016 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 with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | pass_through = (new.shape.ndims == 0)
return new if pass_through else array_ops.where(finished, cur, new)
if impute_finished: |
<|file_name|>RootContainer.js<|end_file_name|><|fim▁begin|>// @flow
import React, { Component } from 'react'
import { View, StatusBar } from 'react-native'
import NavigationRouter from '../Navigation/NavigationRouter'
import { connect } from 'react-redux'
import StartupActions from '../Redux/StartupRedux'
import Redux... | } |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Generated by Django 1.11.5 on 2017-09-19 16:34
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
... | # -*- coding: utf-8 -*- |
<|file_name|>LockingFileTools.java<|end_file_name|><|fim▁begin|>package net.sourceforge.seqware.common.util.filetools.lock;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.channels.FileLock;
import java.nio.charset.StandardCharsets;
i... | |
<|file_name|>refs.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use std::ops::Deref;
use serde::ser::{Serialize, Serializer};
use crate::types::*;
macro_rules! integer_id_impls {
($name: ident) => {
impl $name {
pub fn new(inner: Integer) -> Self {
$name(inner)
}
... | }
|
<|file_name|>outlines.js<|end_file_name|><|fim▁begin|>/**
* libjass
*
* https://github.com/Arnavion/libjass
*
* Copyright 2013 Arnav Singh
*
* 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 Licens... | |
<|file_name|>RegexParser.py<|end_file_name|><|fim▁begin|>from NfaBuilder import NfaBuilder
def enum(**enums):
return type('Enum', (), enums)
nodeTypes = enum(CHARACTER = 1, STAR = 2, QUESTION = 3, ALTER = 4, CONCAT = 5, PLUS = 6)
specialTransitions = enum(EPSILON = -1)
<|fim▁hole|>
class ParseNode():
"""
... | class ParseError( Exception ): pass
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io;<|fim▁hole|>fn read_input() -> io::Result<()> {
let mut input = String::new();
io::stdin().read_line(&mut input)?;
println!("You typed: {}", input.trim());
Ok(())
}
fn main() {
read_input().unwrap();
}<|fim▁end|> | |
<|file_name|>Sphere.js<|end_file_name|><|fim▁begin|>/**
* @module og/bv/Sphere
*/
'use strict';
import { Vec3 } from '../math/Vec3.js';
/**
<|fim▁hole|> * @param {og.Vec3} [center] - Bounding sphere coordiantes.
*/
class Sphere {
constructor(radius, center) {
/**
* Sphere radiu... | * Bounding sphere class.
* @class
* @param {Number} [radius] - Bounding sphere radius.
|
<|file_name|>client_go_adapter.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 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-2... | |
<|file_name|>rebuildSchemata.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
@file rebuildSchemata.py
@author Michael Behrisch
@date 2011-07-11
@version $Id: rebuildSchemata.py 11671 2012-01-07 20:14:30Z behrisch $
Let all SUMO binarie write the schema for their config
SUMO, Simulation of Urban MObil... | import os, sys, subprocess
homeDir = os.environ.get("SUMO_HOME", os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
binDir = os.environ.get("SUMO_BINDIR", os.path.join(homeDir, "bin"))
for exe in "activitygen dfrouter duarouter jtrrouter netconvert netgen od2trips polyconvert sumo".split(): |
<|file_name|>lc069-sqrtx.py<|end_file_name|><|fim▁begin|># coding=utf-8
import unittest
"""69. Sqrt(x)
https://leetcode.com/problems/sqrtx/description/
Implement `int sqrt(int x)`.
Compute and return the square root of _x_ , where _x_ is guaranteed to be a
non-negative integer.
Since the return type is an integer... | |
<|file_name|>testtermopi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
title : testtermopi.py
description : This program runs the termopi.py
: Displays the status of the resources (cpu load and memory usage) consumed by a Raspberry Pi
computer and the resources ... | termo.create_jsonfile_with_pi_status()
#termo.check_pi_resource_status(cpuUsageThreshold) |
<|file_name|>FormLabel.js<|end_file_name|><|fim▁begin|>var React = require('react/addons');
var blacklist = require('blacklist');
var classNames = require('classnames');
module.exports = React.createClass({<|fim▁hole|> id: React.PropTypes.string,
style: React.PropTypes.object,
verticalAlign: React.PropTypes.oneOf... | displayName: 'FormLabel',
propTypes: {
className: React.PropTypes.string,
htmlFor: React.PropTypes.string, |
<|file_name|>mesos_monitor.py<|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/licenses/LICENSE-2.0
#
# Unless required ... | |
<|file_name|>transport_internal_test.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// White-box tests for transport.go (in package http instead of http_test).
package req
i... | type roundTripFunc func(r *http.Request) (*http.Response, error) |
<|file_name|>withOneTarget_after.py<|end_file_name|><|fim▁begin|><|fim▁hole|> print(42)<|fim▁end|> | def main():
with open('file.txt'): |
<|file_name|>source_map.rs<|end_file_name|><|fim▁begin|>use std::slice::Iter;
use crate::base::pos::Line;
use crate::base::symbol::Symbol;
use crate::base::types::ArcType;
use crate::types::VmIndex;
#[derive(Debug, Default, Eq, PartialEq, Clone, Hash)]
#[cfg_attr(feature = "serde_derive", derive(Deserialize, Seriali... | #[cfg_attr(feature = "serde_derive", derive(DeserializeState, SerializeState))]
#[cfg_attr( |
<|file_name|>redundant_semicolon.rs<|end_file_name|><|fim▁begin|>use crate::{EarlyContext, EarlyLintPass, LintContext};
use rustc_ast::{Block, StmtKind};
use rustc_errors::Applicability;
use rustc_span::Span;
declare_lint! {
/// The `redundant_semicolons` lint detects unnecessary trailing
/// semicolons.
/... | |
<|file_name|>test_createkilldye.py<|end_file_name|><|fim▁begin|># ------------------------------------------------------------
# Developping with MicroPython in an async way
#
# ------------------------------------------------------------
# === asyncio tests ===
# --------------------------... | |
<|file_name|>Map.py<|end_file_name|><|fim▁begin|># by amounra 0216 : http://www.aumhaa.com
"""
Codec_Map.py
Created by amounra on 2010-10-05.
Copyright (c) 2010 __artisia__. All rights reserved.
This file allows the reassignment of the controls from their default arrangement. The order is from left to right;
Butto... | COLOR_MAP = [127, 127, 127, 127, 127, 127, 127] |
<|file_name|>bookr.controller.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('shoprApp')
.controller('BookrCtrl', function ($scope, localStorageService, Auth, $http, $routeParams, $location) {
$scope.Auth = Auth;
//$scope.books = Auth.getCurrentUser().books;
$scope.mySubs = Auth.getCurrentUse... |
} |
<|file_name|>network.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
The NetworkCollector class collects metrics on network interface usage
using /proc/net/dev.
#### Dependencies
* /proc/net/dev
"""
import diamond.collector
from diamond.collector import str_to_bool
import diamond.convertor<|fim▁hole|>
try:
... | import os
import re |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# (c) 2015 Incaser Informatica S.L. - Sergio Teruel<|fim▁hole|><|fim▁end|> | # (c) 2015 Incaser Informatica S.L. - Carlos Dauden
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from . import main |
<|file_name|>vowel.py<|end_file_name|><|fim▁begin|>vowels = ['a','e','i','o','u']
s = 'sudeep'
count = 0
for i in s:<|fim▁hole|> print 'vowel found'
count = count + 1
print "number of vowels:",str(count)<|fim▁end|> | for q in vowels:
if s[i] == vowels[q]: |
<|file_name|>Pesawat.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package delay.model;
/**
*
* @author M3 New
*/
public class Pesawat {
private String namaPesawat;
private String idPesawat;
private String idMaskapai... | this.idMaskapai = idMaskapai;
}
|
<|file_name|>ng_form.ts<|end_file_name|><|fim▁begin|>import {
PromiseWrapper,
ObservableWrapper,
EventEmitter,
PromiseCompleter
} from 'angular2/src/facade/async';
import {StringMapWrapper, List, ListWrapper} from 'angular2/src/facade/collection';
import {isPresent, isBlank, CONST_EXPR} from 'angular2/src/facad... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models<|fim▁hole|> def forwards(self, orm):
# Adding model 'Result'
db.create_table('taxonomy_result', (
... |
class Migration(SchemaMigration):
|
<|file_name|>OFFSIDE.cpp<|end_file_name|><|fim▁begin|>#include<iostream>
using namespace std;
int main()
{
int a,d,x[20],y[20],a1,temp,i,j;
while(1)
{
a1=20000;
cin>>a>>d;
if(a==0 & d==0)
break;
for(i=0;i<a;i++)
{<|fim▁hole|> a1=x[i];
}
for(i=0;i<d;i++)
{
cin>>y[i];
}
for(i=0;i<2;i++)
... | cin>>x[i];
if(x[i]<a1) |
<|file_name|>connection-button.js<|end_file_name|><|fim▁begin|>import BarButton from '../bar-button/bar-button';
import { useRef, useEffect } from 'react';
export default function ConnectionButton() {
const buttonRef = useRef();
const isUserConnected = elementorAdminTopBarConfig.is_user_connected;
useEffect( () =>... | |
<|file_name|>manageindexes.js<|end_file_name|><|fim▁begin|>ManageIndexes = {
GridPanel : function(config) {
config.autoExpandColumn = 'columns';
config.viewConfig = { forceFit: true };
ManageIndexes.GridPanel.superclass.constructor.call(this, config);
},
gridPanelStore : function(data) {
var store = n... | }
}
}
},
|
<|file_name|>invocation.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 Richard Diamond & contributors.
//
// This file is part of Rust Rocket.
//
// Rust Rocket is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Softw... |
pub struct State { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>mod acc;
mod palalpha;
mod pal;
mod prewitt;
mod undither;
pub use crate::undither::Undither;
pub use crate::pal::Pal;
pub use crate::palalpha::PalAlpha;<|fim▁hole|>pub use crate::palalpha::PixAlphaAble;<|fim▁end|> | |
<|file_name|>route.js<|end_file_name|><|fim▁begin|>Router.route('/users', {<|fim▁hole|>});<|fim▁end|> | name: 'menu.users',
template: 'users',
parent: 'menu',
title: 'Users', |
<|file_name|>TsMuxeRVideo.java<|end_file_name|><|fim▁begin|>/*
* PS3 Media Server, for streaming any medias to your PS3.
* Copyright (C) 2008 A.Brochard<|fim▁hole|> * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License only.
*
* T... | *
* This program is free software; you can redistribute it and/or |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
A sub-package for efficiently dealing with polynomials.
Within the documentation for this sub-package, a "finite power series,"
i.e., a polynomial (also referred to simply as a "series") is represented
by a 1-D numpy array of the polynomial's coefficients, orde... | from numpy.testing import Tester
test = Tester(__file__).test
bench = Tester(__file__).bench |
<|file_name|>navbarDirective.js<|end_file_name|><|fim▁begin|>(function(angular) {
'use strict';
angular<|fim▁hole|> return {
restrict: 'E',
templateUrl: 'nav/_navbar.html',
controller: 'NavbarController',
controllerAs: 'nav'
};
}
} (window.angul... | .module('jstube.chromeExtensionCleaner.popup')
.directive('jstubeNavbar', jstubeNavbar);
function jstubeNavbar() { |
<|file_name|>kpiHelper.ts<|end_file_name|><|fim▁begin|>/*
* Power BI Visualizations
*
* Copyright (c) Microsoft Corporation
* All rights reserved.
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the ""S... | |
<|file_name|>porter_segment.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import json
import requests
import sys, os
import time
import re
class Helper:
initheaders = {
"Host": "segmentfault.com",
"Connection": "keep-alive",
"Content-Length": "55",
"Accept": "*/*",
"Origin": "https://segment... | return form
|
<|file_name|>binary_buffer.cpp<|end_file_name|><|fim▁begin|>#include "binary_buffer.hpp"
#include <iterator>
#include <algorithm>
#include <sstream>
#include <boost/endian/conversion.hpp>
using boost::endian::native_to_big;
using boost::endian::big_to_native;
namespace {
using aria::byte;
template <typename... | std::copy(begin, end, std::back_inserter(vec));
}
template <typename P> |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import AnswerRating from './answerRating';
import FeedBackResults from './feedbackResults';
import './less/feedback.less';
// Check if bar rating should be initialized
const ratingWrapper = document.querySelector('.rating-wrapper');
if (ratingWrapper !== null) {
An... |
// Check if feed back results charts should be initialized
const feedBackResultsElement = document.getElementById('feedback-results'); |
<|file_name|>tok.rs<|end_file_name|><|fim▁begin|>use std::str::FromStr;
#[derive(Debug)]
pub enum Tok {
Num(i32),
LParen,
RParen,
Minus,
Plus,
Times,
Div,
Comma,
}
// simplest and stupidest possible tokenizer
pub fn tokenize(s: &str) -> Vec<(usize, Tok, usize)> {
let mut tokens = v... | .collect()
}
fn take_while<C,F>(c0: char, chars: &mut C, f: F) -> (String, Option<char>) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
@file Export all functions in yuv-video to user
@author Gilson Varghese<gilsonvarghese7@gmail.com>
@date 13 Oct, 2016
**/
/**
Module includes
*/
var frameReader = require(./lib/framereader);
var frameWriter = require(./lib/framewriter);
var frameConverte... |
}; |
<|file_name|>response.py<|end_file_name|><|fim▁begin|>from datetime import timedelta
from propeller.cookie import Cookie
from propeller.options import Options
from propeller.template import Template
from propeller.util.dict import MultiDict
from urllib import quote
import httplib
import propeller
class Response(obje... | |
<|file_name|>path-type-bounds.rs<|end_file_name|><|fim▁begin|>// pp-exact<|fim▁hole|>
trait Tr { }
impl Tr for int;
fn foo(x: ~Tr: Freeze) -> ~Tr: Freeze { x }
fn main() {
let x: ~Tr: Freeze;
~1 as ~Tr: Freeze;
}<|fim▁end|> | |
<|file_name|>styles.js<|end_file_name|><|fim▁begin|>'use strict';
var React = require('react-native');
var {StyleSheet, PixelRatio, Platform} = React;
var styles = StyleSheet.create({
container: {
flex:1,
paddingTop: 70,
backgroundColor: '#F7F7F7',
},
row: {
flexDire... | alignItems: 'center'
}, |
<|file_name|>bv_feature_selection.py<|end_file_name|><|fim▁begin|>import pyqtgraph as pg
from pyqtgraph.Qt import QtGui, QtCore
import numpy#
from pyqtgraph.parametertree import Parameter, ParameterTree, ParameterItem, registerParameterType
class FeatureSelectionDialog(QtGui.QDialog):
def __init__(self,v... | |
<|file_name|>angular-enhance-text.min.js<|end_file_name|><|fim▁begin|>(function(angular){
'use strict';
var app = angular.module('bernhardposselt.enhancetext', ['ngSanitize']);
app.factory('TextEnhancer',
["SmileyEnhancer", "VideoEnhancer", "NewLineEnhancer", "ImageEnhancer", "YouTubeEnhancer", "LinkEnhancer", funct... |
// trust result to able to use it in ng-bind-html
text = $sce.trustAsHtml(text); |
<|file_name|>Testdb.java<|end_file_name|><|fim▁begin|>/* Copyright (c) 2001-2008, The HSQL Development Group
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source cod... | // db writes out to files and performs clean shuts down |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.