prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>downloader.py<|end_file_name|><|fim▁begin|>import xbmcgui
import urllib
def download(url, dest, dp = None):<|fim▁hole|> if not dp:
dp = xbmcgui.DialogProgress()
dp.create("XBMCHUB...","Downloading & Copying File",' ', ' ')
dp.update(0)
urllib.urlretrieve(url,dest,lambda nb, bs, ... | |
<|file_name|>licenseck.py<|end_file_name|><|fim▁begin|># Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENS... | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
""",
|
<|file_name|>Conversation.tsx<|end_file_name|><|fim▁begin|>import { useEffect, useRef, useState } from "react"
import * as React from "react"
import {
RelayPaginationProp,
RelayRefetchProp,
createPaginationContainer,
} from "react-relay"
import { graphql } from "relay-runtime"
import Waypoint from "react-waypoint... | flex-grow: 1;
`
|
<|file_name|>test_static.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) Alex Urban (2019)
#
# This file is part of GWSumm.
#
# GWSumm 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, ei... | |
<|file_name|>AppTest.java<|end_file_name|><|fim▁begin|>package com.eric.drools_demo;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @para... | super( testName );
}
|
<|file_name|>factory_object_mapping.go<|end_file_name|><|fim▁begin|>package clientcmd
import (
"encoding/json"
"errors"
"fmt"
"sort"
"time"
"github.com/blang/semver"
"github.com/emicklei/go-restful-swagger12"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachin... | if !ok {
return nil, errors.New("provided options object is not a DeploymentLogOptions")
}
oc, _, err := f.clientAccessFactory.Clients() |
<|file_name|>test_MHD.py<|end_file_name|><|fim▁begin|>import pytest
import importlib
from mpi4py import MPI
from spectralDNS import config, get_solver, solve
from TGMHD import initialize, regression_test, pi
comm = MPI.COMM_WORLD
if comm.Get_size() >= 4:
params = ('uniform_slab', 'nonuniform_slab',
... | solve(solver, context) |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for src project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
<|fim▁hole|>application = get_wsgi_applic... | from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.settings")
|
<|file_name|>mass_spec_reverter.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2014 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | zip(
*[ |
<|file_name|>pipeline-hetero-lr-normal.py<|end_file_name|><|fim▁begin|>#
# Copyright 2019 The FATE 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
#
# h... | "callback_param": {
"callbacks": ["ModelCheckpoint"], |
<|file_name|>CommentRenderer.js<|end_file_name|><|fim▁begin|>pinion.backend.renderer.CommentRenderer = (function($) {<|fim▁hole|>
var constr;
// public API -- constructor
constr = function(settings, backend) {
var _this = this,
data = settings.data;
thi... | |
<|file_name|>Dlg_Banner.cpp<|end_file_name|><|fim▁begin|>/*
Free Download Manager Copyright (c) 2003-2016 FreeDownloadManager.ORG
*/
#include "stdafx.h"
#include "FDMCustomized.h"
#include "Dlg_Banner.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
C... | |
<|file_name|>domtree.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015, The Radare Project. All rights reserved.
// See the COPYING file at the top-level directory of this distribution.
// Licensed under the BSD 3-Clause License:
// <http://opensource.org/licenses/BSD-3-Clause>
// This file may not be copied, modif... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>import contextlib
from django.core.exceptions import ValidationError as DjangoValidationError
# Remants from MODM days
# TODO: Remove usages of aliased Exceptions
ValidationError = DjangoValidationError
ValidationValueError = DjangoValidationError
ValidationType... | |
<|file_name|>CompleteUnitGraph.java<|end_file_name|><|fim▁begin|>package soot.toolkits.graph;
/*-
* #%L
* Soot - a J*va Optimization Framework
* %%
* Copyright (C) 1999 Patrice Pominville, Raja Vallee-Rai
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU... | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details. |
<|file_name|>0004_auto__chg_field_graph_slug__chg_field_graph_name.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field... | }, |
<|file_name|>Utils.test.ts<|end_file_name|><|fim▁begin|>import {
stringify,
parseVersion,
isMatch,
startsWith,
endsWith,
toBoolean
} from "../src/Utils.js";
describe("Utils", () => {
describe("stringify", () => {
const user = {
id: 1,
name: "Blake",
password: "123456",
passwor... | expect(toBoolean("0")).toBe(false); |
<|file_name|>test96.py<|end_file_name|><|fim▁begin|>'''test using string.find() in if statement as a boolean. it returns an int'''
class X:
'''check string.find() usage'''
def foo(self):
s = 'abc'
if s.find('ab'):<|fim▁hole|> print 'this is a bug'
if not s.find('ab'):
print 'this is also ... | |
<|file_name|>LimitMatcher.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.<|fim▁hole|> *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is d... | * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>rhnRepository.py<|end_file_name|><|fim▁begin|># rhnRepository.py - Perform local repository functions.
#-------------------------------------------------------------------------------
# This module contains the functionality for providing local packages.
#
# Copyright (c) 2008--2014... | paths.append(template % (name, version, release, dirarch, name, nvrea[1],
release, pkgarch, extension))
return paths |
<|file_name|>https-client.go<|end_file_name|><|fim▁begin|>package main
import (
"crypto/tls"
"net/http"
"net/http/cookiejar"
"log"
)
func main() {
//跳过证书验证
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
//http cookie接口
cookieJar, _ := cookiejar.New(nil)
c := &http.Clie... | } |
<|file_name|>Mapa.java<|end_file_name|><|fim▁begin|>package org.hectordam.proyectohector;
import java.util.ArrayList;
import org.hectordam.proyectohector.R;
import org.hectordam.proyectohector.base.Bar;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesNotA... | import com.google.android.gms.maps.model.MarkerOptions; |
<|file_name|>ShipManager.js<|end_file_name|><|fim▁begin|>/* ShipManager.js
KC3改 Ship Manager
Managesship roster and does indexing for data access.
Saves and loads list to and from localStorage
*/
(function(){
"use strict";
window.KC3ShipManager = {
list: {},
max: 100,
pendingShipNum: 0,
// G... | |
<|file_name|>static-grid-page.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-static-grid-page',
templateUrl: './static-grid-page.component.html',<|fim▁hole|>export class StaticGridPageComponent implements OnInit {
constructor() { }
ite... | styleUrls: ['./static-grid-page.component.scss']
}) |
<|file_name|>issue-38669.rs<|end_file_name|><|fim▁begin|>// check that we don't StorageDead booleans before they are used
// EMIT_MIR issue_38669.main.SimplifyCfg-initial.after.mir
fn main() {<|fim▁hole|> let mut should_break = false;
loop {
if should_break {
break;
}
should_... | |
<|file_name|>base.go<|end_file_name|><|fim▁begin|>package setting
import (
"github.com/insionng/makross"
"github.com/insionng/makross/cache"
"runtime"
"time"
"github.com/insionng/yougam/helper"
"github.com/insionng/yougam/models"
)
func BaseMiddler() makross.Handler {
return func(self *makross.Context) error... | self.Set("SignedUser", user)
self.Set("friends", models.GetFriendsByUidJoinUser(user.Id, 0, 0, "", "id"))
messages, e := models.GetMessagesViaReceiver(0, 0, user.Username, "created") |
<|file_name|>timed.tsx<|end_file_name|><|fim▁begin|>import { act, render } from '@testing-library/react';
import React from 'react';
import {
ArraySlot,
enablePlugin,
loadPlugins,
resetPlugins,
} from 'react-plugin';
import { getNotificationsMethods } from '../../../testHelpers/pluginMocks';
beforeEach(() => j... | afterEach(() => {
act(() => { |
<|file_name|>configuration.py<|end_file_name|><|fim▁begin|># Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, 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.apach... | continue |
<|file_name|>unit_manager.py<|end_file_name|><|fim▁begin|>from attributes import *
from constants import *
# ------------------------------------------------------------------------------
#
class UnitManager (Attributes) :
""" <|fim▁hole|>
# ------------------------------------------------------------------... | UnitManager class -- manages a pool
""" |
<|file_name|>bitcoin_it.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="it" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About NavajoCoin</source>
<translation type="unfinish... | <message>
<location line="+122"/>
<source>Loading addresses...</source> |
<|file_name|>basic_search.rs<|end_file_name|><|fim▁begin|>// # Basic Example
//
// This example covers the basic functionalities of
// tantivy.
//
// We will :
// - define our schema
// - create an index in a directory
// - index a few documents into our index
// - search for the best document matching a basic query
//... | // |
<|file_name|>tours_eu.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="eu" version="2.1">
<context>
<name>TourXML</name>
<message>
<source>To add a note to a chord, press Shift while typing its letter name, or click on the staff.</source>
<comment>note-input</comm... | Horrek talka-hautematetik kenduko ditu eta askatasun handiagoz kokatzen utziko zaitu.</translation> |
<|file_name|>VisualMapping.js<|end_file_name|><|fim▁begin|>/**
* @file Visual mapping.
*/
define(function (require) {
var zrUtil = require('zrender/core/util');
var zrColor = require('zrender/tool/color');
var linearMap = require('../util/number').linearMap;
var each = zrUtil.each;
var isObject =... | |
<|file_name|>usb_storage.js<|end_file_name|><|fim▁begin|>/*
* This program is copyright © 2008-2012 Eric Bishop and is distributed under the terms of the GNU GPL
* version 2.0 with a special clarification/exception that permits adapting the program to
* configure proprietary "back end" software provided that all ... | cancelButton.value = "Cancel";
cancelButton.className = "default_button";
|
<|file_name|>trait2.rs<|end_file_name|><|fim▁begin|>// trait2.rs
trait Show {
fn show(&self) -> String;
}
impl Show for i32 {
fn show(&self) -> String {
format!("four-byte signed {}",self)
}
}<|fim▁hole|>
impl Show for f64 {
fn show(&self) -> String {
format!("eight-byte float {}",self... | |
<|file_name|>remove-session-cookie.spec.ts<|end_file_name|><|fim▁begin|>import { strictEqual } from 'assert';
import { Config, HttpResponse, HttpResponseOK } from '../core';
import {
SESSION_DEFAULT_COOKIE_HTTP_ONLY,
SESSION_DEFAULT_COOKIE_NAME,
SESSION_DEFAULT_COOKIE_PATH,
SESSION_DEFAULT_CSRF_COOKIE_NAME,
S... | |
<|file_name|>LogHelper.java<|end_file_name|><|fim▁begin|>package com.scicrop.se.commons.utils;
import java.io.IOException;
import org.apache.commons.logging.Log;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.ap... | System.err.println("Failed to find/access "+logPath+" !");
System.exit(1);
} |
<|file_name|>c2s_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -u
# -*- coding: utf-8 -*-
import libxml2
import time
import traceback
import sys
import logging
from pyxmpp.all import JID,Iq,Presence,Message,StreamError
from pyxmpp.jabber.all import Client
class Disconnected(Exception):
pass
class MyCli... | raise
|
<|file_name|>fullcalendar-tests.ts<|end_file_name|><|fim▁begin|>/// <reference types="jqueryui" />
import * as FullCalendar from 'fullcalendar';
import * as moment from 'moment';
// All examples from http://arshaw.com/fullcalendar/docs/
$('#calendar').fullCalendar({});
$('#calendar').fullCalendar({
weekends: fa... | },
{ |
<|file_name|>test_block.py<|end_file_name|><|fim▁begin|>from twitter_rec import Api
import time
USERNAME = "liaoyisheng89@sina.com"
PASSWD = "bigdata"
<|fim▁hole|>s = Api.Session(USERNAME, PASSWD, debug=False)
s.connect()
counter = 0
while True:
_ = s.read("/AllenboChina/followers")
if "eason" in _:
print ... | |
<|file_name|>cmd_get.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"
"fmt"
"github.com/ammario/fastpass"
)
func cmdGet(fp *fastpass.FastPass) {
search := flag.Arg(0)
if len(flag.Args()) != 1 {
usage()
}<|fim▁hole|> results := fp.Entries.SortByName()
if search != "" {
results = fp.Entries.S... | |
<|file_name|>SchemaReport.java<|end_file_name|><|fim▁begin|>/*
* Created on Dec 7, 2004
*
* This is the object given to the web-form.
* It's a mapping between the report as seen from the JSP-code to the
* way it's used in the service and domain layers.
*/
package no.abmu.abmstatistikk.annualstatistic.service;
... | |
<|file_name|>team_groups_new.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from datetime import timedelta
from django.utils import timezone
from rest_framework.response import Response
from sentry.api.base import Endpoint
from sentry.api.permissions import assert_perm
from sentry.api.serializ... | id=team_id,
) |
<|file_name|>python.py<|end_file_name|><|fim▁begin|>"""
Python Blueprint
================
Does not install python itself, only develop and setup tools.
Contains pip helper for other blueprints to use.
**Fabric environment:**<|fim▁hole|>
blueprints:
- blues.python
"""
from fabric.decorators import task
fro... |
.. code-block:: yaml |
<|file_name|>postprocessCrossmap.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
parser = argparse.ArgumentParser(description = "Postprocess the VCF file created by the CrossMap to make it valid again.", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("--vcf", help = "Path to the VCF file.")
ar... | import subprocess
import os
import argparse
import gzip |
<|file_name|>0022_auto_20160927_1051.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-27 15:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lots_admin', '0021_auto_2... | name='ward',
field=models.CharField(max_length=10, null=True),
),
] |
<|file_name|>advanced.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import 'rxjs/add/observable/empty';
import { GlobalService } from '../../shared/services/global.servic... | export class AdvancedService {
private urlPrefix = '';
private readonly walletName; |
<|file_name|>cached_db.py<|end_file_name|><|fim▁begin|>"""
Cached, database-backed sessions.
"""
from django.conf import settings
from django.contrib.sessions.backends.db import SessionStore as DBStore
from django.core.cache import cache
KEY_PREFIX = "django.contrib.sessions.cached_db"
class SessionStore(DBStore):
... | |
<|file_name|>triangulate_test.go<|end_file_name|><|fim▁begin|>package alg
import (
"reflect"
"strconv"
"testing"
)
func TestTriangulateConvex(t *testing.T) {
t.Parallel()
type testCase struct {
in []int
out [][3]int
}
testCases := []testCase{
{
[]int{0, 1},
[][3]int{},
},
{
[]int{0},
[][... | tc := tc |
<|file_name|>SectionFullWidth.tsx<|end_file_name|><|fim▁begin|>/**
* @author Adam Charron <adam.c@vanillaforums.com>
* @copyright 2009-2021 Vanilla Forums Inc.<|fim▁hole|>
import React from "react";
interface IProps extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode;
childrenAfter?: Rea... | * @license gpl-2.0-only
*/ |
<|file_name|>BaseActivity.java<|end_file_name|><|fim▁begin|>package ar_ubin.benotified.base;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import javax.inject.Inject;
import ar_ubin.benotified.Act... | public ApplicationComponent getApplicationComponent() { |
<|file_name|>rijndael.py<|end_file_name|><|fim▁begin|># -*- coding: iso-8859-1 -*-
""" crypto.cipher.rijndael
Rijndael encryption algorithm
This byte oriented implementation is intended to closely
match FIPS specification for readability. It is not implemented
for performance.
Copyright © (c) 20... | def setKey(self, key):
""" Set a key and generate the expanded key """
assert( len(key) == (self.Nk*4) ), 'Key length must be same as keySize parameter' |
<|file_name|>code_lexer.rs<|end_file_name|><|fim▁begin|>pub struct CodeLexer<'a> {
pub source: &'a str,
}
impl<'a> CodeLexer<'a> {
pub fn new(source: &'a str) -> CodeLexer<'a> {
CodeLexer { source: source }
}
pub fn is_keyword(&self, identifier: &str) -> bool {
match identifier {
... | return Some(index);
}
} |
<|file_name|>equipment.py<|end_file_name|><|fim▁begin|>from btmux_template_io.item_table import ITEM_TABLE
from btmux_template_io.parsers.ssw.crit_mapping import PHYSICAL_WEAPON_MAP, \
EQUIPMENT_MAP
from . ammo import add_ammo
from . common import add_crits_from_locations
from . weapons import add_weapon
def pop... | add_weapon(equip_e, unit_obj)
elif e_type == 'ammunition':
add_ammo(equip_e, unit_obj) |
<|file_name|>dotest_args.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import absolute_import
# System modules
import argparse
import sys
import multiprocessing
import os
import textwrap
# Third-party modules
# LLDB modules
from . import configuration
class ArgParseNamespace... | group.add_argument(
'--event-add-entries', |
<|file_name|>sample_img.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: ascii -*-
from __future__ import absolute_import
from __future__ import print_function
import sys
import base64
# use a base64 image as default/test image
TEST_IMAGE = """iVBORw0KGgoAAAANSUhEUgAAA8AAAALQCAYAAABfdxm0AAAABHNCSV... | NL8AgHDiFmgAABA2v/wi3XCD/TxvMOXKSY89Jt19t+Tnz/IAgDCjAQYAAGExf77d/P76a/DjZ5wh
vfWW1L692boAAN7F31pdLisry+kSPCc9Pd3pEjyHzM0jc/OiKfO8POmhh6Ru3UI3v927S99+G9nN
bzRl7hZkbh6Zw2tYBMvFkpOTFQgElJ2d7XQpnpKUlKQ1a9Y4XYankLl5ZG5etGS+c6e90NXcucGP |
<|file_name|>test_assign.py<|end_file_name|><|fim▁begin|>import pytest
from porcupy.compiler import compile as compile_
def test_consts():
assert compile_('X = 4') == ''
assert compile_('X = 4; y = X') == 'p1z 4'
assert compile_('X = 4; Y = X; z = Y') == 'p1z 4'
with pytest.raises(ValueError) as ex... | |
<|file_name|>UndertowSslConnection.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except ... |
@Override
public ChannelListener.Setter<? extends SslConnection> getHandshakeSetter() {
return handshakeSetter; |
<|file_name|>typegroups.py<|end_file_name|><|fim▁begin|>import array
import numbers
real_types = [numbers.Real]
int_types = [numbers.Integral]
iterable_types = [set, list, tuple, array.array]
try:
import numpy
except ImportError:
pass
else:
real_types.extend([numpy.float32, numpy.float64])
int_types.e... | |
<|file_name|>url_operations.py<|end_file_name|><|fim▁begin|>import urllib
import urlparse
def get_path(url):
scheme, host, path, query, fragment = urlparse.urlsplit(url)
return path
def get_host(url):
scheme, host, path, query, fragment = urlparse.urlsplit(url)
return host
def add_path(url, new_path)... | query_bits.extend(_make_query_tuples(params))
query = urllib.urlencode(query_bits) |
<|file_name|>os.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// 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... | |
<|file_name|>name.py<|end_file_name|><|fim▁begin|>import os
<|fim▁hole|> return os.path.splitext(fname)[0]
def change_fname_extension(fname, extension):
return remove_fname_extension(fname) + '.' + extension
def concat(path, fname):
return path + '/' + fname<|fim▁end|> | def remove_fname_extension(fname): |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import os
import uuid
from django.db import models
from django.core.files.uploadedfile import UploadedFile
from django.forms.forms import pretty_name
from . import get_image_cropper
from . import tasks
from . import settings
from . import utils
from . import signals... | |
<|file_name|>TestRoundRelaxed.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | * you may not use this file except in compliance with the License. |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.utils.translation import ugettext as _
from common import models as common_models
from hosts import models as hosts_models
class Project(common_models.TimestampedModel):
name = models.CharField(_('Name'), max_length=254)... | |
<|file_name|>bitmap.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/disk_cache/blockfile/bitmap.h"
#include <algorithm>
#include "base/logging.h"
nam... | if (old_maxsize < num_bits_ && clear_bits) {
SetRange(old_maxsize, num_bits_, false);
}
} |
<|file_name|>WindowsUWPInputDevice.hpp<|end_file_name|><|fim▁begin|>//Copyright (c) 2017 Finjin
//
//This file is part of Finjin Engine (finjin-engine).
//
//Finjin Engine is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR... | #pragma once
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3<|fim▁hole|> description="A tiny interface to intuitively access shell commands.",
author="Bede Kelly",
author_email="bedekelly97@gmail.com",
url="https://github.com/bedekelly/pysh",
provides=['pysh'])<|fim▁end|> | from distutils.core import setup
setup(name='PySh',
version='0.0.1',
py_modules=['pysh'], |
<|file_name|>match-arm-statics.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.o... | Variant2 {
dir: Direction
} |
<|file_name|>structs.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from collections import namedtuple
# Other useful structs
TopicPartition = namedtuple("TopicPartition",
["topic", "partition"])
BrokerMetadata = namedtuple("BrokerMetadata",
["nodeId", "host", "port", "rack"])
Parti... | ["offset", "metadata"])
|
<|file_name|>Solution.java<|end_file_name|><|fim▁begin|>package leetcode.reverse_linked_list_ii;
import common.ListNode;
public class Solution {
public ListNode reverseBetween(ListNode head, int m, int n) {
if(head == null) return null;
ListNode curRight = head;
for(int len = 0; len < n - m; len++)... | }
} |
<|file_name|>plot_2cdfs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
from builtins import input
import sys
import scipy
import numpy
import pmagpy.pmagplotlib as pmagplotlib
def main():
"""
NAME
plot_2cdfs.py
DESCRIPTION
makes plots of cdfs ... |
if __name__ == "__main__":
main() |
<|file_name|>syntax-extension-fmt.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.apach... | test(fmt!("%.1b", true), ~"t"); |
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Support for Aurora ABB PowerOne Solar Photvoltaic (PV) inverter."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
from aurorapy.client import AuroraError, AuroraSerialClient
from homeassistant.compon... | SensorEntityDescription(
key="instantaneouspower",
device_class=SensorDeviceClass.POWER,
native_unit_of_measurement=POWER_WATT, |
<|file_name|>versionstream.js<|end_file_name|><|fim▁begin|>var test = require("tape").test
var level = require("level-test")()
var testdb = level("test-versionstream")
var version = require("../")
var db = version(testdb)
var lastVersion
test("stuff some datas", function (t) {
t.plan(2)
db.put("pet", "fluffy",... | db.createVersionStream("pet", {maxVersion: 500, limit: 1})
.on("data", function (record) {
t.ok(record.version != null, "record has a version") |
<|file_name|>properties.py<|end_file_name|><|fim▁begin|>"""
Property reference docs:
- https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/mapping-canonical-property-names-to-mapi-names#tagged-properties
- https://interoperability.blob.core.windows.net/files/MS-OXPROPS/[MS-OXPROPS].pdf
- https://f... | | 0x6600 | 0x67FF | Provider-defined internal non-transmittable property |
| 0x6800 | 0x7BFF | Message class-defined content property |
| 0x7C00 | 0x7FFF | Message class-defined non-transmittable property ... |
<|file_name|>Server.java<|end_file_name|><|fim▁begin|>package net.tcp.socket;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
/**<|fim▁hole|>public class Server {
/**
* @param args
* @throws IOException
*/
public static void main(String[] arg... | * 必须先启动服务器 后连接 1、创建服务器 指定端口 ServerSocket(int port) 2、接收客户端连接 3、发送数据+接收数据
*
*/ |
<|file_name|>VulkanUtil.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2016- PPSSPP Project.
// 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.0 or later versions.
// This progra... | // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
#include "base/basictypes.h" |
<|file_name|>_dndSelector.js<|end_file_name|><|fim▁begin|>//>>built
define("dijit/tree/_dndSelector",["dojo/_base/array","dojo/_base/connect","dojo/_base/declare","dojo/_base/Deferred","dojo/_base/kernel","dojo/_base/lang","dojo/cookie","dojo/mouse","dojo/on","dojo/touch","./_dndContainer"],function(_1,_2,_3,_4,_5,_6,_... | _14.setSelected(true);
this.selection[_14.id]=_14; |
<|file_name|>grpc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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/LI... | response_deserializer=instance.Instance.deserialize,
)
return self._stubs["get_instance"]
|
<|file_name|>test_multiplex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
import tempfile
import shutil
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.utils import process
basedir = os.path.join(os.path.dirname(os.path.abspath... | expected_rc = 0
self.run_and_check(cmd_line, expected_rc) |
<|file_name|>index.js<|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/. */
import { createStore, applyMiddleware } from 'redux';
import th... | // Initial State:
{},
// Enhancers:
applyMiddleware( |
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>import contextlib
import gc
import multiprocessing
import os
from memsql_loader.util.apsw_storage import APSWStorage
from memsql_loader.util import paths
MEMSQL_LOADER_DB = 'memsql_loader.db'
def get_loader_db_path():
return os.path.join(paths.get_data_dir(), ... | return cls._instance
|
<|file_name|>mod_dir_implicit.rs<|end_file_name|><|fim▁begin|>// run-pass
// ignore-pretty issue #37195
mod mod_dir_implicit_aux;
pub fn main() {
assert_eq!(mod_dir_implicit_aux::foo(), 10);<|fim▁hole|><|fim▁end|> | } |
<|file_name|>install.rs<|end_file_name|><|fim▁begin|>//! Implementation of the install aspects of the compiler.
//!
//! This module is responsible for installing the standard library,
//! compiler, and documentation.
use std::env;
use std::fs;
use std::path::{Component, PathBuf};
use std::process::Command;
use build_... | t!(fs::create_dir_all(&empty_dir));
let mut cmd = Command::new(SHELL); |
<|file_name|>hash.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com>
# See LICENSE for details.
from .openssl import OpenSSL
# For python3
def _equals_bytes(a, b):
if len(a) != len(b):
return False
result = 0
fo... | md = OpenSSL.malloc(0, 64)
i = OpenSSL.pointer(OpenSSL.c_int(0))
OpenSSL.HMAC(OpenSSL.EVP_sha512(), key, len(k), d, len(m), md, i) |
<|file_name|>devstack.py<|end_file_name|><|fim▁begin|>"""
Specific overrides to the base prod settings to make development easier.
"""
from os.path import abspath, dirname, join
from .aws import * # pylint: disable=wildcard-import, unused-wildcard-import
# Don't use S3 in devstack, fall back to filesystem
del DEFAUL... |
# Whether to run django-require in debug mode. |
<|file_name|>perlin_2d_colors.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>#![feature(old_path)]
extern crate image;
extern crate noise;
extern crate rand;
use image::{ImageBuffer, Rgb};
use noise::Noise;
use noise::blocks::new_perlin_noise_2d;
use std::num::Float;
fn to_color(value: f64, factor: f64) -> u8 {
let ... | |
<|file_name|>tw.js<|end_file_name|><|fim▁begin|>//window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.... | $('#length').text(140-length);
} |
<|file_name|>MaskLayer.js<|end_file_name|><|fim▁begin|>/*
This file is part of Ext JS 4.2
Copyright (c) 2011-2014 Sencha Inc
Contact: http://www.sencha.com/contact
Commercial Usage
Licensees holding valid commercial licenses may use this file in accordance with the Commercial
Software License Agreement provided wit... | |
<|file_name|>wait.go<|end_file_name|><|fim▁begin|>package wait
import (
"fmt"
"time"
)
// Predicate is a helper test function that will wait for a timeout period of
// time until the passed predicate returns true. This function is helpful as
// timing doesn't always line up well when running integration tests with
... | select {
case <-exitTimer:
return fmt.Errorf("predicate not satisfied after time out")
default: |
<|file_name|>params.py<|end_file_name|><|fim▁begin|>p = dict(
subject = 'EG009',
#Fixation size (in degrees):
fixation_size = 0.4,
monitor='testMonitor',
scanner=True,
screen_number = 1,
full_screen = True,
radial_cyc = 10,
angular_cyc = 15,
angular_width=30,
size = 60, #This... | ) |
<|file_name|>generate_completion_cache.py<|end_file_name|><|fim▁begin|># coding=utf-8
# generate_completion_cache.py - generate cache for dnf bash completion
# Copyright © 2013 Elad Alfassa <elad@fedoraproject.org>
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute ... | def sack(self):
''' Generate cache of available packages ''' |
<|file_name|>farewells.rs<|end_file_name|><|fim▁begin|>pub fn goodbye() -> String {
"再见".to_string()<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>dbdparser.py<|end_file_name|><|fim▁begin|>"""
Module for parsing & validation of EPICS database definition (dbd) files.
Copyright 2012 Australian National University. Licensed under the new BSD License, as specified in the LICENSE file.
"""
from pyparsing import *
from parserutils import *
import os
impor... | self.lineno = lineno(loc,s)
def _process_menu(s,loc,toks):
choices = dict([(value.strip('"'),name) for name,value in toks[1]]) |
<|file_name|>mir-typeck-normalize-fn-sig.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://ww... | }
struct Providers<'x> { |
<|file_name|>WordBreakable.java<|end_file_name|><|fim▁begin|>/**
*
*/
package me.learn.personal.month5;
import java.util.HashSet;<|fim▁hole|>/**
* Title :
*
* Date : Dec 23, 2020
*
* @author bramanarayan
*
*/
public class WordBreakable {
/**
* @param args
*/
public static void main(String[] args) {
... | import java.util.List;
import java.util.Set;
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate curl;
extern crate rustc_serialize;
extern crate semver;
extern crate zip;
pub use commands::{Command, FetchCommand, FindCommand, MakeCommand};
macro_rules! assert_not_empty {
($e:expr) => (assert!(!$e.is_empty(), "{} is empty", stringify!($e)));
}
us... | pub mod version;
|
<|file_name|>user-interface-buttons.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
(function($) {
"use strict";
// Init Theme Core
Core.init();
// Init Demo JS
Demo.init();
// Init Ladda Plugin
Ladda.bind('.ladda-button', {
timeout: 2000
});
// Simulate loa... | 'use strict';
// Author: ThemeREX.com
// user-interface-buttons.html scripts
//
|
<|file_name|>test_io.py<|end_file_name|><|fim▁begin|>import os
from numpy.testing import assert_array_equal, raises, run_module_suite
import numpy as np
import skimage.io as io
from skimage.io.manage_plugins import plugin_store
from skimage import data_dir<|fim▁hole|>
def test_stack_basic():
x = np.arange(12).re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.