prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>//! Contains the different error codes that were in psm.h in the C version.
pub enum Error {
Ok,
NoProgress,
ParamError,
NoMemory,
NotIinitalized,
BadApiVersion,
NoAffinity,
InternalError,
ShmemSegmentError,
OptReadOnly,
Time... | EpNoResources,
UnkownEpid,
UnreachableEpid,
InvalidNode, |
<|file_name|>dynamic-paths.rs<|end_file_name|><|fim▁begin|>#![feature(plugin)]
#![plugin(rocket_codegen)]
extern crate rocket;
#[get("/test/<one>/<two>/<three>")]
fn get(one: &str, two: usize, three: isize) -> &'static str { "hi" }<|fim▁hole|>
fn main() {
let _ = routes![get];
}<|fim▁end|> | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"os"
"github.com/codegangsta/cli"
)
func main() {
app := cli.NewApp()
app.Name = "nano-client"
app.Usage = "Send a request to service"
app.Version = Version
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "service, s",
Usage: "Ser... | Name: "params, p",
Usage: "Parameters as JSON (Required)",
},
} |
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of the VecNet OpenMalaria Portal.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/o... | |
<|file_name|>uSqlExternalDataSourceList.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
* Changes may cause i... | } |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>/* jslint node: true */
var FILENAME = 'modules/empathy.js',
ALL_JAVASCRIPT_FILES = ['Gruntfile.js', '*/*.js',
'public/javascripts/*.js'];
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
... | }; |
<|file_name|>_x.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class XValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="x", parent_name="isosurface.caps", **kwargs):
super(XValidator, self).__init__(
plotly_name=plotly_name,
... | |
<|file_name|>hierarchy.py<|end_file_name|><|fim▁begin|>"""
========================================================
Hierarchical clustering (:mod:`scipy.cluster.hierarchy`)
========================================================
.. currentmodule:: scipy.cluster.hierarchy
These functions cut hierarchical clusterings ... | information. Default is "single".
R : ndarray, optional |
<|file_name|>citrix_adc_appfw_settings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2020 Citrix Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal i... | 'stats',
]
), |
<|file_name|>ArchWall.py<|end_file_name|><|fim▁begin|>#***************************************************************************
#* *
#* Copyright (c) 2011 *
#* Yorik van Havre <yorik@uncre... | obj.addProperty("App::PropertyVector","Normal","Arch",translate("Arch","The normal extrusion direction of this object (keep (0,0,0) for automatic normal)"))
obj.addProperty("App::PropertyInteger","Face","Arch",translate("Arch","The face number of the base object used to build this wall")) |
<|file_name|>ValueAndBuilder93.java<|end_file_name|><|fim▁begin|>// Generated by delombok at Sat Jun 11 11:12:44 CEST 2016
public final class Zoo {
private final String meerkat;
private final String warthog;
public Zoo create() {
return new Zoo("tomon", "pumbaa");
}<|fim▁hole|> @java.lang.SuppressWarning... | |
<|file_name|>content.min.js<|end_file_name|><|fim▁begin|>function $childNode(o) {
return window.frames[o]
}
function animationHover(o, e) {
o = $(o), o.hover(function () {
o.addClass("animated " + e)
}, function () {
window.setTimeout(function () {
o.removeClass("animated " + e)
... | container: "body" |
<|file_name|>iscsi.py<|end_file_name|><|fim▁begin|>"""
Basic iscsi support for Linux host with the help of commands
iscsiadm and tgtadm.
This include the basic operates such as login and get device name by
target name. And it can support the real iscsi access and emulated
iscsi in localhost then access it.
"""
import... | :param params: parameters dict for TGT backend of iSCSI.
"""
super(IscsiTGT, self).__init__(params, root_dir)
|
<|file_name|>acquisition.hpp<|end_file_name|><|fim▁begin|><|fim▁hole|>
#ifndef ACQUISITION_HPP
#define ACQUISITION_HPP
#include <QAbstractVideoBuffer>
#include <QAbstractVideoSurface>
#include <QList>
#include <QVideoFrame>
#include <QLoggingCategory>
Q_DECLARE_LOGGING_CATEGORY(visionAcquisitionLog)
class Acquisitio... | // acquisition.hpp |
<|file_name|>UseOfAllTypeScriptObjectsBinder.js<|end_file_name|><|fim▁begin|>var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (... | return _super.call(this, ['ID'], null, true, MaceTestObject) || this;
}
return UseOfAllTypeScriptObjectsBinder; |
<|file_name|>unmix.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2012 Jake Ross
#
# 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 o... |
#
# def unmix(ages, errors, initial_guess): |
<|file_name|>framework.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import socket
import traceback
from lineup.datastructures import Queue
class Node(object):
def __init__(self, *args, **kw):
self.initialize(*args, **kw)
... | def id(self):
return '|'.join([self.get_hostname(), str(os.getpid())])
@property |
<|file_name|>favourites_manager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the ... | if __name__ == "__main__": |
<|file_name|>preview.test.ts<|end_file_name|><|fim▁begin|>import { createPreview } from '@dicebear/core';
import * as style from '../dist';
import * as fs from 'fs';
import * as path from 'path';
const data = [
[style, { seed: 'test' }, 'eyes'],
[style, { seed: 'test' }, 'hair'],
[style, { seed: 'test' }, 'body'... |
fs.writeFileSync(svgComponent, createPreview(...params), {
encoding: 'utf-8',
}); |
<|file_name|>sitemessage_send_scheduled.py<|end_file_name|><|fim▁begin|>from traceback import format_exc
from django.core.management.base import BaseCommand
from ...toolbox import send_scheduled_messages
class Command(BaseCommand):
help = 'Sends scheduled messages (both in pending and error statuses).'
de... | if priority is not None: |
<|file_name|>boids.js<|end_file_name|><|fim▁begin|>var helpers = require('./');
/** Boids is a lot like Castle in the way it treats elements. But it is more
predictable, and retains attribute information.
1. The root node is collapsed, but its name is preserved in document['*']
2. Attributes are stored in a Object<... | obj.$[helpers.fullName.apply(attr)] = attr.value();
});
var texts = []; |
<|file_name|>parser.ts<|end_file_name|><|fim▁begin|>import * as fs from 'fs';
import * as glob from 'glob';
import { IGettextExtractorStats } from './extractor';
import { CatalogBuilder, IMessage } from './builder';
import { Validate } from './utils/validate';
export interface IMessageData {
text: string;
tex... | |
<|file_name|>regularsetting.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
<|fim▁hole|>})
export class RegularSettingComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}<|fim▁end|> | @Component({
selector: 'admin-regular',
templateUrl: './regularsetting.component.html',
styleUrls: ['./regularsetting.component.css'] |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::error;
use std::ffi::OsStr;
use std::fmt;
use std::fs::{self, File, OpenOptions};
use std::io::{self, Read, Seek, SeekFrom, Write};
use std::mem;
use std::ops::Deref;
use std::path::{Path, PathBuf};
use crate::error::IoResultExt;
use crate::Builde... | Ok(_) => { |
<|file_name|>matrix_cool.py<|end_file_name|><|fim▁begin|>"""
http://coreygoldberg.blogspot.com/2013/01/python-matrix-in-your-terminal.html
Create "The Matrix" of binary numbers scrolling vertically in your terminal.
original code adapted from juancarlospaco:
- http://ubuntuforums.org/showpost.php?p=10306676
Insp... | def set_vertical(self, x, y, string):
string = string[::-1]
if x < 0:
x = 80 + x
|
<|file_name|>prod.config.js<|end_file_name|><|fim▁begin|>require('babel-polyfill');
/* eslint-disable */
// Webpack config for creating the production bundle.
var path = require('path');
var webpack = require('webpack');
var CleanPlugin = require('clean-webpack-plugin');
var ExtractTextPlugin = require('extract-text-w... | path: assetsPath,
filename: '[name]-[chunkhash].js',
chunkFilename: '[name]-[chunkhash].js', |
<|file_name|>off-canvas.js<|end_file_name|><|fim▁begin|>(function ($, Drupal) {
/**
* Toggle show/hide links for off canvas layout.
*/
Drupal.behaviors.omegaOffCanvasLayout = {
attach: function (context) {
$('#off-canvas').click(function(e) {
if (!$(this).hasClass('is-visible')) {
... | $(this).parent().removeClass('is-visible');
e.preventDefault();
e.stopPropagation();
}); |
<|file_name|>index.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2015 Steffen Deusch
# Licensed under the MIT license
# Beilage zu MonitorNjus, 14.09.2015 (Version 0.9.3)
import os
workingdir = os.path.dirname(os.path.realpath(__file__))
import sys
reload(sys)
sys.setd... | <label for="REFRESHAKTIV-Links-"""+unicode(x)+"""\">Links neu laden</label> |
<|file_name|>Marker.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import clsx from 'clsx';
import { equals } from 'ramda';
import { Theme } from '@mui/material';
import makeStyles from '@mui/styles/makeStyles';
import { CreateCSSProperties } from '@mui/styles';
export enum LegendMarkerVariant {
... | variant: LegendMarkerVariant;
}
const useStyles = makeStyles<Theme, StylesProps>((theme) => ({ |
<|file_name|>google.js<|end_file_name|><|fim▁begin|>// TODO: Add tests
import passport from 'passport';
import { OAuth2Strategy as GoogleStrategy } from 'passport-google-oauth';
import authConfig from '../credentials.json';
import init from '../init';
import { upsert } from '../../lib/util';
function passportInit() ... | last_name: profile.name.familyName, |
<|file_name|>DeploymentTest.java<|end_file_name|><|fim▁begin|>package com.redhat.jcliff;
import java.io.StringBufferInputStream;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.Set;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.jboss.dm... | @Test
public void replace() throws Exception {
ModelNode newDeployments=ModelNode.fromStream(new StringBufferInputStream("{\"app1\"=>\"deleted\", \"app2\"=>{\"NAME\"=>\"app2\",\"path\"=>\"blah\"} }")); |
<|file_name|>associated-types-cc-lib.rs<|end_file_name|><|fim▁begin|>// Helper for test issue-18048, which tests associated types in a
// cross-crate scenario.<|fim▁hole|>
pub trait Bar: Sized {
type T;
fn get(x: Option<Self>) -> <Self as Bar>::T;
}
impl Bar for isize {
type T = usize;
fn get(_: Opti... |
#![crate_type="lib"] |
<|file_name|>levels_full.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012 The Android Open Source Project
*
* 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... | #pragma rs java_package_name(com.android.rs.image2) |
<|file_name|>test_extra_trees.py<|end_file_name|><|fim▁begin|>import unittest
from autosklearn.pipeline.components.classification.extra_trees import \
ExtraTreesClassifier
from autosklearn.pipeline.util import _test_classifier, \
_test_classifier_iterative_fit, _test_classifier_predict_proba
import numpy as n... | # Running this without an exception is the purpose of this test!
cls.fit(X, y) |
<|file_name|>riskassessment_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 on 2017-03-22.
# 2017, SMART Health IT.
import io
import json
import os
import unittest
from . import riskassessment
from .fhirdate import FHIRDate
class RiskAssessm... |
def implRiskAssessment2(self, inst):
self.assertEqual(inst.id, "population")
self.assertEqual(inst.status, "final") |
<|file_name|>homogint.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding: UTF-8
from __future__ import division
import numpy as np
def left_multiplication(g, x):
"""
Multiplication action of a group and a vector.
"""
return np.dot(g, x)
def trans_adjoint(g, x):
return np.dot(np.dot(g... |
def compute_vectors(self, movement_field, stages):
"""
Compute the Lie algebra elements for the stages. |
<|file_name|>cloud.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
define_error_codes!(
"KV:Cloud:",
IO => ("IO", "", ""),<|fim▁hole|> SSL => ("SSL", "", ""),
PROTO => ("Proto", "", ""),
UNKNOWN => ("Unknown", "", ""),
TIMEOUT => ("Timeout", ""... | |
<|file_name|>ihm.rs<|end_file_name|><|fim▁begin|>//! Custom hash map implementation for use in breadth-first search
//! This application omits some of the features of a normal hash table and must be very fast,
//! so it makes sense to rewrite it to take advantage of certain optimizations.
//! These tables are always k... | Some(_) => addr = Self::hash_with(addr+1, self.cap_exp),
}
} |
<|file_name|>syntax-extension-with-dll-deps.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:/... | // except according to those terms. |
<|file_name|>parse.rs<|end_file_name|><|fim▁begin|>// ignore-tidy-linelength
use proc_macro::Literal;
pub fn test() {
test_display_literal();<|fim▁hole|>fn test_display_literal() {
assert_eq!(Literal::isize_unsuffixed(-10).to_string(), "-10");
assert_eq!(Literal::isize_suffixed(-10).to_string(), "-10isize... | test_parse_literal();
}
|
<|file_name|>adminStoreApi.service.spec.js<|end_file_name|><|fim▁begin|>(function (angular) {
'use strict';
describe('adminStoreApi', function () {
var $firebaseObjectMock;
var firebaseObjectResult;
var firebaseRef;
var adminStoreApi;<|fim▁hole|> beforeEach(function () {... |
beforeEach(module('movieClub'));
|
<|file_name|>c_parser.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright 2015 by PyCLibrary Authors, see AUTHORS for more details.
#
# Distributed under the terms of the MIT/X11 license.
#
# The full license is in the file ... | stored in Type.type_spec parameter
(This is **not** the case for function pointers):
(i.E. Type(Type('int', '*'), ( ('param1', Type('int'), None), ) ) )
|
<|file_name|>utility.py<|end_file_name|><|fim▁begin|>row_key = "Rows"
column_key = "Cols"
special_keywords = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov',
'dec', 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september',
... | |
<|file_name|>node.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import logging
from src import util
from src import etherscan
from src import messages
from crypto.prices import *
logger = logging.getLogger("node")
######
# Telegram command handler for adding nodes for the user who fired the command.
#
# Com... | for arg in args: |
<|file_name|>selector_parser.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/. */
//! Gecko-specific bits for selector-parsing.
use cs... | } |
<|file_name|>radio3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# selects stream from tuning dial position
# monitors battery condition
from __future__ import division
import spidev<|fim▁hole|>import time
import os
import gc
import sys
import math
global tune1, tune2, tunerout, volts2, volume1, volume2, volumeo... | |
<|file_name|>enums_5.js<|end_file_name|><|fim▁begin|>var searchData=
[<|fim▁hole|> ['shadowactions_5ft',['ShadowActions_t',['../aws__iot__shadow__interface_8h.html#a1fc9e025434023d44d33737f8b7c2a8c',1,'aws_iot_shadow_interface.h']]]
];<|fim▁end|> | ['shadow_5fack_5fstatus_5ft',['Shadow_Ack_Status_t',['../aws__iot__shadow__interface_8h.html#ad946163c2ac5df0aa896520949d47956',1,'aws_iot_shadow_interface.h']]], |
<|file_name|>CreateSelectable.tsx<|end_file_name|><|fim▁begin|>import React, { Component, ComponentType } from 'react'
import { getBoundsForNode, TComputedBounds, TGetBoundsForNodeArgs } from './utils'
import { TSelectableItemState, TSelectableItemProps } from './Selectable.types'
import { SelectableGroupContext } fro... | componentWillUnmount() {
this.context.selectable.unregister(this)
}
|
<|file_name|>taskhall_index.js<|end_file_name|><|fim▁begin|>var vueBody = new coreBody({
el: 'body',
data : {
user : "leasunhy",
selectedTab : 'All Questions',
currentOrder : 'vote',
orders : ['vote', 'view', 'time'],
page ... | |
<|file_name|>raw-str-unbalanced.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> r#"
"## //~ too many `#` when terminating raw string
;<|fim▁end|> | static s: &'static str = |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import 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 'User'
db.create_table(u'accounts_u... | db.delete_table(u'accounts_user')
# Removing M2M table for field groups on 'User'
db.delete_table(db.shorten_name(u'accounts_user_groups')) |
<|file_name|>iME_Draw_colorPicker.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import inkex
import inkscapeMadeEasy_Base as inkBase
import inkscapeMadeEasy_Draw as inkDraw
class myExtension(inkBase.inkscapeMadeEasy):
def __init__(self):
inkex.Effect.__init__(self)
self.OptionParser.add_opti... | |
<|file_name|>graph.rs<|end_file_name|><|fim▁begin|>use client::Client;
use path::Path;
use error::OrchestrateError;
use error::OrchestrateError::RequestError;
use RepresentsJSON;
use serialize::json;
use hyper::method::{Get, Put, Delete};
#[deriving(Decodable, Encodable, Show)]
pub struct GraphResults<T> {
pub cou... | }
|
<|file_name|>chain.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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 versi... | let client = Client::new(
config,
&spec, |
<|file_name|>getpocket.py<|end_file_name|><|fim▁begin|>from logging import Logger
from requests.sessions import Session
def getpocket_download(session: Session, _logger: Logger):
"""
This does the heavy lifting
:param session:
:param _logger:
:return:
"""
headers = {<|fim▁hole|> "en... | "Origin": "https://app.getpocket.com", # checked that this is needed
}
params = { |
<|file_name|>datadescriptor.cpp<|end_file_name|><|fim▁begin|>#include "Data/datadescriptor.h"
#include <type_traits>
#include <QDebug><|fim▁hole|> _name(name), _unit(unit), _factor(factor), _type(t)
{
_uuid = getUUID();
}
DataDescriptor::DataDescriptor(const QJsonObject &jo) {
_uuid = getUUID();
_name = jo["name"].... |
unsigned int DataDescriptor::_uid_ctr = 0;
DataDescriptor::DataDescriptor(QString name, QString unit, double factor, Type t) : |
<|file_name|>ReadAndLexer.js<|end_file_name|><|fim▁begin|>var fs = require('fs');
const readline = require('readline');<|fim▁hole|>const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.question('File name please. ', (answer) => {
var data = fs.readFileSync(answer, 'utf8');
c... | Lexer = require("./Lexer.js")
|
<|file_name|>acorn.js<|end_file_name|><|fim▁begin|>var ps, acorn;
function start(){
ps = new PointStream();
ps.setup(document.getElementById('canvas'));<|fim▁hole|> ps.onKeyDown = function(){
ps.println(window.key);
};
ps.onRender = function(){
ps.translate(0, 0, -25);
ps.clear();
ps.render(ac... | ps.pointSize(5); |
<|file_name|>partition_health.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code ... | :type replica_health_states: list of :class:`ReplicaHealthState |
<|file_name|>dryml-support.js<|end_file_name|><|fim▁begin|>Event.addBehavior({
'body:click' : function(event) {
if (event.shiftKey && event.altKey) {
Dryml.click(event)
Event.stop(event)
}
}
})
var Dryml = {
menu: null,
event: null,
click: function(event)... |
showSourceMenu: function(element) {
var stack = Dryml.getSrcInfoStack(element)
Dryml.showMenu(stack) |
<|file_name|>syslog.py<|end_file_name|><|fim▁begin|>from syslog import syslog
module_name = "Syslog"
config = {
"prefix": "Default Prefix"
}
def handle_alert(message):<|fim▁hole|><|fim▁end|> | syslog("{} - {}".format(config["prefix"], message)) |
<|file_name|>DubboRegistry.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 u... | private final RegistryService registryService;
|
<|file_name|>mm4parser.py<|end_file_name|><|fim▁begin|>"""
gmagoon 05/03/10: new class for MM4 parsing, based on mopacparser.py, which, in turn, is based on gaussianparser.py from cclib, described below:
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.o... | # 14. 2869.2 (Bu ) s
# 15. 1554.4 (Ag ) --
|
<|file_name|>draughtsboard.js<|end_file_name|><|fim▁begin|>(function () {
'use strict'
var SIZE
var COLUMNS
var UNICODES = {
'w': '\u26C0',
'b': '\u26C2',
'B': '\u26C3',
'W': '\u26C1',
'0': ' '
}
var START_FEN
function validMove (move) {
// move should be a string
if (typeof ... |
// do it!
if (action === 'snapback') {
snapbackDraggedPiece() |
<|file_name|>setup-passport.js<|end_file_name|><|fim▁begin|>var passport = require('passport');
var Auth0Strategy = require('passport-auth0');
var credentials = require('../config/credentials.js');
var strategy = new Auth0Strategy({
domain: credentials.domain,
clientID: credentials.clientID,
cl... | passport.deserializeUser(function(user, done) {
done(null, user); |
<|file_name|>news.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#encoding=utf8
'''
Author: xmuyoo@163.com
Date: 2015/12/04
Content:
生成新闻特征数据
输入:
1、无特征样本数据
2、topic_view的文件
3、文章分词过滤后的文件
输出:
1、特征样本数据
'''
import pdb
from collections import Counter
DATA_DIR = 'tmp_data/to... | word_topic_dic[word] = int(topic)
topic_num += 1
|
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|> 'vue': 'vue/dist/vue.js'
}
}
}<|fim▁end|> | module.exports = {
resolve: {
alias: { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>(function() {
var app = angular.module('hebergement', []);
app.controller('TabController', function(){
this.tab = 1;
this.setTab = function(newValue){
this.tab = newValue;
};
this.isSet = function(tabName){
return this.tab === tabName;
};
});<|fim▁hole|>... | |
<|file_name|>decryption_session.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd.
// This file is part of Parity.
// Parity 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,... |
/// Set decryption result.
fn set_decryption_result(core: &SessionCore, data: &mut SessionData, result: Result<EncryptedDocumentKeyShadow, Error>) { |
<|file_name|>quobyte.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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 agreed to in writing, software
# distributed u... | # Copyright (c) 2015 Quobyte Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
<|file_name|>cifar_loader.py<|end_file_name|><|fim▁begin|>import cPickle
import numpy as np
import cv2
def unpickle(file):
fo = open(file, 'rb')
dict = cPickle.load(fo)
fo.close()
return dict
files = ['../../datasets/svhn/cifar-10-batches-py/data_batch_1']
dict = unpickle(files[0])
images = dict['da... | cv2.imshow("", images[1000])
cv2.waitKey(0)
cv2.destroyAllWindows() |
<|file_name|>test_llann.py<|end_file_name|><|fim▁begin|>import py
from rpython.annotator import model as annmodel
from rpython.rtyper.llannotation import SomePtr, lltype_to_annotation
from rpython.conftest import option
from rpython.rtyper.annlowlevel import (annotate_lowlevel_helper,
MixLevelHelperAnnotator, Pseu... | s_A, r_A = a.s_r_instanceof(A)
fn1ptr = a.delayedfunction(fn1, [s_A], s_A)
pseudo = PseudoHighLevelCallable(fn1ptr, [s_A], s_A)
|
<|file_name|>UAA.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
import sys, localconfig, platform, time
#OS Runtime comments
if platform.system() == "Windows":
sys.path.append(localconfig.winpath)
print "You are running the AnkitBot UAA Module for Windows. Sponsored by DQ. :)"
else:<|fim▁hole|>impor... | sys.path.append(localconfig.linuxpath)
print "You are running the AnkitBot UAA Module for Linux. Sponsored by DQ. :)" |
<|file_name|>bslmf_invokeresult.06.t.cpp<|end_file_name|><|fim▁begin|>// bslmf_invokeresult.06.t.cpp -*-C++-*-
// ============================================================================
// INCLUDE STANDARD TEST MACHINERY FROM CASE 0
// ---------------------... |
// ----------------------------------------------------------------------------
// Copyright 2018 Bloomberg Finance L.P.
// |
<|file_name|>bitcoin_lv_LV.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="lv_LV" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Hotcoin</sourc... | </message> |
<|file_name|>list-cdn-endpoints.mock.ts<|end_file_name|><|fim▁begin|>export const request = {
"headers": {<|fim▁hole|> "body": {
"endpoints": [
{
"id": "19f06b6a-3ace-4315-b086-499a0e521b76",
"origin": "static-images.nyc3.digitaloceanspaces.com",
"endpoint": "static-images.nyc3.cdn.... | "Content-Type": "application/json",
},
};
export const response = { |
<|file_name|>E15E1.java<|end_file_name|><|fim▁begin|>package io.agrest.it.fixture.cayenne;
import io.agrest.it.fixture.cayenne.auto._E15E1;
public class E15E1 extends _E15E1 {
<|fim▁hole|><|fim▁end|> | private static final long serialVersionUID = 1L;
} |
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|># Copyright 2013 Openstack Foundation
# 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... | def get_routers_count(self, context, filters=None): |
<|file_name|>build_cosine_tables.py<|end_file_name|><|fim▁begin|>import os
import string
import codecs
import ast
import math
from vector3 import Vector3
filename_out = "../../Assets/cosine_table"
table_size = 512
fixed_point_precision = 512
def dumpCosine(_cosine_func, display_name, f):
f.write('c... | |
<|file_name|>mpl_msk_spb.py<|end_file_name|><|fim▁begin|><|fim▁hole|># http://matplotlib.org/basemap/users/examples.html
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
# create new figure, axes instances.
fig=plt.figure()
ax=fig.add_axes([0.1,0.1,0.8,0.8])
# setup mercator m... | # -*- coding: utf-8 -*- |
<|file_name|>forecast.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
__metaclass__ = type
import pandas as pd
from pyoptflow import utils
from pyoptflow.core import extract_motion_proesmans
from pyoptflow.extrapolation import semilagra... | |
<|file_name|>test_file_command.py<|end_file_name|><|fim▁begin|>import unittest
from app.commands.file_command import FileCommand
class TestFileCommand(unittest.TestCase):
def setUp(self):
self.window = WindowSpy()
self.settings = PluginSettingsStub()
self.sublime = SublimeSpy()
se... | |
<|file_name|>issue-3029.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/lice... | // option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unused_allocation)] |
<|file_name|>Quaternion.cpp<|end_file_name|><|fim▁begin|>/*
MIT License
Copyright (C) 2006 The Mono.Xna Team
All rights reserved.
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 restricti... | rResult.W = (pMatrix[_M12] - pMatrix[_M21]) * num2;
}
}
|
<|file_name|>pymatrix.py<|end_file_name|><|fim▁begin|>import math
import copy
def print_matrix(matrix):
"""
This function prettyprints a matrix
:param matrix: The matrix to prettyprint
"""
for i in range(len(matrix)):
print(matrix[i])
def transpose(matrix):
"""
This function tran... |
cofactors = [] # the matrix of cofactors, transposed
for i in range(dim):
cofactor_row = [] |
<|file_name|>qselect.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ordering;
// The threshold below which qselect_inplace_by() should just sort the slice.
const SORT_THRESH: usize = 6;
/// Use the Quickselect algorithm to select the `k`th smallest
/// element from `data`.
///
/// Does not modify `data`. Allocates an... | /// ##Panics
/// If `k` is greater than `data.len()`. |
<|file_name|>date.pipe.ts<|end_file_name|><|fim▁begin|>import { Injectable, Pipe } from '@angular/core';
import { DatePipe } from '@angular/common';
@Injectable()
// #docregion date-pipe
@Pipe({name: 'date', pure: true})
export class StringSafeDatePipe extends DatePipe {
transform(value: any, format: string): string ... | // #enddocregion date-pipe |
<|file_name|>testApplicationSettings1.js<|end_file_name|><|fim▁begin|>(function($) {
module("applicationSettings1");
// Test case : Application Settings
_asyncTest("Application Settings 1", function()
{
expect(14);
var gitana = GitanaTest.authenticateFullOAuth();
gitana.then(f... | |
<|file_name|>collector_crimeserver.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import json
import logging
import sys
from intelmq.lib.bot import Bot
from intelmq.lib.message import Report
from sdk.blueliv_api import BluelivAPI
class BluelivCrimeserverCollectorBot(Bot):
def process(self):
sel... | |
<|file_name|>stack_switcher.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (17af302) from gir-files (11e0e6d)
// DO NOT EDIT
use Box;
use Buildable;
use Container;
use Orientable;
#[cfg(feature = "3.10")]
use Stack;
use Widget;
use ffi;
use glib::object::Downcast;
use glib::translate::*;
glib_wrapp... |
impl StackSwitcher { |
<|file_name|>mercury.rs<|end_file_name|><|fim▁begin|>// This file is generated. Do not edit
// @generated
// https://github.com/Manishearth/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy)]
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(non_camel_case_types)... | pub fn new() -> MercuryMultiGetReply {
::std::default::Default::default()
} |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# global default settings for physical simulation
# ---------------------------------------------------------------------
# system parameters
d1 = 0.08
l2 = 0.19
d2 = 0.... | wheel = dia/4 |
<|file_name|>0019_auto_20160922_1342.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.db import migrations, models
import multiselectfield.db.fields
class Migration(migrations.Migration):
dependencies = [
('user', '0018_auto_20160922_1258'),
]
operations = [
migrations.AddField(
... | from __future__ import unicode_literals
|
<|file_name|>path3d.cpp<|end_file_name|><|fim▁begin|>// *****************************************************************************
// path3d.cpp Tao3D project
// *****************************************************************************
//
// File description:
... |
GL.LoadMatrix(); |
<|file_name|>qos.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 appl... | can be used by neutron port and network, to provide bandwidth limit
QoS capabilities.
|
<|file_name|>description.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2011-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software cod... | #
# http://numenta.org/licenses/
# ----------------------------------------------------------------------
|
<|file_name|>copyfrom-tests.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var helper = require(__dirname + '/../test-helper');
var CopyFromStream = require(__dirname + '/../../../lib/copystream').CopyFromStream;
var ConnectionImitation = function () {
this.send = 0;
this.hasToBeSend = 0;
this.finished = 0;
}... | |
<|file_name|>helper.go<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: Apache-2.0
// Copyright 2017-2019 Authors of Cilium
package cmd
import (
"archive/tar"
"bytes"
"compress/gzip"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"os"
"path/filepath"
"regexp"
"strings"
)
type tarWriter interface {
io.... | |
<|file_name|>x509_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# 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
#
# http:/... | |
<|file_name|>TsTservSS.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import SocketServer
import time<|fim▁hole|>
HOST = ''
PORT = 1234
ADDR = (HOST, PORT)
class MyRequestHandler(SocketServer.StreamRequestHandler):
def handle(self):
print('...connected from: {}'.format(self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.