prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>mulpd.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
fn mulpd_1() {
run_test(&Instruction { mnemonic: Mnemonic::MULPD, opera... |
fn mulpd_2() {
run_test(&Instruction { mnemonic: Mnemonic::MULPD, operand1: Some(Direct(XMM0)), operand2: Some(IndirectScaledDisplaced(EDI, Four, 1728580241, Some(OperandSize::Xmmword), None)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: No... |
<|file_name|>Babel.py<|end_file_name|><|fim▁begin|>import sublime
import sublime_plugin
import json
from os.path import dirname, realpath, join
from .node_bridge import node_bridge
# monkeypatch `Region` to be iterable
sublime.Region.totuple = lambda self: (self.a, self.b)
sublime.Region.__iter__ = lambda self: self.... | 'use_local_babel': self.get_setting('use_local_babel'),
'node_modules': self.get_setting('node_modules'),
'options': self.get_setting('options')
})]) |
<|file_name|>EndConditionScience.java<|end_file_name|><|fim▁begin|>package com.avrgaming.civcraft.endgame;
import java.util.ArrayList;
import com.avrgaming.civcraft.main.CivGlobal;
import com.avrgaming.civcraft.main.CivMessage;
import com.avrgaming.civcraft.object.Civilization;
import com.avrgaming.civcraft.object.To... | return true;
}
|
<|file_name|>controllers.js<|end_file_name|><|fim▁begin|>angular.module('starter.controllers', [])
// A simple controller that fetches a list of data from a service
.controller('JobIndexCtrl', function($rootScope, PetService) {
// "Pets" is a service returning mock data (services.js)
$rootScope.pets = PetService.a... | $rootScope.pet = PetService.get($stateParams.jobId); |
<|file_name|>struct_field.rs<|end_file_name|><|fim▁begin|>struct S {
foobar: i32,
frobnicator: i32,
}
fn main() {
let _ = S {
foo<caret>
frobnicator: 92
};<|fim▁hole|><|fim▁end|> | } |
<|file_name|>StackedBarChart.stories.tsx<|end_file_name|><|fim▁begin|>import React from "react"
import { StackedBarChart } from "./StackedBarChart.js"
import {
SampleColumnSlugs,
SynthesizeFruitTable,
SynthesizeGDPTable,
} from "../../coreTable/OwidTableSynthesizers.js"
export default {
title: "Stacked... | selection: table.availableEntityNames, |
<|file_name|>font_list.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 core_text;
use text::util::unicode_plane;
use ucd::{Cod... | |
<|file_name|>train.py<|end_file_name|><|fim▁begin|># Copyright 2020 The SQLFlow Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | # (TODO:lhw) remove this function call, use the new metadata in load_metas |
<|file_name|>rest_client.py<|end_file_name|><|fim▁begin|>import copy, getpass, logging, pprint, re, urllib, urlparse
import httplib2
from django.utils import datastructures, simplejson
from autotest_lib.frontend.afe import rpc_client_lib
from autotest_lib.client.common_lib import utils
_request_headers = {}
def _ge... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! # Teleborg
//!
//! Teleborg is a fast, reliable and easy to use wrapper for the [Telegram bot
//! API](https://core.telegram.org/bots/api).
//! This crate aims to provide everything the user needs to create a high
//! performant Telegram bot.
//!
//! ## Getting start... | //! // Our first command handler
//! fn test(bot: &Bot, update: Update, _: Option<Vec<&str>>) {
//! bot.reply_to_message(&update, "It works!").unwrap(); |
<|file_name|>install_cmd.py<|end_file_name|><|fim▁begin|>import os
import gflags
from textwrap import dedent
import hashlib
import zipfile
from ..exceptions import UsageError
from ..Bunch import Bunch
from ..TreeScanner import TreeScanner
from ..PakManifest import PakManifest, PakFile, PakFolder
def help():
ret... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache Li... |
response = http.HttpResponse(content_type='application/binary')
response['Content-Disposition'] = \ |
<|file_name|>deployments.go<|end_file_name|><|fim▁begin|>// Copyright 2019 Istio 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... | )
var _ appsv1.DeploymentInterface = &deploymentImpl{} |
<|file_name|>gen-crons.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
from optparse import OptionParser
from jinja2 import Template
HEADER = '!!AUTO-GENERATED!! Edit bin/crontab/crontab.tpl instead.'
TEMPLATE = open(os.path.join(os.path.dirname(__file__), 'crontab.tpl')).read()
<|fim▁hole|> pars... | def main():
parser = OptionParser() |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 LinkedIn Corp. 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 req... | }
}
|
<|file_name|>MetricUnionTransform.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, Salesforce.com, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of s... | * @author rzhang
*/
public class MetricUnionTransform implements Transform {
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from toyz.web import app<|fim▁hole|><|fim▁end|> | from toyz.web import tasks |
<|file_name|>types.d.ts<|end_file_name|><|fim▁begin|>export type Mixed = {};
export type Maybe<T> = T | null | undefined;
export type Constructor<T = Mixed> = new (...args: any[]) => T;
export type HTMLElementClass = typeof HTMLElement;
export type ComponentProps<T, E = HTMLElementClass> = { [P in keyof T]: PropOption... | // called after render
rendered?(): void;
}
|
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Author: François Rossigneux <francois.rossigneux@inria.fr>
#
# 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|>checker_test.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
U... | return true
}
|
<|file_name|>writer.go<|end_file_name|><|fim▁begin|>package proxy
import (
"bytes"
"net/http"
)
type Response interface {
Status() int
Header() http.Header
Body() []byte
}
type WriterRecorder struct {<|fim▁hole|> http.ResponseWriter
status int
body bytes.Buffer
}
func (w *WriterRecorder) WriteHeader(status... | |
<|file_name|>roles-modal.js<|end_file_name|><|fim▁begin|>define(function(require, exports, module) {
var Notify = require('common/bootstrap-notify');
exports.run = function() {
var $form = $("#user-roles-form"),
isTeacher = $form.find('input[value=ROLE_TEACHER]').prop('checked'),
... |
return false;
});
|
<|file_name|>i18n.js<|end_file_name|><|fim▁begin|>// i18n.js
App.i18n = {
strings: {},
loaded: false,
setLanguage: function(languageCode, callback) {
this.languageCode = languageCode;
App.localStorage.set('selected_interface_locale', languageCode);
this.loadStrings(callback);
},
getLanguage: function(langua... | $(this).val(string);
});
$("[data-i18nplaceholder]").each(function() {
var string = $(this).data('i18nplaceholder'); |
<|file_name|>User.java<|end_file_name|><|fim▁begin|>package com.zhanghedr.mvc;
/**
* Created by zhanghedr on 1/2/17.
*/
public class User {
private String name;
private String email;
public User(String name, String email) {
this.name = name;
this.email = email;
}
public String ... |
public void setName(String name) { |
<|file_name|>test_sdist.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""sdist tests"""
import os
import shutil
import sys
import tempfile
import unittest
import urllib
import unicodedata
import posixpath
from StringIO import StringIO
from setuptools.command.sdist import sdist
from setuptools.command.egg_... | self.assertTrue(os.path.join('sdist_test', 'c.rst') not in manifest) |
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for OAuth Dispatch python API module. """
import unittest
from django.conf import settings
from django.http import HttpRequest
from django.test import TestCase
from oauth2_provider.models import AccessToken
from common.djangoapps.student.tests.factorie... | self.assertDictContainsSubset(
{
'token_type': 'Bearer',
'expires_in': EXPECTED_DEFAULT_EXPIRES_IN, |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from django.core.urlresolvers import RegexURLResolver
from django.http import Http404
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore.url_routing import Ro... | |
<|file_name|>iterable.py<|end_file_name|><|fim▁begin|>import copy
from django import forms
from django.db import models
from django.core.exceptions import ValidationError, ImproperlyConfigured
from django.db.models.fields.subclassing import Creator
from djangae.forms.fields import ListFormField
from django.utils.text i... | if value is None:
return self._iterable_type([])
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""
Example
-------
class SystemSetting(KVModel):<|fim▁hole|>setting = SystemSetting.create(key='foo', value=100)
loaded_setting = SystemSetting.get_by_key('foo')
"""
from django.db import models
from .fields import SerializableField
class KVModel(models.Model):... | pass
|
<|file_name|>local.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
'''
import os
from .common import * # noqa
# DEBUG
# --------------------------------------------------------... | SECRET_KEY = env("DJANGO_SECRET_KEY", default='CHANGEME!!!')
# Mail settings
# ------------------------------------------------------------------------------ |
<|file_name|>facebook_fetcher.py<|end_file_name|><|fim▁begin|>import re
import datetime
import dateutil.parser
from django.conf import settings
from django.utils import feedgenerator
from django.utils.html import linebreaks
from apps.social.models import MSocialServices
from apps.reader.models import UserSubscription
f... | posts = feed.get('posts', {}).get('data', None)
if posts:
for post in posts: |
<|file_name|>doom-one2.go<|end_file_name|><|fim▁begin|>package styles
import (<|fim▁hole|>)
// Doom One 2 style. Inspired by Atom One and Doom Emacs's Atom One theme
var DoomOne2 = Register(chroma.MustNewStyle("doom-one2", chroma.StyleEntries{
chroma.Text: "#b0c4de",
chroma.Error: "#b... | "github.com/alecthomas/chroma" |
<|file_name|>import4.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://www.apache.org/li... |
// run-pass
|
<|file_name|>RetreatCommand3HullMod.java<|end_file_name|><|fim▁begin|>package org.tc.autonomous;
<|fim▁hole|> super(3);
}
}<|fim▁end|> |
public class RetreatCommand3HullMod extends AbstractRetreatCommandHullMod {
public RetreatCommand3HullMod() {
|
<|file_name|>user.service.ts<|end_file_name|><|fim▁begin|>/**
* Created by fuzhihong on 16/10/14.<|fim▁hole|> */
import { Injectable } from '@angular/core';
import {Headers,Http,Response} from '@angular/http';
import {Subject} from 'rxjs/Subject';
import 'rxjs/add/operator/toPromise'
import {User} from './user'... | |
<|file_name|>rlptraits.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 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 ... | |
<|file_name|>BinaryNumberTest.cpp<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------------------------*
BinaryNumberTest.cpp
This test file provides some examples of using WinUnit, by testing a
"BinaryNumber" class. The BinaryNumber class has two constructors:
o... | |
<|file_name|>queue.js<|end_file_name|><|fim▁begin|>(function() {
if (typeof module === "undefined") self.queue = queue;
else module.exports = queue;
queue.version = "1.0.1";
function queue(parallelism) {
var queue = {},
active = 0, // number of in-flight deferrals
remaining = 0, // number ... | }
return queue; |
<|file_name|>evaluator_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENS... | e := &ast.FuncCallExpr{
FnName: model.NewCIStr("EXTRACT"), |
<|file_name|>tensorflow.py<|end_file_name|><|fim▁begin|>"""
Component that performs TensorFlow classification on images.
For a quick start, pick a pre-trained COCO model from:
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md
For more details about this platform, ... | vol.Optional(CONF_AREA): AREA_SCHEMA,
vol.Optional(CONF_CATEGORIES, default=[]): |
<|file_name|>controllers.py<|end_file_name|><|fim▁begin|>"""
mod_customized Controllers
===================
In this module, users can test their fork branch with customized set of regression tests
"""
from flask import Blueprint, g, request, redirect, url_for, flash
from github import GitHub, ApiError
from datetime imp... | |
<|file_name|>Solution.py<|end_file_name|><|fim▁begin|># Problem: Search for a Range
#
# Given a sorted array of integers, find the starting and ending position of a given target value.
#
# Your algorithm's runtime complexity must be in the order of O(log n).
#
# If the target is not found in the array, return [-1, -1].... | start -= 1 |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
DESCRIPTION = """
Send emails based on a Django template
See:
https://github.com/prestontimmons/django-email-template
"""
<|fim▁hole|> description="Send emails based on a Django template",
long_description=DESCRIPT... | setup(
name="django-email-template",
version="1.0.2", |
<|file_name|>ChartComponentModel.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved.
* http://www.jaspersoft.com.
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is free softw... | actionName: 'changeChartType', |
<|file_name|>version.go<|end_file_name|><|fim▁begin|>package eventgrid
// Copyright (c) Microsoft and contributors. 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
... | func UserAgent() string {
return "Azure-SDK-For-Go/v10.3.1-beta arm-eventgrid/2017-06-15-preview"
} |
<|file_name|>09-rooms.js<|end_file_name|><|fim▁begin|>/* eslint-env mocha */
/* globals expect */
import { getCredentials, api, request, credentials } from '../../data/api-data.js';
import { password } from '../../data/user';
import { closeRoom, createRoom } from '../../data/rooms.helper';
import { updatePermission } ... | request.post(api('users.create')) |
<|file_name|>testNavigateFTP.js<|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 strict";
Cu.import("resource://gre/modules/Serv... | } |
<|file_name|>apk_operations.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2017 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.
import argparse
import json
import logging
import os
import pipes
import po... | self._RegisterExtraArgs(group)
def ProcessArgs(self, args): |
<|file_name|>Streams.ts<|end_file_name|><|fim▁begin|>export enum Streams {
COLLABORATORS = 400,
METADATA,
DOCUMENT_CONTENT,
CURSOR,
}
export enum StreamsSubtype {
COLLABORATORS_JOIN = 100,
COLLABORATORS_LOCAL_UPDATE,
DOCUMENT_OPERATION,<|fim▁hole|> DOCUMENT_QUERY,
DOCUMENT_REPLY,
METADATA_TITLE,
M... | |
<|file_name|>directives.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('rvplusplus').directive('initFocus', function() {
return {
restrict: 'A', // only activate on element attribute
link: function(scope, element, attrs) {
element.focus();
}
};<|fim▁hole|><|fim▁... | }); |
<|file_name|>inputhandler.py<|end_file_name|><|fim▁begin|>'''
File: input.py
Author: Tristan van Vaalen
Handles user input
'''
import signal
import sys
import verbose
v = verbose.Verbose()
class InputHandler():
def __init__(self):
v.debug('Initializing input handler').indent()
self.running = T... |
if raw in ['help', 'h', '?']:
self.output_options()
|
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>use intern::intern;
use grammar::repr::*;
use lr1::Lookahead;
use lr1::Lookahead::EOF;
use test_util::{normalized_grammar};
use super::FirstSets;
pub fn nt(t: &str) -> Symbol {
Symbol::Nonterminal(NonterminalString(intern(t)))
}
pub fn term(t: &str) -> Symbol {
... | assert_eq!( |
<|file_name|>0006_auto_20161209_0108.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hordak", "0005_account_currencies")]
operations = [
migrations.RunSQL(
"""
CRE... | # Generated by Django 1.10.1 on 2016-12-09 01:08
from __future__ import unicode_literals
|
<|file_name|>WorkbenchCmd.java<|end_file_name|><|fim▁begin|>package daanielz.tools.commands;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;<|fim▁hole|>import daanielz.tools.Utils;
public class WorkbenchCmd implements CommandExecutor {
public b... | import org.bukkit.entity.Player;
|
<|file_name|>GraphProgram.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014 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://www.apa... | public GraphProgram() |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var LOTUS = Symbol.for('lotus');
var lotus = global[LOTUS];
if (!lotus) {
var lotusPath = process.env.LOTUS_PATH;
// Try using the local version.
if (lotusPath) {
lotusPath += '/lotus-require';
if (__dirname === lotusPath) {
// We are already usin... |
global[LOTUS] = lotus; |
<|file_name|>olpc-muc-prop-change.py<|end_file_name|><|fim▁begin|>"""
Test OLPC MUC properties.
"""
import dbus
from twisted.words.xish import domish, xpath
from gabbletest import exec_test, acknowledge_iq, make_muc_presence
from servicetest import call_async, EventPattern, wrap_channel
import constants as cs
import... | assert event.args[2] == 2 # handle type
assert event.args[3] == 1 # handle |
<|file_name|>VisibleScope.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2009-2014 Dell, Inc.
* See annotations for authorship information
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file e... |
/**
* Resource is visible across one whole datacenter
*/ |
<|file_name|>loadProfile.js<|end_file_name|><|fim▁begin|>game.LoadProfile = me.ScreenObject.extend({
/**
* action to perform on state change
*/
onResetEvent: function() {
me.game.world.addChild(new me.Sprite(0, 0, me.loader.getImage('load-screen')), -10);
//puts load screen in when g... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2003 CAMP
# Please see the accompanying LICENSE file for further information.
"""Main gpaw module."""
import os
import sys
try:
from distutils.util import get_platform
except ImportError:
modulepath = os.environ.get('GPAW_GET_PLATFORM')
... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Unix SMB/CIFS implementation.
# Copyright (C) Sean Dague <sdague@linux.vnet.ibm.com> 2011
#
# 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; ei... | def assertCmdFail(self, val, msg=""):
self.assertIsNotNone(val, msg)
|
<|file_name|>CardCollectionDao.java<|end_file_name|><|fim▁begin|>/*
* $Id: CardCollectionDao.java 475 2005-12-08 23:44:08 -0800 (Thu, 08 Dec 2005) ivaynberg $
* $Revision: 475 $
* $Date: 2005-12-08 23:44:08 -0800 (Thu, 08 Dec 2005) $
*
* ========================================================================... | List<String> getUniqueLastNames();
|
<|file_name|>padStart.d.ts<|end_file_name|><|fim▁begin|>import { padStart } from "../fp";
<|fim▁hole|><|fim▁end|> | export = padStart; |
<|file_name|>basic.js<|end_file_name|><|fim▁begin|>'use strict';
var BigNumber = require('bignumber.js');<|fim▁hole|>var quotaMb = function(invites) { return min(BigNumber(2048).plus(BigNumber(512).times(invites)), upperLimitMb) };
module.exports = {
cycles: {
$subscription: {
storageUsedMb: {},
in... |
var upperLimitMb = BigNumber(1024).times(16);
var min = function(x, y) { return x.comparedTo(y) < 0 ? x : y }; |
<|file_name|>render.rs<|end_file_name|><|fim▁begin|>use std::collections::{HashMap, BTreeMap};
use std::error;
use std::fmt;
use std::io::Write;
use std::io::Error as IOError;
use serialize::json::Json;
use template::{Template, TemplateElement, Parameter, HelperTemplate};
use template::TemplateElement::{RawString, Exp... | |
<|file_name|>gen-accessors.go<|end_file_name|><|fim▁begin|>// Copyright 2017 The go-github AUTHORS. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
// gen-accessors generates accessor methods for structs with pointer fiel... | FieldName: fieldName,
FieldType: fieldType, |
<|file_name|>reducer_test.ts<|end_file_name|><|fim▁begin|>import { fakeState } from "../../__test_support__/fake_state";
import { overwrite, refreshStart, refreshOK, refreshNO } from "../../api/crud";
import {
SpecialStatus,
TaggedSequence,
TaggedDevice,
ResourceName,
TaggedResource,
TaggedTool,
} from "far... | }; |
<|file_name|>CachedIoAdapter.java<|end_file_name|><|fim▁begin|>/* This file is part of the db4o object database http://www.db4o.com
Copyright (C) 2004 - 2011 Versant Corporation http://www.versant.com
db4o is free software; you can redistribute it and/or modify it under
the terms of version 3 of the GNU General Publ... | flushAllPages();
}
|
<|file_name|>hrdoc.py<|end_file_name|><|fim▁begin|>import os
import sys
import shutil
from glob import glob
# --------------------------------------------------------------------------
DOC_DIR = 'hr-html'
PYWRAPS_FN = 'idaapi.py'
# --------------------------------------------------------------------------
def add_foo... | # -------------------------------------------------------------------------- |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>def clean_dict_repr(mw):
"""Produce a repr()-like output of dict mw with ordered keys"""
return '{' + \
', '.join('{k!r}: {v!r}'.format(k=k, v=v) for k, v in<|fim▁hole|> sorted(mw.items())) +\
'}'<|fim▁end|> | |
<|file_name|>OgreOverlay.cpp<|end_file_name|><|fim▁begin|>/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2014 Torus Knot Software Ltd
Pe... | mName(name),
mRotate(0.0f),
mScrollX(0.0f), mScrollY(0.0f),
mScaleX(1.0f), mScaleY(1.0f), |
<|file_name|>fractions.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Handles backports of the standard library's `fractions.py`.
The fractions module in 2.6 does not handle being instantiated using a
float and then calculating an approximate fraction based on that.... | """
from __future__ import absolute_import
|
<|file_name|>unused-async.rs<|end_file_name|><|fim▁begin|>// edition:2018
// run-pass
#![allow(dead_code)]
#[must_use]
//~^ WARNING `must_use`
async fn test() -> i32 {
1
}
struct Wowee {}
impl Wowee {
#[must_use]
//~^ WARNING `must_use`
async fn test_method() -> i32 {
1
}
}
/* FIXME(gus... | }
#[must_use] |
<|file_name|>actions.js<|end_file_name|><|fim▁begin|>/*
* App Actions
*
* Actions change things in your application
* Since this boilerplate uses a uni-directional data flow, specifically redux,
* we have these actions which are the only way your application interacts with
* your application state. This guarantee... | // * @param {object} error The error
// *
// * @return {object} An action object with a type of LOAD_REPOS_ERROR passing the error
// */ |
<|file_name|>Intro.js<|end_file_name|><|fim▁begin|>// ==ClosureCompiler==
// @compilation_level SIMPLE_OPTIMIZATIONS
/**
* @license @product.name@ JS v@product.version@ (@product.date@)
*
* (c) 2009-2014 Torstein Honsi
*
* License: www.highcharts.com/license
*/
<|fim▁hole|> module.exports = root.document ... | (function (root, factory) {
if (typeof module === 'object' && module.exports) { |
<|file_name|>constellation_msg.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/. */
//! The high-level interface from script to constel... | |
<|file_name|>dma.rs<|end_file_name|><|fim▁begin|>use core::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use libd7::{syscall, PhysAddr, VirtAddr};
static MAPPED: AtomicBool = AtomicBool::new(false);
static VIRTUAL_ADDR: VirtAddr = unsafe { VirtAddr::new_unsafe(0x10_0000_0000) }; // Should be free
#[derive(Debug, ... | if !MAPPED.compare_and_swap(false, true, Ordering::SeqCst) {
unsafe {
syscall::mmap_physical(
PhysAddr::new(0), |
<|file_name|>43.cpp<|end_file_name|><|fim▁begin|>class Solution {
public:
string multiply(string num1, string num2) {
string a, b;
a = num1;
b = num2;
string A, B;
// cout << a;
// cout << b;
int fa = 1;
int fb = 1;
int f = 1;
int lena = 0;
int lenb = 0;
... | } else {
A = a;
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(proc_macro)]
#![recursion_limit = "128"]
#[macro_use]
extern crate lazy_static;
extern crate proc_macro;
#[macro_use]
extern crate quote;
extern crate regex;
extern crate remacs_util;
extern crate syn;
use proc_macro::TokenStream;
use regex::Regex;
mod func... | rargs.append(arg); |
<|file_name|>ScheduleIterator.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2011 Pedro Ribeiro
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.<|fim▁hole|> * You may obtain a copy of the License at
*
* htt... | |
<|file_name|>Log.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of Ingen.
Copyright 2007-2016 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
Software Foundation, e... | #endif |
<|file_name|>28 Implement strStr.py<|end_file_name|><|fim▁begin|>class Solution(object):
def strStr(self, haystack, needle):
"""
:type haystack: str
:type needle: str
:rtype: int
"""
if not needle:
return 0
if len(haystack) < len(needle):
ret... | j=0
while j < len(needle) and i+j < len(haystack):
if haystack[i+j] != needle[j]:
break |
<|file_name|>encoding.py<|end_file_name|><|fim▁begin|>import re
import chardet
import sys
RE_CHARSET = re.compile(br'<meta.*?charset=["\']*(.+?)["\'>]', flags=re.I)
RE_PRAGMA = re.compile(br'<meta.*?content=["\']*;?charset=(.+?)["\'>]', flags=re.I)
RE_XML = re.compile(br'^<\?xml.*?encoding=["\']*(.+?)["\'>]')
CHARSE... | |
<|file_name|>kis_transparency_mask.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2006 Boudewijn Rempt <boud@valdyas.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; either ve... | {
return koIcon("view-filter"); |
<|file_name|>Guides through All Selected Nodes.py<|end_file_name|><|fim▁begin|>#MenuTitle: Guides through All Selected Nodes
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
__doc__="""
Creates guides through all selected nodes.
"""
from Foundation import NSPoint
import math
t... | |
<|file_name|>animation.rs<|end_file_name|><|fim▁begin|>use crate::ipc_protocol::{ServerOneshotSender, ServerResponse, RotationDirection};
use crate::radians::Radians;
use crate::{Distance, Point};
use super::HandlerError;
use super::super::{
event_loop_notifier::EventLoopNotifier,
state::TurtleState,
app::... | |
<|file_name|>chain_call_after.rs<|end_file_name|><|fim▁begin|>fn main() {<|fim▁hole|> <caret>
}<|fim▁end|> | let moo = foo().bar().baz() |
<|file_name|>mmu.rs<|end_file_name|><|fim▁begin|>//! Generic definitions related to the MMU
use core::ops::{Add, AddAssign, Deref};
use hal::arch::mmu::PageEntry;
use hal::arch::mmu::{
PAGE_SHIFT,
OFFSET_MASK,
L1_PAGE_SHIFT,
L2_PAGE_SHIFT,
L3_PAGE_SHIFT,
L4_PAGE_SHIFT
};
pub trait Address {
... | fn from(pfn: Pfn) -> Mfn { |
<|file_name|>utilities.js<|end_file_name|><|fim▁begin|>/**
* Escapes a string for SQL insertion
*/
exports.escapeString = function(_string) {
if(typeof _string !== "string") {
return "\"" + _string + "\"";
}
return "\"" + _string.replace(/"/g, "'") + "\"";
};
/**
* Removes HTML entities, replaces breaks/para... | |
<|file_name|>bdist_egg.py<|end_file_name|><|fim▁begin|>"""setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys, os, marshal
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
from distutils.sysconfig import ... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import os
from flask.ext.wtf import Form
from wtforms import validators
from digits import utils
from digits.utils import subclass
from digits.utils.forms imp... | tooltip="Indicate a folder full of images. For each image in the feature"
" image folder there must be one corresponding image in the label"
" image folder. The label image must have the same filename except" |
<|file_name|>orf.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
import re
import calendar
import datetime
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
HEADRequest,
unified_strdate,
strip_jsonp,
int_or_none,
float_o... | subtitles = {} |
<|file_name|>proj3d.py<|end_file_name|><|fim▁begin|># 3dproj.py
#
"""
Various transforms used for by the 3D code
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import zip
from matplotlib.collections import LineCollection
from ... | |
<|file_name|>os.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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.apache.org/license... | extern { |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>"""
Command line interface for cobbler.
Copyright 2006-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
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 F... |
def report_item(remote,otype,item=None,name=None):
if item is None: |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <iostream>
int main()
{<|fim▁hole|>
sf::Music sound;
if (!sound.openFromFile("C:/Users/Alpha/Documents/Donguili/bin/Debug/test.ogg"))
return -1; // erreur
sound.play();
while (window.... | sf::RenderWindow window(sf::VideoMode(200, 200), "Donguili"); |
<|file_name|>authorization_client.go<|end_file_name|><|fim▁begin|>/*
Copyright 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... | }
return &AuthorizationV1Client{client}, nil |
<|file_name|>just_detach_bem.py<|end_file_name|><|fim▁begin|>import lms_code.lib.rep2 as rep2
from lms_code.analysis.run_bem import bemify, boundary_conditions,\
assemble, constrain, solve, evaluate_surface_disp
from lms_code.analysis.simplified_bem import create_surface_mesh, \
set_params
from codim1.core impo... | d['fault_mesh'] = detach |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import os
import sys
import imp
import logging
from collections import namedtuple
"""
Objects used to configure Glue at runtime.
"""
__all__ = ['Registry', 'SettingRegistry', 'ExporterRegistry',
'ColormapRegistry', 'DataFactoryRegistry', 'QtClientRegistry'... | The default configuration file search order:
|
<|file_name|>default_logger_test.go<|end_file_name|><|fim▁begin|>package log
import (
"bytes"
"io"
stdlog "log"
"strings"
"sync"
"testing"
"time"
)
// NOTES:
// - Run "go test" to run tests
// - Run "gocov test | gocov report" to report on test converage by file
// - Run "gocov test | gocov annotate -" to repo... | lvl: NoticeLevel,
msg: "notice",
flds: nil,
want: " [36;1mNOTICE[0m notice\n", |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.