prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>active.rs<|end_file_name|><|fim▁begin|>//! List of the active feature gates.
use super::{to_nonzero, Feature, State};
use rustc_span::edition::Edition;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
macro_rules! set {
($field: ident) => {{
fn f(features: &mut Features, _: Span)... | /// Allows trait methods with arbitrary self types. |
<|file_name|>irc_parser.cpp<|end_file_name|><|fim▁begin|>/*
Ucieszony Chat Client
Copyright (C) 2013-2015 Paweł Ostrowski
This file is part of Ucieszony Chat Client.
Ucieszony Chat Client is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by... |
time(&time_g);
time_l = localtime(&time_g);
|
<|file_name|>cleanup-rvalue-temp-during-incomplete-alloc.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... | let mut y = Vec::new();
y.push(box Bickwick(do_it(get_bar(x).as_slice()))); |
<|file_name|>firebase.go<|end_file_name|><|fim▁begin|>/*
Package firego is a REST client for Firebase (https://firebase.com).
*/
package firego
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
_url "net/url"
"strings"
"sync"
"time"
)
// TimeoutDuration is the length of time any ... | client *http.Client
clientTimeout time.Duration
|
<|file_name|>poll.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Script for polling N64/GC SI bus devices
#
# This script uses the serial bridge and pool in loops
# for the buttons status.
#
# It currently supports N64 controllers, N64 mouses & GameCube controllers.
#
# --Jacques Gagnon <darthcloud@gmail.co... | MAGENTA='\x1b[1;95m' |
<|file_name|>NASHORN-105.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Pu... | |
<|file_name|>ValueFlowTransferFunctions.java<|end_file_name|><|fim▁begin|>package edu.wayne.ograph.analysis;
import java.util.Collections;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.jdt.core.dom.ASTNode;
import ... | value.getGamma().put(instr.getTarget(), actDomains);
if (actDomains.size() > 0) {
|
<|file_name|>region-object-lifetime-2.rs<|end_file_name|><|fim▁begin|>// Various tests related to testing how region inference works
// with respect to the object receivers.
trait Foo {
fn borrowed<'a>(&'a self) -> &'a ();
}<|fim▁hole|>
// Borrowed receiver but two distinct lifetimes, we get an error.
fn borrowed_... | |
<|file_name|>sencha_touch.js<|end_file_name|><|fim▁begin|>//= require sencha_touch/sencha-touch
//= require_directory ./sencha_touch/app
//= require_tree ./sencha_touch/app/models
//= require_tree ./sencha_touch/app/stores
//= require_tree ./sencha_touch/app/controllers
<|fim▁hole|><|fim▁end|> | //= require_tree ./sencha_touch/app/views |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from PenBlog.admin import article,category,link,other
__author__ = 'lihaoquan'
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# 文章
url(r'^$', article.show_articles),
url(r'^new-article/$', article.new),
url... | #!/usr/bin/env python
# -*- coding:utf-8 -*-
|
<|file_name|>test_ciplugininterface.py<|end_file_name|><|fim▁begin|>from PyObjCTools.TestSupport import *
from Quartz.QuartzCore import *
from Quartz import *
class TestCIPluginInterfaceHelper (NSObject):
def load_(self, h): return 1
class TestCIPlugInInterface (TestCase):
def testMethods(self):
self.... | main() |
<|file_name|>Game.java<|end_file_name|><|fim▁begin|>package com.recursivechaos.boredgames.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.data.annotation.Id;
/**
* Created by Andrew Bell 5/28/2015
* www.recursivechaos.com
* andrew@recursivechaos.com
* Licensed under MIT Lice... | public String getDescription() { |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from django.utils.translation import ugettex... | |
<|file_name|>issue-40085.rs<|end_file_name|><|fim▁begin|>// run-pass
use std::ops::Index;<|fim▁hole|> type Output = ();
fn index(&self, _: fn()) -> &() { &UNIT }
}
fn main() {
S.index(bar);
S[bar];
}<|fim▁end|> | fn bar() {}
static UNIT: () = ();
struct S;
impl Index<fn()> for S { |
<|file_name|>0009_auto_20190422_1627.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2 on 2019-04-22 16:27
from django.db import migrations
import model_utils.fields
class Migration(migrations.Migration):<|fim▁hole|> dependencies = [
('schedules', '0008_auto_20180208_1946'),
]
operations ... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
<|fim▁hole|>urlpatterns = [
url(r'^dodaj/(?P<dopuszczenie_id>[0-9]+)/$', ZadanieCreateView.as_view(), name='create'),
url(r'(?P<pk>[0-9]+)/detail/$', ZadanieDetailView.as_view(), name='detail'),
url(r'(?P<pk>[0-9]+)/update/$'... |
from .views import ZadanieCreateView, ZadanieDetailView, ZadanieUpdateView
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>"""
(c) Copyright 2014. All Rights Reserved.
qball module setup and package.
"""
from setuptools import setup
setup(
name='qball',
author='Matt Ferrante',
author_email='mferrante3@gmail.com',
description='Python integration for qball',
license='(... | setup_requires=['httplib2'],
version='1.1.0',
url="https://github.com/ferrants/qball-python", |
<|file_name|>rangyinputs-tests.ts<|end_file_name|><|fim▁begin|>let $obj: JQuery = $('meh');
let selection: RangyInputs.Selection = $obj.getSelection();
let start: number = selection.start;
let end: number = selection.end;
let len: number = selection.length;
let text: string = selection.text;<|fim▁hole|> .deleteText... | $obj = $obj.setSelection(selection.start)
.setSelection(selection.start, selection.end)
.collapseSelection()
.collapseSelection(true) |
<|file_name|>useDebugging.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { useEffect } from "react"
import RNAsyncStorageFlipper from "rn-async-storage-flipper"
export function useDebugging() {
useEffect(() => {
RNAsyncStorageFlipper(AsyncStorage)
}, [])
}<|fim▁end|> | import AsyncStorage from "@react-native-community/async-storage" |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.utils.html import format_html
from sorl.thumbnail import get_thumbnail
from sorl.thumbnail.fields import ImageField
from sno.models import Sno
class SnoGalleries(models.Model):<|fim▁hole|> class Meta:
verbose_name ... | |
<|file_name|>lazy-components.js<|end_file_name|><|fim▁begin|>!(function() {
'use strict';
function ComponentLoader($window, $q) {
var self = this;
this.basePath = '.';
this.queue = [ /*{path: '.', name: 'svg-viewer', scripts:['lazy.js'], run: function(){}}*/ ];
this.loaded = { /*'svg-viewe... | |
<|file_name|>c_l_stripePay.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* Stripe library
*
* @module core/lib/c_l_stripe
* @license MIT
* @copyright 2016 Chris Turnbull <https://github.com/christurnbull>
*/
module.exports = function(app, db, lib) {
return {
/**
* Donate
*/
donate: funct... | }
// save to database etc...
return cb(null, [charge]); |
<|file_name|>hark.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class HarkIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?hark\.com/clips/(?P<id>.+?)-.+'
_TEST = {
'url': 'http://www.hark.com/clips/mmbzyhkgny-obama-beyon... | 'duration': 11,
}
} |
<|file_name|>register_sireio.cpp<|end_file_name|><|fim▁begin|>/********************************************\
*
* Sire - Molecular Simulation Framework
*
* Copyright (C) 2008 Christopher Woods
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Gene... | * that should have come with this distribution.
*
* You can contact the authors via the developer's mailing list |
<|file_name|>app.e2e-spec.ts<|end_file_name|><|fim▁begin|>import { RecipiePlayerPage } from './app.po';
describe('recipie-player App', function() {<|fim▁hole|> page = new RecipiePlayerPage();
});
it('should display message saying app works', () => {
page.navigateTo();
expect(page.getParagraphText()).to... | let page: RecipiePlayerPage;
beforeEach(() => { |
<|file_name|>interfaces.ts<|end_file_name|><|fim▁begin|>export interface IFeatureResponse {
result: IFeature[];<|fim▁hole|>
export interface IFeature {
id: string;
openEstimate: number;
inProgressEstimate: number;
completeEstimate: number;
}<|fim▁end|> | lastUpdated: number;
} |
<|file_name|>pl.js<|end_file_name|><|fim▁begin|>OC.L10N.register(
"settings",
{
"Enabled" : "Włączone",
"Not enabled" : "Nie włączone",
"Wrong password" : "Złe hasło",
"Saved" : "Zapisano",
"No user supplied" : "Niedostarczony użytkownik",
"Unable to change password" : "Nie można zmienić... | "Last login" : "Ostatnio zalogowany",
"change full name" : "Zmień pełna nazwę",
"set new password" : "ustaw nowe hasło",
"change email address" : "zmień adres email", |
<|file_name|>simple.ts<|end_file_name|><|fim▁begin|>import { parse } from "../src/parsers";
import anArrayContaining from "../src/parsers/array";
import strings from "../src/parsers/string";<|fim▁hole|>// Run this example using `npm run example:simple`
// Try to alter the content of this array. Put booleans, numbers, ... | |
<|file_name|>register_pair.py<|end_file_name|><|fim▁begin|>class RegisterPair:
<|fim▁hole|> def __init__(self, name, register_high, register_low):
self.name = name
self.register_high = register_high
self.register_low = register_low<|fim▁end|> | |
<|file_name|>node.js<|end_file_name|><|fim▁begin|>// Copyright 2012 Google Inc. All Rights Reserved.
/**
* @fileoverview Node utilities.
*/
goog.provide('wgxpath.Node');
goog.require('goog.array');
goog.require('goog.dom.NodeType');
goog.require('goog.userAgent');
goog.require('wgxpath.IEAttrWrapper');
goog.requir... | var result = [];
var i = 0;
while (node = descendants[i++]) {
if (wgxpath.Node.attrMatches(node, attrName, attrValue)) { |
<|file_name|>mediascape.js<|end_file_name|><|fim▁begin|>//main javascript
(function init() {
// If we need to load requirejs before loading butter, make it so
if (typeof define === "undefined") {
var rscript = document.createElement("script");
rscript.onload = function () {
init();
... | jquery: 'lib/jquery-2.1.3.min',
namedwebsockets: 'lib/namedwebsockets', |
<|file_name|>wupload.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#------------------------------------------------------------
# seriesly - XBMC Plugin
# Conector para Wupload
# http://blog.tvalacarta.info/plugin-xbmc/seriesly/
#------------------------------------------------------------
import urlparse,u... | logger.info("data="+data)
patron = '<p class="fileInfo filename"><span>Filename: </span> <strong>([^<]+)</strong></p>'
matches = re.compile(patron,re.DOTALL).findall(data)
|
<|file_name|>account_analytic_line.py<|end_file_name|><|fim▁begin|>from odoo.osv import expression
from odoo.addons.sale_timesheet.models.account import AccountAnalyticLine
def _timesheet_get_portal_domain(self):
""" WE revert this functionality of odoo. We want to show details of ordered quantities also
... | AccountAnalyticLine._timesheet_get_portal_domain = _timesheet_get_portal_domain |
<|file_name|>julian_time.rs<|end_file_name|><|fim▁begin|>/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Andres Vahter (andres.vahter@gmail.com)
*
* 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 ... | i = (365.25 * year as f64).trunc();
i += (30.6001_f64 * 14.0_f64).trunc(); |
<|file_name|>WriterEvent.java<|end_file_name|><|fim▁begin|>package com.focusit.jitloganalyzer.tty.model;
/**
* Created by doki on 08.11.16.
* <writer thread='139821162608384'/>
*/
public class WriterEvent extends AbstractTTYEvent implements TTYEvent, HasThreadId
{
private final static String START_TOKEN = "<wri... | }
|
<|file_name|>model.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "model.h"
#include "node.h"
#include "../manager/resourcemanager.h"
#include "mesh.h"
#include "bonemgr.h"
using namespace graphic;
// Bone¸¶´Ù °æ°è¹Ú½º¸¦ »ý¼ºÇÑ´Ù.
struct sMinMax
{
Vector3 Min;
Vector3 Max;
sMinMax() : Min(Vector3(... | , m_isRenderMesh(true)
, m_isRenderBone(false)
{
|
<|file_name|>lookup.go<|end_file_name|><|fim▁begin|>package yaputil
import (
"io/ioutil"
"net"
"regexp"
)
var (<|fim▁hole|> return net.LookupIP(host)
}
func GetLocalNameServers() ([]string, error) {
b, err := ioutil.ReadFile("/etc/resolv.conf")
if err != nil {
return nil, err
}
nameservers := make([]string,... | nsRegex = regexp.MustCompile(`(?m)^nameserver\s+([0-9a-fA-F\.:]+)`)
)
func LookupIP(host string) (ips []net.IP, err error) { |
<|file_name|>issue-27362.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | // option. This file may not be copied, modified, or distributed |
<|file_name|>ProbeLogAggregator.py<|end_file_name|><|fim▁begin|>'''
Created on Feb 26, 2015
@author: Akshat
'''
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as mgrid
import ntpath
class PrbLogAgg:
'''
classdocs
'''
dataFrame = {}
csv = []
... | def path_leaf(self, path):
head, tail = ntpath.split(path)
return tail or ntpath.basename(head) |
<|file_name|>addFeature.ts<|end_file_name|><|fim▁begin|>/// <reference path="typings/tsd.d.ts"/><|fim▁hole|>
interface featureOption {
filters?: {};
style: {};
}
interface TopoJsonOption {
filters:string[];
object:string;
style: {
fillOpacity?: number;
strokeColor: string;
strokeWeight: number;
... | /// <reference path="AddFilter.ts"/>
/// <reference path="utils.ts"/> |
<|file_name|>inotify_tracker.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2013 ActiveState Software Inc. All rights reserved.
package watch<|fim▁hole|>
import (
"log"
"os"
"sync"
"syscall"
"github.com/hpcloud/tail/util"
"gopkg.in/fsnotify.v1"
)
type InotifyTracker struct {
mux sync.Mutex
watcher *fs... | |
<|file_name|>about.js<|end_file_name|><|fim▁begin|>'use strict';
describe('Controller: AboutCtrl', function () {
// load the controller's module
beforeEach(module('e01App'));
<|fim▁hole|> // Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope... | var AboutCtrl,
scope;
|
<|file_name|>classification.py<|end_file_name|><|fim▁begin|>#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the A... | |
<|file_name|>trainer_utils_test.py<|end_file_name|><|fim▁begin|># Copyright 2021, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | x = [[1.0], [2.0], [3.0]]
y = [[3.0], [5.0], [7.0]]
return tf.data.Dataset.from_tensor_slices((x, y)).batch(1) |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate gcc;
use std::env;
fn main() {
let mut config = gcc::Config::new();
config.include("nanovg/src");
config.include("nanovg/example");
config.file("nanovg/src/nanovg.c");
config.file("src/nanovg_shim.c");
for feature in &["GL2", "GL3... | } |
<|file_name|>test.py<|end_file_name|><|fim▁begin|># Copyright 2015, Oliver Nagy <olitheolix@gmail.com>
#
# This file is part of Azrael (https://github.com/olitheolix/azrael)
#
# Azrael is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by... | dae_file = base64.b64encode(dae_file).decode('utf8')
dae_rgb1 = base64.b64encode(dae_rgb1).decode('utf8') |
<|file_name|>options_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Uber Technologies, 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
// in the Software without restriction, including wi... | require.Equal(t, expected, full)
} |
<|file_name|>createRecoveryPlanInput.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 inco... | *
* @returns {object} metadata of CreateRecoveryPlanInput
*
*/ |
<|file_name|>mod.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/licens... | c
},
_ => None
} |
<|file_name|>get_access_token.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
__author__ = 'lxr0827'
import pymysql,requests,json
import datetime
#定时运行该脚本获取accesstoken,记录到accesstoken module里
#test
APPID = "wx243dd553e7ab9da7"
SECRET = "57f109fd1cce0913a76a1700f94c4e2d"
AccessTokenURL = 'https://api.weixin.qq.... | else:
result = cur.fetchone() |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';<|fim▁hole|>
import { jqxDropDownListComponent } from '../../../../../jqwidgets-ts/angular_jqxdropdownlist';
@NgModule({
imports: [BrowserModule],
declarations: [AppComponent, jqxDropDownListComponent],
b... | import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component'; |
<|file_name|>octree.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from math import *
octree_node_size = 112
def recurse(depth):
if depth == 0:
return 1
else:
return pow(8, depth) + recurse(depth - 1)
def octree_size(depth):
return recurse(depth) * octree_node_size
print("Size %d" % (octree_size(3)))<|fim▁end|> | |
<|file_name|>test_functional.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
from flask import url_for
from power_grid_helper.user.models import User
from .factories import UserFactory
class TestLoggingIn:
"""Login."""
def... | # Submits
res = form.submit().follow()
assert res.status_code == 200 |
<|file_name|>EventBindingTests.ts<|end_file_name|><|fim▁begin|>/// <reference path="tsUnit.ts" />
/// <reference path="MockExpression.ts" />
/// <reference path="../src/EventBinding.ts" />
module jsBind {
private fireEvent(elem: any): void {
if (document.createEventObject) {
// IE 9 & 10
... |
c.isTrue(expr.wasEvaluated);
} |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
log "github.com/Sirupsen/logrus"
"github.com/docker/infrakit/cli"
"github.com/docker/infrakit/discovery"
"github.com/docker/infrakit/spi/flavor"
flavor_client "github.com/docker/infrakit/spi/http/flavor"
flavor_plugin "github.com/docker/infr... | "os"
)
func main() { |
<|file_name|>db-test.ts<|end_file_name|><|fim▁begin|>import * as Promise from "bluebird";
import {expect} from "chai";
import {Entity} from "../../src/server/entity/entity";
import {PgJsonDb} from "../src/pgjson-db";
import {fixtures} from "./fixtures";
import {initDb} from "./init-db";
describe("pg json db", () => {
... | it("should find entity by content value", () => {
const matchingFixtureIds = ids.filter((id, i) => fixtures[i].data[0].a === 1);
return db.find(0) |
<|file_name|>0008_fix_name_indices.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.db import migrations, models
class Migration(migrations.Migration):
atomic = False
dependencies = [
('publishers', '0007_publisher_romeo_parent_id'),
]
operations = [
migrations.AlterField(
... | # Generated by Django 2.1.7 on 2019-05-12 16:08
|
<|file_name|>StageApp.py<|end_file_name|><|fim▁begin|>"""
@author: ArcGIS for Intelligence
@contact: defensesolutions@esri.com
@company: Esri
@version: 1.0
@description: Used to stage the apps for Movement Analysis
@requirements: Python 2.7.x, ArcGIS 10.3.1
@copyright: Esri, 2015
"""
import ... | pa.publishfromconfig(configFiles=configFiles,
combinedApp=None, |
<|file_name|>graphviz.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | use std::env; |
<|file_name|>prelude.rs<|end_file_name|><|fim▁begin|>pub(crate) use crate::bitset::{Iter as SetIter, Set};
pub(crate) use crate::helper::{CellArray, DigitArray, HouseArray, Unsolvable};
pub(crate) use crate::Sudoku;
#[rustfmt::skip]
pub(crate) use crate::board::{<|fim▁hole|> Candidate,
positions::{
Cell,... | Digit, |
<|file_name|>splitAt.d.ts<|end_file_name|><|fim▁begin|>import { List } from './$types';
export function $string(index: number, str: string): [string, string];
export function $list<T>(index: number, list: List<T>): [T[], T[]];<|fim▁hole|> list: string | List<T>,
): [string, string] | [T[], T[]];<|fim▁end|> | export function $mixed<T>(
index: number, |
<|file_name|>S8.4_A4.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**<|fim▁hole|> */
var __str = "";
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (__str... | * Empty string variable has a length property
*
* @path ch08/8.4/S8.4_A4.js
* @description Try read length property of empty string variable |
<|file_name|>32.d.ts<|end_file_name|><|fim▁begin|>import * as React from "react";<|fim▁hole|> CarbonIconProps & React.RefAttributes<SVGSVGElement>
>;
export default PlayOutlineFilled32;<|fim▁end|> | import { CarbonIconProps } from "../../";
declare const PlayOutlineFilled32: React.ForwardRefExoticComponent< |
<|file_name|>table_cell.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/. */
//! CSS table formatting contexts.
#![deny(unsafe_blocks)... |
impl Flow for TableCellFlow {
fn class(&self) -> FlowClass {
FlowClass::TableCell |
<|file_name|>Quaternionf.java<|end_file_name|><|fim▁begin|>package com.flowpowered.math.imaginary;
import java.io.Serializable;
import com.flowpowered.math.GenericMath;
import com.flowpowered.math.HashFunctions;
import com.flowpowered.math.TrigMath;
import com.flowpowered.math.matrix.Matrix3f;
import com.flowpowered.... | }
|
<|file_name|>pymsp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
author: Alex Apostoli
based on https://github.com/hkm95/python-multiwii
which is under GPLv3
"""
import struct
import time
import sys
import re
class MSPItem:
def __init__(self, name, fmt, field... | MSP_MOTOR: MSPItem('MOTOR', "8h", "motor"),
MSP_RC: MSPItem('RC', "8h", "rc"),
MSP_COMP_GPS: MSPItem('COMP_GPS', "HhB", "distanceToHome,directionToHome,update"),
|
<|file_name|>ENV.py<|end_file_name|><|fim▁begin|>""" environ settings """
import environ
BASE_DIR = environ.Path(__file__) - 4<|fim▁hole|><|fim▁end|> | ENV_VAR = environ.Env() |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import "github.com/evilwire/morokei/app"
func main() {
// create a new App
app, err := app.Setup()
if err != nil {
panic(err)
}
// run it forever<|fim▁hole|><|fim▁end|> | panic(app.Run())
} |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>package kube
import (
"fmt"
"github.com/box/kube-applier/sysutil"
"io/ioutil"
"log"
"os/exec"
"regexp"
"strconv"
"strings"
)
const (
// Default location of the service-account token on the cluster
tokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/... | schemaCacheDir string
}
|
<|file_name|>impl_kombu.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack 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 Lic... | # consumer is started after we do |
<|file_name|>clone_test.go<|end_file_name|><|fim▁begin|>// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2011 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are per... | "testing"
pb "./testdata"
"github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto" |
<|file_name|>OneColumnPerColor.java<|end_file_name|><|fim▁begin|>package org.gnubridge.presentation.gui;
import java.awt.Point;
import org.gnubridge.core.Card;
import org.gnubridge.core.Direction;
import org.gnubridge.core.East;
import org.gnubridge.core.Deal;
import org.gnubridge.core.Hand;
import org.gnubridge.core... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>export * from './trie';
export { TrieNode, FLAG_WORD, ChildMap, TrieRoot } from './TrieNode';
export * from './util';
export * from './walker';<|fim▁hole|>export * from './consolidate';
export { SuggestionResult, MaxCost, suggestionCollector, SuggestionCollector } from... | export * from './importExport';
export * from './TrieBuilder'; |
<|file_name|>TypeWrapperIsAssignableParameterizedTypeTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013, Unitils.org
*
* 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
*
*... | assertFalse(result);
}
|
<|file_name|>blueimp-gallery.js<|end_file_name|><|fim▁begin|>/*
* blueimp Gallery JS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Swipe implementation based on
* https://github.com/bradbirdsall/Swipe
*
* Licensed under the MIT license:
* https://opensour... | // Cancel the slideshow:
this.pause() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from . import cmis_backend<|fim▁hole|><|fim▁end|> | from . import ir_model_fields |
<|file_name|>0001_squashed_0004_auto_20160413_1312.py<|end_file_name|><|fim▁begin|># Generated by Django 2.0.13 on 2020-01-04 17:21
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import modoboa.limits.models
class Migration(migrations.Migration):
repl... | ),
migrations.CreateModel(
name='DomainObjectLimit', |
<|file_name|>queryprovider.go<|end_file_name|><|fim▁begin|>// Code generated by counterfeiter. DO NOT EDIT.
package mocks
import (
"sync"
"github.com/hyperledger/fabric-protos-go/peer"
)
type QueryProvider struct {
TransactionStatusStub func(string, string) (peer.TxValidationCode, uint64, error)
transacti... | |
<|file_name|>properties.rs<|end_file_name|><|fim▁begin|>extern crate dbus;
<|fim▁hole|> // in this case we'll use OrgFreedesktopDBusProperties, which allows us to call "get".
let c = Connection::get_private(BusType::Session).unwrap();
let p = c.with_path("org.mpris.MediaPlayer2.rhythmbox", "/org/mpris/MediaP... | use dbus::{Connection, BusType, stdintf};
fn main() {
// Connect to server and create a ConnPath. A ConnPath implements several interfaces, |
<|file_name|>print_operation_preview.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use PageSetup;
use PrintContext;
use ffi;
use glib;
use glib::object::Downcast;
use glib::object::IsA;
use glib::... | use std::ptr; |
<|file_name|>notifications.py<|end_file_name|><|fim▁begin|>from code_intelligence import graphql
import fire
import github3
import json
import logging
import os
import numpy as np
import pprint
import retrying
import json
TOKEN_NAME_PREFERENCE = ["INPUT_GITHUB_PERSONAL_ACCESS_TOKEN", "GITHUB_PERSONAL_ACCESS_TOKEN", "G... | edges {{
node {{ |
<|file_name|>issue-55587.rs<|end_file_name|><|fim▁begin|>use std::path::Path;
fn main() {<|fim▁hole|>}<|fim▁end|> | let Path::new(); //~ ERROR expected tuple struct or tuple variant |
<|file_name|>protobuf.rs<|end_file_name|><|fim▁begin|>/// The protocol compiler can output a FileDescriptorSet containing the .proto
/// files it parses.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FileDescriptorSet {
#[prost(message, repeated, tag="1")]
pub file: ::prost::alloc::vec::Vec<FileDescr... | |
<|file_name|>lec_func.py<|end_file_name|><|fim▁begin|>"""
The MIT License (MIT)
Copyright (c)2013 Rich Friedel
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 restriction, including witho... | |
<|file_name|>ContactGroup.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
import * as helper from '../core/Helper';
import * as validator from '../core/Validator';
export class ContactGroup extends helper.Helper {
createUrl(options?:any, id?:string) {
return '/account/~/extension/~/address-book/group' + (id ... | /// <reference path="../externals.d.ts" /> |
<|file_name|>progressbarConfig.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
@Injectable()
export class ProgressbarConfig {<|fim▁hole|> public max: number = 100;
}<|fim▁end|> | /** if `true` changing value of progress bar will be animated (note: not supported by Bootstrap 4) */
public animate: Boolean = true;
/** maximum total value of progress element */ |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.utils = exports.default = void 0;
var reducers = _interopRequireWildcard(require("./reducers"));
var _utils = _interopRequireWildcard(require("./utils"));
exports.utils = _utils;... | |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals, print_function
import os
import sys
import subprocess
import json
from ape import feaquencer
from ape import tasks
from .exceptions import ContainerError, ContainerNotFound, ProductNotFound
class Config(object):
APE_ROOT ... | product_name = os.environ.get('PRODUCT_NAME')
return container_dir, product_name
|
<|file_name|>ThreadNameAttribute.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in... | @Override |
<|file_name|>serializer.py<|end_file_name|><|fim▁begin|># ext/serializer.py
# Copyright (C) 2005-2019 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Serializer/Deserializer... | cls = pickle.loads(b64decode(clsarg)) |
<|file_name|>setup.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<|fim▁hole|># a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
<|file_name|>ref.rs<|end_file_name|><|fim▁begin|>#[derive(Clone, Copy)]
struct Point { x: i32, y: i32 }
fn main() {
let c = 'Q';
// A `ref` borrow on the left side of an assignment is equivalent to
// an `&` borrow on the right side.
let ref ref_c1 = c;
let ref_c2 = &c;
println!("ref_c1 equal... | {
// Destructure `mutable_ tuple` to change the value of `last`.
let (_, ref mut last) = mutable_tuple;
*last = 2u32; |
<|file_name|>test_editor.py<|end_file_name|><|fim▁begin|>def test_basic_editor(scratch_tree):
sess = scratch_tree.edit('/')
assert sess.id == ''
assert sess.path == '/'
assert sess.record is not None
<|fim▁hole|> assert sess['title'] == 'Index'
assert sess['body'] == 'Hello World!'
sess['bo... | assert sess['_model'] == 'page' |
<|file_name|>methods.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 data_loader::decode;
use fetch::cors_cache::{BasicCORSCac... | response
} else {
request.response_tainting.set(ResponseTainting::CORSTainting); |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"net"
"io"
"github.com/shellus/pkg/logs"
"context"
"github.com/gamexg/proxyclient"
"flag"
)
type Tunnel struct {
conn net.Conn
kcp net.Conn
}
var (<|fim▁hole|> socksAddr string
listenAddr string
linkAddr string
)
func main() {
flag.S... | |
<|file_name|>DeviceTreeCompiler.java<|end_file_name|><|fim▁begin|>package io.silverspoon.bulldog.beagleboneblack.devicetree;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
public class DeviceTreeCompiler {
<|fim▁hole|>
public static void compileOverlay... | private static final String FIRMWARE_PATH = "/lib/firmware/";
private static final String OBJECT_FILE_PATTERN = "%s%s.dtbo";
private static final String DEFINITION_FILE_PATTERN = "%s%s.dts";
private static final String COMPILER_CALL = "dtc -O dtb -o %s -b 0 -@ %s"; |
<|file_name|>ModDavSvnProxyServlet2.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2006, 2007 ThoughtWorks, Inc.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice app... | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
<|file_name|>client_proxy.cpp<|end_file_name|><|fim▁begin|>/* BEGIN_COMMON_COPYRIGHT_HEADER
* (c)LGPL2+
*
* LXQt - a lightweight, Qt based, desktop toolset
* https://lxqt.org
*
* Copyright: 2013 Razor team
* Authors:
* Kuzma Shapran <kuzma.shapran@gmail.com>
*
* This program or library is free software; you... | |
<|file_name|>shapeset_l2_legendre.cpp<|end_file_name|><|fim▁begin|>// This file is part of Hermes2D.
//
// Hermes2D 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 2 of the License, or
// (at ... | |
<|file_name|>Zested.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from zested.main import main
<|fim▁hole|><|fim▁end|> | if __name__ == "__main__":
main() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.