prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>hp_httpmanageable_mib.py<|end_file_name|><|fim▁begin|># # Copyright (C) 2015 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 3 as published by # the Fr...
serial = yield self.get_next('hpHttpMgSerialNumber') if serial: if isinstance(serial, bytes):
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent 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/LICE...
# Producer and consumer
<|file_name|>hwiOperation.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class LedOperation(Operation): opcodes = {"but": "1111100"} structure = [Opcodes(opcodes), Zero(21), Register] class ButOperation(Operation): opcodes = {"led": "1111101"} structure = [Opcodes(opcodes), Operand2(25)]<|fim▁end|>
from .operation import Operation from ..operands import Register, Operand2, Opcodes, Zero
<|file_name|>GetDischargeSummaries.java<|end_file_name|><|fim▁begin|>package gov.va.medora.mdws.emrsvc; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java ...
}
<|file_name|>precomp.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////// // // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/...
// // Copyright (C) 2003 Microsoft Corporation. All rights reserved.
<|file_name|>cargop.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> extern crate cargopants; fn main() { let mut cargo = cargopants::Client::new(); println!("latest version {:?}", cargo.krate("url").get().unwrap()); println!("krate {:?}", cargo.krate("url").version("0.2.25").get().unwrap()); }<|fim▁end|>
//#![deny(warnings)]
<|file_name|>test_property_delete.py<|end_file_name|><|fim▁begin|>""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tool...
with self.assertRaises(TraitError): del e.a
<|file_name|>main_bak.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2012-2015 S-Core Co., Ltd. * * 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/lice...
_dimmingOn(); $('body').append(removeDlg);
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>/* * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior a...
*/
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import theano from theano import shared, tensor from blocks.bricks import Feedforward, Activation from blocks.bricks.base import application, lazy from blocks_extras.initialization import PermutationMatrix from blocks_extras.utils import check_valid_permutation from...
if self._dot: return tensor.dot(input_, self._matrix)
<|file_name|>test_client_authorize.py<|end_file_name|><|fim▁begin|>import collections import json import unittest import responses from requests import HTTPError from mock import patch from batfish import Client from batfish.__about__ import __version__ class TestClientAuthorize(unittest.TestCase): def setUp(s...
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations <|fim▁hole|> operations = [ migrations.CreateModel( name='Prueba', fields=[ ('id', models.AutoField(ver...
class Migration(migrations.Migration): dependencies = [ ]
<|file_name|>ellipse.rs<|end_file_name|><|fim▁begin|>//! Draw ellipse<|fim▁hole|> pub use rectangle::centered; pub use rectangle::centered_square as circle; /// Ellipse border #[derive(Copy, Clone)] pub struct Border { /// The border color pub color: Color, /// The border radius pub radius: Radius, } ...
use types::{Color, Radius, Rectangle, Resolution}; use {triangulation, DrawState, Graphics}; use math::Matrix2d;
<|file_name|>0002_auto_20161030_1553.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-30 12:53 from __future__ import unicode_literals <|fim▁hole|>from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('core', '0001_initial...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages with open('pyluno/meta.py') as f: exec(f.read()) setup( name='pyluno', version=__version__, packages=find_packages(exclude=['tests']), description='A Luno API for Python', author='Cayle Sharrock/Grant...
'test': ['requests-mock>=0.7.0', 'nose'], } )
<|file_name|>build_insert_query.rs<|end_file_name|><|fim▁begin|>extern crate rustorm; extern crate uuid; extern crate chrono; extern crate rustc_serialize; use uuid::Uuid; use rustorm::query::Query; use rustorm::dao::{Dao, IsDao}; use rustorm::pool::ManagedPool; #[derive(Debug, Clone)] pub struct Photo { pub pho...
let expected = " INSERT INTO bazaar.product( name )\x20
<|file_name|>ListAvatarViewHolder.java<|end_file_name|><|fim▁begin|>package com.michaelfotiadis.crossyscore.ui.components.addplayer.avatar; import android.view.View; import android.widget.ImageView; import com.michaelfotiadis.crossyscore.R; import com.michaelfotiadis.crossyscore.ui.core.common.viewholder.BaseViewHold...
import butterknife.Bind;
<|file_name|>templates.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|> public: void in_base(); }; template<typename T, typename Alloc = std::allocator<T> > class vector : Alloc { public: void foo(); void stop(); }; template<typename Alloc> class vector<bool, Alloc>; } void f() { std::vector...
namespace std { template<typename T> class allocator {
<|file_name|>incident.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * import logging import e...
pass
<|file_name|>apache2.go<|end_file_name|><|fim▁begin|>package mpapache2 import ( "errors" "fmt" "io/ioutil" "net/http" "os" "regexp" "strconv" "strings" mp "github.com/mackerelio/go-mackerel-plugin-helper" "github.com/urfave/cli" ) // Apache2Plugin for fetching metrics type Apache2Plugin struct { Host ...
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// This file is part of Gate. // Copyright (C) 2012-2015 Cyril Adrian <cyril.adrian@gmail.com> // // Gate 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, ver...
<|file_name|>cisco_fc_zone_client_cli.py<|end_file_name|><|fim▁begin|># (c) Copyright 2014 Cisco Systems Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the Licens...
node_port_wwn = linesplit[2] return_list.append(node_port_wwn)
<|file_name|>drift_utils_test.py<|end_file_name|><|fim▁begin|># Copyright 2021 DeepMind Technologies Limited and Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod category; pub mod question;<|fim▁hole|><|fim▁end|>
pub mod dashboard;
<|file_name|>session.py<|end_file_name|><|fim▁begin|># Класс-помощник для работы с сессией class SessionHelper: def __init__(self, app): self.app = app # Функция входа на сайт def login(self, username, password): wd = self.app.wd<|fim▁hole|> wd.find_element_by_name("pass").click() ...
self.app.open_home_page() wd.find_element_by_name("user").click() wd.find_element_by_name("user").clear() wd.find_element_by_name("user").send_keys(username)
<|file_name|>ResourceGroupInner.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for * license information. * * Code generated by Microsoft (R) AutoRest Code Generator. */ package com.microsoft....
/** * Set the location value.
<|file_name|>AbstractMDXDataFactory.java<|end_file_name|><|fim▁begin|>/*! * This program is free software; you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software * Foundation. * * You should have received a copy of the GNU Lesse...
if ( field != null ) { return String.valueOf( field );
<|file_name|>State.java<|end_file_name|><|fim▁begin|>package org.usfirst.frc.team5940.states; import edu.wpi.first.wpilibj.RobotBase; public abstract class State implements Runnable { @SuppressWarnings("unused") protected RobotBase robot; //Update recall delay private int delay = 25; /** * Constru...
protected abstract void init();
<|file_name|>cpp-list.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, Input, ChangeDetectorRef } from '@angular/core'; import { Cpp } from '../../../shared/interfaces/cpps.interface'; import { FormBuilder, FormGroup, Validators, FormArray } from '@angular/forms'; import { Subject } from 'rxjs/Subj...
addActive = true; constructor(
<|file_name|>sprite_stroke_drawer.py<|end_file_name|><|fim▁begin|># Flexlay - A Generic 2D Game Editor # Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software ...
<|file_name|>options.js<|end_file_name|><|fim▁begin|>"use strict"; const commonOptions = require("../common/common-options"); // format based on https://github.com/prettier/prettier/blob/master/src/main/core-options.js module.exports = { bracketSpacing: commonOptions.bracketSpacing, singleQuote: commonOptions.sin...
proseWrap: commonOptions.proseWrap };
<|file_name|>FloatArray64.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package bigarrays; /** * @author vincent.gardeux@epfl.ch * * Class for representing a float static array requiring address space larger than 32 bits. */ public class FloatArray64 { private static final int CHUNK_SIZE = 1024*1024*512; ...
<|file_name|>CWE762_Mismatched_Memory_Management_Routines__new_free_int64_t_21.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__new_free_int64_t_21.cpp Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_free.label.xml T...
printLine("Calling good()..."); good(); printLine("Finished good()");
<|file_name|>deploy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 import sys, os, shutil from os import path from urllib.request import pathname2url import subprocess from subprocess import call import sys import re import zipfile import config os.chdir(config.root_dir) SUPPORTED_OPERATING_SYSTEMS = ('windows_...
return if not path.isdir(parent_dir):
<|file_name|>devices.rs<|end_file_name|><|fim▁begin|>use std::collections::HashSet; use std::collections::HashMap; use std::fmt; use winapi::shared::hidpi::{HIDP_BUTTON_CAPS, HIDP_CAPS, HIDP_VALUE_CAPS}; use winapi::um::winnt::HANDLE; use winapi::um::winuser::RID_DEVICE_INFO; #[derive(Clone)] pub struct MouseI...
impl Devices { pub fn new() -> Devices { Devices {
<|file_name|>HyperElasticPhaseFieldIsoDamage.C<|end_file_name|><|fim▁begin|>/****************************************************************/ /* MOOSE - Multiphysics Object Oriented Simulation Environment */ /* */ /* All contents are licensed under...
if (_num_stiffness) _dpk2_dce = _dpk2_dee * _dee_dce;
<|file_name|>typedarray-prototype.js<|end_file_name|><|fim▁begin|>// Any copyright is dedicated to the Public Domain. // http://creativecommons.org/licenses/publicdomain/ //----------------------------------------------------------------------------- var BUGNUMBER = 565604; var summary = "Typed-array properties don'...
var p = props[i];
<|file_name|>list_filtering.js<|end_file_name|><|fim▁begin|>function changeQueryStr(name, value) { var query = window.location.search.substring(1), newQuery = '?', notFound = true, vars = query.split('&'); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split('='); if ...
<|file_name|>test_python_2d_ns.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_python_2d_ns ---------------------------------- Tests for `python_2d_ns` module. """ import sys import unittest from python_2d_ns.python_2d_ns import * class TestPython_2d_ns(unittest.TestCase):...
#this coordinate should be 0 self.assertTrue(x[0,2]==0) #test initial condition, Taylor green forcing, test whether the value is given on specific wavenumber def test_IC_con(self):
<|file_name|>borrowed-unique-basic.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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...
#![feature(box_syntax)] #![omit_gdb_pretty_printer_section]
<|file_name|>prod_config_windows.py<|end_file_name|><|fim▁begin|># ***** BEGIN LICENSE BLOCK ***** # 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/. # ***** END LICENS...
"options": [ "--prefs-root=%(test_path)s/prefs", "--processes=1",
<|file_name|>WVideo.java<|end_file_name|><|fim▁begin|>package com.github.bordertech.wcomponents; import com.github.bordertech.wcomponents.util.Util; import java.util.Arrays; import java.util.List; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** ...
<|file_name|>load_darwin.go<|end_file_name|><|fim▁begin|>// +build darwin package load import ( "os/exec" "strconv" "strings" "../common" ) func Avg() (*AvgStat, error) { values, err := common.DoSysctrl("vm.loadavg") if err != nil { return nil, err } load1, err := strconv.ParseFloat(values[0], 64) if er...
ret := MiscStat{} for _, l := range lines {
<|file_name|>doc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Sahana Eden Document Library @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation f...
#table.entered.comment = DIV(_class="tooltip",
<|file_name|>installer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import platform import os import sys from .constants import (MYSTEM_BIN, MYSTEM_EXE, MYSTEM_DIR) _TARBALL_URLS = { 'linux': { '32bit': "http://download.cdn.yandex.net/mystem/mystem-3.0-linux3.5-32bit.tar.gz", '64bit': "...
<|file_name|>AnalysisService.java<|end_file_name|><|fim▁begin|>/* * Licensed to ElasticSearch and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. ElasticSearch licenses this * file to you un...
public AnalysisService(Index index, @IndexSettings Settings indexSettings, @Nullable IndicesAnalysisService indicesAnalysisService, @Nullable Map<String, AnalyzerProviderFactory> analyzerFactoryFactories,
<|file_name|>auto_shard_dataset_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
drop_final_batch=True, use_parser_fn=None) with self.assertRaises(errors.OutOfRangeError): self.evaluate(outputs())
<|file_name|>BoafiPenTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- ########## boafi Pentest script ########## - Perform various pentests automatically and save reports for further study ########## - Features/TODOs: Ipv6,DHCP,DNS,NTP,exploits,mitm.. ########## - Router bruteforce for eas...
craft=(results.packetcraft).split("-") if("TCP" in craft[0]):
<|file_name|>generate-enums.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 Ilkka Rauta // // 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-...
// See the License for the specific language governing permissions and // limitations under the License.
<|file_name|>davidson.py<|end_file_name|><|fim▁begin|>"""A block Davidson solver for finding a fixed number of eigenvalues. Adapted from https://joshuagoings.com/2013/08/23/davidsons-method/ """ import time from typing import Tuple import numpy as np from tqdm import tqdm def davidson(A: np.ndarray, k: int, eig: in...
start_numpy = time.time() E, Vec = np.linalg.eig(A) E = np.sort(E)
<|file_name|>device_tracker.py<|end_file_name|><|fim▁begin|>"""Support for Cisco IOS Routers.""" import logging import re from pexpect import pxssh import voluptuous as vol from homeassistant.components.device_tracker import ( DOMAIN, PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA, DeviceScanner, ) from homeas...
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>/* * @license Apache-2.0 * * Copyright (c) 2019 The Stdlib 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...
* * @param x - input value * @param a - minimum support
<|file_name|>data_prepper.py<|end_file_name|><|fim▁begin|>import numpy as np import jarvis.helpers.helpers as helpers from data_cleaner import DataCleaner def get_data(csv=None, sep='|'): dataset = create_dataset(csv, sep) inputs = DataCleaner().clean(dataset[:, 0:1]) outputs = format_targets(dataset[:, 1]) t...
for action in actions: target_map[action] = index index += 1
<|file_name|>newport_group.py<|end_file_name|><|fim▁begin|># =============================================================================== # Copyright 2011 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain ...
def _set_deceleration(self, v): self._deceleration = v
<|file_name|>qrcodedialog.cpp<|end_file_name|><|fim▁begin|>#include "qrcodedialog.h" #include "ui_qrcodedialog.h" #include "bitcoinunits.h" #include "guiconstants.h" #include "guiutil.h" #include "optionsmodel.h" #include <QPixmap> #include <QUrl> #include <qrencode.h> QRCodeDialog::QRCodeDialog(const QString &addr...
<|file_name|>AudioMerger.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from pydub import * class AudioMerger: voice_tags = ["one", "two", "three", "four", "five", "ten", "RUN", "relax", "completed"] def __init__(self, music): self.music = music self.additionalGain = 8 self.voices={} for voice in self.voice_ta...
<|file_name|>DynamicTypeClient.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react' import { ifError } from '@framework/Globals'; import { ajaxPost, ajaxGet, ValidationError } from '@framework/Services'; import { SearchControl, ValueSearchControlLine } from '@framework/Search' import * as Finder from '@f...
type: 'StringLength'; multiLine: boolean; min?: number;
<|file_name|>install_extension.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """This utility installs an engage extension into a deployment home. """ import os import os.path import sys from optparse import OptionParser import shutil import re import logging logger = logging.getLogger(__name__) # enable impo...
else:
<|file_name|>closure.js<|end_file_name|><|fim▁begin|>// Looking at closures // http://stackoverflow.com/q/111102/137001 $(document).ready(function() {<|fim▁hole|> closureTest(); function closureTest() { //console.log } });<|fim▁end|>
<|file_name|>controlUnit.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import argparse import json import time import logging from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTShadowClient import RPi.GPIO as GPIO <|fim▁hole|>parser.add_argument('-c', '--cert', required=True, help='Certificate file path.') parser.a...
parser = argparse.ArgumentParser(description='Lightbulb control unit.') parser.add_argument('-e', '--endpoint', required=True, help='The AWS Iot endpoint.') parser.add_argument('-r', '--rootCA', required=True, help='Root CA file path.')
<|file_name|>operations.py<|end_file_name|><|fim▁begin|>"""This module contains functions to :meth:`~reload` the database, load work and citations from there, and operate BibTeX""" import importlib import re import textwrap import warnings import subprocess from copy import copy from collections import OrderedDict f...
Use acronym for place name: >>> print(work_to_bibtex(murta2014a, acronym=True))
<|file_name|>arena_storage_pool.rs<|end_file_name|><|fim▁begin|>// Implements http://rosettacode.org/wiki/Arena_storage_pool #![feature(rustc_private)] extern crate arena; <|fim▁hole|>fn main() { // Memory is allocated using the default allocator (currently jemalloc). The memory is // allocated in chunks, and...
use arena::TypedArena; #[cfg(not(test))]
<|file_name|>palo_metrics.cpp<|end_file_name|><|fim▁begin|>// Modifications copyright (C) 2017, Baidu.com, Inc. // Copyright 2017 The Apache Software Foundation // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work fo...
// = m->AddGauge(IO_MGR_LOCAL_BYTES_READ, 0L); // _s_io_mgr_cached_bytes_read // = m->AddGauge(IO_MGR_CACHED_BYTES_READ, 0L); // _s_io_mgr_short_circuit_bytes_read
<|file_name|>page-wrap.tsx<|end_file_name|><|fim▁begin|>import { FC, createElement as h } from 'react'; import { PageProps } from '@not-govuk/app-composer'; import { Page } from '@hods/components'; import './app.scss'; export const PageWrap: FC<PageProps> = ({ routes, children }) => { const compare = (a, b) => ( ...
? 1
<|file_name|>lite_test.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.apache....
self.assertEqual('Placeholder', input_details[0]['name']) self.assertEqual(np.float32, input_details[0]['dtype']) self.assertTrue(([1, 16, 16, 3] == input_details[0]['shape']).all())
<|file_name|>Parser.java<|end_file_name|><|fim▁begin|>package com.real.estate.parser; import org.jsoup.nodes.Element; import java.util.List; /** * Created by Snayki on 22.03.2016. */ public interface Parser<T> {<|fim▁hole|>}<|fim▁end|>
List<Element> parse(); T createFromElement(Element element);
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import operator from django.db import models from django.db.models import Q from django.db.models import Count from caching.base import CachingManager, CachingMixin from emoticonvis.apps.base import models as base_models from emoticonvis.apps.corpus import utils imp...
<|file_name|>unionfs_xattr_test_darwin.go<|end_file_name|><|fim▁begin|>// Copyright 2016 the Go-FUSE Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package unionfs import ( "syscall" "unsafe" ) // Darwin doesn't have support for...
if e1 != 0 { err = e1 } return
<|file_name|>NamingMixin.js<|end_file_name|><|fim▁begin|>const NamingMixin = { _name: null, getName() { return this._name; },<|fim▁hole|> _shortName: null, getShortName() { return this._shortName || this.getName(); }, _abbreviation: null, getAbbreviation() { return this._abbreviation || th...
<|file_name|>http.rs<|end_file_name|><|fim▁begin|>use hyper::Client; use hyper::net::HttpsConnector; use hyper_native_tls::NativeTlsClient; error_chain!{ errors {<|fim▁hole|> } } pub fn tls_client() -> Result<Client> { let ssl = NativeTlsClient::new().chain_err(|| ErrorKind::FailedToCreateTlsClient)?; ...
FailedToCreateTlsClient { description("Failed to create TLS client") display("Failed to create TLS client") }
<|file_name|>re.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/licenses/LIC...
<|file_name|>user-profile.component.ts<|end_file_name|><|fim▁begin|>import {Component, EventEmitter, Output, Input, OnInit} from '@angular/core'; import {UserModel, UserResponse} from "../user-management/user.model"; import {UserService} from "../user-management/user.service"; import {Config} from "../../../shared/conf...
onShowEdit() { this.showView = false;
<|file_name|>video_search_result.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ Picarto.TV API Documentation The Picarto.TV API documentation Note, for fixed access tokens, the header that needs to be sent is of the format: `Authorization: Bearer yourTokenHere` This can be generated at https://oauth.pi...
<|file_name|>configs-where_pred_indent-block.rs<|end_file_name|><|fim▁begin|>// rustfmt-where_pred_indent: Block // Where predicate indent <|fim▁hole|> Sit: Eq, Amet: Eq, { // body }<|fim▁end|>
fn lorem<Ipsum, Dolor, Sit, Amet>() -> T where Ipsum: Eq, Dolor: Eq,
<|file_name|>bench_test.go<|end_file_name|><|fim▁begin|>// Copyright ©2016 The Gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package f32 import "testing" const ( benchLen = 1e5 a = 2 ) var ( x = make([]float32, b...
<|file_name|>Stack.cpp<|end_file_name|><|fim▁begin|>/* ** Stack.cpp for cpp_abstractvm in /var/projects/cpp_abstractvm/Stack.cpp ** ** Made by kevin labbe ** Login <labbe_k@epitech.net> ** ** Started on Mar 1, 2014 2:15:13 AM 2014 kevin labbe ** Last update Mar 1, 2014 2:15:13 AM 2014 kevin labbe */ #incl...
if (_stack.size() < 2)
<|file_name|>test_record_contents.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- __author__ = 'Ostico <ostico@gmail.com>' import unittest import os os.environ['DEBUG'] = "1" os.environ['DEBUG_VERBOSE'] = "0" import pyorient class CommandTestCase(unittest.TestCase): def __init__(self, *args, **kwargs):...
def test_nested_objects_9(self): res = self.client.command( 'create vertex v content '
<|file_name|>cucumber-upload.js<|end_file_name|><|fim▁begin|>'use strict'; const Joi = require('joi'); const uuid = require('uuid'); const reqUtils = require('../utils/requestUtils'); const R = require('ramda'); //fixme: allow unknown fields and just require absolutely mandatory ones const cucumberSchema = Joi.array()...
<|file_name|>to3015.py<|end_file_name|><|fim▁begin|>from dependencies.dependency import aq_inner from dependencies.dependency import aq_parent from lims.permissions import * from dependencies.dependency import BaseContent from lims.upgrade import stub def upgrade(tool):<|fim▁hole|> # Hack prevent out-of-date upgra...
<|file_name|>issue-10200.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/lic...
struct Foo(bool); fn foo(_: uint) -> Foo { Foo(false) } fn main() {
<|file_name|>iTestClient-sk.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="sk_SK"> <context> <name>AboutWidget</name> <message> <source>About iTest</source> <translation>O programe iTest</translation> </message> <message> ...
<message> <source>i)</source> <translation>i)</translation> </message>
<|file_name|>length.js<|end_file_name|><|fim▁begin|>var _ = require('underscore'); /* A rule should contain explain and rule methods */ // TODO explain explain // TODO explain missing // TODO explain assert function assert (options, password) { return !!password && options.minLength <= password.length; } function ...
}; }
<|file_name|>inherent_impls.rs<|end_file_name|><|fim▁begin|>// This test case tests the incremental compilation hash (ICH) implementation // for let expressions. // The general pattern followed here is: Change one thing between rev1 and rev2 // and make sure that the hash has changed, then change nothing between rev2 ...
} #[cfg(not(cfail1))] #[rustc_clean(cfg="cfail2")]
<|file_name|>explicit-self.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/l...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>fn main() { let config = ConfigBuilder::new() .with_width(150) .with_title("Rust is awesome".to_string()) .finalize(); println!("{}", config); let config = ConfigBuilder::new() .with_width(1000) .with_heig...
extern crate config; use config::ConfigBuilder;
<|file_name|>long.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use std::{fs, io, time::Instant}; extern crate svgbob; fn main() -> io::Result<()> { let art = include_str!("../test_data/long.bob"); let t1 = Instant::now(); fs::create_dir_all("out")?; fs::write("out/long.svg", svgbob::to_svg(art))?; ...
<|file_name|>test_patchset.rs<|end_file_name|><|fim▁begin|>extern crate unidiff; use unidiff::PatchSet; #[test] fn test_parse_sample0_diff() { let buf = include_str!("fixtures/sample0.diff"); <|fim▁hole|> let mut patch = PatchSet::new(); patch.parse(&buf).unwrap(); // three file in the patch asser...
<|file_name|>LookAround.js<|end_file_name|><|fim▁begin|>/** * Created by shuis on 2017/5/29. */ import React, { Component } from 'react'; import { View, Image, FlatList, TouchableWithoutFeedback } from 'react-native'; import {TabBarIcon, TweetSeparator} from '../component/base'; import Tweet from '../componen...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Models for the ``feedback_form`` app.""" from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.conf import settings from django.utils.encoding import pyth...
return '{0}'.format(self.creation_date)
<|file_name|>quic_client.py<|end_file_name|><|fim▁begin|>import sys import time import socket import struct import random import hashlib import urllib2 from Crypto import Random from Crypto.Cipher import AES # from itertools import izip_longest # Setting timeout so that we won't wait forever timeout = 2 socket.setde...
<|file_name|>hint_metrics.rs<|end_file_name|><|fim▁begin|>//! Describe font hint metrics /// Specifies whether to hint font metrics; hinting font metrics means quantizing them so that they are integer values in device space. Doing this improves the consistency of letter and line spacing, however it also means that tex...
<|file_name|>UpdateProcessAction.java<|end_file_name|><|fim▁begin|>/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ ...
if (obj == null) { return false;
<|file_name|>events_test.js<|end_file_name|><|fim▁begin|>module('system/props/events_test'); test('listener should receive event - removing should remove', function() { var obj = {}, count = 0; var F = function() { count++; }; Ember.addListener(obj, 'event!', F); equal(count, 0, 'nothing yet'); Ember.sendE...
<|file_name|>feed_parse_extractSpearpointtranslationsHomeBlog.py<|end_file_name|><|fim▁begin|>def extractSpearpointtranslationsHomeBlog(item): ''' Parser for 'spearpointtranslations.home.blog' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['t...
<|file_name|>receivers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ## This file is part of Zenodo. ## Copyright (C) 2012, 2013, 2014 CERN. ## ## Zenodo 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 Found...
if os.path.exists(d):
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use std::panic::catch_unwind; use std::sync::Arc; use env_logger::*; use expectest::expect; use expectest::prelude::*; use maplit::*; use serde_json::json; use pact_consumer::*; use pact_consumer::prelude::*; use pact_models::Consumer; use pact_models::pact::Pact; us...
.. super::PublishOptions::default() }; super::publish_result(&vec![], &PactSource::File("/tmp/test".into()), &options).await;
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import warnings from django.views.generic.dates import ArchiveIndexView, DateDetailView, DayArchiveView, MonthArchiveView, \ YearArchiveView<|fim▁hole|> from .models import Photo, Gallery # Gallery views. class GalleryListView(ListView): queryset = Gallery...
from django.views.generic.detail import DetailView from django.views.generic.list import ListView from django.views.generic.base import RedirectView from django.core.urlresolvers import reverse
<|file_name|>SettingsKeyserverFragment.java<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2012-2015 Dominik Schürmann <dominik@dominikschuermann.de> * Copyright (C) 2015 Adithya Abraham Philip <adithyaphilip@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms ...
addKeyserver(keyserver); break;
<|file_name|>maker.py<|end_file_name|><|fim▁begin|>import demowlcutils from demowlcutils import ppxml, WLC_login from pprint import pprint as pp from jnpr.wlc import WirelessLanController as WLC wlc = WLC(host='a', user='b', password='c') r = wlc.RpcMaker( target='vlan', name='Jeremy') # you can access the followi...
# r.args
<|file_name|>slate_soft_q.py<|end_file_name|><|fim▁begin|>from typing import Union from ray.rllib.models.action_dist import ActionDistribution from ray.rllib.utils.annotations import override from ray.rllib.utils.exploration.exploration import TensorType from ray.rllib.utils.exploration.soft_q import SoftQ from ray.rl...