prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>optimize_dead_defs.rs<|end_file_name|><|fim▁begin|>use std::collections::{HashSet};
use grit;
pub fn optimize(mut prog: grit::ProgDef) -> grit::ProgDef {
let info = collect_prog_info(&prog);
prog.fun_defs = prog.fun_defs.into_iter().filter(|def| {
info.used_funs.contains(&def.name)
}).collec... | collect_fun(&mut info, fun_def); |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod codegen;
pub mod jit;<|fim▁hole|><|fim▁end|> | pub mod cpuid; |
<|file_name|>util.module.ts<|end_file_name|><|fim▁begin|>/// <reference path="sugar.ts" />
module vs.tools.util {
'use strict';
angular.module('vs.tools.util', [])<|fim▁hole|><|fim▁end|> | /* @ngInject */
.factory('sugar', (config, $http) => Sugar.getInstance(config, $http));
} |
<|file_name|>ocr.py<|end_file_name|><|fim▁begin|>"""
Runs OCR on a given file.
"""
from os import system, listdir
from PIL import Image
from pytesseract import image_to_string
import editdistance
from constants import DATA_DIR
def classify(image, people_class, max_classify_distance=1, min_nonclassify_distance=3):
... | return result
def setup_ocr(raw_data, progress): |
<|file_name|>generic-arg-mismatch-recover.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be ... | // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT. |
<|file_name|>24.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { BatteryFull24 as default } from "../../"; |
<|file_name|>clipboard.js<|end_file_name|><|fim▁begin|>/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* 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
*
* ht... | |
<|file_name|>scripts.js<|end_file_name|><|fim▁begin|>function infostart_rate(ob_id, vote)
{
$.get("/bitrix/components/infostart/objects_new.list/ajax_rate.php",
{ID:ob_id, TYPE:vote},
function(answer)
<|fim▁hole|> {
alert(answer);
});
}<|fim▁end|> | |
<|file_name|>comp-1489.component.ts<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> *
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-comp-1489',
te... | * @license
* Copyright Google Inc. All Rights Reserved. |
<|file_name|>feed_parse_extractMiratlsWordpressCom.py<|end_file_name|><|fim▁begin|>def extractMiratlsWordpressCom(item):<|fim▁hole|> Parser for 'miratls.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return No... | ''' |
<|file_name|>mapSVC.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module("services")
.factory('mapSVC', [ "colorsSVC", function(colorsSVC) {<|fim▁hole|> var setPathMode = function (mode) {
if(mode == "driving"){
return google.maps.DirectionsTravelMode.DRIVING;
}
else if(mode == "... | // Converts two coordinates to a GoogleLatLong
var cnvLatLong = function (x) {
return new google.maps.LatLng(x[0],x[1]);
}; |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... | from tensorflow.python.platform import googletest as _googletest |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>"""
Constants used across the ORM in general.
"""
# Separator used to split filter strings apart.<|fim▁hole|>LOOKUP_SEP = '__'<|fim▁end|> | |
<|file_name|>delay_based_time_source_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright 2011 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.
#include "components/viz/common/frame_sinks/delay_based_time_source.h"
#inc... | // Tick with -1ms of jitter |
<|file_name|>teleop.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
PACKAGE_NAME = 'shiba_teleop'
import roslib
roslib.load_manifest(PACKAGE_NAME)
import rospy
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Joy
import rospkg
FORWARD = 1
BACKWARDS = 2
SPINNING = 3
STOPPED = 4
linear_increment... | min_linear_vel = -1.0
default_linear_vel = 0.1 |
<|file_name|>utils.d.ts<|end_file_name|><|fim▁begin|>export function makeRequest(method: any, auth: any, url: any, qs: any, data: any, cb: any): Promise<any>;
/**
* Freshdesk's API protocol violations
*
* @param {String} message Error message
* @param {Number} status HTTP status of the received Freshdesk-respons... | * @param {Object} data Parsed response of the Freshdesk API |
<|file_name|>dantooine_voritor_hunter_lair_1.py<|end_file_name|><|fim▁begin|>import sys
from java.util import Vector
def addTemplate(core):
core.spawnService.addLairTemplate('dantooine_voritor_hunter_lair_2', 'slinking_voritor_hunter', 15, 'object/tangible/lair/base/poi_all_lair_bones.iff')<|fim▁hole|><|fim▁end|> | return |
<|file_name|>repository.go<|end_file_name|><|fim▁begin|>package yum
import (
"bytes"
"encoding/xml"
"fmt"
"io"
"io/ioutil"
"math"
"os"
"path/filepath"
"time"
"github.com/gonuts/logger"
)
// List of packages to ignore for our case
var IGNORED_PACKAGES = []string{
"rpmlib(CompressedFileNames)", "/bin/sh", "... | // get repo metadata with list of available files
remotedata, err := repo.remoteMetadata()
if err != nil {
return err |
<|file_name|>input.rs<|end_file_name|><|fim▁begin|>#[allow(dead_code)]
pub static EXAMPLE_INPUT: &'static str =
"swap position 4 with position 0
swap letter d with letter b
reverse positions 0 through 4
rotate left 1 step
move position 1 to position 4<|fim▁hole|>rotate based on position of letter d";
#[allow(dead_code... | move position 3 to position 0
rotate based on position of letter b |
<|file_name|>test_ofstats.py<|end_file_name|><|fim▁begin|># Copyright 2011 Midokura KK
#
# 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... | |
<|file_name|>gsproxy.go<|end_file_name|><|fim▁begin|>package gsproxy
import (
"fmt"
"math/big"
"sync"
"time"
"github.com/gsdocker/gsconfig"
"github.com/gsdocker/gslogger"
"github.com/gsrpc/gorpc"
"github.com/gsrpc/gorpc/handler"
)
var (
dhHandler = "gsproxy-dh"
transProxyHandler = "gsproxy-trans"
... | proxy := &_Proxy{
Log: gslogger.Get("gsproxy"),
proxy: builder.proxy, |
<|file_name|>20181123102419-change-user-clients-sso-id-to-has-login.ts<|end_file_name|><|fim▁begin|>export const up = async function(db: any): Promise<any> {
return db.runSql(
`
ALTER TABLE user_clients ADD COLUMN has_login BOOLEAN DEFAULT FALSE;
<|fim▁hole|> `
);
};
export const down = function... | UPDATE user_clients SET has_login = sso_id IS NOT NULL; |
<|file_name|>TransactionService.java<|end_file_name|><|fim▁begin|>package pl.garciapl.banknow.service;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
import pl.garciapl.banknow.model.Transaction;
import pl.garciapl.banknow.service.exceptions.GenericBankNowException;
import pl.garciapl... | * @author lukasz
*/
public interface TransactionService { |
<|file_name|>0002_contact_project_socialsite.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-13 18:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myblog', '0001_... | ),
migrations.CreateModel(
name='Project',
fields=[ |
<|file_name|>test_general_describer.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import division, print_function, unicode_literals, \
absolute_import
import unittest
import os
import json
import numpy as np
import pandas as pd
from pymatgen import Structure
from veidt.describer.general import... | results = self.generator.describe(self.df)
np.testing.assert_array_equal(np.sin(self.data),
results[["sin x", "sin y", "sin z"]]) |
<|file_name|>not-found.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-page-not-found',
templateUrl: './not-found.component.html',
styleUrls: ['./not-found.component.scss'],
})
export class NotFoundComponent implements OnInit {<|fim▁hole|> ... | |
<|file_name|>ParseOptionsFile.ts<|end_file_name|><|fim▁begin|>import { Command } from '@dicy/types'
import Rule from '../Rule'
import { Action } from '../types'
export default class ParseOptionsFile extends Rule {
static commands: Set<Command> = new Set<Command>(['load'])
static defaultActions: Action[] = ['parse... | async parse () {
for (const input of this.inputs) {
const output = await this.getOutput(`${input.filePath}-ParsedYAML`) |
<|file_name|>test_sob.py<|end_file_name|><|fim▁begin|># Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import division, absolute_import
import os
import sys
from textwrap import dedent
from twisted.trial import unittest
from twisted.persisted import sob
from twisted.python imp... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import datetime
from flask import g
from sqlalchemy import (
Boolean,
Column,
DateTime,
ForeignKey,
Integer,
Sequence,
String,
Table,
UniqueConstraint,
)
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm impo... | id = Column(Integer, Sequence("ab_register_user_id_seq"), primary_key=True)
first_name = Column(String(64), nullable=False)
last_name = Column(String(64), nullable=False)
username = Column(String(64), unique=True, nullable=False) |
<|file_name|>GameSystems_service_binding.cc<|end_file_name|><|fim▁begin|>// This file is part of SWGANH which is released under the MIT license.
// See file LICENSE or go to http://swganh.com/LICENSE
#include "swganh_core/gamesystems/gamesystems_service_binding.h"
BOOST_PYTHON_MODULE(py_gamesystems)<|fim▁hole|>{
... | |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|># Copyright 2012 Nebula, 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/LICEN... | |
<|file_name|>find_error.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Lexing error finder
~~~~~~~~~~~~~~~~~~~
For the source files given on the command line, display
the text where Error tokens are being generated, along
with some context.
:copyright: Copyright ... |
import sys, os
|
<|file_name|>user.rs<|end_file_name|><|fim▁begin|>use super::super::schema::user;
#[derive(Queryable, Deserialize, Serialize, Clone)]<|fim▁hole|> pub username: String,
pub email: String,
pub password: String,
}
#[derive(Insertable)]
#[table_name="user"]
pub struct NewUser<'a> {
pub username: &'a str,
pub em... | pub struct User {
pub id: i32, |
<|file_name|>cloudflare_dns.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function... | new_record = {
"type": params['type'],
"name": params['record'], |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from .models import Batch, Event, PreClaim, Claim, Department, Student
from django.contrib.admin.models import LogEntry
# Register your models here.
def js_approve(modeladmin, request, queryset):
queryset.update(js_approved = True... | |
<|file_name|>customisation.py<|end_file_name|><|fim▁begin|>import os
from django import template
from django.conf import settings
from django.utils.safestring import mark_safe
register = template.Library()
<|fim▁hole|> settings.MEDIA_ROOT,
"overrides.css"
)
if os.path.exists(theme_path):
... | @register.simple_tag()
def custom_css():
theme_path = os.path.join( |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import Y... | )
state = __builtin__.property(_get_state) |
<|file_name|>git.py<|end_file_name|><|fim▁begin|>import subprocess
import re
import os
from app import util
BLAME_NAME_REX = re.compile(r'\(([\w\s]+)\d{4}')
def git_path(path):
"""Returns the top-level git path."""
dir_ = path
if os.path.isfile(path):
dir_ = os.path.split(path)[0]
proc = sub... | all_files.update(out.splitlines())
|
<|file_name|>indexer3.ts<|end_file_name|><|fim▁begin|>var dateMap: { [x: string]: Date; } = {}
<|fim▁hole|>var r: Date = dateMap["hello"] // result type includes indexer using BCT<|fim▁end|> | |
<|file_name|>sysccapi.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package scc
import (
"errors"
"fmt"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/common/util"
"github.com/hyperledger/fabric/core/chaincode/... | Name string |
<|file_name|>discreteBarChart.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Examples for Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project locat... |
chart.buildhtml()
output_file.write(chart.htmlcontent) |
<|file_name|>Menu.java<|end_file_name|><|fim▁begin|>package ppp.menu;
import java.awt.image.BufferedImage;
public abstract interface Menu {
public abstract void up();<|fim▁hole|>}<|fim▁end|> | public abstract void down();
public abstract void enter();
public abstract void escape();
public abstract BufferedImage getImage(); |
<|file_name|>test_plugins.py<|end_file_name|><|fim▁begin|>import types
import unittest
from collections import namedtuple
import os
import sys
import tempfile
from zipfile import ZipFile, ZipInfo
from utils import jar_utils
sys.path.append('tests/unit/')
import mock
from plugins.systems.config_container_crawler impo... | @mock.patch('utils.file_utils.os.walk',
side_effect=mocked_os_walk)
@mock.patch('utils.file_utils.os.lstat', |
<|file_name|>PartListSection.tsx<|end_file_name|><|fim▁begin|>import React, { useMemo } from 'react';
import { cx, css } from '@emotion/css';
import { MenuItem, WithContextMenu, MenuGroup, useTheme2 } from '@grafana/ui';
import { SelectableValue, GrafanaTheme2 } from '@grafana/data';
import { Seg } from './Seg';
import... | <button className={cx('gf-form-label', noRightMarginPaddingClass)} onClick={openMenu}>
{name}
</button> |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007-2008
#
# Based on the original in EJS:
# Copyright (C) Andrew Tridgell <tridge@samba.org> 2005
#
# This program is free software; you can redistribute it a... | try:
__import__(modulename)
except ImportError:
import_bundled_package(modulename, location) |
<|file_name|>test_base_document.py<|end_file_name|><|fim▁begin|>import unittest
<|fim▁hole|>class TestBaseDocument(unittest.TestCase):
def test_docstatus(self):
doc = BaseDocument({"docstatus": 0})
self.assertTrue(doc.docstatus.is_draft())
self.assertEquals(doc.docstatus, 0)
doc.docstatus = 1
self.assertTru... | from frappe.model.base_document import BaseDocument
|
<|file_name|>webpack.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// tslint:disable
// TODO: cleanup this file, it's copied as is ... |
// Exports the webpack plugins we use internally.
export { BaseHrefWebpackPlugin } from '../lib/base-href-webpack/base-href-webpack-plugin';
export { CleanCssWebpackPlugin, CleanCssWebpackPluginOptions } from './cleancss-webpack-plugin'; |
<|file_name|>base_transform.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
API Issues to work out:
- MatrixTransform and STTransform both have 'scale' and 'translate'
... | function code.
Optionally, an inverse() method returns a new transform performing the |
<|file_name|>test_task.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
HDL Testing Platform
REST API for HDL TP # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagg... | |
<|file_name|>AuditLogModel.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2017-2019 Arrow Electronics, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Apache License 2.0
* which accompanies this distribution, and is available at
* http://apa... | * @param objectHid The objectHid
*/
public void setObjectHid(String objectHid) {
this.objectHid = objectHid; |
<|file_name|>parser.hpp<|end_file_name|><|fim▁begin|>#ifndef _PARSER_HPP
#define _PARSER_HPP
#include <cassert>
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include "toyobj.hpp"
#include "lexer.hpp"
#include "toy.hpp"
#include "ast.hpp"
class ParserContext {
public:
explicit Parse... | |
<|file_name|>border-base.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _postcss = require('postcss');
var _clone = require('../clone');
var _clone... | return cur + " " + prev;
}).trim();
if (value === '') {
value = defaults[0]; |
<|file_name|>setup_wizard.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, json, copy
from frappe.utils import cstr, flt, getdate
from frappe import _
fr... | "company": args.get("company_name").strip(),
"parent_account": tax_group, |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""
Generic relations
Generic relations let an object have a foreign key to any object through a
content-type/object-id field. A ``GenericForeignKey`` field can point to any
object, be it animal, vegetable, or mineral.
The canonical example is tags (although this ex... | |
<|file_name|>4986e64643f4_.py<|end_file_name|><|fim▁begin|>"""empty message
Revision ID: 4986e64643f4
Revises: 175003d01257
Create Date: 2015-04-15 12:16:41.965765
"""
# revision identifiers, used by Alembic.
revision = '4986e64643f4'<|fim▁hole|>down_revision = '175003d01257'
from alembic import op
import sqlalchem... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from psyrun.backend import DistributeBackend, LoadBalancingBackend
from psyrun.mapper import (<|fim▁hole|> map_pspace_hdd_backed)
from psyrun.pspace import Param
from psyrun.scheduler import ImmediateRun, Sqsub
from psyrun.store import DefaultStore, PickleStore
f... | map_pspace,
map_pspace_parallel, |
<|file_name|>TextToBinary.PipeStorage.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Google
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and/or associated documentation files (the
// "Materials"), to deal in the Materials without restriction, including
/... | EXPECT_THAT(
CompileFailure("OpTypePipeStorage", SPV_ENV_UNIVERSAL_1_1),
Eq("Expected <result-id> at the beginning of an instruction, found "
"'OpTypePipeStorage'.")); |
<|file_name|>python_tests.py<|end_file_name|><|fim▁begin|># ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache L... | class PythonTests(PythonTarget): |
<|file_name|>send_serial.rs<|end_file_name|><|fim▁begin|>use printspool_machine::components::ControllerConfig;
use super::*;
use crate::gcode_parser::parse_gcode;
pub fn send_serial(
effects: &mut Vec<Effect>,
gcode_line: GCodeLine,
context: &mut Context,
is_polling: bool,
) {
// Allow for a byte ... |
// eprintln!("TX: {:?}", gcode_line.gcode);
context.push_gcode_tx(gcode_line.gcode.clone(), is_polling); |
<|file_name|>bulkimport_users_common.py<|end_file_name|><|fim▁begin|>import re
from crispy_forms import layout
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from django.http import HttpResponseRedirect, Htt... | context['uses_email_auth_backend'] = settings.CRADMIN_LEGACY_USE_EMAIL_AUTH_BACKEND |
<|file_name|>pagtn.py<|end_file_name|><|fim▁begin|>"""
DGL-based PAGTN for graph property prediction.
"""
import torch.nn as nn
import torch.nn.functional as F
from deepchem.models.losses import Loss, L2Loss, SparseSoftmaxCrossEntropy
from deepchem.models.torch_models.torch_model import TorchModel
class Pagtn(nn.Mod... | Parameters |
<|file_name|>scripts-parse.py<|end_file_name|><|fim▁begin|>import sys
from unicode_parse_common import *
# http://www.unicode.org/Public/5.1.0/ucd/Scripts.txt
script_to_harfbuzz = {
# This is the list of HB_Script_* at the time of writing
'Common': 'HB_Script_Common',
'Greek': 'HB_Script_Greek',
'Cyrillic': '... | |
<|file_name|>test_bdist_pex.py<|end_file_name|><|fim▁begin|># Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import subprocess
import sys
from textwrap import dedent
from twitter.common.contextutil import pushd
from pex.testi... | setup( |
<|file_name|>nodes.rs<|end_file_name|><|fim▁begin|>// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use std::ops::Deref;
// self
use crate::geom::*;
use super::attri... | |
<|file_name|>opts.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/. */
//! Configuration options for a single run of the servo applicat... |
/// Whether we're running in multiprocess mode. |
<|file_name|>highlight_problems.py<|end_file_name|><|fim▁begin|>import sublime
import sublime_plugin
import json
from threading import Thread
from ..lib.ycmd_handler import server
from ..lib.utils import *
from ..lib.msgs import MsgTemplates
class CppYCMHighlightProblemsListener(sublime_plugin.EventListener):
d... | # from ..commands.highlight_problems import output_panel
# if output_panel and (view.id() == output_panel.id()): |
<|file_name|>fix_method_call_with_string_literal.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | fn f(s: String) -> String {
f(f(f("((")<caret>
} |
<|file_name|>CreateAliasResultJsonUnmarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of th... | if (context.testExpression("Alias", targetDepth)) { |
<|file_name|>issue-8153.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.
//<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except according to... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>resultsource0.rs<|end_file_name|><|fim▁begin|>fn double_number(number_str: &str) -> i32 {
// Essayons d'utiliser la méthode `unwrap` pour récupérer le nombre.
// Va-t-elle nous mordre ?
2 * number_str.parse::<i32>().unwrap()
}<|fim▁hole|>
fn main() {
let twenty = double_number("10");
pr... | |
<|file_name|>File_Wm_Elements.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
//++++++++++++++++++++++++++++++++++++++++++++++... | if (Data_Parse_Padding)
Skip_XX(Data_Parse_Padding, "Padding"); |
<|file_name|>pr-list.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>/// <reference path="./typings/app.d.ts" />
import {Component, View, ElementRef, bootstrap, FORM_DIRECTIVES} from 'angular2/angular2';
@Component({
selector: 'pr-list'
})
@View({
directives: [FORM_DIRECTIVES],
template: `
List of Pull... | |
<|file_name|>test_lazy.py<|end_file_name|><|fim▁begin|>import functools
import re
import pytest
from autoray import do, lazy, to_numpy, infer_backend, get_dtype_name, astype
from numpy.testing import assert_allclose
from .test_autoray import BACKENDS, gen_rand<|fim▁hole|>
def test_manual_construct():
def foo(a,... | |
<|file_name|>cogroup.rs<|end_file_name|><|fim▁begin|>//! Group records by a key, and apply a reduction function.
//!
//! The `group` operators act on data that can be viewed as pairs `(key, val)`. They group records
//! with the same key, and apply user supplied functions to the key and a list of values, which are
//! ... | result.set_difference(index.time(), accumulation);
}
}
} |
<|file_name|>VersionIndependentConcept.java<|end_file_name|><|fim▁begin|>package ca.uhn.fhir.jpa.term;
/*
* #%L
* HAPI FHIR JPA Server
* %%
* Copyright (C) 2014 - 2016 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complianc... | * limitations under the License.
* #L%
*/
|
<|file_name|>crawler_wikipedia.py<|end_file_name|><|fim▁begin|>#encoding=utf-8
#------------------------------------------------------------------
# File Name: crawler_wikipedia_v0.py
# Author: yy
# Mail: RNHisnothuman@gmail.com
# Date: 2014年02月12日 星期三 15时15分24秒
#----------------------------------------------------... | def get_content_by_api(self,apistr): |
<|file_name|>EditHistoryFilterTagsToExcludeActions.js<|end_file_name|><|fim▁begin|>import {
ADD_HISTORY_FILTER_EXCLUDE_TAG,<|fim▁hole|> DISMISS_HISTORY_FILTER_EXCLUDES_TAGS,
} from 'app/configs+constants/ActionTypes';
export const saveTags = (tags = []) => ({
type: SAVE_HISTORY_FILTER_EXCLUDES_TAGS,
tag... | REMOVE_HISTORY_FILTER_EXCLUDE_TAG,
SAVE_HISTORY_FILTER_EXCLUDES_TAGS, |
<|file_name|>IRC2LCD.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
#
# IRC2LCD
# Tim Ballas
#
"""IRC bot to display mentions on an LCD through a Parallax Propeller.
Usage: IRCbot2LCD.py <server[:port]> <channel> <nicknameToMonitor> <COMport> <optional bot nickname>
"""
#
# Modified from:
# Example program us... | import sys
if len(sys.argv) < 5:
print("Usage: IRCbot2LCD.py <server[:port]> <channel> <nicknameToMonitor> <COMport> <optional bot nickname>")
sys.exit(1) |
<|file_name|>test_unit_tilde.py<|end_file_name|><|fim▁begin|>import pytest
from conftest import assert_bash_exec
@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=")
class TestUnitTilde:
def test_1(self, bash):
assert_bash_exec(bash, "_tilde >/dev/null")
def test_2(self, bash):
"""Te... | """Test for https://bugs.debian.org/766163"""
assert_bash_exec(bash, "_tilde ~-o")
|
<|file_name|>test_wind_dir.py<|end_file_name|><|fim▁begin|># Simple example of reading the MCP3008 analog input channels and printing
import time
import sys
import numpy as np
# Import SPI library (for hardware SPI) and MCP3008 library.
import Adafruit_GPIO.SPI as SPI
import Adafruit_MCP3008
import RPi.GPIO as GPIO
i... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2013 Canonical
#
# Authors:
# Didier Roche<|fim▁hole|># Foundation; version 3.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ... | #
# 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 |
<|file_name|>setFilterParameters.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for ag-grid v3.3.3
// Project: http://www.ag-grid.com/
// Definitions by: Niall Crosby <https://github.com/ceolter/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
export interface SetFilterParameters {
/** Same a... | newRowsAction?: string;
/** If true, the filter will not remove items that are no longer availabe due to other filters. */
suppressRemoveEntries?: boolean;
/** Comparator for sorting. If not provided, the colDef comparator is used. If colDef also not provided, the default (agGrid provided) comparator is... |
<|file_name|>FileUtils.py<|end_file_name|><|fim▁begin|># -*- coding: iso-8859-1 -*-
#
# This file is part of GNU Enterprise.
#
# GNU Enterprise 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 ... | |
<|file_name|>ret-bang.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/licens... | fn okay(i: uint) -> int {
if i == 3u { my_err(~"I don't like three"); } else { return 42; }
}
|
<|file_name|>SASLOutputStream.java<|end_file_name|><|fim▁begin|>/*
* @(#)file SASLOutputStream.java
* @(#)author Sun Microsystems, Inc.
* @(#)version 1.10
* @(#)lastedit 07/03/08
* @(#)build @BUILD_TAG_PLACEHOLDER@
*
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (... | out.write(wrappedToken, 0, wrappedToken.length);
}
}
|
<|file_name|>TableDialog.js<|end_file_name|><|fim▁begin|>define(
({
insertTableTitle: "Insertar tabla",
modifyTableTitle: "Modificar tabla",
rows: "Filas:",
columns: "Columnas:",
align: "Alinear:",
cellPadding: "Relleno de celda:",
cellSpacing: "Espaciado de celda:",
tableWidth: "Ancho de tabla:",
backgroundCo... | |
<|file_name|>middleware.test.js<|end_file_name|><|fim▁begin|>import { LOCAL_STORAGE_REMOVE_ITEM, LOCAL_STORAGE_SET_ITEM } from './actionTypes'
import createMiddleware from './middleware'
describe('middleware', () => {
let removeItem
let setItem
let middleware
let next
let store
beforeEach(() => {<|fim▁hol... | removeItem = jest.fn()
setItem = jest.fn()
middleware = createMiddleware({ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::fs;
use std::path;
use std::io::Read;
use serialize::json;
use valico::json_schema;
fn visit_specs<F>(dir: &path::Path, cb: F) where F: Fn(&path::Path, json::Json) {
let contents = fs::read_dir(dir).ok().unwrap();
for entry in contents {
let pat... | let state = schema.validate(&data);
if state.is_valid() != valid { |
<|file_name|>cli.rs<|end_file_name|><|fim▁begin|>use clap::{App, AppSettings, Arg, SubCommand};
use std::path::Path;
pub fn app<'a, 'b>() -> App<'a, 'b> {
App::new("homers")
.version(crate_version!())
.author("Jacob Helwig <jacob@technosorcery.net>")
.about("Manage dotfiles in your home dir... | .arg(Arg::with_name("repository")
.help("The name of the repository to add the path to") |
<|file_name|>startPythonFromMsg.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import sys
from LAPS.MsgBus.Bus import Bus
# Create queue with a unique name<|fim▁hole|>
# insert message
# receive msg
# delete queue
if __name__ == "__main__":
# If invoked directly, parse command line arguments for logger in... | |
<|file_name|>alpha.py<|end_file_name|><|fim▁begin|>from interface.design.ui_screen import Ui_wnd_gifextract
from PyQt5 import QtWidgets
import sys
import listener
import config
import ffmpeg
import queue
import interface.menus.Frame_CreateGif
import interface.menus.Frame_ExtractFrames
import interface.menus.Frame_Queue... | |
<|file_name|>user-settings-mediator.js<|end_file_name|><|fim▁begin|>define([
'./user-settings'
], function (userSettings) {
var context;
var exposed = {
init: function(thisContext){
context = thisContext;
context.sandbox.on('settings.close', userSettings.close);
... | context.sandbox.emit('settings.close');
},
openUserSettings: function() {
context.sandbox.emit('settings.open'); |
<|file_name|>component.js<|end_file_name|><|fim▁begin|>import type { Config } from '../src/core/config'
import type VNode from '../src/core/vdom/vnode'
import type Watcher from '../src/core/observer/watcher'
declare interface Component {
// constructor information
static cid: number;
static options: Object;
//... | _n: (value: string) => number | string;
// empty vnode
_e: () => VNode; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
PostgreSQL Session API
======================
The Session classes wrap the Queries :py:class:`Session <queries.Session>` and
:py:class:`TornadoSession <queries.tornado_session.TornadoSession>` classes
providing environment variable based configuration.
Environm... |
session = sprockets.postgresql.Session('foo')
A :py:class:`queries.Session` object will be created that connects to Postgres |
<|file_name|>average_checkpoints.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import collections
import os
import re... | num = None |
<|file_name|>bootstrapslider.js<|end_file_name|><|fim▁begin|>jQuery('#bootstrapslider').carousel({<|fim▁hole|><|fim▁end|> | interval: bootstrapslider_script_vars.interval,
pause: bootstrapslider_script_vars.pause,
wrap: bootstrapslider_script_vars.wrap
}); |
<|file_name|>HttpConnectorFactoryTest.java<|end_file_name|><|fim▁begin|>package io.dropwizard.jetty;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.jetty9.InstrumentedConnectionFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.dropwizard.configuration.ResourceConfiguration... | }
if (server != null) {
server.stop(); |
<|file_name|>camelizeStyle.js<|end_file_name|><|fim▁begin|>import camelize from "./camelize";
const msPattern = /^-ms-/;
function camelizeStyle(string) {
return camelize(string.replace(msPattern, "ms-"));
}<|fim▁hole|><|fim▁end|> |
export default camelizeStyle; |
<|file_name|>keccak.py<|end_file_name|><|fim▁begin|># ===================================================================
#
# Copyright (c) 2015, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided tha... | |
<|file_name|>vbp-optim.py<|end_file_name|><|fim▁begin|>from vsvbp import container, solver
import argparse, sys, os, re
def parse(inputfile):
""" Parse a file using format from
Brandao et al. [Bin Packing and Related Problems: General Arc-flow Formulation with Graph Compression (2013)]
Format:
d (n... | else: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.