prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/*
* Wazuh app - Module for agent info fetching functions
* Copyright (C) 2015-2021 Wazuh, Inc.
*
* 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 Fou... |
MONITORING_INDEX_PATTERN = getAppConfigurationSetting('wazuh.monitoring.pattern', appConfig, WAZUH_MONITORING_PATTERN);
const lastCharIndexPattern = MONITORING_INDEX_PATTERN[MONITORING_INDEX_PATTERN.length - 1]; |
<|file_name|>mimetype.ts<|end_file_name|><|fim▁begin|>// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import {
nbformat
} from '@jupyterlab/coreutils';
/**
* The mime type service of a code editor.
*/
export
interface IEditorMimeTypeService {
/**
* Get ... | * @returns A valid mimetype.
*
* #### Notes |
<|file_name|>ProtocolResponseMessageJmsTemplateFactory.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 Smart Society Services B.V.
*
* 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
*
*... | import org.springframework.jms.core.JmsTemplate; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate hyper;
extern crate hyper_native_tls;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
static URL: &'static str = "http://api.openaq.org";
mod entities;
pub use entities::*;
pub mod json {
use hyper::Client;
use hyper::net::HttpsC... | }
|
<|file_name|>classes_75.js<|end_file_name|><|fim▁begin|>var searchData=
[
['unbancategories',['unbanCategories',['../classunban_categories.html',1,'']]],
['unbancategorieshandler',['unbanCategoriesHandler',['../classunban_categories_handler.html',1,'']]],
['unbanformrecaptcha',['unbanFormRecaptcha',['../classunba... | ['unbanmembers',['unbanMembers',['../classunban_members.html',1,'']]],
['unbanmembershandler',['unbanMembersHandler',['../classunban_members_handler.html',1,'']]] |
<|file_name|>Image.js<|end_file_name|><|fim▁begin|>/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2016 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* An Image is a light-weight object you can use to display anything... | |
<|file_name|>get_flags.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 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... |
columns, found := openapi.GetPrintColumns(schema.GetExtensions())
if !found {
// Extension not found, return empty columns |
<|file_name|>loadstations.py<|end_file_name|><|fim▁begin|>import argparse
from osgb import osgb_to_lonlat
from osgb.convert import eastnorth_to_osgb
from utils.database import insert_into_db, empty_table, execute_sql<|fim▁hole|>
def read_stations(filename):
with open(filename, 'r') as input_file:
for line ... |
# Loads data from here: https://data.gov.uk/dataset/naptan
|
<|file_name|>ipasn.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import json
from . import check_input_attribute, standard_error_message
from pyipasnhistory import IPASNHistory
from pymisp import MISPAttribute, MISPEvent, MISPObject
misperrors = {'error': 'Error'}<|fim▁hole|> 'description': 'Qu... | mispattributes = {'input': ['ip-src', 'ip-dst'], 'format': 'misp_standard'}
moduleinfo = {'version': '0.2', 'author': 'Raphaël Vinot', |
<|file_name|>QueryCache.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * 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 required by applicable law or agreed to in writing, software
* distributed under... | /*
* Copyright 2017-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding:utf8 -*-
from fabric.api import task, run, local, cd, hosts, env
import time
from oozappa.config import get_config, procure_common_functions
_settings = get_config()
procure_common_functions()
import sys
from common_multiple_fabric_environment impor... | print('launch_instance_from_app_a_image')
@task |
<|file_name|>dynamic-field.directive.ts<|end_file_name|><|fim▁begin|>import { ComponentFactoryResolver, Directive, Input, OnInit, ViewContainerRef } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { DynamicFormComponents } from '../../dynamic-form.constants';
@Directive({
selector: '[dynamicF... | constructor( |
<|file_name|>strings.js<|end_file_name|><|fim▁begin|>define({
"_widgetLabel": "Tra cứu Địa lý",
"description": "Duyệt đến hoặc Kéo <a href='./widgets/GeoLookup/data/sample.csv' tooltip='Download an example sheet' target='_blank'> trang tính </a> tại đây để mô phỏng và thêm các dữ liệu bản đồ vào trang tính đó.",
... | |
<|file_name|>repo.py<|end_file_name|><|fim▁begin|>from ghizmo.commands import lib
def tags(config, args):
"""
List all tags.
"""
return config.repo.tags()
def show_tags(config, args):
"""
Show info for tags supplied on stdin.
"""
for item in lib.input_json_lines():
yield config.repo.tag(item)
... | Create a new release.
"""
yield config.repo.create_release(args.tag_name, name=args.name, |
<|file_name|>game.ts<|end_file_name|><|fim▁begin|>/// <reference path="def/jquery.d.ts"/>
import game = require('./main');
import levels = require('./testlevels');
import controls = require('./keys');<|fim▁hole|> var sounds = new HtmlAudioManager();
game.run(levels[0], controls, sounds);
});<|fim▁end|> | import HtmlAudioManager = require('./audio');
$(document).ready(function() { |
<|file_name|>FeedForward.hpp<|end_file_name|><|fim▁begin|>#ifndef _FEEDFORWARD_H_
#define _FEEDFORWARD_H_
#include <vector><|fim▁hole|>
#include "Layer.hpp"
#include "Loss.hpp"
#include "types.hpp"
class FeedForward
{
public:
FeedForward(const std::vector<Layer *> &layervec, Loss *lf);
virtual ~FeedForward();
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .base import FileTransport, HttpFileTransport, BlitzortungDataPath, BlitzortungDataPathGenerator
from .raw_signal import RawSignalsBlitzortungDataProvider
from .station import StationsBlitzortungDataProvider
from .strike import StrikesBlitzortungDataProvider
... | from .. import INJECTOR
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
mod lib;
fn main() {
//let sum = summ_iter();
let sum = lib::summ_while();<|fim▁hole|><|fim▁end|> | println!("Sum: {}", sum);
} |
<|file_name|>triggerPages.js<|end_file_name|><|fim▁begin|>// Load required packages<|fim▁hole|>
// Create our Express router
var router = express.Router();
// Create endpoint handlers for trigger pages
router.route('/q/:code')
.get(triggerPageController.getTriggerPagesQr);
router.route('/n/:code')
.get(triggerP... | var express = require('express');
var triggerPageController = require('../controllers/triggerPage'); |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# scanpdf documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 23 13:43:29 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration valu... | |
<|file_name|>CursandoFXMLController.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tcc.curriculo;
import java.net.URL;
import java.sql.SQL... | @FXML private ComboBox<Curso> cmbCurso;
@FXML private TextField txtArea;
@FXML private ComboBox<String> cmbPeriodo;
|
<|file_name|>hello_world.rs<|end_file_name|><|fim▁begin|>// use util::{run_example, read_url};
use std::{};
use util::{run_example};
fn t(file: &str) {
let a= file;
println!("hello: {:}", a);
run_example()
<|fim▁hole|>}
#[test] fn non_macro() { t("hello_world") }<|fim▁end|> | |
<|file_name|>folderadmin.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
from __future__ import unicode_literals
import itertools
import os
import re
from django import forms
from django.conf import settings as django_settings
from django.contrib import messages
from django.contrib.admin import helpers
from dja... | |
<|file_name|>MimeEncoder.java<|end_file_name|><|fim▁begin|>/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain ... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import random
from django.core.exceptions import ValidationError
from django.http.request import HttpRequest
from django.urls import reverse
from django.utils.text import slugify<|fim▁hole|>from ..context_processors import scope... |
from test_plus import TestCase
|
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>import os<|fim▁hole|>from whitenoise.django import DjangoWhiteNoise
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "morgoth.settings")
os.environ.setdefault("DJANGO_CONFIGURATION", "Production")
application = DjangoWhiteNoise(get_wsgi_application())<|fim▁end|> |
from configurations.wsgi import get_wsgi_application |
<|file_name|>vm.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use serde_json;
use serde_json::value::Value;
use common::{Context, Result, Error};
use common::structs::VM;
use database;
use handler;
use backend;
use remote;
use net;
/*
* Validates the user-specified parameters for VM creation, and s... |
if !net::is_valid_ip_port(dst) {
return Err(Error::new("Invalid `destination`, must be ip:port"));
} |
<|file_name|>davs-package.js<|end_file_name|><|fim▁begin|>'use babel';
// eslint-disable-next-line
import { CompositeDisposable, TextEditor, Directory } from 'atom';
import config from './config';<|fim▁hole|>class DavsPackage {
constructor() {
this.reactReduxUtilsView = null;
this.modalPanel = null;
thi... | import Creator from './Creator';
import Insertor from './Insertor';
|
<|file_name|>243_topology_tables.py<|end_file_name|><|fim▁begin|>from migrate.changeset import UniqueConstraint
from migrate import ForeignKeyConstraint
from sqlalchemy import Boolean, BigInteger, Column, DateTime, Enum, Float
from sqlalchemy import dialects
from sqlalchemy import ForeignKey, Index, Integer, MetaData, ... | LOG.exception(_('Exception while creating table node_info.')) |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# This file is part of Scalable COncurrent Operations in Python (SCOOP).
#
# SCOOP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Softw... | def test_wait_with_timeout(self): |
<|file_name|>hcexception.hpp<|end_file_name|><|fim▁begin|>#ifndef _HC_EXCEPTION_HPP_
#define _HC_EXCEPTION_HPP_
//////////////
// Includes //
#include <exception><|fim▁hole|>
//////////
// Code //
// To distinguish between different HCExceptions.
enum HCType {
// When the game cannot open the SDL window.
HC_W... | #include <string> |
<|file_name|>addtorrentform.cpp<|end_file_name|><|fim▁begin|>#include "addtorrentform.h"
#include "ui_addtorrentform.h"
#include "torrentcontentfiltermodel.h"
#include "torrentcontentmodel.h"
#include "proplistdelegate.h"
#include "utilities/utils.h"
#include <QDateTime>
#include <QFileDialog>
#include <QDebug>
#inclu... | |
<|file_name|>regression.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright MetaCommunications, Inc. 2003-2007
# Copyright Redshift Software, Inc. 2007
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
i... | if not self.smtp_login:
server_name = 'mail.%s' % mail.split( '@' )[-1] |
<|file_name|>jflapfile.py<|end_file_name|><|fim▁begin|>from filetypes.basefile import BaseFile
from filetypes.plainfile import PlainFile
from filetypes.plainfile import ReviewTest
import filetypes
class JFLAPReviewTest(ReviewTest):
def __init__(self, dict_, file_type):
super().__init__(dict_, file_type)
... | extensions = ['jff'] |
<|file_name|>CglibNPETest.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2009-2015 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
*
* ... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django.conf.urls import url
from oauth2_provider import views
from .views import CoffeestatsApplicationRegistration, \
CoffeestatsApplicationDetail, \
CoffeestatsApplicationApproval, \
CoffeestatsApplicationRejec... | )
# Application management views
urlpatterns += ( |
<|file_name|>seed_action.py<|end_file_name|><|fim▁begin|>""" The aomi "seed" loop """
from __future__ import print_function
import os
import difflib
import logging
from shutil import rmtree
import tempfile
from termcolor import colored
import yaml
from future.utils import iteritems # pylint: disable=E0401
from aomi.he... | LOG.debug("writing Secretfile to %s", s_path) |
<|file_name|>connections.js<|end_file_name|><|fim▁begin|>/**
* Connections
*
* `Connections` are like "saved settings" for your adapters. What's the difference between
* a connection and an adapter, you might ask? An adapter (e.g. `sails-mysql`) is generic--
* it needs some additional information to work (e.g. y... | |
<|file_name|>MultipleFileInputDialog.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
MultipleExternalInputDialog.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor ... | (C) 2013 by CS Systemes d'information (CS SI)
Email : volayaf at gmail dot com
otb at c-s dot fr (CS SI) |
<|file_name|>config.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | declare var Config: any; |
<|file_name|>notebookclass.hh<|end_file_name|><|fim▁begin|>/* XFC: Xfce Foundation Classes (User Interface Library)
* Copyright (C) 2004-2005 The XFC Development Team.
*
* notebookclass.hh - Private interface
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the... | } // namespace Gtk |
<|file_name|>l-calc_ar.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ar_EG">
<context>
<name>XDGDesktopList</name>
<message>
<location filename="../../../core/libLumina/LuminaXDG.cpp" line="608"/>
<source>Multimedia</source>
... | <message> |
<|file_name|>workflows.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apach... | |
<|file_name|>Tile.tsx<|end_file_name|><|fim▁begin|>/**
*
* Copyright (c) 2014 All Rights Reserved by the SDL Group.
*
* 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
*
* ... | import * as PropTypes from "prop-types";
|
<|file_name|>produtos.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){
var $nomeInput = $('#nomeInput');
var $descricaoInput = $('#descricaoInput');
var $precoInput = $('#precoInput');
var $categoriaSelect = $('#categoriaSelect');
var $novidadeSelect = $('#novidadeSelect');
var $carregandoImg ... | var resp = $.post('/produtos/admin/rest/salvar', obterValoresdeProdutos()); |
<|file_name|>node.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2021 Tigera, 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 License at
//
// http://www.apache.org/lic... | ip, cidr, err := cnet.ParseCIDROrIP(addr.Address)
if err == nil { |
<|file_name|>write.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use std::io;
pub trait AnyWrite {
type wstr: ?Sized;
type Error;
fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<(), Self::Error>;
fn write_str(&mut self, s: &Self::wstr) -> Result<(), Self::Error>;
}
impl<'a> AnyWrite for fmt... | fn write_str(&mut self, s: &Self::wstr) -> Result<(), Self::Error> { |
<|file_name|>teams_list.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
* Warmux is a convivial mass murder game.
* Copyright (C) 2001-2011 Warmux Team.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms... | << Format(_("Error loading team :")) << real_name <<":"<< error
<< std::endl;
return false;
} |
<|file_name|>CanvasRect.js<|end_file_name|><|fim▁begin|>/**
* Draws rectangles
*/
Y.Rect = Y.Base.create("rect", Y.Shape, [], {
/**
* Indicates the type of shape
*
* @property _type
* @readOnly
* @type String
*/
_type: "rect",
<|fim▁hole|> /**
* @private
*/
_dra... | |
<|file_name|>SiteMapClient.py<|end_file_name|><|fim▁begin|>""" Client-side transfer class for monitoring system
"""
import time
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC import S_OK
class SiteMapClient:
###########################################################################
def __init__( se... | |
<|file_name|>ScreenSpySrv.js<|end_file_name|><|fim▁begin|>'use strict';
describe('Service: ScreenSpySrv', function () {
// load the service's module
beforeEach(module('brandonMcgregorApp'));
// instantiate service
var ScreenSpySrv;
beforeEach(inject(function (_ScreenSpySrv_) {
ScreenSpySrv = _ScreenSpy... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8
from setuptools import setup, find_packages
setup(name='french_dates_to_ical',
version='0.0.1',
author='Michaël Launay',
author_email='michaellaunay@ecreall.com',
url='http://www.ecreall.com/ressources/fre... | keywords='python tools utils ical',
license='GPL',
classifiers=['Development Status :: 2 - Planning', |
<|file_name|>kv-grid-checkbox.js<|end_file_name|><|fim▁begin|>/*!
* @package yii2-grid
* @author Kartik Visweswaran <kartikv2@gmail.com>
* @copyright Copyright © Kartik Visweswaran, Krajee.com, 2014 - 2015
* @version 3.0.1
*
* Client actions for yii2-grid CheckboxColumn
*
* Author: Kartik Visweswar... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.db import models
from modpacks.models.modpack import Modpack
class Server(models.Model):
""" Minecraft Server details for display on the server page """<|fim▁hole|>
name = models.CharField(verbose_name='Ser... | |
<|file_name|>tcpserv.py<|end_file_name|><|fim▁begin|># tcpserv
#
# Copyright (c) 2015 Christian Sengstock, All rights 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 by the Free Software Foundation; either
# ... | import time |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from datetime import datetime
def time_ago( x ):
return date.distance_of_time_in_words( x, datetime.utcnow() )
def iff( a, b, c ):
if a:
return b
else:
return c<|fim▁end|> | from webhelpers import * |
<|file_name|>lock_plan9.go<|end_file_name|><|fim▁begin|>// Copyright 2015 CoreOS, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0... |
l.file = f |
<|file_name|>space.js<|end_file_name|><|fim▁begin|>/**
* Test helpers for the tap tests that use material-ui as a front end
*/
import {saveToken, elements} from '../demo';
/**
*
* @param {object} aBrowser
* @param {string} accessToken
* @param {boolean} isOneOnOne
* @param {string} to
*/
export default functi... | aBrowser.element(elements.toPersonInput).setValue(to); |
<|file_name|>mcms.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `MCMS` writer"]
pub struct W(crate::W<MCMS_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<MCMS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(a... | |
<|file_name|>tbb_function_replacement.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2005-2016 Intel Corporation
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... | m_next = m_base;
m_size = size;
} |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | assert_eq!(to_string(f, -0.0, MinusPlusRaw, 8, false), "-0.0000000e0"); |
<|file_name|>main_aenetwork.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
import common
import connection
import m3u8
import base64
import os
import ustvpaths
import re
import simplejson
import sys
import time
import urllib
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
from b... | 'episode' : episode_number,
'plot' : episode_plot,
'premiered' : episode_airdate,
'TVShowTitle' : episode_showtitle, |
<|file_name|>spendfrom.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amo... | config = read_bitcoin_config(options.datadir)
if options.testnet: config['testnet'] = True
bitcoind = connect_JSON(config) |
<|file_name|>visualization.py<|end_file_name|><|fim▁begin|>"""
Visualization module.
"""
import numpy as np
from matplotlib import animation
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_lo... | mark_inset(ax, axins, loc1=2, loc2=4, fc="none", ec="0.5")
plt.savefig('taliban_zoom_intensity.pdf', bbox_inches='tight')
plt.show() |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
// vendor/assets/javascripts directory can be ref... | name = "q" + i + "a" + j;
if ($("input[name='" + name + "']:checked").length == 0) {
numbers.add(i);
$("#q" + i).css("border", "2px solid red"); |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# fi-ware-chef_validator documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 15 12:28:39 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible con... | |
<|file_name|>collections.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2018 the Pockets team, see AUTHORS.
# Licensed under the BSD License, see LICENSE for details.
"""A pocket full of useful collection tools!"""
from __future__ import absolute_import, print_function
from collections impor... | |
<|file_name|>i18n-router.http-loader.ts<|end_file_name|><|fim▁begin|>// angular
import { HttpClient } from '@angular/common/http';
import { Routes } from '@angular/router';
// libs
import * as _ from 'lodash';
import { I18NRouterLoader, I18NRouterSettings } from '@ngx-i18n-router/core';
export class I18NRouterHttpLoa... | }, () => reject('Endpoint unreachable!'));
});
} |
<|file_name|>qobject_test.rs<|end_file_name|><|fim▁begin|>extern crate qmlrs;
extern crate libc;
use qmlrs::*;
#[test]
pub fn qobject_test() {
let mut engine = qmlrs::Engine::new("test");
extern "C" fn test_slot(_: *mut ffi::QObject, id: libc::c_int, _: *const ffi::QVariantList, ret: *mut ffi::QVariant) {
... |
obj.set_property("name",Variant::String("Kai".to_string())); |
<|file_name|>picker.directive.ts<|end_file_name|><|fim▁begin|>/**
* picker.directive
*/
import {
Directive, ElementRef, Input, Compiler, ViewContainerRef, ComponentFactory,
ReflectiveInjector, Output, EventEmitter, OnInit, OnChanges, SimpleChanges
} from '@angular/core';
import { DynamicModule } from './dyna... | @Input() labels: DateTimePickerLabels = new DateTimePickerLabels();
private created: boolean;
private dialog: DialogComponent; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Two sample Kolmogorov-Smirnov test.
/// Two sample test result.
pub struct TestResult {
pub is_rejected: bool,
pub statistic: f64,
pub reject_probability: f64,
pub critical_value: f64,
pub confidence: f64,
}
/// Perform a two sample Kolmogorov-S... |
// The current value testing for ECDF difference. Sweeps up through elements
// present in xs and ys. |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package images
import (
"image"<|fim▁hole|>
"github.com/go-chi/chi"
"github.com/spf13/viper"
)
type ProductImageSet struct {
Thumbnail image.Image
Main image.Image
Original image.Image
}
type ProductImageLocations struct {
Thumbnail string
Main str... | |
<|file_name|>GlutViewController.py<|end_file_name|><|fim▁begin|>from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
from OpenGL.GLUT.freeglut import *
import GlutWrapper
import math
ESCAPE = b'\033'
class GlutViewController(GlutWrapper.GlutWrapper):
"""docstring for GlutViewController"""
... | self.drawAxis(50)
|
<|file_name|>debug.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
human_curl.debug
~~~~~~~~~~~~~~~~~~~~~~~~~~
Debuggging tests for human_curl<|fim▁hole|>
import logging
from .tests import *
logger = logging.getLogger("human_curl")
logger.setLevel(logging.DEBUG)
# Add the log mess... |
:copyright: (c) 2011 by Alexandr Lispython (alex@obout.ru).
:license: BSD, see LICENSE for more details.
""" |
<|file_name|>DirectoryFragment.java<|end_file_name|><|fim▁begin|>package com.nbsp.materialfilepicker.ui;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation... | private File mFile; |
<|file_name|>GteViewVolumeNode.cpp<|end_file_name|><|fim▁begin|>// David Eberly, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2017
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// File Versi... | rotate.SetRow(3, { 0.0f, 0.0f, 0.0f, 1.0f });
#endif
localTransform.SetTranslation(mViewVolume->GetPosition());
localTransform.SetRotation(rotate); |
<|file_name|>SharpHandler.py<|end_file_name|><|fim▁begin|>import base64, re, traceback, os, string, subprocess
from prompt_toolkit import PromptSession
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.styles import Style
from poshc2.clien... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
from django.http import HttpResponse
<|fim▁hole|><|fim▁end|> | # Create your views here.
def index(request):
return render(request, 'todo/index.html') |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Helianto -- static website generator
// Copyright © 2015-2016 Mickaël RAYBAUD-ROIG
//
// 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 Foundation... |
debug!(
"Rendering document {} in {} ...",
path.display(), |
<|file_name|>keys.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
import logging
import warnings
from flypwd.config import config
with warnings.catch_warnings():
warnings.simplefilter("ignore")
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
<|fim▁hole|>
def check_key(keyfile... | log = logging.getLogger(__name__) |
<|file_name|>stmt.go<|end_file_name|><|fim▁begin|>package cassandra
// read statements
var selectIntStmt = `<|fim▁hole|> SELECT metric_timestamp, value FROM metrics_int WHERE metric_name = ? AND tags = ?
`
var selectIntByStartEndTimeStmt = `
SELECT metric_timestamp, value FROM metrics_int WHERE metric_name = ? AND... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate diesel;
#[macro_use]
extern crate log;
mod database;
pub mod models;
pub mod routes;
mod schema;
pub mod util;
use crate::routes::rest;
use crate::routes::rest::izettle::IZettleNotifier;
use crate::util::{catchers, FileResponder};
use clap:... | #[rocket::main]
async fn main() { |
<|file_name|>coerce-unify.rs<|end_file_name|><|fim▁begin|>// run-pass
// Check that coercions can unify if-else, match arms and array elements.
// Try to construct if-else chains, matches and arrays out of given expressions.
macro_rules! check {
($last:expr $(, $rest:expr)+) => {
// Last expression comes f... | check3!(size_of::<u8>, size_of::<u16>, size_of::<usize> as fn() -> usize);
let s = String::from("bar"); |
<|file_name|>ModalOverlay.tsx<|end_file_name|><|fim▁begin|>import { Box } from '@tlon/indigo-react';
import React, { useCallback, useRef } from 'react';
import { PropFunc } from '~/types/util';
interface ModalOverlayProps {
spacing?: PropFunc<typeof Box>['m'];
dismiss: () => void;
}
type Props = ModalOverlayProps ... | (e: any) => {
if (e.key === 'Escape') { |
<|file_name|>event.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Event
# -------------
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def get_cal_events(m_st, m_end):
# load owned events
res1 = fr... | myroles = ['t2.role = "%s"' % r.replace('"', '\"') for r in roles]
myroles = '(' + (' OR '.join(myroles)) + ')'
res3 = frappe.db.sql("""select t1.name from `tabEvent` t1, `tabEvent Role` t2 |
<|file_name|>Data.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2014-2017 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GN... | |
<|file_name|>cache.go<|end_file_name|><|fim▁begin|>package auth
import (
"fmt"
"strings"
"sync"
"time"
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/auth/user"
"k8s.io/kubernetes/pkg/client/cache"
kclient "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes... | if err != nil { |
<|file_name|>macros-no-semicolon.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, m... | // 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. |
<|file_name|>MagicNumberInspection.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2003-2013 Dave Griffith, Bas Leijdekkers
*
* 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://... | final PsiType type = expression.getType();
if (!ClassUtils.isPrimitiveNumericType(type) || PsiType.CHAR.equals(type)) { |
<|file_name|>registry.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from smart_settings import LocalScope
from .icons import icon_icons_app
from .literals import DEFAULT_ICON_SET
name = 'icons'
label = _(u'Icons')
description = _(u'Han... | 'name': 'ICON_SET', |
<|file_name|>OrderSingleBean.java<|end_file_name|><|fim▁begin|>package project2.jdbc.bean;
import org.json.JSONObject;
public class OrderSingleBean {
private int qty;
private double unit_price;
private int movie_id;
private String title;
public int getQty() {
return qty;
}
public void setQty(... | return unit_price;
}
|
<|file_name|>plot_barycenters.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Barycenters
===========
This example shows three methods to compute barycenters of time series.
For an overview over the available methods see the :mod:`tslearn.barycenters`
module.
*tslearn* provides three methods for calculati... | |
<|file_name|>default.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = {
client: {
lib: {
// Load Angular-UI-Bootstrap module templates for these modules:
uibModuleTemplates: [
'modal',
'popover',
'progressbar',
'tabs',
'tooltip',
'typeahea... | 'public/lib/bootstrap/less/navs.less',
'public/lib/bootstrap/less/navbar.less', |
<|file_name|>client.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> *
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import 'babel-polyfill';
import ReactDOM from 'reac... | * React Starter Kit (https://www.reactstarterkit.com/) |
<|file_name|>test_pygeonet_processing.py<|end_file_name|><|fim▁begin|># pyGeoNet_readGeotiff
#import sys<|fim▁hole|>
from osgeo import gdal
#from string import *
import numpy as np
from time import clock
import pygeonet_defaults as defaults
import pygeonet_prepare as Parameters
from math import modf, floor
#from scipy.... | #import os |
<|file_name|>jquery.tablesorter.pager.js<|end_file_name|><|fim▁begin|>/*!
* tablesorter pager plugin
* updated 5/27/2013
*/
/*jshint browser:true, jquery:true, unused:false */
;(function($) {
"use strict";
/*jshint supernew:true */
$.extend({ tablesorterPager: new function() {
this.defaults = {
// target th... | $sh = hsh ? tc.$sticky.children('thead:first').children().children() : '';
$f = $t.find('tfoot tr:first').children(); |
<|file_name|>cms.py<|end_file_name|><|fim▁begin|>from django import template
from django.core.urlresolvers import reverse
from django.utils.http import urlquote_plus
from apps.cms.models import Content
register = template.Library()
@register.simple_tag (takes_context=True)
def cms_content (context, key):
request ... | except Content.DoesNotExist: |
<|file_name|>bit.rs<|end_file_name|><|fim▁begin|>/// The unary logical negation operator `!`.
///
/// # Examples
///
/// An implementation of `Not` for `Answer`, which enables the use of `!` to
/// invert its value.
///
/// ```
/// use std::ops::Not;
///
/// #[derive(Debug, PartialEq)]
/// enum Answer {
/// Yes,
//... | /// # Examples
///
/// ```
/// assert_eq!(!true, false); |
<|file_name|>configtest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Config file test app (together with test.cfg file)
#
import os, sys
sys.path.append("..")
import configfile
cfg = configfile.ConfigFile("test.cfg")
<|fim▁hole|>cfg.setCfgValue("name1", "value1")
cfg.setCfgValue("name2", "value2")
cfg.sel... | |
<|file_name|>Juan.py<|end_file_name|><|fim▁begin|>print("hola me llamo juan")
a = 'ofi'
b = 'chilea'
c = 'Mmm'
d = 'me da igual'
bandera = True
carac = input()
if carac.endswith('?'):
print(a)
elif carac.isupper():
print (b)
elif carac.isalnum():
print(d)
<|fim▁hole|><|fim▁end|> | else:
print(c) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.