prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>tool_ssp_simulation.py<|end_file_name|><|fim▁begin|>#
# =================================================================
# =================================================================
# def _enum(**enums):
# return type('Enum', (), enums)
import eventlet
from eventlet import greenthread
import... | cs = None |
<|file_name|>ActionToggleCameraActorInteraction.cpp<|end_file_name|><|fim▁begin|>/************************************************************************
* Copyright (C) 2019 Spatial Information Systems Research Limited
*
* This program is free software: you can redistribute it and/or modify
* it under the terms o... | return tr( htext.join(" ").toStdString().c_str());
} // end whatsThis
|
<|file_name|>AppContainer.js<|end_file_name|><|fim▁begin|>import React from 'react';
import 'isomorphic-fetch';
import {RouteHandler} from 'react-router';
import Transmit from 'react-transmit';
import {createStore, combineReducers} from 'redux';<|fim▁hole|>import {Provider} from 'react-redux';
import * as reducers from... | |
<|file_name|>build_utils_codes.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2016 Bastille Networks
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
(... | if len (code3) >= 3:
return code3[2] |
<|file_name|>iron-selector.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
const { computed } = Ember;
let IronSelector = Ember.Component.extend({
attributeBindings: [
'selected',
'role',
'attrForSelected',
'multi'
],
selectedItem: computed({
get() {},
set(key, value) {
... |
didInsertElement() {
this._super(...arguments);
|
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>@Component({
// tslint:disable-next-line
selector: 'body',
template: '<router-outlet></router-outlet>'
})
export class AppComponent implements OnInit {
constructor(private router: Router) { }
ngOnInit() {
this.router.events.subscribe(... | import { Component, OnInit } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
|
<|file_name|>Adafruit_GPS.cpp<|end_file_name|><|fim▁begin|>/***********************************
This is our GPS library
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafrui... | }
boolean Adafruit_GPS::waitForSentence(char *wait4me, uint8_t max) {
char str[20]; |
<|file_name|>DVDInputStreamHTSP.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005-2008 Team XBMC
* http://www.xbmc.org
*
* 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;... | |
<|file_name|>reporter.py<|end_file_name|><|fim▁begin|>import collections
import contextlib
import copy
import json
import warnings
import numpy
import six
from chainer.backends import cuda
from chainer import configuration
from chainer import serializer as serializer_module
from chainer import variable
def _copy_va... | |
<|file_name|>sers_windows.go<|end_file_name|><|fim▁begin|>// +build windows
package sers
// taken from https://github.com/tarm/goserial
// and slightly modified
// (C) 2011, 2012 Tarmigan Casebolt, Benjamin Siegert, Michael Meier
// All rights reserved.
// Use of this source code is governed by an MIT-style
// licen... | }
//fmt.Printf("n %d err %v\n", n, err) |
<|file_name|>yaml.min.js<|end_file_name|><|fim▁begin|>Joomla 3.6.4 = 5e60174db2edd61c1c32011464017d84<|fim▁hole|>Joomla 3.7.0 = c7eeeb362de64acba3e76fd13e0ad6af
Joomla 3.4.1 = 399117bc209c7f4eb16f72bfef504db7<|fim▁end|> | |
<|file_name|>categories.client.config.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|> // Menus.addMenuItem('topbar', 'Categories', 'categories', 'item', '/categories(?:/[^/]+)?', null, null, 9);
// Set admin menu items
Menus.addMenuItem('admin', 'Categories', 'categories', 'dropdown', '/categories(/cre... | // Configuring the Articles module
angular.module('categories').run(['Menus',
function(Menus) {
// Set top bar menu items |
<|file_name|>geste2lfmm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# Copyright 2018 Francisco Pina Martins <f.pinamartins@gmail.com>
# This file is part of geste2lfmm.
# geste2lfmm is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | # along with geste2lfmm. If not, see <http://www.gnu.org/licenses/>.
|
<|file_name|>test_project.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2016 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the te... | assert (exp.occupations == mol.exp_alpha.occupations).all()
assert abs(exp.coeffs[:,:-2] - mol.exp_alpha.coeffs[:,:-2]).max() < 1e-9
assert (exp.coeffs[:,-2:] == 0.0).all()
|
<|file_name|>http_server.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 foxbox_taxonomy::manager::*;
use hyper::net::{ Networ... | // Taxonomy router paths. Keep in sync with taxonomy_router.rs |
<|file_name|>StrongComponentRenderer.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012 Tom Denley
* This file incorporates work covered by the following copyright and
* permission notice:
*
* Copyright (c) 2003-2008, Franz-Josef Elmer, All rights reserved.
*
* Redistribution and use in source and binary ... | * Interface for rendering a {@link StrongComponent}.
*
* @author Franz-Josef Elmer |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8; -*-
"""
Copyright (C) 2007-2012 Lincoln de Sousa <lincoln@minaslivre.org>
Copyright (C) 2007 Gabriel Falcão <gabrielteratos@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of... | |
<|file_name|>automated_deploy_stage_rollback_policy.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache L... | |
<|file_name|>test_tableservice.py<|end_file_name|><|fim▁begin|># coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | |
<|file_name|>getUser.js<|end_file_name|><|fim▁begin|><|fim▁hole|> return createReturnPromise(firebase.getUser(), path)
}
return getUser
}
export default getUserFactory<|fim▁end|> | import { createReturnPromise } from '../helpers'
function getUserFactory() {
function getUser({ firebase, path }) { |
<|file_name|>getMachinesSpec.js<|end_file_name|><|fim▁begin|>// Test get machiens
var fs = require('fs');
try {
fs.accessSync('testdb.json', fs.F_OK);
fs.unlinkSync('testdb.json');
// Do something
} catch (e) {
// It isn't accessible
console.log(e);
}
var server = require('../server.js').createServ... | |
<|file_name|>IBeaconConstants.java<|end_file_name|><|fim▁begin|>package uk.co.alt236.bluetoothlelib.device.beacon.ibeacon;
/**
*
*/
public class IBeaconConstants {
public static final byte[] MANUFACTURER_DATA_IBEACON_PREFIX = {0x4C, 0x00, 0x02, 0x15};
<|fim▁hole|><|fim▁end|> | } |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './QtGUI.ui'
#
# Created: Sat Oct 11 18:25:23 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from gui.L... | |
<|file_name|>init.js<|end_file_name|><|fim▁begin|>tinyMCE.init({
mode : 'textareas',
theme : "advanced",
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_adv... | |
<|file_name|>ConfigFile.cpp<|end_file_name|><|fim▁begin|>/*
--------------------------------------------------------------------------------
Based on class found at: http://ai.stanford.edu/~gal/Code/FindMotifs/
--------------------------------------------------------------------------------
*/
#include "Platform... |
return is;
}
//------------------------------------------------------------------------------
|
<|file_name|>grasp_demo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import rospy
import actionlib<|fim▁hole|>
if __name__ == "__main__":
rospy.init_node("grasp_demo")
rospy.loginfo("Waiting for play_motion...")
client = actionlib.SimpleActionClient("/play_motion", PlayMotionAction)
client.wait_for_se... | from play_motion_msgs.msg import PlayMotionAction, PlayMotionGoal
from sensor_msgs.msg import JointState |
<|file_name|>template.go<|end_file_name|><|fim▁begin|>/*
Copyright © 2020 Henry Huang <hhh@rutcode.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 License, or
(at your op... | message string
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from distutils.core import setup
setup(
name='snapboard',
version='0.2.1',
author='Bo Shi',
maintainer='SNAPboard developers',
maintainer_email='snapboard-discuss@googlegroups.com',
url='http://code.google.com/p/snapboard/',
... | 'templates/notification/*/*.*',
]},
) |
<|file_name|>CardDef.ts<|end_file_name|><|fim▁begin|>import {CardClass, CardSet, CardType, MultiClassGroup, Race, Rarity} from "./Enums";
import {cleanEnum} from "./helpers";
export default class CardDef {
public attack: number;
public armor: number;
public cardClass: CardClass;
public cardSet: CardSet;
public co... | this.health = props.health || 0; |
<|file_name|>dns.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2014 David Vavra (vavra.david@email.cz)
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 ... | but WITHOUT 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|>env.go<|end_file_name|><|fim▁begin|>package infrastructure
import (
"errors"
"os"
"strings"
"github.com/fabiofalci/flagrc"
"github.com/mitchellh/go-homedir"
)
const SCONSIFY_CONF_LOCATION = "/.sconsify"
func GetCacheLocation() string {
if basePath := getConfLocation(); basePath != "" {
return b... | |
<|file_name|>attach.go<|end_file_name|><|fim▁begin|>package container
import (
"context"
"fmt"
"io"
"github.com/docker/cli/cli"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"github.com/moby/sys/signal... | if result.StatusCode != 0 {
return cli.StatusError{StatusCode: int(result.StatusCode)} |
<|file_name|>MeshHelpers.hpp<|end_file_name|><|fim▁begin|>#ifndef SLG_MESH_HELPERS_HPP
#define SLG_MESH_HELPERS_HPP
#include "glm/glm.hpp"
#include "slg/Mesh.hpp"
#include <vector>
namespace slg {
bool loadObj(const char * filename,
std::vector<glm::vec3> & vertices,
std::vector<g... | std::vector<glm::vec3> const& inBitangents, |
<|file_name|>webhookPublisher.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Fission Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... | } |
<|file_name|>Signal.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
################################################################################
#
# Copyright 2014 Stjepan Henc <sthenc@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance ... | |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for roastdog 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/dev/howto/deployment/wsgi/
"""<|fim▁hole|>import os
os.environ.setdefault("DJ... | from django.core.wsgi import get_wsgi_application
from dj_static import Cling |
<|file_name|>a00980.js<|end_file_name|><|fim▁begin|><|fim▁hole|> [ "kReverseIfHasRTL", "a00980.html#a402a13eb2d1593daed0190a118f23d88", null ],
[ "RTLReversePolicyNames", "a00980.html#af5c5a40d574f6ab56726b8b2f963f65c", null ]
];<|fim▁end|> | var a00980 =
[
[ "kDoNotReverse", "a00980.html#a0db2198747060995d61a01dcfac97eb7", null ],
[ "kForceReverse", "a00980.html#a597d22620e40ecc0ec38dfa4f65a9d85", null ], |
<|file_name|>build_clib.py<|end_file_name|><|fim▁begin|>"""distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
__revision__ = "$Id$"
# XXX this module has *lots* of code ripped... | # files in a temporary build directory.)
macros = build_info.get('macros')
include_dirs = build_info.get('include_dirs')
objects = self.compiler.compile(sources,
|
<|file_name|>mysqlDAL.js<|end_file_name|><|fim▁begin|>var mysql = require('mysql');
function mysqlConn(config,logger) {
this.connectionPool = mysql.createPool(config);
this.initialized = true;
this.logger = logger;
}
mysqlConn.prototype = {
/// if the raw connection is needed
getConnection: func... | |
<|file_name|>print-path.py<|end_file_name|><|fim▁begin|># -----------
# User Instructions:
#
# Modify the the search function so that it returns
# a shortest path as follows:
#
# [['>', 'v', ' ', ' ', ' ', ' '],
# [' ', '>', '>', '>', '>', 'v'],
# [' ', ' ', ' ', ' ', ' ', 'v'],
# [' ', ' ', ' ', ' ', ' ', 'v'],
# ... | print(row) |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright (C) 2017 Dmitry Berezovsky
#
# JointBox 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 L... | # JointBox - Your DIY smart home. Simplified. |
<|file_name|>CPOrmLoader.java<|end_file_name|><|fim▁begin|>package za.co.cporm.model.loader.support;
import android.content.Context;
import android.database.Cursor;<|fim▁hole|>import android.support.v4.content.CursorLoader;
import za.co.cporm.model.generate.TableDetails;
import za.co.cporm.model.query.Select;
import z... | |
<|file_name|>select.template.ts<|end_file_name|><|fim▁begin|>/*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICE... | .ifExport((me) => |
<|file_name|>borrowck-auto-mut-ref-to-immut-var.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
// ht... | |
<|file_name|>validation_test.go<|end_file_name|><|fim▁begin|>package config
import (
"bytes"
"fmt"
"strings"
"testing"
"gopkg.in/inconshreveable/log15.v2"
)
func TestValidation(t *testing.T) {
t.Parallel()
c := New().FromString(`
[networks.net]
`)
if c.Validate() {
t.Error("Expected it to be invalid.")... | network = 5 |
<|file_name|>get_device_state.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
""" message_gds.py:
"""
# Import Required Libraries (Standard, Third Party, Local) ********************
import datetime
import logging
if __name__ == "__main__":
import os
import sys
sys.path.append(os.path.dirname(os.path.dir... | for key, value in kwargs.items(): |
<|file_name|>data_api_client_ex2.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
query = GeneAcronymQuery()
gene_info = query.get_data('ABAT')
for gene in gene_info:
print "%s (%s)" % (gene['name'], gene['organism']['name'])<|fim▁end|> | from gene_acronym_query import GeneAcronymQuery |
<|file_name|>app.rs<|end_file_name|><|fim▁begin|>use clap::{App, AppSettings, Arg, ArgGroup, SubCommand};
pub fn build() -> App<'static, 'static> {
App::new(crate_name!())
.about(crate_description!())
.version(crate_version!())
.setting(AppSettings::SubcommandRequired)
.setting(AppS... | .about("Digraph lookup and resolution")
.setting(AppSettings::AllowLeadingHyphen)
.setting(AppSettings::UnifiedHelpMessage) |
<|file_name|>globals.d.ts<|end_file_name|><|fim▁begin|>/**
* TypeScript global declarations go here
*/<|fim▁hole|>
declare global {
// Defined in es2017 but most major browsers support it
interface String {
padStart(width: number, pad: string): string
}
}
export { }<|fim▁end|> | |
<|file_name|>guildDelete.js<|end_file_name|><|fim▁begin|>const excludedTables = ["blacklist", "musicCache", "timedEvents"];
const statPoster = require("../../modules/statPoster.js");
module.exports = async guild => {
let tables = await r.tableList().run();
for(let table of tables) {
let indexes = await r.table(tabl... | } |
<|file_name|>errors.py<|end_file_name|><|fim▁begin|>"""Let's Encrypt client errors."""
class Error(Exception):
"""Generic Let's Encrypt client error."""
class AccountStorageError(Error):
"""Generic `.AccountStorage` error."""
class AccountNotFound(AccountStorageError):
"""Account not found error."""
... | for achall in self.failed_achalls if achall.error is not None))
|
<|file_name|>mysql.py<|end_file_name|><|fim▁begin|>"""pybackup - Backup Plugin for MySQL Database
"""
import os
from pybackup import errors
from pybackup import utils
from pybackup.logmgr import logger
from pybackup.plugins import BackupPluginBase
from pysysinfo.mysql import MySQLinfo
__author__ = "Ali Onur Uyar"
_... | out_path=dump_path, |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import json
import mock
from sentry.plugins.helpers import get_option, set_option
from sentry.testutils import TestCase
from sentry.models import set_sentry_version, Option
from sentry.tasks.check_update import check_update, PYPI_URL
class CheckUpdateTest(TestCase)... | self.assertEqual(get_option(key=self.KEY), self.NEW)
def test_set_sentry_version_new(self): |
<|file_name|>init-old.py<|end_file_name|><|fim▁begin|>import errno
import os
import pwd
import shutil
import sys
from jinja2 import Environment, FileSystemLoader
class TutorialEnv:
LOCAL_MACHINE = ("Local Machine Condor Pool", "submit-host")
USC_HPCC_CLUSTER = ("USC HPCC Cluster", "usc-hpcc")
OSG_FROM_IS... | |
<|file_name|>kqueue.rs<|end_file_name|><|fim▁begin|>use {io, EventSet, PollOpt, Token};
use event::IoEvent;
use nix::sys::event::{EventFilter, EventFlag, FilterFlag, KEvent, kqueue, kevent};
use nix::sys::event::{EV_ADD, EV_CLEAR, EV_DELETE, EV_DISABLE, EV_ENABLE, EV_EOF, EV_ERROR, EV_ONESHOT};
use std::{fmt, slice};
u... | |
<|file_name|>randNNIWalks.py<|end_file_name|><|fim▁begin|>#randNNIWalks.py
#writes random SPR walks to files
#calls GTP on each NNI random walk file to get
#the ditances between each tree and the first tree of the sequence
#the results are written to csv files with lines delimited by \t
import tree_utils as tu
import w... | treefile.write(tum.toNewickTree(rand_tree) + "\n")
current_tree = rand_tree |
<|file_name|>test_python_can.py<|end_file_name|><|fim▁begin|>from tests.package.test_python import TestPythonPackageBase
class TestPythonPy2Can(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_CAN=y
""... | |
<|file_name|>listdb_reservations.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import time
import pyslurm
def reservation_display(reservation):
if reservation:
for key,value in reservation.items():
print("\t{}={}".format(key, value))
if __name__ == "__main__":
try:
end = ti... | |
<|file_name|>ast.rs<|end_file_name|><|fim▁begin|>//! JMESPath abstract syntax tree (AST).
//!
//! Inspecting the JMESPath AST can be useful for analyzing the way in
//! which an expression was parsed and which features are utilized in
//! an expression.
//!
//! Ast can be accessed directly from a parsed `jmespath::Expr... | //! `Expression`. |
<|file_name|>login.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import urllib
from . import admin
from flask import request
from flask import url_for
from flask import redirect
from flask import render_template
from flask_login import UserMixin
from flask_login import login_user
from flask_login import logo... | return unicode(self.user.id)
|
<|file_name|>specifications.py<|end_file_name|><|fim▁begin|># This file is part of pylabels, a Python library to create PDFs for printing
# labels.
# Copyright (C) 2012, 2013, 2014, 2015 Blair Bonnett
#
# pylabels is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public Lic... | """Raised when a sheet specification has inconsistent dimensions. """
pass
|
<|file_name|>advent16.rs<|end_file_name|><|fim▁begin|>// advent16.rs
// find Aunt Sue
extern crate pcre;
use std::io;
fn main() {
loop {
let mut input = String::new();
let result = io::stdin().read_line(&mut input);
match result {
Ok(byte_count) => if byte_count == 0 { break; ... | |
<|file_name|>task_execution_time.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import legacy_page_test
from telemetry.timeline.model import TimelineMod... | |
<|file_name|>todo.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { Todo } from './todo.model';
import { TodoService } from './todo.service';
@Component({
selector: 'app-todo',
templateUrl: './todo.component.html',
styleUrls: ['./todo.component.css'],
provide... | addTodo() { |
<|file_name|>wysiwyg_utils.js<|end_file_name|><|fim▁begin|>/** @odoo-module **/
export function isImg(node) {
return (node && (node.nodeName === "IMG" || (node.className && node.className.match(/(^|\s)(media_iframe_video|o_image|fa)(\s|$)/i))));
}
<|fim▁hole|>/**
* Returns a list of all the ancestors nodes of the... | |
<|file_name|>config_utils.py<|end_file_name|><|fim▁begin|>import logging
import emission.storage.timeseries.abstract_timeseries as esta
import emission.core.wrapper.entry as ecwe
def get_last_entry(user_id, time_query, config_key):
user_ts = esta.TimeSeries.get_time_series(user_id)
# get the list of over... | # saved back into the cache.
config_overrides = list(user_ts.find_entries([config_key], time_query)) |
<|file_name|>create_role.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Un... | match := false
for _, extra := range groupResources {
if resource.Resource == extra.Resource && resource.Group == extra.Group {
match = true |
<|file_name|>env.rs<|end_file_name|><|fim▁begin|>use std::ops::{Deref, DerefMut};
use std::collections::HashMap;
use std::iter::FromIterator;
use std::cell::RefCell;
use rand::IsaacRng;
use rand::distributions::{Range, Sample};
use common_util::IntType;<|fim▁hole|>
/// The Roller runtime environment. Stores the varia... | use syntax_tree::*;
use eval::types::*;
use eval::eval_functions::eval_expr;
use error::*; |
<|file_name|>derp.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core';
/*
# Description:
Repackages an array subset as a new array.
**Reasoning:**
Angular2's change checker freaks out when you ngFor an array that's a subset
of a larger data structure. Please read: https://github... | }) |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>'use strict';
var gulp = require('gulp');
var autoprefixer = require('jstransformer')(require('jstransformer-stylus'));
var autoprefixer = require('autoprefixer-stylus');
var browserSync = require('browser-sync').create();
var changed = require('gulp-changed');
var... | |
<|file_name|>test_extensions.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... | lib = 'libcustomop_lib.so' |
<|file_name|>junit.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless requi... | // Skipped means junit test skipped
Skipped TestStatusEnum = "skipped"
// Passed means junit test passed
Passed TestStatusEnum = "passed" |
<|file_name|>MutableValueSetterProxy.cpp<|end_file_name|><|fim▁begin|>#include "MutableValueSetterProxy.h"
#include <jsi/jsi.h>
#include "MutableValue.h"
#include "SharedParent.h"
using namespace facebook;
namespace reanimated {
void MutableValueSetterProxy::set(
jsi::Runtime &rt,
const jsi::PropNameID &name... | }
|
<|file_name|>ElementTree.py<|end_file_name|><|fim▁begin|>#
# ElementTree
# $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $
#
# light-weight XML support for Python 2.3 and later.
#
# history (since 1.2.6):
# 2005-11-12 fl added tostringlist/fromstringlist helpers
# 2006-07-05 fl merged in selected changes fr... | def __setitem__(self, index, element): |
<|file_name|>StandaloneConfig.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You und... | * limitations under the License.
*/ |
<|file_name|>output_disposition.py<|end_file_name|><|fim▁begin|>'''
Created on Sep 14, 2013
@author: paepcke
Modifications:
- Jan 1, 2013: added remove() method to OutputFile
'''
import StringIO
from collections import OrderedDict
import csv
import re
import sys
import os
import tempfile
from col_data_type impo... | |
<|file_name|>imagenet_train_darknet.py<|end_file_name|><|fim▁begin|>"""Train ILSVRC2017 Data using homemade scripts."""
import cv2
import os
import math
import tensorflow as tf
from multiprocessing import Process, Queue
import os
import sys
FILE_DIR = os.path.dirname(__file__)
sys.path.append(FILE_DIR + '/../')
impo... | CKPTS_DIR, |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
<|fim▁hole|>from .forms import FileForm
class FileAdmin(admin.ModelAdmin):
list_display = ('id', 'md5', 'file', 'size')
list_per_page = 100
list_display_links = ('md5',)
form = FileForm
class LinkAdmin(admin.ModelAdm... | from .models import File, Link |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate dotenv;
extern crate ctrlc;
extern crate chrono;
extern crate chrono_tz;
extern crate url;
extern crate linkify;
#[macro_use]
extern crate html5ever;
extern crate reqwest;
#[macro_use]
extern crate slog;
extern crate slog_async;
extern crate slog_envlo... | |
<|file_name|>java_compile.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | _name = 'java'
_file_suffix = '.java' |
<|file_name|>poly2wkt.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import sys
import argparse
def loopfile(polyfile):
polyline=''
with open(polyfile,'r') as f:
read_data = f.readlines()
f.close()
polylines = []
polyline = ""
countend = 0
# countpoly = 0
for l in read_data:
s = l.strip()
if len(s) > 1:... | # countpoly += 1
# if countpoly == 1:
# polyline = "POLYGON (("
# |
<|file_name|>test_usage.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | ../../../../../share/pyshared/twisted/test/test_usage.py |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|># pylint: disable=redefined-outer-name, comparison-with-callable
"""Test helper functions."""
import gzip
import importlib
import logging
import os
import sys
from typing import Any, Dict, List, Optional, Tuple, Union
import cloudpickle
import numpy as np
... | InferenceData object on which to check the attributes.
Returns
-------
|
<|file_name|>utilities.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" A set of utilities, mostly for post-processing and visualization
We put arrays on disk as raw bytes, extending along the first dimension.
Alongside each array x we ensure the value x.dtype which stores the string
... | |
<|file_name|>hostname.rs<|end_file_name|><|fim▁begin|>extern crate getopts;
extern crate libc;
use getopts::{optflag, getopts, usage, OptGroup};
use libc::{c_char, c_int, size_t};
use std::io::stdio;
use std::os;
static HOSTNAME_MAX_LENGTH: uint = 256;
extern {
fn gethostname(name: *mut c_char, namelen: size_t) ... | } |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import socket
import sys
import os
import time
import random
import csv
import json
import random
from sentence_generator import make_sentence
from copy import deepcopy
from subprocess import check_output
# csv file columns are timestamp, pres... | |
<|file_name|>ConcurrentMapBasedDoubleBinaryOperatorMemoizer.java<|end_file_name|><|fim▁begin|>/*
* This file is part of memoization.java. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://creativecommons.org/publicdomain/zero/1.0/. No part of ... | final KEY key = keyFunction.apply(left, right);
return computeIfAbsent(key, givenKey -> Double.valueOf(operator.applyAsDouble(left, right))) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
.. moduleauthor:: Chris Dusold <DriveLink@chrisdusold.com>
A module containing general purpose, cross instance hashing.
This module intends to make storage and cache checking stable accross instances.
"""
from drivelink.hash._hasher import hash<|fim▁hole|><|f... | from drivelink.hash._hasher import frozen_hash
from drivelink.hash._hasher import Deterministic_Hashable |
<|file_name|>graph_creation.py<|end_file_name|><|fim▁begin|># Creates graph of restaurant reviews for yelp or trip advisor.<|fim▁hole|># Rob Churchill
#
# NOTE: I learned to do this in my data science class last semester. If you are looking for plagiarism things, you will almost certainly find similar clustering code. ... | # writes graph to gml file for use in gephi
# |
<|file_name|>wasm32.rs<|end_file_name|><|fim▁begin|>fn<|fim▁hole|>{
"wasm32"
}<|fim▁end|> | wasm32
() -> &str |
<|file_name|>puppet_client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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
#
# ... | """
try:
# launch execution
cmd_launch = CONF.clients_puppet.cmd_launch |
<|file_name|>plane_error.py<|end_file_name|><|fim▁begin|>import numpy as np
def plane_error(results, target):
"""
Computes angle between target orbital plane and actually achieved plane.
:param results: Results struct as output by flight_manager (NOT flight_sim_3d).
:param target: Target ... | |
<|file_name|>MinuteRepeater.js<|end_file_name|><|fim▁begin|>// MinuteRepeater Class
// @params dial: object
// @params settings: object
// @params parentWatch: Watch instance
//
// The minuterepeater class accepts a dial, or defaults to the 0th index of the
// dials array on the parent Watch class, and based on the han... | this.hourElement = document.createElement('audio');
this.hourElement.src = this.chimes.hour;
document.body.appendChild(this.hourElement);
|
<|file_name|>CronSetDirectory.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2000 - 2011 TagServlet Ltd
*
* This file is part of Open BlueDragon (OpenBD) CFML Server Engine.
*
* OpenBD is free software: you can redistribute it and/or modify<|fim▁hole|> *
* OpenBD is distributed in the hope that it ... | * it under the terms of the GNU General Public License as published by
* Free Software Foundation,version 3. |
<|file_name|>downloadview.py<|end_file_name|><|fim▁begin|>#
# downloadview.py
#
# Copyright 2010 Brett Mravec <brett.mravec@gmail.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 ... | def add_download (self, download):
print 'DownloadView.add_download (download): stub' |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for mysite2 project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djan... | |
<|file_name|>fields.py<|end_file_name|><|fim▁begin|>import os
import types
import binascii
from django.db import models
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import cached_property
try:
from django.utils.encoding import smart_text
exce... | self.keyname = kwargs.pop('keyname', None)
# If settings.DEFAULT_KEY_DIRECTORY, then the key
# is located in DEFAULT_KEY_DIRECTORY/keyname |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2002-2018 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published ... | |
<|file_name|>cases.py<|end_file_name|><|fim▁begin|>from app import db, GenericRecord
class Case(GenericRecord):
__collection__ = 'cases'<|fim▁hole|><|fim▁end|> |
db.register([Case]) |
<|file_name|>tempusdominus-bootstrap-4.js<|end_file_name|><|fim▁begin|>/*@preserve
* Tempus Dominus Bootstrap4 v5.0.0-alpha13 (https://tempusdominus.github.io/bootstrap-4/)
* Copyright 2016-2017 Jonathan Peterson
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
*/
if (typeof ... | }
this._options.daysOfWeekDisabled = _daysOfWeekDisabled.reduce(function (previousValue, currentValue) {
currentValue = parseInt(currentValue, 10);
if (currentValue > 6 || currentValue < 0 || isNaN(currentValue)) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.