prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>page.js<|end_file_name|><|fim▁begin|>import React from "react"; import Griddle from 'griddle-react'; import styles from "./style.css"; import restCalls from '../../utils/restCalls'; import { browserHistory } from 'react-router'; import AddNewCaseModal from '../../common/components/CaseModal'; import ViewCa...
}, { "columnName": "watchItem",
<|file_name|>StepExporter.cpp<|end_file_name|><|fim▁begin|>/* Open Asset Import Library (assimp) ---------------------------------------------------------------------- Copyright (c) 2006-2018, assimp team All rights reserved. Redistribution and use of this software in source and binary forms, with or without modifi...
<|file_name|>null_object.py<|end_file_name|><|fim▁begin|>""" Encapsulate the absence of an object by providing a substitutable alternative that offers suitable default do nothing behavior. """ import abc class AbstractObject(metaclass=abc.ABCMeta): """ Declare the interface for Client's collaborator. Imp...
def request(self):
<|file_name|>expr-if-struct.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/...
impl PartialEq for mood { fn eq(&self, other: &mood) -> bool { ((*self) as uint) == ((*other) as uint)
<|file_name|>actions.test.js<|end_file_name|><|fim▁begin|>import { defaultAction, } from '../actions'; import { DEFAULT_ACTION, } from '../constants'; describe('Marginals actions', () => { describe('Default Action', () => { it('has a type of DEFAULT_ACTION', () => { const expected = {<|fim▁hole|> }); ...
type: DEFAULT_ACTION, }; expect(defaultAction()).toEqual(expected); });
<|file_name|>installment.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python # -*- coding: utf-8 -*- import re from datetime import datetime, date from decimal import Decimal from translations import _t, _a from model import Model from lib.query_builder import Query from lib.money import Money import payment impor...
table = 'installments'
<|file_name|>BuildFacilitiesState.cpp<|end_file_name|><|fim▁begin|>/* * Copyright 2010-2015 OpenXcom Developers. * * This file is part of OpenXcom. * * OpenXcom 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 Softwar...
#include "../Savegame/SavedGame.h" #include "PlaceFacilityState.h"
<|file_name|>application_tokens.d.ts<|end_file_name|><|fim▁begin|>import { OpaqueToken, Provider } from 'angular2/src/core/di'; /** * An {@link angular2/di/OpaqueToken} representing the application root type in the {@link * Injector}. * * ``` * @Component(...) * class MyApp { * ... * } * * bootstrap(MyApp)....
<|file_name|>test_ui.py<|end_file_name|><|fim▁begin|># License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).<|fim▁hole|> class UICase(HttpCase): def test_ui_website(self): """Test frontend tour.""" tour = "website_sale_product_brand" self.phantom_js( url_path="/shop", ...
from odoo.tests.common import HttpCase
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; var express = require('express'); var passport = require('passport'); var config = require('../config/environment'); var User = require('../api/user/user.model'); // Passport Configuration<|fim▁hole|>require('./twitter/passport').setup(User, config); re...
require('./local/passport').setup(User, config); require('./facebook/passport').setup(User, config);
<|file_name|>PorterStemmer.java<|end_file_name|><|fim▁begin|>/** * Licensing arrangement (from website FAQ): * * The software is completely free for any purpose, unless notes at the * head of the program text indicates otherwise (which is rare). In any * case, the notes about licensing are never more restrictiv...
public static void main(String[] args) { PorterStemmer s = new PorterStemmer();
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # ----------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team.<|fim▁hole|># The full license is in the file COPYING.txt, distributed with this software. # ------------------...
# # Distributed under the terms of the Modified BSD License. #
<|file_name|>if_.rs<|end_file_name|><|fim▁begin|>//! Network interface name resolution. //! //! Uses Linux and/or POSIX functions to resolve interface names like "eth0" //! or "socan1" into device numbers. use libc::c_uint; use crate::{Result, Error, NixPath}; /// Resolve an interface into a interface number. pub fn ...
/// Interface is in polling mode.
<|file_name|>ddraw.rs<|end_file_name|><|fim▁begin|>// Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. // All files in the project carrying such notice may not be co...
<|file_name|>4-json-to-csv.py<|end_file_name|><|fim▁begin|># import the libraries that you need import requests import csv # make a GET request to the OneSearch X-Service API response = requests.get('http://onesearch.cuny.edu/PrimoWebServices' '/xservice/search/brief?' '...
'&json=true') # take the JSON from the response # and store it in a variable called alldata
<|file_name|>__init__.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 #<|fim▁hole|># Unless required by applicable law or agreed to in writing, software # distri...
# http://www.apache.org/licenses/LICENSE-2.0 #
<|file_name|>test_environment.py<|end_file_name|><|fim▁begin|># Copyright 2012-2015 MongoDB, 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....
<|file_name|>_googleappengine.py<|end_file_name|><|fim▁begin|>"""HTTP related handlers. Note that some other HTTP handlers live in more specific modules: _auth.py, _gzip.py, etc. Copyright 2002-2006 John J Lee <jjl@pobox.com> This code is free software; you can redistribute it and/or modify it under the terms of th...
# create_readline_wrapper = socket._fileobject #else:
<|file_name|>check-import.ts<|end_file_name|><|fim▁begin|>import { Selector } from 'testcafe' import { ROOT_URL, login } from '../e2e/utils' // eslint-disable-next-line fixture`imported data check`.beforeEach(async (t /*: TestController */) => { await t.setNativeDialogHandler(() => true) await t.navigateTo(`${ROOT...
.expect(Selector('a').withText('Ask HN: single comment').exists) .ok({ timeout: 20000 }) })
<|file_name|>backend_client.go<|end_file_name|><|fim▁begin|>package http import ( gohttp "net/http" "time" ) func MakeBackendHttpClient(timeout time.Duration) *gohttp.Client { return &gohttp.Client{ Timeout: time.Duration(timeout), Transport: &gohttp.Transport{ DisableKeepAlives: true,<|fim▁hole|> }, } }<...
<|file_name|>localrepo.py<|end_file_name|><|fim▁begin|># localrepo.py - read/write repository class for mercurial # # Copyright 2005-2007 Matt Mackall <mpm@selenic.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from node impo...
return self.local() # so statichttprepo's override of local() works
<|file_name|>Sergeant.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package com.iluwatar; public class Sergeant extends Unit { public Sergeant(Unit ... children) { super(children); } @Override public void accept(UnitVisitor visitor) { visitor.visitSergeant(this); super.accept(visitor); } ...
<|file_name|>GA_8Queens.py<|end_file_name|><|fim▁begin|>''' Solution for Eight Queens Problem Using the Genetic Algorithms 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 ...
<|file_name|>hash.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). use digest::{Digest, FixedOutput}; use sha2::Sha256; use std::error::Error; use std::fmt; use std::io::{self, Write}; use hex; const ...
0xab, 0xab,
<|file_name|>h8.py<|end_file_name|><|fim▁begin|>import envi.archs.h8.emu as h8_emu import envi.archs.h8.regs as h8_regs import vivisect.impemu.emulator as v_i_emulator<|fim▁hole|>class H8WorkspaceEmulator(v_i_emulator.WorkspaceEmulator, h8_emu.H8Emulator): taintregs = [h8_regs.REG_ER0, h8_regs.REG_ER1, h8_regs.REG...
<|file_name|>compose-environment-manager.ts<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015-2017 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at *...
recipe = this.parser.parse(content); } catch (e) { this.$log.error(e);
<|file_name|>login.py<|end_file_name|><|fim▁begin|>from flask_login import LoginManager <|fim▁hole|> login_manager = LoginManager() @login_manager.user_loader def load_user(user_id): return User.get(user_id=user_id)<|fim▁end|>
from server.users.models import User
<|file_name|>test_product_except_self.py<|end_file_name|><|fim▁begin|>""" https://leetcode.com/explore/interview/card/top-interview-questions-hard/116/array-and-strings/827/ """ from unittest import TestCase from kevin.leet.product_except_self import Solution, SolutionOptimized class TestProductExceptSelf(TestCase)...
<|file_name|>win_impl.rs<|end_file_name|><|fim▁begin|>use winapi; use self::winapi::shared::windef::POINT; use self::winapi::ctypes::c_int; use self::winapi::um::winuser::*; use crate::win::keycodes::*; use crate::{Key, KeyboardControllable, MouseButton, MouseControllable}; use std::mem::*; /// The main struct for h...
self.key_to_scancode(key), );
<|file_name|>DashboardVM.js<|end_file_name|><|fim▁begin|>define(["ng", "lodash"], function(ng, _){ "use strict"; var DashboardVM = function DashboardVM($scope, $rootScope){ var _self = this; this.toggleHStretch = function(isOn){ _self.setOptions(options); }; this.updateOptions = function(options){ ...
// this.items = [ // {
<|file_name|>library.py<|end_file_name|><|fim▁begin|>""" Client for the library API. """ class LibraryClient(object): """ Library API client. """ def __init__(self,axilent_connection): self.content_resource = axilent_connection.resource_client('axilent.library','content') self.api = axi...
Updates existing content. """ response = self.content_resource.put(data={'content_type':content_type, 'project':project,
<|file_name|>SendmywayCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class SendmywayCom(XFSHoster): __name__ = "SendmywayCom" __type__ = "hoster" __version__ = "0.04" __pattern__ = r'http://(?:www\.)?sendmyway...
__license__ = "GPLv3" __authors__ = [("zoidberg", "zoidberg@mujmail.cz")]
<|file_name|>datastore.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') 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 Apache Lic...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate camera_controllers; extern crate collada; extern crate dev_menu; extern crate env_logger; extern crate gfx; extern crate gfx_text; extern crate gfx_debug_draw; extern crate piston; extern crate piston_window; extern crate sdl2_window; extern crate shader_ve...
<|file_name|>stats.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.6 # This file is a part of Metagam project. # # Metagam 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, o...
# loading list of active players that are really inactive for 14 days
<|file_name|>container_operations_unix.go<|end_file_name|><|fim▁begin|>// +build linux freebsd package daemon import ( "context" "fmt" "io/ioutil" "os" "path/filepath" "strconv" "time" "github.com/docker/docker/container" "github.com/docker/docker/daemon/links" "github.com/docker/docker/pkg/idtools" "gith...
for _, configRef := range c.ConfigReferences {
<|file_name|>db.py<|end_file_name|><|fim▁begin|><|fim▁hole|>db.create_all()<|fim▁end|>
from core import db from auth import models from admin import models
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # hash-ring-ctypes documentation build configuration file, created by # sphinx-quickstart on Wed Oct 2 18:10:26 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configura...
# The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the
<|file_name|>SlowBullet.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package com.syntacticsugar.vooga.gameplayer.objects.items.bullets; import com.syntacticsugar.vooga.gameplayer.event.implementations.SlowEvent; import com.syntacticsugar.vooga.gameplayer.objects.GameObjectType; public class SlowBullet extends Abstra...
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>""" WSGI config for websqlrunner project. It exposes the WSGI callable as a module-level variable named ``application``.<|fim▁hole|>For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsg...
<|file_name|>FaceDetector.py<|end_file_name|><|fim▁begin|>import cv2 import numpy as np import os from vilay.core.Descriptor import MediaTime, Shape from vilay.detectors.IDetector import IDetector from vilay.core.DescriptionScheme import DescriptionScheme class FaceDetector(IDetector): def getName(self): ...
# preprocessing actFrame = cv2.cvtColor(actFrame, cv2.cv.CV_BGR2GRAY) actFrame = cv2.equalizeHist(actFrame)
<|file_name|>models.py<|end_file_name|><|fim▁begin|># from index import db # class MyObject(): # def __init__(self): # pass # @staticmethod<|fim▁hole|><|fim▁end|>
# def get_something(arg1, arg2): # return something
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'FormPlu...
<|file_name|>invalid_range_index_example.py<|end_file_name|><|fim▁begin|>for i in range(0): i += 1 for j in range(0, 1, 3):<|fim▁hole|> for n in range(0, 1.1): # Error on this line n += 1 for m in range(4, 5): m += 1<|fim▁end|>
j += 1 for k in range(9, 1, -9): k += 1
<|file_name|>move-scalar.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.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,...
// 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.
<|file_name|>list.js<|end_file_name|><|fim▁begin|>import Omi from 'omi/dist/omi' import { CellsTitle, Cells, CellHeader, CellBody, CellFooter } from '../cell' Omi.makeHTML('CellsTitle', CellsTitle); Omi.makeHTML('Cells', Cells);<|fim▁hole|>export default class List extends Omi.Component{ constructor(data) { ...
Omi.makeHTML('CellHeader', CellHeader); Omi.makeHTML('CellBody', CellBody); Omi.makeHTML('CellFooter', CellFooter);
<|file_name|>mat.rs<|end_file_name|><|fim▁begin|>use std::ops::{Add, Sub}; #[derive(Clone, Copy, Debug, PartialEq)] pub struct Vec3 { pub x: f32, pub y: f32, pub z: f32 } impl Add for Vec3 {<|fim▁hole|> x: self.x + rhs.x, y: self.y + rhs.y, z: self.z + rhs.z } ...
type Output = Vec3; fn add(self, rhs: Vec3) -> Vec3 { Vec3 {
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from './TitusCapacityDetailsSection'; export * from './TitusSecurityGroups'; export * from './resize/TitusResizeServerGroupModal';<|fim▁hole|><|fim▁end|>
export * from './scalingActivity/TitusScalingActivitiesModal'; export * from './scalingPolicy';
<|file_name|>source.rs<|end_file_name|><|fim▁begin|>use check_file; use ffprobe; use path; use std::cmp::Ordering; use std::error::Error as StdError; use std::fmt; use std::io; use std::iter::IntoIterator; use std::ops::{Deref, DerefMut}; use std::path::PathBuf; #[derive(Debug)] pub enum Error { CheckFileError(che...
<|file_name|>config-wiki.post.json.js<|end_file_name|><|fim▁begin|><import resource="classpath:alfresco/site-webscripts/org/alfresco/callutils.js"> if (!json.isNull("wikipage")) { var wikipage = String(json.get("wikipage")); model.pagecontent = getPageText(wikipage); model.title = wikipage.replace(/_/g, " ");...
<|file_name|>conf.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 by applicable law or agre...
# -- Options for openstackdocstheme ------------------------------------------- openstack_projects = [
<|file_name|>huawei_lte.py<|end_file_name|><|fim▁begin|>""" Support for Huawei LTE routers. For more details about this component, please refer to the documentation at https://home-assistant.io/components/huawei_lte/ """ from datetime import timedelta from functools import reduce import logging import operator import...
<|file_name|>TestTryTest.java<|end_file_name|><|fim▁begin|>package com.caozeal.practice; import static org.assertj.core.api.Assertions.*; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; ...
////
<|file_name|>ddate.rs<|end_file_name|><|fim▁begin|>/// Enum containing all discordian Days, including StTibsDay #[derive(Debug,PartialEq)] enum Day { Sweetmorn, Boomtime, Pungenday, PricklePrickle, SettingOrange, StTibsDay, } /// Enum containing all discordian Seasons, including StTibsDay #[der...
#[test] fn test_leap_year_negative() {
<|file_name|>uniq.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for uniq // Project: https://www.npmjs.com/package/uniq // Definitions by: Hans Windhoff <https://github.com/hansrwindhoff> // Definitions: https://github.com/borisyankov/DefinitelyTyped <|fim▁hole|> declare var uniq :Uniq; declare module "uniq" {...
interface Uniq{ <T>(ip:Array<T>): Array<T>; }
<|file_name|>macgen.py<|end_file_name|><|fim▁begin|># macgen.py script to generate a MAC address for Red Hat Virtualization guests # # from http://www.linux-kvm.com/sites/default/files/macgen.py import random def randomMAC(): mac = [ 0x00, 0x16, 0x3e,<|fim▁hole|><|fim▁end|>
random.randint(0x00, 0x7f), random.randint(0x00, 0xff), random.randint(0x00, 0xff) ] return ':'.join(map(lambda x: "%02x" % x, mac))
<|file_name|>example_client.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 Robert Scott # 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 2 # of the License, or (at your opti...
# Set a two dimensional cell range.
<|file_name|>web_rootMenu.py<|end_file_name|><|fim▁begin|>""" @name: PyHouse/Project/src/Modules/Computer/Web/web_rootMenu.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2013-2019 by D. Brian Kimmel @license: MIT License @note: Created on May 30, 2013 @summary: Handle t...
<|file_name|>client.go<|end_file_name|><|fim▁begin|>// Package machinelearningservices implements the Azure ARM Machinelearningservices service API version 2019-06-01. // // These APIs allow end users to operate on Azure Machine Learning Workspace resources. package machinelearningservices // Copyright (c) Microsoft C...
import ( "github.com/Azure/go-autorest/autorest" )
<|file_name|>git.cc<|end_file_name|><|fim▁begin|>// This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved. /** git.cc Jeremy Barnes, 14 November 2015 Copyright (c) mldb.ai inc. All rights reserved. */ #include "mldb/core/procedure.h" #include "mldb/core/dataset.h" #include "mldb/base/per...
~Accum() { git_repository_free(repo);
<|file_name|>JavacTreeMaker.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2013-2018 The Project Lombok Authors. * * 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 restrict...
import com.sun.tools.javac.code.Attribute; import com.sun.tools.javac.code.BoundKind;
<|file_name|>hpdf.py<|end_file_name|><|fim▁begin|>## ## * << Haru Free PDF Library 2.0.8 >> -- hpdf.h ## * ## * URL http://libharu.org/ ## * ## * Copyright (c) 1999-2006 Takeshi Kanno ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereb...
#HPDF_STATUS HPDF_Page_Circle (HPDF_Page page, HPDF_REAL x, HPDF_REAL y, HPDF_REAL ray) _HPDF_Page_Circle=haru.HPDF_Page_Circle _HPDF_Page_Circle.restype=HPDF_STATUS
<|file_name|>LabelDetail.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react'; export interface LabelDetailProps { [key: string]: any; /** An element type to render as (string or function). */ as?: any; /** Primary content. */ children?: React.ReactNode; <|fim▁hole|> /** Additional classes. */...
<|file_name|>vmprof_profiler.py<|end_file_name|><|fim▁begin|>import os import shutil import tempfile import vmprof import prof_six as six from _prof_imports import TreeStats, CallTreeStat class VmProfProfile(object): """ Wrapper class that represents VmProf Python profiling backend with API matching the ...
return tstats
<|file_name|>mdl-layout.component.ts<|end_file_name|><|fim▁begin|>import { AfterContentInit, Component, ContentChild, ContentChildren, ElementRef, EventEmitter, Inject, Injectable, InjectionToken, Input, NgZone, OnChanges, OnDestroy, Optional, Output, QueryList, Renderer2, SimpleChan...
@Input("mdl-layout-no-drawer-button") get isNoDrawer(): boolean {
<|file_name|>custom.js<|end_file_name|><|fim▁begin|>'use strict'; //var async = require('async'), // nconf = require('nconf'), // user = require('../user'), // groups = require('../groups'), // topics = require('../topics'), // posts = require('../posts'), // notifications = require('../notifications...
SocketCustom.refreshLinkParser = function(socket, sets, callback) { if (!socket.uid) {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|><|fim▁end|>
"""Parse Archimate XML Exchange File Format into a MongoDB DB"""
<|file_name|>goaliedash.server.routes.js<|end_file_name|><|fim▁begin|><|fim▁hole|> /** * Module dependencies. */ var users = require('../../app/controllers/users'), goaliedash = require('../../app/controllers/goaliedash'); module.exports = function(app) { app.route('/goaliedash') .get(users.requiresLogin, user...
'use strict';
<|file_name|>comment.js<|end_file_name|><|fim▁begin|>/** * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or http://ckeditor.com/license */ /** * @fileOverview Defines the {@link CKEDITOR.dom.comment} class, which represents * a DOM comment no...
CKEDITOR.dom.domObject.call( this, comment );
<|file_name|>OsiamUserService.java<|end_file_name|><|fim▁begin|>package org.osiam.client; /* * for licensing see the file license.txt. */ import static org.apache.http.HttpStatus.SC_FORBIDDEN; import static org.apache.http.HttpStatus.SC_OK; import static org.apache.http.HttpStatus.SC_UNAUTHORIZED; import static org....
errorMessage = getErrorMessage(response, String.format("Unable to setup connection (HTTP Status Code: %d)", httpStatus)); throw new ConnectionInitializationException(errorMessage);
<|file_name|>precip_ingest.py<|end_file_name|><|fim▁begin|>"""Ingest Stage IV Hourly Files. 1. Copies to hourly stage IV netCDF files 2. Copies hourly stage IV netCDF to hourly IEMRE """ import os import datetime import sys import numpy as np from scipy.interpolate import NearestNDInterpolator import pygrib f...
def main(argv): """Go Main"""
<|file_name|>quickcheck.rs<|end_file_name|><|fim▁begin|>#![cfg(feature="quickcheck")] extern crate quickcheck; extern crate rand; extern crate petgraph; use rand::Rng; use petgraph::{Graph, GraphMap, Undirected, Directed, EdgeType, Incoming, Outgoing}; use petgraph::algo::{ min_spanning_tree, is_cyclic_undire...
#[test] fn graphmap_remove() { fn prop(mut g: GraphMap<i8, ()>, a: i8, b: i8) -> bool {
<|file_name|>blockdev.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 std::cell::RefCell; use std::path::{Path, PathBuf}; use std...
Utc.timestamp(self.initialization_time as i64, 0) }
<|file_name|>struct_allocated_resources_in_describe_elasticity_assurances.go<|end_file_name|><|fim▁begin|>package ecs //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...
type AllocatedResourcesInDescribeElasticityAssurances struct { AllocatedResource []AllocatedResource `json:"AllocatedResource" xml:"AllocatedResource"` }
<|file_name|>worker.js<|end_file_name|><|fim▁begin|>var AWS = require('aws-sdk'); var Policy = require("./s3post").Policy; var helpers = require("./helpers"); var POLICY_FILE = "policy.json"; var schedule = require('node-schedule'); var Worker = function(sqsCommnad, s3Object, simpleData){ var queue = sqsCommnad; ...
return;
<|file_name|>resource_fastly_service_v1_headers_test.go<|end_file_name|><|fim▁begin|>package fastly import ( "fmt" "reflect" "sort" "testing" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" gofastly "github.com/sethvar...
destination = "http.Server" type = "cache" action = "delete"
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright © 2012 - 2017 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
<|file_name|>invalidForInContinueStatements.js<|end_file_name|><|fim▁begin|>continue; ONE: for (var x in {}) continue TWO; TWO: for (var x in {}) { var fn = function () { continue TWO; }; } THREE: for (var x in {}) { var fn = function () { continue THREE; }; } <|...
for (var x in {}) { continue FIVE; FIVE:
<|file_name|>singleton.js<|end_file_name|><|fim▁begin|>/** * simple */ var mysinleton = { property1 : 'something', property2 : 'something else', method1 : function() { console.log("hello world"); } } /*** * encapsulation like java get、set */ var mysinleton2 = function() { var privateVar...
} }; return _static;
<|file_name|>prism-line-highlight.js<|end_file_name|><|fim▁begin|>(function(){ if(!window.Prism) { return; } function $$(expr, con) { return Array.prototype.slice.call((con || document).querySelectorAll(expr)); } var CRLF = crlf = /\r?\n|\r/g; <|fim▁hole|> var lineHeight = parseFloat(getComputedStyle(pre).lineHeigh...
function highlightLines(pre, lines, classes) { var ranges = lines.replace(/\s+/g, '').split(','), offset = +pre.getAttribute('data-line-offset') || 0;
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import os from subprocess import PIPE, Popen import sys from django.utils.encoding import force_text, DEFAULT_LOCALE_ENCODING from django.utils import six from .base import CommandError def popen_wrapper(args, os_err_exc_typ...
(args[0], strerror)), sys.exc_info()[2]) output, errors = p.communicate() return ( output,
<|file_name|>attribute_frontend.go<|end_file_name|><|fim▁begin|>// Copyright 2015, Cyrill @ Schumacher.fm and the CoreStore contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at //...
<|file_name|>elo.rs<|end_file_name|><|fim▁begin|>// This file was taken from the rust-elo project since it's not a published // Cargo crate. Check out https://github.com/CarlColglazier/rust-elo :] // disregard dead code since this is an API #![allow(dead_code)] /// Elo. pub trait Elo { /// Get the rating. f...
assert_eq!(1400f32, player_two.get_rating()); // With a win, player_one should gain an advantage. rating_system.win::<RatingObject>(&mut player_one, &mut player_two); assert_eq!(1416f32, player_one.get_rating());
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2013 Christopher L. Felton # # 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 # the Free Software Foundation, either version 3 of the License, or ...
<|file_name|>resource_loader.py<|end_file_name|><|fim▁begin|># Copyright 2015 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.a...
# distributed under the License is distributed on an "AS IS" BASIS, # 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|>pic_carver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ @author : 'Muhammad Arslan <rslnrkmt2552@gmail.com>' """ import re import zlib import cv2 from scapy.all import * pics = "pictues" faces_dir = "faces" pcap_file = "bhp.pcap" def get_http_headers(http_payload): try: head...
for x1, y1, x2, y2 in rects: cv2.rectangle(img, (x1, y1), (x2, y2), (127, 255, 0), 2)
<|file_name|>issue-50061.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lic...
// aux-build:issue-50061.rs #![feature(decl_macro)]
<|file_name|>playerwrapper.js<|end_file_name|><|fim▁begin|>var PlayerWrapper = function() { this.underlyingPlayer = 'aurora'; this.aurora = {}; this.sm2 = {}; this.duration = 0; this.volume = 100; return this; }; PlayerWrapper.prototype = _.extend({}, OC.Backbone.Events); PlayerWrapper.prototype.play = functio...
this.aurora = AV.Player.fromURL(url); this.aurora.asset.source.chunkSize=524288;
<|file_name|>quotemention.js<|end_file_name|><|fim▁begin|>/*global document, window, gdn, jQuery*/ jQuery(($) => { // Check if an element's top is visible in the viewport. function inview(target) { target = $(target); return target.length && target.offset().top > window.pageYOffset; } ...
target = $(loaded).addClass('mentionHighlight'); } else { get(mention) .done((data) => {
<|file_name|>objs_graphics.py<|end_file_name|><|fim▁begin|>from gi.repository import Gtk import os class ExportDialog(Gtk.Dialog): def __init__(self,parent,*args): Gtk.Dialog.__init__(self, "Exportieren", parent, 0, (Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.OK)) self.set_de...
self.combo.set_entry_text_column(0) self.contentarea.add(self.combo)
<|file_name|>logging_metrics_pb2_grpc.py<|end_file_name|><|fim▁begin|># Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities import google.cloud.proto.logging.v2.logging_metri...
'/google.logging.v2.MetricsServiceV2/UpdateLogMetric', request_serializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.UpdateLogMetricRequest.SerializeToString, response_deserializer=google_dot_cloud_dot_proto_dot_logging_dot_v2_dot_logging__metrics__pb2.LogMetric.From...
<|file_name|>transmute-equal-assoc-types.rs<|end_file_name|><|fim▁begin|>trait Foo { type Bar;<|fim▁hole|>} unsafe fn noop<F: Foo>(foo: F::Bar) -> F::Bar { ::std::mem::transmute(foo) //~ ERROR cannot transmute between types of different sizes } fn main() {}<|fim▁end|>
<|file_name|>inject.js<|end_file_name|><|fim▁begin|>/* Copyright (C) 2016 R&D Solutions 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/LICENSE-2...
<|file_name|>upload.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt // parent, args, callback frappe.upload = { make: function(opts) { if(!opts.args) opts.args = {}; if(opts.allow_multiple === undefined) { opts.allow_multipl...
$file_input.on("change", function() {
<|file_name|>setfocus-directive.ts<|end_file_name|><|fim▁begin|>export class SetFocus { static $depends: string[] = []; static module: ng.IModule = angular.module( 'SetFocus', SetFocus.$depends ).directive('setFocus', ['$parse', SetFocus.directive]); static directive($parse: ng.IParseService): angular.IDir...
$element: ng.IAugmentedJQuery, attrs: ng.IAttributes
<|file_name|>Wildfly8Redis32ModuleControllerTestIT.java<|end_file_name|><|fim▁begin|>/* * LICENCE : CloudUnit is available under the Affero Gnu Public License GPL V3 : https://www.gnu.org/licenses/agpl-3.0.html * but CloudUnit is licensed too under a standard commercial license. * Please contact our sales team if yo...
<|file_name|>PermissionRequired.java<|end_file_name|><|fim▁begin|>package org.apache.shiro.grails.annotations; <|fim▁hole|> import org.apache.shiro.authz.Permission; @Target({ElementType.FIELD, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) public @interface PermissionRequired { Class<? extends Permissio...
import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;
<|file_name|>test_alloc_source.cpp<|end_file_name|><|fim▁begin|>#include "fixed/impl/basic_allocation_sources.hpp" #include "fixed/impl/fixed_def.hpp" #include "fixed/impl/fixed_type_traits.hpp" #include "catch.hpp" #include "test_struct.hpp" TEST_CASE("test fixed allocation_source", "[alloc]") { static_assert(fixed:...
static_assert(fixed::_impl::is_allocation_source_v<fixed::_impl::empty_source>, "empty source is supposed to be allocation_source");
<|file_name|>FileSystemNotFoundException.java<|end_file_name|><|fim▁begin|>/* * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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. * A copy of the License...
<|file_name|>chapter.25.7.cpp<|end_file_name|><|fim▁begin|>// // This is example code from Chapter 25.7 "Drill" of // "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup // #include <iostream> using namespace std; //------------------------------------------------------------------------------ i...