prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>constraint_electrostaticpotential.py<|end_file_name|><|fim▁begin|># ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * ... | obj.addProperty(
"App::PropertyBool",
"ElectricForcecalculation",
"Parameter", |
<|file_name|>client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/... | class ReportErrorsServiceClientMeta(type): |
<|file_name|>subscribers.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.utils.translation import ugettext as _
from apps.mainapp.models import Report, ReportSubscriber... | subscriber = get_object_or_404(ReportSubscriber, confirm_token = confirm_token )
subscriber.is_confirmed = True
subscriber.save()
|
<|file_name|>scheduler.component.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core';
import * as $ from "jquery"
import {downgradeComponent} from '@angular/upgrade/static';
import {NotificationService} from "../../core/services/notification.service";
import {AgentService} from "../../core/service... | |
<|file_name|>qualify_min_const_fn.rs<|end_file_name|><|fim▁begin|>use rustc::hir::def_id::DefId;
use rustc::hir;
use rustc::mir::*;
use rustc::ty::{self, Predicate, TyCtxt};
use rustc_target::spec::abi;
use std::borrow::Cow;
use syntax_pos::Span;
type McfResult = Result<(), (Span, Cow<'static, str>)>;
pub fn is_min_c... | |
<|file_name|>building_location_choice_model.py<|end_file_name|><|fim▁begin|># Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.models.building_location_choice_model import BuildingLocationChoiceModel as UrbansimBuildingLocationChoiceM... | # buildings = None
if (building_set is not None):
|
<|file_name|>noBlankLinesAfterLocalImports_after.py<|end_file_name|><|fim▁begin|>from pprint import pprint
VAR = 42
<|fim▁hole|>
class C:
from textwrap import dedent
pass
import codecs as C
pass<|fim▁end|> | def foo():
import sys
import ast, tokenize
pass |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib import messages
from django.db.models import Q
from django.http import Http404
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.shortcuts import render, get_object_or_404, redirect
from dj... |
def post(self, request, *args, **kwargs):
formset = VariationInventoryFormSet(request.POST, request.FILES)
if formset.is_valid(): |
<|file_name|>watcher.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package client
import (
"strings"
"sync"
"v.io/v23/context"
wire "v.io/v23/services/syncbase"
... | }
change := stream.Change()
if w.OnChange != nil { |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import os
import errno
import fcntl
from contextlib import contextmanager
from time import time, sleep
@contextmanager
def wlock(filename, retry_interval=0.05):
# returns: write, exists, fd
try:
with open(filename, 'rb+') as lock:
try:
... | raise
else:
yield False, True, lock
break |
<|file_name|>XiteQt.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import ctypes, os, sys, unittest
from PySide.QtCore import *
from PySide.QtGui import *
import ScintillaCallable
sys.path.append("..")
from bin import ScintillaEditPy
scintillaDirectory = ".."
scintillaIncludeDirectory = os.pa... | sys.exit(app.exec_()) |
<|file_name|>_screenshot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import robot
from keywordgroup import KeywordGroup
class _ScreenshotKeywords(KeywordGroup):
def __init__(self):
self._screenshot_index = 0
# Public
def capture_page_screenshot(self, filename=... | link = robot.utils.get_link_path(path, logdir)
|
<|file_name|>uniq-cc-generic.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apach... | |
<|file_name|>bitcoin_he.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="he" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Trollcoin</source>
... | <message> |
<|file_name|>latex.py<|end_file_name|><|fim▁begin|># This file is part of Rubber and thus covered by the GPL
# (c) Emmanuel Beffara, 2002--2006
"""
LaTeX document building system for Rubber.
This module contains all the code in Rubber that actually does the job of
building a LaTeX document from start to finish.
"""
i... | "listoftables" : ("", self.h_listoftables),
"bibliography" : ("a", self.h_bibliography),
"bibliographystyle" : ("a", self.h_bibliographystyle), |
<|file_name|>selectors.js<|end_file_name|><|fim▁begin|>import hasFeature from './has';
export function prop(path) {<|fim▁hole|> const names = path.split('.');
if (!(names[0] in props)) {
throw new Error(`Missing required prop ${names[0]}.`);
}
return names.reduce((p, name) => (p && p[name]), pro... | return function(state, props) { |
<|file_name|>wsgi_install.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Daniel Tschan <tschan@puzzle.ch>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | p {
margin: 0 0 2em;
} |
<|file_name|>provider.py<|end_file_name|><|fim▁begin|>from allauth.socialaccount.providers.base import AuthAction, ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class Scope(object):
ACCESS = 'read-only'
class YNABAccount(ProviderAccount):
pass
<|fim▁hole|> na... | class YNABProvider(OAuth2Provider):
id = 'ynab' |
<|file_name|>DamAutoCroppingTest.java<|end_file_name|><|fim▁begin|>/*
* #%L
* wcm.io
* %%
* Copyright (C) 2019 wcm.io
* %%
* 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
*
* htt... | import io.wcm.handler.media.testcontext.AppAemContext; |
<|file_name|>fitharms.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function,division
from astropy.io import fits
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
from pint.templates import lctemplate,lcprimitives,lcfitters
from pint.eventstats import z2m,sf_z2m... | ax.axhline(5.99,color='r') |
<|file_name|>conversion_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
import unittest
class OpenCCTest(unittest.TestCase):
def setUp(self):
self.openCC = OpenCC()
def test_hk2s(self):
self.openCC.set_conversion('hk2s')
words ... | def test_s2hk(self):
self.openCC.set_conversion('s2hk')
words = '香烟(英语:Cigarette),为烟草制品的一种。鼠标是一种很常见及常用的电脑输入设备。' |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import base64
import itertools
import json
import logging
import os
import re
import time
from .buckets import get_bucket_client
from .params import get_param_client
from .secrets import get_secret_client
logger = logging.getLogger("zentral.conf.config")
class Pro... | v = v.serialize()
s[k] = v
return s |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RandomPasswordGenerator.settings")
try:
from django.core.management import execute_from_command_line
<|fim▁hole|> # Th... | except ImportError:
|
<|file_name|>relation.go<|end_file_name|><|fim▁begin|>package relation
import (
// "fmt"
"github.com/vetinari/osm/bbox"
"github.com/vetinari/osm/item"
"github.com/vetinari/osm/node"
"github.com/vetinari/osm/tags"
"github.com/vetinari/osm/user"
"github.com/vetinari/osm/way"
"time"
)
func (self *Relation) Type(... | |
<|file_name|>0005_auto_20150412_1806.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
('hhlregistrations', '0004_auto_20150411_1935'),
]
ope... | |
<|file_name|>payloads.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
from xml.etree import ElementTree as et
from lib.core.data import conf
from lib.core.data import logger
from ... | for child in element.getchildren(): |
<|file_name|>ActivityServiceImpl.java<|end_file_name|><|fim▁begin|>/*
* Crafter Studio Web-content authoring solution
* Copyright (C) 2007-2016 Crafter Software Corporation.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published ... | HashMap<String,Object> params = new HashMap<String,Object>(); |
<|file_name|>scaneo.go<|end_file_name|><|fim▁begin|>package main
import (
"errors"
"flag"
"fmt"
"go/ast"
"go/parser"
"go/token"
"log"
"os"
"path/filepath"
"strings"
"text/template"
)
const (
usageText = `SCANEO
Generate Go code to convert database rows into arbitrary structs.
USAGE
scaneo [option... | outFilename := flag.String("o", "scans.go", "")
packName := flag.String("p", "current directory", "")
unexport := flag.Bool("u", false, "") |
<|file_name|>hapi-faker.js<|end_file_name|><|fim▁begin|>var jfs = require('json-schema-faker');
var mout = require('mout');
var Joi = require('joi');
var bluebird = require('bluebird');
var HapiFaker = function(options) {
if (!(this instanceof HapiFaker))
return new HapiFaker(options);
var result = Joi.valida... |
if (!this._options.jfs) |
<|file_name|>SSS_travel_time_to_DDD.py<|end_file_name|><|fim▁begin|># Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from urbansim.abstract_variables.abstract_travel_time_variable_for_non_interaction_dataset import abstract_travel_time_variable_... | |
<|file_name|>runtime.go<|end_file_name|><|fim▁begin|>package sodium
// #cgo pkg-config: libsodium
// #include <stdlib.h>
// #include <sodium.h>
import "C"
func RuntimeHasNeon() bool {
return C.sodium_runtime_has_neon() != 0
}
func RuntimeHasSse2() bool {
return C.sodium_runtime_has_sse2() != 0
}
func RuntimeHasSs... | |
<|file_name|>resolutions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import scrapy
from scraper.items import ResolutionItem
class ResolutionSpider(scrapy.Spider):
name = "resolutions"
allowed_domains = ["www.pmo.gov.il"]
start_urls = ["http://www.pmo.gov.il/Secretary/GovDecisions/Pages/defau... | |
<|file_name|>camera.py<|end_file_name|><|fim▁begin|>"""
This component provides basic support for Amcrest IP cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.amcrest/
"""
import logging
from homeassistant.components.amcrest import (
DA... | self._resolution = amcrest.resolution |
<|file_name|>be.js<|end_file_name|><|fim▁begin|>//! moment.js locale configuration
//! locale : belarusian (be)
//! author : Dmitry Demidov : https://github.com/demidov91
//! author: Praleska: http://praleska.pro/
//! Author : Menelion Elensúle : https://github.com/Oire
import moment from '../moment';
function plural... | }
else if (key === 'h') { |
<|file_name|>serial_ports.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""This utility script was adopted from StackExchange:
http://stackoverflow.com/questions/12090503/listing-available-com-ports-with-python
Adopted for use with arduino_GC connection project
"""
import sys
import glob
import serial
def se... | result = []
for port in ports:
try: |
<|file_name|>reducer-6b2d258d.js<|end_file_name|><|fim▁begin|>import { e as error, E as EnhanceCtx, T as TurnOrder, i as info, S as Stage, a as SetActivePlayersEvent, F as FnWrap, b as SetActivePlayers, I as InitTurnOrderState, U as UpdateTurnOrderState, c as UpdateActivePlayersOnceEmpty, g as gameEvent, d as STRIP_TRA... | function flushAndValidatePlugins(state, oldState, pluginOpts) {
|
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>//! IRC protocol errors using `failure`.
use thiserror::Error;
/// A `Result` type for IRC `ProtocolErrors`.
pub type Result<T, E = ProtocolError> = ::std::result::Result<T, E>;
/// An IRC protocol error.
#[derive(Debug, Error)]
pub enum ProtocolError {
/// An i... | |
<|file_name|>CloudRetailScopes.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * 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 the License
* is distrib... | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
<|file_name|>fonts.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use glib::translate::*;
use std::clone::Cl... | impl Clone for FontOptions {
fn clone(&self) -> FontOptions { |
<|file_name|>1379.py<|end_file_name|><|fim▁begin|>"""
The mean of three integers A, B and C is (A + B + C)/3. The median of three integers is the one that would be in the
middle if they are sorted in non-decreasing order. Given two integers A and B, return the minimum possible integer C
such that the mean and the media... | |
<|file_name|>simple.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: MIT
use orbclient::{Color, EventOption, GraphicsPath, Mode, Renderer, Window};
fn main() {
let (width, height) = orbclient::get_display_size().unwrap();
let mut window = Window::new(
(width as i32) / 4,
(height as... | |
<|file_name|>translate_armor_search.js<|end_file_name|><|fim▁begin|>var tag, tag_text;
var name, name_jp;
var labeltags = document.getElementsByTagName("label");
for (var i = 0; i < labeltags.length; i++) {
tag = labeltags[i];
tag_text = tag.innerText;
for (var j=0; j<skill_replace_list.length; j++) {
... | }
}
} |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod builder;
pub mod update_queue;
pub use self::builder::StateBuilder;
pub use self::update_queue::Monitors as UpdateMonitors;
use ecs::entity::{Entities, Entity, EntityRef, Accessor};
use ecs::module::{Component, StorageReadGuard, StorageWriteGuard};
use ecs::module:... | pub fn update(&mut self) -> Update<Cx> {
Update { state: self }
} |
<|file_name|>axes.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) Duncan Macleod (2013)
#
# This file is part of GWpy.
#
# GWpy 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 ve... | >>> plot.add_subplots(111, projection='xxx') |
<|file_name|>Collection.spec.js<|end_file_name|><|fim▁begin|>import expect from "expect";
import { Collection } from "./Collection";
import { Server } from "./Server";
describe("Collection", () => {
describe("constructor", () => {
it("should set the initial set of data", () => {
const collection = new Coll... | });
it("should accept a query object", () => {
const collection = new Collection([{}, { name: "a" }, { name: "b" }]); |
<|file_name|>BasicForm.js<|end_file_name|><|fim▁begin|>Ext.form.BasicForm.override({
resetDirty: function() {
this.items.each(function(field) {
field.resetDirty();
});
},
setDefaultValues: function() {
this.items.each(function(field) {
field.setDefaultValue();... | }, this);
return ret;
} |
<|file_name|>merger.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2013, Roboterclub Aachen e.V.
# All rights reserved.
#
# The file is part of the xpcc library and is released under the 3-clause BSD
# license. See the file `LICENSE` for the full license governing this code.
# -----------------... | if dev.id.name == props.name and dev.id.type in suffix: |
<|file_name|>banner_min.js<|end_file_name|><|fim▁begin|>/*! @license pzprv3-ui.js v<%= pkg.version %> (c) 2009-<%= grunt.template.today('yyyy') %> <%= pkg.author %>, MIT license<|fim▁hole|><|fim▁end|> | * https://bitbucket.org/sabo2/pzprv3 */ |
<|file_name|>DebugActionDelegate.java<|end_file_name|><|fim▁begin|>/* COPYRIGHT-ENEA-SRC-R2 *
**************************************************************************
* Copyright (C) 2005-2007 by Enea Software AB.
* All rights reserved.
*
* This Software is furnished under a software license agreement and
* may... | } |
<|file_name|>anysex.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
)
class AnySexIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?anysex\.com/(?P<id>\d+)'
_TEST = {<|fim▁hole|>... | 'url': 'http://anysex.com/156592/',
'md5': '023e9fbb7f7987f5529a394c34ad3d3d',
'info_dict': { |
<|file_name|>backoff.go<|end_file_name|><|fim▁begin|>package backoff
import (
"math"
"time"
"github.com/quan-xie/tuba/util/xtime"
)
// Backoff interface defines contract for backoff strategies
type Backoff interface {
Next(retry int) time.Duration
}
type constantBackoff struct {
backoffInterval xtime.Duration
... | maxTimeout: float64(maxTimeout / time.Millisecond),
}
} |
<|file_name|>_part_grammar_processor.py<|end_file_name|><|fim▁begin|># -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by t... | # You should have received a copy of the GNU General Public License |
<|file_name|>KonfigurationEventTest.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import static java.time.LocalDateTime.now;
import static org.assertj.core.api.Assertions.assertThat;
public class KonfigurationEventTest {
@Test
public void test() {
KonfigurationEvent konfigurationEvent = new Konfigurati... | package buchungstool.model.importer;
import org.junit.Test;
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
setup(name='pyyaxml',
version='0.6.7',
description='Python API to Yandex.XML',
url='https://github.com/dbf256/py-ya-xml',
author='Alexey Moskvin',
author_email='dbf256@gmail.com',
license='MIT',
pa... | 'six',
],
zip_safe=False) |
<|file_name|>elasticsearch_backend.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import datetime
import re
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
from django.utils import six
import... | "max_gram": 15,
}, |
<|file_name|>test.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from wrapper import get, run
import logging
import requests
@get('/')
def f(*args, **kwargs):
return '<html><head></head><body><h1>Hello!</h1></body></html>'
@get('/test', ['php'])
def test_f(*args, **kwargs):
arguments = kwargs['arguments']
p... | |
<|file_name|>limits.rs<|end_file_name|><|fim▁begin|>use crate::error::Result;
use postgres::Connection;
use std::collections::BTreeMap;
use std::time::Duration;
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct Limits {
memory: usize,
targets: usize,
timeout: Duration,
networking: bool,
max_... | let mut res = BTreeMap::new(); |
<|file_name|>domtokenlist.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::attr::Attr;
use dom::bindings::codegen::Binding... | attr.value() |
<|file_name|>sharpen.go<|end_file_name|><|fim▁begin|>// Package sharpen provides functions to sharpen an image.
package sharpen
import (
"hawx.me/code/img/blur"
"hawx.me/code/img/utils"
"image"
"image/color"
"math"
)
// Sharpen takes an image and sharpens it by, essentially, unblurring it. It is
// currently ex... |
if diff(ar, br) >= threshold {
ar = amount*(ar-br) + ar
} |
<|file_name|>AfinidadeLikesEscolaELocalidades.py<|end_file_name|><|fim▁begin|># coding: iso-8859-1 -*-
"""
Created on Wed Oct 22 21:49:24 2014
@author: fábioandrews
"""
import facebook
from DadosDeAmigoEmComum import DadosDeAmigoEmComum
class AfinidadeLikesEscolaELocalidades:
def __init__(self,ACCESS_TOKEN_FACEB... | likesEmComumEntreOsDois.append(umLikeMeuAmigo) |
<|file_name|>DAQGeneric.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import print_function
from collections import OrderedDict
import numpy as np
import six
from acq4.devices.DAQGeneric.taskGUI import DAQGenericTaskGui
from acq4.devices.Device import Device, DeviceTask
from pyqtgraph impor... | chans = [chans]
for ch in chans: |
<|file_name|>yml-test.js<|end_file_name|><|fim▁begin|>/**
* Copyright IBM Corp. 2020, 2020
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*
* @jest-environment node
*/
'use strict';
describe('yml', () => {
let vol;
let ad... | |
<|file_name|>0f3a25.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 3 of the License, or
# (a... | assert_equal(myDisasm.repr(), 'vpternlogq zmm28, zmm16, zmmword ptr [r8], 11h') |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 Google LLC
//
// Use of this source code is governed by an MIT-style license that can be found
// in the LICENSE file or at https://opensource.org/licenses/MIT.
//! Handlers and types for agent's actions.
//!
//! The basic functionality that a GRR agen... | pub mod stat;
pub mod insttime; |
<|file_name|>clv_patient_category_seq.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol ... | |
<|file_name|>test_stack_resources.py<|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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... |
@mock.patch.object(res.Resource, 'metadata_update')
@mock.patch.object(res.Resource, 'signal')
@mock.patch.object(service.EngineService, '_get_stack') |
<|file_name|>AddInformationsAboutModules.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016 robert
*
* 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 3 of the License, ... | for (String m : modulesName)
{
IField f = new StringField(m);
fields.add(f); |
<|file_name|>ParsedTagInfo.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010 The Android Open Source Project
*
* 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... | list.add(t[j]);
}
} |
<|file_name|>needless_return.rs<|end_file_name|><|fim▁begin|>// run-rustfix
#![feature(let_else)]
#![allow(unused)]
#![allow(
clippy::if_same_then_else,
clippy::single_match,
clippy::needless_bool,
clippy::equatable_if_let
)]
#![warn(clippy::needless_return)]
macro_rules! the_answer {
() => {
... | async fn async_read_line() -> String { |
<|file_name|>base64_substitution.py<|end_file_name|><|fim▁begin|>"""
This payload receives the msfvenom shellcode, base64 encodes it, and stores it within the payload.
At runtime, the executable decodes the shellcode and executes it in memory.
module by @christruncer
"""
import base64
from datetime import date
fr... | from modules.common import helpers
from modules.common import encryption
|
<|file_name|>update_settings_dialog.cc<|end_file_name|><|fim▁begin|>//
// Aspia Project
// Copyright (C) 2018 Dmitry Chapyshev <dmitry@aspia.ru>
//
// 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 Foundat... | UpdateSettingsDialog::UpdateSettingsDialog(QWidget* parent) |
<|file_name|>LetterProps.js<|end_file_name|><|fim▁begin|>function LetterProps(o, sw, sc, fc, m, p) {
this.o = o;
this.sw = sw;
this.sc = sc;
this.fc = fc;
this.m = m;
this.p = p;
this._mdf = {
o: true,
sw: !!sw,
sc: !!sc,
fc: !!fc,
m: true,
p: true,
};
}
LetterP... | return updated;
}; |
<|file_name|>layer1.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files... | 'OptionsToRemove.member')
return self._get_response('UpdateConfigurationTemplate', params)
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use std::error::Error;
use std::io::{self, Cursor};
use std::sync::Arc;
use rustc_serialize::{json, Encodable};
use rustc_serialize::json::Json;<|fim▁hole|>use conduit::{Request, Response, Handler};
use conduit_router::{RouteBuilder, Reque... | use url;
|
<|file_name|>pandas 8 - Standard Deviation.py<|end_file_name|><|fim▁begin|>import pandas as pd
from pandas import DataFrame
from matplotlib import pyplot as plt
from matplotlib import style
style.use('ggplot')
df = pd.read_csv('sp500_ohlc.csv', index_col = 'Date', parse_dates=True)
#print df.head()
df['STD'] = pd.... | plt.show() |
<|file_name|>poid.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'poname'
})
export class PoidPipe implements PipeTransform {
transform(item: any, purOrderNo: any): any {<|fim▁hole|> if(purOrderNo == undefined) return item;
//return updated array
... | //chek if any value undefined |
<|file_name|>vpcmpistri.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;<|fim▁hole|>use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
fn vpcmpistri_1() {
run_test(&Instruction { mnemonic: Mnemonic::VPCMPISTRI, opera... | use ::instruction_def::*; |
<|file_name|>test_sitecustomize.py<|end_file_name|><|fim▁begin|># -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017,2020 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by t... | "test", |
<|file_name|>demo06.py<|end_file_name|><|fim▁begin|># Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from __future__ import print_function
import fixpath
import colorama
from colorama import Fore, Back, Style
from random import randint, choice
from string import printable
# Fore, Back and Sty... | print('%s%s%s%s%s' % (pos(randint(1+MINY,MAXY-1), randint(1+MINX,MAXX-1)), choice(FORES), choice(BACKS), choice(STYLES), choice(CHARS)), end='')
# put cursor to top, left, and set color to white-on-black with normal brightness.
print('%s%s%s%s' % (pos(MINY, MINX), Fore.WHITE, Back.BLACK, Style.NORMAL), ... |
<|file_name|>math.rs<|end_file_name|><|fim▁begin|>command!(multiply(_ctx, msg, _args, one: f64, two: f64) {
let product = one * two;<|fim▁hole|> let _ = msg.channel_id.say(&product.to_string());
});<|fim▁end|> | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import os
import unittest
import mock
from pulp.server.db import connection
class PulpWebservicesTests(unittest.TestCase):
"""
Base class for tests of webservice controllers. This base is used to work around the
authentication tests for each each method
... | def setUp(self):
connection.initialize() |
<|file_name|>vcpu_model.py<|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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | |
<|file_name|>script.js<|end_file_name|><|fim▁begin|>$(document).ready(function () {
startAnimation();
});
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = (window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame |... | (function ($, window) {
function Constellation (canvas, options) { |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
from enfermeriaapp.models import Cola_Consulta, Cola_Enfermeria
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.utils import timezone
import time
from django.contrib import messages
from... | return render(request,"datospersonales/paciente_list.html",{'personalpaciente':pacientes,'datoFacult':auxL,'informacion':info})
#Muestra el listado de pacientes en cola para tomarles signos vitales
@login_required(login_url='logins') |
<|file_name|>19180cf98af6_nsx_gw_devices.py<|end_file_name|><|fim▁begin|># Copyright 2014 OpenStack Foundation<|fim▁hole|>#
# 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|>test_import_wallet.py<|end_file_name|><|fim▁begin|>import pytest
from indy import IndyError
from indy import did
from indy import wallet
from indy.error import ErrorCode
@pytest.mark.asyncio
@pytest.mark.parametrize("wallet_handle_cleanup", [False])
async def test_import_wallet_works(wallet_handle, wall... | did_with_meta_after = await did.get_my_did_with_meta(wallet_handle, _did)
assert did_with_meta_before == did_with_meta_after
await wallet.close_wallet(wallet_handle) |
<|file_name|>view.js<|end_file_name|><|fim▁begin|>(function(){
var getDataBtn = document.getElementById('btn-getdata');
var content = document.getElementById('content');
getDataBtn.addEventListener('click',getCourseData);<|fim▁hole|>
function getCourseData(){
datacontext().getCourseSessions(function(courseSession... | |
<|file_name|>language.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.template import loader
from django.views.i18n import set_language
from xadmin.plugins.utils import get_context_dict
from xadmin.sites import site
from xadmin.views import BaseAdminPlugin, CommAdminView, BaseAdminView
<|fi... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 Softwar... | |
<|file_name|>pinterest.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
try_get,
unified_timestamp,
ur... | continue
format_url = url_or_none(format_dict.get('url'))
if not format_url or format_url in urls: |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | |
<|file_name|>routes.py<|end_file_name|><|fim▁begin|>import flask
from donut import auth_utils
from donut.modules.account import blueprint, helpers
@blueprint.route("/request")
def request_account():
"""Provides a form to request an account."""
return flask.render_template("request_account.html")
@blueprint... | def request_account_submit():
"""Handles an account creation request."""
uid = flask.request.form.get("uid", None) |
<|file_name|>conversion_test.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.a... | def bar(self):
return self.x
class TestSubclass(TestBase): |
<|file_name|>generate_html.py<|end_file_name|><|fim▁begin|># -- coding: utf-8 --
# Copyright 2015 Tim Santor
#
# This file is part of proprietary software and use of this file
# is strictly prohibited without written consent.
#
# @author Tim Santor <tsantor@xstudios.agency>
"""Generates HTML for HTML5 banner ads.""... | continue |
<|file_name|>level_bar.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk.
//
// rgtk 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 version 3 of the License, or
// (at your option) ... |
pub fn add_offset_value(&mut self, name: &str, value: f64) -> () {
unsafe {
ffi::gtk_level_bar_add_offset_value( |
<|file_name|>posix.rs<|end_file_name|><|fim▁begin|>use {TryRead, TryWrite};
use io::{self, PipeReader, PipeWriter};
use std::mem;
use std::os::unix::io::{Fd, AsRawFd};
/*
*
* ===== Awakener =====
*
*/
pub struct Awakener {
reader: PipeReader,
writer: PipeWriter,
}
impl Awakener {
pub fn new() -> io::... | }
pub fn as_raw_fd(&self) -> Fd {
self.reader.as_raw_fd() |
<|file_name|>test_mrcmemmap.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016, Science and Technology Facilities Council
# This software is distributed under a BSD licence. See LICENSE.txt.
"""
Tests for mrcmemmap.py
"""
# Import Python 3 features for future-proofing
from __future__ import (absolute_import, divisi... | from mrcfile.mrcmemmap import MrcMemmap
|
<|file_name|>_smoothing.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class SmoothingValidator(_plotly_utils.basevalidators.NumberValidator):<|fim▁hole|> self, plotly_name="smoothing", parent_name="contourcarpet.line", **kwargs
):
super(SmoothingValidator, self).__init__(
... | def __init__( |
<|file_name|>abstractmoduleloader.d.ts<|end_file_name|><|fim▁begin|>declare module goog.module {
/**
* An interface that loads JavaScript modules.
* @interface
*/
interface AbstractModuleLoader {
/**
* Loads a list of JavaScript modules.
*
* @param {Ar... | |
<|file_name|>0948.cpp<|end_file_name|><|fim▁begin|>#include<queue>
#include<cstdio>
#include<algorithm>
using namespace std;
const int N = 20012, inf = 2000000000;
int p[N], f[N], t[N], s[N], dg[N];
int main() {
int i, j, n;
while (scanf("%d", &n) == 1 && n) {
fill(dg, dg+n, 0);
fill(s, s+n, inf);
for (... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.