prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>basic-example.rs<|end_file_name|><|fim▁begin|>extern crate compiler;
use compiler::{ir,pass};
fn main() {
let mut module = self::create_module();
let mut pm = self::create_ir_pass_manager();
println!("Previously:\n\n{}", ir::printable(&module));
module = pm.run(module);
module = mo... |
let mut block = ir::Block::empty("other"); |
<|file_name|>items-sortable.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function($) {
$(".wp-list-table tbody").sortable({handle:".kpm-handle-column", cursor: 'url(images/closedhand.cur)',
helper:function(e, ui) {
ui.children().each(function() {
$(this).width($(this).width());
});
return ui;... | nonce:$("#_wpnonce").val()
};
fields = $('input:hidden[name="order[]"]').serialize();
params = fields + '&' + $.param(params); |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
import views
<|fim▁hole|> url(r'^newUser', views.newUser, name='newUser'),
url(r'^appHandler', views.appHandler, name='appHandler'),
url(r'^passToLogin', views.loginByPassword, name='passToLogin'),
url(... | urlpatterns = patterns('',
url(r'^logout', views.logout, name='logout'), |
<|file_name|>decorator.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Intel Corporation
//
// 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|>// distributed under the Licen... | // http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software |
<|file_name|>insight.js<|end_file_name|><|fim▁begin|>import _ from 'lodash'
import URLJoin from 'url-join'
import request from 'request'
import bitcore from 'bitcore-lib'
import config from './config'
import logger from './logger'
/**
* @typedef {Object} Insight~UnspentObject
* @property {string} address
* @proper... | */
export default class Insight {
/** |
<|file_name|>graph.rs<|end_file_name|><|fim▁begin|>// -----------------------------------------------
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
// ██║ ╚████║╚████... | where
T: Serialize,
{
GraphExplore { |
<|file_name|>pbil_selection.py<|end_file_name|><|fim▁begin|>import numpy as np
from math import floor
from ..weight import RankingBasedSelection
class PBILSelection(RankingBasedSelection):
"""
This selection scheme is used by PBIL and compact GA.
Also, PBIL selection scheme also used in natural gradient ... | idx_negative = idx_sorted_rank[-half_num_weight:]
weights[idx_negative] = -1
else: |
<|file_name|>win_tool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|>"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
from ctypes import windll, wintypes
import os
import shutil
import subprocess
import sys
BASE_DIR = os.pat... | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
|
<|file_name|>location_network_creation.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2018, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this sof... | |
<|file_name|>test_prometheus_transformer.py<|end_file_name|><|fim▁begin|># Copyright 2018 - Nokia
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | |
<|file_name|>base32_test.go<|end_file_name|><|fim▁begin|>// Copyright 2009 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.
package base32
import (
"bytes"
"io/ioutil"
"os"
"testing"
)
type testpair struct {
decoded, enc... | var i int |
<|file_name|>vgg16.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)
"""
from __future__ import print_function
from __future__ import absolute_import
import warnings
f... | TF_WEIGHTS_PATH = 'https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5'
TH_WEIGHTS_PATH_NO_TOP = 'https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_th_dim_ordering_th_kernels_notop.h5' |
<|file_name|>MeshRenderer.cpp<|end_file_name|><|fim▁begin|>#include "MeshRenderer.h"
#include "Data/ShapeMesh.h"
#include "Data/Utility.h"
#include <GLBlaat/GLFramebuffer.h>
#include <GLBlaat/GLProgram.h>
#include <GLBlaat/GLTextureManager.h>
#include <GLBlaat/GLUtility.h>
#include <NQVTK/Rendering/Camera.... | |
<|file_name|>cartesian_joint.rs<|end_file_name|><|fim▁begin|>use na::{self, DVectorSliceMut, RealField};
use crate::joint::Joint;
use crate::math::{Isometry, JacobianSliceMut, Translation, Vector, Velocity, DIM};
use crate::solver::IntegrationParameters;
/// A joint that allows only all the translational degrees of ... | fn jacobian_dot(&self, _: &Isometry<N>, _: &mut JacobianSliceMut<N>) {}
fn jacobian_dot_veldiff_mul_coordinates( |
<|file_name|>cgroup.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2015, Galaxy Authors. All Rights Reserved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Author: wangtaize@baidu.com
#include "agent/cgroup.h"
#include <sstream>
#include <sys/types.h>
#... |
if (pos + RUNNER_META_PREFIX.size() >= file.size()) { |
<|file_name|>openstack_simple.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from libcloud.compute.providers import get_driver
import libcloud.security
# This assumes you don't have SSL set up.
# Note: Code like this poses a security risk (MITM attack) and
# that's the reason why you should never use it for anything els... | from libcloud.compute.types import Provider |
<|file_name|>Add.py<|end_file_name|><|fim▁begin|>import os
import libxml2
from sfatables.command import Command
from sfatables.globals import sfatables_config, target_dir, match_dir
class Add(Command):
def __init__(self):
self.options = [('-A','--add')]
self.help = 'Add a rule to a chain'
s... | valueNode = libxml2.newNode('value')
valueNode.addContent(option_value)
context[0].addChild(valueNode)
|
<|file_name|>ras.go<|end_file_name|><|fim▁begin|>// +build linux
// +build 386 amd64 arm arm64
package ras
import (
"database/sql"
"fmt"
"os"
"strconv"
"strings"
"time"
_ "modernc.org/sqlite" //to register SQLite driver
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
// ... | r.initializeCPUMetricDataIfRequired(mcError.SocketID)
r.updateSocketCounters(mcError) |
<|file_name|>cs.py<|end_file_name|><|fim▁begin|>import sqlite3
from typing import List
from pyspatial.cs import CoordinatesSystem, Axis, CoordinatesSystemType, AxisOrientation, AxisType
from pyspatial.uom import UnitOfMeasure
from . import db, EPSGException, make_id, parse_id
from .uom import get_unit
def get_coordi... | |
<|file_name|>gene.rs<|end_file_name|><|fim▁begin|>/// An enum for storing additional information for different types of genes
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum GeneExtras {
/// Input contains a current value
Input(f64),
/// Neuron contains a current value and an input count
Neuron(f64, u... | Bias
}
#[derive(Clone, Copy, Debug, PartialEq)] |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub mod bfs_dfs;<|fim▁hole|><|fim▁end|> | pub mod dijkstra; |
<|file_name|>buffer.ts<|end_file_name|><|fim▁begin|>// Specifically test buffer module regression.
import {
Buffer as ImportedBuffer,
SlowBuffer as ImportedSlowBuffer,
transcode,
TranscodeEncoding,
constants,
kMaxLength,
kStringMaxLength,
Blob,
} from 'buffer';
const utf8Buffer = new Bu... | transcode(Buffer.from('€'), 'utf8', 'ascii'); // $ExpectType Buffer
const source: TranscodeEncoding = 'utf8';
const target: TranscodeEncoding = 'ascii'; |
<|file_name|>serialization.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 properties::{parse, parse_input};
use style::comput... |
mod border_shorthands { |
<|file_name|>lesson3-1.js<|end_file_name|><|fim▁begin|>function test() {
for(var i=1; i<3; i++) {
console.log("inner i: " + i);
}
console.log("outer i: " + i);
}<|fim▁hole|>function last() {
const PI = 3.1415926;
console.log(PI);
}
// test();
last();<|fim▁end|> | |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for spa_movies project.
Generated by 'django-admin startproject' using Django 1.9.7.
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... | import os
|
<|file_name|>partitioner.py<|end_file_name|><|fim▁begin|>from pyFTS.common import FuzzySet, Membership
import numpy as np
from scipy.spatial import KDTree
import matplotlib.pylab as plt
import logging
class Partitioner(object):
"""
Universe of Discourse partitioner. Split data on several fuzzy sets
"""
... | return ret |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | |
<|file_name|>GameTools.js<|end_file_name|><|fim▁begin|>/* micropolisJS. Adapted by Graeme McCutcheon from Micropolis.
*
* This code is released under the GNU GPL v3, with some additional terms.
* Please see the files LICENSE and COPYING for details. Alternatively,
* consult http://micropolisjs.graememcc.co.uk/LICEN... | */ |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Stefano Palazzo <stefano.palazzo@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 Software Foundation, either version 3 of the Li... | import docopt
import hello
|
<|file_name|>InventoryImpl.java<|end_file_name|><|fim▁begin|>package crazypants.enderio.machine.capbank.network;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import cofh.api.energy.IEnergyContainerItem;
import crazypants.enderio.EnderI... | } |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from distutils.core import setup
from setuptools import find_packages
LONGDOC = """
A very simple python library, used to format datetime with *** time ago statement.
Install
pip install timeago
Usage
import timeago, datetime
d = dateti... | print (timeago.format(d, locale='zh_CN')) # will print 3分钟后 |
<|file_name|>herkulex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7
"""
@package: pyHerkulex
@name: herkulex.py
@author: Achu Wilson (achuwilson@gmail.com), Akhil Chandran (akhilchandran.t.r@gmail.com)
@version: 0.1
This is a python library for interfacing the Herkulex range of smart
servo motors manufac... | def get_position_p(self):
""" Get the P value of the current PID for position
""" |
<|file_name|>scanf.py<|end_file_name|><|fim▁begin|>"""scanf.py: scanf-style input for Python.
Danny Yoo (dyoo@hkn.eecs.berkeley.edu)
The initial motivation for this module was based on a posting on
Python-tutor:
http://mail.python.org/pipermail/tutor/2004-July/030480.html
I haven't been able to find a nice modu... | pass # implement me!
|
<|file_name|>test_spec_dealer.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2007-2015 Contributors as noted in the AUTHORS file
This file is part of libzmq, the ZeroMQ core engine in C++.
libzmq is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Pu... | assert (rc == 0);
rc = zmq_poll (poller, 2, 100); |
<|file_name|>test_stateless_writer.rs<|end_file_name|><|fim▁begin|>use std::default::Default;
use rtps::*;
use rtps::common_types::*;
use factories::Create;
#[test]
fn test_stateless_writer_heartbeat_increments_count() {
let mut writer : StatelessWriter = Create::create();
writer.new_change(
ChangeK... | let heartbeat = writer.heartbeat(reader_entity_id); |
<|file_name|>test_multiple_dictation.py<|end_file_name|><|fim▁begin|>"""
Multiple dictation constructs
===============================================================================
This file is a showcase investigating the use and functionality of multiple
dictation elements within Dragonfly speech recognition gramm... | - Alice (1000000) |
<|file_name|>lc804-unique-morse-code-words.py<|end_file_name|><|fim▁begin|># coding=utf-8
import unittest
"""804. Unique Morse Code Words
https://leetcode.com/problems/unique-morse-code-words/description/
International Morse Code defines a standard encoding where each letter is
mapped to a series of dots and dashes, ... | self.assertEqual(s.uniqueMorseRepresentations(["gin", "zen", "gig", "msg"]), 2)
if __name__ == "__main__": |
<|file_name|>generic.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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 ... | |
<|file_name|>oneyear_data_layer_subset_good.py<|end_file_name|><|fim▁begin|>#This python script is modified from oneyear_data_layer_subset_good.pro
#This routine open one year files defined in file lists, stack these file, subset, and fill bad data with -2000
#input arguments are flist_ndvi, flist_bq, ul_lon,ul_lat,l... | str1='.VI_NDVI.'
str2='.VI_QUAL.'
|
<|file_name|>optuna_example.py<|end_file_name|><|fim▁begin|>"""This test checks that Optuna is functional.
It also checks that it is usable with a separate scheduler.
"""
import time
import ray
from ray import tune
from ray.tune.suggest import ConcurrencyLimiter
from ray.tune.schedulers import AsyncHyperBandScheduler... | # Feed the score back back to Tune.
tune.report(iterations=step, mean_loss=intermediate_score) |
<|file_name|>bindings.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#![allow(
dead_code,
non_camel_case_types,
non_snake_case,
non_upper_case_globals... | );
}
pub type vda_session_info_t = vda_session_info; |
<|file_name|>namespacehryky_1_1log.js<|end_file_name|><|fim▁begin|><|fim▁hole|> [ "level_type", "namespacehryky_1_1log.html#a6005efaf1fc45416ed6aa211f939993f", null ],
[ "writer_type", "namespacehryky_1_1log.html#a855ba68dea65f57a39b7a1cb03aee800", null ],
[ "write", "namespacehryky_1_1log.html#a5c7e76e7e425... | var namespacehryky_1_1log =
[
[ "AutoElapsed", "structhryky_1_1log_1_1_auto_elapsed.html", null ], |
<|file_name|>test_engine.hh<|end_file_name|><|fim▁begin|>/*
* fMBT, free Model Based Testing tool
* Copyright (c) 2011, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU Lesser General Public License,
* version 2.1, as publis... | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
<|file_name|>tab-group.d.ts<|end_file_name|><|fim▁begin|>import { ModuleWithProviders, QueryList, ElementRef, Renderer } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import { MdTab } from './tab';
/** A simple change event emitted on focus or selection changes. */
... | * TODO: internal
*/
ngAfterViewChecked(): void; |
<|file_name|>session.service.js<|end_file_name|><|fim▁begin|>angular.module('ssAuth').factory('SessionService', ['$http', '$cookies', '$q', function($http, $cookies, $q){
var currentUser = {};
var currentFetch;
currentUser.isAdmin = function() {
return currentUser && currentUser.groups && currentU... | }; |
<|file_name|>say.js<|end_file_name|><|fim▁begin|>const {
Command
} = require("discord.js-commando");
module.exports = class Say extends Command {
constructor(client) {
super(client, {
name: "say",
aliases: ["echo", "speak"],
group: "util",
memberName: "sa... | autoAliases: true,
args: [{
key: "sayText",
prompt: "What do you want me to say?", |
<|file_name|>test_cache.py<|end_file_name|><|fim▁begin|># (c) 2012-2015, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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, e... | def get(self, key): |
<|file_name|>anim-xy-min.js<|end_file_name|><|fim▁begin|>/*<|fim▁hole|>Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add("anim-xy",function(e,t){var n=Number;e.Anim.behaviors.xy={set:function(e,t,r,i,s,o,u){e._node.setXY([u(s,n(r[0]),n(i[0])-n(r[0]... | YUI 3.7.3 (build 5687) |
<|file_name|>trace_listener.go<|end_file_name|><|fim▁begin|>/* Copyright (c) 2012-2016 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
package antlr
import "fmt"
type TraceListener struct {
parse... | |
<|file_name|>C2Rule.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (C) 2011 - 2015 Yoav Artzi, All rights reserved.
* <p>
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Pub... | }
return null; |
<|file_name|>sample-simulator.py<|end_file_name|><|fim▁begin|># -*- Mode:Python; -*-
# /*
# * Copyright (c) 2010 INRIA
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# ... | ## Example function - triggered if an event is canceled (should not be called). |
<|file_name|>settings_base.py<|end_file_name|><|fim▁begin|>"""private_base will be populated from puppet and placed in this directory"""
import logging
import os
import dj_database_url
from lib.settings_base import CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING
from .. import splitstrip
import private_base as pri... | REDIS_BACKEND = private.REDIS_BACKENDS_CACHE
REDIS_BACKENDS = { |
<|file_name|>Type.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010 CENATIC: Centro Nacional de Referencia de
# Aplicacion de las TIC basadas en Fuentes Abiertas, Spain.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... |
query = Query(q)
if not len(query): |
<|file_name|>kernel.go<|end_file_name|><|fim▁begin|>package http
<|fim▁hole|> "github.com/coraldane/falcon-agent/g"
"github.com/toolkits/nux"
"github.com/toolkits/sys"
"net/http"
)
func configKernelRoutes() {
http.HandleFunc("/proc/kernel/hostname", func(w http.ResponseWriter, r *http.Request) {
data, err := g.H... | import ( |
<|file_name|>api.js<|end_file_name|><|fim▁begin|>let userDao = require('../dao/userDao'),
articleDao = require('../dao/articleDao'),
commentDao = require('../dao/commentDao'),
starDao = require('../dao/starDao'),
messageDao = require('../dao/messageDao'),
voteDao = require('../dao/voteDao'),
set... | if (!error && response.statusCode == 200 && tools.isNotBlank(data) && data.errcode == 0 && tools.isNotBlank(data.ticket)) { |
<|file_name|>entity.js<|end_file_name|><|fim▁begin|>define(['exports', 'aurelia-validation', 'aurelia-dependency-injection', './orm-metadata'], function (exports, _aureliaValidation, _aureliaDependencyInjection, _ormMetadata) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
ex... | }; |
<|file_name|>TimeMachineQueryTest.java<|end_file_name|><|fim▁begin|>/*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2013 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Less... | TimeMachineQuery query = TimeMachineQuery.createForMetrics("12345", "ncloc").setFrom(from).setTo(to); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Amazon Inspector
//!<|fim▁hole|>//! If you're using the service, you're probably looking for [InspectorClient](struct.InspectorClient.html) and [Inspector](trait.Inspector.html).
extern crate hyper;
extern crate rusoto_core;
extern crate serde;
#[macro_use]
extern c... | |
<|file_name|>soup.py<|end_file_name|><|fim▁begin|># Hack, hide DataLossWarnings
# Based on html5lib code namespaceHTMLElements=False should do it, but nope ...
# Also it doesn't seem to be available in older version from html5lib, removing it
import warnings
from typing import IO, Union
from bs4 import BeautifulSoup
f... | |
<|file_name|>eventlet_utils.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Cloudbase Solutions.
# 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://ww... | |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>"use strict";
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
interval: 200,
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
... | },
files: {
src: ['Gruntfile.js', 'package.json', 'lib/*.js', 'lib/controllers/**/*.js', 'lib/models/**/*.js', 'lib/utils/**/*.js', 'demo/*.js'] |
<|file_name|>log.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2017 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.<|fim▁hole|> * but WITHOUT ANY WARRANTY; with... | *
* This program is distributed in the hope that it will be useful, |
<|file_name|>realview-switcheroo-atomic.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectua... | |
<|file_name|>monitoring-alarm.js<|end_file_name|><|fim▁begin|>'use strict';
viewModel.MonitoringAlarm = new Object();
var ma = viewModel.MonitoringAlarm;
ma.minDatetemp = new Date();
ma.maxDatetemp = new Date();
ma.minDateRet = new Date();
ma.maxDateRet = new Date();
vm.currentMenu('Alarm Data');
vm.currentTitle('... | // $('#dateStart').data('kendoDatePicker').value( new Date(Date.UTC(moment( ma.maxDatetemp).get('year'), ma.maxDatetemp.getMonth(), ma.maxDatetemp.getDate() - 7, 0, 0, 0, 0))); |
<|file_name|>set_test.go<|end_file_name|><|fim▁begin|>package mxj
import (
"testing"
)
func TestSetValueForPath(t *testing.T) {
m := map[string]interface{}{
"Div": map[string]interface{}{<|fim▁hole|> "Family": "sans",
},
},
}
mv := Map(m)
// testing setting a new key
err := mv.SetValueForPath("big", ... | "Colour": "blue",
"Font": map[string]interface{}{ |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from distutils.core import setup
setup(name = "palabre",
version = "0.6b",
description = "XML Socket Python Server",
long_description = "Flash XML Multiuser Socket Server",
author = "Cél... | ("/etc", ["etc/palabre.conf"]
),
("doc",["doc/README.txt"]),
("./",["AUTHORS","COPYING","MANIFEST","MANIFEST.in","PKG-INFO"]), |
<|file_name|>animate_pipe_flow_byframe_experiment_intensityonly.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import numpy as np
import sys
from numpy import *
import matplotlib.pyplot as pyplot
import matplotlib.animation as anim
import h5py
from matplotlib.colors import LogNorm
from mpl_toolkits.mplot3d import... | Lscale = L/R |
<|file_name|>TrainingImporter.java<|end_file_name|><|fim▁begin|>/*
* Licensed under the Apache License, Version 2.0 (the "License"); you
* may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | .source(jsonBuilder().startObject().field("query", query).field("dataID", list[0]).field("label", list[list.length - 1]).endObject()); |
<|file_name|>color_matrix.rs<|end_file_name|><|fim▁begin|>use cssparser::Parser;
use markup5ever::{expanded_name, local_name, namespace_url, ns};
use nalgebra::{Matrix3, Matrix4x5, Matrix5, Vector5};
use crate::document::AcquiredNodes;
use crate::drawing_ctx::DrawingCtx;
use crate::element::{ElementResult, SetAttribut... | let a = Matrix3::new( |
<|file_name|>issue-12133-3.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://www.apache.org/l... | // except according to those terms.
// aux-build:issue-12133-rlib.rs |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from fanstatic import Library, Resource
import js.jquery
library = Library('jquery.socialshareprivacy', 'resources')
css = Resource(library, 'socialshareprivacy/socialshareprivacy.css')
<|fim▁hole|> minified='jquery.socialshareprivacy.... | socialshareprivacy = Resource(library, 'jquery.socialshareprivacy.js', |
<|file_name|>heatmap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
line = sys.stdin.readline() # skip the header
line = sys.stdin.readline()
all = {}<|fim▁hole|> v = line.split()
if v[0] not in all:
all[v[0]] = set()
all[v[0]].add(v[1])
line = sys.stdin.readline()
s = [k for... | while line: |
<|file_name|>variable_test.js<|end_file_name|><|fim▁begin|>"use strict";
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*... | |
<|file_name|>QueueCmd.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 John Grosh <john.a.grosh@gmail.com>.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | this.aliases = new String[]{"list"};
this.bePlaying = true; |
<|file_name|>slds-dropdown-item.js<|end_file_name|><|fim▁begin|>import Component from '@ember/component';
import layout from '../templates/components/slds-dropdown-item';
export default Component.extend({
layout,
tagName: '',
clicked: null,<|fim▁hole|> clicked(handler, next) {
if (handler) {
han... |
actions: { |
<|file_name|>warp_event.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from lib import script
import random
rand = random.randint
def warp_uptown_east(pc):
result = script.select(pc, ("enter", "north", "south", "west", "cancel"), "warp")
if result == 1:
script.warp(pc, 10023000, rand... | 10000164: warp_guild_lobby, #ギルド元宮ロビー1F
10000165: warp_guild_lobby, #ギルド元宮ロビー2F
10000166: warp_guild_lobby, #ギルド元宮ロビー3F
10000167: warp_guild_lobby, #ギルド元宮ロビー4F |
<|file_name|>deriving-eq-ord-boxed-slice.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://ww... | |
<|file_name|>each_controller.py<|end_file_name|><|fim▁begin|>import os
import gevent
from rhizo.main import c
path_on_server = c.path_on_server()
name = path_on_server.rsplit('/', 1)[1]
print(name, os.getcwd(), path_on_server)
<|fim▁hole|>while True:
message = 'msg-%s-%d' % (name, message_index)
print('%s: s... | # loop forever sending messages
message_index = 0 |
<|file_name|>generic-tag.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<|fim▁hole|>// option. This f... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>copystructure.go<|end_file_name|><|fim▁begin|>package copystructure
import (
"reflect"
"sync"
"github.com/mitchellh/reflectwalk"
)
// Copy returns a deep copy of v.
func Copy(v interface{}) (interface{}, error) {
return Config{}.Copy(v)
}
// CopierFunc is a function that knows how to deep copy a sp... | // If we haven't set the result yet, then this is the result since
// it is the first (outermost) value we're seeing.
if w.Result == nil && v.IsValid() {
w.Result = v.Interface() |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from collections import deque
class Node(tuple):
##### ^ -- backwad
##### v -- forward
##### <-- left
##### --> right
LEFT,RIGHT,TOP,BOTTOM,FORWARD,BACKWARD = range(6)
def __new__(cls, r, c, five):
return tuple.__new__(cls, (r,c... | mat = [input() for _ in range(n)]
start,end = find_ends(mat)
print('Yes' if dfs(mat,n,start,end) else 'No')
|
<|file_name|>small-dense-int-switch.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apa... | 1 => y,
2 => y*2, |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.db import models
from django.utils.translation import ugettext as _
# from django.core.urlresolvers import reverse_lazy, reverse
from django.conf import settings
from projects.models import Project, Customer
class Report (mo... | class Meta: |
<|file_name|>labels.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
use std::io::{Read, Seek, SeekFrom, self};
use std::iter;
use std::ops::{Index, Range};
use std::path::Path;
use byteorder::{BigEndian, ReadBytesExt};
use cast::From as _0;
use linalg::prelude::*;
/// Labels corresponding to a set of images
pub st... | impl Index<u32> for Labels {
type Output = u8; |
<|file_name|>regions-out-of-scope-slice.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http:... | }
|
<|file_name|>Row.js<|end_file_name|><|fim▁begin|>import React, { memo } from 'react';
import SideBarItemTemplateWithData from '../RoomList/SideBarItemTemplateWithData';
import UserItem from './UserItem';
<|fim▁hole|> if (item.t === 'd' && !item.u) {
return (
<UserItem
id={`search-${item._id}`}
useRealName... | const Row = ({ item, data }) => {
const { t, SideBarItemTemplate, avatarTemplate: AvatarTemplate, useRealName, extended } = data;
|
<|file_name|>countries.js<|end_file_name|><|fim▁begin|>export default [
{
'English short name': 'Afghanistan',
'French short name': "Afghanistan (l')",
'Alpha-2 code': 'AF',
'Alpha-3 code': 'AFG',
Numeric: 4,
Capital: 'Kaboul',
Continent: 5,
},
{
'English short name': 'Åland Island... | 'Alpha-2 code': 'BV', |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Code to manage fetching and storing the metadata of IdPs.
"""
import datetime
import logging
import dateutil.parser
import pytz
import requests
from celery.task import task
from lxml import etree
from onelogin.saml2.utils import OneLogin_S... |
def _update_data(entity_id, public_key, sso_url, expires_at): |
<|file_name|>vizier_client.go<|end_file_name|><|fim▁begin|>// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2... | |
<|file_name|>issue-35677.rs<|end_file_name|><|fim▁begin|>// run-rustfix<|fim▁hole|>use std::hash::Hash;
fn is_subset<T>(this: &HashSet<T>, other: &HashSet<T>) -> bool {
this.is_subset(other)
//~^ ERROR the method
}
fn main() {}<|fim▁end|> | #![allow(dead_code)]
use std::collections::HashSet; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react';
import PropTypes from 'prop-types';
import './index.css';
const TemplateWrapper = ({children}) => <div>{children()}</div>;<|fim▁hole|>
export default TemplateWrapper;<|fim▁end|> |
TemplateWrapper.propTypes = {
children: PropTypes.func,
}; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = formatDistance;
// Source: https://www.unicode.org/cldr/charts/32/summary/te.html
var formatDistanceLocale = {
lessThanXSeconds: {
standalone: {
one: 'సెకను కన... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
import os
# The version of the wrapped library is the starting point for the
# version number of the python package.
# In bugfix releases of the python package, add a '-' suffix and an
# incrementing integer.
# For example, ... | include_package_data=True,
zip_safe=False,
install_requires=[ |
<|file_name|>utilities.js<|end_file_name|><|fim▁begin|>var utilities = (function(window, $){
/**
* Draws a rounded rectangle using the current state of the canvas.
* If you omit the last three params, it will draw a rectangle
* outline with a 5 pixel border radius
* @param {CanvasRenderingContex... | }
} |
<|file_name|>game.js<|end_file_name|><|fim▁begin|>var game = new Phaser.Game(375, 667, Phaser.AUTO, 'gameDiv');
// var game = new Phaser.Game(720, 1280, Phaser.AUTO, 'gameDiv');
game.global = {
taps: 0,
enemyHP: 0,
enemyHPTotal: 0,
level: 1,
enemyNumber: 1,
coins: 0,<|fim▁hole|> }
};
game.state.add('boot... | player: {
name: 'mr. hero',
level: 1,
skillLevel: [0, 0, 0, 0, 0, 0] |
<|file_name|>test_batch.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.exceptions import ValidationError
import unittest
class TestBatch(unittest.TestCase):
def test_item_has_b... | "name": "_test Batch",
"item": "_Test Item"
}).save) |
<|file_name|>recommend.js<|end_file_name|><|fim▁begin|>// 热门推荐
module.exports = function recommend() {
var t = t || {
};
t = {
init: function () {
this.tap()
},
tap: function () {
$('.hot-lesson ul li').tooltip('tag', {
type: 'mouseover',
selected: 'on',
contentClas... | }
},
t.init(); |
<|file_name|>Constants (2).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 under... | public class Constants {
public static final String Package = "org.apache.catalina.loader"; |
<|file_name|>panel.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _
from crystal_dashboard.dashboards.crystal import dashboard
import horizon
class Controllers(horizon.Panel):<|fim▁hole|>dashboard.CrystalController.register(Controllers)<|fim▁end|> | name = _("Controllers")
slug = 'controllers'
|
<|file_name|>text_parser_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in... | with self.assertRaises(pyparsing.ParseException):
text_parser.PyparsingConstants.IPV4_OCTET.parseString('526')
with self.assertRaises(pyparsing.ParseException): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.