prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>EqualsOperator.java<|end_file_name|><|fim▁begin|>package br.net.ubre.lang.keyword.binary.relational;
import br.net.ubre.data.container.DataContainer;
import br.net.ubre.lang.data.literal.FalseStatement;
import br.net.ubre.lang.data.literal.TrueStatement;
import br.net.ubre.lang.statement.Statement;
/**
... | |
<|file_name|>module_common.py<|end_file_name|><|fim▁begin|># (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015 Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lic... | # Create the module zip data
zipoutput = BytesIO()
zf = zipfile.ZipFile(zipoutput, mode='w', compression=compression_method) |
<|file_name|>inject.py<|end_file_name|><|fim▁begin|>#First parameter is path for binary file containing instructions to be injected
#Second parameter is Process Identifier for process to be injected to
import binascii
import sys
from ctypes import *
if len(sys.argv) < 3:
print("usage inject.py <shellcodefile.bin> <... | sys.exit(1)
|
<|file_name|>media-preview-test.js<|end_file_name|><|fim▁begin|>import { mediaPreview } from 'mtt-blog/helpers/media-preview';<|fim▁hole|>module('Unit | Helper | media preview');
// Replace this with your real tests.
test('it works', function(assert) {
let result = mediaPreview([42]);
assert.ok(result);
});<|fim▁e... | import { module, test } from 'qunit';
|
<|file_name|>__init__.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 Apache... |
config = CsConfig()
|
<|file_name|>CXPassphraseBuilder.java<|end_file_name|><|fim▁begin|>package org.cohorte.utilities.security;
/**
* @author ogattaz
*
*/
public class CXPassphraseBuilder {
/**
* @param aValue
* @return
* @throws InstantiationException
* @throws CXPassphraseSchemeException
*/
public static IXPassphrase bui... | }
/** |
<|file_name|>traveling_salesman_problem.rs<|end_file_name|><|fim▁begin|>use graph::Graph;
use adjacency_matrix::AdjacencyMatrix;
pub fn traveling_salesman_problem(g: &Graph) -> Vec<usize> {
if g.vertex_count == 0 {
return vec![];
}
let m = AdjacencyMatrix::from_graph(&g);
optimize_tour(&constru... | |
<|file_name|>dangi.js<|end_file_name|><|fim▁begin|>define(
//begin v1.x content
{
"field-quarter-short-relative+0": "detta kv.",
"field-quarter-short-relative+1": "nästa kv.",
"field-tue-relative+-1": "tisdag förra veckan",
"field-year": "år",
"field-wed-relative+0": "onsdag denna vecka",
"field-wed-relative+1": ... | "field-minute-short-relative+0": "denna minut",
"field-quarter-relative+0": "detta kvartal", |
<|file_name|>iam.py<|end_file_name|><|fim▁begin|># Copyright 2020 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.0
#
# Unless requ... | For all allowed roles and permissions, see:
https://cloud.google.com/bigquery/docs/access-control |
<|file_name|>vmware_vmkernel_facts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# 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... | hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}' |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
re... | |
<|file_name|>flac_to_mp3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import sys
import os<|fim▁hole|>
import path_utils
import generic_run
def puaq():
print("Usage: %s input_file.flac" % path_utils.basename_filtered(__file__))
sys.exit(1)
def convert_flac_to_mp3(input_file, output_file, bitrate):
... | |
<|file_name|>EncryptionIdentity.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.datalakestore.models;
import com.azure.core.annotation.Fluent;... | |
<|file_name|>TestHelper.java<|end_file_name|><|fim▁begin|>package de.v13dev.designpatterns.util;
import java.util.List;
/**
* Created by stebo on 22.03.17.
*/
public class TestHelper {
public static boolean isSortedAscending(List<Integer> list) {
if(list.size() < 2) return true;
for(int i = 1;... | |
<|file_name|>appadmin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# ##########################################################
# ## make sure administrator is on localhost
# ###########################################################
import os
import socket
import datetime
import copy
import gluon.content... | nrows=nrows,
rows=rows,
query=request.vars.query,
) |
<|file_name|>heapsize.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "heapsize_impl")]
extern crate heapsize;
extern crate linked_hash_map;
use linked_hash_map::LinkedHashMap;
use heapsize::HeapSizeOf;
#[test]
fn empty() {
assert_eq!(LinkedHashMap::<String, String>::new().heap_size_of_children(), 0);
}
#[test... | map.insert("bonjour".to_string(), "monde".to_string()); |
<|file_name|>build_record_set_singleton.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | """
return self._content
@content.setter |
<|file_name|>events_test.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2014 The Syncthing Authors.
//
// 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/.
package even... | |
<|file_name|>test_django.py<|end_file_name|><|fim▁begin|>import datetime
import decimal
from django.test import TestCase
from django.core.cache import cache
from httmock import HTTMock
from django_dynamic_fixture import G, N
from postnl_checkout.contrib.django_postnl_checkout.models import Order
from .base import ... | }
instance = G(
Order, |
<|file_name|>EntityGiantPet.java<|end_file_name|><|fim▁begin|>/*
* This file is part of EchoPet.
*
* EchoPet is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your... | public SizeCategory getSizeCategory(){
return SizeCategory.OVERSIZE; |
<|file_name|>plugin_typescript.go<|end_file_name|><|fim▁begin|>package main
import (
"errors"
"github.com/JoshStrobl/trunk"
"github.com/stroblindustries/coreutils"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
)
// TypeScriptPlugin is our TypeScript plugin
type TypeScriptPlugin struct {
}
// SimpleType... | return nil
} |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Customize django settings:
DEBUG = True
INSTALLED_APPS = (
'django_translate',
'example_basic.translate'
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'djan... | ]
WSGI_APPLICATION = 'example_basic.wsgi.application' |
<|file_name|>DTEND.js<|end_file_name|><|fim▁begin|>import propertyTest from '../../helpers/propertyTest'
propertyTest('DTEND', {
transformableValue: new Date('1991-03-07 09:00:00'),<|fim▁hole|><|fim▁end|> | transformedValue: '19910307T090000'
}) |
<|file_name|>text.py<|end_file_name|><|fim▁begin|>"""
Generic interchange document structures.
"""
STYLE_TYPE_INT = 'int'
STYLE_TYPE_FLOAT = 'float'
STYLE_TYPE_CDATA = 'cdata'
STYLE_TYPE_BOOLEAN = 'boolean'
STYLE_TYPES = (
STYLE_TYPE_INT,
STYLE_TYPE_FLOAT,
STYLE_TYPE_CDATA,
STYLE_TYPE_BOOLEAN
)
clas... | class SeparatorLine(Div):
"""A single line separating parts of a chapter."""
def __init__(self): |
<|file_name|>oauth_test.go<|end_file_name|><|fim▁begin|>package legacy
import (
"testing"
"k8s.io/apimachinery/pkg/runtime"
"github.com/openshift/origin/pkg/api/apihelpers/apitesting"
oauthapi "github.com/openshift/origin/pkg/oauth/apis/oauth"
)
func TestOAuthFieldSelectorConversions(t *testing.T) {
install :=... | return nil
} |
<|file_name|>context_processors.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.forms import AuthenticationForm
from django.core.urlresolvers import reverse
from actstream.models import user_stream
from dnstorm.app import DNSTORM_URL
from dnstorm.app.utils import get_option
from dnstorm.app.models import Pro... | context['login_url'] = reverse('login') + '?next=' + request.build_absolute_uri() if 'next' not in request.GET else ''
context['logout_url'] = reverse('logout') + '?next=' + request.build_absolute_uri() if 'next' not in request.GET else ''
|
<|file_name|>test_shuffle.py<|end_file_name|><|fim▁begin|>import dask.dataframe as dd
import pandas.util.testing as tm
import pandas as pd
from dask.dataframe.shuffle import shuffle
import partd
from dask.async import get_sync
dsk = {('x', 0): pd.DataFrame({'a': [1, 2, 3], 'b': [1, 4, 7]},
... | assert not (set(x.b) & set(y.b)) # disjoint
assert shuffle(d, d.b, npartitions=2)._name == shuffle(d, d.b, npartitions=2)._name
|
<|file_name|>unit_association.py<|end_file_name|><|fim▁begin|>"""
Contains the manager class and exceptions for handling the mappings between
repositories and content units.
"""
from gettext import gettext as _
import logging
import sys
from celery import task
import pymongo
from pulp.plugins.conduits.unit_import imp... | similar_exists = RepoUnitAssociationManager.association_exists(repo_id, unit_id,
unit_type_id)
# Create the database entry |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate lexer;
use lexer::{Item, StateFn, Lexer};
#[derive(Debug, PartialEq)]
pub enum ItemType {
Comma,
Text,
Comment,
EOF
}
fn lex_text(l: &mut Lexer<ItemType>) -> Option<StateFn<ItemType>> {
loop {
if l.remaining_input().starts_wit... | l.next();
return Some(StateFn(lex_comment)); |
<|file_name|>SynchroDomainScheduler.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2000 - 2011 Silverpeas
*<|fim▁hole|> *
* As a special exception to the terms and conditions of version 3.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* Open Source Software ("FLOSS") applica... | * This program 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, either version 3 of the
* License, or (at your option) any later version. |
<|file_name|>AbstractETApiService.java<|end_file_name|><|fim▁begin|>package com.iservport.et.service;
import java.nio.charset.Charset;
import org.apache.commons.codec.binary.Base64;
import org.springframework.http.HttpHeaders;
import org.springframework.web.util.UriComponentsBuilder;
/**
<|fim▁hole|> * Base ... | |
<|file_name|>DensifyGeometriesInterval.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
DensifyGeometriesInterval.py by Anita Graser, Dec 2012
based on DensifyGeometries.py
---------------------
Date ... | return self.tr('Densify geometries given an interval')
def outputName(self):
return self.tr('Densified') |
<|file_name|>GlobalSearch.js<|end_file_name|><|fim▁begin|>import React, { Component, PropTypes } from 'react'
import { Search, Grid } from 'semantic-ui-react'
import { browserHistory } from 'react-router'
import Tag from './Tag'
import { search, setQuery, clearSearch } from '../actions/entities'
import { MIN_CHARACTER... | )
})
const { dispatch } = this.props
dispatch(setQuery(value)) |
<|file_name|>dfs_solution.py<|end_file_name|><|fim▁begin|>import sys
n, m = map(int, raw_input().strip().split())
v1, v2 = map(int, raw_input().strip().split())
x, y = map(int, raw_input().strip().split())
route_map = {}
distance_map = {}
def get_edge_name(x, y):
if x > y:
x, y = y, x
return str(x) + '_... | if edge_name not in distance_map: |
<|file_name|>task_arc_wake.rs<|end_file_name|><|fim▁begin|>use futures::task::{self, ArcWake, Waker};
use std::panic;
use std::sync::{Arc, Mutex};
struct CountingWaker {
nr_wake: Mutex<i32>,
}
impl CountingWaker {
fn new() -> Self {
Self { nr_wake: Mutex::new(0) }
}
fn wakes(&self) -> i32 {
... | fn wake_by_ref(_arc_self: &Arc<Self>) {
panic!("WAKE UP"); |
<|file_name|>jinja_filters.py<|end_file_name|><|fim▁begin|>import re
from jinja2 import Markup, escape, evalcontextfilter<|fim▁hole|>
@app.template_filter('nl2br')
@evalcontextfilter
def nl2br(eval_ctx, value):
result = u'\n\n'.join(u'<p>%s</p>' % p.replace('\n', '<br>\n')
for p in _paragr... | from app import app
_paragraph_re = re.compile(r'(?:\r\n|\r|\n){2,}')
|
<|file_name|>IQsMetadataManager.java<|end_file_name|><|fim▁begin|>package queue;
/**
* Queue server metadata manager.
*
* @author Thanh Nguyen <btnguyen2k@gmail.com>
* @since 0.1.0
*/<|fim▁hole|><|fim▁end|> | public interface IQsMetadataManager {
} |
<|file_name|>test_rank.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy.testing import assert_equal, assert_array_equal
from scipy.stats import rankdata, tiecorrect
class TestTieCorrect(object):
def test_empty(self):
"""An empty array requires no correction, should return 1.0."""
ra... | n = a.size # ntie * k
out = tiecorrect(rankdata(a)) |
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>/*
Copyright 2017 Takashi Ogura
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
Unles... | |
<|file_name|>po_generic_page.py<|end_file_name|><|fim▁begin|>from hubcheck.pageobjects.basepageobject import BasePageObject
from hubcheck.pageobjects.basepageelement import Link
from selenium.common.exceptions import NoSuchElementException
class GenericPage(BasePageObject):
"""Generic Page with just a header and f... |
def goto_profile(self): |
<|file_name|>cancel-clean-via-immediate-rvalue-ref.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
//... | // except according to those terms.
|
<|file_name|>list-header.ts<|end_file_name|><|fim▁begin|>import { Attribute, Directive, ElementRef, Renderer } from '@angular/core';
import { Config } from '../../config/config';
import { Ion } from '../ion';
/**
* @hidden
*/
@Directive({
selector: 'ion-list-header'
})
export class ListHeader extends Ion {
con... | set id(val: string) {
this._id = val;
this.setElementAttribute('id', val);
} |
<|file_name|>autorestart.go<|end_file_name|><|fim▁begin|>package autorestart
import (
"log"
"os"
"os/exec"
"os/signal"
"path/filepath"
"syscall"
"time"
"github.com/tillberg/watcher"
)
func logf(format string, args ...interface{}) {
log.Printf("[autorestart] "+format+"\n", args...)
}
<|fim▁hole|>
func getExe... | const errorPath = "*error*"
var _exePath = errorPath |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate xml;
use std::ffi::{CStr, CString};
use std::path::{Path, PathBuf};
use xml::{Event, Parser};
use ::libvirt::*;
use ::util::errors::*;
use ::util::ipv4::IPv4;
use ::virt::conn::Conn;
use ::virt::storage::volume::Volume;
use ::virt::network::Network;
pub mod... | |
<|file_name|>SettingsBluetoothRounded.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});<|fim▁hole|>exports.default = void 0;
var _createSvgIcon = _interopRequireDefault(r... | |
<|file_name|>tmdb.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import copy
import re
import sqlite3
import time, urllib
from core import filetools
from core import httptools
from core import jsontools
from core import scrapertools
from core.item import InfoLabels
from platformcode import config... | return info_nfo
|
<|file_name|>inline.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/licenses... | }
} |
<|file_name|>test_cp_mgmt_service_icmp.py<|end_file_name|><|fim▁begin|># Ansible module to manage CheckPoint Firewall (c) 2019
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | |
<|file_name|>radio8x2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Raspberry Pi Internet Radio
# using an HD44780 LCD display
# $Id: radio8x2.py,v 1.7 2017/07/31 07:44:26 bob Exp $
#
# Author : Bob Rathbone
# Site : http://www.bobrathbone.com
#
# This program uses Music Player Daemon 'mpd'and it's clie... |
if len(ipaddr) < 1: |
<|file_name|>NotificationIcon.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { INotificationIconProps, DefaultIconNumberStyleObject, NotificationBubbleStyleObject} from './NotificationIcon.Props';
import { Icon } from '../Icon/Icon';
import * as classNames from 'classnames';
import './Notificat... | |
<|file_name|>XSConsoleConfig.py<|end_file_name|><|fim▁begin|># Copyright (c) 2007-2009 Citrix Systems Inc.
#
# 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; version 2 only.
#
# This program is d... | |
<|file_name|>35-search_insert_position.py<|end_file_name|><|fim▁begin|># 二分查找,这题应该归为 easy
class Solution(object):
def searchInsert(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
end_index = len(nums)-1
start_index = 0
... | if nums[index] == target: |
<|file_name|>parse-content.js<|end_file_name|><|fim▁begin|>var fs = require('fs'),
eol = require('eol'),
path = require('path'),
mkdirp = require('mkdirp'),
watch = require('watch');
var specialFiles = {
'welcome.md': function(fileContent, consoleContent) {
consoleContent.welcome = processF... | if (config.writeable && config.writeable.indexOf(file.base) !== -1) {
file.writeable = true; |
<|file_name|>processBinFiles.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import os, subprocess
amsDecode = "/usr/local/bin/amsDecode"
path = "/usr/local/bin"
specDataFile = "specData.csv"
f = open("processFile.log", "w")
if os.path.exists(specDataFile):
os.remove(specDataFile)
for fileName in os.listdir('.... |
subprocess.call(cmnd,stdout=f)
f.close |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2014 Dell, 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/LICENSE-2.0
#
# Un... | _g_message_id_count = 0 |
<|file_name|>StringLiteral.java<|end_file_name|><|fim▁begin|>package org.bimserver.database.query.literals;
/******************************************************************************
* Copyright (C) 2009-2019 BIMserver.org<|fim▁hole|> * License, or (at your option) any later version.
*
* This program is dist... | *
* This program 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, either version 3 of the |
<|file_name|>api_metadata.rs<|end_file_name|><|fim▁begin|>//! Details of the `metadata` section of the procedural macro.
use quote::ToTokens;
use syn::{
braced,
parse::{Parse, ParseStream},
Ident, LitBool, LitStr, Token,
};
use super::{auth_scheme::AuthScheme, util, version::MatrixVersionLiteral};
mod kw... | }
impl ToTokens for EndpointPath { |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
**constants.py**
**Platform:**
Windows, Linux, Mac Os X.
**Description:**
Defines **Foundations** package default constants through the :class:`Constants` class.
**Others:**
"""
from __future__ import ... | :param minor_version: Package minor version.
:type minor_version: unicode
"""
change_version = "0" |
<|file_name|>insert_destination_data.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from main.management.commands._private import SharedCommand
from main.models import Destination
class Command(SharedCommand):
model = Destination<|fim▁end|> | |
<|file_name|>search.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# This file is part of the Lampadas Documentation System.
#
# Copyright (c) 2000, 2001, 2002 David Merrill <david@lupercalia.net>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | |
<|file_name|>AutoNumberGenerator.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Alexander Severgin
*
* 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/... | valueVault.storeValue(new IntegerDataWrapper() {
@Override
public Double getNumberValue() { |
<|file_name|>IGraphPathFinder.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2010-2013, Abel Hegedus, Istvan Rath and Daniel Varro
* This program and the accompanying materials are made available under the
* terms of the Eclipse Publ... | |
<|file_name|>IChoice.ts<|end_file_name|><|fim▁begin|>export interface IChoice {
id: string;
foundAt: number;
desc: string;
choices: string[];
defaultChoice: string;
event: string;<|fim▁hole|> extraData?: any;
init(opts: PartialChoice);
}
export type PartialChoice = {
[P in keyof IChoice]?: IChoice[... | |
<|file_name|>ByteArrayImpl.java<|end_file_name|><|fim▁begin|>/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package net.sf.mmm.util.io.base;
import net.sf.mmm.util.exception.api.NlsNullPointerException;
/**
* This class is simil... | |
<|file_name|>macro-stack.js<|end_file_name|><|fim▁begin|>'use strict'
import Macro from './macro.js'<|fim▁hole|>export default class MacroStack {
/**
* コンストラクタ
*/
constructor () {
/**
* [*store manual] スタックの中身
* @private
* @type {Array}
*/
this.stack = []
}
/**
* スタックへ積む
... |
/**
* マクロスタック
*/ |
<|file_name|>NITFBufferList.cpp<|end_file_name|><|fim▁begin|>/* =========================================================================
* This file is part of NITRO
* =========================================================================
*
* (C) Copyright 2004 - 2017, MDA Information Systems LLC
*
* NI... | numBytesCopied += numBytesLeftInBuffer;
|
<|file_name|>Toast.js<|end_file_name|><|fim▁begin|>import React from 'react'
import styles from './Toast.scss'
export default ({ className, message, show }) => (
<div
className={[
styles.container,
'animated',
'fadeIn',
].concat(className).join(' ')}
style={{ display: show ? 'block' : ... | </div>
) |
<|file_name|>get.js<|end_file_name|><|fim▁begin|>var params = {
title: 'Hello Dynamic :-)',
resourcesPath: portal.url.createResourceUrl('')
};
var body = system.thymeleaf.render('view/page.html', params);<|fim▁hole|>portal.response.body = body;<|fim▁end|> |
portal.response.contentType = 'text/html'; |
<|file_name|>issue-35668.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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... | }
fn main() {
let a = (0..30).collect::<Vec<_>>(); |
<|file_name|>nurturing.py<|end_file_name|><|fim▁begin|>from base import BaseClient
NURTURING_API_VERSION = '1'
class NurturingClient(BaseClient):
def _get_path(self, subpath):
return 'nurture/v%s/%s' % (NURTURING_API_VERSION, subpath)
def get_campaigns(self, **options):
return self._ca... | return self._call('lead/%s' % lead_guid, **options)
def enroll_lead(self, campaign_guid, lead_guid, **options):
return self._call('campaign/%s/add' % campaign_guid, data=lead_guid, method='POST', **options) |
<|file_name|>ExecutionView.js<|end_file_name|><|fim▁begin|>Ext.define('Redwood.view.ExecutionView', {
extend: 'Ext.panel.Panel',
alias: 'widget.executionview',
overflowY: 'auto',
bodyPadding: 5,
dataRecord: null,
dirty: false,
loadingData: true,
viewType: "Execution",<|fim▁hole|>
ini... | noteChanged: false,
tcDataRefreshed: false, |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-15 18:42
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
... | |
<|file_name|>mount.rs<|end_file_name|><|fim▁begin|>use libc::{c_ulong, c_int};
use libc;
use {Result, NixPath};
use errno::Errno;
libc_bitflags!(
pub struct MsFlags: c_ulong {
/// Mount read-only<|fim▁hole|> MS_NOSUID;
/// Disallow access to device special files
MS_NODEV;
///... | MS_RDONLY;
/// Ignore suid and sgid bits |
<|file_name|>GeneratorAdderImpl.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
* 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,... | |
<|file_name|>negative_numbers.rs<|end_file_name|><|fim▁begin|>/*
* Tests for negative numbers.
*/
extern crate rustyard;
#[test]
fn can_add_two_negative_numbers() {
let mut yard = rustyard::ShuntingYard::new();
assert_eq!(-4f64, yard.calculate("-2 + -2").unwrap());
assert_eq!("-2 + -2 ", yard.to_string... | #[test] |
<|file_name|>sharedvalue.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------
# Theano @ Dragon
# Copyright(c) 2017 SeetaTech
# Written by Ting Pan
# --------------------------------------------------------<|fim▁hole|>from dragon.core.tensor import Tensor, GetTensorName
def shared... |
import numpy as np
import dragon.core.workspace as ws |
<|file_name|>translatable-snack-bar.service.ts<|end_file_name|><|fim▁begin|>import {Injectable} from '@angular/core';
import {SnackBarService} from './snack-bar.service';<|fim▁hole|>
@Injectable({
providedIn: 'root'
})
export class TranslatableSnackBarService {
/**
* @param snackBarService
* @param translate... | import {LangChangeEvent, TranslateService} from '@ngx-translate/core'; |
<|file_name|>application_gateway_ssl_predefined_policy.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# licen... | |
<|file_name|>pipeline.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 https://mozilla.org/MPL/2.0/. */
use crate::event_loop::EventLoop;
use background_hang_monit... | |
<|file_name|>legibilidad.py<|end_file_name|><|fim▁begin|># Legibilidad 2 (beta)
# Averigua la legibilidad de un texto
# Spanish readability calculations
# © 2016 Alejandro Muñoz Fernández
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as publ... | #You should have received a copy of the GNU General Public License |
<|file_name|>HFileWriterV2.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2011 The Apache Software Foundation
*
* 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 copyrigh... | * @param klength |
<|file_name|>computed.js<|end_file_name|><|fim▁begin|>import { computed, get } from '@ember/object';
import { getOwner } from '@ember/application';
import { deprecate } from '@ember/debug';
export function ability(abilityName, resourceName) {
deprecate(
'Using ability() computed property is deprecated. Use gette... |
resourceName = resourceName || abilityName; |
<|file_name|>etl.py<|end_file_name|><|fim▁begin|>def transform(old):<|fim▁hole|> old.items() for value in values}<|fim▁end|> | return {value.lower(): score for score, values in |
<|file_name|>guestshell.py<|end_file_name|><|fim▁begin|># Copyright 2014-present, Apstra, Inc. All rights reserved.
#
# This source code is licensed under End User License Agreement found in the
# LICENSE file at http://www.apstra.com/community/eula
<|fim▁hole|>from functools import partial
from aeon.nxos.exceptions im... | from collections import namedtuple
import time
import logging |
<|file_name|>switchDefaultFirst.js<|end_file_name|><|fim▁begin|>var name;
switch (name) {
case "Kamol":
doSomething();
default:
doSomethingElse();
}
switch (name) {
default:
doSomethingElse();<|fim▁hole|> doSomething();
}<|fim▁end|> | break;
case "Kamol": |
<|file_name|>vm_config.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::on_chain_config::OnChainConfig;
use anyhow::{format_err, Result};
use move_core_types::gas_schedule::{CostTable, GasConstants};
use serde::{Deserialize, Serialize};
/// ... | |
<|file_name|>volumes-provider.test.js<|end_file_name|><|fim▁begin|>import { expect, fixture, fixtureCleanup, fixtureSync } from '@open-wc/testing';
import sinon from 'sinon';
import volumesProvider from '../../../../src/BookNavigator/volumes/volumes-provider';
const brOptions = {
"options": {
"enableMultipleBook... | expect(origSortButton.classList.contains('neutral-icon')).to.be.true;
provider.sortOrderBy = 'title_asc';
const ascButton = await fixture(provider.sortButton); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
* See LICENSE in the project root for license information.
*/
/**
* This sample shows how to:
* - Get the current user's metadata
* - Get the current user's profile photo
* ... | passport.authenticate('azuread-openidconnect', { failureRedirect: '/' }),
(req, res) => {
res.redirect('/');
}); |
<|file_name|>configureStore.ts<|end_file_name|><|fim▁begin|>import { createStore, applyMiddleware, Store } from 'redux';
import thunkMiddleware from 'redux-thunk';
//import { createLogger } from 'redux-logger';
import { appReducer, IApplicationState } from '../reducers/appReducer';
import { UserService } from 'services... | import { NotificationService } from 'services/notification.service';
import { QuestionsAssetsService } from 'services/questionsAssets.service';
//const loggerMiddleware = createLogger(); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Low-level Rust lexer.
//!
//! The idea with `rustc_lexer` is to make a reusable library,
//! by separating out pure lexing and rustc-specific concerns, like spans,
//! error reporting, and interning. So, rustc_lexer operates directly on `&str`,
//! produces simple t... | let terminated = self.single_quoted_string(); |
<|file_name|>profile_mode.cc<|end_file_name|><|fim▁begin|>// Copyright (C) 2019-2021 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the<|fim▁hole|>
// This library is distributed in the hope that it wil... | // terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version. |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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... | fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(self, f) }
}
|
<|file_name|>block.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 block layout.
use layout::box::{RenderBox, RenderBoxUt... | |
<|file_name|>0006_auto__chg_field_billdetails_end_date__chg_field_billdetails_start_date.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration)... |
# The following code is provided here to aid in writing a correct migration
# Changing field 'billdetails.end_date'
db.alter_column(u'employee_billdetails', 'end_date', self.gf('django.db.models.fields.DateField')()) |
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Zigbee switches."""
import voluptuous as vol
from homeassistant.components.switch import SwitchDevice
from homeassistant.components.zigbee import (
ZigBeeDigitalOut, ZigBeeDigitalOutConfig, PLATFORM_SCHEMA)
DEPENDENCIES = ['zigbee']<|fim▁hole|>DEP... |
CONF_ON_STATE = 'on_state'
DEFAULT_ON_STATE = 'high' |
<|file_name|>lexical-scope-in-if.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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.a... | // BEGINNING of else branch
// gdb-command:print x |
<|file_name|>RadixSort.py<|end_file_name|><|fim▁begin|>#implementation of radix sort in Python.
def RadixSort(A):
RADIX = 10
maxLength = False
tmp , placement = -1, 1
<|fim▁hole|> buckets = [list() for _ in range(RADIX)]
for i in A:
tmp = i / placement
buckets[tmp % RADIX].append(i)
if maxLengt... | while not maxLength:
maxLength = True |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp');
var browserify = require('browserify');
//transform jsx to js
var reactify = require('reactify');
//convert to stream
var source = require('vinyl-source-stream');
var nodemon = require('gulp-nodemon');
gulp.task('browserify', function() ... | |
<|file_name|>demo.bundle.js<|end_file_name|><|fim▁begin|>/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/... | }
} );
|
<|file_name|>lugwiz.10a10b4d8340.js<|end_file_name|><|fim▁begin|>/* ************************************************************************
qooxdoo - the new era of web development
http://qooxdoo.org
Copyright:
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
License:
LGPL: http://www.... | control = new qx.ui.popup.Popup(new qx.ui.layout.VBox);
control.setAutoHide(false); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.