prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>crossword2.py<|end_file_name|><|fim▁begin|># coding: utf-8
import re
from crossword import *
class Crossword2(Crossword):
def __init__(self):
self.grid = OpenGrid()
self.connected = {}
self.used_words = []
def copy(self):
copied = Crossword2()
copied.gr... | ___A___
__#RAT#
#ANT#__
___#___ |
<|file_name|>HttpUtil.java<|end_file_name|><|fim▁begin|>package com.coolweather.android.util;
<|fim▁hole|>import okhttp3.OkHttpClient;
import okhttp3.Request;
/**
* Created by fengj on 2017/1/27.
*/
public class HttpUtil {
public static void sendOkHttpRequest(String address,okhttp3.Callback callback){
O... | |
<|file_name|>flash_and_debug.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import telnetlib
import subprocess
import signal
import time
###############################################################
# This script will automatically flash and start a GDB debug
# session to the STM32 discovery board using Ope... | tn.write("flash probe 0\n")
tn.read_until("> ") |
<|file_name|>sosecpwhashprovider.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from turbogears.identity.soprovider import *
from secpwhash import check_password
class SoSecPWHashIdentityProvider(SqlObjectIdentityProvider):
def validate_password(self, user, user_name, password):
# print >>sys.stderr, user, user.pas... | |
<|file_name|>prop_test.py<|end_file_name|><|fim▁begin|>class A(object):
def __init__(self, bar):
self._x = 1 ; self._bar = bar
def __getX(self):
return self._x
def __setX(self, x):
self._x = x
def __delX(self):
pass
<|fim▁hole|> x5 = property(__getX, doc=123) # bad doc
x6 = property(lambd... | x1 = property(__getX, __setX, __delX, "doc of x1")
x2 = property(__setX) # should return
x3 = property(__getX, __getX) # should not return
x4 = property(__getX, fdel=__getX) # should not return |
<|file_name|>token.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2020 ASMlover. 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 retain the above... | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <sstream> |
<|file_name|>nlu.py<|end_file_name|><|fim▁begin|>import json
import apiai
CLIENT_ACCESS_TOKEN = 'api key'
def nlu(mytext):
ai = apiai.ApiAI(CLIENT_ACCESS_TOKEN)
request = ai.text_request()
request.lang = 'en' # optional, default value equal 'en'
# request.session_id = "<SESSION ID, U... |
request.query = mytext
|
<|file_name|>test_json.py<|end_file_name|><|fim▁begin|>import pytest
from playlog.lib.json import Encoder
<|fim▁hole|> encoder.default(object())<|fim▁end|> |
def test_encoder():
encoder = Encoder()
with pytest.raises(TypeError): |
<|file_name|>trait-bounds-on-structs-and-enums-locals.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or... | let baz: Foo<usize> = panic!();
//~^ ERROR not implemented |
<|file_name|>unix.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 base::prelude::*;
use core::{mem};
use arch_fns::{memchr};
use ... | impl UnixSockAddr {
/// Creates a Unix socket address from given bytes.
/// |
<|file_name|>controller.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | else:
return
elif self._reader and self._needs_read and self._creds:
return |
<|file_name|>format.cpp<|end_file_name|><|fim▁begin|>#include "unicorn/format.hpp"
#include <cmath>
#include <cstdio>
using namespace RS::Unicorn::Literals;
using namespace std::chrono;
using namespace std::literals;
namespace RS::Unicorn {
namespace UnicornDetail {
namespace {
// These wil... | |
<|file_name|>assign.cpp<|end_file_name|><|fim▁begin|>// Copyright (C) 2013 Johan Hake
//
// This file is part of DOLFIN.
//
// DOLFIN 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 o... | #include <dolfin/function/FunctionSpace.h>
#include "assign.h"
#include "FunctionAssigner.h"
|
<|file_name|>ServiceValidationError.js<|end_file_name|><|fim▁begin|>/**
* Created by wangqi on 16/6/3.
*/
function ServiceValidationError(code, message, field) {
Error.captureStackTrace(this, this.constructor);
<|fim▁hole|> this.type = 'UserLevelServiceRequestError';
this.name = 'ServiceValidationError';
... | |
<|file_name|>0348_fix_project_key_rate_limit_window_unit.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
... | 'date_started': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'environment_id': ('sentry.db.models.fields.bounded.BoundedPositiveIntegerField', [], {'db_index': 'True'}),
'id': ('sentry.db.models.fields.bounded.BoundedBigAutoField', [], {'primary_k... |
<|file_name|>DDUtil.py<|end_file_name|><|fim▁begin|>import os
import datetime
def exit():
os._exit(0)
def GetTimeString(m = -1):
if m==0:
s1 = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
else:
s1 = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
<|fim▁hole|>
def MakeDir(directory):
... | return s1 |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public<|fim▁hole|> * 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/. */
#![feature(arc_weak)]
#![cfg_attr(any(target_os = "lin... | |
<|file_name|>vidics.py<|end_file_name|><|fim▁begin|>import urllib2, urllib, sys, os, re, random, copy
import htmlcleaner
import httplib2
from BeautifulSoup import BeautifulSoup, Tag, NavigableString
import xbmc,xbmcplugin,xbmcgui,xbmcaddon
from t0mm0.common.net import Net
from t0mm0.common.addon import Addon
from scrap... | |
<|file_name|>MakeTableResultsandErrors.py<|end_file_name|><|fim▁begin|>import sys
params = open(sys.argv[1], 'r')
errors = open(sys.argv[2], 'r')
error = []
for line in errors:
if len(line) < 5: continue
error.append(map(float, line.replace('[', '').replace(']', '').split(',')))
print error
output = []
cou... | for j in range(len(output)/5 + 1):
print str(wedge[count]) + " & " + output[j*5+i] + " \\\\"
print "\hline" |
<|file_name|>bitcoin_vi_VN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="vi_VN" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About bitcoinlite</source>
<translation type="u... | <location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message> |
<|file_name|>unboxed-closures-cross-crate.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://w... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Render to a window created by Glutin, using Glium's OpenGL functions
#[macro_use] extern crate log;
#[macro_use] extern crate glium;
extern crate breeze_backend;
use breeze_backend::{BackendAction, BackendResult, Renderer};
use breeze_backend::ppu::{SCREEN_WIDTH, S... | width: SCREEN_WIDTH,
height: SCREEN_HEIGHT,
format: ClientFormat::U8U8U8, |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># pylint: disable=unused-import
# TODO: eventually move this implementation into the user_api
"""
Django Administration forms module<|fim▁hole|><|fim▁end|> | """
from student.forms import PasswordResetFormNoActive |
<|file_name|>import-shadow-4.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed |
<|file_name|>bitcoin_en_GB.ts<|end_file_name|><|fim▁begin|><TS language="en_GB" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Right-click to edit address or label</translation>
</message>
<message>
... | <translation>&Settings</translation>
</message> |
<|file_name|>jquery.js<|end_file_name|><|fim▁begin|>/* prevent execution of jQuery if included more than once */
if(typeof window.jQuery == "undefined") {
/*
* jQuery 1.1.2 - New Wave Javascript
*
* Copyright (c) 2007 John Resig (jquery.com)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.tx... | if ( jQuery.isFunction( value ) )
value = value.call( elem, [index] );
// exclude the following css properties to add px |
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>pub use alloc::boxed::*;
pub use core::cmp::max;
pub use core::cmp::min;
pub use core::clone::Clone;<|fim▁hole|>pub use core::option::Option;
pub use core::ptr;
pub use core::sync::atomic::*;
pub use common::debug::*;
pub use common::event::*;
pub use common::queue:... | pub use core::mem::size_of;
pub use core::mem::size_of_val; |
<|file_name|>issue-20313.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//<|fim▁hole|>// option. This file may not be copied, modified, or distributed
// except according t... | // 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 |
<|file_name|>parsers.py<|end_file_name|><|fim▁begin|># Copyright (C) 2017 Open Information Security Foundation
# Copyright (c) 2015-2017 Jason Ish
#
# You can copy, redistribute or modify this Program under the terms of
# the GNU General Public License version 2 as published by the Free
# Software Foundation.
#
# This ... | "remove-source", parents=[global_parser]))
commands.checkversions.register(subparsers.add_parser(
"check-versions", parents=[global_parser]))
|
<|file_name|>home.ts<|end_file_name|><|fim▁begin|>import {Component} from 'angular2/core';<|fim▁hole|> styleUrls: ['app/components/home/home.css'],
providers: [],
directives: [],
pipes: []
})
export class Home {
constructor() {}
ngOnInit() {
}
}<|fim▁end|> |
@Component({
selector: 'home',
templateUrl: 'app/components/home/home.html', |
<|file_name|>test_nis.py<|end_file_name|><|fim▁begin|>from test import support
import unittest
import sys
# Skip test if nis module does not exist.
nis = support.import_module('nis')
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
except nis.error as msg... | done = 1
break
if done:
break |
<|file_name|>patch.go<|end_file_name|><|fim▁begin|><|fim▁hole|>
var skipSystemMastersAuthorizer = false
// SkipSystemMastersAuthorizer disable implicitly added system/master authz, and turn it into another authz mode "SystemMasters", to be added via authorization-mode
func SkipSystemMastersAuthorizer() {
skipSystemMa... | package server |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
exec(open('react/version.py').read())
setup(
name='react',<|fim▁hole|> version=__version__,
packages=find_packages(),
url='https://github.com/3D-e-Chem/python-modified-tanimoto',
author='Stefan Verhoeven'... | description='Generate fragments of a molecule using smirks', |
<|file_name|>gui_laveqed.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
from Tkinter import *
from ttk import *
from ScrolledText import ScrolledText as Text
from PIL import Image, ImageTk
import tkFileDialog,os,cairo,tempfile,time,shutil,tkFont
from laveqed import laveqed
from rsvg_windows i... | self.win.bind('<Control-o>',self.open_svg_fixCtrlO)
self.win.bind('<Control-p>', self.preferences)
self.win.bind('<Control-q>',self.close) |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export * from './logger.service'
export * from './logger.module' |
<|file_name|>labyrinth.cc<|end_file_name|><|fim▁begin|>#include "labyrinth.h"
#include <algorithm>
Labyrinth::Labyrinth(const int& width, const int& height, const std::vector<std::string>& map)
:_data(width, height), _visited(width, height)
{
for (int i = 0; i < width; ++i) {
for (int j = 0; j < heig... | return _data.valid(point);
} |
<|file_name|>queues (15).js<|end_file_name|><|fim▁begin|>var nums = [];
for (var i = 0; i < 100; ++i) {
nums[i] = Math.floor(Math.random() * 101);
}
insertionsort(nums);
dispArr(nums);
print();
putstr("Enter a value to count: ");
var val = parseInt(readline());
<|fim▁hole|>var retVal = count(nums, val);
pri... | |
<|file_name|>opsgenie_schedule_overrideV2_client.go<|end_file_name|><|fim▁begin|>package client
import (
"github.com/AcalephStorage/consul-alerts/Godeps/_workspace/src/github.com/opsgenie/opsgenie-go-sdk/schedulev2"
)
// OpsGenieScheduleOverrideV2Client is the data type to make Schedule rule API requests.
type OpsGe... | error,
) {
var response schedulev2.GetScheduleOverrideResponse |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
('artist', '0002_auto_20150322_1630'),
]
operations = [
migrations.CreateModel(
name='Ev... |
from django.db import models, migrations
|
<|file_name|>message_test.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, wit... | self.assertIsInstance(msg.map_int32_int32, collections_abc.Mapping)
self.assertIsInstance(msg.map_int32_int32, collections_abc.MutableMapping)
self.assertIsInstance(msg.map_int32_foreign_message, collections_abc.Mapping)
self.assertIsInstance(msg.map_int32_foreign_message, |
<|file_name|>issue-22038.rs<|end_file_name|><|fim▁begin|>extern "C" {
// @has issue_22038/fn.foo1.html \
// '//*[@class="rust fn"]' 'pub unsafe extern "C" fn foo1()'
pub fn foo1();
}<|fim▁hole|>extern "system" {
// @has issue_22038/fn.foo2.html \
// '//*[@class="rust fn"]' 'pub unsafe exte... | |
<|file_name|>install_third_party.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Oppia 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... | 'unpacked', os.path.join('fonts', 'HTML-CSS', 'TeX', 'png')]
def _install_third_party_libs(): |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import view
try:
view.main()
except:
print('Invalid List Format')
<|fim▁hole|><|fim▁end|> | view.terminate() |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | ##############################################################################
from spack import *
|
<|file_name|>messages.py<|end_file_name|><|fim▁begin|>'''Module for the messages pageset'''
from murmeli.pages.base import PageSet
from murmeli.pagetemplate import PageTemplate
from murmeli import dbutils
from murmeli.contactmgr import ContactManager
from murmeli.messageutils import MessageTree
from murmeli import inb... | "mails":mails, "nummessages":num_msgs,
"webcachedir":self.get_web_cache_dir()})
contents = self.build_page({'pageTitle':self.i18n("messages.title"), |
<|file_name|>ioentity.cpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2016, Alexander Entinger / LXRobotics
* 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 sourc... | /**
* @brief Constructor
* @param |
<|file_name|>traits.rs<|end_file_name|><|fim▁begin|>use approx::AbsDiffEq;
use num::{Bounded, FromPrimitive, Signed};
use na::allocator::Allocator;
use na::{DimMin, DimName, Scalar, U1};
use simba::scalar::{ClosedAdd, ClosedMul, ClosedSub};
use std::cmp::PartialOrd;
/// A type-level number representing a vector, matr... | |
<|file_name|>parser_cc_block.py<|end_file_name|><|fim▁begin|>#
# Copyright 2013, 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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... | |
<|file_name|>intervals.py<|end_file_name|><|fim▁begin|>import numpy as np
import warnings
import operator
from heapq import merge
class intervals(object):
r"""
This class implements methods for intervals or union of two unbounded
intervals, when all these sets have a point in their intersection
"""... | ## Check that the interval is correct |
<|file_name|>sequence_concat.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##########################################################################
## Sequence Concat
## Author: Tyghe Vallard
## Release Date: 5/30/2012
## ... | amount of segments are included. |
<|file_name|>test_pool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... |
@pytest.fixture
def bigip_pool1(): |
<|file_name|>viewer.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
use crate::{
interfaces::{LeftScreen, RightScreen},
tui::{
text_builder::TextBuilder,
tui_interface::{TUIInterface, TUIOutput},
},
}... | } |
<|file_name|>extentSelector.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
extentSelector.py
---------------------
Date : December 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email... | def __init__(self, canvas):
self.canvas = canvas
QgsMapToolEmitPoint.__init__(self, self.canvas) |
<|file_name|>action_registry_test.py<|end_file_name|><|fim▁begin|># coding: utf-8<|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
#
# http://www.apache.org/licenses/LICENSE-2.0
... | #
# Copyright 2018 The Oppia Authors. All Rights Reserved.
# |
<|file_name|>scatter_plot_model.js<|end_file_name|><|fim▁begin|>// ==========================================================================
// DG.ScatterPlotModel
//
// Author: William Finzer
//
// Copyright (c) 2014 by The Concord Consortium, Inc. All rights reserved.
//
// Licensed under... | |
<|file_name|>execution.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2013 - Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... | (workbook_name, id)) |
<|file_name|>LZ4StreamHC.java<|end_file_name|><|fim▁begin|>/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.util.lz4;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
i... | Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap); |
<|file_name|>expr-if-fail.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | |
<|file_name|>next_back.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::iter::Iterator;
use core::iter::DoubleEndedIterator;
use core::iter::ExactSizeIterator;
use core::iter::Enumerate;
struct A<T> {
begin: T,
end: T
}
macro_rules!... | // }
#[test] |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=100)
bar = models.ForeignKey('Bar', related_name='bar_fk')
def __unicode__(self):
return self.name
class Bar(models.Model):
name = models.CharField(ma... |
def __unicode__(self): |
<|file_name|>depparser.py<|end_file_name|><|fim▁begin|>###########################################################################
# Copyright 2017 ZT Prentner IT GmbH (www.ztp.at)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as ... | return DEPStateCertList(self.chunksize, self, self.idx)
|
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... |
version('1.0.6', '310c504347ca499874593ac96e935353')
|
<|file_name|>SentimentAnalyzerP.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
from edu.umd.rhsmith.diads.tools.sentiment import ISentimentAnalyzer
import pickle
import re
import os
import sys
import time
import traceback
import nltk
from nltk.corpus import stopwords
class SentimentAnalyzer... | ext_tokens.append("<MENTION>")
# replace links with a dummy string |
<|file_name|>compile.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use std::fmt;
use std::iter;
use std::result;
use std::sync::Arc;
use syntax::hir::{self, Hir};
use syntax::is_word_byte;
use syntax::utf8::{Utf8Range, Utf8Sequence, Utf8Sequences};
use prog::{
EmptyLook, Inst, InstBytes, InstChar... | }
}
|
<|file_name|>645-collection-backfill-slugs.py<|end_file_name|><|fim▁begin|>from mkt.collections.models import Collection
def run():
"""Backfill slugs."""
for c in Collection.objects.all():<|fim▁hole|><|fim▁end|> | c.save() |
<|file_name|>thingUtils.py<|end_file_name|><|fim▁begin|>import platform<|fim▁hole|><|fim▁end|> |
def is_windows():
"""Returns true if current platform is windows"""
return any(platform.win32_ver()) |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|>import poplib
import email
import time<|fim▁hole|>class MailHelper:
def __init__(self, app):
self.app = app
def get_mail(self, username, password, subject):
for i in range (5):
pop = poplib.POP3(self.app.config['james']['host'])
... | |
<|file_name|>complex_cp.js<|end_file_name|><|fim▁begin|>var complexExample = {
"edges" : [
{
"id" : 0,
"sbo" : 15,
"source" : "Reactome:109796",
"target" : "Reactome:177938"
},
{
"id" : 1,
"sbo" : 15,
"source" : "MAP:Cb15996_CY_Reactome... | "y" : 2293 |
<|file_name|>CWE762_Mismatched_Memory_Management_Routines__new_array_delete_int_81_bad.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__new_array_delete_int_81_bad.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_a... | #include "std_testcase.h"
#include "CWE762_Mismatched_Memory_Management_Routines__new_array_delete_int_81.h"
namespace CWE762_Mismatched_Memory_Management_Routines__new_array_delete_int_81
|
<|file_name|>test_htmlcontains.py<|end_file_name|><|fim▁begin|>from ftw import ruleset, testrunner, http, errors
import pytest
import re
import random
import threading
def test_logcontains(ruleset, test):
runner = testrunner.TestRunner()
for stage in test.stages:
runner.run_stage(stage)
# Should retur... | |
<|file_name|>test_reshape.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd<|fim▁hole|>import dask.dataframe as dd
from dask.dataframe.utils import assert_eq, PANDAS_ge_0190
@pytest.mark.parametrize('data', [
pd.Series([1, 1, 1, 2, 2, 1, 3, 4], dtype='category'),
pd.Series(pd.Categorical... | import pandas.util.testing as tm
import pytest
|
<|file_name|>dbd_parsers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
@package glider_utils
@file glider_utils.py
@author Stuart Pearce & Chris Wingard
@brief Module containing glider utiliities
"""
__author__ = 'Stuart Pearce & Chris Wingard'
__license__ = 'Apache 2.0'
import numpy as np
import warnings
... | def _read_data(self):
"""
Read in the column labels, data type, number of bytes of each |
<|file_name|>compoom.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""
** marun flavor: compoom **
usage: compoom=/path/to/append.script
add parameter -XX:OnOutOfMemoryError=
"""
import util
def apply(conf, currentflags, flavor_conf):
compressor = flavor_conf.get('compressor', 'gzip,lz4 --rm')
for cm... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
|
<|file_name|>__init__.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/license... |
from .base import RegionCommitmentsTransport
from .rest import RegionCommitmentsRestTransport
from .rest import RegionCommitmentsRestInterceptor |
<|file_name|>cell_list.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <string>
#include <cstring>
#include "../include/globals.hpp"
#include "../include/classes.hpp"
#include "../include/functions.hpp"
struct ce... | double ci[3] = {0,0,0}; |
<|file_name|>ellen_bintree_map_rcu_gpt.cpp<|end_file_name|><|fim▁begin|>/*
This file is a part of libcds - Concurrent Data Structures library
(C) Copyright Maxim Khizhinsky (libcds.dev@gmail.com) 2006-2016
Source code repo: http://github.com/khizmax/libcds/
Download: http://sourceforge.net/projects/li... | */ |
<|file_name|>debug_v2_ops_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 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... | self.assertEqual(tensor_id_1, tensor_id_2)
x = np.zeros([100, 100, 50], dtype=np.float64) |
<|file_name|>dht_log.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Internet de las Cosas - http://internetdelascosas.cl
#
# Descripcion : Programa que permite obtener la lectura de un sensor DHT11
# Lenguaje : Python
# Autor : Jose Zorrilla <jzorrilla@iot.cl>
# Dependencias : Libreria de Adafruit ht... | # Ciclo principal infinito
while True: |
<|file_name|>imag_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# python+selenium识别验证码
#
import re
import requests
import pytesseract
from selenium import webdriver
from PIL import Image,Image
import time
#
driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://higo.flycua.com/hp/html/... | # 打印识别的验证码
# print(code.strip())
|
<|file_name|>SpriteBatcher.java<|end_file_name|><|fim▁begin|>package com.androidgames.framework.gl;
import javax.microedition.khronos.opengles.GL10;
import android.util.FloatMath;
import com.androidgames.framework.impl.GLGraphics;
import com.androidgames.framework.math.Vector2;
public class SpriteBatcher {
... | |
<|file_name|>manager.py<|end_file_name|><|fim▁begin|>import attr
from navmazing import NavigateToAttribute
from navmazing import NavigateToSibling
from widgetastic.widget import NoSuchElementException
from widgetastic.widget import Text
from widgetastic.widget import View
from widgetastic_patternfly import BreadCrumb
f... |
from cfme.base.ui import BaseLoggedInPage |
<|file_name|>share_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Camlistore 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
Un... | t.Fatal("Was expecting error for 'camget -shared " + fileURL + "'")
}
if !strings.Contains(err.Error(), "client: got status code 401") { |
<|file_name|>AllDrinks.js<|end_file_name|><|fim▁begin|>var AllDrinks =
[{"drinkName": "Alexander",
"recipe": "Shake all ingredients with ice and strain contents into a cocktail glass. Sprinkle nutmeg on top and serve.",
"image": "https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Gin_Alexander_%28437... | |
<|file_name|>attributes-included.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache... | |
<|file_name|>permissions_data_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdint.h>
#include <utility>
#include <vector>
#include "base/comma... | switches::kExtensionsOnChromeURLs);
// Enabling the switch should allow all extensions to access chrome urls.
CheckRestrictedUrls(extension.get(), false); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Easy file downloading
#[macro_use]
extern crate error_chain;
extern crate url;
#[cfg(feature = "rustls-backend")]
#[macro_use]
extern crate lazy_static;
#[cfg(feature = "rustls-backend")]
extern crate ca_loader;
use url::Url;
use std::path::Path;
mod errors;
pub ... | try!(transfer.write_function(|data| { |
<|file_name|>mirror_maker.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apach... | if self.blacklist is not None:
cmd += " --blacklist=\"%s\"" % self.blacklist |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const latestIncome = require('./latestIncome')
const latestSpending = require('./latestSpending')
function aggFinances(search) {
return {
latestIncome: () => latestIncome(search),<|fim▁hole|>
module.exports = aggFinances<|fim▁end|> | latestSpending: () => latestSpending(search),
}
} |
<|file_name|>initContext.js<|end_file_name|><|fim▁begin|><|fim▁hole|>};<|fim▁end|> | module.exports = (req, res, next) => {
req.context = req.context || {};
next(); |
<|file_name|>test_cleaner.py<|end_file_name|><|fim▁begin|>import mock
from crashstats.base.tests.testbase import TestCase
from crashstats.api.cleaner import Cleaner, SmartWhitelistMatcher
from crashstats import scrubber
class TestCleaner(TestCase):
def test_simplest_case(self):
whitelist = {'hits': ('fo... | },
'NightTrain': {
'foo': 7, |
<|file_name|>serialization.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 cssparser::Parser;
use media_queries::CSSErrorRepor... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __all__ = ["core"] |
<|file_name|>mod.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/. */
//! Servo heavily uses display lists, which are retained-mode lis... | /// The type of the scroll offset list. This is only populated if WebRender is in use.
pub type ScrollOffsetMap = HashMap<ClipId, Vector2D<f32>>;
|
<|file_name|>20161212145712_location_conference.js<|end_file_name|><|fim▁begin|><|fim▁hole|> return Promise.all([
knex.schema.createTable('locations', function (table) {
table.uuid('id').notNullable().primary()
table.string('title').notNullable().unique()
table.text('description')
table.str... | exports.up = function (knex, Promise) { |
<|file_name|>ogrinfo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#*****************************************************************************
# $Id$
#
# Project: OpenGIS Simple Features Reference Implementation
# Purpose: Python port of a simple client for viewing OGR driver data.
# Author: Even Rouault... | pszDataSource = argv[iArg]
else: |
<|file_name|>bitcoin_pt_BR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Swagcoin</sour... | <source>User Interface &language:</source>
<translation>&Língua da interface com usuário:</translation>
</message> |
<|file_name|>test_serve.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import io
import multiprocessing
import urllib.request
import time
import grole
def simple_server():
app = grole.Grole()
@app.route('/')
def hello(env, req):
return 'Hello, World!'
app.run(host='127.0.0.1')
class TestServe(... | import unittest
import asyncio |
<|file_name|>dock.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The OpenSDS 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... | |
<|file_name|>transition.js<|end_file_name|><|fim▁begin|>/**
* @fileoverview transition parser/implementation - still WIP
*
* @author Tony Parisi
*/
goog.provide('glam.TransitionElement');
goog.require('glam.AnimationElement');
<|fim▁hole|>glam.TransitionElement.DEFAULT_TIMING_FUNCTION = glam.AnimationElement.DEF... | glam.TransitionElement.DEFAULT_DURATION = glam.AnimationElement.DEFAULT_DURATION; |
<|file_name|>AbstractSecurityProviderBuilderImpl.java<|end_file_name|><|fim▁begin|>package io.github.thankpoint.security.impl;
import java.security.Provider;
import java.security.Security;
import io.github.thankpoint.security.api.provider.SecurityProviderBuilder;
/**
* Implementation of {@link SecurityProviderBuild... | return provider(Security.getProvider(name)); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.