prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>0012_line_to_multiline.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.contrib.gis.geos import GeometryCollection
def change_line_to_multiline(apps, schema_editor):
# We can't import the Person model ... | |
<|file_name|>staging.py<|end_file_name|><|fim▁begin|>"""Production settings and globals."""
from base import *
########## HOST CONFIGURATION
# See: https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production
MAIN_HOST = ['openbilanci.staging.deppsviluppo.org',]
# Allowed hosts expansion:... |
########## END TOOLBAR CONFIGURATION |
<|file_name|>test-viewer.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 The AMP HTML 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:/... | }
it('should consider non-trusted when not iframed', () => {
windowApi.parent = windowApi; |
<|file_name|>backend.go<|end_file_name|><|fim▁begin|>package okta
import (
"fmt"
"github.com/hashicorp/vault/logical"
"github.com/hashicorp/vault/logical/framework"
)
func Factory(conf *logical.BackendConfig) (logical.Backend, error) {
return Backend().Setup(conf)
}
func Backend() *backend {
var b backend
b.B... | Unauthenticated: []string{
"login/*",
},
}, |
<|file_name|>core.py<|end_file_name|><|fim▁begin|>#!/bin/python
'''
Library for formulating and solving game trees as linear programs.
'''
class Node(object):
'''Abstract class to represent a node in the game tree.'''
def solve(self):
'''
Should populate the solutions dictionary.
sol... | |
<|file_name|>zoom.py<|end_file_name|><|fim▁begin|>from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point
from django.contrib.gis.maps.google.gmap import GoogleMapException
from math import pi, sin, cos, log, exp, atan
# Constants used for degree to radian conversion, and vice-versa.
DTOR = pi / 1... | def get_lon_lat(self, lonlat): |
<|file_name|>sanity_checks.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/. */
//! Different static asserts that ensure the build does... | saw_before = true; |
<|file_name|>checks.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016, GohighSec
# 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/licen... | msg = ("B320: LOG.warn is deprecated, please use LOG.warning!") |
<|file_name|>interface-gen.js<|end_file_name|><|fim▁begin|>// generates an interface file given an eni file
// you can generate an eni file using the aws-cli
// example:
// aws ec2 describe-network-interfaces --network-interface-ids eni-2492676c > eni-7290653a.json
var ENI_FILE = "json/eni-651e2c2c.json";
// the int... | |
<|file_name|>encoding.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015, Sam Payson
//
// 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 without limitation... | // provides encoding information for this type. |
<|file_name|>ObservablePrimitiveSupplement.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2009 Google 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... | |
<|file_name|>licenseMd.js<|end_file_name|><|fim▁begin|>const fs = require('fs');
<|fim▁hole|> fs.writeFileSync(`${params.projectRoot}/License.md`, params.license);
return 'licenseMd: ok';
};<|fim▁end|> | module.exports = (params) => () => { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import _jsx from "@babel/runtime/helpers/builtin/jsx";
import React from 'react';
import EditMediaDialog from '../../containers/EditMediaDialog';
import LoginDialog from '../../containers/LoginDialog';
import PreviewMediaDialog from '../../containers/PreviewMediaDialog... |
export default Dialogs; |
<|file_name|>help.py<|end_file_name|><|fim▁begin|>"""Module containing bug report helper(s)."""
from __future__ import print_function
import json
import platform
import sys
import ssl
import idna
import urllib3
from . import __version__ as requests_version
try:
import charset_normalizer
except ImportError:
... | 'version': getattr(cryptography, '__version__', ''),
}
idna_info = {
'version': getattr(idna, '__version__', ''), |
<|file_name|>flo2_pid.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#--------------------------------------------------------------------------
# flo2_pid.py
# Rick Kauffman a.k.a. Chewie
#
# Hewlett Packard Company Revision: 1.0
# ~~~~~~~~~ Wooki... | print "</head>"
print "<body>"
print "<h1> <img src=\"../../images/glarn.png\" width=\"50\" height=\"50\">glarn: The dpid database</h1>"
print "<HR> " |
<|file_name|>bitcoin_fi.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fi" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Parallaxcoin</source... | |
<|file_name|>Secret.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
import base64
import json
from six import string_types
from kubernetes_py.models.unversio... | if not is_valid_string(account_uid):
raise SyntaxError("Secret.set_service_account() account_uid: [ {} ] is invalid.".format(account_uid))
if not is_valid_string(token):
raise SyntaxError("Secret.set_service_account() token: [ {} ] is invalid.".format(token)) |
<|file_name|>DBcon.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*-
'''
Created on 18/2/2015
@author: PC06
'''
from flaskext.mysql import MySQL
from flask import Flask
class DBcon():
'''
classdocs
'''<|fim▁hole|> def __init__(self):
'''
Constructor
'''
pass
... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import csv
import re
from io import TextIOWrapper
from django.conf import settings
from django.core.cache import cache
from django.utils.termcolors import colorize
# Import clog if we're in debug otherwise make it a noop
if settings.DEBUG:
from clog.clog import c... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//
// SOS: the Stupid Operating System
// by Eliza Weisman (eliza@elizas.website)
//
// Copyright (c) 2015-2017 Eliza Weisman
// Released under the terms of the MIT license. See `LICENSE` in the root
// directory of this repository for more information.
//
//! `x86_... | , elf_sections: Some(elf_sections_tag.sections())
, ..Default::default()
};
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import glob
import os
import synapseclient
import uuid
from synapseclient import Project, File, Folder, Evaluation
from challenge import *
import challenge
from collections import OrderedDict
syn = synapseclient.Synapse()
syn.login()
CLEANUP = True
## module scope va... | if project:
syn.delete(project) |
<|file_name|>render-video-player.js<|end_file_name|><|fim▁begin|>/*
* Give a file path uuid, or full path, render a html for the file display.
*
* ../unit/u-rvp.js will be the test file.
*/
var fs = require('fs');<|fim▁hole|>var path = require('path');
var handlebars = require('handlebars');
var folder_module ... | |
<|file_name|>0004_auto_20160525_1032.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0003_remove_userprofile_is_check'),
]
operations = [... | ), |
<|file_name|>require-named-unassigned-functions.js<|end_file_name|><|fim▁begin|>/**
* Require unassigned functions to be named inline
*
* Types: `Boolean` or `Object`
*
* Values:
* - `true`
* - `Object`:
* - `allExcept`: array of quoted identifiers
*
* #### Example
*
* ```js
* "requireNamedUnassigned... |
// If the function has been named, skip it |
<|file_name|>0040_remove_itemtype_key.py<|end_file_name|><|fim▁begin|>from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('kirppu', '0039_counter_private_key'),
]
operations = [
migrations.AlterUniqueTogether(
name='itemtype',
... | name='key', |
<|file_name|>_common.py<|end_file_name|><|fim▁begin|>import sys
import click
from globus_cli.termio import FORMAT_SILENT, formatted_print
from ..services.transfer import CustomTransferClient
def transfer_task_wait_with_io(
transfer_client: CustomTransferClient,
meow,
heartbeat,
polling_interval,
... | exit_code = 1
if timed_out(waited_time): |
<|file_name|>webdav.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# pylint: disable=locally-disabled, star-args
""" WebDAV upload method for dput.
Install to "/usr/share/dput/webdav.py".
"""
from __future__ import with_statement
import re
import os
import sys
import cgi
import netrc
import socket
import... | basename = os.path.basename(filepath)
return urlparse.urljoin(url.rstrip('/') + '/', basename)
|
<|file_name|>Downloader.py<|end_file_name|><|fim▁begin|>import pykka
from rx.subjects import *
from TorrentPython.DownloadManager import *
from TorrentPython.RoutingTable import *
class DownloaderActor(pykka.ThreadingActor):
def __init__(self, downloader):
super(DownloaderActor, self).__init__()
... | self.destroy()
def destroy(self):
if self.actor.is_alive(): |
<|file_name|>kickoff.py<|end_file_name|><|fim▁begin|>from flask import url_for
from decksite.view import View
from magic import tournaments
from shared import dtutil
# pylint: disable=no-self-use
class KickOff(View):
def __init__(self) -> None:
super().__init__()
kick_off_date = tournaments.kick_... | |
<|file_name|>file.js<|end_file_name|><|fim▁begin|>/**
* @file
* Provides JavaScript additions to the managed file field type.
*
* This file provides progress bar support (if available), popup windows for
* file previews, and disabling of other file fields during Ajax uploads (which
* prevents separate file fields... | (function ($) {
"use strict";
|
<|file_name|>time.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/. */
extern crate time as std_time;
use energy::read_energy_uj;
use ... | RootWindow, |
<|file_name|>StorageUtils.java<|end_file_name|><|fim▁begin|>package me.yugy.app.common.utils;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import java.io.File;
... | |
<|file_name|>point.rs<|end_file_name|><|fim▁begin|>use std::ops::{Add, Sub, Neg};
use num::{ToPrimitive, Num};
use drawable::Drawable;
use canvas::{Canvas, Colour};
use std::fmt::Debug;
#[derive(Copy, Clone, Debug)]
pub struct Point2D<T> {
pub x: T,
pub y: T
}
impl<T> Point2D<T> where T: Num {
pub fn new(x: T, y: ... | |
<|file_name|>cubes.py<|end_file_name|><|fim▁begin|>#python
import k3d
k3d.check_node_environment(context, "MeshSourceScript")
# Construct a cube mesh primitive ...
cubes = context.output.primitives().create("cube")
matrices = cubes.topology().create("matrices", "k3d::matrix4")
materials = cubes.topology().create("mat... | |
<|file_name|>test_inlinequeryresultvideo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modif... | # You should have received a copy of the GNU General Public License
# along with this program. If not, see [http://www.gnu.org/licenses/]. |
<|file_name|>User.js<|end_file_name|><|fim▁begin|>import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import moment from 'moment';
import { toggleSelect } from '../actions/users';
import { createLink } from '../../utils';
class User extends Component {
render() {
const pr... | |
<|file_name|>explicit-projection.rs<|end_file_name|><|fim▁begin|>#![feature(rustc_attrs)]
<|fim▁hole|>#[rustc_outlives]
struct Foo<'a, A, B> where A: Trait<'a, B> //~ ERROR rustc_outlives
{
foo: <A as Trait<'a, B>>::Type
}
fn main() {}<|fim▁end|> | trait Trait<'x, T> where T: 'x {
type Type;
}
|
<|file_name|>unwind-initializer-indirect.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://ww... | fn main() { |
<|file_name|>alien-username.py<|end_file_name|><|fim▁begin|>#!/bin/python
# Solution for https://www.hackerrank.com/challenges/alien-username<|fim▁hole|>def is_valid_username(s):
pattern = r'^[_\.][0-9]+[a-zA-Z]*_?$'
match = re.match(pattern, s)
return match
n = int(raw_input().strip())
for i in range(n):
... |
import re
|
<|file_name|>mode.rs<|end_file_name|><|fim▁begin|>#[derive(Eq, PartialEq, Clone)]
pub enum GpuMode {
HBlank,
VBlank,
VRAM,
OAM,
}
impl GpuMode {
pub fn to_u8(&self) -> u8 {
match *self {
GpuMode::HBlank => 0x00,
GpuMode::VBlank => 0x01,<|fim▁hole|> GpuMode... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># http://stackoverflow.com/questions/1477294/generate-random-utf-8-string-in-python
import random
def get_random_unicode(length):
try:
get_char = unichr
except NameError:
get_char = chr
# Update this to include code point ranges to be s... | return ''.join(random.choice(alphabet) for i in range(length)) |
<|file_name|>app.js<|end_file_name|><|fim▁begin|><|fim▁hole|>angular.module('sidecar', [
'ngRoute',
'sidecar.services',
// 'sidecar.version'
]).
config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
$locationProvider.hashPrefix('!');
$routeProvider.otherwise({redirectTo:... | 'use strict';
// Declare app level module which depends on views, and components |
<|file_name|>org_deleter_test.go<|end_file_name|><|fim▁begin|>package cf_command_test
import (
"errors"
"code.cloudfoundry.org/cf-pusher/cf_command"
"code.cloudfoundry.org/cf-pusher/fakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("OrgDeleter", func() {
var (
orgDeleter *cf_co... | |
<|file_name|>editor-lists-debug.js<|end_file_name|><|fim▁begin|>YUI.add('editor-lists', function (Y, NAME) {
/**
* Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support.
* Adds overrides for the <a href="Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist"... | * @module editor
* @submodule editor-lists
*/
|
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import './polyfills';
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {RouterModule} from '@angular/router';
import {HttpModule} from '@angular/http';
import {FormsModule, ReactiveFormsModule} from '@angular... |
export class AppModule {} |
<|file_name|>SQL_Det_Pop_Sum_by_Column.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Sun Jan 22 23:03:45 2017
@author: Shabaka
"""
# import pandas
import pandas as pd
# Import Pyplot as plt from matplotlib
import matplotlib.pyplot as plt
from sqlalchemy import create_engine
# ... | |
<|file_name|>policy_ref_snip7.cpp<|end_file_name|><|fim▁begin|>// Copyright John Maddock 2007.
// Copyright Paul A. Bristow 2010.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.tx... | |
<|file_name|>couchbase.test.js<|end_file_name|><|fim▁begin|>'use strict';
const assert = require('assert');
const should = require('should');
const uuid = require('uuid/v1');
const _ = require('lodash');
const GeoPoint = require('loopback-datasource-juggler').GeoPoint;
const initialization = require("./init.js");
co... | });
});
it('should support "or" operator that is satisfied', function(done) { |
<|file_name|>issue-23207.rs<|end_file_name|><|fim▁begin|>// aux-build:issue-23207-1.rs
// aux-build:issue-23207-2.rs
// ignore-cross-compile
extern crate issue_23207_2;
<|fim▁hole|>pub use issue_23207_2::fmt;<|fim▁end|> | // @has issue_23207/fmt/index.html
// @count - '//*[@class="struct"]' 1 |
<|file_name|>test_artificial_32_Anscombe_ConstantTrend_7_12_100.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
<|fim▁hole|>
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 7, transform = "An... | |
<|file_name|>flat_set.hpp<|end_file_name|><|fim▁begin|><|fim▁hole|>//
// (C) Copyright Ion Gaztanaga 2008-2011. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.lslboost.org/LICENSE_1_0.txt)
//
// See http://www.lslboost.org/libs/interprocess ... | ////////////////////////////////////////////////////////////////////////////// |
<|file_name|>inventory-test.js<|end_file_name|><|fim▁begin|>import { moduleForModel, test } from 'ember-qunit';
import Pretender from 'pretender';
// ToDo: Install ember-cli-faker
import mocks from './mocks';
const {
inventoryMock,
productMock,
componentsMock
} = mocks;
let mockServer;
moduleForModel('inve... | this.get(`/products/${productMock.id}`, function() { |
<|file_name|>world_model.cpp<|end_file_name|><|fim▁begin|>#include <vigir_footstep_planning_plugins/plugin_aggregators/world_model.h>
namespace vigir_footstep_planning
{
WorldModel::WorldModel()
: ExtendedPluginAggregator<WorldModel, CollisionCheckPlugin>("WorldModel")
{
}
void WorldModel::loadPlugins(bool print_wa... | |
<|file_name|>structure_functions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""
Author: Kartamyshev A.I. (Darth Feiwante)
"""
def inherit_icalc_isotropic(new_structure = '', start_new_version = None, base_calculation = (None, None, None), database = None, min_mult = 1, max_mult = 1, num_points = 2, geo_f... | |
<|file_name|>CancelJobRequestMarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 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 the License is... |
if (cancelJobRequest.getJobId() != null) {
request.addParameter("JobId", StringUtils.fromString(cancelJobRequest.getJobId()));
} |
<|file_name|>zookeeper_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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/li... | |
<|file_name|>QueryLogic.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
import re
def mgo_text_split(query_text):
''' split text to support mongodb $text match on a phrase '''
sep = r'[`\-=~!@#$%^&*()_+\[\]{};\'\\:"|<,./<>?]'
word_lst = re.split(sep, query_text)
text_query = ' '.join('\"{}\"'.... | for i in ('ip', 'banner', 'port', 'time', 'webinfo.tag', 'webinfo.title', 'server', 'hostname'):
filter_lst.append({i: {"$regex": list[0], '$options': 'i'}})
query['$or'] = filter_lst
return query |
<|file_name|>evaplib.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Functions for calculation of potential and actual evaporation
from meteorological data.
Potential and actual evaporation functions
==========================================
- E0: Calculate Penman (1948, 1956) open water evaporat... | Evaplib: Python libray for calculation of evaporation from meteorological data.
Parameters |
<|file_name|>uniformbuffer.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2018 Bruce Stenning. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code mu... | ///
/// uniform_name: The name of the uniform whose value should be set
/// value: The value to set for the uniform |
<|file_name|>loginserver.ts<|end_file_name|><|fim▁begin|>/**
* Login server abstraction layer
* Pokemon Showdown - http://pokemonshowdown.com/
*
* This file handles communicating with the login server.
*
* @license MIT
*/
const LOGIN_SERVER_TIMEOUT = 30000;
const LOGIN_SERVER_BATCH_TIME = 1000;
import {Net, FS... | for (const [data, resolve] of requests) {
resolvers.push(resolve);
dataList.push(data);
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Distutils installer for extras."""
from setuptools import setup
import os.path
import extras
testtools_cmd = extras.try_import('testtools.TestCommand')
def get_version():
"""Return the version of extras that we are building."""
vers... | "Programming Language :: Python", |
<|file_name|>expose.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless ... | |
<|file_name|>FVDofm.hpp<|end_file_name|><|fim▁begin|>//
// Created by tyler on 10/15/17.<|fim▁hole|>
#ifndef YAFEL_FVDOFM_HPP
#define YAFEL_FVDOFM_HPP
#include "yafel_globals.hpp"
#include "utils/DoFManager.hpp"
YAFEL_NAMESPACE_OPEN
/**
* \class FVDofm
* DoFManager-like class for finite volume methods
*
* Holds ... | // |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin<|fim▁hole|>
urlpatterns = patterns('',
url(r'', include('main.urls')),
# Examples:
# url(r'^$', 'whereami.views.home',... | # admin.autodiscover() |
<|file_name|>char.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licen... | use option::{None, Option, Some};
use iter::{range_step, Iterator, RangeStep};
use slice::SlicePrelude;
|
<|file_name|>WantLinks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/pythonTest
# -*- coding: utf-8 -*-
#
# Web functions want links
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version... | |
<|file_name|>windows2012ServerMemory.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from memory.mem import _Memory
class Windows2012ServerMemory(_Memory):<|fim▁hole|> def csv_all_modules_dll(self):
super(Windows2012ServerMemory, self)._csv_all_modules_dll()
def csv_all_modules... | def __init__(self, params):
super(Windows2012ServerMemory, self).__init__(params)
|
<|file_name|>dct_double.go<|end_file_name|><|fim▁begin|>package guetzli_patapon
// kDCTMatrix[8*u+x] = 0.5*alpha(u)*cos((2*x+1)*u*M_PI/16),
// where alpha(0) = 1/sqrt(2) and alpha(u) = 1 for u > 0.
var kDCTMatrix = [64]float64{
0.3535533906, 0.3535533906, 0.3535533906, 0.3535533906,
0.3535533906, 0.3535533906, 0.353... | 0.2777851165, -0.4903926402, 0.0975451610, 0.4157348062,
-0.4157348062, -0.0975451610, 0.4903926402, -0.2777851165,
0.1913417162, -0.4619397663, 0.4619397663, -0.1913417162, |
<|file_name|>Bookmark.ts<|end_file_name|><|fim▁begin|>import DOMUtils from 'tinymce/core/api/dom/DOMUtils';
interface Bookmark {
startContainer: Node;
startOffset: number;
endContainer?: Node;
endOffset?: number;
}
/**
* Returns a range bookmark. This will convert indexed bookmarks into temporary span elemen... | export {
create, |
<|file_name|>edit.cpp<|end_file_name|><|fim▁begin|>#include <cstring>
#include <iostream>
#include <algorithm>
#include "matcher.h"
#include "edit.h"
#include "char.h"
#include "instrumentation.h"
#define INIT_POS -1
#define __DEBUG__ false
// the node represented by a given point
#define node(p) (distances[(p)->j][(... | best_match->j = j;
best_match->i = i; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::{Box, FnBox};
use super::stack::Stack;
#[cfg(target_arch = "x86")]
mod i686;
#[cfg(target_arch = "x86_64")]
mod x86_64;
<|fim▁hole|>
#[cfg(target_arch = "x86_64")]
pub use super::x86_64::*;
}
/// A thread has to be wrapped by a calling funct... | mod imp {
#[cfg(target_arch = "x86")]
pub use super::i686::*; |
<|file_name|>keyword-abstract.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.or... | |
<|file_name|>TransResultHolder.java<|end_file_name|><|fim▁begin|>package com.yueny.demo.downlatch.holder;
import java.util.List;
import java.util.Vector;
<|fim▁hole|>
import com.yueny.demo.downlatch.bo.RecoverResult;
/**
* @author yueny09 <deep_blue_yang@163.com>
*
* @DATE 2016年3月22日 下午1:15:25
*
*/
p... |
import org.apache.commons.collections4.CollectionUtils;
|
<|file_name|>tokenization_deberta.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2020 Microsoft and the HuggingFace Inc. team.
#
# 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
#
# ... | # See the License for the specific language governing permissions and
# limitations under the License.
""" Tokenization class for model DeBERTa.""" |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//! - `to_py_object` converts a Rust value to a Python object.
//! - `from_py_object` converts a Python object back to a Rust value.
//!
//! Requires the `serde-convert` feature.
mod de;
mod error;
mod ser;
#[cfg(test)]
mod tests;
pub use de::from_py_objec... | //! `serde` integration. |
<|file_name|>opt-p32.rs<|end_file_name|><|fim▁begin|>extern crate llvm_opt;
use llvm_opt::{P};
#[derive(Clone, Copy, Debug)]
pub struct X;
<|fim▁hole|>fn calc(v: f32) -> P<X> {
let a = P::<X>::new(v * 1.234_f32);
let b = P::<X>::new(5.0_f32);
a / b
}
fn main() {
let v: f32 = std::env::args().nth(1).... | #[inline(never)] |
<|file_name|>test_admin_password.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance... |
def fake_set_admin_password(self, context, instance, password=None):
pass |
<|file_name|>SocketServerEncrypt.java<|end_file_name|><|fim▁begin|>package com.cqs.socket.example;
import javax.net.ServerSocketFactory;
import javax.net.ssl.SSLServerSocketFactory;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
imp... | } |
<|file_name|>trait-as-struct-constructor.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://ww... | |
<|file_name|>jmvc.js<|end_file_name|><|fim▁begin|>// Tests for the JavaScriptMVC compatibility layer. Will be removed eventually
steal('funcunit/qunit', 'jquerypp/controller/view/test/qunit'<|fim▁hole|> , 'jquerypp/class/class_test.js'
, 'jquerypp/model/test/qunit'
, 'jquerypp/controller/controller_test.js'
, 'jquer... | |
<|file_name|>gutenberg.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
@file
@brief Link to data from `Gutenberg <http://www.gutenberg.org/>`_,
provides an automated way to get the data from this website.
Some data may be replicated here to unit test notebooks.
"""<|fim▁hole|>
def gutenberg_name(name="cond... | import os
import urllib.request
from urllib.error import URLError |
<|file_name|>Type.java<|end_file_name|><|fim▁begin|>/***
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the f... | |
<|file_name|>AttributeMarshallingMixin.js<|end_file_name|><|fim▁begin|>import { booleanAttributeValue, standardBooleanAttributes } from "./dom.js";
import { rendering } from "./internal.js";
// Memoized maps of attribute to property names and vice versa.
// We initialize this with the special case of the tabindex (low... | |
<|file_name|>index.d.ts<|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 incorrect behavior ... | |
<|file_name|>schema.rs<|end_file_name|><|fim▁begin|>table! {
posts (id) {
id -> Int4,
title -> Varchar,
body -> Text,
published -> Bool,
user_id -> Int4,
}
}
table! {
users (id) {
id -> Int4,
name -> Varchar,
hair_color -> Nullable<Varchar>,
... | |
<|file_name|>Ciudad.java<|end_file_name|><|fim▁begin|>package tsp;
public class Ciudad {
private String nombre;
private int id;
private CiudadesDistancias[] distanciasC = new CiudadesDistancias[22];
private boolean visitado = false;
private boolean inicial = false;
Ciudad(int idd, String nom){
nom... | }
public int getDistancia(String cd){
int distancia = 0;
|
<|file_name|>non-constant-expr-for-vec-repeat.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
//... | |
<|file_name|>shared.module.ts<|end_file_name|><|fim▁begin|>import { BrowserModule } from '@angular/platform-browser';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/comm... | ],
imports: [
FormsModule, |
<|file_name|>view.js<|end_file_name|><|fim▁begin|>'use strict';var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {... | |
<|file_name|>jsondb.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, absolute_import
"""JSON flat file database system."""
import codecs
import os
import os.path
import re
from fcntl import flock, LOCK_EX, LOCK_SH, LOCK_UN
import redis
import json
import... | logger.debug("Cache lock released") |
<|file_name|>load_instructions.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
extern crate test_generation;
use test_generation::abstract_state::{AbstractState, AbstractValue};
use vm::file_format::{Bytecode, ConstantPoolIndex, SignatureToken};
mod c... |
#[test]
fn bytecode_ldfalse() {
let state1 = AbstractState::new(); |
<|file_name|>harmony-array-includes.js<|end_file_name|><|fim▁begin|>// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
'use strict';
// This file relies on the fact that the following declaration has be... | if (SameValueZero(searchElement, elementK)) {
return true; |
<|file_name|>RemoteVMConnector.java<|end_file_name|><|fim▁begin|>/*
* JDIVisitor
* Copyright (C) 2014 Adrian Herrera
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of ... | Map<String, Connector.Argument> arguments = connectorArguments(connector);
VirtualMachine vm = connector.attach(arguments);
|
<|file_name|>guidanceresponse_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 on 2017-03-22.
# 2017, SMART Health IT.
import io
import json
import os
import unittest
from . import guidanceresponse
from .fhirdate import FHIRDate
class Guidanc... | self.assertEqual("GuidanceResponse", js["resourceType"])
return guidanceresponse.GuidanceResponse(js)
def testGuidanceResponse1(self): |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>from PyQt4 import QtCore, QtGui
import os
class ConfigPage(QtGui.QWizardPage):<|fim▁hole|> def __init__(self, templates, parent=None):
super(ConfigPage, self).__init__(parent)
#self.setTitle("Configuration")
#self.setSubTitle("Alter config... | |
<|file_name|>moderation.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
moderation plugin for DecoraterBot.
"""
import regex
import discord
from discord.ext import commands
from DecoraterBotUtils import utils
# This module's warn, and mute commands do not work for now.
# I would like it if someone would help me f... | for disuser in ctx.message.mentions:
listdata = ctx.message.channel.server.members
member2 = discord.utils.find(
lambda member: member.name == disuser.name, listdata) |
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use crate::jsonrpc::futures::channel::mpsc;
use crate::jsonrpc::{middleware, MetaIoHandler, Metadata, Middleware};
use crate::meta::{MetaExtractor, NoopExtractor, RequestC... | |
<|file_name|>RemovingCallbackFacetViaMethod.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses ... | public boolean impliesObjectChanged() { |
<|file_name|>NodeQualifier.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.ann... | package uk.ac.ucl.eidp.data;
|
<|file_name|>Rerequester.py<|end_file_name|><|fim▁begin|># Written by Bram Cohen
# modified for multitracker operation by John Hoffman
# see LICENSE.txt for license information
from BitTornado.zurllib import urlopen, quote
from urlparse import urlparse, urlunparse
from socket import gethostbyname
from btformats import... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.