prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>decompose.rs<|end_file_name|><|fim▁begin|>//! Decomposition and tessellation. //! //! The [`Decompose`] iterator uses various traits to decompose and tessellate //! iterators of topological structures. //! //! This module provides two kinds of decomposition traits: conversions and //! [`Iterator`] extensio...
} impl<T> IntoEdges for BoundedPolygon<T> where
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from bacnet import BACNetTransform from cwmp import CWMPTransform from dns import DNSTransform from ftp import FTPTransform from http import HTTPTransform from http import HTTPWWWTransform<|fim▁hole|>from https import HTTPSGetTransform from https import HTTPSWWWTra...
from https import HTTPSTransform
<|file_name|>FunctionContainer.java<|end_file_name|><|fim▁begin|>package org.lolongo; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * A container of Functions. * * @author Xavier Courangon */ public class FunctionContain...
public FunctionContainer() { } // public FunctionContainer(Collection<Function> functions) {
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright (c) 2014 SwiftStack, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/license...
<|file_name|>field_level_explanation.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document<|fim▁hole|><|f...
class FieldLevelExplanation(Document): pass
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate piston_window; extern crate yasss13rtwcf_shared as shared; #[macro_use] extern crate slog; extern crate slog_term; #[macro_use] extern crate lazy_static; extern crate gfx_device_gl; extern crate image; extern crate nalgebra; extern crate input; extern crate...
let mut keys = HashSet::new(); while let Some(e) = window.next() { window.draw_2d(&e, |c, g| renderer.render(c, g));
<|file_name|>Top.ts<|end_file_name|><|fim▁begin|>export class TopRequest { constructor(<|fim▁hole|><|fim▁end|>
public By: string, public Class: number, public Source: number) {} }
<|file_name|>0002_auto_20151207_0017.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings....
('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), ],
<|file_name|>class_path.py<|end_file_name|><|fim▁begin|># PyJVM (pyjvm.org) Java Virtual Machine implemented in pure Python # Copyright (C) 2014 Andrew Romanenco (andrew@romanenco.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publ...
if not os.path.exists(path):
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>module.exports = function (grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), requirejs: { compile: { options: { shim: { gr...
name: "../node_modules/almond/almond",
<|file_name|>WebSocketService.ts<|end_file_name|><|fim▁begin|>/* * Wire * Copyright (C) 2018 Wire Swiss GmbH * * 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 the Licen...
switch (state) {
<|file_name|>static.py<|end_file_name|><|fim▁begin|>""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ from __future__ import unicode_literals import mimetypes import os import stat import posixpath import re try: from...
raise Http404(_("Directory indexes are not allowed here.")) if not os.path.exists(fullpath):
<|file_name|>files.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ use std::num::NonZeroU64; use anyhow::{format_err, Context, Error}; use async_trait::as...
repo.store_file(id, content_size, data, bubble_id).await?;
<|file_name|>speedtest.py<|end_file_name|><|fim▁begin|># This code is licensed under The GNU General Public License version 2 (GPLv2) # If you decide to fork this code please obey by the licensing rules. # # Thanks go to the-one who initially created the initial speedtest code in early 2014 # That code broke but it did...
<|file_name|>copy.js<|end_file_name|><|fim▁begin|>module.exports = { devTemplates: { files: [{ expand: true, cwd: '<%= appConfig.rutatemplates %>', dest:'<%= appConfig.rutadev %>/html', src: ['**/*'] }] }, devImages: { files: [{ ...
<|file_name|>colors.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export declare function darken(baseColor: string, amount: number): string
<|file_name|>gbm.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict import astropy.coordinates as coord import astropy.units as u import matplotlib.pyplot as plt #import mpl_toolkits.basemap as bm import numpy as np import spherical_geometry.polygon as sp from astropy.table import Table import astropy...
<|file_name|>PrinterInfoLoader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ * Copyright (c) 2015 BEEVC - Electronic Systems This file is part of BEESOFT * 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, e...
Returns: pygame font object """
<|file_name|>EntityAndTags.java<|end_file_name|><|fim▁begin|>/* * Copyright 2016 Axibase Corporation or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at<|...
* * https://www.axibase.com/atsd/axibase-apache-2.0.pdf
<|file_name|>test_utils.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under (1) the MaidSafe.net Commercial License, // version 1.0 or later, or (2) The General Public License (GPL), version 3, depending on which // licence you accepted on in...
<|file_name|>ghost-prod-config.js<|end_file_name|><|fim▁begin|>var path = require('path'), config; config = {<|fim▁hole|> production: { url: 'http://localhost:2368', database: { client: 'sqlite3', connection: { filename: path.join(__dirname, '../node_modules/ghost/content/data/ghost-dev...
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import * """ Also used in cms.tests.ApphooksTestCase """ urlpatterns = patterns('cms.test_utils.project.sampleapp.views', url(r'^$', 'sample_view', {'message': 'sample root page',}, name='sample-root'), url(r'^settings/$', 'sampl...
url(r'^account/$', 'sample_view', {'message': 'sample account page'}, name='sample-account'), url(r'^account/my_profile/$', 'sample_view', {'message': 'sample my profile page'}, name='sample-profile'), url(r'^(?P<id>[0-9]+)/$', 'category_view', name='category_view'), url(r'^notfound/$', 'notfound', name...
<|file_name|>step3_env.py<|end_file_name|><|fim▁begin|>#import sys, traceback import mal_readline import mal_types as types from mal_types import (MalSym, MalInt, MalStr, _symbol, _keywordu, MalList, _list, MalVector, MalHashMap, MalFunc) import reader, printer from env imp...
return MalInt(a.value-b.value) def multiply(args): a, b = args[0], args[1]
<|file_name|>helloWorld.py<|end_file_name|><|fim▁begin|>#coding=utf8 def hello(instr): bufstr = " helloWorld!" return (instr + bufstr), 123 <|fim▁hole|> k = "yzh" print hello(k)<|fim▁end|>
if __name__ == "__main__":
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>import bleach import json from django import forms from osf.models import CollectionProvider, CollectionSubmission from admin.base.utils import get_nodelicense_choices, get_defaultlicense_choices, validate_slug class CollectionProviderForm(forms.ModelForm): col...
<|file_name|>reset-mode.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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/lice...
<|file_name|>Kwginf.java<|end_file_name|><|fim▁begin|>package ee.esutoniagodesu.domain.jmet.table; import org.hibernate.annotations.Immutable; import javax.persistence.*; import java.io.Serializable; <|fim▁hole|> @Entity @Immutable @Table(name = "kwginf", schema = "jmet") public final class Kwginf implements Serializ...
<|file_name|>window.js<|end_file_name|><|fim▁begin|>var WINDOW = { ms_Width: 0, ms_Height: 0, ms_Callbacks: { 70: "WINDOW.toggleFullScreen()" // Toggle fullscreen }, initialize: function initialize() { this.updateSize(); // Create callbacks from keyboard $(document).keydown(function(inEvent) { WINDOW...
else if (document.webkitCancelFullScreen) document.webkitCancelFullScreen(); }
<|file_name|>bitwise_operations.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/Bitwise_operations fn main() { let a: u8 = 105; let b: u8 = 91; println!("a = {:0>8}", a); println!("b = {:0>8}", b); println!("a | b = {:0>8}", a | b); println!("a & b = {:0>8}", a & b); ...
<|file_name|>OrderExpressionImpl.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright 2013 SAP AG * <|fim▁hole|> * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distri...
* 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|>ArticleService.java<|end_file_name|><|fim▁begin|>package service; import java.util.List; import java.util.Map; import util.DataBaseUtils; public class ArticleService { /** * 通过类别获取文章列表 <|fim▁hole|> */ public List<Map<String,Object>> getArticlesByCategoryId(Integer categoryId,Integer start...
* @param categoryId * @param start * @param end
<|file_name|>htmlbrelement.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> * 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 dom::bindings::codegen::Bindings::HTMLBRElementBinding; use dom::bindings::codegen::InheritTypes::HTMLBRElemen...
/* This Source Code Form is subject to the terms of the Mozilla Public
<|file_name|>WorkerEventQueue.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2010 Google 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: * 1. Redistributions of source code must re...
namespace blink {
<|file_name|>high_lows.py<|end_file_name|><|fim▁begin|>import csv from datetime import datetime from matplotlib import pyplot as plt # Get dates, high, and low temperatures from file. filename = 'sitka_weather_2017.csv' with open(filename) as f: reader = csv.reader(f) header_row = next(reader) dates, hig...
current_date = datetime.strptime(row[0], "%Y-%m-%d") dates.append(current_date)
<|file_name|>event_tags.py<|end_file_name|><|fim▁begin|>import re from django import template from django import forms register = template.Library() def _process_field_attributes(field, attr, process): # split attribute name and value from 'attr:value' string params = attr.split(':', 1) attribute = par...
return h[key][1] @register.filter
<|file_name|>clean.rs<|end_file_name|><|fim▁begin|>use std::env; use cargo::ops; use cargo::util::{CliResult, CliError, Config}; use cargo::util::important_paths::{find_root_manifest_for_cwd}; #[derive(RustcDecodable)] struct Options { flag_package: Option<String>, flag_target: Option<String>, flag_manife...
-q, --quiet No output printed to stdout
<|file_name|>decode.ts<|end_file_name|><|fim▁begin|>import "./combine"; import combineTemplate from "./combinetemplate"; import { Desc } from "./describe"; import { Observable, Property } from "./observable"; <|fim▁hole|> /** @hidden */ export function decode<T extends Record<any, any>>(src: Observable<keyof T>, cases:...
export type FlattenedObservable<O> = O extends Observable<infer I> ? I : O export type DecodedValueOf<O> = FlattenedObservable<O[keyof O]>
<|file_name|>meta.go<|end_file_name|><|fim▁begin|>// Copyright 2015, David Howden // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "fmt" "tchaik.com/index" "tchaik.com/index/checklist" "tchaik.com/index/cursor" "tchaik.com/index/favour...
if err != nil { return nil, fmt.Errorf("error loading play history: %v", err) }
<|file_name|>attachment.py<|end_file_name|><|fim▁begin|>"""Module provides provides a convinient class :class:`Attachment` to access (Create, Read, Delete) document attachments.""" import base64, logging from os.path import basename from copy import deepcopy from mimetypes ...
def _deleteattach( conn, paths=[], hthdrs={}, **query ) : """
<|file_name|>ex_cca.py<|end_file_name|><|fim▁begin|>import numpy as np import matplotlib.pyplot as plt import spm1d #(0) Load dataset: dataset = spm1d.data.mv1d.cca.Dorn2012() y,x = dataset.get_data() #A:slow, B:fast<|fim▁hole|> #(1) Conduct non-parametric test: np.random.seed(0) alpha = 0.05 ...
<|file_name|>generate_projects.py<|end_file_name|><|fim▁begin|>import os, sys, multiprocessing, subprocess from build_util import * if __name__ == "__main__": cfg = cfg_from_argv(sys.argv) bi = build_info(cfg.compiler, cfg.archs, cfg.cfg) print("Starting build project: " + build_cfg.project_name + " ...") additio...
additional_options += " -DCFG_EXTERNAL_PATH:STRING=\"%s\"" % build_cfg.external_path additional_options += " -DCFG_INCLUDE_PATH:STRING=\"%s\"" % build_cfg.include_path
<|file_name|>strategy_utils.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2020 The TF-Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.<|fim▁hole|># # https://www.apache.org/licenses/LICENSE-2.0 # # Unl...
# You may obtain a copy of the License at
<|file_name|>load_dorado2009.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' Loader for all 2009 Dorado missions written for Monique's notice of bad depths in Dorado389_2009_084_02_084_02_decim.nc. Mike McCann MBARI 15 January 2013 @var __date__: Date of last svn commit @undocumented: __doc__ parser @status...
'Dorado389_2009_309_00_309_03_decim.nc',
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages setup( name="HtmlNode", version="0.1.8", packages=find_packages(), description="A simple Python HTML generator", author="Hing-Lung Lau", author_email="lung220@gmail.com", url="http://github.com/hl...
'License :: OSI Approved :: Apache Software License', ] )
<|file_name|>while-prelude-drop.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. //<|fim▁hole|>// except according to those terms. #[deriving(Eq)] enum t { a, b(~str), } f...
// 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 // option. This file may not be copied, modified, or distributed
<|file_name|>borrowck-borrow-overloaded-deref-mut.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 // ...
fn assign2<'a>(x: &'a Own<int>) { **x = 3; //~ ERROR cannot borrow
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import csv import json from cStringIO import StringIO from datetime import datetime from django.conf import settings from django.core import mail, management from django.core.cache import cache import mock from nose.plugins.attrib import ...
<|file_name|>database.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os from operator import itemgetter from gluon.storage import Storage from gluon.dal import DAL, Field, Row DBHOST = os.environ.get('DBHOST', 'localhost') DATABASE_URI = 'mysql://benchmarkdbuser:benchmarkdbpass@%s:3306/hello_world' % D...
if table == 'World': self.db.define_table('World', Field('randomNumber', 'integer')) elif table == 'Fortune':
<|file_name|>general.js<|end_file_name|><|fim▁begin|>jQuery.noConflict(); jQuery(document).ready(function(){ /** * This will remove username/password text in the login form fields **/ jQuery('.username, .password').focusout(function(){ if(jQuery(this).val() != '') { jQuery(this).css({backgroundPosition: "0...
jQuery.post(url,function(data){ jQuery('.dropbox').append(data); }); }
<|file_name|>winevt.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """Parser for Windows EventLog (EVT) files.""" import pyevt from plaso import dependencies from plaso.events import time_events from plaso.lib import errors from plaso.lib import eventdata from plaso.lib import specification from plaso.parser...
event_object = WinEvtRecordEvent( written_time, eventdata.EventTimestamp.WRITTEN_TIME, evt_record, record_number, event_identifier, recovered=recovered) parser_mediator.ProduceEvent(event_object)
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from mapwidgets.widgets import GooglePointFieldWidget from miot.models import PointOfInterest, Page, Profile from django import forms class PointOfInterestForm(forms.ModelForm):<|fim▁hole|> class Meta: model = PointOfInterest fields = ("name", "feat...
'''The form for a point of interest.'''
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var http = require('http') var https = require('https') var corsify = require('corsify') var collect = require('stream-collector') var pump = require('pump') var iterate = require('random-iterate') var limiter = require('size-limit-stream') var eos = require('end-of-s...
var app = name.split('/')[0] var channelNames = name.slice(app.length + 1)
<|file_name|>yaml_templates_command.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python import argparse import sys from yamltempl import yamlutils, vtl def main(): parser = argparse.ArgumentParser( description="Merge yaml data into a Velocity Template Language template") parser.add_argument('yamlf...
parser.add_argument('-o', '--output',
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Kay framework. :Copyright: (c) 2009 Accense Technology, Inc. Takashi Matsuo <tmatsuo@candit.jp>, Ian Lewis <IanMLewis@gmail.com> All rights reserved. :license: BSD, see LIC...
if sys.modules.has_key('google'): del sys.modules['google'] from google.appengine.api import apiproxy_stub_map setup()
<|file_name|>polling.py<|end_file_name|><|fim▁begin|>"""Support for Telegram bot using polling.""" import logging from homeassistant.const import ( EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP) from homeassistant.core import callback from . import ( CONF_ALLOWED_CHAT_IDS, PLATFORM_SCHEMA as TELEGRAM_PL...
async def async_setup_platform(hass, config): """Set up the Telegram polling platform.""" bot = initialize_bot(config)
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import<|fim▁hole|> class BasicAuth(BaseAuth): def authorization(self, request, response): if response is not None: challenges = self._authenticate_headers(response) if 'Basic' not in challenges: ...
from __future__ import unicode_literals from base64 import b64encode from django_digest.test.methods import WWWAuthenticateError, BaseAuth
<|file_name|>split_terminator.rs<|end_file_name|><|fim▁begin|>#![feature(core, unboxed_closures)] extern crate core; #[cfg(test)] mod tests { use core::str::SplitTerminator; use core::ops::FnOnce; use core::ops::FnMut; // impl StrExt for str { // #[inline] // fn contains<'a, P: Patter...
// };
<|file_name|>karate_chop.py<|end_file_name|><|fim▁begin|>import random import math import collections import tree_decomposition as td import create_production_rules as pr import graph_sampler as gs import stochastic_growth import probabilistic_growth import net_metrics import matplotlib.pyplot as plt import product<|f...
import networkx as nx import numpy as np
<|file_name|>virtualenv_hax.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from __future__ import print_function import argparse import distutils.spawn import subprocess import sys<|fim▁hole|>import virtualenv def main(argv=None): parser = argparse.ArgumentParser(description=( 'A ...
<|file_name|>QueryParameterTag.java<|end_file_name|><|fim▁begin|>/* * Copyright 2002 Sun Microsystems, 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 c...
<|file_name|>Administration.TenantForm.ts<|end_file_name|><|fim▁begin|>namespace PatientManagement.Administration { export interface TenantForm { TenantName: Serenity.StringEditor; TenantImage: Serenity.ImageUploadEditor; TenantWebSite: Serenity.StringEditor; OverrideUsersEmailSigna...
if (!TenantForm.init) { TenantForm.init = true;
<|file_name|>restrictions.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/li...
mc::cat_downcast(cmt_base, _) => { // When we borrow the interior of an enum, we have to
<|file_name|>openssl_wrap.py<|end_file_name|><|fim▁begin|># OpenSSL is more stable then ssl # but OpenSSL is different then ssl, so need a wrapper import sys import os import OpenSSL SSLError = OpenSSL.SSL.WantReadError import select import time import socket import logging ssl_version = '' class SSLConnection(obj...
<|file_name|>kindcheck.rs<|end_file_name|><|fim▁begin|>use std::{fmt, result::Result as StdResult}; use crate::base::{ ast::{self, AstType}, error::Errors, kind::{self, ArcKind, Kind, KindCache}, merge, pos::{self, BytePos, HasSpan, Span, Spanned}, scoped_map::{Entry, ScopedMap}, symbol::Sy...
}
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE...
# # Unless required by applicable law or agreed to in writing, software
<|file_name|>resnet_benchmark.py<|end_file_name|><|fim▁begin|># Copyright 2018 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://www....
NUM_EVAL_IMAGES = 50000
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package commands import ( "bytes" "encoding/json" "errors" "fmt" "io" "io/ioutil" "os" "os/exec" cmds "github.com/ipfs/go-ipfs/commands" repo "github.com/ipfs/go-ipfs/repo" config "github.com/ipfs/go-ipfs/repo/config" fsrepo "github.com/ipfs/go-ipfs/repo...
return errors.New("Failed to decode file as config") } return r.SetConfig(&cfg)
<|file_name|>postgres.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.api.settings") import copy import logging import django from api.webview.models import HarvesterResponse, Document, Version from scrapi import events from scra...
return self.response.content return str(self.response.content) @property
<|file_name|>test_pandas_utils.py<|end_file_name|><|fim▁begin|>import pytest import pandas as pd from lcdblib.pandas import utils @pytest.fixture(scope='session') def sample_table(): metadata = { 'sample': ['one', 'two'], 'tissue': ['ovary', 'testis'] } return pd.DataFrame(metadata) de...
test_sf = pd.Series({'sample': 'one', 'tissue': 'ovary', 'num': 100}, name='').sort_index()
<|file_name|>macro_parser.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/li...
// Only touch the binders we have actually bound for idx in range(ei.match_lo, ei.match_hi) { let sub = ei.matches[idx].clone();
<|file_name|>beamsearch_runner.py<|end_file_name|><|fim▁begin|>from typing import Callable, List, Dict, Optional import numpy as np from typeguard import check_argument_types from neuralmonkey.model.model_part import ModelPart from neuralmonkey.decoders.beam_search_decoder import (BeamSearchDecoder, ...
decoded_tokens = self._postprocess([before_eos_tokens]) else:
<|file_name|>model_issue_student_filter.py<|end_file_name|><|fim▁begin|># coding: utf-8 import django_filters from django import forms<|fim▁hole|>from django.utils.translation import ugettext_lazy as _ from courses.models import Course from issues.models import Issue from issues.model_issue_status import IssueStatus...
<|file_name|>udp.go<|end_file_name|><|fim▁begin|>package pool import ( "fmt" "net" ) const ( _net = "udp4" // ) func createUDPConnection(address string) (*net.UDPConn, error) { addr, err := net.ResolveUDPAddr(_net, address) if err != nil { return nil, err } conn, err := net.DialUDP(_net, nil, addr) if err ...
} return &UDPPool{buffers, done} }
<|file_name|>request_context.py<|end_file_name|><|fim▁begin|>"""Middleware to set the request context.""" from aiohttp.web import middleware <|fim▁hole|> # mypy: allow-untyped-defs @callback def setup_request_context(app, context): """Create request context middleware for the app.""" @middleware async d...
from homeassistant.core import callback
<|file_name|>vmstat.py<|end_file_name|><|fim▁begin|>''' Contains Vmstat() class Typical contents of vmstat file:: nr_free_pages 1757414 nr_inactive_anon 2604 nr_active_anon 528697 nr_inactive_file 841209 nr_active_file 382447 nr_unevictable 7836 nr_mlock 7837 nr_anon_pages 534070 nr_mapped ...
return ret
<|file_name|>location.py<|end_file_name|><|fim▁begin|>from rec import CourseRecord from score import RoomScore from evaluation import ScheduleEvaluation FULL_HOURS = 8 # 8:00AM - 4:00PM utilization PARTIAL_HOURS = FULL_HOURS * 0.75 #75% HALF_HOURS = FULL_HOURS * 0.50 #50% SPARSE_HOURS = FULL_HOURS * 0.25 #25% ...
self.evals = evals
<|file_name|>pathutils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # 2005/12/06 # Version 0.2.4 # pathutils.py # Functions useful for working with files and paths. # http://www.voidspace.org.uk/python/recipebook.shtml#utils # Copyright Michael Foord 2004 # Released subject to the BSD License # Please see h...
Usage : ``shutil.rmtree(path, onerror=onerror)`` """ import stat
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import os ADMINS = ( # ('Eduardo Lopez', 'eduardo.biagi@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': ...
'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites',
<|file_name|>django.py<|end_file_name|><|fim▁begin|>""" Django support. """ from __future__ import absolute_import import datetime from os import path from types import GeneratorType import decimal from django import VERSION if VERSION < (1, 8): from django.contrib.contenttypes.generic import ( GenericFor...
models.DecimalField: decimal.Decimal,
<|file_name|>basic_create_rollback.py<|end_file_name|><|fim▁begin|>example_template = Template({ 'A': RsrcDef({}, []),<|fim▁hole|> 'E': RsrcDef({'ca': GetAtt('C', 'a')}, []), }) engine.create_stack('foo', example_template) engine.noop(3) engine.rollback_stack('foo') engine.noop(6) engine.call(verify, Template())...
'B': RsrcDef({}, []), 'C': RsrcDef({'a': '4alpha'}, ['A', 'B']), 'D': RsrcDef({'c': GetRes('C')}, []),
<|file_name|>ec2_fitness.py<|end_file_name|><|fim▁begin|>""" Provides functions for evaluating the 'fitness' of ec2 instances. This module really just provides functions for deciding which instance is best to be killed by the autoscaler. """ def sort_by_system_instance_health(instances): return sorted( in...
Sort a list according to their fitness. This will return the list of instances in order of 'fitness': that is, that which is least desirable to kill is first in the list.
<|file_name|>cohorts.py<|end_file_name|><|fim▁begin|>""" This file contains the logic for cohorts, as exposed internally to the forums, and to the cohort admin views. """ import logging import random import request_cache from courseware import courses from django.contrib.auth.models import User from django.core.excep...
Look up the given user, and if successful, add them to the specified cohort. Arguments: cohort: CourseUserGroup
<|file_name|>CErrorInfo.cc<|end_file_name|><|fim▁begin|>// -*- c++ -*- //***************************************************************************** /** @file: CErrorInfo.cc * * @author Alexander Dreyer * @date 2006-03-06 * * This file defines the class CErrorInfo, which to conver error coedes to * meaningful ...
pErrorText[CTypes::no_ring] = "No polynomial ring structure defined.";
<|file_name|>tcp-stress.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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://www.apache.org...
fn main() { // This test has a chance to time out, try to not let it time out thread::spawn(move|| -> () {
<|file_name|>apiqueryresult.hpp<|end_file_name|><|fim▁begin|>//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 the License, or //(at your option) any later version. //This pro...
class HUGGLE_EX_CORE ApiQueryResultNode { public:
<|file_name|>git.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import binascii import io import logging...
<|file_name|>provenance_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013, 2014 Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this ...
def setUpModule():
<|file_name|>toggle_tool_button.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use Actionable; use Bin; use Buildable; use Container; use ToolButton; use ToolItem; use Widget; use ffi;<|fim▁hole|>u...
use glib::object::Cast;
<|file_name|>filetype_is_file.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::span_lint_and_help; use clippy_utils::ty::match_type; use clippy_utils::{get_parent_expr, paths}; use if_chain::if_chain; use rustc_hir as hir; use rustc_lint::LateContext; use rustc_span::source_map::Span; use super::FILETYPE...
<|file_name|>Date.js<|end_file_name|><|fim▁begin|>/** * A date picker component which shows a Date Picker on the screen. This class extends from {@link Ext.picker.Picker} * and {@link Ext.Sheet} so it is a popup. * * This component has no required configurations. * * ## Examples * * @example miniphone previ...
return null;
<|file_name|>job.py<|end_file_name|><|fim▁begin|>""" A job is an object with states: CREATED, RUNNING, DONE, FAILED, CANCELLED A job can be polled for completion and reports the progress so far if it is still RUNNING. """ from connection import H2OConnection import time import sys class H2OJob(object): """ A cla...
self._100_percent = False
<|file_name|>SqliteCustomFunctions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import sys if __name__ == '__main__': sys.path.append('../../') import json import logging import sqlite3 from gchelpers.ip.GeoDbManager import GeoDbManager from gchelpers.dt import D...
<|file_name|>local.rs<|end_file_name|><|fim▁begin|>use std::any::Any;<|fim▁hole|>#[derive(Debug, Clone)] pub struct SessLocal {} #[derive(Debug, Clone)] pub struct SessSeedLocal {} impl SessionSeed for SessSeedLocal { fn spawn(&self) -> Result<Box<Session>> { unimplemented!() } fn seed_type(&self) ...
use ::exec::Output; use ::exec::session::{SeedType, Session, SessionSeed}; use ::util::errors::*;
<|file_name|>utilities.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET try: import simplejson as json except ImportError: import json ADDRESS_FIELDS = ( 'first', 'middle', 'last', 'salutation', 'e...
'Projectbillingrule', 'Projectbillingtransaction', 'Projectgroup',
<|file_name|>CurrentFunction.java<|end_file_name|><|fim▁begin|>// $Id: CurrentFunction.java 96 2005-02-28 21:07:29Z blindsey $ package com.blnz.xsl.expr; import com.blnz.xsl.om.*; /** * Represents the XSLT Function: node-set current() * * The current function returns a node-set that has the * current node as i...
ExprContext context) throws XSLException {
<|file_name|>MagicOre.py<|end_file_name|><|fim▁begin|>from .MaterialModifier import * class MagicOre(MaterialModifier):<|fim▁hole|><|fim▁end|>
pass
<|file_name|>warlock.py<|end_file_name|><|fim▁begin|>from ..utils import * ## # Minions class AT_019:<|fim▁hole|> class AT_021: "Tiny Knight of Evil" events = Discard(FRIENDLY).on(Buff(SELF, "AT_021e")) AT_021e = buff(+1, +1) class AT_023: "Void Crusher" inspire = Destroy(RANDOM_ENEMY_MINION | RANDOM_FRIENDLY...
"Dreadsteed" deathrattle = Summon(CONTROLLER, "AT_019")
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import ( setup, find_packages, ) import sys with open("README.md", "r") as fh: long_description = fh.read() setup( name="beautifulsoup4", # NOTE: We can't import __version__ from bs4 because bs4/__init__.py is Python 2 code, # ...
"Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python",
<|file_name|>test_expressions.py<|end_file_name|><|fim▁begin|># # OpenCenter(TM) is Copyright 2013 by Rackspace US, Inc. ############################################################################## # # OpenCenter is licensed under the Apache License, Version 2.0 (the "License"); # you may not use this f...
self._model_create('facts', node_id=self.nodes['node-1']['id'],
<|file_name|>vlaCal-v2.1.js<|end_file_name|><|fim▁begin|>/*********************************************************/ /* vlaCalendar version 2.1 for mootools release 1.2 */ /*********************************************************/ var vlaCalendar = new Class({ 'slideDuration': 500, 'fadeDuration': 500, ...
case 'inputTop': default: top = this.getPos(this.element).y; }