prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from django.utils.translation import ugettext as _
def error_page(request, errormsg=''):
"""Show error page with message"""<|fim▁hole|> if not errormsg:
... | |
<|file_name|>owned.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|>js_FxzL6y_vG1Dd9B-MsolHGVlVoN_lbUIGopU6FCDDV9U.js<|end_file_name|><|fim▁begin|>/*jslint browser: true */ /*global jQuery: true */
/**
* jQuery Cookie plugin
*
* Copyright (c) 2010 Klaus Hartl (stilbuero.de)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-licen... | $.extend(this, { values: {}, oldValue: null }, args);
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># #######
# Copyright (c) 2018-2020 Cloudify Platform Ltd. 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
#
# ... | super(CloudResourcesBase, self).__init__( |
<|file_name|>post_result.py<|end_file_name|><|fim▁begin|>import json
import httplib
import requests
import six
import pyaml
from six.moves.urllib.parse import urljoin
from st2actions.runners.pythonrunner import Action
__all__ = [
'PostResultAction'
]
def _serialize(data):
return pyaml.dump(data)
def forma... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='MissingTeacherEnt... | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), |
<|file_name|>sketch.js<|end_file_name|><|fim▁begin|>function setup() {
createCanvas(600, 400);<|fim▁hole|> loadJSON("data.json", drawData);
}
function draw() {
background(255, 0, 0);
console.log(int(random(0, 2)));
}
function drawData(data) {
background(120, 180, 200);
// person 1 bubble
fill(155, 30,... | noLoop();
noStroke();
textSize(20);
|
<|file_name|>into_bits.rs<|end_file_name|><|fim▁begin|>//! Implementation of `FromBits` and `IntoBits`.
/// Safe lossless bitwise conversion from `T` to `Self`.
pub trait FromBits<T>: crate::marker::Sized {
/// Safe lossless bitwise transmute from `T` to `Self`.
fn from_bits(t: T) -> Self;<|fim▁hole|>}
/// Sa... | |
<|file_name|>client.go<|end_file_name|><|fim▁begin|>// Package network implements the Azure ARM Network service API version .
//
// Network Client
package network
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use ... |
// NewWithBaseURI creates an instance of the BaseClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
return BaseClient{ |
<|file_name|>test_group_snapshots.py<|end_file_name|><|fim▁begin|># Copyright 2017 FiberHome Telecommunication Technologies CO.,LTD
# Copyright (C) 2017 Dell Inc. or its subsidiaries.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in c... | # Verify the created volumes are associated with consistency group
vols = self.volumes_client.list_volumes(detail=True)['volumes']
grp_vols = [v for v in vols if v['group_id'] == grp['id']] |
<|file_name|>crate-method-reexport-grrrrrrr.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
// h... | let y = (); |
<|file_name|>CustomPaginationActionsTable.js<|end_file_name|><|fim▁begin|>import * as React from 'react';
import PropTypes from 'prop-types';
import { useTheme } from '@mui/material/styles';
import Box from '@mui/material/Box';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
im... | <IconButton
onClick={handleNextButtonClick} |
<|file_name|>playmp3.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python2
# -*- coding: utf-8 -*-
#======================================================================
#
# playsnd.py - play sound with ctypes + mci
#
# Created by skywind on 2013/12/01
# Last change: 2014/01/26 23:40:20
#
#=================... | print(winmm.stop(name))
|
<|file_name|>poWithReceiversDateRange.js<|end_file_name|><|fim▁begin|>import '../../../../css/rpt/styles.global.css';
import styles from '../../../css/rpt/styles.css';
import React, { Component, PropTypes } from 'react';
import 'react-widgets/lib/less/react-widgets.less';
import DateTimePicker from 'react-widgets/lib/D... | |
<|file_name|>WordSpout.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 this file
* to you unde... | @SuppressWarnings("rawtypes")
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { |
<|file_name|>FileFragmentResultCacheManager.java<|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 a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Un... |
private final Cache<CacheKey, Path> cache; |
<|file_name|>mmca_et.py<|end_file_name|><|fim▁begin|>#
# Author: Jorg Bornschein <bornschein@fias.uni-frankfurt.de)
# Lincense: Academic Free License (AFL) v3.0
#
from __future__ import division
import numpy as np
from math import pi
from scipy.misc import comb
from mpi4py import MPI
import pulp.em as em
import ... | cut_denom = parallel.allsort(my_logdenoms)[-N_use]
my_sel, = np.where(my_logdenoms >= cut_denom)
my_N, = my_sel.shape
N_use = comm.allreduce(my_N) |
<|file_name|>collection.py<|end_file_name|><|fim▁begin|>import collections
import copy
import functools
import itertools
import json
import time
import warnings
from sentinels import NOTHING
from .filtering import filter_applies, iter_key_candidates
from . import ObjectId, OperationFailure, DuplicateKeyError
from .help... | if value not in container:
container.append(value)
elif k == '$pull': |
<|file_name|>TileEngine.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2016 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom 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, eit... | }
else
{ |
<|file_name|>ndarray.js<|end_file_name|><|fim▁begin|>(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports... | return ctor([])
} else if(typeof data === "number") { |
<|file_name|>comp-47.component.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> * Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Component, OnInit } from '@angular/core';
impor... | /**
* @license |
<|file_name|>TriState.go<|end_file_name|><|fim▁begin|>package tristate
type StateValue int
const (
TRISTATE_SUCCESS StateValue = iota
TRISTATE_FAILRUE<|fim▁hole|> State StateValue
Err error
}
func NewSuccess() *TriState {
return nil
}
func NewUnknown(err error) *TriState {
if err == nil {
panic("error not se... | TRISTATE_UNKNOWN
)
type TriState struct { |
<|file_name|>c0a714ade734_adding_timestamps_to_all_tables.py<|end_file_name|><|fim▁begin|>"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
br... |
def downgrade(engine_name): |
<|file_name|>alloc_system.rs<|end_file_name|><|fim▁begin|>use common::memory::*;
#[allocator]
#[allow(unused_variables)]
#[no_mangle]
pub extern "C" fn __rust_allocate(size: usize, align: usize) -> *mut u8 {
unsafe { alloc(size) as *mut u8 }
}
#[allow(unused_variables)]
#[no_mangle]
pub extern "C" fn __rust_deall... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from . import test_remote_printer<|fim▁hole|>from . import test_printer<|fim▁end|> | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
# pylint: disable=missing-module-docstring, missing-function-docstring
import typing
import math
import contextlib
from timeit import default_timer
from operator import itemgetter
from searx.engines impor... | max_timeout = max(max_timeout, engines[engine_name].timeout)
# histogram configuration
histogram_width = 0.1 |
<|file_name|>lib.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/. */
//! This module contains shared types and messages for use by dev... | |
<|file_name|>bitcoin_ro_RO.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ro_RO" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About fitcoin</sourc... | <message>
<location line="-2"/> |
<|file_name|>main_beagle.cc<|end_file_name|><|fim▁begin|>// C++ entry point
#include "Elf32.h"
// autogen.h contains the full kernel binary in a char array
#include "autogen.h"
extern "C" {
volatile unsigned char *uart1 = (volatile unsigned char*) 0x4806A000;
volatile unsigned char *uart2 = (volatile unsigned char*)... |
/** UART/IrDA/CIR Registers */ |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup
setup(
name='curie',
version='0.1.1',
author='Eric Viara',
author_email='eric.viara@curie.fr',
packages=['curie'],
url='http://pypi.python.org/pypi/TowelStuff/',
license='LICENSE.txt',<|fim▁hole|><|fim▁end|> | description='NaviCell Python Binding',
long_description=open('README.txt').read()
) |
<|file_name|>index.test.ts<|end_file_name|><|fim▁begin|>import { createBuilder } from '@develohpanda/fluent-builder';
import * as grpcJs from '@grpc/grpc-js';
import { globalBeforeEach } from '../../../__jest__/before-each';
import { grpcMocks } from '../../../__mocks__/@grpc/grpc-js';
import { grpcMethodDefinitionSch... |
describe('grpc.start', () => {
afterEach(() => { |
<|file_name|>model.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 Li... | pickle.dump(args_save, fout)
|
<|file_name|>packetizer.go<|end_file_name|><|fim▁begin|>package rpc
import (
"fmt"
"io"
"net"
"github.com/ugorji/go/codec"
)
type packetizer interface {
NextFrame() (rpcMessage, error)
}
type packetHandler struct {
dec decoder
reader io.Reader
frameDecoder *decoderWrapper
protocols *proto... | }
} |
<|file_name|>example_test.go<|end_file_name|><|fim▁begin|>// +build go1.10,codegen
package api
import (
"encoding/json"
"testing"
)
func buildAPI() *API {
a := &API{}
stringShape := &Shape{
API: a,
ShapeName: "string",
Type: "string",
}
stringShapeRef := &ShapeRef{
API: a,
ShapeName... | ]
] |
<|file_name|>build_list.py<|end_file_name|><|fim▁begin|><|fim▁hole|> print("'{email}',".format(email=email))<|fim▁end|> | emails = sorted(set([line.strip() for line in open("email_domains.txt")]))
for email in emails: |
<|file_name|>crateresolve8-1.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... | |
<|file_name|>knockoutExtenders.js<|end_file_name|><|fim▁begin|>define(function () {
return { registerExtenders: registerExtenders };
function registerExtenders() {
registerDateBinding();
registerMoneyExtension();
}
function registerDateBinding () {
ko.bindingHandlers.dateStri... | return value < 0 ? '(' + display + ')' : display;
}; |
<|file_name|>l-photo_lv.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="lv_LV">
<context>
<name>MainUI</name>
<message>
<location filename="../mainUI.ui" line="14"/>
<source>Image Viewer</source>
<translation type="unfinish... | <translation type="unfinished"></translation> |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """Holds all pytee logic.""" |
<|file_name|>request_response.rs<|end_file_name|><|fim▁begin|>use ansi_term::Colour::*;
use crate::{MismatchResult, display_result};
use pact_matching::models::RequestResponseInteraction;
use pact_matching::Mismatch;
pub fn display_request_response_result(
errors: &mut Vec<(Option<String>, String, Option<MismatchRes... | interaction.response.status, |
<|file_name|>GpsBoundState.java<|end_file_name|><|fim▁begin|>package org.runnerup.notification;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.support.v4.app.N... | import org.runnerup.view.MainLayout;
@TargetApi(Build.VERSION_CODES.FROYO) |
<|file_name|>event.go<|end_file_name|><|fim▁begin|>package event
type Event interface {
// IsCancellable returns true if the current event may be cancelled.
IsCancellable() bool<|fim▁hole|> SetCancelled(bool)
// IsCancelled returns true if the current event will be cancelled.
// (If the event is cancellable.)
Is... |
// SetCancelled makes the event cancelled or not. The value is taken
// into account only if the event is cancellable - you can determine
// it by reading its documentation or calling the IsCancellable function. |
<|file_name|>Leitura_portas.py<|end_file_name|><|fim▁begin|>import glob
import sys
import serial
def serial_ports():
""" Lists serial port names
:raises EnvironmentError:
On unsupported or unknown platforms
:returns:
A list of the serial ports available on the system
... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have t... | |
<|file_name|>transmute-type-parameters.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.... | |
<|file_name|>AddCallSuperTypeAnnotationsPreserved.py<|end_file_name|><|fim▁begin|>class A:<|fim▁hole|> pass
class B(A):
def <warning descr="Call to __init__ of super class is missed">__i<caret>nit__</warning>(self, d:str, *, e:bytes) -> list:
pass<|fim▁end|> | def __init__(self, a:int, b:float, *args:tuple, c:complex, **kwargs:dict) -> None: |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import tcms.core.models.base
from django.conf import settings
import tcms.core.models.fields
class Migration(migrations.Migration):
dependencies = [
... | options={
'db_table': 'test_cases',
},
bases=(models.Model, tcms.core.models.base.UrlMixin), |
<|file_name|>issue-12033.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.<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except according to t... | //
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>solution.go<|end_file_name|><|fim▁begin|>/**
* Definition for singly-linked list.
* type ListNode struct {
* Val int
* Next *ListNode
* }
*/<|fim▁hole|> pair := &ListNode{0, nil}
dummy := pair
dummy.Next = head
for head != nil && head.Next != nil {
tmp_next := head.Nex... |
func swapPairs(head *ListNode) *ListNode { |
<|file_name|>projects.ts<|end_file_name|><|fim▁begin|>import {Injectable, bind} from '@angular/core';
import {Project} from '../models/project';
import {ProjectsApi} from './api/ProjectsApi';
import {Subject, Observable} from 'rxjs';
let initialProjects: Project[] = [];
interface IProjectsOperation extends Function {
... | export var projectsServiceInjectables: Array<any> = [ |
<|file_name|>url_monitor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- encoding:utf-8 -*-
__author__ = 'kairong'
#解决crontab中无法执行的问题
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import ConfigParser
import MySQLdb
import requests
import re
from socket import socket, SOCK_DGRAM, AF_INET
from multip... | c_url = "http://%s%s" % (c_domain,c_location)
if c_method == line[5]: |
<|file_name|>CompleteOnRedirectAction.java<|end_file_name|><|fim▁begin|>/**
* Licensed to Apereo under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Apereo licenses this file to you under the Apache License,... | }
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# This file is open source software, licensed to you under the terms
# of the Apache License, Version 2.0 (the "License"). See the NOTICE file
# distributed with this work for additional information regarding copyright
# ownership. You may not... | |
<|file_name|>evaluation_criteria.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Concept
*
* 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-... | |
<|file_name|>of_config_cli.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... |
def f(p, args):
try: |
<|file_name|>dialogs.py<|end_file_name|><|fim▁begin|># -*- Mode: Python; test-case-name: flumotion.test.test_dialogs -*-
# -*- coding: UTF-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This fi... | |
<|file_name|>syncstep.py<|end_file_name|><|fim▁begin|>import os
import base64
from datetime import datetime
from xos.config import Config
from xos.logger import Logger, logging
from synchronizers.base.steps import *
from django.db.models import F, Q
from core.models import *
from django.db import reset_queries
from syn... | except:
peer_objects = []
if (hasattr(obj,'controller')): |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from utils.fields import SlugField
from utils.forms import (
BootstrapMixin,
JSONField,
SmallTextarea,
StaticSelect,
add_blank_choice,
)
from .enums import PasswordAlgorithm
from .models import Platform
class PlatformFor... | class Meta:
model = Platform
fields = [
"name", |
<|file_name|>Main_TopBarView.js<|end_file_name|><|fim▁begin|>/* RequireJS Module Dependency Definitions */
define([
'app',
'jquery',
'marionette',
'handlebars',
'collections/TopBarMessagesCollection',
'text!templates/main_topbar.html',
'foundation-reveal',
'foundation-topbar'
], function (App, $, Marionette, Ha... | this.triggerMethod("click:leaderboards:show"); |
<|file_name|>db_base_plugin_common.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 OpenStack Foundation.
# 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
#... | |
<|file_name|>EmailHandlerV1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import webapp2
import logging
from google.appengine.ext.webapp.mail_handlers import InboundMailHandler
from google.appengine.ext import ndb
from MailMessage import MailMessage
# the email domain of this app is @pomis-newsletterman.app... | |
<|file_name|>move-3-unique.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<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, ... | // http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
<|file_name|>discountMember.js<|end_file_name|><|fim▁begin|>var mysql = require('mysql');
function discountMember(router,connection){
var self=this;
self.handleRoutes(router,connection);
}
//KALO...UDH SEKALI DIDISKON>>>BERARTI GABOLEH LAGI LAGI DISKON YAA TODO:
discountMember.prototype.handleRoutes = function... | });
}else{ |
<|file_name|>scraper.py<|end_file_name|><|fim▁begin|>import os, scrapy, argparse
from realclearpolitics.spiders.spider import RcpSpider
from scrapy.crawler import CrawlerProcess
parser = argparse.ArgumentParser('Scrap realclearpolitics polls data')
parser.add_argument('url', action="store")
parser.add_argument('--local... | parser.add_argument('--csv', dest='to_csv', action='store_true')
parser.add_argument('--output', dest='output', action='store')
args = parser.parse_args() |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
mod heartbeat;
mod lsp_notification_dispatch;
mod lsp_request_dispatch;
mod lsp_st... | ));
let mut lsp_state = LSPState::create_state(
Arc::new(config), |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import os
DEFAULT_CHARACTER_PATH = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'characters')
CHARACTER_PATH = os.environ.get('HR_CHARACTER_PATH', DEFAULT_CHARACTER_PATH)
RESET_SESSION_BY_HELLO = False
SESSION_REMOVE_TIMEOUT = 3600 # Timeout second... | config['CS_PORT'] = CS_PORT |
<|file_name|>dumpbinary.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2014, Alessandro Gatti - frob.it
# 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. Redistributio... | else: |
<|file_name|>test_product_variation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.forms import formset_factory
import pytest
from shoop.admin.modules.products.views.variation.simple_variation_forms import SimpleVariationChildForm, SimpleVariationChildFormSet
from shoop.admin.modules.products.views... | |
<|file_name|>export.py<|end_file_name|><|fim▁begin|>from qtpy.QtWidgets import QFileDialog
import logging
import pandas as pd
class Export:
header = ['x0', 'y0', 'x1', 'y1', 'row_index', 'column_index',
'lock', 'active',
'fitting_confidence', 'd_spacing_value', 'd_spacing_err',
... | a1_err] = FormatTableForExport.get_val_err_fixed(_entry['a1']) |
<|file_name|>macpath.py<|end_file_name|><|fim▁begin|>"""Pathname and path-related operations for the Macintosh."""
import os
from stat import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","islin... | """Split a pathname into two parts: the directory leading up to the final
bit, and the basename (the filename, without colons, in that directory).
The result (s, t) is such that join(s, t) yields the original argument."""
|
<|file_name|>test_parser_ssh.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json<|fim▁hole|>
import intelmq.lib.test as test
from intelmq.bots.parsers.dragonresearchgroup.parser_ssh import \
DragonResearchGroupSSHParserBot
class TestDragonResearchGroupSSHPa... | import unittest |
<|file_name|>4f8bd7cac829_clean_db.py<|end_file_name|><|fim▁begin|>"""Clean db
Revision ID: 4f8bd7cac829
Revises: 3f249e0d2769<|fim▁hole|>
# revision identifiers, used by Alembic.
revision = '4f8bd7cac829'
down_revision = '3f249e0d2769'
from alembic import op
import sqlalchemy as sa
def upgrade():
''' Drop the ... | Create Date: 2014-01-09 14:03:13.997656
""" |
<|file_name|>VersionIdentifierFormatterPhaseValue.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.version.impl;
import net.sf.mmm.util.version.api.DevelopmentPhase;
import net.sf.m... | }
} |
<|file_name|>template.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a virtual module that is entirely implemented as an action plugin and runs on th... | |
<|file_name|>binner.py<|end_file_name|><|fim▁begin|>import numpy as N
class Binner(object):
"""Class to perform averages of arbitary variables over some bin
(i.e. range) of a coordinate.
An example:
r, u = calculateVelocitiesAtPositions()
# r is nx X ny X nz X 3 array of positions
... | import cPickle
import Gnuplot
u = cPickle.load(file('/Disk/radio3data1/s0567077/pd_64/u.000122880')) |
<|file_name|>string.js<|end_file_name|><|fim▁begin|>/**
@module ember
@submodule ember-htmlbars
*/
import Ember from 'ember-metal/core';
import EmberStringUtils from 'ember-runtime/system/string';
import { SafeString, escapeExpression } from 'htmlbars-util';
/**
Mark a string as safe for unescaped output with Ember... | SafeString, |
<|file_name|>expr.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Jeffery Olson
//
// Licensed under the 3-Clause BSD License, see LICENSE.txt
// at the top-level of this repository.
// This file may not be copied, modified, or distributed
// except according to those terms.
use std::fmt::{Show, Formatter, Result};
... | let printed_val = match var_expr.print() {
Ok(v) => v,
Err(e) => return Err(e) |
<|file_name|>vendor-prefix.js<|end_file_name|><|fim▁begin|>var style = document.createElement('p').style,
prefixes = 'O ms Moz webkit'.split(' '),
hasPrefix = /^(o|ms|moz|webkit)/,
upper = /([A-Z])/g,
memo = {};
function get(key) {
return (key in memo) ? memo[key] : memo[key] = prefix(key);
}
function prefi... | throw new Error('unable to prefix ' + key);
}
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.<|fim▁hole|> */
#![deny(warnings)]
mod protocol;
mod str_serialized;
pub use protocol::{
git_lfs_mime, ObjectAction, ObjectError, ObjectStatus, Operation, RequestBatch, RequestObject,
ResponseBatch, Respo... | *
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2. |
<|file_name|>02-states.js<|end_file_name|><|fim▁begin|>export function seed(db) {
const table = 'states'
let id = 1
return Promise.all([
db(table).del(),
// `id` is autoincrement and not generally necessary to explicitly define
// However, for the `company_state` seed, having a consistent `id` to
// refere... | db(table).insert({ id: id++, abbreviation: 'HI', name: 'Hawaii', country_id: 1 }),
db(table).insert({ id: id++, abbreviation: 'ID', name: 'Idaho', country_id: 1 }),
db(table).insert({ id: id++, abbreviation: 'IL', name: 'Illinois', country_id: 1 }), |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2015, Alberto Corona <alberto@0x1a.us>
// All rights reserved. This file is part of core-utils, distributed under the
// GPL v3 license. For full terms please see the LICENSE file.
#![crate_type = "bin"]
#![crate_name = "rm"]
#![feature(path_ext)]
sta... | }, |
<|file_name|>SCMTrigger.java<|end_file_name|><|fim▁begin|>/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Brian Westrich, Jean-Baptiste Quenot, id:cactusman
* 2015 Kanstantsin Shautsou
*
* Permission is hereby granted, free of charge, to any person obta... | * Run the SCM trigger with additional build actions. Used by SubversionRepositoryStatus
* to trigger a build at a specific revisionn number.
* |
<|file_name|>factory_body.go<|end_file_name|><|fim▁begin|>/*
* Flip API
*
* Description
*
* API version: 2.0.1
* Contact: cloudsupport@telestream.net
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package flip
type FactoryBody struct {
// AWS access key.
AwsAccessKe... | // Specify if your files are public or private (private files need authorization url to access). By default this is not set.
Acl string `json:"acl,omitempty"` |
<|file_name|>UnusedVariable.java<|end_file_name|><|fim▁begin|><|fim▁hole|> }
}<|fim▁end|> | class Foo {
public void foo() {
int i; |
<|file_name|>cci_no_inline_lib.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.o... | #![crate_name="cci_no_inline_lib"]
|
<|file_name|>base.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""The top-level package for ``django-mysqlpool``."""
# These imports make 2 act like 3, making it easier on us to switch to PyPy or
# some other VM if we need to for performance reasons.
from __future__ import (absolute_import, print_function, u... |
# Define this here so Django can import it.
DatabaseWrapper = base.DatabaseWrapper |
<|file_name|>app.py<|end_file_name|><|fim▁begin|># all the imports
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_template, flash
from queries import *
from functools import wraps
from contextlib import closing
from wtforms import SelectField, PasswordField, validato... |
@app.route('/results')
@login_required
def results(): |
<|file_name|>round.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from django.contrib.auth.models import User
from dixit import settings
from dixit.game.models.game import Game
from dixit.game.models.player import Player
from dixit.game.models.round import Round, RoundStatus, Play
from dixit.game.mod... | story_card = self.current.turn._pick_card()
Play.play_for_round(self.current, self.game.storyteller, story_card, 'story')
players = self.game.players.all().exclude(id=self.game.storyteller.id)
for player in players: |
<|file_name|>SunrveyService.java<|end_file_name|><|fim▁begin|>package com.tianyu.mesimp.survey.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Service;
import com.tianyu.mesimp.survey.bean.CompanyNum;
@Servi... | |
<|file_name|>b486.js<|end_file_name|><|fim▁begin|>//~ name b486<|fim▁hole|><|fim▁end|> |
alert(b486);
//~ component b487.js |
<|file_name|>watch_test_name_pattern_mode.test.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent ri... | cursorHide: '[MOCK - cursorHide]',
cursorRestorePosition: '[MOCK - cursorRestorePosition]', |
<|file_name|>var_int.rs<|end_file_name|><|fim▁begin|>use bytes::BytesMut;
use criterion::{black_box, criterion_group, criterion_main, Benchmark, Criterion};
use protocol::{Decode, Encode, Var};
fn criterion_benchmark(c: &mut Criterion) {
c.bench(
"benches",
Benchmark::new("write_var_u64", move |b| ... | b.iter(|| Var::<u64>::decode(&mut (black_box(&buf[0..]))).unwrap())
}),
); |
<|file_name|>test_inverse_kinematics.py<|end_file_name|><|fim▁begin|>import platform
import pytest
import math
import numpy as np
import dartpy as dart
def test_solve_for_free_joint():
'''
Very simple test of InverseKinematics module, applied to a FreeJoint to
ensure that the target is reachable
'''
... | |
<|file_name|>issue_tracker_service.py<|end_file_name|><|fim▁begin|># Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Provides a layer of abstraction for the issue tracker API."""
import logging
from api... | API explorer: https://goo.gl/xWd0dX |
<|file_name|>interface.ts<|end_file_name|><|fim▁begin|>import { ACTIONS, TYPE } from './constants';
import { CalendarViewEvent } from '../../../containers/calendar/interface';
export interface EventDownAction {
action: ACTIONS.EVENT_DOWN;
payload: {
type: TYPE;
idx: number;<|fim▁hole|> };
}
... | event: CalendarViewEvent; |
<|file_name|>SimpleMetricTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2016, Groupon, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code ... | }
@Test
public void equal_across_types() { |
<|file_name|>icon_about.py<|end_file_name|><|fim▁begin|>#----------------------------------------------------------------------
# This file was generated by D:\personal\src\airs\gui\images\make_images.py
#
from wx import ImageFromStream, BitmapFromImage, EmptyIcon
import cStringIO, zlib
<|fim▁hole|>def getData():... | |
<|file_name|>issue-4208-cc.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
// http://www.apache.org/l... | pub trait Trig<T> {
fn sin(&self) -> T; |
<|file_name|>api_handler.rs<|end_file_name|><|fim▁begin|>use typeable::Typeable;
use traitobject;<|fim▁hole|>use std::any::TypeId;
use std::mem;
use backend;
use super::{CallInfo};
use json::{JsonValue};
pub trait ApiHandler: Typeable {
fn api_call<'a, 'b>(&'a self, &str, &mut JsonValue, &'b mut (backend::Request... | |
<|file_name|>worker.js<|end_file_name|><|fim▁begin|>import path from 'path';
import {runScheduler} from './scheduler';<|fim▁hole|>import {initQueue} from './pipeline.queue';
logger.info(" _____ _ _ _ _ _ _ _ _ ");
logger.info("| | |_|___| | | |_| |_|_|");
logger.info("| --| | |... | import logger from '../util/logger';
import dotenv from 'dotenv';
import {loadConfig} from '../../config'; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.