prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>issue-3049.rs<|end_file_name|><|fim▁begin|>// rustfmt-indent_style: Visual fn main() { something.aaaaaaaaaaaa() .aaaaaaaaaaaa() .aaaaaaaaaaaa() .aaaaaaaaaaaa() .aaaaaaaaaaaa() .aaaaaaaaaaaa() .aaaaaaaaaaaa() .ben...
<|file_name|>test_cron_triggers.py<|end_file_name|><|fim▁begin|># Copyright 2014 - 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.apache.org/lic...
<|file_name|>SimpleServlet.java<|end_file_name|><|fim▁begin|>/* * Copyright 2015 Adobe Systems Incorporated * * 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<|fim▁hole|> * Unless requ...
* * http://www.apache.org/licenses/LICENSE-2.0 *
<|file_name|>mf6lakeconn.py<|end_file_name|><|fim▁begin|>import os import numpy as np import flopy ml = flopy.modflow.Modflow.load('l2a_2k.nam', version='mf2005', verbose=True) delx = ml.dis.delr.array dely = ml.dis.delc.array # get data from the lst file f = open('l2a_2k.lst', 'r') for line in f: if 'LAYER # ...
print(lake_cnt) dtype2 = [('iconn', np.int), ('belev', np.float), ('telev', np.float),
<|file_name|>environment_agents.ts<|end_file_name|><|fim▁begin|>/* * Copyright 2021 ThoughtWorks, 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/lic...
} }
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>import re import datetime import logging log = logging.getLogger(__name__) class Marker(object): __slots__ = ['line_start', 'line_end', 'expires'] def __init__(self, lineno): self.line_start = lineno self.line_end = lineno self.expi...
if match:
<|file_name|>HttpData.java<|end_file_name|><|fim▁begin|>/* * Copyright 2016 LINE Corporation * * LINE Corporation licenses this file to you 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: * * ht...
* Converts the specified formatted string into a UTF-8 {@link HttpData}. The string is formatted by * {@link String#format(Locale, String, Object...)} with {@linkplain Locale#ENGLISH English locale}. * * @param format {@linkplain Formatter the format string} of the response content
<|file_name|>AbstractCloud.java<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2009-2014 Dell, Inc. * See annotations for authorship information * * ==================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file ...
<|file_name|>commands.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2016-2018 Boucher, Antoni <bouanto@zoho.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restrictio...
* the Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions:
<|file_name|>em-osspec-network.cpp<|end_file_name|><|fim▁begin|>/* -*-c++-*- Copyright (C) 2003-2015 Runtime Revolution Ltd. This file is part of LiveCode. LiveCode is free software; you can redistribute it and/or modify it under the terms of the GN...
<|file_name|>handlers.py<|end_file_name|><|fim▁begin|>import hashlib import json from PIL import Image from django.http import HttpResponse from django.shortcuts import render try: from django.urls import reverse except ImportError: from django.core.urlresolvers import reverse from crits.core.class_mapper im...
<|file_name|>test_init.py<|end_file_name|><|fim▁begin|>"""The tests for the analytics .""" from unittest.mock import patch from homeassistant.components.analytics.const import ANALYTICS_ENDPOINT_URL, DOMAIN from homeassistant.setup import async_setup_component MOCK_VERSION = "1970.1.0" async def test_setup(hass): ...
<|file_name|>issue-21801.rs<|end_file_name|><|fim▁begin|>// compile-flags: -Cmetadata=aux pub struct Foo;<|fim▁hole|> impl Foo { pub fn new<F>(f: F) -> Foo where F: FnMut() -> i32 { loop {} } }<|fim▁end|>
<|file_name|>xml_name.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- #<|fim▁hole|># translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or ...
# Copyright 2008 Zuza Software Foundation # # This file is part of translate. #
<|file_name|>optout.py<|end_file_name|><|fim▁begin|>""" Bot wide hook opt-out for channels """ import asyncio from collections import defaultdict from fnmatch import fnmatch from functools import total_ordering from threading import RLock from sqlalchemy import Table, Column, String, Boolean, PrimaryKeyConstraint, and...
<|file_name|>math ceiling.ts<|end_file_name|><|fim▁begin|>//<|fim▁hole|><|fim▁end|>
Math.ceil(foo); //
<|file_name|>feature_compute2.py<|end_file_name|><|fim▁begin|>''' Computes feature representations ''' from __future__ import division, print_function from hscom import __common__ (print, print_, print_on, print_off, rrr, profile) = __common__.init(__name__, '[fc2]') # scientific import numpy as np # python from os.pa...
# =======================================
<|file_name|>CalendarLink.java<|end_file_name|><|fim▁begin|>/** * Copyright © 2002 Instituto Superior Técnico * * This file is part of FenixEdu Academic. * * FenixEdu Academic is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * t...
private static final MessageResources messages = MessageResources.getMessageResources(Bundle.DEGREE);
<|file_name|>test_client.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest import os import collections import mock import accurev.client import accurev.depot class TestAccuRevClient(unittest.TestCase): def setUp(self): self.client = accurev.client.Client() ...
<|file_name|>test_run_CR3BP.py<|end_file_name|><|fim▁begin|>""" ******************************************************************** Test file for implementation check of CR3BP library. ******************************************************************** Last update: 21/01/2022 Description ----------- ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from cStringIO import StringIO from captcha.models import CaptchaStore from django.http import HttpResponse, Http404 from django.shortcuts import get_object_or_404 import Image,ImageDraw,ImageFont,ImageFilter import random from captcha.conf import settings def captcha...
image = Image.composite(fgimage, image, maskimage) xpos = xpos + 2 + charimage.size[0]
<|file_name|>t1.js<|end_file_name|><|fim▁begin|>const S$ = require('S$'); function loadSrc(obj, src) { throw src; } const cookies = S$.symbol('Cookie', ''); const world = {}; if (cookies) { if (/iPhone/.exec(cookies)) {<|fim▁hole|>} else { loadSrc(world, '/resources/fresh'); }<|fim▁end|>
loadSrc(world, '/resources/' + cookies); } loadSrc(world, '/resources/unknown');
<|file_name|>resp.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 MaidSafe.net limited. // // This SAFE Network Software is licensed to you under The General Public License (GPL), version 3. // Unless required by applicable law or agreed to in writing, the SAFE Network Software distributed // under the GPL Licence is...
// Test converting an `AuthGranted` object to its FFI representation and then back again. #[test]
<|file_name|>P3_removeCsvHeader.py<|end_file_name|><|fim▁begin|>#! python3 """Remove CSV header Removes the header from all CSV files in the current working directory. Note: Outputs to ``./headerRemoved`` directory. """ def main(): import csv, os os.makedirs('headerRemoved', exist_ok=True) # Loop...
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! A library for build scripts to compile custom C code //! //! This library is intended to be used as a `build-dependencies` entry in //! `Cargo.toml`: //! //! ```toml //! [build-dependencies] //! gcc = "0.3" //! ``` //! //! The purpose of this crate is to provide the ...
<|file_name|>test_db_base.cpp<|end_file_name|><|fim▁begin|>#include "test_db_base.h" #include <cppcms/json.h> test_db_base::test_db_base(cppcms::service &srv) : cppcms::application(srv) { db_connection_str = settings().get<std::string>("app.db_connection_string"); } <|fim▁hole|> void test_db_base::clear() { s...
void test_db_base::init() { sql.open(db_connection_str); }
<|file_name|>a3.py<|end_file_name|><|fim▁begin|>def p5a(): xs = [-.75, -0.5,-0.25,0] fxs = [-.0718125, -.02475, .3349375, 1.101] getdd123(xs,fxs,3) def getdd123(xs,fxs,n): #derivatives l1stdd = [] l2nddd = [] l3rddd = [] for i in range(0,n): l1stdd.append((fxs[i+1]-fxs[i])/(xs[i+1]-xs[i])) for i...
getdd123(xs,fxs,3)
<|file_name|>toc.service.ts<|end_file_name|><|fim▁begin|>import { Inject, Injectable } from '@angular/core'; import { DOCUMENT, DomSanitizer, SafeHtml } from '@angular/platform-browser'; import { ReplaySubject } from 'rxjs/ReplaySubject'; import { ScrollSpyInfo, ScrollSpyService } from 'app/shared/scroll-spy.service';...
if (id) {
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' .. module:: genomics.config :synopsis: library configuration :noindex: :copyright: Copyright 2014 by Tiago Antao :license: GNU Affero, see LICENSE for details .. moduleauthor:: Tiago Antao <tra@popgen.net> ''' import os impor...
self.grid_limit = int(self.grid_limit) except cp.NoSectionError:
<|file_name|>softlayer.py<|end_file_name|><|fim▁begin|>from os import getenv from time import time, sleep from core import Platform, Instance from SoftLayer import Client from SoftLayer.CCI import CCIManager from paramiko import SSHClient class _SuppressPolicy(object): def missing_host_key(self, client, hostname,...
'password': password} client = SSHClient() client.set_missing_host_key_policy(_SuppressPolicy())
<|file_name|>DefaultProcedureOperator.java<|end_file_name|><|fim▁begin|>/* * Copyright 2007-2019 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 * * ...
CallableStatement statement = null; AccessorEventContext eventContext = null; boolean hasEx = false; try {
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2014 Davide Corio # Copyright 2015-2016 Lorenzo Battistini - Agile Business Group # Copyright 2018 Sergio Zanchetta (Associazione PNLUG - Gruppo Odoo) # Copyright 2018 Sergio Corato # License LGPL-3.0 or later (http://www.gnu....
}
<|file_name|>test_app.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Test for: command line arguments """ from nose.tools import eq_, assert_raises from m2bk import app, config, const import os def _get_arg_cfg_file_name(arg, filename): try: app.init_parsecmdline([arg, filename]) except...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate cgmath; #[macro_use] extern crate glium; extern crate glutin; #[macro_use] extern crate log; extern crate rand; extern crate time; mod main;<|fim▁hole|>mod scene; fn main() { main::main(); }<|fim▁end|>
mod prelude; mod raytrace;
<|file_name|>u16.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<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your //...
// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
<|file_name|>web.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3 import subprocess from xml.dom import minidom import imaplib from pycious.lib.common import singleton class Mail: def __init__(self, username, password,\ server='imap.gmail.com', port=993): """ It returns -1 i...
self.M=imaplib.IMAP4_SSL(self.server , self.port) #First field is imap login (gmail uses login with #domain and '@' character), second - password self.M.login(self.username, self.password)
<|file_name|>electrum_reorg.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2019 The Bitcoin Unlimited developers """ Tests to check if basic electrum server integration works """ import random from test_framework.util import waitFor, assert_equal from test_framework.test_framework import Bitcoin...
<|file_name|>NotificationPermissionsModule.native.ts<|end_file_name|><|fim▁begin|>import { NativeModulesProxy } from '@unimodules/core'; <|fim▁hole|><|fim▁end|>
import { NotificationPermissionsModule } from './NotificationPermissionsModule.types'; export default (NativeModulesProxy.ExpoNotificationPermissionsModule as any) as NotificationPermissionsModule;
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup import re import os import sys def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__...
if sys.argv[-1] == 'publish': os.system("python setup.py sdist upload") print("You probably want to also tag the version now:") print(" git tag -a %s -m 'version %s'" % (version, version))
<|file_name|>mail.py<|end_file_name|><|fim▁begin|>""" Tools for sending email. """ import mimetypes import os import smtplib import socket import time import random from email import Charset, Encoders from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase ...
<|file_name|>app.js<|end_file_name|><|fim▁begin|>angular.module('MEANcraftApp', ['ngRoute', 'MEANcraftApp.login', 'MEANcraftApp.overview', 'btford.socket-io'/*,'socket-io', 'flow'*/]) .config(function ($httpProvider, $routeProvider) {<|fim▁hole|> $httpProvider.interceptors.push('TokenInterceptor'); $routePr...
<|file_name|>install-app-device-test.js<|end_file_name|><|fim▁begin|>const td = require('testdouble'); const expect = require('../../../../helpers/expect'); const RSVP = require('rsvp'); const Promise = RSVP.Promise; const adbPath = 'adbPath'; const deviceUUID = 'u...
<|file_name|>limitprocessor_identifier_hint_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ Test for Hintidentifier """ import datetime import unittest from base_test import PschedTestBase from pscheduler.limitprocessor.identifier.hint import * DATA = { "hint": "value", "match": { "...
self.assertRaises(ValueError, data_is_valid, 123)
<|file_name|>RemoveSubscriptionInfoTest.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 ...
* if you need to make a change, please see the modify the groovy scripts in the * under src/gram/script and then use maven openwire:generate to regenerate * this file. *
<|file_name|>convert.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2013, Eduard Broecker # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that # the following conditions are met: # # Re...
<|file_name|>node.py<|end_file_name|><|fim▁begin|>from props.graph_representation.word import Word,NO_INDEX, strip_punctuations import cgi from copy import deepcopy from props.dependency_tree.definitions import time_prep, definite_label,\ adjectival_mod_dependencies COPULA = "SAME AS" # the textual ...
TIME = "TIME" # the textual value of a time node LOCATION = "LOCATION" # the textual value of a location node
<|file_name|>csslint.js<|end_file_name|><|fim▁begin|>/*! CSSLint Copyright (c) 2011 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software wit...
<|file_name|>ghost.client.service.js<|end_file_name|><|fim▁begin|>'use strict'; //Ghost service used for communicating with the ghost api angular.module('ghost').factory('Ghost', ['$http', 'localStorageService', function($http, localStorageService) { return { login: function() { return $htt...
query: function(options) {
<|file_name|>ExampleUnitTest.java<|end_file_name|><|fim▁begin|>package cn.mutils.app.alipay; import org.junit.Test; import static org.junit.Assert.*; /**<|fim▁hole|> @Test public void addition_isCorrect() throws Exception { assertEquals(4, 2 + 2); } }<|fim▁end|>
* To work on unit tests, switch the Test Artifact in the Build Variants view. */ public class ExampleUnitTest {
<|file_name|>existing-authority-documents.js<|end_file_name|><|fim▁begin|>'use strict'; const BaseController = require('../controllers/base'); const UploadModel = require('../models/file-upload'); const config = require('../../../config'); const uuid = require('uuid'); const path = require('path');<|fim▁hole|> if...
module.exports = class UploadController extends BaseController { get(req, res, next) { const docs = req.sessionModel.get('existing-authority-documents') || [];
<|file_name|>IssueState.java<|end_file_name|><|fim▁begin|>package com.fastaccess.data.dao.types; import androidx.annotation.StringRes; import com.fastaccess.R; public enum IssueState { open(R.string.opened), closed(R.string.closed), all(R.string.all); int status; IssueState(@StringRes int statu...
} @StringRes public int getStatus() { return status;
<|file_name|>mail.py<|end_file_name|><|fim▁begin|># # Sending emails in combination # with Motion surveillance software # # (c) Dr. Yves J. Hilpisch # The Python Quants GmbH # import smtplib from datetime import datetime<|fim▁hole|> def prompt(prompt): return raw_input(prompt).strip() fromaddr = 'rpi@hilpisch.co...
from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText
<|file_name|>sbs_simple_ops.py<|end_file_name|><|fim▁begin|># Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. from common import * import testdata class oldstyle...
printwith("case", "%s %s= %s" % (a, op, b), type(a), type(b)) a <<= b
<|file_name|>types.go<|end_file_name|><|fim▁begin|>/* Copyright 2014 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 Unless r...
<|file_name|>battlelog.mohw.inject.js<|end_file_name|><|fim▁begin|>/// <reference path="windowbutton/battlelog.windowbutton.js" /> /// <reference path="playbar/battlelog.bf3.playbar.js" /> /// <reference path="dialog/battlelog.bf3.dialog.js" /> /// <reference path="stats/battlelog.bf3.stats.js" /> var baseurl = 'http:...
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.contrib import admin from django.utils.translation import ugettext as _ from .models import AbuseReport, SearchTermRecord admin.site.register(AbuseReport) <|fim▁hole|> search_fields = ('term', ) def get_user_full_name(self...
class SearchTermAdmin(admin.ModelAdmin): list_display = ('__unicode__', 'ip_address', 'get_user_full_name', )
<|file_name|>test_analyzers.py<|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/. from socorro.lib import datetimeutil from socorro.unittest.e...
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>export async function getNodeSummary(nodeId, nodeType) { const bioentityUrl = `${biolink}bioentity/${nodeType}/${nodeId}`; console.log('getNodeSummary bioentityUrl', nodeId, nodeType, bioentityUrl); const params = { fetch_objects: true, unselect_evidence:...
<|file_name|>eq.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.<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
//
<|file_name|>classes.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class Class(Document): name = StringField(required = True) meta = { "allow_inheritance": False }<|fim▁end|>
from mongoengine import *
<|file_name|>emf_export.py<|end_file_name|><|fim▁begin|># Copyright (C) 2009 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 Soft...
epix.iUsageSrc = 0x0 # DIB_RGB_COLORS
<|file_name|>test_copy.py<|end_file_name|><|fim▁begin|>import filecmp from transfert import Resource from transfert.actions import copy def estimate_nb_cycles(len_data, chunk_size): return (len_data // chunk_size) + [0, 1][(len_data % chunk_size) > 0] def test_simple_local_copy(tmpdir): src = tmpdir.join('...
src.write('some data')
<|file_name|>sale_report.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistr...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { Increment, Decrement } from '../actions' export default (state = 0, action) => { switch (action.constructor) { case Increment: return state + 1 case Decrement: return state - 1 default:<|fim▁hole|>}<|fim▁end|>
return state }
<|file_name|>topBarSection.ts<|end_file_name|><|fim▁begin|>module ngFoundation.directives { //@NgDirective('topBarSection') class TopBarSectionDirective implements ng.IDirective { template = '<section class="top-bar-section" ng-transclude></section>'; restrict = "E"; transclude = true; replace = tr...
}
<|file_name|>verify.py<|end_file_name|><|fim▁begin|>import calendar import json from datetime import datetime from time import gmtime, time from urlparse import parse_qsl, urlparse from wsgiref.handlers import format_date_time import jwt from browserid.errors import ExpiredSignatureError from django_statsd.clients imp...
<|file_name|>lookups.py<|end_file_name|><|fim▁begin|>bg_image_modes = ('stretch', 'tile', 'center', 'right', 'left') transitions_jquery_ui = ( 'blind', 'bounce', 'clip', 'drop', 'explode', 'fade', 'fold', 'highlight', 'puff', 'pulsate', 'scale', 'shake', 'size', 'slide' ) transitions_animatecss = ( 'bounc...
'rotateInDownRight', 'rotateInUpLeft', 'rotateInUpRight',
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import collections import difflib import inspect import logging import os.path import warnings import os import importlib import cherrypy import yaml from yaml import load try: from yaml import CLoader as Loader except ImportError: from yaml import Loader j...
self._logging_config = load(logging_yml, self._YAMLLoader) if "bundles_yml" in config_file_paths and not webassets_env:
<|file_name|>ProbabilitisticModels.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # A search engine based on probabilitistic models of the information retrival. # Author - Janu Verma # email - jv367@cornell.edu # http://januverma.wordpress.com/ # @januverma import sys from pydoc import help import os ...
# inittalize the score for the document
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package provision import ( "bytes" "fmt" "io/ioutil" "net/url" "path" "path/filepath" "strconv" "strings" log "github.com/Sirupsen/logrus" "github.com/docker/machine/libmachine/auth" "github.com/docker/machine/libmachine/provision/pkgaction" "github.com/d...
} machineServerKeyPath := path.Join(dockerDir, "server-key.pem") authOptions.ServerKeyRemotePath = machineServerKeyPath
<|file_name|>PreCastEvent.java<|end_file_name|><|fim▁begin|>package com.elmakers.mine.bukkit.api.event; import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; import com.elmakers.mine.bukkit.api.magic.Mage; import com.elmakers.mine.bukkit.api.spell.Spell; /** * A cu...
private final Mage mage; private final Spell spell;
<|file_name|>file.py<|end_file_name|><|fim▁begin|>import os import re import mimetypes from collections import namedtuple<|fim▁hole|> from app.lib.helpers import ( http400, http404, ) DEFAULT_CONTENT_TYPE = 'application/octet-stream' FILENAME_PARSER = re.compile(r"(?P<id>\d+)_(?P<name>.+)\.(?P<format>.+)") P...
from aiohttp import web
<|file_name|>text.rs<|end_file_name|><|fim▁begin|>use std::borrow::ToOwned; use std::any::Any; use { GenericEvent, TEXT }; /// When receiving text from user, such as typing a character pub trait TextEvent { /// Creates a text event. fn from_text(text: &str, old_event: &Self) -> Option<Self>; /// Calls clo...
{ if self.event_id() != TEXT {
<|file_name|>signals.js<|end_file_name|><|fim▁begin|>// This is not the set of all possible signals. // // It IS, however, the set of all signals that trigger // an exit on either Linux or BSD systems. Linux is a // superset of the signal names supported on BSD, and // the unknown signals just fail to register, s...
) }
<|file_name|>interface.go<|end_file_name|><|fim▁begin|>package autonat import ( "context" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" ma "github.com/multiformats/go-multiaddr" ) // AutoNAT is the interface for NAT autodiscovery type AutoNAT interface { // Status returns t...
<|file_name|>gone-exception.js<|end_file_name|><|fim▁begin|>/** * MIT License * * Copyright (c) 2017 ITGorillaz * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction,...
<|file_name|>test_user_has_group.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests.common import TransactionCase from odoo.exceptions import ValidationError class TestHasGroup(TransactionCase): def setUp(self): ...
self.assertEqual( self.test_user.groups_id, (group_0 + group_U + self.grp_internal), "We should have our 2 groups and the implied user group",
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.md') as readme_file: readme = readme_file.read() with open('HISTORY.md') as history_file: history = history_file.read() requirements = [ 'requests' ] test_requ...
<|file_name|>OptionsApp.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../all.d.ts" /> module OptionsApp {<|fim▁hole|> .run(Helpers.setCurrentLanguage) .run(Helpers.trackPage) .controller('OptionsCtrl', OptionsCtrl) .directive('checkboxOption', () => { return { template: `<input ng-model="param"...
angular.module('OptionsApp', ['HeaderApp', 'gettext', 'angular-google-analytics']) .config(Helpers.setAnaliticSetting)
<|file_name|>slo.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 OpenStack Foundation # # 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 # ...
:raises HTTPNotFound: on SLO manifest not found :returns: SLO manifest's segments
<|file_name|>espree.js<|end_file_name|><|fim▁begin|>/** * @fileoverview Main Espree file that converts Acorn into Esprima output. * * This file contains code from the following MIT-licensed projects: * 1. Acorn * 2. Babylon * 3. Babel-ESLint * * This file also contains code from Esprima, which is BSD licensed. ...
<|file_name|>CommentsAdapter.java<|end_file_name|><|fim▁begin|>package org.shikimori.library.adapters; import android.content.Context; import android.view.View; import android.view.ViewGroup; import com.nostra13.universalimageloader.core.ImageLoader; import org.shikimori.library.R; import org.shikimori.library.adapt...
public void setOnSettingsListener(View.OnClickListener clickListener) { this.clickListener = clickListener; }
<|file_name|>StatsDateLib.py<|end_file_name|><|fim▁begin|>""" ############################################################################## ## ## ## @name : StatsDateLib.py ## ## @license : MetPX Copyright (C) 2004-2006 Environment Canada ## MetPX comes with ABSOLUTELY NO WARRANTY; For details type see ...
DAY = 24 * HOUR MINUTES_PER_DAY = 24*60
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import makeParser from "./parser"; <|fim▁hole|><|fim▁end|>
export { makeParser };
<|file_name|>publish.js<|end_file_name|><|fim▁begin|>'use strict'; <|fim▁hole|>function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } var _Subject = require('../Subject'); var _Subject2 = _interopRequireDefault(_Subject); var _multicast = require('./multicast'); var _multi...
exports.__esModule = true; exports['default'] = publish;
<|file_name|>tvec.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licen...
fcx.schedule_lifetime_end(scope, lleltptr); fcx.schedule_drop_mem(scope, lleltptr, vt.unit_ty); } fcx.pop_custom_cleanup_scope(temp_scope);
<|file_name|>imperative_grad.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow Authors. All Rights Reserved. #<|fim▁hole|># You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.
<|file_name|>tvec.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licen...
debug!("writing index {} with lleltptr={}", i, bcx.val_to_string(lleltptr)); bcx = expr::trans_into(bcx, &**element,
<|file_name|>Print.cpp<|end_file_name|><|fim▁begin|>/* Print.cpp - Base class that provides print() and println() Copyright (c) 2008 David A. Mellis. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published ...
{ size_t n = print(num, base); n += println(); return n;
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url<|fim▁hole|> url(r'^$', 'webinterface.view.dashboard.main'), url(r'^dashboard/$', 'webinterface.view.dashboard.main'), url(r'^login/$', 'webinterface.view.login.main'), url(r'^login/ajax/$', 'webinterface...
urlpatterns = patterns('',
<|file_name|>sse-c.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-2021 MinIO, Inc. // // This file is part of MinIO Object Storage stack // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software F...
return sealedKey, errInvalidInternalIV } if algorithm != SealAlgorithm && algorithm != InsecureSealAlgorithm {
<|file_name|>PetitionsHandler.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2005-2010 MaNGOS <http://getmangos.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 Foundation; either version 2...
delete result;
<|file_name|>rabid_mott.py<|end_file_name|><|fim▁begin|>import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options<|fim▁hole|>from java.util import Vector ...
<|file_name|>debug-words.rs<|end_file_name|><|fim▁begin|>use textwrap::WordSeparator;<|fim▁hole|>fn main() { #[cfg(feature = "unicode-linebreak")] let word_separator = WordSeparator::UnicodeBreakProperties; #[cfg(not(feature = "unicode-linebreak"))] let word_separator = WordSeparator::AsciiSpace; l...
<|file_name|>portal-directives.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { ComponentFactoryResolver, ComponentRef, ...
inputs: ['portal: cdkPortalHost'], providers: [{ provide: CdkPortalOutlet, useExisting: PortalHostDirective
<|file_name|>ownershipmovessource0.rs<|end_file_name|><|fim▁begin|>// Cette fonction prend possession d'un entier alloué dans le tas. fn destroy_box(c: Box<i32>) { println!("Destroying a box that contains {}", c); // `c` est détruit et la mémoire va être libérée. }<|fim▁hole|> let x = 5u32; // On copie...
fn main() { // Entier alloué dans la pile.
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|># Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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://ww...
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License.
<|file_name|>font.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 https://mozilla.org/MPL/2.0/. */ //! Specified values for font properties #[cfg(feature = "geck...
} while let Ok(flag) = input.try(|input| { Ok(
<|file_name|>JmsEventManager.java<|end_file_name|><|fim▁begin|>package it.breex.bus.impl.jms; import it.breex.bus.event.AbstractResponseEvent; import it.breex.bus.event.EventData; import it.breex.bus.event.EventHandler; import it.breex.bus.event.RequestEvent; import it.breex.bus.impl.AbstractEventManager; import java...
eventData.setTransportData(responseQueue); ObjectMessage message = session.createObjectMessage(eventData); message.setJMSCorrelationID(eventData.getName()); message.setJMSReplyTo(responseQueue);
<|file_name|>diffservers1.js<|end_file_name|><|fim▁begin|>s = new ShardingTest( "diffservers1" , 2 ); assert.eq( 2 , s.config.shards.count() , "server count wrong" ); assert.eq( 2 , s._connections[0].getDB( "config" ).shards.count() , "where are servers!" ); assert.eq( 0 , s._connections[1].getDB( "config" ).shards.co...
test1.save( { a : 1 } ); test1.save( { a : 2 } ); test1.save( { a : 3 } ); assert( 3 , test1.count() );