prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>uniform.rs<|end_file_name|><|fim▁begin|>use crate::*;
#[derive(Clone, Debug, Default)]
pub struct UniformCrossover;
impl CrossoverMethod for UniformCrossover {
fn crossover(
&self,
rng: &mut dyn RngCore,
parent_a: &Chromosome,<|fim▁hole|> parent_b: &Chromosome,
) ->... | |
<|file_name|>collapse-basic.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
@Component({
selector: 'ngbd-collapse-basic',
templateUrl: './collapse-basic.html'
})
export class NgbdCollapseBasic {<|fim▁hole|><|fim▁end|> | public isCollapsed = false;
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='mtg-deck-editor',
version='1.0.3',
url='https://github.com/buckket/mtg-deck-editor',
author='buckket',
author_email='buckket@cock.li',
packages=['mtgdeck... | |
<|file_name|>24.d.ts<|end_file_name|><|fim▁begin|>import * as React from "react";
import { CarbonIconProps } from "../../";
declare const Laptop24: React.ForwardRefExoticComponent<
CarbonIconProps & React.RefAttributes<SVGSVGElement>
>;<|fim▁hole|><|fim▁end|> | export default Laptop24; |
<|file_name|>LabelWidget.java<|end_file_name|><|fim▁begin|>package edu.mit.blocks.codeblockutil;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import ja... | } else {
setText(labelBeforeEdit);
}
|
<|file_name|>trustkey_test.go<|end_file_name|><|fim▁begin|>package daemon // import "github.com/tiborvass/docker/daemon"
import (
"io/ioutil"
"os"
"path/filepath"
"testing"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/fs"
)
// LoadOrCreateTrustKey
func TestLoadOrCreateTrustKeyInva... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![crate_name = "tasksink"]
/// Task sink
/// Binds PULL socket to tcp://localhost:5558
/// Collects results from workers via that socket
extern crate zmq;
use std::time::Instant;
fn main() {
// Prepare our context and socket
let mut context = zmq::Contex... | }
println!("\nTotal elapsed time: {:?}", start.elapsed());
} |
<|file_name|>changelg.rs<|end_file_name|><|fim▁begin|>extern crate git2;
extern crate regex;
use self::git2::{Repository, Commit};
use self::regex::Regex;
macro_rules! filter_option {
($e:expr) => (match $e { Ok(t) => t, Err(e) => return Some(Err(e)) })
}
macro_rules! option_match {
($e:expr) => (match $e { ... | });
|
<|file_name|>unifont.rs<|end_file_name|><|fim▁begin|>use std::fs::File;
use std::io::{BufRead, BufReader, Read, Write};<|fim▁hole|> let mut output = File::create("unifont.font").unwrap();
let mut count = 0;
for line_res in BufReader::new(input).lines() {
let line = line_res.unwrap();
let mut part... |
fn main() {
let mut input = File::open("unifont.hex").unwrap(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># flake8: noqa
"""
PILKit image processors.
A processor accepts an image, does some stuff, and returns the result.
Processors can do anything with the image you want, but their responsibilities
should be limited to image manipulations--they should be completely de... | |
<|file_name|>Query.js<|end_file_name|><|fim▁begin|>'use strict';
var pkg = require('../package');
var log = require('debug')(pkg.name + ':Query');
console.log.bind(log);
var error = require('debug')(pkg.name + ':Query');
console.error.bind(error);
var async = require('async');
var spawn = require('child_process').sp... | |
<|file_name|>alertMessage.ts<|end_file_name|><|fim▁begin|>import IError from './error';
interface IAlertMessage {
id?: number;
status?: number;
message?: string;<|fim▁hole|> alertType: string;
}
export default IAlertMessage;<|fim▁end|> | errors?: IError[]; |
<|file_name|>PrivMgrComponentOperations.cpp<|end_file_name|><|fim▁begin|>//*****************************************************************************
// @@@ START COPYRIGHT @@@
//
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distribu... | |
<|file_name|>struct-no-fields-5.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<|fim▁hole|>// option.... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>ArtistDetailActivity.java<|end_file_name|><|fim▁begin|>package com.leychina.activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebChromeClient;
import android.widget.ImageView;
import and... | import com.leychina.R; |
<|file_name|>pcmp.rs<|end_file_name|><|fim▁begin|>//! SSE4.2 (pcmpestri) accelerated substring search
//!
//! Using the two way substring search algorithm.
// wssm word size string matching<br>
// wslm word size lexicographical maximum suffix<|fim▁hole|>//
#![allow(dead_code)]
extern crate unchecked_index;
extern cra... | |
<|file_name|>cs.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'link', 'cs', {
acccessKey: 'Přístupový klíč',
advanced: 'Rozšířené',
advisoryContentType: '... | info: 'Informace o odkazu',
|
<|file_name|>BoardDAO.java<|end_file_name|><|fim▁begin|>package com.board;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
public class BoardDAO {
private Connection conn;
public BoardDAO(Connection conn){
this.conn ... | |
<|file_name|>widgets.py<|end_file_name|><|fim▁begin|>class Widget(object):
def __init__(self, options, *args, **kwargs):
super(Widget, self).__init__(*args, **kwargs)
self.options = options
<|fim▁hole|> def render(self, request):
raise NotImplementedError
def render_option_form(self... | def get_display_name(self):
raise NotImplementedError
|
<|file_name|>fractions.js<|end_file_name|><|fim▁begin|>const multiples =
'(hundred|thousand|million|billion|trillion|quadrillion|quintillion|sextillion|septillion)'
const here = 'fraction-tagger'
// plural-ordinals like 'hundredths' are already tagged as Fraction by compromise
const tagFractions = function (doc) {
... | doc.match('#Cardinal+ out? of every? #Cardinal').tag('Fraction', here) |
<|file_name|>admin-videos-ctrl.js<|end_file_name|><|fim▁begin|>angular.module('streama').controller('adminVideosCtrl', ['$scope', 'apiService', 'modalService', '$state', function ($scope, apiService, modalService, $state) {
$scope.loading = true;
apiService.genericVideo.list().then(function (response) {
$scope.v... | |
<|file_name|>JumpGameTest.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>
#include "JumpGame.hpp"
TEST_CASE("Jump Game") {
JumpGame s;
SECTION("Sample tests") {
vector<int> nums_1{2, 3, 1, 1, 4};
REQUIRE(s.canJump(nums_1));
vector<int> nums_2{3, 2, 1, 0, 4};
REQUIRE_FALSE(s.canJum... | #include "catch.hpp" |
<|file_name|>0003_auto_20170522_1154.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals<|fim▁hole|>from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
pygments.lexers.sw
~~~~~~~~~~~~~~~~~~~~~
Lexers for semantic web languages.
:copyright: 2007 by Philip Cooper <philip.cooper@openvest.com>.
:license: BSD, see LICENSE for more details.
Modified and extended ... | (r'(\s*)(\.)(\s*)', bygroups(Text, Punctuation, Text), '#pop'), |
<|file_name|>shipping_line.py<|end_file_name|><|fim▁begin|>from ..base import HaravanResource
class ShippingLine(HaravanResource):<|fim▁hole|><|fim▁end|> | pass |
<|file_name|>topology.go<|end_file_name|><|fim▁begin|>/*
Copyright 2021 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
Unles... | |
<|file_name|>createsigningcertificate.py<|end_file_name|><|fim▁begin|># Copyright 2009-2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source cod... | |
<|file_name|>componentFactory.ts<|end_file_name|><|fim▁begin|>import * as Debug from 'debug';
import * as Models from '../models';
const debug = Debug('neeo:device:ComponentFactory');
// TODO declare types in models/components to use here and in requestHandler.
const TYPE_BUTTON = 'button';
const TYPE_SWITCH = 'switc... | |
<|file_name|>SQLTransactionRollbackException.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... | * @param reason
* the string to use as the Reason string
|
<|file_name|>testTFIDF.py<|end_file_name|><|fim▁begin|>from tfidf import *
import psycopg2
import psycopg2.extensions
import math
def cos_sim(A,B):
def dot_product(a,b):
sum = 0.0
for key in a.keys():
if key in b:
sum += a[key]*b[key]
return sum
return dot_pro... | documentNumber = 0
docMap = [] |
<|file_name|>deeper_ns_list.py<|end_file_name|><|fim▁begin|>from invoke import task, Collection
@task
def toplevel(ctx):
pass
@task
def subtask(ctx):
pass
ns = Collection(<|fim▁hole|>)<|fim▁end|> | toplevel,
Collection('a', subtask,
Collection('nother', subtask)
) |
<|file_name|>IDomFacade.ts<|end_file_name|><|fim▁begin|>import { Bucket } from '../expressions/util/Bucket';
import { Attr, CharacterData, Element, Node } from '../types/Types';
/**
* The base interface of a dom facade
*
* @public
*/
export default interface IDomFacade {
/**
* Get all attributes of this element... | |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for board 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.7/howto/deployment/wsgi/
"""
import os<|fim▁hole|><|fim▁end|> | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "board.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application() |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[macro_use]
// has macros, must go first
mod utils;
pub mod annotation;
pub mod attribute;
pub mod attribute_group;
pub mod attributes;
pub mod choice;
pub mod common;
pub mod complex_content;
pub mod complex_type;
pub mod constants;
pub mod element;
pub mod extension;... | fn parse_occurs_err() {
let test_cases = vec![ |
<|file_name|>smooth.py<|end_file_name|><|fim▁begin|>'''<|fim▁hole|>@author: jiayu.zhou
'''
import numpy as np;
def least_squares(w, X, y):
'''
least squares loss.
MATLAB verified function.
f(x) = 1/2 * ||X * w - y||_F^2.
Parameters
----------
w: np.matrix
X: np.matrix
... | A set of (smooth) loss functions.
Created on Oct 2, 2014
|
<|file_name|>cast-in-array-size.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.... | |
<|file_name|>Filter.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2008 by Steven Wallace
snwallace@gmail.com
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 3 of... | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License |
<|file_name|>patrol.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Patrols the edges of the map going clockwise. Just drives around in circles,
taking pains not to hit a wall.
When we see a wall, turn right a little.
"""
from courier import RoboLink
robot = RoboLink.connect(name="... | # ^^^ by default, we get a 5-quality
# scanner and a 2-quality engine. well, we want to
# move faster, so we'll soup up our engine instead. |
<|file_name|>quotesAPI.ts<|end_file_name|><|fim▁begin|>import { AddQuoteParameters } from '@mymicds/sdk';
import { assertType } from 'typescript-is';
import * as api from '../libs/api';<|fim▁hole|>
import * as Random from 'random-js';
const engine = Random.engines.mt19937().autoSeed();
export default ((app, db) => {
... | import * as quotes from '../libs/quotes';
import RoutesFunction from './routesFunction'; |
<|file_name|>termination-trait-for-impl-termination.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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
/... | fn main() -> impl std::process::Termination { } |
<|file_name|>0012_add_asset_uid_to_xform.py<|end_file_name|><|fim▁begin|># coding: utf-8
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('logger', '0011_add-index-to-instance-uuid_and_xform_uuid'),
]
operations = [
migrations.AddField(
... | field=models.CharField(max_length=32, null=True), |
<|file_name|>rome_fields_dict.py<|end_file_name|><|fim▁begin|><|fim▁hole|> 'ROME-FIELD-05':[ 268.35435 , -30.2578356389 , '17:53:25.044','-30:15:28.2083' ],
'ROME-FIELD-06':[ 268.356124833 , -29.7729819283 , '17:53:25.47','-29:46:22.7349' ],
'ROME-FIELD-07':[ 268.529571333 , -28.693... | field_dict={'ROME-FIELD-01':[ 267.835895375 , -30.0608178195 , '17:51:20.6149','-30:03:38.9442' ],
'ROME-FIELD-02':[ 269.636745458 , -27.9782661111 , '17:58:32.8189','-27:58:41.758' ],
'ROME-FIELD-03':[ 268.000049542 , -28.8195573333 , '17:52:00.0119','-28:49:10.4064' ],
'ROME-FIE... |
<|file_name|>remainingTimePipe.js<|end_file_name|><|fim▁begin|>"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect =... | remaining = 60 + minute - currentMinute;
}
else {
remaining = minute - currentMinute; |
<|file_name|>test_oneview_ethernet_network_facts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
###
# Copyright (2016-2019) Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# You may not use this file except in compliance with the L... | config='config.json',
name=None |
<|file_name|>mapUtils.test.js<|end_file_name|><|fim▁begin|>import deepFreeze from 'deep-freeze';
import { arrayToMap, mapKeysToArray } from './mapUtils';
describe('arrayToMap', () => {
it('should create map from 2D array', () => {
const a = [
['key1', 'value1'],
['key2', 'value2']
];
deepFre... | it('should create empty map from empty array', () => {
const result = arrayToMap([]); |
<|file_name|>repr-c-issue-82792.rs<|end_file_name|><|fim▁begin|>// Regression test for #82792.
// run-pass
#![feature(const_generics_defaults)]
#[repr(C)]
pub struct Loaf<T: Sized, const N: usize = 1> {
head: [T; N],<|fim▁hole|>
fn main() {}<|fim▁end|> | slice: [T],
} |
<|file_name|>do_iter.py<|end_file_name|><|fim▁begin|>#!/bin/python3.5<|fim▁hole|>from collections import Iterable
d = {'a':1, 'b':2, 'c':3}
for key in d:
print(key)
for value in d.values():
print(value)
for ch in 'ABC':
print(ch)
print(isinstance('abc', Iterable) )
print(isinstance(123,Iterable))
for i, value i... | |
<|file_name|>tutorial_notes.py<|end_file_name|><|fim▁begin|># Copyright (c) 2020 Bartosz Szczesny <bszcz@bszcz.org>
# This program is free software under the MIT license.
print('\n# avoid new line at the beginning')
s = """\
test
"""
print(s)
print('\n# string are immutable')
s = 'string'
try:
s[1] = 'p'
except ... | print(list(a))
|
<|file_name|>DropdownToggle.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';
declare namespace DropdownToggle {
export interface DropdownToggleProps extends React.HTMLProps<DropdownToggle> {
bsRole?: string;
noCaret?: boolean;
open?: boolean;
title?: string;
... | bsSize?:string;
}
} |
<|file_name|>jstraceable.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use syntax::ext::base::ExtCtxt;
use syntax::codemap::Span... | add_attr("privatize");
add_attr("jstraceable");
|
<|file_name|>numeric.rs<|end_file_name|><|fim▁begin|>use std::char::{is_whitespace, to_digit};
use std::cmp::max;
use std::num::pow;
#[deriving(PartialOrd, Clone, Show, Eq)]
pub struct Numeric {
value: i64,
len: uint,
precision: uint
}
impl Numeric {
pub fn new(value: i64, len: uint, precision: uint) ... | }
}
|
<|file_name|>actions_it_test.go<|end_file_name|><|fim▁begin|>// +build integration
/*
Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments
Copyright (C) ITsysCOM GmbH
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as p... | actsLclCfg, err = config.NewCGRConfigFromFolder(actsLclCfgPath) |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>from itertools import count
from typing import Union
from dataclasses import dataclass, field
from OnePy.constants import ActionType, OrderType
from OnePy.sys_module.components.exceptions import (OrderConflictError,
... | self._check_size()
self._check_conflict(self.price, self.price_pct, name='price') |
<|file_name|>code128.cpp<|end_file_name|><|fim▁begin|>/*
* OpenRPT report writer and rendering engine
* Copyright (C) 2001-2011 by OpenMFG, LLC
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software... | if(!space) |
<|file_name|>feature-gate-cfg-target-vendor.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http:/... | fn main() {
cfg!(target_vendor = "x");
//~^ ERROR `cfg(target_vendor)` is experimental and subject to change |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>import math as mth
import numpy as np
#----------------------
# J Matthews, 21/02
# This is a file containing useful constants for python coding
#
# Units in CGS unless stated
#
#----------------------
#H=6.62606957E-27
HEV=4.13620e-15
#C=29979245800.0
#BOLTZMAN... | YR = 3.1556925e7
PI_E2_OVER_MC=0.02655103 # Classical cross-section |
<|file_name|>apicoverage_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 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.... | resTested, resAll := getTestedAPIsByLevel(test.Negative, test.Reg, test.apisOpenapi, test.apisTested)
if !equalAPIArray(resTested, test.ExpectedTested) {
t.Errorf("resTested did not match expected for test")
t.Errorf("Expected: %#v", test.ExpectedTested) |
<|file_name|>match.js<|end_file_name|><|fim▁begin|>const _transform = require('lodash/transform');
function MatchTransformer(match) {
if( !(this instanceof MatchTransformer) ) {
return this.transform(new MatchTransformer(match));
}
<|fim▁hole|> if( typeof match === 'string' ) {
// Escape str... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.contrib import admin
from article.models import Article
# Register your models here.
admin.site.register(Article)<|fim▁end|> | |
<|file_name|>tree.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';<|fim▁hole|>import { TooltipModule } from '../tooltip';
@NgModule({
imports: [
CommonModule,
TooltipModule
],
declarations: [
TreeCompone... | import { TreeComponent } from './tree';
import { TreeNodeComponent } from './tree-node'; |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse
from django.shortcuts import render
from django.views import generic
import api.soql
import json
from api.soql import *
# Create your views here.
def indexView(request):
context = {
"vehicleAgencies": getUniqueVal... | .groupBy([column]) |
<|file_name|>0015_auto__add_field_hardwarerelease_medium.py<|end_file_name|><|fim▁begin|># encoding: 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):
# Adding field 'Hardwarer... | 'original_filename': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'owner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'owned_files'", 'null': 'True', 'to': "orm['auth.User']"}), |
<|file_name|>eventcardlist_component_test.js<|end_file_name|><|fim▁begin|>// Copyright 2015 Google Inc. 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... | }); |
<|file_name|>mix299.py<|end_file_name|><|fim▁begin|>def Setup(Settings,DefaultModel):
# set1-test_of_models_against_datasets/osm299.py
Settings["experiment_name"] = "set1_Mix_model_versus_datasets_299px"
Settings["graph_histories"] = ['together'] #['all','together',[],[1,0],[0,0,0],[]]
# 5556x_minlen... | |
<|file_name|>nuoc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from heapq import heapify, heappop, heappush
with open('NUOC.INP') as f:
m, n = map(int, f.readline().split())
height = [[int(i) for i in line.split()] for line in f]
queue = ([(h, 0, i) for i, h in enumerate(height[0])]<|fim▁hole|>heap... | + [(h, m - 1, i) for i, h in enumerate(height[-1])]
+ [(height[i][0], i, 0) for i in range(m)]
+ [(height[i][-1], i, n - 1) for i in range(m)]) |
<|file_name|>emailutil.py<|end_file_name|><|fim▁begin|># Some useful functions to extract data out of emails
# Copyright (C) 2002-2012 John Goerzen & contributors
#
# 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
# th... | message = MailParser().parsestr(content, True) |
<|file_name|>tcp_socket.cc<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
#include "tcp_socket.h"
using namespace easynet;
//TCPSocket 已连接的服务器
TCPSo... | |
<|file_name|>clienttest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (C) 2012 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the ... | # This is a VirtualBox COM/XPCOM API client, no data needed.
wrapper = VirtualBoxManager(None, None)
|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Test mocks and helpers
from __future__ import absolute_import
from webob import Request
from xblock.runtime import DictKeyValueStore, KvsFieldData
from xblock.test.tools import TestRuntime
def make_request(body, method='POST'):
"""
Helper method to make req... | |
<|file_name|>azure_client_set.go<|end_file_name|><|fim▁begin|>package client
import (
"log"
"net/http"
"regexp"
"time"
"github.com/hashicorp/packer-plugin-sdk/useragent"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-12-01/compute"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-1... | PollClient() autorest.Client
// SubscriptionID returns the subscription ID that this client set was created for
SubscriptionID() string |
<|file_name|>social.py<|end_file_name|><|fim▁begin|>"""
Social.py
Contains elements that enable connecting with external social sites.
Copyright (C) 2015 Timothy Edmund Crosley
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public Licen... | self.rating(), self.default())
self.style['width'] = "%spx" % self.size() |
<|file_name|>guard.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Machinery to conditionally expose things.
use js::jsapi::... | condition: condition,
value: value,
}
} |
<|file_name|>api_scanner_main.cc<|end_file_name|><|fim▁begin|>/**
******************************************************************************
* api-scanner - Scan for API imports from a packaged 360 game *
******************************************************************************
* Copyright 2... |
namespace xe {
namespace tools { |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import hashlib
import json
import os
import uuid
from django import forms
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import V... | |
<|file_name|>base_model.py<|end_file_name|><|fim▁begin|>import numpy as np
import torch
import os
import sys
import functools
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import init
import torch.nn.functional as F<|fim▁hole|>class GANLoss(nn.Module):
def __init__(self, target_real_label=... | import torchvision.models as M
|
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>var webpackConfig = require("./webpack.config.js");
webpackConfig.devtool = "inline-source-map";
delete webpackConfig.externals;
delete webpackConfig.entry;
delete webpackConfig.output;
module.exports = function (config) {
config.set({
basePath: ".",
fr... | |
<|file_name|>benchmark.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import numpy as np
import pycuda.driver as drv
from neon.backends.nervanagpu import NervanaGPU
from openai_gemm import matmul
ng = NervanaGPU()
print drv.Context.get_current().get_device().name()
config = (
# m, n, k, AT, ... | ( 128, 7680, 2560, False, True), |
<|file_name|>ROLO_evaluation.py<|end_file_name|><|fim▁begin|># Copyright (c) <2016> <GUANGHAN NING>. 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.apach... |
gt_location = utils.find_gt_location( lines, test_id - 1) |
<|file_name|>clone.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... | if self.to_broker != partition.replicas[0]:
partition.swap_replica_positions(self.to_broker, partition.replicas[0]) |
<|file_name|>extendedDataDisplayBuilder.factory.js<|end_file_name|><|fim▁begin|>/**
* @ngdoc service
* @name merchello.models.extendedDataDisplayBuilder
*
* @description
* A utility service that builds ExtendedDataBuilder models
*/
angular.module('merchello.models')
.factory('e... | return {
createDefault: function() {
return new Constructor();
}, |
<|file_name|>build_numeric.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Generate the body of ieee.numeric_std and numeric_bit from a template.
# The implementation is based only on the specification and on testing (as
# the specifications are often ambiguous).
# The algorithms are very simple: carry ripp... | function size_unsigned (n : natural) return natural
is |
<|file_name|>warm_starting_util.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow 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://ww... | from tensorflow.python.training import saver |
<|file_name|>utils_test.go<|end_file_name|><|fim▁begin|>package main
import (
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Utils", func() {
Describe("absPathToFile", func() {
It("should return provided absolute path as is", func() {
Expect(absPathToFile("/lorem/ipsum/dolo... | It("should return true for valid date format", func() { |
<|file_name|>P4COMSTR.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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 limita... | |
<|file_name|>run_upgrade.py<|end_file_name|><|fim▁begin|>import os
from importlib import import_module
from django.core.management.base import BaseCommand
from django.utils import translation
from django.conf import settings
def get_modules():
path = os.path.join(settings.BASE_DIR, 'utils', 'upgrade')
root, ... | print('To run an upgrade use the following: `python3 manage.py run_upgrade --script 12_13`')
else: |
<|file_name|>fdb-core.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.export... | coll,
cat = {},
arr, |
<|file_name|>present-to-all.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
Object.defineProperty(exports, "__esModule", {
value: true
});
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _pure = require('recompose/pure');
var _pure2 = _interopRequireDefault(_pure);
var _SvgIcon = re... | 'use strict'; |
<|file_name|>configs-fn_args_density-vertical.rs<|end_file_name|><|fim▁begin|>// rustfmt-fn_args_density: Vertical
// Function arguments density
trait Lorem {
fn lorem(
ipsum: Ipsum,
dolor: Dolor,
sit: Sit,
amet: Amet,
);
fn lorem(
ipsum: Ipsum,
dolor: Dolor... | } |
<|file_name|>compile_utils_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 The TensorFlow 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://ww... | |
<|file_name|>gaia_auth_util.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 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 "google_apis/gaia/gaia_auth_util.h"
#include <vector>
#include "base/logging.h"... | |
<|file_name|>tachybradycardia.py<|end_file_name|><|fim▁begin|>def bradycardia(hr, lowerthresh):
"""
This module determines when in the ECG data there is bradycardia
:param hr: (ndarray) heart rate- used to determine when
bradycardia occurred in ECG trace
:param lowerthresh: (int or double) lower ... | import numpy as np
brady = [0] * np.size(hr)
for i in range(len(hr)):
if hr[i] <= int(lowerthresh): # this indicates bradycardia, |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>__author__ = 'Fabrizio Lungo<fab@lungo.co.uk>'
import os
import yaml
from __exceptions__.FileNotFound import FileNotFound
from section import ConfigurationSection
class Configuration(ConfigurationSection):
def __init__(self, fn='config.yml', name=None, create... | |
<|file_name|>test_course_locators.py<|end_file_name|><|fim▁begin|>"""
Tests of CourseKeys and CourseLocators
"""
import ddt
from bson.objectid import ObjectId
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator
from ... | testobj = CourseLocator(org=org, course=course, run=run)
self.check_course_locn_fields(testobj, org=org, course=course, run=run) |
<|file_name|>preparse.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Kay preparse management command.
:Copyright: (c) 2009 Accense Technology, Inc.
Takashi Matsuo <tmatsuo@candit.jp>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import ... | application.app.app_settings.PER_DOMAIN_SETTINGS.iteritems():
if not settings_name in settings_treated: |
<|file_name|>TestFuzzyRowAndColumnRangeFilter.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... | |
<|file_name|>request_for_quotation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _
from frappe.model.mapper imp... | |
<|file_name|>package.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from spack import *
class Libidl(AutotoolsPackage):
"""libraries for Interface Definition Language files"""
homepage = "https://developer.gnome.org/"
url = "https://ftp.gnome.org/pub/gnome/sources/libIDL/0.8/libIDL-0.8.14.tar.bz2"
... | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT) |
<|file_name|>0002_auto_20160331_1111.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-30 22:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wordproject', '0001_init... |
operations = [
migrations.AlterField(
model_name='wordrecord', |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import logging, os
import psycopg2
# settings
database_name = 'postgres_database'
user = 'postgres_user'
password = 'some_password_here_lol'
port = 5432
host = 'postgres_host_normally_localhost'
path_to_gnaf_data = '/path/to/gnaf/data/'
# setup
logging.basicConfig(fo... | try: |
<|file_name|>net.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "irc.h"
#include "db.h"... | {
printf("socket no message in first 60 seconds, %d %d\n", pnode->nLastRecv != 0, pnode->nLastSend != 0);
pnode->fDisconnect = true; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.