prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>birdseye.py<|end_file_name|><|fim▁begin|>import cv2
import random
from moviepy.editor import VideoFileClip
#from modules.ssd.main import ImageNetwork
"""
def pipeline_yolo(img):
img_undist, img_lane_augmented, lane_info = lane_process(img)
output = vehicle_detection_yolo(img, img_lane_augmented, l... | video_output = 'test/labelled_ssd.mp4'
process_video(video_input, video_output) |
<|file_name|>bottle-sse.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import bottle
import datetime
import time
@bottle.get('/')
def index():
return bottle.static_file('index.html', root='.')
@bottle.get('/stream')
def stream():
bottle.response.content_type = 'tex... | time.sleep(5)
|
<|file_name|>iadfa.py<|end_file_name|><|fim▁begin|>from fsa import *
from nameGenerator import *
class IncrementalAdfa(Dfa):
"""This class is an Acyclic Deterministic Finite State Automaton
constructed by a list of words.
"""
def __init__(self, words, nameGenerator = None, sorted = False):
i... | |
<|file_name|>AbstractJpaDAO.java<|end_file_name|><|fim▁begin|>package com.meadowhawk.cah.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.transaction.annotation.Transactional;
public abstract class AbstractJpaDAO<T> {
public... | public void setClazz(Class<T> clazzToSet) {
this.clazz = clazzToSet;
}
|
<|file_name|>bang-macro.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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/lice... | use bang_macro::rewrite;
fn main() {
assert_eq!(rewrite!("Hello, world!"), "NOT Hello, world!"); |
<|file_name|>tea-knowledge.component.js<|end_file_name|><|fim▁begin|>class TeaKnowledgeController {
constructor ($scope, $state, $compile, DTOptionsBuilder, DTColumnBuilder, API) {
'ngInject'<|fim▁hole|> let TeaKnowledges = this.API.service('teaknowledges', this.API.all('informs'))
TeaKnowledges.getList()... | this.API = API
this.$state = $state
// let TeaKnowledges = this.API.service('teakns', this.API.all('users')) |
<|file_name|>use.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/licens... |
#![no_std]
extern crate std; |
<|file_name|>Background.js<|end_file_name|><|fim▁begin|>(function(Object) {
Object.Model.Background = Object.Model.PresentationObject.extend({
"initialize" : function() {
Object.Model.PresentationObject.prototype.initialize.call(this);
}
},{
"type" : "Background",
"attributes" : _.defaults({
... | }
}, Object.Model.PresentationObject.attributes)
});
|
<|file_name|>r_li_renyi_ascii.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************<|fim▁hole|> Email : medspx at medspx dot fr
***************************************************************************
* ... | r_li_renyi_ascii.py
-------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux |
<|file_name|>cpu_util.py<|end_file_name|><|fim▁begin|>"""
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor is free software; you can redistribute it and/or modify<|fim▁hole|>or (at your option) any later version.
RockStor is distributed in the hope that it will be u... | it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License, |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { configure, makeAutoObservable, toJS } from 'mobx'
import { DataProps } from '../../../Fetch/src/stores'
import { NodesConstants } from '../constants'
configure({
enforceActions: 'observed',
})
export interface NodesItemProps {
id: string
url: string
fe... | }
public items: NodesItemProps[] = []
public constructor() {
makeAutoObservable(this) |
<|file_name|>test_profile_topic_list.py<|end_file_name|><|fim▁begin|>from rest_framework import status
from test_utils import serialized_time
def test_get_profile_topics(
api_client, enable_premium_requirement, profile_topic_factory, user_factory
):
"""
Premium users should be able to list their own prof... | "is_detailed": topic.is_detailed,
"items_url": api_client.build_full_url(
f"/know-me/profile/profile-topics/{topic.pk}/items/" |
<|file_name|>loader2.js<|end_file_name|><|fim▁begin|>/*
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This 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 ... | "elements/audio/type_flash.js",
"elements/audio/type_native.js", |
<|file_name|>compression_snap.rs<|end_file_name|><|fim▁begin|>extern crate snap;
use std::io::{self, Read, Write};
pub fn compress(uncompressed: &[u8], compressed: &mut Vec<u8>) -> io::Result<()> {<|fim▁hole|> Ok(())
}
pub fn decompress(compressed: &[u8], decompressed: &mut Vec<u8>) -> io::Result<()> {
decomp... | compressed.clear();
let mut encoder = snap::Writer::new(compressed);
encoder.write_all(&uncompressed)?;
encoder.flush()?; |
<|file_name|>codecommit.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "codecommit")]<|fim▁hole|>
use rusoto_codecommit::{CodeCommit, CodeCommitClient, ListRepositoriesInput};
use rusoto_core::Region;
#[test]
fn should_list_repositories() {
let client = CodeCommitClient::new(Region::UsEast1);
let request = L... |
extern crate rusoto_core;
extern crate rusoto_codecommit; |
<|file_name|>cloneWith.js<|end_file_name|><|fim▁begin|>var baseClone = require('./_baseClone');
/**<|fim▁hole|> * This method is like `_.clone` except that it accepts `customizer` which
* is invoked to produce the cloned value. If `customizer` returns `undefined`,
* cloning is handled by the method instead. The `cus... | |
<|file_name|>0016_subscription_team.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-08 19:41
from __future__ import unicode_literals
from django.db import migrations, models
<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
('event', '0015... | |
<|file_name|>test_iloc.py<|end_file_name|><|fim▁begin|>""" test positional based indexing with iloc """
from datetime import datetime
import re
from warnings import (
catch_warnings,
simplefilter,
)
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
NA,
C... | @pytest.mark.parametrize("index,columns", [(np.arange(20), list("ABCDE"))]) |
<|file_name|>data.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/. */
//! Per-node data used in style calculation.
use arrayvec::Arra... | "We definitely need to do something!");
return RestyleKind::CascadeOnly; |
<|file_name|>WhiteNoise.java<|end_file_name|><|fim▁begin|>package org.istic.synthlab.core.modules.whitenoise;
import org.istic.synthlab.components.IComponent;
import org.istic.synthlab.core.modules.io.IOutput;
import org.istic.synthlab.core.services.Factory;
import org.istic.synthlab.core.services.Register;<|fim▁hole|>... |
public class WhiteNoise implements IWhiteNoise { |
<|file_name|>GameTime.py<|end_file_name|><|fim▁begin|>import discord
from discord.ext import commands
import time
import datetime
import pytz
class GameTime(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def time(self, ctx):
"""Display... | "Eleint",
"Marpenoth",
"Uktar", |
<|file_name|>test_cartodb_update.py<|end_file_name|><|fim▁begin|>from io import StringIO
import re
import httpretty
from django.core.management import call_command
from oppia.test import OppiaTestCase
from settings import constants
from settings.models import SettingProperties
from tests.utils import get_file_content... | httpretty.register_uri(httpretty.GET,
self.cartodb_uri_regex,
body=cartodb_response)
|
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>from copy import deepcopy
from operator import mul
import joblib
import numpy as np
from scipy import sparse
import pandas as pd
import pytest
import anndata as ad
from anndata._core.index import _normalize_index
from anndata._core.views import ArrayView, Sparse... |
assert init_hash == joblib.hash(adata) |
<|file_name|>postgresql_schema.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = ... |
- name: Drop schema "acme" with cascade |
<|file_name|>webdav.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import cgi
import logging
import os
import uuid
from collections import namedtuple
import requests
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.runtime.client_request import ClientRequest
fro... | |
<|file_name|>deoptimizer.cc<|end_file_name|><|fim▁begin|>// Copyright 2010 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must ... | |
<|file_name|>websocket.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 crate::dom::bindings::cell::DomRefCell;
use crate::dom:... | enum WebSocketRequestState { |
<|file_name|>RenderMethod_PhongPoint_CG.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "Renderer.h"
#include "RenderMethod_PhongPoint_CG.h"
RenderMethod_PhongPoint_CG::RenderMethod_PhongPoint_CG(class Renderer *r) {
ASSERT(r, "Null pointer: r");
renderer = r;
useCG = true;
}
bool RenderMet... | switch (pass) {
case OPAQUE_PASS:
pass_opaque();
|
<|file_name|>timing.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
# Copyright (C) 2003 CAMP
# Please see the accompanying LICENSE file for further information.
"""A replacement for the ``time.clock()`` function.
From the clock man page::
Note that the time can wrap around. On a 32bit... |
class NullTimer: |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The xi-editor 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-... | |
<|file_name|>datatable_spec.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import {DataTable} from 'datatables.net-responsive-bs';
const settingsMock = {
header: 'Test Header'
};
describe('DataTables component', () => {<|fim▁hole|> it('Should have props', () => {
expect(comp.prop... | class mock extends Component {}
var comp = new mock(settingsMock);
|
<|file_name|>view.js<|end_file_name|><|fim▁begin|><|fim▁hole|>{
$('.assign').width(150);
$('.assign').height(40);
$('.assign').load(createLink('user', 'ajaxGetUser', 'taskID=' + taskID + '&assignedTo=' + assignedTo));
}
function setComment()
{
$('#comment').toggle();
}<|fim▁end|> | function assign(taskID, assignedTo) |
<|file_name|>Errors.py<|end_file_name|><|fim▁begin|>#=======================================================================
#
# Python Lexical Analyser
#
# Exception classes
#
#=======================================================================
import exceptions
class PlexError(exceptions.Exception):
messag... |
class AmbiguousAction(PlexError):
message = "Two tokens with different actions can match the same string"
|
<|file_name|>page_links_to_edge_list_wiki.py<|end_file_name|><|fim▁begin|>import optparse
import pickle
#converts urls to wiki_id
parser = optparse.OptionParser()
parser.add_option('-i','--input', dest = 'input_file', help = 'input_file')
parser.add_option('-o','--output', dest = 'output_file', help = 'output_file')
... | line = line.split(' ')
if line[0] == '#':
continue |
<|file_name|>single_context_logger.go<|end_file_name|><|fim▁begin|>package logger
import (
"golang.org/x/net/context"
)
// SingleContextLogger logs everything in the same context. Useful for adding context-logging
// into code that doesn't yet support it.
type SingleContextLogger struct {
ctx context.Context
lo... | s.logger.CloneWithAddedDepth(1).CErrorf(s.ctx, format, args...)
}
func (s *SingleContextLogger) Errorf(format string, args ...interface{}) { |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from txzookeeper.client import ZookeeperClient
from txzookeeper.retry import RetryClient
import zookeeper
import sys
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
import os
from twisted.python import log
from twisted.internet import... | def get_mongod_all(self, callback = None): |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>fn main() {
let output = Command::new("python")
.arg(format!("{}/scripts/generate_wrappers.py",
env!("CARGO_MANIFEST_DIR")))
.spawn()
.expect("failed to execute process");
println!("{:?}", output)
}<|fim▁... | use std::process::Command;
|
<|file_name|>is_integral.hpp<|end_file_name|><|fim▁begin|>#ifndef NEK_TYPE_TRAITS_IS_INTEGRAL_HPP
#define NEK_TYPE_TRAITS_IS_INTEGRAL_HPP
#include <nek/type_traits/integral_constant.hpp>
#include <nek/type_traits/remove_cv.hpp>
namespace nek
{
namespace is_integral_detail
{
template <class T>
... | {
}; |
<|file_name|>features.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
<|fim▁hole|>function Features(urls) {
var self = this;
urls.links().then(function(links) {
angular.extend(self, links);
});
}
/**
* Provides info what features are available on server
*/
angular.module('superdesk.fe... | Features.$inject = ['urls']; |
<|file_name|>glances_curses.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by... | return isexitkey
|
<|file_name|>taiwan-zh-TW.js<|end_file_name|><|fim▁begin|>/*
* World Calendars
* https://github.com/alexcjohnson/world-calendars
*
* Batch-converted from kbwood/calendars
* Many thanks to Keith Wood and all of the contributors to the original project!
*
* This source code is licensed under the MIT license found ... | monthNamesShort: ['一','二','三','四','五','六',
'七','八','九','十','十一','十二'],
dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'], |
<|file_name|>model_analyzer_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 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://w... | .with_node_names(trim_name_regexes=['ops.py.*']) |
<|file_name|>plot_10_overview.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
.. _tut-overview:
Overview of MEG/EEG analysis with MNE-Python
============================================
This tutorial covers the basic EEG/MEG pipeline for event-related analysis:
loading data, epoching, averaging, plotting,... | legend='upper left', show_sensors='upper right')
############################################################################### |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|># This file starts the WSGI web application.
# - Heroku starts gunicorn, which loads Procfile, which starts manage.py
# - Developers can run it from the command line: python runserver.py
import logging
from logging.handlers import RotatingFileHandler
from app import c... | # Manage the command line parameters such as:
# - python manage.py runserver
# - python manage.py db |
<|file_name|>groups_to_user.py<|end_file_name|><|fim▁begin|>from collections import namedtuple
from corehq.apps.change_feed.consumer.feed import KafkaChangeFeed
from corehq.apps.change_feed.document_types import GROUP
from corehq.apps.groups.models import Group
from corehq.elastic import stream_es_query, get_es_new, ES... | checkpoint = get_checkpoint_for_elasticsearch_pillow(pillow_id, USER_INDEX_INFO) |
<|file_name|>exception.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
**********
Exceptions
**********
Base exceptions and errors for NetworkX.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)\nLoïc Séguin-C. <loicseguin@gmail.com>"""
# ... | """
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|>
def main():
SHARE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"share")
data_files = []
# don't trash the users system icons!!
black_list = ['index.theme', 'index.theme~']
fo... | from distutils.core import setup
import os
import sys |
<|file_name|>version.py<|end_file_name|><|fim▁begin|># ormbad.version
# Helper module for ORMBad version information
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Aug 13 12:38:42 2015 -0400
#
# Copyright (C) 2015 Tipsy Bear Studios
# For license information, see LICENSE.txt
#
# ID: version.py ... | |
<|file_name|>bounty.py<|end_file_name|><|fim▁begin|>import os, pickle, re, sys, rsa
from common.safeprint import safeprint
from common.call import parse
from multiprocessing import Lock
from hashlib import sha256
global bountyList
global bountyLock
global bountyPath
global masterKey
bountyList = []
bountyLock = Lock()... | |
<|file_name|>TableModelBookTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2019 phramusca ( https://github.com/phramusca/ )
*
* 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, eithe... | */
@Test
public void testIsCellEnabled() { |
<|file_name|>constants.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Uber Technologies, 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/L... | // RoleS2 is the name of the role for server S2 |
<|file_name|>rotatingtext.rs<|end_file_name|><|fim▁begin|>use config::Config;
use errors::*;
use std::time::{Duration, Instant};
use widget::{I3BarWidget, State};
use serde_json::value::Value;
<|fim▁hole|> rotation_pos: usize,
width: usize,
rotation_interval: Duration,
rotation_speed: Duration,
next_... | #[derive(Clone, Debug)]
pub struct RotatingTextWidget { |
<|file_name|>buildChoropleth.js<|end_file_name|><|fim▁begin|>var mouseMoveControl = true;
function initializeChoropleth(data) {
var map = L.map('map2', {
center: [40, -120],
zoom: 4
})
createTileLayer(map)
var dataLayer = setEnumerationUnits(map, dataLayer, data)
return {
... | } |
<|file_name|>tei_cleanup.py<|end_file_name|><|fim▁begin|>import sys
import regex as re
from BeautifulSoup import BeautifulStoneSoup as bss
# REQUIRES BeautifulSoup3. BS4 breaks on Python recursion errors when it gets badly damaged texts.
def cleanup(infile, outfile):
# main routine. takes a file handle for inp... | "damageSpan", |
<|file_name|>test_models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import copy
import os
from django.contrib import auth
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db.models import QuerySet
from django.test import TestCase, Clien... |
self.assertTrue(isinstance(reminders, dict))
self.assertEqual(sorted(list(reminders.keys())), sorted(reminders_keys_correct))
|
<|file_name|>box.go<|end_file_name|><|fim▁begin|>// Copyright 2012 The Go 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 box authenticates and encrypts messages using public-key cryptography.
Box uses Curve25519, XSalsa2... | func Precompute(sharedKey, peersPublicKey, privateKey *[32]byte) { |
<|file_name|>sockets.js<|end_file_name|><|fim▁begin|>const fs = require('fs');
const path = require('path');
// eslint-disable-next-line import/no-extraneous-dependencies
const sharedsession = require('express-socket.io-session');
/**
* Checks to see if sockets are configured and then sets up socket.io
* @param {Ce... | * @return {socket.io}
*/
module.exports = function sockets(ceres, app, server) { |
<|file_name|>pager.py<|end_file_name|><|fim▁begin|>"""Draws DAG in ASCII."""
import logging
import os
import pydoc
import sys
from rich.pager import Pager
from dvc.env import DVC_PAGER
from dvc.utils import format_link
logger = logging.getLogger(__name__)
DEFAULT_PAGER = "less"
LESS = "LESS"
PAGER_ENV = "PAGER"
... |
def make_pager(cmd=None): |
<|file_name|>dylib.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ht... | // Copyright 2014 The Rust Project Developers. See the COPYRIGHT |
<|file_name|>template.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from jinja2 import Environment, FileSystemLoader
from uwsgi_sloth.settings import ROOT
from uwsgi_sloth import settings, __VERSION__
template_path = os.path.join(ROOT, 'templates')
env = Environment(loader=FileSystemLoader(templa... | """Template shortcut & filters"""
import os
import datetime |
<|file_name|>run_gridlabd_batch_file.py<|end_file_name|><|fim▁begin|># This function runs a .bat file that job handles multiple GridLAB-D files
import subprocess
#C:\Projects\GridLAB-D_Builds\trunk\test\input\batch test\13_node_fault2.glm<|fim▁hole|> batch_file = open('{:s}'.format(batch_name),'w')
batch_file.write('... | def create_batch_file(glm_folder,batch_name): |
<|file_name|>wunderground.py<|end_file_name|><|fim▁begin|>import urllib2, json, time, sys
from datetime import date, datetime
from dateutil.rrule import rrule, DAILY
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-f", dest="fahrenheit", action="store", default=False, type="string", help="... | url.close() |
<|file_name|>reader.rs<|end_file_name|><|fim▁begin|>//! Represents a way to read a record-based file by mapping each read line to a record. The mapping between
//! the data from the file and the record name is made by the `mapper` function.
//!
//! # Examples
//! ```rust
//! use rbf::record::{AsciiMode, UTF8Mode};
/... | //! "GL" => {
//! assert_eq!(rec.get_value("ID"), "GL");
//! for (i, l) in greek.chars().enumerate() { |
<|file_name|>test_vm_rest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.rest.gen_data import a_provider as _a_provider
from cfme.rest.gen_data import vm as _vm
from cfme.utils import error
from cfme.utils.rest import assert_respons... | record, __ = wait_for(
lambda: appliance.rest_api.collections.vms.find_by( |
<|file_name|>aggregateContention.py<|end_file_name|><|fim▁begin|>import os
import re
import cx_Oracle
import collections
import datetime
earContentionCode = [2200,2210,2220,3140,3150,4130,4210,4700,4920,5000,5010,5710,6850]
#Primary query, Look for all claims/contentions where the participant has at least one content... |
if currParticipant != contention.ptcpnt_vet_id : |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># vim: set fileencoding=utf-8 :
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use ... | # py_modules=["my_module"],
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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, in... | if os.altsep:
path = path.replace(os.altsep, os.sep)
path_components = path.split(os.sep) |
<|file_name|>FragmentAppointmentList.java<|end_file_name|><|fim▁begin|>package com.ftfl.icare;
import java.util.List;
import com.ftfl.icare.adapter.CustomAppointmentAdapter;
import com.ftfl.icare.adapter.CustomDoctorAdapter;
import com.ftfl.icare.helper.AppointmentDataSource;
import com.ftfl.icare.helper.DoctorProfil... | |
<|file_name|>DSMRSerialAutoDevice.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2010-2019 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Ecl... | * @author Hilbrand Bouwkamp - New class. Simplified states and contains code specific to discover the serial port
* settings automatically.
*/
@NonNullByDefault |
<|file_name|>test_docker_inspect.py<|end_file_name|><|fim▁begin|>import pytest
import doctest
from insights.parsers import docker_inspect, SkipException
from insights.tests import context_wrap
DOCKER_CONTAINER_INSPECT = """
[
{
"Id": "97d7cd1a5d8fd7730e83bb61ecbc993742438e966ac5c11910776b5d53f4ae07",
"Created"... | docker_inspect.DockerInspectContainer(context_wrap(DOCKER_CONTAINER_INSPECT_TRUNCATED)) |
<|file_name|>texture.cpp<|end_file_name|><|fim▁begin|>#include "texture.h"
using namespace gl;
/**
* Constructs a new Texture object, storing the specified textureID for binding
* @param textureID the Integer representing the texture that can be bound
*/
Texture::Texture(std::string associatedFileName, gl::GLuint ... | /**
* Binds the texture using GL11. The texture will remain bound until the next bind() call of a different
* texture object, or manual call to GL11.glBindTexture(...) |
<|file_name|>refactor_social_login_keys.py<|end_file_name|><|fim▁begin|>import frappe
from frappe.utils import cstr
def execute():
# Update Social Logins in User
run_patch()
# Create Social Login Key(s) from Social Login Keys
frappe.reload_doc("integrations", "doctype", "social_login_key", force=True)
if not fr... |
def get_provider_field_map(): |
<|file_name|>v1_2.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8; indent-tabs-mode:nil; tab-width:4 -*-
# This file is part of DITA DTD Generator.
#
# Copyright 2009 Jarno Elovirta <http://www.elovirta.com/>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | """Glossary entry topic type."""
id = u"glossentry" |
<|file_name|>list_cluster.go<|end_file_name|><|fim▁begin|>package command
import (
"fmt"
"os"
"text/tabwriter"
"strings"
"github.com/codegangsta/cli"
"github.com/docker/machine/commands/mcndirs"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/persist"
)
var (
// ListClusterCliC... | if err != nil {
continue
}
|
<|file_name|>nodepage.view.js<|end_file_name|><|fim▁begin|>/*global App*/
/* Backbone View */
App.View.NodeView = App.View.BaseView.extend({
<|fim▁hole|>
});<|fim▁end|> | templateId: 'node',
model: App.models.nodePage |
<|file_name|>server.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import logging
import os
import sys
try:
from magic import from_file as magic_from_file
except ImportError:
magic_from_file = None
from six.moves import SimpleHTTPServer as srvm... |
socketserver.TCPServer.allow_reuse_address = True
try: |
<|file_name|>DistControllerToWorkerHeartBeat.java<|end_file_name|><|fim▁begin|>package Armadillo.Communication.Impl.Distributed;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.j... | EnumCalcCols.IsClientDisconnected,
true);
resultObj.SetStrValue(
|
<|file_name|>parsers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2015 Spanish National Research Council
#
# 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:... |
def parse(self):
return self._parse(self._convert_to_headers())
|
<|file_name|>test_shaping.py<|end_file_name|><|fim▁begin|>#import logging
#logging.basicConfig(level=logging.INFO, datefmt='%H:%M:%S',
# format='%(asctime)s %(levelname)s: %(message)s')
import unittest
import SocketServer, socket
import random, time
import threading
import cStringIO
from datetime im... | self.sock_client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 © Samuel Dolt <samuel@dolt.ch>
//
// This file is part of orion_backend.
//
// Orion_backend 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,... | // along with orion_backend. If not, see <http://www.gnu.org/licenses/>.
|
<|file_name|>spot_alignment_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Created on 25 April 2014
@author: Kimon Tsitsikas
Copyright © 2013-2014 Kimon Tsitsikas, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms
of the GNU Gene... | |
<|file_name|>chronology.d.ts<|end_file_name|><|fim▁begin|>/// <reference path="../definitions/higher-object.d.ts" />
declare module Chronology {
interface WallTime {
rules: any;
UTCToWallTime(date: Date, timezone: string): Date;
WallTimeToUTC(timezone: string, years: number, months: number, ... | }
function isDate(d: any): boolean;
} |
<|file_name|>source.py<|end_file_name|><|fim▁begin|>'''
|marx| offers several different source shapes. Tests in this module exercise
those sources (except ``SAOSAC``, which is heavily used in
:ref:`sect-tests.PSF` already).
'''
import shutil
import subprocess
import os
from collections import OrderedDict
from marxtes... | title = 'Compiling a USER source' |
<|file_name|>capsule.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
"""
Usage::
hammer capsule [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
content Manage the ca... | |
<|file_name|>ResponseToClient.java<|end_file_name|><|fim▁begin|>package models;
/**
* This class is for boxing the response sent back to slack by the bot.
* @author sabinapokhrel
*/
public class ResponseToClient {
public String status; // Status of the response sent back to slack. It can be either success or fai... | }
} |
<|file_name|>format.js<|end_file_name|><|fim▁begin|>"use strict"
/**
* `format` constructor.
*
* @api public
*/
const checkStatusCode = require('./helpers');
module.exports = {
create : (statusCode, error, message, data) => {
if(!statusCode) throw new Error('Status code is required')
if( isNaN( Number( ... | gatewayTimeout: (message, data) => {
this.statusCode = 504
this.error = true |
<|file_name|>imputils.py<|end_file_name|><|fim▁begin|>"""
Utilities to simplify the boilerplate for native lowering.
"""
import collections
import contextlib
import inspect
import functools
from enum import Enum
from numba.core import typing, types, utils, cgutils
from numba.core.typing.templates import BaseRegistry... | """
return self.lower_getattr(ty, None)
def lower_setattr(self, ty, attr): |
<|file_name|>section-content-wrapper.js<|end_file_name|><|fim▁begin|>var fs = require('fs'),
es = require('event-stream'),
asyncJoin = require('gwm-util').asyncJoin;
module.exports = function(options) {
var type = options.buildType,
configFileName = './config/' + type + '.json',
fileData = {},
... | |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2012 Jason Gedge <http://www.gedge.ca>
*
* This file is part of the OpGraph project.
*
* This program is free software: you can redistribute it and/or modify<|fim▁hole|> *
* This program is distributed in the hope that it will be use... | * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import cereconf
__version__ = "1.5"
IP_NUMBER = 'IPNumber'
IPv6_NUMBER = 'IPv6Number'
DNS_OWNER='DnsOwner'
REV_IP_NUMBER = 'IPNumber_rev'
A_RECORD = 'ARecord'
AAAA_RECORD = 'AAAARecord'
HOST_INFO = 'HostInfo'
MX_SET = 'MXSet'
SRV_TARGET = ... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export * from './dropdown-treeview-select.module'; |
<|file_name|>OS_close.cpp<|end_file_name|><|fim▁begin|>/*
**==============================================================================
**
** Copyright (c) 2003, 2004, 2005, 2006, Michael Brasher, Karl Schopmeyer
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software a... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!coding: utf-8
import base64
import calendar
import os
import re
import paramiko
from io import StringIO
import hashlib
import threading
import time
import pyte
def ssh_key_string_to_obj(text):
key_f = StringIO(text)
key = None
try:
key = para... |
def wrap_with_warning(text, bolder=False): |
<|file_name|>travel.cpp<|end_file_name|><|fim▁begin|>/**
* @author Marc Moerig
* @version 3.0
*/
#include <iostream>
#include <fstream>
#include "../../algorithm/nb_iter/iterate.hpp"
#include "../../lisa/ctrlpara.hpp"
#include "travel_graph.hpp"
#include "travel_neighbourhood.hpp"
using namespace std;
//*****... |
// open file for output
std::ofstream o_strm(argv[2]);
|
<|file_name|>cmd.rs<|end_file_name|><|fim▁begin|>use num_cpus;
use std::cmp::{max, min};
use std::default::Default;
use std::ops::Deref;
use crate::gc::M;
use docopt::Docopt;
use rustc_serialize;
use crate::gc::{DEFAULT_CODE_SPACE_LIMIT, DEFAULT_PERM_SPACE_LIMIT};
pub fn parse() -> Args {
Docopt::new(USAGE)
... | pub flag_gc_events: bool,
pub flag_gc_stress: bool, |
<|file_name|>view-service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { DataService } from '../../../_service/dataconnect';
import { Router } from '@angular/router';
@Injectable()<|fim▁hole|> constructor(private _dataserver: DataService, private _router: Router) { }
getwa... | export class WarehouseViewService { |
<|file_name|>SipHeaderFactoryImpl.java<|end_file_name|><|fim▁begin|>package org.lastbamboo.common.sip.stack.message.header;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import jav... | return valuesList;
}
public SipHeader createSentByVia(final InetAddress address) |
<|file_name|>cmdtext.py<|end_file_name|><|fim▁begin|>import sys
MAX_NUM_STORED_LINES = 200
MAX_NUM_LINES = 10
LINEWIDTH = 80
class CmdText(object):
"""
Represents a command line text device. Text is split into lines
corresponding to the linewidth of the device.
"""
def __init__(self):
"""
... | |
<|file_name|>testNasa2DVDReader_mc3e.py<|end_file_name|><|fim▁begin|>import numpy as np
import unittest
from ..aux_readers import NASA_2DVD_reader
class TestNasa2DvdReaderMc3eSubcase(unittest.TestCase):
"Test module for the NASA_2DVD_reader class in pydsd.aux_io.NASA_2DVD_reader for mc3e files"
def setUp(se... | def test_can_run_calc_dsd_params(self):
self.dsd.calculate_dsd_parameterization()
self.assertIsNotNone(
self.dsd.fields["D0"], |
<|file_name|>PluginLoadUnload.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright (c) 2008, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... |
self.assert_( maya.cmds.pluginInfo( "ieCore", query = True, loaded = True ) ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.