prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>const-expr-addr-operator.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.a...
// Constant of generic type (int)
<|file_name|>DOMNodeHighlighter.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code m...
IntPoint titleBasePoint = IntPoint(anchorBox.x(), anchorBox.maxY() - 1); titleBasePoint.move(rectInflatePx, rectInflatePx); IntRect titleRect = enclosingIntRect(font.selectionRectForText(nodeTitleRun, titleBasePoint, fontHeightPx));
<|file_name|>28.py<|end_file_name|><|fim▁begin|><|fim▁hole|> print la, la # [str], [str] propagate([1]) # [] propagate([2]) # []<|fim▁end|>
def propagate(la): # la: [list(int)]
<|file_name|>add_provider.cpp<|end_file_name|><|fim▁begin|>// add_provider.cpp // // Edit a Davit Provider. // // (C) Copyright 2007 Fred Gleason <fredg@paravelsystems.com> // // $Id: add_provider.cpp,v 1.2 2007/11/19 16:53:29 fredg Exp $ // // This program is free software; you can redistribute it and/or modif...
<|file_name|>weather_client.py<|end_file_name|><|fim▁begin|>""" Module containing classes for HTTP client/server interactions """ # Python 2.x/3.x compatibility imports try: from urllib.error import HTTPError, URLError from urllib.parse import urlencode except ImportError: from urllib2 import HTTPError, UR...
Adds the API key and the query parameters dictionary to the specified
<|file_name|>tag27.go<|end_file_name|><|fim▁begin|>// Package tag. package tag <|fim▁hole|><|fim▁end|>
println("tag27")
<|file_name|>channel.py<|end_file_name|><|fim▁begin|>import abc import subprocess import logging from observables import BLOperator, MCObservable from data import BLDataChannel, GIDataChannel import util class Channel(metaclass=abc.ABCMeta): ISOSPIN_MAP = { 'singlet': "0", 'doublet': "1h", 'tripl...
def __str__(self):
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// Copyright 2022 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.apache.org/licenses/LICENSE-2.0 // //...
) { client.close();
<|file_name|>jtrace.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** begin : Thu Apr 24 15:54:58 CEST 2003 copyright : (C) 2003 by Giuseppe Lipari email : lipari@sssup.it **********************************...
} else if (dynamic_cast<DeadEvt*>(e) != NULL) { DBGPRINT("DlineMissEvt");
<|file_name|>simple.py<|end_file_name|><|fim▁begin|># # Copyright: Copyright (c) MOSEK ApS, Denmark. All rights reserved. # # File: simple.py # # Purpose: Demonstrates a very simple example using MOSEK by<|fim▁hole|># import mosek import sys def streamprinter(msg): sys.stdout.write (msg) sys.stdout.flush (...
# reading a problem file, solving the problem and # writing the solution to a file.
<|file_name|>Kokkos_PolicyTraitAdaptor.hpp<|end_file_name|><|fim▁begin|>/* //@HEADER // ************************************************************************ // // Kokkos v. 3.0 // Copyright (2020) National Technology & Engineering // Solutions of Sandia, LLC (NTESS). // //...
<|file_name|>test_greatest_hot_100_singles.py<|end_file_name|><|fim▁begin|>import json import unittest import billboard class TestCurrentGreatestHot100Singles(unittest.TestCase): """Checks that the ChartData object for the current Greatest Hot 100 Singles chart has entries and instance variables that are vali...
self.assertTrue(json.loads(entry.json()))
<|file_name|>primary_unit_declaration.py<|end_file_name|><|fim▁begin|>from vsg.token import primary_unit_declaration as token<|fim▁hole|> def detect(iToken, lObjects): ''' primary_unit_declaration ::= identifier; ''' return classify(iToken, lObjects) def classify(iToken, lObjects): iCurrent = iTo...
from vsg.vhdlFile import utils
<|file_name|>sync_test_megacli.py<|end_file_name|><|fim▁begin|>""" Application for testing syncing algorithm (c) 2013-2014 by Mega Limited, Wellsford, New Zealand This file is part of the MEGA SDK - Client Access Engine. Applications using the MEGA API must present a valid application key and comply with the th...
<|file_name|>TEvento.java<|end_file_name|><|fim▁begin|>package br.com.swconsultoria.nfe.schema.retEnvEpec; import javax.xml.bind.annotation.*; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * Tipo Evento * * <p>Classe Java de TEv...
<|file_name|>test_page_api.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ MailMojo API v1 of the MailMojo API # noqa: E501 OpenAPI spec version: 1.1.0 Contact: hjelp@mailmojo.no Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import im...
<|file_name|>C.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Problem: Making Chess Boards # Language: Python # Author: KirarinSnow # Usage: python thisfile.py <input.in >output.out from heapq import * def process(r1, r2, c1, c2): for i in range(r1, r2): for j in range(c1, c2): if 0 <...
for case in range(int(raw_input())):
<|file_name|>test_resource.py<|end_file_name|><|fim▁begin|>import pytest from webtest import TestApp from pyramid.config import Configurator from pyramid.testing import DummyRequest from pyramid.authorization import ACLAuthorizationPolicy from pyramid.authentication import AuthTktAuthenticationPolicy def make_app(con...
def test_request_add_get_view(): config = Configurator()
<|file_name|>rpcDocuments-spec.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node 'use strict'; /** * Documents RPC Prototype * * - TIU CREATE RECORD (MAKE^TIUSRVP) * - TIU UPDATE RECORD (UPDATE^TIUSRVP) * - TIU DELETE RECORD (DELETE^TIUSRVP) * - TIU SIGN RECORD * ... and locks * ... key file, TIUSRVP * * ...
'', '', '', '',
<|file_name|>S15.10.2.15_A1_T23.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * @name: S15.10.2.15_A1_T23; * @section: 15.10.2.15; * @assertion: The internal helper function CharacterRange ta...
<|file_name|>multipart.py<|end_file_name|><|fim▁begin|>import base64 import binascii import json import re import uuid import warnings import zlib from collections import deque from types import TracebackType from typing import ( # noqa TYPE_CHECKING,<|fim▁hole|> Any, Dict, Iterator, List, Mappi...
<|file_name|>Team.tsx<|end_file_name|><|fim▁begin|>/// <reference path="../../../../definitions/tsd.d.ts" /> import {AchievementProps} from "../Achievement/Achievement"; import LoginService from "../../service/LoginService"; export interface TeamProps { _id: string; name: string; botId?: string; image...
}
<|file_name|>0029_auto__del_field_toindexstore_basemodel_ptr__add_field_toindexstore_id.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration):...
db.add_column(u'catalog_toindexstore', u'basemodel_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['catalog.BaseModel'], unique=True, primary_key=True), keep_default=False)
<|file_name|>InvalidRuleVisitor.java<|end_file_name|><|fim▁begin|>/* * * ==================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License a...
this.context = context;
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>//=====================================================================// /*! @file @brief R8C LCD メイン @n for ST7567 SPI (128 x 32) @n LCD: Aitendo M-G0812P7567 @author 平松邦仁 (hira@rvf-rc45.net) @copyright Copyright (C) 2017 Kunihito Hiramatsu @n Release...
<|file_name|>isVector.ts<|end_file_name|><|fim▁begin|>import { IVector } from '~math'; export function isVector(v: any): v is IVector {<|fim▁hole|> typeof v.x === 'number' && typeof v.y === 'number' && (v.z && typeof v.z === 'number' || true) ); }<|fim▁end|>
return ( v &&
<|file_name|>WeaveKeyExportClientNative.cpp<|end_file_name|><|fim▁begin|>/* * * Copyright (c) 2013-2017 Nest Labs, 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 c...
{ WEAVE_ERROR err = WEAVE_NO_ERROR;
<|file_name|>create-image2.py<|end_file_name|><|fim▁begin|>import cv2 import numpy as np import sys def reshapeImg(img, l, w, p): # reshape image to (l, w) and add/remove pixels as needed while len(img) % p != 0: img = np.append(img, 255) olds = img.size / p news = l*w if news < olds: img = img[:p*news] eli...
l = int(sys.argv[1]) w = int(sys.argv[2]) s = sys.argv[3]
<|file_name|>GUIWindowVideoBase.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2005-2008 Team XBMC * http://www.xbmc.org * * This Program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation;...
/* For recordings we check here for a available stream URL */ CPVRRecording *tag = g_PVRRecordings->GetByPath(item.GetPath()); if (tag && !tag->m_strStreamURL.IsEmpty())
<|file_name|>uint-template.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...
assert!(parse_bytes(to_bytes(~"Z"), 10u).is_none()); assert!(parse_bytes(to_bytes(~"_"), 2u).is_none());
<|file_name|>Education.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import { useTranslation } from 'react-i18next'; import School from "../components/School"; import SectionHeader from "../components/SectionHeader"; import FadeInAndGrowWhenVisible from "../components/animations/FadeInAndGrowWhenVisible";...
export default Education;
<|file_name|>policy.py<|end_file_name|><|fim▁begin|>""" -- Policy Network for decision making [more general] """ from nmt_uni import * from layers import _p import os import time, datetime import cPickle as pkl # hyper params TINY = 1e-7 PI = numpy.pi E = numpy.e A = 0.2 B = 1 class Controller(object): ...
if self.type == 'categorical': actions = tensor.matrix('actions', dtype='int64') elif self.type == 'gaussian':
<|file_name|>test_opt_conmin.py<|end_file_name|><|fim▁begin|>""" Test the CONMIN optimizer component """ import unittest import numpy # pylint: disable=F0401,E0611 from openmdao.main.api import Assembly, Component, VariableTree, set_as_top, Driver from openmdao.main.datatypes.api import Float, Array, Str, VarTree fro...
assert_rel_error(self, self.top.comp.opt_design_vars[2],
<|file_name|>bench_objectify.py<|end_file_name|><|fim▁begin|>import sys, copy from itertools import * import benchbase from benchbase import (with_attributes, with_text, onlylib, serialized, children, nochange) ############################################################ # Benchmarks ##########...
<|file_name|>debugkarma.conf.js<|end_file_name|><|fim▁begin|>module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter fra...
{ pattern: 'test/**/*.js.map', included: false },
<|file_name|>primes.py<|end_file_name|><|fim▁begin|>import time import numpy as np """ Module for prime related computations Includes: Infinite prime iterator Thresholded prime iterator Primality test Prime Factorization Divisor Computation Divisor Cardinality """ class EratosthenesSieve(obje...
if self.table[p] == 1: self.primes.append(p)
<|file_name|>68.rs<|end_file_name|><|fim▁begin|>/* Problem 68: Magic 5-gon ring * * Consider the following "magic" 3-gon ring, filled with the numbers 1 to 6, and each line adding to nine. * * Working clockwise, and starting from the group of three with the numerically lowest external node (4,3,2 in this example), ...
<|file_name|>apache.rs<|end_file_name|><|fim▁begin|>#![feature(test)] extern crate grok; extern crate test; use grok::Grok; use test::Bencher; #[bench] fn bench_apache_log_match(b: &mut Bencher) { let msg = r#"220.181.108.96 - - [13/Jun/2015:21:14:28 +0000] "GET /blog/geekery/xvfb-firefox.html HTTP/1.1" 200 1097...
<|file_name|>volumeops.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Pedro Navarro Perez # Copyright 2013 Cloudbase Solutions Srl # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complia...
CONF = cfg.CONF CONF.register_opts(hyper_volumeops_opts, 'hyperv') CONF.import_opt('my_ip', 'nova.netconf')
<|file_name|>cache.rs<|end_file_name|><|fim▁begin|>use consumer::forced_string; use std::{fs, path, process}; #[derive(Clone)] pub struct Cache { build: path::PathBuf, cache: path::PathBuf,<|fim▁hole|>impl Cache { pub fn new(build: path::PathBuf, cache: path::PathBuf) -> Cache { let folders = vec![...
folders: Vec<String>, }
<|file_name|>banner.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ banner Description goes here... :copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited :license: BSD, see LICENSE for more details. """ import unittest from selenium.webdriver.common.by import By from sele...
def test_ict_academy_tamilnadu(self): driver = self.driver driver.get("http://pursuite.openlabs.us/ssc-article/it-ites-initiative/developing-tomorrows-workforce-today/training-programs-tools-resources/private-sector-training-programs/ict-academy-tamilnadu/")
<|file_name|>big.js-global-tests.ts<|end_file_name|><|fim▁begin|>/* This file contains tests for the globally exported big.js definitions. Use the global Big constructor and the types in the global BigJs namespace. Do not import anything from 'big.js' Tests include code from http://mikemcl.github.io/big.js/ ...
x.div(3); // 1.667 y.div(3); // 1.6666666667 }
<|file_name|>build_soul.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- """Tanium SOUL package builder.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import codecs import ...
if lprop: ret.append(self._api_dict(lprop, True)) if sprops:
<|file_name|>generate_case_lists.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2015 The ANGLE Project Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file.<|fim▁hole|># # generate_case_lists.py: # Helper script for updatin...
<|file_name|>StatusNotification.ts<|end_file_name|><|fim▁begin|>import { NotificationType } from 'vscode-languageclient' export enum Status { ok = 1, warn = 2, error = 3 }<|fim▁hole|>export interface StatusParams { state: Status } export const type = new NotificationType<StatusParams>('standard/status')<|fim▁...
<|file_name|>not_undef.hpp<|end_file_name|><|fim▁begin|>/** * @file * Declares the NotUndef type. */ #pragma once #include "../values/forward.hpp" #include <ostream> namespace puppet { namespace runtime { namespace types { // Forward declaration of recursion_guard struct recursion_guard; /** * R...
<|file_name|>set-queue-2.js<|end_file_name|><|fim▁begin|>/* * Author: Zoltán Lajos Kis <zoltan.lajos.kis@ericsson.com> */ <|fim▁hole|>"use strict"; module.exports.bin = [ 0x00, 0x15, // type = 21 0x00, 0x08, // length = 8 0xff, 0xf...
<|file_name|>commands.js<|end_file_name|><|fim▁begin|>exports.__esModule = true; exports.parseServerOptionsForRunCommand = parseServerOptionsForRunCommand; exports.parseRunTargets = parseRunTargets; var _cordova = require('../cordova'); var cordova = babelHelpers.interopRequireWildcard(_cordova); var _cordovaProject...
var findMongoPort = require('../runners/run-mongo.js').findMongoPort; var isRunning = !!findMongoPort(options.appDir);
<|file_name|>report.js<|end_file_name|><|fim▁begin|>import axios from 'axios'; import { updateRadius } from './radius-reducer';<|fim▁hole|>/* ------------------ ACTIONS --------------------- */ const ADD_B_TYPE = 'ADD_B_TYPE'; const ADD_LNG_LAT = 'ADD_LNG_LAT'; const UPDATE_RADIUS = 'UPDATE_RADIUS'; const SWITC...
import { AddBType } from './b-type-reducer'; // import { create as createUser } from './users'; // import history from '../history';
<|file_name|>daint.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `DAINT` reader"] pub struct R(crate::R<DAINT_SPEC>); impl core::ops::Deref for R { type Target = crate::R<DAINT_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<DAINT_SPEC>> for R { ...
#[inline(always)]
<|file_name|>port_plus_one.py<|end_file_name|><|fim▁begin|>def pre_listen(task_id, transport, attr_array): new_attrs = [] for (scope, name, value) in attr_array: if scope == transport and name == 'port':<|fim▁hole|> value = str(int(value) + 1) new_attr = (scope, name, value) n...
<|file_name|>repositories.ts<|end_file_name|><|fim▁begin|>export interface IRepository { get<T>(key: string): T; }<|fim▁hole|> defrost(): void; }<|fim▁end|>
export interface IFrozenRepository extends IRepository {
<|file_name|>BundleInfoImpl.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 ...
private String parseSymbolicName(String name) { // note that we don't explicitly check if there are tokens, because that
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate nom; mod assembler; mod parser; mod tokens;<|fim▁hole|> pub use assembler::assemble;<|fim▁end|>
<|file_name|>FilestoreModel.js<|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 un...
{ name: 'type', type: 'string' },
<|file_name|>dockcli.py<|end_file_name|><|fim▁begin|># Basic command-line interface to manage docker containers which will use an # image stored in a dockerhub registry - 'pokeybill/bftest' import click from click.testing import CliRunner import docker import sys import time import requests this = sys.modules[__name_...
repeat += 1
<|file_name|>ProfileFragment.java<|end_file_name|><|fim▁begin|>package com.carpoolsophia; import java.util.concurrent.ExecutionException; import org.json.JSONException; import org.json.JSONObject; import android.app.Fragment; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; import andr...
final ProfileFragment finalThis = this;
<|file_name|>strmap_helper.py<|end_file_name|><|fim▁begin|>""" This module contains a helper to extract various kinds of primitive data types from a dictionary of strings. """ class StringDictHelper: """ Helper class to extract primitive types from a dictionary of strings. This is a port of Java rob...
<|file_name|>test_constants.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). You may // not use this file except in compliance with the License. A copy of the // License is located at // ...
cluster1 = "arn:aws:ecs:us-east-1:123456789123:cluster/test1"
<|file_name|>reproducibility.py<|end_file_name|><|fim▁begin|>import json, logging, os, re, subprocess, shlex <|fim▁hole|>from tools import get_category_by_status log = logging.getLogger() meta_files = ['Disassembly', 'Stacktrace', 'Registers', 'SegvAnalysis', 'ProcMaps', "BootLog" , "CoreDump", "Boo...
<|file_name|>vyos_banner.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat<|fim▁hole|># # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pub...
<|file_name|>capability-token.5.x.py<|end_file_name|><|fim▁begin|>from flask import Flask, Response, request from twilio.util import TwilioCapability app = Flask(__name__) @app.route('/token', methods=['GET']) def get_capability_token(): """Respond to incoming requests."""<|fim▁hole|> # Find these values at t...
<|file_name|>test.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.apache....
import FLOAT64_MAX_SAFE_NTH_FIBONACCI = require( './index' );
<|file_name|>test_aliasdb.py<|end_file_name|><|fim▁begin|>import unittest import io import aliasdb from aliasdb import Alias, AliasDB, JSONBackend class FakeAliasDatabase(): def __init__(self): self.aliases = [] def add_alias(self, alias): self.aliases.append(alias) def get_aliases(self)...
<|file_name|>tensor_to_vector.cc<|end_file_name|><|fim▁begin|>#include <primitiv/config.h> #include <cstring> <|fim▁hole|> namespace primitiv { namespace devices { std::vector<float> Eigen::tensor_to_vector_impl(const Tensor &x) { const std::uint32_t num_elements = x.shape().size(); std::vector<float> ret(num_ele...
#include <primitiv/devices/eigen/device.h> #include <primitiv/devices/eigen/ops/common.h>
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from wagtailmenus.utils.version import get_version, get_stable_branch_name # major.minor.patch.release.number # release must be one of alpha, beta, rc, or final VERSION = (3, 1, 0, "alpha", 0) __version__ = get_version(VERSION) stable_branch_name = get_stable_branc...
<|file_name|>nf.rs<|end_file_name|><|fim▁begin|>use e2d2::common::EmptyMetadata; use e2d2::headers::*; use e2d2::operators::*; use e2d2::scheduler::*; use fnv::FnvHasher; use std::collections::HashMap; use std::convert::From; use std::hash::BuildHasherDefault; use std::net::Ipv4Addr; type FnvHash = BuildHasherDefault<...
lpm_table.insert_ipv4(&Ipv4Addr::new(41, 105, 236, 253), 32, 1); lpm_table.insert_ipv4(&Ipv4Addr::new(183, 60, 48, 25), 32, 1); lpm_table.insert_ipv4(&Ipv4Addr::new(188, 143, 232, 254), 32, 1); lpm_table.insert_ipv4(&Ipv4Addr::new(36, 97, 169, 81), 32, 1);
<|file_name|>service_account.go<|end_file_name|><|fim▁begin|>// Copyright 2022 Google LLC. 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.apac...
<|file_name|>solution.py<|end_file_name|><|fim▁begin|>import collections puzzle_input = (0,13,1,8,6,15) test_inputs = [ ([(0,3,6), 10], 0), ([(1,3,2)], 1), ([(2,1,3)], 10), ([(1,2,3)], 27), ([(2,3,1)], 78), ([(3,2,1)], 438), ([(3,1,2)], 1836), # Expensive Tests # ([(0,3,6), 300000...
return prev_number for _input, expected_output in test_inputs:
<|file_name|>VirtualSCSIController.java<|end_file_name|><|fim▁begin|>package com.vmware.vim25; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotati...
VirtualLsiLogicController.class, ParaVirtualSCSIController.class, VirtualBusLogicController.class,
<|file_name|>on.js<|end_file_name|><|fim▁begin|>/** @license MIT License (c) copyright B Cavalier & J Hann */ /** * wire/on plugin * wire plugin that provides an "on" facet to connect to dom events, * and includes support for delegation * * wire is part of the cujo.js family of libraries (http://cujojs.com/) * ...
<|file_name|>errorcodes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # $Id: $ ERROR_AUTH_FAILED = "Authorization failed" NO_SUCH_BACKEND = "No such backend"<|fim▁hole|><|fim▁end|>
REDIRECTION_FAILED = "Redirection failed"
<|file_name|>shocker.py<|end_file_name|><|fim▁begin|>import src import random class Shocker(src.items.Item): """ ingame item used as ressource to build bombs and stuff should have the habit to explode at inconvienent times """ type = "Shocker" def __init__(self): """ set up in...
super().__init__(display="/\\")
<|file_name|>deriving-span-Ord-enum-struct-variant.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 //...
A { x: Error //~ ERROR //~^ ERROR
<|file_name|>test_surface_mover.py<|end_file_name|><|fim▁begin|>import IMP import IMP.algebra import IMP.core import IMP.atom import IMP.test class Tests(IMP.test.TestCase): """Tests for SurfaceMover.""" def test_init(self): """Test creation of surface mover.""" m = IMP.Model() surf ...
mv = IMP.core.SurfaceMover(surf, 1, .1, 1.) self.assertSetEqual(set([surf.get_particle()]), set(mv.get_inputs())) mv.set_was_used(True)
<|file_name|>TextListFragment.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015 IRCCloud, 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/license...
text = args.getString("text"); if(textView != null)
<|file_name|>hello_world_macro.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate nickel; <|fim▁hole|> server.get("**", middleware!("Hello World")); server.listen("127.0.0.1:6767").unwrap(); }<|fim▁end|>
use nickel::{Nickel, HttpRouter}; fn main() { let mut server = Nickel::new();
<|file_name|>http_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unle...
redirectHandler := func(s int, bad bool) func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/" {
<|file_name|>udp_application.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' Author: Robin David License: GNU GPLv3 Repo: https://github.com/RobinDavid Copyright (c) 2012 Robin David PyStack is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as pu...
else: raise Exception("[Errno -5] No address associated with hostname") if not self.connectionID:
<|file_name|>bundle.js<|end_file_name|><|fim▁begin|>(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,...
document.getElementById("taskReward").value;
<|file_name|>primitives_scale.rs<|end_file_name|><|fim▁begin|>extern crate rand; extern crate kiss3d; extern crate nalgebra as na; use rand::random; use na::{Vec3, Translation, RotationWithTranslation}; use kiss3d::window::Window; use kiss3d::light::Light; fn main() { let mut window = Window::new("Kiss3d: primiti...
sp.append_translation(&Vec3::new(offset, -1.0, 0.0)); co.append_translation(&Vec3::new(offset, 2.0, 0.0)); cy.append_translation(&Vec3::new(offset, -2.0, 0.0));
<|file_name|>test_environments_negative.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Mirantis, 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....
type_of_creds='alt') @classmethod def resource_cleanup(cls):
<|file_name|>hook-django.core.mail.py<|end_file_name|><|fim▁begin|>#----------------------------------------------------------------------------- # Copyright (c) 2013-2016, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # T...
backward compatibility). We then need to name those modules as hidden imports, otherwise at runtime the autoreload thread will complain with a traceback.
<|file_name|>competing_consumer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|># third party related imports import boto.sqs import ujson # local library imports from mobile_push.config import setting from mobile_push.logger import logger from mobile_push.message_router import MessageRouter keep_ru...
# standard library imports import signal
<|file_name|>modulegen__gcc_LP64.py<|end_file_name|><|fim▁begin|>from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warning...
'void', [param('ns3::Address', 'address')], is_pure_virtual=True, is_virtual=True) ## net-device.h (module 'network'): void ns3::NetDevice::SetIfIndex(uint32_t const index) [member function]
<|file_name|>newapp_test.go<|end_file_name|><|fim▁begin|>package cmd import ( "fmt" "io/ioutil" "os" "path/filepath" "reflect" "sort" "strings" "testing" kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" buildapi "github.com/openshift/origin/pkg/...
t.Fatalf("%s: Refs amount doesn't match. Expected %d, got %d", test.name, len(test.expectedRefs), len(refs)) }
<|file_name|>image_spec.js<|end_file_name|><|fim▁begin|>describe("Image", function() { beforeEach(function() { $("body").append($('<div id="sandbox"></div>')); }); afterEach(function() { $('#sandbox').remove(); $('.ui-dialog').remove(); }); it("add image into item content by factory", function() ...
<|file_name|>compiler-llvm.cpp<|end_file_name|><|fim▁begin|>// **************************************************************************** // compiler-llvm.cpp XLR project // **************************************************************************** // // File Descrip...
<|file_name|>event_data_objects.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation...
if (expression && Events::reconstruct_interval_expression(&expr_buf, interval, expression)) DBUG_RETURN(EVEX_MICROSECOND_UNSUP);
<|file_name|>XmlMarkupDeclImpl.java<|end_file_name|><|fim▁begin|>/* * Copyright 2000-2014 JetBrains s.r.o. * * 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...
* Unless required by applicable law or agreed to in writing, software
<|file_name|>repr.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/licenses/L...
<|file_name|>networking.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>/* 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 script_thread::{CommonScriptMsg, MainThrea...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; exports.connect = function () { var mongoose = require('mongoose'), config = require('../config'), options = { user : config.mongo.user, pass : config.mongo.pass }; <|fim▁hole|> return mongoose.connection; };<|fim▁end|>
mongoose.connect(config.db, options);
<|file_name|>GLmesh.hpp<|end_file_name|><|fim▁begin|>#ifndef GLMESH_H #define GLMESH_H #include <GLplus.hpp> namespace tinyobj { struct shape_t; } // end namespace tinyobj namespace GLmesh { class StaticMesh { std::shared_ptr<GLplus::Buffer> mpPositions; std::shared_ptr<GLplus::Buffer> mpTexcoords; ...
size_t mVertexCount = 0; std::shared_ptr<GLplus::Texture2D> mpDiffuseTexture;
<|file_name|>ndarray.go<|end_file_name|><|fim▁begin|>package nd import ( "fmt" "math" "strconv" "strings" ) //多维数据,高维的值表示有多少个次一个维度的空间,以此类推。 //数据以slice存储,索引也以(第一维位置, 第二维位置, 第三维位置, ...) 检索。 //实现的String接口将第一维“横着”显示,第二维、第三维依次堆积,因此以二维结构来看, //第一维和第二维类似矩阵的行和列。 //无论如何Reshape(),data数据的顺序没有发生变化,只是索引发生变化。 type NdArray struc...
panic(fmt.Errorf("shape error"))
<|file_name|>webhook.go<|end_file_name|><|fim▁begin|>package api import ( "encoding/json" "net/http" "strings" log "github.com/Sirupsen/logrus"<|fim▁hole|> "github.com/gorilla/mux" "github.com/shipyard/shipyard/dockerhub" ) func (a *Api) hubWebhook(w http.ResponseWriter, r *http.Request) { vars := mux.Vars(r) ...
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var address = ''; var config = {}; var requestGroupId = 0; var readRequestsTodo = 0; var readRequestsDone = 0; var scanRequestsTodo = [0, 0, 0]; var scanRequestsDone = [0, 0, 0]; var scanResults = []; var requestSentCounter = 0; var requestSuccessCounter = 0; var reques...
$('#analogs') .on('change', '.form-control', function(e) { setAnalog(config[$(e.currentTarget).closest('.analog')[0].dataset.id], e.currentTarget.value);
<|file_name|>nonFinalPublic.py<|end_file_name|><|fim▁begin|>for astTuple in Query.input.tuples('ast'): if type(astTuple.ast) is Field: modifiers = astTuple.ast.modifiers nonFinalPublic = modifiers.isSet(Modifier.ModifierFlag.Public) and not modifiers.isSet(Modifier.ModifierFlag.Final) if not...
Query.result = Query.input
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export * from './baSendMail.service';
<|file_name|>app.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){ ///Declare variables var unitSwap = true; var latitude = $('#latitude'); var longitude = $('#longitude'); var location = $('#location'); var temperature = $('#temperature'); var weather = $('#weather'); var w...
var day = $('#day');