prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>to_str.rs<|end_file_name|><|fim▁begin|>use ::ffi; use ::libc::c_char; use std::ffi::CStr; // To-string converters // See http://www.libnfc.org/api/group__string-converter.html /// Converts nfc_modulation_type value to string pub fn modulation_type(pnd: ffi::nfc_modulation_type) -> &'static str { uns...
pub fn target(buf: *mut *mut c_char, pnt: *mut ffi::nfc_target, verbose: u8) -> i32 { unsafe { ffi::str_nfc_target(buf, pnt, verbose) } }
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for freudiancommits project. import os DEBUG = True if os.environ.get('DJANGO_DEBUG', None) == '1' else False TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS import dj_database_url DATABASES ...
'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' } },
<|file_name|>flags.py<|end_file_name|><|fim▁begin|># flags.py # # Copyright (C) 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later vers...
<|file_name|>install.js<|end_file_name|><|fim▁begin|>"use strict"; var sqlite3 = require('sqlite3'); var authHelper = require('./server/helpers/auth'); var db = new sqlite3.Database('./data/users.db'); db.serialize(function() { db.run( 'CREATE TABLE "users" ('<|fim▁hole|> + '"id" I...
<|file_name|>ipaddr.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. # # 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 Lic...
Args: address: A string or integer representing the IP
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url from . import views urlpatterns = [ url(r'^([a-zA-Z0-9_\-]+)/$', views.poll, name='poll'), url(r'^([a-zA-Z0-9_\-]+).csv$', views.poll, {'export': True}, name='poll_export_csv'),<|fim▁hole|> url(r'^([a-zA-Z0-9_\-]+)/comment/(...
url(r'^([a-zA-Z0-9_\-]+)/comment/$', views.comment, name='poll_comment'),
<|file_name|>flatmap.rs<|end_file_name|><|fim▁begin|>#![crate_name = "sknife"] /// Flatten and map on a list /// /// # Arguments /// /// * `f` - the map function /// * `list` - A slice of elements to flatten and map /// /// # Example /// /// ``` /// use sknife::collection::flatmap; /// let mut list: Vec<i32> = (1..4)....
assert_eq!( flatmap(slice, |x: &mut i32| vec![*x]), vec![1, 2, 3]
<|file_name|>startup.py<|end_file_name|><|fim▁begin|># pylint: disable=unused-import, unused-variable, missing-docstring def _readline(): try: import readline except ImportError: print("Module readline not available.") else: import rlcompleter readline.parse_and_bind("tab: complete") import ...
del os, histfile _readline()
<|file_name|>main.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/. */ #![deny(unused_imports)] #![deny(unused_variables)] #![feature(...
#![allow(non_snake_case, dead_code)]
<|file_name|>point.ts<|end_file_name|><|fim▁begin|>/** * Модуль класса точек двухмерной плоскости * * @module */ ; /** * Класс точек двухмерной плоскости */ <|fim▁hole|>{ /** * Координата по оси абсцисс */ public x: number; /** * Координата по оси ординат */ public y: number; /** ...
class Point
<|file_name|>configobj.py<|end_file_name|><|fim▁begin|># configobj.py # A config file reader/writer that supports nested sections in config files. # Copyright (C) 2005-2014: # (name) : (email) # Michael Foord: fuzzyman AT voidspace DOT org DOT uk # Nicola Larosa: nico AT tekNico DOT net # Rob Dennis: rdennis AT gmail D...
self.indent_type = '' # preserve the final comment
<|file_name|>get-display-name.js<|end_file_name|><|fim▁begin|>function getDisplayName(WrappedComponent) { return WrappedComponent.displayName || WrappedComponent.name || "Component"; } <|fim▁hole|>export default getDisplayName;<|fim▁end|>
<|file_name|>bad-value-ident-true.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...
fn main() { }
<|file_name|>test_data.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2016 Didotech srl (http://www.didotech.com) # # This program is Free Software; you can redistribute it and/or # modify it under the terms of the...
# 2=Ricevuta bancaria # 3=Rimessa diretta # 4=Cessioni
<|file_name|>ChangeEvent.java<|end_file_name|><|fim▁begin|>/* * #%L * GwtMaterial * %% * Copyright (C) 2015 - 2018 GwtMaterialDesign * %% * 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...
public class ChangeEvent extends GwtEvent<ChangeEvent.ChangeHandler> { public static final Type<ChangeHandler> TYPE = new Type<>();
<|file_name|>server.go<|end_file_name|><|fim▁begin|>package ga import ( "bytes" "crypto/hmac" "crypto/sha256" "encoding/base64" "encoding/json" "fmt" "io/ioutil" "log" "net/http" "runtime" "time" ) const ( // PkgVersion is the current version of this package. Follows major, minor and // patch conventions...
// SendEvents posts one or more events to GameAnalytics using the server config func (s *Server) SendEvents(e []Event) error { payload, err := json.Marshal(e)
<|file_name|>canvas.react.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Uber Technologies, Inc. // 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 with...
<|file_name|>test_dummy_thread.py<|end_file_name|><|fim▁begin|>"""Generic thread tests. Meant to be used by dummy_thread and thread. To allow for different modules to be used, test_main() can be called with the module to use as the thread implementation as its sole argument. """ import dummy_thread as _thread import...
start_time = int(time.time()) _thread.start_new_thread(delay_unlock,(self.lock, DELAY)) if test_support.verbose: print
<|file_name|>server.js<|end_file_name|><|fim▁begin|>//setup Dependencies<|fim▁hole|>var connect = require('connect'); //Setup Express var express = require('express'); var path = require('path'); let app = express(); var server = require('http').Server(app); var io = require('socket.io')(server); var keypress = requir...
<|file_name|>index.ios.js<|end_file_name|><|fim▁begin|>/** * Sample React Native App * https://github.com/facebook/react-native * @flow */ import React, { Component } from 'react'; import { AppRegistry } from 'react-native'; import Navigation from './app/config/entry'; export default class RNJueJin extends Compon...
} }
<|file_name|>NetworkVarianceTableModel.java<|end_file_name|><|fim▁begin|>/* * This file is part of the GeMTC software for MTC model generation and * analysis. GeMTC is distributed from http://drugis.org/gemtc. * Copyright (C) 2009-2012 Gert van Valkenhoef. * * This program is free software: you can redistribute it...
<|file_name|>clustertriggerauthentication.go<|end_file_name|><|fim▁begin|>/* Copyright 2020 The Knative 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/LI...
untyped := ctx.Value(filtered.LabelKey{}) if untyped == nil {
<|file_name|>api-creation.component.ts<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2015 The Gravitee team (http://gravitee.io) * * 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 * * ...
tags: '<', tenants: '<', groups: '<', },
<|file_name|>DetailedResultsActivity.java<|end_file_name|><|fim▁begin|>package edu.osu.cse5236.group9.dieta; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import ...
@Override public void onStop() {
<|file_name|>indent.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from gi.repository import GObject, Gtk, Gedit, PeasGtk import ConfigParser UI_XML = '''<ui> <menubar name="MenuBar"> <menu name="ToolsMenu" action="Tools"> <placeholder name="ToolsOps_2"> <menuitem name="Change Indent" action=...
box.pack_start(section, False, False, 0) return box
<|file_name|>IRLS_tf_v2.py<|end_file_name|><|fim▁begin|># python 3 # tensorflow 2.0 from __future__ import print_function, division, absolute_import import os import argparse import random import numpy as np import datetime # from numpy import linalg import os.path as osp import sys cur_dir = osp.dirname(osp.abspath(...
<|file_name|>sessionmessages.cc<|end_file_name|><|fim▁begin|>/* * libjingle * Copyright 2010, Google Inc. * * 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 retain the abo...
AddXmlChildren(session, action_elems); return session;
<|file_name|>worddisplayvm.js<|end_file_name|><|fim▁begin|>///<reference path="./otmword.ts" /> ///<reference path="./wmmodules.ts" /> ///<reference path="./wgenerator.ts" /> ///<reference path="./ntdialog.ts" /> /** * 単語作成部で使用するViewModel */ class WordDisplayVM { /** * コンストラクタ * @param el バインデ...
create: function _create() {
<|file_name|>launcher.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.8.0 var db, monitor; db = require('./db.js'); monitor = require('./monitor.js'); <|fim▁hole|> var m; db.createClient(); db.clearQueue(); m = monitor.createMonitor().start(); }); };<|fim▁end|>
module.exports.launch = function() { require('./argv_parser.js').parse(process.argv.slice(2), function() {
<|file_name|>Wall.js<|end_file_name|><|fim▁begin|>"use strict"; function Wall(layer, id) { powerupjs.GameObject.call(this, layer, id); // Some physical properties of the wall this.strokeColor = 'none'; this.fillColor = 'none'; this.scoreFrontColor = "#FFC800"; this.scoreSideColor = "#B28C00"; this.defaultFron...
<|file_name|>issues.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 - present Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS ...
for report in reports: t = report[JSON_INDEX_TYPE] # assert failures are not very informative without knowing
<|file_name|>cli.ts<|end_file_name|><|fim▁begin|>/// <reference path="../typings/node/node.d.ts" /> import generator = require("./sequelize-auto-ts"); import fs = require("fs"); let prompt = require("prompt"); if (process.argv.length > 2) { processFromCommandLines(); } else { processFromPrompt(); ...
{ console.log("Database: " + options.database);
<|file_name|>activeCoin.js<|end_file_name|><|fim▁begin|>import { DASHBOARD_ACTIVE_COIN_CHANGE, DASHBOARD_ACTIVE_COIN_BALANCE, DASHBOARD_ACTIVE_COIN_SEND_FORM, DASHBOARD_ACTIVE_COIN_RECEIVE_FORM, DASHBOARD_ACTIVE_COIN_RESET_FORMS, DASHBOARD_ACTIVE_SECTION, DASHBOARD_ACTIVE_TXINFO_MODAL, ACTIVE_COIN_GET_A...
balance: 0, addresses: null, activeSection: 'default', showTransactionInfo: false,
<|file_name|>tensor_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 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.apache.org/lic...
b.ReportAllocs() for i := 0; i < b.N; i++ { if t, err := NewTensor(v); err != nil || t == nil { b.Fatalf("(%v, %v)", t, err)
<|file_name|>formfields.py<|end_file_name|><|fim▁begin|># file eulcommon/djangoextras/formfields.py # # Copyright 2010,2011 Emory University Libraries # # 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...
# use size to set maximum length if 'size' in extra_attrs:
<|file_name|>database2.py<|end_file_name|><|fim▁begin|>from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net' __docformat__ = 'restructuredtext en' ''' The database used to store ebook metadata ''' import os, sys, shutil, cStringIO, glob, time, functools...
if notify:
<|file_name|>access_control_config.py<|end_file_name|><|fim▁begin|>## This file is part of Invenio. ## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## publis...
<|file_name|>Root.js<|end_file_name|><|fim▁begin|>import React from 'react' import { Router, Route, hashHistory, browserHistory, IndexRoute } from 'react-router'<|fim▁hole|>import Register from '../components/hello/Register' import Index from '../components/index/Index' import HelloWorld from '../components/hello/Hello...
import MainContainer from '../components/MainContainer' import Login from '../components/hello/Login'
<|file_name|>HCenter3.py<|end_file_name|><|fim▁begin|># encoding: utf-8 from yast import import_module import_module('UI') from yast import * class HCenter3Client:<|fim▁hole|> VCenter(PushButton(Opt("vstretch"), "Button 1")), VCenter(PushButton(Opt("vstretch"), "Button 2")), VCenter(PushBu...
def main(self): UI.OpenDialog( Opt("defaultsize"), VBox(
<|file_name|>remove-gallery-image.component.ts<|end_file_name|><|fim▁begin|>import { Component, EventEmitter, Input, Output } from '@angular/core'; import { GalleryImageService } from '../../../../shared/services/gallery-image.service'; @Component({ selector: 'respond-remove-gallery-image', templateUrl: 'remov...
<|file_name|>replace_wrapped.js<|end_file_name|><|fim▁begin|>// Expects to be preceeded by javascript that creates a variable called selectRange that // defines the segment to be wrapped and replaced. // create custom range object for wrapSelection var replaceRange = $.fn.range; replaceRange.ClearVariables(...
$.scrollTo( selectRange.startContainer, 0, {offset: {top:-from_top, left:0 } } );
<|file_name|>overloaded-builtin-operators-0x.cpp<|end_file_name|><|fim▁begin|>// RUN: %clang_cc1 -fsyntax-only -fshow-overloads=best -std=c++11 -verify %s <|fim▁hole|>struct X { operator T() const {return T();} }; void test_char16t(X<char16_t> x) { bool b = x == char16_t(); }<|fim▁end|>
template <class T>
<|file_name|>ActiveMQServerLogger.java<|end_file_name|><|fim▁begin|>/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You...
@LogMessage(level = Logger.Level.WARN)
<|file_name|>simple_modis_algorithms.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------- # Copyright * 2014, United States Government, as represented by the # Administrator of the National Aeronautics and Space Administration. All # rights reserved. # # The Cr...
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
<|file_name|>managers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # This file is part of wger Workout Manager. # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, eithe...
return users.filter(Q(groups__permissions=perm_gym) | Q(groups__permissions=perm_gyms) |
<|file_name|>convert.py<|end_file_name|><|fim▁begin|># encoding: utf-8 # # 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/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com...
return None return unicode(value)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
__author__ = 'zhonghong'
<|file_name|>table.SQL.py<|end_file_name|><|fim▁begin|><|fim▁hole|># CREATE TABLE and INSERT (possible). ### import os, sys try: from MonetDBtesting import process except ImportError: import process clt = process.client('sql', user = 'my_user', passwd = 'p1', stdin = open(os.path.join(os....
### # SET a GRANTed ROLE for a USER (possible).
<|file_name|>exports.js<|end_file_name|><|fim▁begin|>define('exports@*', [], function(require, exports, module){ <|fim▁hole|><|fim▁end|>
exports.a = 1; });
<|file_name|>store_others.go<|end_file_name|><|fim▁begin|>//go:build !windows // +build !windows package fs import ( "os"<|fim▁hole|> func notEmptyErr(err error) bool { return err.(*os.PathError).Err == syscall.ENOTEMPTY }<|fim▁end|>
"syscall" )
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from __future__ import unicode_literals, print_function, division<|fim▁end|>
# -*- coding: UTF-8 -*-
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>import styles from './index.css' import React from 'react' export default React.createClass({ propTypes: { isLoading: React.PropTypes.bool.isRequired }, render() { return ( <div className={ this.props.isLoading === true ? style...
<|file_name|>getMethod.js<|end_file_name|><|fim▁begin|><|fim▁hole|> var fs = require('fs'); var path = require('path'); var getRoutes = {}; getRoutes['/'] = require('./get/index.js').getPage; getRoutes['/level'] = require('./get/level.js').getPage; getRoutes['/play'] = require('./get/play.js').getPage; getRoutes['Er...
/* module ในการเก็บ route ใน เมธอด GET */
<|file_name|>test_expressions.py<|end_file_name|><|fim▁begin|>import vtrace.tests as vt_tests<|fim▁hole|>breakpoints = { 'windows': 'ntdll.NtTerminateProcess', 'linux': 'libc.exit', 'freebsd': 'libc.exit', } class VtraceExpressionTest(vt_tests.VtraceProcessTest): def test_vtrace_sym(self): pla...
<|file_name|>demo_multiple_scenes.py<|end_file_name|><|fim▁begin|># # cocos2d # http://python.cocos2d.org # from __future__ import division, print_function, unicode_literals # This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__f...
director.run(main_scene)
<|file_name|>bitcoin_fr.ts<|end_file_name|><|fim▁begin|><TS language="fr" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>Cliquer à droite pour modifier l'adresse ou l'étiquette</translation> </message> <m...
<source>Open until %1</source>
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>import wx import wx.calendar from wx.lib.masked import TimeCtrl from wx.lib.agw import hypertreelist as HTL from datetime import datetime, time from lib import Task, DATA, PRIORITIES, DEFAULT_PRIORITY from decorators import requires_selection ID_ADD_TASK = 1000 ID_ADD_...
if task.due_date is not None: self.chkIsDue.SetValue(True)
<|file_name|>entry.js<|end_file_name|><|fim▁begin|>// React app import React from 'react' import {render} from 'react-dom' import App from './components/base_layout/App.jsx' // Redux state manager import { Provider } from 'react-redux' import { createStore } from 'redux' import reducers from './state_manager/reducers'...
export let store = createStore(reducers) render( <Provider store={store}>
<|file_name|>store.py<|end_file_name|><|fim▁begin|>from rknfilter.targets import BaseTarget from rknfilter.db import Resource, Decision, CommitEvery from rknfilter.core import DumpFilesParser class StoreTarget(BaseTarget): def __init__(self, *args, **kwargs):<|fim▁hole|> def process(self): commit = Comm...
super(StoreTarget, self).__init__(*args, **kwargs) self._dump_files_parser = DumpFilesParser()
<|file_name|>ip_vtk58.py<|end_file_name|><|fim▁begin|># Copyright (c) Charl P. Botha, TU Delft. # All rights reserved. # See COPYRIGHT for details. import config from install_package import InstallPackage import os import re import shutil import sys import utils BASENAME = "VTK" GIT_REPO = "http://vtk.org/VTK.git" GI...
# on Win, inst/VTK/bin contains the so files config.VTK_SODIR = os.path.join(self.inst_dir, 'bin')
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Parsing module for Rurtle programs. //! //! Note that parsing requires some additional information, i.e. the number of //! arguments for a function. Function calls in Rurtle need neither parenthesis //! nor something else, so this is legal: //! //! ```text //! FUNCA ...
Token::Number(num) => Ok(Number(num)), token => parse_error!(self, UnexpectedToken("Token::Number", token)),
<|file_name|>exception.go<|end_file_name|><|fim▁begin|>var user = os.Getenv("USER") func init() { if user == "" { panic("no value for $USER") } } func throwsPanic(f func()) (b bool) { <|fim▁hole|> if x := recover(); x!= nil { b =true } }() f() return })<|fim▁end|>
defer func() {
<|file_name|>submit_fastqc.py<|end_file_name|><|fim▁begin|>from gscripts import qtools import sys, os if not os.path.exists("fastqc/"): os.mkdir("fastqc") cmds = [] Sub = qtools.Submitter() for fileName in sys.argv[1:]: fastqc_command = "fastqc -o fastqc %s" %fileName<|fim▁hole|> cmds.append(fastqc_c...
<|file_name|>test_templates.py<|end_file_name|><|fim▁begin|># Copyright (C) 2011-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 # Soft...
class TestMake(unittest.TestCase): """Test template interpolation."""
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*! Provides packet encoding and decoding functionality, as well as the packet enum. This module does not handle the checksum. If it did, it would be incredibly difficult to write Fastnet tests.*/ pub use self::encoder::*; pub use self::decoder::*; use uuid; use std::c...
}
<|file_name|>sub.rs<|end_file_name|><|fim▁begin|>use super::song_info::SongInfo; use super::pos::{RowPosition, Point}; use super::{Sentence, SentenceOptions, SentenceParameters, Syllable, SyllableOptions, SyllableParameters, AsSentenceOptions, AsSyllableOptions}; use ::overlay::*; use ::overlay::pos::*; use...
{ let filter_fun = |sentence_candidate: &&Sentence| { match (sentence.syllables.first(),
<|file_name|>integration_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 Couchbase, 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...
} var err error var datasetRegexp *regexp.Regexp
<|file_name|>0006_auto_20160716_1641.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-07-16 16:41 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ...
model_name='charity', name='gateway', field=models.ManyToManyField(through='campaign.GatewayProperty', to='campaign.Gateway'), ),
<|file_name|>test.ts<|end_file_name|><|fim▁begin|>/* * Copyright 2017 Banco Bilbao Vizcaya Argentaria, S.A. * * 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.or...
BrowserDynamicTestingModule, platformBrowserDynamicTesting()
<|file_name|>prediction_metrics_manager_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate ...
# along with this program. If not, see http://www.gnu.org/licenses. # # http://numenta.org/licenses/ # ----------------------------------------------------------------------
<|file_name|>authentication.py<|end_file_name|><|fim▁begin|>import urllib def basic_authentication(username=None, password=None, protocol="http"): from .fixtures import server_config, url build_url = url(server_config()) query = {} return build_url("/webdriver/tests/support/authentication.py", ...
protocol=protocol)
<|file_name|>AutoUpdateReceiver.java<|end_file_name|><|fim▁begin|>package com.coolweather.app.receiver; import com.coolweather.app.service.AutoUpdateService; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; public class AutoUpdateReceiver extends BroadcastRecei...
}
<|file_name|>serialization_profile.py<|end_file_name|><|fim▁begin|>from __future__ import print_function import shutil import os.path import tempfile import cProfile import pstats import nineml from nineml.utils.comprehensive_example import ( instances_of_all_types, v1_safe_docs) from nineml.serialization import ex...
<|file_name|>WebSecurityConfigurerAdapterTests.java<|end_file_name|><|fim▁begin|>/* * Copyright 2002-2018 the original author or 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 ...
filterChain.doFilter(request, response);
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub struct Allergies(u32); impl Allergies { pub fn new(x: u32) -> Allergies { Allergies(x) } pub fn is_allergic_to(&self, allergen: &Allergen) -> bool { allergen.value() & self.0 != 0 } pub fn allergies(&self) -> Vec<Allergen> { ...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::fmt; use std::error::Error; use std::sync::Mutex; use CapabilitiesSource; use gl; use version::Api; use version::Version; pub use self::compute::{ComputeShader, ComputeCommand}; pub use self::program::Program; pub use self::reflection::{Uniform, UniformBlock, ...
CompilationNotSupported,
<|file_name|>mouseevent.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 dom::bindings::codegen::Bindings::MouseEventBinding; u...
<|file_name|>skeletonmm-tarball.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # External command, intended to be called with run_command() or custom_target() # in meson.build # argv[1] argv[2] argv[3:] # skeletonmm-tarball.py <output_file_or_check> <source_dir> <i...
if sys.argv[1] == 'check': # Called from run_command() during setup or configuration. # Check which archive format can be used.
<|file_name|>tensor_util.py<|end_file_name|><|fim▁begin|># Copyright 2015 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.apach...
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>use log::error; use std::fmt::Debug; use thiserror::Error; #[derive(Error, Debug)]<|fim▁hole|> #[error("Error")] Error(String), } impl std::convert::From<std::io::Error> for FlushError { fn from(e: std::io::Error) -> Self { FlushError::Error(forma...
pub enum FlushError {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2012 NOEL-BARON Léo # All rights reserved.<|fim▁hole|># * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # * Redistributions in binary form must r...
# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: #
<|file_name|>objects.rs<|end_file_name|><|fim▁begin|>// Copyright 2019 Dmitry Tantsur <divius.inside@gmail.com> // // 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...
/// Return one and exactly one result. /// /// Fails with `ResourceNotFound` if the query produces no results and /// with `TooManyItems` if the query produces more than one result.
<|file_name|>pipe_unix.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.org/licen...
timeout: Option<u64>) -> IoResult<Inner> {
<|file_name|>address.js<|end_file_name|><|fim▁begin|>angular.module('ordercloud-address', []) .directive('ordercloudAddressForm', AddressFormDirective) .directive('ordercloudAddressInfo', AddressInfoDirective) .filter('address', AddressFilter) ; function AddressFormDirective(OCGeography) { return { ...
if (!address) return null;
<|file_name|>NetzobRegex.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #|...
>>> hexData = TypeConverter.convert(data, ASCII, HexaString)
<|file_name|>astar.rs<|end_file_name|><|fim▁begin|>use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::collections::{BinaryHeap, HashMap}; use std::hash::Hash; use super::visit::{EdgeRef, GraphBase, IntoEdges, VisitMap, Visitable}; use crate::scored::MinScored; use crate::algo::Measure; /// \[Generi...
/// let a = g.add_node((0., 0.)); /// let b = g.add_node((2., 0.)); /// let c = g.add_node((1., 1.)); /// let d = g.add_node((0., 2.));
<|file_name|>BoundaryLocationTest.js<|end_file_name|><|fim▁begin|>asynctest( 'browser.tinymce.core.keyboard.BoundaryLocationTest', [ 'ephox.agar.api.Assertions', 'ephox.agar.api.GeneralSteps', 'ephox.agar.api.Logger', 'ephox.agar.api.Pipeline', 'ephox.agar.api.Step', 'ephox.katamari.api.Fun'...
return new CaretPosition(container.getOrDie().dom(), offset); };
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>""" sphinxit.core.constants ~~~~~~~~~~~~~~~~~~~~~~~ Defines some Sphinx-specific constants. :copyright: (c) 2013 by Roman Semirook. :license: BSD, see LICENSE for more details. """ from collections import namedtuple RESERVED_KEYWORDS = ( ...
'OPTION', 'OR', 'ORDER', 'REPLACE',
<|file_name|>committees.py<|end_file_name|><|fim▁begin|>import re import lxml.html from pupa.scrape import Scraper, Organization class WYCommitteeScraper(Scraper): members = {} urls = { "list": "http://legisweb.state.wy.us/LegbyYear/CommitteeList.aspx?Year=%s", "detail": "http://legisweb.stat...
for row in rows[1:]: tds = row.xpath('.//td') name = tds[0].text_content().strip()
<|file_name|>issue-3036.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/lice...
fn main() { let x = 3
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|># # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMP...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014, 2015 CERN. # # Invenio 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 Foundat...
elif auth_code: flash(auth_msg, 'error') abort(apache.HTTP_UNAUTHORIZED)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
"""Intesishome platform."""
<|file_name|>LdapInjectionJndi.java<|end_file_name|><|fim▁begin|>import javax.naming.directory.DirContext; import org.owasp.esapi.Encoder; import org.owasp.esapi.reference.DefaultEncoder; public void ldapQueryBad(HttpServletRequest request, DirContext ctx) throws NamingException { String organizationName = request.g...
String organizationName = request.getParameter("organization_name"); String username = request.getParameter("username");
<|file_name|>choice.py<|end_file_name|><|fim▁begin|>import psidialogs <|fim▁hole|>s = psidialogs.choice(["1", "2", "3"], "Choose a number!") if s is not None: print(s)<|fim▁end|>
<|file_name|>gsdSubsample.py<|end_file_name|><|fim▁begin|>#open a gsd file and write out a subsampled version, keeping only every N timesteps #useful if you want to be analyzing a shorter trajectory import gsd.hoomd import argparse import time<|fim▁hole|>parser.add_argument('ofname',metavar='output',type=str,help='wher...
start = time.time() parser = argparse.ArgumentParser(description='Subsamble GSD trajectory') parser.add_argument('fname',metavar='input',type=str,help='trajectory file to be subsampled')
<|file_name|>stock.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import print_function, unicode_literals import frappe, random, erpnext from frappe.desk import query_report from erpnext.sto...
except Exception:
<|file_name|>quiz1.py<|end_file_name|><|fim▁begin|>"""Softmax.""" scores = [3.0, 1.0, 0.2] import numpy as np def softmax(x): """Compute softmax values for each sets of scores in x.""" return np.exp(x) / sum(np.exp(x)) print(softmax(scores)) <|fim▁hole|># Plot softmax curves import matplotlib.pyplot as plt...
<|file_name|>test_purchase.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2012 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General P...
<|file_name|>16.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export { ThunderstormStrong16 as default } from "../../";