prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>credential_factory.py<|end_file_name|><|fim▁begin|>#----------------------------------------------------------------------
# Copyright (c) 2014 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (th... | print "C1 = %s" % cred1
print "C2 = %s" % cred2
|
<|file_name|>VirtualNode.ts<|end_file_name|><|fim▁begin|>import { IVirtualNode, IVirtualElementProps } from './IVirtualNode';
import Cascade from '../cascade/Cascade';
export default class VirtualNode<T> implements IVirtualNode<T> {
type: string;
props: T & IVirtualElementProps;
children: any[];
key: s... | function stringReplacer(match: string, lowerLetter: string, upperLetter: string) { |
<|file_name|>notebook.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from IPython.core.display import Javascript, HTML, display_javascript, display_html
def setup_notebook():
# assign text/x-c++src MIME type to pybind11 cells
code = """
require(['notebook/js/codecell'], function(cc) {
cc... | }); |
<|file_name|>checkdatabaseschema.py<|end_file_name|><|fim▁begin|>##
# Copyright (c) 2014 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | |
<|file_name|>entrymanager.cpp<|end_file_name|><|fim▁begin|>/***********************************************************************
**
** Sturdy - note-taking app
** Copyright (C) 2016 Vladislav Tronko <innermous@gmail.com>
**
** Sturdy is free software: you can redistribute it and/or modify
** it under the terms of th... | clear();
} |
<|file_name|>petsc_vector.cc<|end_file_name|><|fim▁begin|>// ---------------------------------------------------------------------
//
// Copyright (C) 2004 - 2013 by the deal.II authors
//
// This file is part of the deal.II library.
//<|fim▁hole|>// version 2.1 of the License, or (at your option) any later version.
//... | // The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either |
<|file_name|>scope.go<|end_file_name|><|fim▁begin|>package gorm
import (
"errors"
"fmt"
"go/ast"
"strings"
"time"
"reflect"
"regexp"
)
type Scope struct {
Value interface{}
indirectValue *reflect.Value
Search *search
Sql string
SqlVars []interface{}
db *DB
skip... | return scope.primaryKey |
<|file_name|>publication_counts.py<|end_file_name|><|fim▁begin|>import logging
import pandas as pd
from catalog.core.search_indexes import PublicationDocSearch
from ..data_access import data_cache, IncludedStatistics
from query import Query
logger = logging.getLogger(__name__)
def _create_count_dataframe(df):
... | 'has_formal_description': IncludedStatistics.formal_description_count.name,
'has_odd': IncludedStatistics.odd_count.name,
'has_visual_documentation': IncludedStatistics.visual_documentation_count.name
}).reindex(pd.RangeIndex(start=1995, stop=2018, name='year_published'), fill_value=0.0) |
<|file_name|>AllClassesRenamer.java<|end_file_name|><|fim▁begin|>package tools.renamers;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import tools.EntryPoint;
import tools.Tool;
import tools.utils.EnumerationIterator;
import tools.utils.MappingUtils... | } |
<|file_name|>RegisterClient.js<|end_file_name|><|fim▁begin|>// noinspection JSUnusedLocalSymbols
const React = require('react')
const moment = require('moment')
const agent = require('../agent')
import {Link} from 'react-router'
import {Row, Col} from 'react-bootstrap'
import ClientForm from './ClientForm'
import _ fro... | router: React.PropTypes.object |
<|file_name|>json_test.go<|end_file_name|><|fim▁begin|>/*
* PAKT - Interlink Remote Applications
* Copyright (C) 2016 Roland Singer <roland.singer[at]desertbit.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
... | */ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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, eit... |
# now update with the hosts (if any) that failed or were
# unreachable during the handler execution phase |
<|file_name|>os.js<|end_file_name|><|fim▁begin|>import $ from '../core';
import { userAgent } from '../../common/navigator';
$.os = (() => {
const match = userAgent.match($.regexp.os);
const mobile = (/mobile/i).test(userAgent);
const os = RegExp.$1.toLowerCase();
if($.device.idevice){
return 'ios';
}
... | |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from rest_framework import viewsets, permissions
import models
import serializers
<|fim▁hole|> """
This viewset automatically provides `list`, `create`, `retrieve`,
`update` and `destroy` actions.
"""
queryset = models.Page.objects.all()
serializ... | class PageViewSet(viewsets.ModelViewSet): |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Code to manage fetching and storing the metadata of IdPs.
"""
#pylint: disable=no-member
from celery.task import task # pylint: disable=import-error,no-name-in-module
import datetime
import dateutil.parser
import logging
from lxml import et... | else:
SAMLProviderData.objects.create( |
<|file_name|>plot_error.py<|end_file_name|><|fim▁begin|>from matplotlib import pyplot as plt
path = "C:/Temp/mnisterrors/chunk" + str(input("chunk: ")) + ".txt"
<|fim▁hole|>plt.plot(errorhistory)
plt.show()<|fim▁end|> | with open(path, "r") as f:
errorhistory = [float(line.rstrip('\n')) for line in f]
|
<|file_name|>add.js<|end_file_name|><|fim▁begin|>//# sourceURL=add.js
$(function () {
$("#frm").jValidate({
rules:{
name:{
required:true,
minlength:2,
maxlength:32,
stringCheck:true
},
code:{
... | email:{
email:true,
minlength:8,
maxlength:32 |
<|file_name|>backup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import os.path
import msgpack
import json
from base64 import b64encode, b64decode
from binascii import hexlify
from time import time
import compression
import crypto
from transports.metatransport import MetaTransport
from transports... | 'mode': os stat mode, |
<|file_name|>user.py<|end_file_name|><|fim▁begin|># Copyright 2012-2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | parser = super(SetUser, self).get_parser(prog_name)
parser.add_argument(
'user', |
<|file_name|>voter_data_download.py<|end_file_name|><|fim▁begin|>import urllib2
import os
baseurl = "http://ceoaperms.ap.gov.in/TS_Rolls/PDFGeneration.aspx?urlPath=D:\SSR2016_Final\Telangana\AC_001\English\S29A"
constituencyCount = 0
constituencyTotal = 229
while constituencyCount <= constituencyTotal:
pdfCount ... | http://ceoaperms.ap.gov.in/TS_Rolls/PDFGeneration.aspx?urlPath=D:\SSR2016_Final\Telangana\AC_001\English\S29A001P001.PDF
url = baseurl+str(constituencyCount).zfill(2)+'P'+str(pdfCount).zfill(3)+".pdf"
pdfCount = pdfCount + 1 |
<|file_name|>DefaultTableCellHeaderRenderer.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU G... | |
<|file_name|>normalize.js<|end_file_name|><|fim▁begin|>import { toTitleCase } from 'utils';
export default values => {
let newValues = { ...values };
// Add a sourceType if no source (i.e. not scraped) and no sourceType
if (!newValues['source'] && !newValues['sourceType']) {
newValues['sourceType'] = 'user'... | newValues = { ...newValues, page: undefined, book: undefined };
break;
case 'book': |
<|file_name|>pagination.py<|end_file_name|><|fim▁begin|>import base64
from dataclasses import dataclass
from typing import Any, List, Tuple, Union
import flask
import sqlalchemy as sa
from marshmallow import ValidationError, fields
from flask_resty.sorting import FieldOrderings, FieldSortingBase
from flask_resty.view... | def get_item_meta(self, item, view): |
<|file_name|>ini.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 v... | group = self.groups.get(line, None) |
<|file_name|>scripts.js<|end_file_name|><|fim▁begin|>/**
Select
<|fim▁hole|> http://css-tricks.com/responsive-menu-concepts
# 2012 by Tim Pietrusky
# timpietrusky.com
**/<|fim▁end|> | # What? #
Part of my "Responsive Menu Concepts" article on CSS-Tricks |
<|file_name|>pretty.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright (c) 2021 Project CHIP 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/LI... | # |
<|file_name|>robot.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import math
import random
import mapp
import geom
class Robot:
def __init__(self, mapp, num_particles):
"""
Initialize the robot with a map.
Inputs:
mapp: a Map object on which the robot will move.
"""
... | #!/usr/bin/env python3
|
<|file_name|>datetimef_test.js<|end_file_name|><|fim▁begin|>#target "InDesign"
#include "../datetimef.js"
var today = new Date(2014, 2, 8, 13, 23, 46, 300);
// => Sat Mar 08 2014 13:23:46 GMT+0900
var ret = [];
var t = function(done, expect) {
done_str = done;
if (done === expect) {
ret.push("[Passed]: retur... | t( datetimef(today, "%L"), "300");
t( datetimef(today, "%z"), "-0900"); |
<|file_name|>runserver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
import sys, os
# для доступа к файлам данных меняем каталог на тот,
# в котором лежит скрипт запуска
dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(dir)
<|fim▁hole|><|fim▁end|> | from brigantina import code
# поехали!
code.webapp.run() # stand alone server |
<|file_name|>pyraminx.js<|end_file_name|><|fim▁begin|>var pyraminxHeuristic = null;
var MIN_PYRAMINX_LENGTH = 6;
var PYRAMINX_HEURISTIC_DEPTH = 7;
function pyraminxState() {
if (pyraminxHeuristic === null) {
pyraminxHeuristic = new pyraminx.EdgesHeuristic(PYRAMINX_HEURISTIC_DEPTH);
}
while (true) {
var s... | var tipMoves = pyraminx.randomTipMoves();
var solutionStr = pyraminx.movesToString(solution); |
<|file_name|>lvm.py<|end_file_name|><|fim▁begin|># Copyright 2013 OpenStack Foundation.
# 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.... | 'udev settle.', name)
|
<|file_name|>photo.service.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { Injectable } from '@angular/core';
@Injectable()
export class PhotoService {
constructor(private http: Http) { }
upload(vehicleId: number, photo: any) {
var formData = new FormData();
formData.append('file', phot... | import { Http } from '@angular/http'; |
<|file_name|>profile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------#
# #
# This file is part of the Horus Project #
# ... | """
A setting object contains a configuration setting. These are globally accessible trough the quick access functions |
<|file_name|>subreddit-picker-item-view.js<|end_file_name|><|fim▁begin|>define(['App', 'jquery', 'underscore', 'backbone', 'hbs!template/subreddit-picker-item', 'view/basem-view'],
function(App, $, _, Backbone, SRPitemTmpl, BaseView) {
return BaseView.extend({
template: SRPitemTmpl,
... | action: 'unsub', |
<|file_name|>simplepattern_test.rs<|end_file_name|><|fim▁begin|>use simplepattern::SimplePattern;
#[test]
fn root_url_matches_only_root() {<|fim▁hole|> assert!(p.matches("/").is_match);
assert!(!p.matches("/foo").is_match);
assert!(!p.matches("/foo/bar").is_match);
}
#[test]
fn raw_routes_match_urls() {
... | let p=SimplePattern::new("/"); |
<|file_name|>plotting.py<|end_file_name|><|fim▁begin|># being a bit too dynamic
# pylint: disable=E1101
import datetime
import warnings
import re
from math import ceil
from collections import namedtuple
from contextlib import contextmanager
from distutils.version import LooseVersion
import numpy as np
from pandas.uti... |
Parameters |
<|file_name|>local.go<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2016 H2O.ai, Inc. <http://h2o.ai/>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License... |
var uploadEngineHelp = `
engine [path] |
<|file_name|>tvigle.py<|end_file_name|><|fim▁begin|># encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
float_or_none,
parse_age_limit,
)
class TvigleIE(InfoExtractor):
IE_NAME = 'tvigle'
IE_DESC = 'Интернет-телевидение Tvigle.ru'
_VAL... | {
'url': 'http://www.tvigle.ru/video/vladimir-vysotskii/vedushchii-teleprogrammy-60-minut-ssha-o-vladimire-vysotskom/',
'md5': 'd9012d7c7c598fe7a11d7fb46dc1f574',
'info_dict': { |
<|file_name|>bot_app.py<|end_file_name|><|fim▁begin|>import logging
import pickle
import random
from gevent import Greenlet, sleep
from threading import Lock
from app import create_app
from dota_bot import DotaBot
from models import db, DynamicConfiguration, Game, GameStatus, GameVIP
from helpers.general import divide... | db.session().commit()
g.start()
self.mutex.release()
sleep(60) |
<|file_name|>base.py<|end_file_name|><|fim▁begin|><|fim▁hole|>def classeq(x, y):
return x.__class__==y.__class__
class Element(object): pass<|fim▁end|> | # -*- coding: utf-8 -*-
|
<|file_name|>notify.py<|end_file_name|><|fim▁begin|>"""SynologyChat platform for notify component."""
from http import HTTPStatus
import json
import logging
import requests
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
PLATFORM_SCHEMA,
BaseNotificationService,
)
from ho... | """Initialize the service."""
self._resource = resource
self._verify_ssl = verify_ssl
|
<|file_name|>NearestBaseUIWin.cpp<|end_file_name|><|fim▁begin|>// ADOBE SYSTEMS INCORPORATED
// Copyright 1993 - 2002 Adobe Systems Incorporated
// All Rights Reserved
//
// NOTICE: Adobe permits you to use, modify, and distribute this
// file in accordance with the terms of the Adobe license agreement
// accompanyi... | |
<|file_name|>RemoveHeadersTest.java<|end_file_name|><|fim▁begin|>/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You ... | assertMockEndpointsSatisfied(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>''' direct
<|fim▁hole|>.. moduleauthor:: Edwin Tye <Edwin.Tye@gmail.com>
'''
from __future__ import division, print_function, absolute_import
from .sqp import *
from .ip import *
from .ipBar import *
from .ipPD import *
from .ipPDC import *
from .ipPDandPDC import... | |
<|file_name|>sublimelinter.py<|end_file_name|><|fim▁begin|>#
# sublimelinter.py
# Part of SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Ryan Hileman and Aparajita Fishman
#
# Project: https://github.com/SublimeLinter/SublimeLinter3
# License: MIT
#
"""This module provides the SublimeLinte... | |
<|file_name|>lifecycle_inventory.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Build an ansible inventory based on autoscaling group instance lifecycle state.
Outputs JSON to stdout with keys for each state and combination of autoscaling
group and state.
{
"InService": [<|fim▁hole|> "Terminating:Wait"... | "10.0.47.127",
"10.0.46.174"
], |
<|file_name|>SSLDualAuthenticationExample.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this fil... | |
<|file_name|>formatting.py<|end_file_name|><|fim▁begin|>from contextlib import contextmanager
from .termui import get_terminal_size
from .parser import split_opt
from ._compat import term_len
# Can force a width. This is used by the test system
FORCED_WIDTH = None
def measure_table(rows):
widths = {}
for r... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url
from application import views
<|fim▁hole|> url(r'^(?P<application_id>\d+)/$', views.detail, name='detail'),
url(r'^klogin/(?P<username>\w+)/(?P<password>\w+)/$', views.klogin, name='klogin'),
)<|fim▁end|> | urlpatterns = patterns('',
url(r'^$', views.index, name='index'), |
<|file_name|>security_rule_associations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.... | |
<|file_name|>IDODependencyList.java<|end_file_name|><|fim▁begin|>package com.idega.data;
import java.util.Vector;
import java.util.List;
import java.util.Iterator;
import java.util.Collection;
/**
* Title: idega Data Objects
* Description: Idega Data Objects is a Framework for Object/Relational mapping and ... | while (iter2.hasNext()) {
Class item = (Class)iter2.next();
if(!listContainsClass(theReturn,item)){ |
<|file_name|>test_language_actions.py<|end_file_name|><|fim▁begin|>from six import BytesIO
from pathod.language import actions, parse_pathoc, parse_pathod, serve
def parse_request(s):
return next(parse_pathoc(s))
def test_unique_name():
assert not actions.PauseAt(0, "f").unique_name
assert a... | assert l.freeze({}).spec() == l.spec() |
<|file_name|>ec2.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 Apache License... | name=name,
size=int(size), |
<|file_name|>error.py<|end_file_name|><|fim▁begin|>class EmptyResult(object):
'''
Null Object pattern to prevent Null reference errors<|fim▁hole|> '''
def __init__(self):
self.status = 0
self.body = ''
self.msg = ''
self.reason = ''
def __nonzero__(self):
retu... | when there is no result |
<|file_name|>modifDoublon2.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Mon Apr 27 09:30:47 2015
@author: martin
"""
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
from Bio.SubsMat.MatrixInfo import blosum62
#remarque : Ceci n'est pas une maélioration de modifDoublon,
#c'est une vers... | def modifDoublon2(x,y,z,ldna,offset,doublon,i,q,patternX,patternY):
ATCG = ["A","T","C","G"]
# on commence par déterminer quels acides aminés de x et y sont "ciblés" |
<|file_name|>EarthStream.java<|end_file_name|><|fim▁begin|>package kieranvs.avatar.bending.earth;
import java.util.Arrays;
import java.util.concurrent.ConcurrentHashMap;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import kieranvs.avatar.P... | this.origin = location.clone();
|
<|file_name|>cubes_ext.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from flask import request, g, Response
#from openspending.core import cache
from openspending.auth import require
from openspending.lib.jsonexport import jsonify
from openspending.views.api_v2.common import blueprint
from openspending.views.error impo... | import logging
from datetime import datetime
import os
import json |
<|file_name|>testing.py<|end_file_name|><|fim▁begin|>import collections
import lxml.objectify
import mock
import zeit.cms.repository.interfaces
import zeit.cms.tagging.interfaces
import zeit.cms.tagging.tag
import zope.component
import zope.interface
NAMESPACE = "http://namespaces.zeit.de/CMS/tagging"
KEYWORD_PROPERT... | |
<|file_name|>btree.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/... | fn has_key(&self, other: K) -> bool {
let order = self.key.cmp(&other); |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>"""
model.py
by Ted Morin
contains a function to predict 10-year Atrial Fibrilation risks using beta coefficients from
10.1016:S0140-6736(09)60443-8
2010 Development of a Risk Score for Atrial Fibrillation in the Community
Framingham Heart Study
translated and optim... | 1654.6600, # gender_age2
1.8961, # age_vhd
0.6100 # age_hxchf
]) |
<|file_name|>mailutils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# publ... | receivers are separated by ',')
@param usebcc: [bool] True for using Bcc in place of To
@param subject: [string] subject of the email
@param content: [string] content of the email |
<|file_name|>2017-10-09-modas.py<|end_file_name|><|fim▁begin|>from statistics import mode
def moda(muestras):
frecuencias = {}
for muestra in muestras:
if muestra not in frecuencias.keys():
frecuencias[muestra] = 1
else:
frecuencias[muestra] += 1
valores = []
fr... | |
<|file_name|>0001_squashed_0022_auto_20141229_2347.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
def siteconf_func(apps, schema_edi... | )
|
<|file_name|>runner.py<|end_file_name|><|fim▁begin|>from dask.callbacks import Callback
from os import getcwd, remove
from os.path import join, exists
from dask.diagnostics import ProgressBar
from dask.multiprocessing import get as get_proc
import toolz
import json
class NekCallback(Callback):
def __init__(self, c... | |
<|file_name|>posture-to-jacobian-recurrent.py<|end_file_name|><|fim▁begin|>import climate
import lmj.cubes
import lmj.plot
import numpy as np
import pandas as pd
import theanets
logging = climate.get_logger('posture->jac')
BATCH = 256<|fim▁hole|> df = pd.read_csv(fn, index_col='time').dropna()
cols = [c for c ... | THRESHOLD = 100
def load_markers(fn): |
<|file_name|>somescript.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import sys<|fim▁hole|>words = text.split()
print 'Words:',words
wordcount = len(words)
print 'Wordcount:',wordcount<|fim▁end|> | text = sys.stdin.read()
print 'Text:',text |
<|file_name|>proxy.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 Apache Lic... | if row['uri'] == uri:
#Source URI's that refered the user to the threat
referers[row['referer']]+=1 |
<|file_name|>250.py<|end_file_name|><|fim▁begin|>class DinkyFish:
def monthsUntilCrowded(self, tankVolume, maleNum, femaleNum):
months = 0
while maleNum + femaleNum <= (tankVolume * 2):
minFishes = min(maleNum, femaleNum)
maleNum += minFishes
femaleNum += mi... | months += 1
return months |
<|file_name|>tydecode.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/licens... | ast::ident { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import * as Actions from './actions'
import * as Controls from './controls'
import Editor from './editor'
import Panel from './panel'
export {Actions}
export {Editor}<|fim▁hole|><|fim▁end|> | export {Panel}
export {Controls} |
<|file_name|>test.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/licen... | [a, b] => match (from_str::<uint>(a), from_str::<uint>(b)) { |
<|file_name|>range-spectrogram.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) Alex Urban (2019-2020)
#
# 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... | |
<|file_name|>main_server_weblog.py<|end_file_name|><|fim▁begin|>'''
Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This ... | import sys
import subprocess |
<|file_name|>ast_node.go<|end_file_name|><|fim▁begin|>/*
* gomacro - A Go interpreter with Lisp-like macros
*
* Copyright (C) 2017-2019 Massimiliano Ghilardi
*
* 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
* ... | func (x ArrayType) Interface() interface{} { return asInterface(x.X, x.X == nil) }
func (x AssignStmt) Interface() interface{} { return asInterface(x.X, x.X == nil) }
func (x BadDecl) Interface() interface{} { return asInterface(x.X, x.X == nil) } |
<|file_name|>boilerplate.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, os, re
from frappe.utils import touch_file, encode, cstr
def make_boilerplate(dest, app_name):
if not os... | |
<|file_name|>bodiesHandling.py<|end_file_name|><|fim▁begin|># encoding: utf-8
"""
Miscellaneous functions, which are useful for handling bodies.
"""
from yade.wrapper import *
import utils,math,numpy
try:
from minieigen import *
except ImportError:
from miniEigen import *
#spheresPackDimensions====================... | idSpheresIter=[] |
<|file_name|>TileEntitySailRenderer.java<|end_file_name|><|fim▁begin|>package net.tmachq.Ported_Blocks.tileentities.renderers;
import java.io.DataInputStream;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.rendere... | OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier);
}
|
<|file_name|>statistics.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2013 Matthew Woodruff
This script 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 opti... | write_result(args.data.name, result,
args.output_directory)
|
<|file_name|>Druidmace.java<|end_file_name|><|fim▁begin|>package fr.toss.FF7Weapons;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.Item;
import com.google.common.collect.Multimap;
public class Druidmace extends FF7weapon
{<... | private float field_150934_a; |
<|file_name|>GenKineticField.java<|end_file_name|><|fim▁begin|>package com.suscipio_solutions.consecro_mud.Items.BasicTech;
import com.suscipio_solutions.consecro_mud.Common.interfaces.CMMsg;
import com.suscipio_solutions.consecro_mud.Common.interfaces.PhyStats;
import com.suscipio_solutions.consecro_mud.Items.interfac... |
@Override
protected boolean doShield(MOB mob, CMMsg msg, double successFactor) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
__version__ = '1.3.7'<|fim▁hole|>
default_app_config = 'aldryn_redirects.apps.AldrynRedirects'<|fim▁end|> | |
<|file_name|>test_envois.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-
"""
envois.test
~~~~~~~~~~~~
nosetests for the envois pkg
:copyright: (c) 2012 by Mek
:license: BSD, see LICENSE for more details.
"""
import os
import json
import unittest
from envois import invoice
jsn = {"seller":... | def test_invoice(self):
invoice.make_invoice(jsn) |
<|file_name|>validation.js<|end_file_name|><|fim▁begin|>/*!
* Module requirements
*/
var NeopreneError = require('../error')
/**
* Document Validation Error
*
* @api private
* @param {Document} instance
* @inherits NeopreneError
*/
function ValidationError (instance) {
NeopreneError.call(this, "Validation ... | this.errors = instance.errors = {}; |
<|file_name|>test_where_clause.py<|end_file_name|><|fim▁begin|># Copyright 2013-2016 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | with self.assertRaises(StatementException):
WhereClause('a', 'b', 'c') |
<|file_name|>debugger.rs<|end_file_name|><|fim▁begin|>use crate::common::Config;
use crate::runtest::ProcRes;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;
pub(super) struct DebuggerCommands {
pub commands: Vec<String>,
pub check_lines: Vec<String>,
pub breakpoint_lines: Vec<u... | let mut counter = 1;
let reader = BufReader::new(File::open(file).unwrap());
for line in reader.lines() {
match line { |
<|file_name|>attachment.ts<|end_file_name|><|fim▁begin|>export default interface Attachment {
id: number;
created: Date;<|fim▁hole|> filename: string;
mimeType: string;
fileSize: string;
noteId: number;
}<|fim▁end|> | updated: Date; |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import datetime
import json
import logging
from django.contrib import messages
from django.contrib.auth import REDIRECT_FIELD_NAME, get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import logout
from django.contri... | # create a Vote. Deny attackers any information about how they are failing.
if request.is_ajax():
result = {"status": "200", |
<|file_name|>inspector-group.model.ts<|end_file_name|><|fim▁begin|>import {Label} from './label.model';
import {Position} from './position.model';
import {InspectorTab} from './inspector-tab.model';
export class InspectorGroup {
name: string;
label: Label;
position: Position;
tab: InspectorTab;<|fim▁ho... | |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/**
* @author Vexatos<|fim▁hole|>
@MethodsReturnNonnullByDefault
@ParametersAreNonnullByDefault
package vexatos.backpacks.backpack;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;<|fim▁end|> | */ |
<|file_name|>xml_importer.py<|end_file_name|><|fim▁begin|>"""
Each store has slightly different semantics wrt draft v published. XML doesn't officially recognize draft
but does hold it in a subdir. Old mongo has a virtual but not physical draft for every unit in published state.
Split mongo has a physical for every uni... | |
<|file_name|>organise.py<|end_file_name|><|fim▁begin|>import os
import shutil
from hashlib import md5
from io import StringIO
from PIL import Image
from photonix.photos.models import LibraryPath
from photonix.photos.utils.db import record_photo
from photonix.photos.utils.fs import (determine_destination,
... | opened orig and dest file contents. Can keep hold of all file-based and
image-based hashes per file. |
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""Constants for Google Assistant."""
from homeassistant.components import (
binary_sensor,
camera,
climate,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
... | CONF_PROJECT_ID = "project_id"
CONF_ALIASES = "aliases"
CONF_API_KEY = "api_key" |
<|file_name|>ForecastFragment.java<|end_file_name|><|fim▁begin|>package com.dreamdevs.sunshine.fragment;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
impor... | import android.util.Log;
import android.view.LayoutInflater; |
<|file_name|>stateMachine.cpp<|end_file_name|><|fim▁begin|>#include "stateMachine.h"
#include <vector>
#include "../Ecs/World.h"
#include "../AI/AiComponent.h"
#include "../AI/BasicAiModule.h"
#include "../AI/Action/MoveCloseToTargetAction.h"
#include "../AI/Action/NoAction.h"
#include "../AI/SubSystems/NavigationSub... | using Threading::getConcurrentWriter;
namespace StateMachineTest |
<|file_name|>bookmarkmanager.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Us... | |
<|file_name|>TXFrameworkException.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* Thi... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.conf.urls import url
from django.conf.urls.static import static
from . import views
urlpatterns = [<|fim▁hole|> url(r'^subreddits$', views.subreddits),
url(r'^about$', views.about),
url(r'^api$', views.api),
... | url(r'^$', views.home), |
<|file_name|>ez_rpc.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors
// Licensed under the MIT License:
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"),... | // all copies or substantial portions of the Software. |
<|file_name|>imports.rs<|end_file_name|><|fim▁begin|>// Imports.
// Long import.
use syntax::ast::{ItemForeignMod, ItemImpl, ItemMac, ItemMod, ItemStatic, ItemDefaultImpl};
use exceedingly::looooooooooooooooooooooooooooooooooooooooooooooooooooooooooong::import::path::{ItemA,
... |
mod Foo { |
<|file_name|>IStep.java<|end_file_name|><|fim▁begin|>// Start of user code Copyright
/*******************************************************************************
* Copyright (c) 2012 IBM Corporation and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.