prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>issue-5708.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
impl<'a, T> MyContainer<'a, T> { pub fn add (&mut self, foo: &'a MyTrait<T>) {
<|file_name|>parsers.py<|end_file_name|><|fim▁begin|>import re from markdown import Markdown, TextPreprocessor from smartypants import smartyPants from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import get_lexer_by_name, TextLexer class CodeBlockPreprocessor(TextPre...
A Markdown preprocessor that implements SmartyPants for converting plain ASCII punctuation characters into typographically correct versions
<|file_name|>test_profile.py<|end_file_name|><|fim▁begin|>"""Test suite for the profile module.""" import sys import pstats import unittest from difflib import unified_diff from io import StringIO from test.support import run_unittest import profile from test.profilee import testfunc, timer class Profi...
results[i+1].split('\n'), expected[method].split('\n')))) def test_calling_conventions(self):
<|file_name|>ClientApplicationAccessToken.java<|end_file_name|><|fim▁begin|>package fi.otavanopisto.pyramus.domainmodel.clientapplications; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; im...
@NotNull @OneToOne @JoinColumn(name = "clientApplicationAuthorizationCode", unique = true, nullable = false) private ClientApplicationAuthorizationCode clientApplicationAuthorizationCode;
<|file_name|>refl_gui.py<|end_file_name|><|fim▁begin|># pylint: disable = too-many-lines, invalid-name, line-too-long, too-many-instance-attributes, # pylint: disable = too-many-branches,too-many-locals, too-many-nested-blocks from __future__ import (absolute_import, division, print_function) try: from mantidplot ...
if self.mod_flag: ret, _saved = self._save_check() if ret == QtGui.QMessageBox.RejectRole:
<|file_name|>VanChartHyperLinkPane.java<|end_file_name|><|fim▁begin|>package com.fr.plugin.chart.custom.component; import com.fr.chart.chartattr.Plot; import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.design.Ext...
} @Override
<|file_name|>calc.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env kjscmd5 function Calculator(ui) { // Setup entry functions var display = ui.findChild('display'); this.display = display; this.one = function() { display.intValue = display.intValue*10+1; } this.two = function() { display.intValue = display.i...
this.equals = function() { this.lastop(); display.intValue = this.val; }
<|file_name|>webdriver_handlers.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::conversions::FromJSValConvertib...
match find_node_by_unique_id(page, pipeline, x) { Some(ref node) => { match HTMLIFrameElementCast::to_ref(node.root().r()) {
<|file_name|>histogram.cc<|end_file_name|><|fim▁begin|>/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2012-2019 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/LICENSE-2.0 *
<|file_name|>ComFixed.hpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2010-2019 The ESPResSo project * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 * Max-Planck-Institute for Polymer Research, Theory Group * * This file is part of ESPResSo. * * ESPResSo is free software: you can redistribute ...
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<|file_name|>CookieJar.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2012, 2016 Apple 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 reta...
#include "FrameLoader.h" #include "NetworkingContext.h" #include "PlatformCookieJar.h"
<|file_name|>associated-types-sugar-path.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://ww...
<|file_name|>loggers.py<|end_file_name|><|fim▁begin|># ***************************************************************************** # conduct - CONvenient Construction Tool # # 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...
if self.stream: self.flush() if hasattr(self.stream, 'close'): self.stream.close()
<|file_name|>test_root.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # 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. Th...
<|file_name|>pdf.rs<|end_file_name|><|fim▁begin|>// Copyright 2018-2019, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <https://opensource.org/licenses/MIT> use std::convert::TryFrom; use std::ffi::{C...
<|file_name|>ehci.rs<|end_file_name|><|fim▁begin|>use core::ptr::{read, write}; use common::debug; use drivers::pciconfig::PciConfig; use schemes::KScheme; #[repr(packed)] struct Setup { request_type: u8, request: u8, value: u16, index: u16, len: u16, } #[repr(packed)] struct Qtd { next: u3...
// if eecp > 0 { // if pci.read(eecp) & ((1 << 24) | (1 << 16)) == (1 << 16) { // debug::d("Taking Ownership"); // debug::d(" ");
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>""" Serializers and ModelSerializers are similar to Forms and ModelForms. Unlike forms, they are not constrained to dealing with HTML output, and form encoded input. Serialization in REST framework is a two-phase process: 1. Serializers marshal between complex ...
Note that all fields from the base classes are used. """ fields = [(field_name, attrs.pop(field_name)) for field_name, obj in list(six.iteritems(attrs))
<|file_name|>ModifiedTanimotoDistanceConfig.java<|end_file_name|><|fim▁begin|>package nl.esciencecenter.e3dchem.modifiedtanimoto; import org.knime.base.util.flowvariable.FlowVariableProvider; import org.knime.core.data.DataTableSpec; import org.knime.core.node.InvalidSettingsException; import org.knime.core.node.util....
String column) throws InvalidSettingsException {
<|file_name|>20_58ee75910929_add_theme_to_config_.py<|end_file_name|><|fim▁begin|>"""Add theme to config Revision ID: 58ee75910929 Revises: 1c22ceb384a7 Create Date: 2015-08-28 15:15:47.971807 """ # revision identifiers, used by Alembic. revision = '58ee75910929' down_revision = '1c22ceb384a7' from alembic import o...
def upgrade(): op.execute("INSERT INTO config (category, key, value, description) VALUES ('general', 'theme', '\"zkpylons\"', 'The enabled theme to use. Should match the theme folder name (requires a server restart to take effect)')")
<|file_name|>descriptor_test.rs<|end_file_name|><|fim▁begin|>use super::*; #[test] fn merge_aliases_empty() { let base = IndexMap::new(); let extended = IndexMap::new(); let output = merge_aliases(&base, &extended); assert!(output.is_empty()); } #[test] fn merge_aliases_base_only() { let mut bas...
#[test] fn merge_plugins_config_impl_extended_aliases_none() { let mut base = Plugins::new();
<|file_name|>NetherLapis.java<|end_file_name|><|fim▁begin|>package com.camp.block; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecra...
<|file_name|>search.rs<|end_file_name|><|fim▁begin|>extern crate cargo; extern crate cargotest; extern crate hamcrest; extern crate url; use std::fs::{self, File}; use std::io::prelude::*; use std::path::PathBuf; use cargo::util::ProcessBuilder; use cargotest::support::execs; use cargotest::support::git::repo; use ca...
"#, reg = registry()).as_bytes()).unwrap(); fs::create_dir_all(&api_path().join("api/v1")).unwrap();
<|file_name|>blockio.cc<|end_file_name|><|fim▁begin|>/* * blockio.cc * * */ #define _LARGEFILE_SOURCE #define _FILE_OFFSET_BITS 64 #include "version.h" #include "blockio.h" #include "osutils.h" #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd....
if(result!=count*s.blocksize) return 0; else return count;
<|file_name|>serializer.py<|end_file_name|><|fim▁begin|>""" Serialize data to/from JSON """ # Avoid shadowing the standard library json module from __future__ import absolute_import, unicode_literals import datetime import decimal import json import sys import uuid from io import BytesIO from django.core.serializers...
stream_or_string = BytesIO(stream_or_string)
<|file_name|>Webhook.cpp<|end_file_name|><|fim▁begin|>// PabstMirror // async send msg to a discord webhook // Requires CPR (curl wrapper) - https://github.com/whoshuu/cpr (and put libcurl.dll in base arma folder) #include <iostream> #include <String> #include <future> #include "cpr/cpr.h" constexpr auto VERSION_STR ...
<|file_name|>hocNotification.js<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * hocNotification * */ import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { compose, setPropTypes } from 'recompose'; import { createStructuredSelector } from 'reselect'; import { selectNotifications } from 'fe...
*
<|file_name|>ProtocolDaoOjb.java<|end_file_name|><|fim▁begin|>/* * Copyright 2005-2014 The Kuali Foundation * * Licensed under the Educational Community 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://...
*/ private static final Collection<String> REVISION_REQUESTED_PROTOCOL_ACTION_TYPE_CODES = Arrays.asList(new String[] {"202", "203"});
<|file_name|>TypeMismatchException.java<|end_file_name|><|fim▁begin|>/* * Copyright 2002-2008 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 * * h...
* * @author Rod Johnson * @author Juergen Hoeller
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code, unused_variables)] use std::thread::sleep_ms; mod xcb; fn main() { let c = xcb::connect().unwrap(); let iter = c.screen_iterator(); println!("abc"); for screen in iter { println!("width {}", screen.width()); c.bar(s...
<|file_name|>ReponseNormal.java<|end_file_name|><|fim▁begin|>package com.hypebeast.sdk.api.model.hypebeaststore; import com.google.gson.annotations.SerializedName; import com.hypebeast.sdk.api.model.Alternative; import com.hypebeast.sdk.api.model.symfony.taxonomy; /** * Created by hesk on 7/1/2015. */ public class ...
public taxonomy taxon_result; }
<|file_name|>footer.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core'; import { Page } from '../objects/page'; import { NavigationService } from '../services/navigation.service'; @Component({ selector: 'my-footer', moduleId: module.id, templateUrl: '../vi...
pages: Page[]; selectedPage: Page; constructor(private navigationService: NavigationService) { }
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>import json from django.test.utils import override_settings import pytest from pyquery import PyQuery from fjord.base import views from fjord.base.tests import ( LocalizingClient, TestCase, AnalyzerProfileFactory, reverse ) from fjord.base.views...
# Pull out next link which is naughty, so it should have been # replaced with a dashboard link. pq = PyQuery(resp.content) next_url = pq('#next-url-link')
<|file_name|>sign.rs<|end_file_name|><|fim▁begin|>// Copyright 2017-2021 int08h LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 //...
<|file_name|>power_of_2.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::floats::PrimitiveFloat; use malachite_base::num::basic::integers::PrimitiveInt; use malachite_base::num::basic::signeds::PrimitiveSigned; use malachite_base::num::basic::unsigneds::PrimitiveUnsigned; use malachite_base::num::convers...
#[test] fn power_of_2_properties() { apply_fn_to_unsigneds!(power_of_2_properties_helper_unsigned);
<|file_name|>crc.cc<|end_file_name|><|fim▁begin|>//----------------------------------------------------------------------------- // Copyright (c) 2013 GarageGames, LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Soft...
U32 val;
<|file_name|>MenuController.java<|end_file_name|><|fim▁begin|>package org.cleverframe.sys.controller; import org.cleverframe.common.controller.BaseController; import org.cleverframe.common.mapper.BeanMapper; import org.cleverframe.common.persistence.Page; import org.cleverframe.common.vo.response.AjaxMessage; import o...
return json; }
<|file_name|>test_socket.rs<|end_file_name|><|fim▁begin|>use nix::sys::socket::{InetAddr, UnixAddr, getsockname}; use std::mem; use std::net::{self, Ipv6Addr, SocketAddr, SocketAddrV6}; use std::path::Path; use std::str::FromStr; use std::os::unix::io::RawFd; use libc::c_char; #[test] pub fn test_inetv4_addr_to_sock_a...
for cmsg in msg.cmsgs() { if let ControlMessage::ScmRights(fd) = cmsg { assert_eq!(received_r, None);
<|file_name|>test_pcf.py<|end_file_name|><|fim▁begin|>"""Tests for parabolic cylinder functions. """ import numpy as np from numpy.testing import assert_allclose, assert_equal import scipy.special as sc def test_pbwa_segfault(): # Regression test for https://github.com/scipy/scipy/issues/6208. # # Data g...
assert_allclose(sc.pbwa(0, 0), (w, wp), rtol=1e-13, atol=0) def test_pbwa_nan():
<|file_name|>start-service.js<|end_file_name|><|fim▁begin|>Package('{Name}.Services', { Bootstrap : new Class({ implements: ['exportService', 'importService', 'getUserId'], initialize : function() { this.serviceName = 'bootstrap'; this.exportServices = [this.serviceName]; this.importServices = [] S...
{ SYMPHONY.remote.hello()
<|file_name|>inferno-component.node.js<|end_file_name|><|fim▁begin|>/*! * inferno-component v1.2.2 * (c) 2017 Dominic Gannaway * Released under the MIT License. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('inferno')) : typeof def...
})));
<|file_name|>test_linked_list.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import unittest from linked_list import (delete_node, list_cycle, remove_elements, reverse_list) from public import ListNode class TestLinkedList(unittest.TestCase): def test_delete_node(self): ...
head = ListNode(1)
<|file_name|>rpath.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/lice...
fn get_rpath_relative_to_output(config: &mut RPathConfig, lib: &Path) -> String { // Mac doesn't appear to support $ORIGIN let prefix = if config.is_like_osx { "@loader_path"
<|file_name|>token.py<|end_file_name|><|fim▁begin|>""" Token class definition """ class Token(object): """Represents a token with type and value""" def __init__(self, type, value): self._type = type self._value = value <|fim▁hole|> def type(self): return self._type @property ...
@property
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import sys from inspect import getmembers from ._hoedown import lib def _set_constants(): is_int = lambda n: isinstance(n, int) for name, value in getmembers(lib, is_int): if not name.startswith('HOEDOWN_'): ...
_set_constants()
<|file_name|>login.js<|end_file_name|><|fim▁begin|>Template.login.events({ 'submit form': function(){ event.preventDefault(); var email = event.target.email.value; var password = event.target.password.value; //error handling Meteor.loginWithPassword(email, password, function(error){ if (error) { ale...
}); } });
<|file_name|>alg_tower_of_hanoi.py<|end_file_name|><|fim▁begin|>"""The tower of Hanoi.""" from __future__ import absolute_import from __future__ import print_function from __future__ import division def tower_of_hanoi(height, from_pole, to_pole, with_pole, counter): """Tower of Hanoi. Time complexity: T(1) =...
<|file_name|>test2.out.rs<|end_file_name|><|fim▁begin|>fn should_format() { println!("Test", "Test2", "Test3"); }<|fim▁hole|> fn shouldnt_format() { println!("Test"); println!("Test"); println!("Test"); println!("Test"); } fn should_format() { println!("Test", "Test2", "Test3"); }<|fim▁end|>
<|file_name|>index.transform.js<|end_file_name|><|fim▁begin|>'use strict'; var BigNumber = require('../../type/BigNumber'); var Range = require('../../type/Range'); var Index = require('../../type/Index'); var isNumber = require('../../util/number').isNumber; /** * Attach a transform function to math.index * Adds a...
return res; }; math.index.transform = transform;
<|file_name|>test_ccode.py<|end_file_name|><|fim▁begin|>from sympy.core import pi, oo, symbols, Function, Rational, Integer, GoldenRatio, EulerGamma, Catalan, Lambda, Dummy, Eq from sympy.functions import Piecewise, sin, cos, Abs, exp, ceiling, sqrt, gamma from sympy.utilities.pytest import raises from sympy.printing.c...
def test_dummy_loops():
<|file_name|>Image.java<|end_file_name|><|fim▁begin|>/* * Copyright 2011 Henri Kerola * * 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|>onesky_test.go<|end_file_name|><|fim▁begin|>// Package onesky tests // Copyright (c) 2015 Sebastian Czoch <sebastian@czoch.eu>. All rights reserved. // Use of this source code is governed by a GNU v2 license found in the LICENSE file. package onesky import ( "fmt" "io/ioutil" "net/url" "os" "path" "...
Language{ Code: "de", EnglishName: "German",
<|file_name|>test_meta_data_provider.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- import base64 import unittest from ingenico.connect.sdk.defaultimpl.default_marshaller import DefaultMarshaller from ingenico.connect.sdk.domain.metadata.shopping_cart_extension import ShoppingCartExtension from ingenico.conne...
<|file_name|>check-quadrant.py<|end_file_name|><|fim▁begin|># Brandon Michael # cis142 # checkForQuadrant.py # Goal: This program will keep asking for input values to check for the quadrant postion, # origin, x-axis and y axis postions # Notes: I used a while loop to make testing values easier and I used the input x,y ...
elif xValue > 0 and yValue < 0: print("Quadrant IV")
<|file_name|>CaptureFactoryImpl.java<|end_file_name|><|fim▁begin|>package com.intershop.adapter.payment.partnerpay.internal.service.capture; import javax.inject.Inject; import com.google.inject.Injector; import com.intershop.adapter.payment.partnerpay.capi.service.capture.CaptureFactory; import com.intershop.api.serv...
injector.injectMembers(ret);
<|file_name|>WikipediaArticleReader.java<|end_file_name|><|fim▁begin|>/** * Copyright 2011 Diego Ceccarelli * * 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.apa...
private WikiXMLParser wxp;
<|file_name|>graph.py<|end_file_name|><|fim▁begin|>"""Base class for undirected graphs. The Graph class allows any hashable object as a node and can associate key/value attribute pairs with each undirected edge. Self-loops are allowed but multiple edges are not (see MultiGraph). For directed graphs see DiGraph and M...
<|file_name|>meta_graph.pb.cc<|end_file_name|><|fim▁begin|>// Generated by the protocol buffer compiler. DO NOT EDIT! // source: tensorflow/core/protobuf/meta_graph.proto #define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION #include "tensorflow/core/protobuf/meta_graph.pb.h" #include <algorithm> #include <google/pr...
// @@protoc_insertion_point(serialize_end:tensorflow.CollectionDef) } ::google::protobuf::uint8* CollectionDef::InternalSerializeWithCachedSizesToArray(
<|file_name|>postcss.config.js<|end_file_name|><|fim▁begin|>const {env, browsers} = require('config'); const isProd = env === 'production'; module.exports = {<|fim▁hole|> } };<|fim▁end|>
// parser: 'sugarss', plugins: { 'postcss-preset-env': browsers, 'cssnano': isProd ? {} : false,
<|file_name|>ConstantFactory.js<|end_file_name|><|fim▁begin|>/** * Created by BlueX on 6/11/16. */ angular .module('TK-WEB-PITCH') .factory('ConstantFactory', function(){ //var API_URL = 'http://127.0.0.1:8888/TK-API/'; var API_URL = 'http://api-test.tarangkhmer.com/'; <|fim▁hole|> ...
<|file_name|>atari_breakout_dqn_cntk.py<|end_file_name|><|fim▁begin|>import random import numpy as np import math from time import perf_counter import os import sys from collections import deque import gym import cntk from cntk.layers import Convolution, MaxPooling, Dense from cntk.models import Sequential, LayerSta...
self.loss = cntk.ops.reduce_mean(cntk.ops.square(self.model - q_target), axis=0)
<|file_name|>rgBuildSettingsViewVulkan.cpp<|end_file_name|><|fim▁begin|>// C++. #include <cassert> #include <sstream> #include <algorithm> // Qt. #include <QWidget> #include <QMessageBox> #include <QDesktopWidget> #include <QFileDialog> // Infra. #include <QtCommon/Util/RestoreCursorPosition.h> #include <QtCommon/Sca...
ui.compilerBinariesLineEdit->setText(selectedDirectory);
<|file_name|>security_group_test.go<|end_file_name|><|fim▁begin|>package securitygroup_test import ( "code.cloudfoundry.org/cli/cf/api/securitygroups/securitygroupsfakes" "code.cloudfoundry.org/cli/cf/configuration/coreconfig" "code.cloudfoundry.org/cli/cf/errors" "code.cloudfoundry.org/cli/cf/models" "code.cloud...
<|file_name|>tcp_client_socket_win.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 "net/socket/tcp_client_socket_win.h" #include <mstcpip.h> #include "base...
<|file_name|>DefaultDirectedAcyclicGraph.java<|end_file_name|><|fim▁begin|>/* * Copyright 2012-present Facebook, 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...
* Unless required by applicable law or agreed to in writing, software
<|file_name|>path_parsing.rs<|end_file_name|><|fim▁begin|>extern crate memchr; use self::memchr::{memchr, memrchr}; use memrnchr::memrnchr; use std::path::MAIN_SEPARATOR; use std::str;<|fim▁hole|>pub const SEP: u8 = MAIN_SEPARATOR as u8; lazy_static! { pub static ref SEP_STR: &'static str = str::from_utf8(&[SEP]).un...
<|file_name|>RpcClients4TaskerModule.java<|end_file_name|><|fim▁begin|>package dataengine.tasker; import javax.jms.Connection; import com.google.inject.Provides; import dataengine.apis.DepJobService_I; import dataengine.apis.RpcClientProvider; import dataengine.apis.SessionsDB_I; import dataengine.apis.CommunicationCo...
// this.depJobMgrBroadcastAddr=depJobMgrBroadcastAddr; //debug = true;
<|file_name|>ExportLogsStatsOverHttpDUnitTest.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 fi...
@Override public void connectIfNeeded() throws Exception { if (!connector.isConnected())
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # vim:set et ts=4 sw=4: """Utility functions @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2000, 2001, 2002, 2003, 2004, 2005, 2006 James Troup <james@nocrew.org> @license: GNU General Public License version 2 or later """ # T...
def _ensure_dsc_hash(dsc, dsc_files, hashname, hashfunc): """
<|file_name|>peer_test.go<|end_file_name|><|fim▁begin|>package peer import ( "os/exec" "testing" "github.com/bmizerany/assert" "github.com/soundcloud/doozer" "github.com/zyxar/doozerd/store" ) func TestDoozerNop(t *testing.T) { var ( l = mustListen() u = mustListenUDP(l.Addr().String()) st = store.New(...
} names, err := cl.Getdir("/not/here", rev, 0, -1)
<|file_name|>ActivityCollector.java<|end_file_name|><|fim▁begin|>package com.example.mywechat.utils; import java.util.ArrayList; import java.util.List; import android.app.Activity; /** * ActivityCollector ÀàÓÃÓÚ¹ÜÀíËùÓеĻ * @author dzhiqin * */ public class ActivityCollector { public static List<Activity> a...
}
<|file_name|>cmilitwostateselect.cpp<|end_file_name|><|fim▁begin|>#include "cmilitwostateselect.h" #include "ui_cmilitwostateselect.h" #include "cengine.h" #include "ctextout.h" void CMili2McuController::DoUpdateLogicView(const CEngineModel *engine) { if (engine->CurrentMcuType() == CEngineModel::MILI_MCU) ...
QWidget(parent), ui(new Ui::CMiliTwoStateSelect), mMcuController(this) {
<|file_name|>PriceData.java<|end_file_name|><|fim▁begin|>package info.faceland.loot.data; public class PriceData { private int price; private boolean rare; public PriceData (int price, boolean rare) { this.price = price;<|fim▁hole|> public int getPrice() { return price; } public void setPrice(int...
this.rare = rare; }
<|file_name|>dbtest.go<|end_file_name|><|fim▁begin|>package dbtest import ( "database/sql" "flag" "os" "testing" ) var DatabaseURL = flag.String("db.url", getenv("TEST_DATABASE_URL", "postgres://localhost/empire?sslmode=disable"), "A connection string where a postgres instance is running.")<|fim▁hole|> db, err :=...
func Open(t testing.TB) *sql.DB {
<|file_name|>svf_dpi.cpp<|end_file_name|><|fim▁begin|>/* * svf_dpi.cpp * * Created on: Jan 7, 2014 * Author: ballance */ #include "svf_runtest.h"<|fim▁hole|>{ if (name == 0 || *name == 0) { name == 0; } svf_runtest(name); return 0; }<|fim▁end|>
extern "C" int svf_dpi_run_test(const char *name); int svf_dpi_run_test(const char *name)
<|file_name|>using_module_exports_b.js<|end_file_name|><|fim▁begin|><|fim▁hole|>module.exports = { b: function() { return A.a() } };<|fim▁end|>
A = require('./using_module_exports_a');
<|file_name|>SessionKind.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 under t...
SPARKR("sparkr");
<|file_name|>IgnorePlugin.js<|end_file_name|><|fim▁begin|>/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ "use strict"; class IgnorePlugin { constructor(resourceRegExp, contextRegExp) { this.resourceRegExp = resourceRegExp; this.contextRegExp = contextR...
return this.checkResource(result.request) && this.checkContext(result.context); } checkIgnore(result, callback) {
<|file_name|>butterfaces-clientSideFilter.jquery.js<|end_file_name|><|fim▁begin|>/** * butterItemFilterField is a jQuery plugin that filters html element with the css class <code>filterable-item</code>. * It is applied to the search field.<br/> * If no filter text is entered, then all filterable-items are displayed....
<|file_name|>pod.go<|end_file_name|><|fim▁begin|>package test import ( "testing" "k8s.io/kubernetes/pkg/admission" kapi "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/runtime" buildapi "github.com/openshift/origin/pkg/build/api" ) type TestPod kapi.Pod func Pod() *...
return (*TestPod)(&kapi.Pod{}) }
<|file_name|>test_contrib_operator.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 und...
[0.13240421, 0.17859563, 0.93759584, 1.1174043 ]]]), atol=1e-5, rtol=1e-5) @with_seed()
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import * from apps.profile import views urlpatterns = patterns('', url(r'^get_preferences?/?', views.get_preference), url(r'^set_preference/?', views.set_preference), url(r'^set_account_settings/?', views.set_account_settings), url...
)
<|file_name|>CorpDetatHelper.java<|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. */ package helper; import bean.CorpDetat; import java.util.List; ...
}
<|file_name|>hidden_network_workaround.py<|end_file_name|><|fim▁begin|># My computer was failing to recognize wifi networks after being woken up from sleep so this uses the network manager command # line tool to force my computer to recognize the network I type in to the terminal.<|fim▁hole|> import subprocess network_...
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
class URIError(Exception): pass
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from sorl.thumbnail import ImageField from warnings import warn class Image(models.Model): # link to other objects using the...
# other images for this object siblings = Image.objects.filter(
<|file_name|>f4m.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import base64 import io import itertools import os import time import xml.etree.ElementTree as etree from .common import FileDownloader from .http import HttpFD from ..utils import ( struct_pack, struct_unpack, compat...
<|file_name|>plot_self_training_varying_threshold.py<|end_file_name|><|fim▁begin|>""" ============================================= Effect of varying threshold for self-training ============================================= This example illustrates the effect of a varying threshold on self-training. The `breast_cancer...
ax3 = plt.subplot(212, sharex=ax1)
<|file_name|>router.js<|end_file_name|><|fim▁begin|>/* YUI 3.16.0 (build 76f0e08) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('router', function (Y, NAME) { /** Provides URL-based routing using HTML5 `pushState()` or the location hash. @mo...
will be the hash from the current URL. @return {String} Current hash path, or an empty string if the hash is empty.
<|file_name|>condvar.rs<|end_file_name|><|fim▁begin|>use crate::sys::mutex::Mutex; use crate::time::Duration; pub struct Condvar {} pub type MovableCondvar = Condvar; impl Condvar { pub const fn new() -> Condvar { Condvar {} }<|fim▁hole|> #[inline] pub unsafe fn init(&mut self) {} #[inli...
<|file_name|>0023_auto_20190405_0911.py<|end_file_name|><|fim▁begin|># Generated by Django 2.1.8 on 2019-04-05 07:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mainapp', '0022_auto_20190404_1605'), ] operations = [ migrations.AlterF...
name='reference_number', field=models.CharField(blank=True, max_length=50, null=True), ),
<|file_name|>http_ece.rs<|end_file_name|><|fim▁begin|>use ece::encrypt; use crate::error::WebPushError; use crate::message::WebPushPayload; use crate::vapid::VapidSignature; /// Content encoding profiles. pub enum ContentEncoding { //Make sure this enum remains exhaustive as that allows for easier migrations to n...
/// /// `peer_public_key` is the `p256dh` and `peer_secret` the `auth` from
<|file_name|>inventory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from __future__ import absolute_import from collections import OrderedDict from linchpin.InventoryFilters.InventoryFilter import InventoryFilter class Inventory(InventoryFilter): DEFAULT_HOSTNAMES = ['public_ip'] def get_host_data...
:param cfgs:
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|>from django.test import TestCase from django.contrib.gis.geos import (LineString, Polygon, MultiPolygon, MultiLineString, MultiPoint, Point) from django.core.exceptions import ValidationError from django.conf import settings f...
self.trek = TrekFactory.create(geom=LineString((0, 0), (8, 8))) self.trek_reverse = TrekFactory.create(geom=LineString((6.4, 6.4), (0.8, 0.8)))
<|file_name|>queryutils.py<|end_file_name|><|fim▁begin|>from msaf.models import dbsession, Sample, Marker, Batch from msaf.lib.analytics import SampleSet from itertools import cycle import yaml def load_yaml(yaml_text): d = yaml.load( yaml_text ) instances = {} for k in d: if k == 'selector':...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub mod network { // Modules can be nested inside other modules pub mod client { pub fn connect() {} } pub mod server { pub fn connect() {} } pub fn connect() {} } // Multiple modules can be defined in the same lib.rs pub mod clie...
pub fn connect() {} }
<|file_name|>RegexVariables.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 ...
* "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at
<|file_name|>DesktopModule.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014 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 * * http://www.apac...
*
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup setup(name='jgcspendfrom', version='1.0', description='Command-line utility for jgcoin "coin control"', author='Gavin Andresen', author_email='gavin@jgcoinfoundation.org',<|fim▁hole|> requires=['jsonrpc'], ...
<|file_name|>indent.js<|end_file_name|><|fim▁begin|>// test: indent_only const foo = 1 + 2 ; const foo = [1, 2]; <|fim▁hole|> {a, b}; const foo = { a, b}; someMethod(foo, [ 0, 1, 2,], bar); someMethod( foo, [0, 1, 2,], bar); someMethod(foo, [ 0, 1, 2, ]...
const foo = [ 1, 2]; const foo =
<|file_name|>files.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # GMate - Plugin Based Programmer's Text Editor # Copyright © 2008 Alexandre da Silva / Carlos Antonio da Silva # # This file is part of Gmate. # # See LICENTE.TXT for licence information import os import gnomevfs from datetime import datetime ...
if file_info is not None: return file_info.type != gnomevfs.FILE_TYPE_DIRECTORY return False