code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# The MIT License (MIT)
#
# Copyright (c) 2013 Numenta, Inc.
#
# 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, including without limitation the rights
# to use, copy, mod... | ilblackdragon/nupic-hackathon-2014 | pycept/pycept/__init__.py | Python | mit | 1,184 |
#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class httpd(test.test):
"""
Autotest module for testing basic functionality
of httpd
@author xu zheng<zhengxu@cn.ibm.com>
"""
version = 1
nfail = 0
path = ''
... | PoornimaNayak/autotest-client-tests | linux-tools/httpd/httpd.py | Python | gpl-2.0 | 1,200 |
# ome - Object Message Expressions
# Copyright (c) 2015-2016 Luke McCarthy <luke@iogopro.co.uk>
from . import lang_c
target_map = {
'c': lang_c,
}
| shaurz/ome | ome/target/__init__.py | Python | mit | 153 |
import sys
from pyAMI import *
class amiListConfigurationTag:
def __init__(self):
return
def command(self , argv):
argument = []
argument.append("ListConfigurationTag")
argument.extend(argv)
return argument
def main(argv):
try:
pyAMI_setEn... | ndawe/pyAMI | devscripts/done/amiListConfigurationTag.py | Python | gpl-3.0 | 643 |
"""URLs for the Study app."""
from django.urls import path
from . import views
urlpatterns = [
path('', views.Index.as_view(), name='study_index'),
path('<int:pk>/', views.GuideDetail.as_view(), name='study_guide_page'),
]
| studybuffalo/studybuffalo | study_buffalo/study/urls.py | Python | gpl-3.0 | 233 |
from Screens.MessageBox import MessageBox
from Components.ActionMap import ActionMap, NumberActionMap
from Components.MenuList import MenuList
from Components.Button import Button
from Components.Label import Label
from Components.Pixmap import Pixmap
from Components.ActionMap import NumberActionMap, ActionMap
from Com... | schleichdi2/OpenNfr_E2_Gui-6.0 | lib/python/Plugins/Extensions/Infopanel/panel_key.py | Python | gpl-2.0 | 2,724 |
import sqlite3
import os
from urllib.parse import urlparse
from jinja2 import Environment, FileSystemLoader
from cspreporter.core.plugins import Processor
from cspreporter.plugins import ROOT_PATH
class Directives(Processor):
title = 'Top Blocked URIs by Directives'
desc = 'Determines most blocked URIs with... | yandex/csp-reporter | cspreporter/plugins/directives/directives.py | Python | gpl-2.0 | 2,983 |
#!/usr/bin/python3
#
# This file is part of sarracenia.
# The sarracenia suite is Free and is proudly provided by the Government of Canada
# Copyright (C) Her Majesty The Queen in Right of Canada, Environment Canada, 2008-2015
#
# Questions or bugs report: dps-client@ec.gc.ca
# sarracenia repository: git://git.code.sf.... | khosrow/metpx | sarracenia/sarra/sr_poster.py | Python | gpl-2.0 | 18,736 |
from numpy import mean
import csv
import sys
import json
import codecs
reload(sys)
sys.setdefaultencoding('utf8')
def utf_8_encoder(unicode_csv_data):
for line in unicode_csv_data:
yield line.encode('utf-8')
def main(input_file_1, input_file_2, output_file):
dataset = []
file_1_means = []
lab... | hhassan1/Encuestas-DG-2016-17 | charts_comparison_generator.py | Python | bsd-3-clause | 1,606 |
class Information:
def __init__(self, objectid, cvid, information_type_id, description):
self.objectid = objectid
self.cvid = cvid
self.information_type_id = information_type_id
self.description = description
self.deleted = 0
| itucsdb1611/itucsdb1611 | classes/information.py | Python | gpl-3.0 | 270 |
class Solution(object):
def threeSumClosest(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
nums.sort()
result = nums[0] + nums[1] + nums[-1]
for i in range(len(nums) - 2):
if i != 0 and nums[i] == nums[i - ... | rx2130/Leetcode | python/16 3Sum Closest.py | Python | apache-2.0 | 1,151 |
from django.http import HttpResponse, HttpRequest
from django.shortcuts import render_to_response, redirect, get_object_or_404
from django.core.urlresolvers import reverse
from django.core import urlresolvers
from thweddy.main.models import *
from thweddy.main.forms import *
from thweddy.main.twitter.utils import *
fr... | antiface/thweddy | thweddy/main/views.py | Python | mit | 6,393 |
from conans import ConanFile
import os
import StringIO
def riot_board(settings):
if settings.target == "native32":
return "native"
return settings.target
class AversivePlusPlusConanModule(ConanFile):
name = "riot"
version = "0.1"
settings = "os", "compiler", "arch", "target"
options = ... | AversivePlusPlus/AversivePlusPlus | modules/thirdparty/riot/riot/conanfile.py | Python | bsd-3-clause | 4,444 |
# Copyright 2014: The Rally team
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | vishnu-kumar/PeformanceFramework | tests/unit/cli/commands/test_show.py | Python | apache-2.0 | 10,239 |
import numpy as np
import matplotlib.pyplot as plt
t=np.arange(0,5,0.2)
plt.plot(t,t,'r--',t,t**2,'bs',t,t**3,'g^')
plt.show()
| Mooooony/plot-tutorial | three_lines.py | Python | mpl-2.0 | 128 |
import uncertainties
from uncertainties import ufloat
import math
import numpy
import numpy
import pylab
from scipy.optimize import curve_fit
import math
import scipy.stats
import uncertainties
from uncertainties import unumpy
h_fe = ufloat(170, 10)
V_BE = ufloat(0.605, 0.004)
V_CC = ufloat(20.2, 0.... | fedebell/Laboratorio3 | relazione4/calcoli.py | Python | gpl-3.0 | 2,530 |
import json
import logging
import sys
from redash.query_runner import *
from redash.utils import JSONEncoder
try:
import cx_Oracle
TYPES_MAP = {
cx_Oracle.DATETIME: TYPE_DATETIME,
cx_Oracle.CLOB: TYPE_STRING,
cx_Oracle.LOB: TYPE_STRING,
cx_Oracle.FIXED_CHAR: TYPE_STRING,
... | 44px/redash | redash/query_runner/oracle.py | Python | bsd-2-clause | 5,408 |
# Copyright 2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | wolverineav/neutron | neutron/tests/common/config_fixtures.py | Python | apache-2.0 | 2,517 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "eyedata.settings.local")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| IQSS/eyeData | eyedata/manage.py | Python | mit | 256 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
Copyright (c) 2011 Tyler Kenendy <tk@tkte.ch>
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, including without limitation the... | deathcap/Burger | burger/toppings/stats.py | Python | mit | 2,220 |
#!/usr/bin/env python
#
# Copyright (C) 2013 Martin Owens
#
# This program is free software; you can redilenibute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This pro... | jmetzmeier/python-crontab-debian | tests/test_frequency.py | Python | gpl-3.0 | 5,280 |
import ppygui as gui
from tumblr import Api
class Quote(gui.CeFrame):
def __init__(self, api):
self.api = api
gui.CeFrame.__init__(self, title="Opentumblr CE")
self.l_quote = gui.Label(self, "Add a Quote", align = "center")
self.l_title = gui.Label(self, "Quote")
self.tc_title = gui.Edit(self, multiline... | jyr/opentumblr-ce | opentumblr/quote.py | Python | mit | 1,557 |
import argparse
import sys
from coalib.misc import Constants
from coalib.collecting.Collectors import get_all_bears_names
try:
from argcomplete.completers import ChoicesCompleter
except ImportError:
class ChoicesCompleter:
def __init__(self, *args, **kwargs):
pass
class CustomFormatter(... | scottbelden/coala | coalib/parsing/DefaultArgParser.py | Python | agpl-3.0 | 10,845 |
import argparse
import torch
import torch.nn as nn
from torch.autograd import Variable
import models
import torchaudio.transforms as tat
import torchvision.transforms as tvt
import spl_transforms
from loader_voxforge import *
import math
parser = argparse.ArgumentParser(description='PyTorch Language ID Classifier Trai... | dhpollack/spokenlanguages | cfg.py | Python | mit | 12,221 |
"""
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, Version 2.0 (the
"License"); you may not use this ... | radicalbit/ambari | ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/superset.py | Python | apache-2.0 | 6,323 |
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import random
from typing import Optional, List, Tuple
from ..model import Model
from ..program import Program
from shared.insn_yaml import Insn
from .branch_gen import B... | lowRISC/opentitan | hw/ip/otbn/dv/rig/rig/gens/bad_branch.py | Python | apache-2.0 | 2,355 |
from common import *
class Notifier(object):
def __init__(self):
pass
def notify(self, source, *args):
if source == 'Logger':
print 'Logger: error log message caught - %s' % args[0]
elif source == 'Dispatching':
reason, path = args
print 'Dispatc... | emop/webrobot | webrobot_gao/src/sailing/common/notifier.py | Python | gpl-2.0 | 652 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Payment',
fields=[
('id', models.AutoField(verb... | giovannicode/djangoseller | payments/migrations/0001_initial.py | Python | bsd-3-clause | 576 |
import time
from redset.interfaces import Serializer
from redset.locks import Lock
import logging
log = logging.getLogger(__name__)
__all__ = (
'SortedSet',
'TimeSortedSet',
'ScheduledSet',
)
class SortedSet(object):
"""
A Redis-backed sorted set safe for multiprocess consumption.
By def... | percolate/redset | redset/sets.py | Python | bsd-2-clause | 11,194 |
import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="y", parent_name="bar", **kwargs):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
anim=kwargs.pop("... | plotly/python-api | packages/python/plotly/plotly/validators/bar/_y.py | Python | mit | 480 |
#Python Advanced Roguelike Engine (Parole)
#Copyright (C) 2006-2012 Max Bane
#
#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 2
#of the License, or (at your option) any later versio... | gdos/parole | src/parole/map.py | Python | gpl-2.0 | 96,935 |
# Copyright 2013-2021 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | aerospike/aerospike-admin | lib/health/query.py | Python | apache-2.0 | 102,759 |
"""
Select candidates from a .astrom file based on certain qualities.
Takes a .cands.astrom file as argument.
"""
from ossos import astrom
import sys
from astropy.io import ascii
from . import match
import os
import numpy
parser = astrom.AstromParser()
cands_filename = sys.argv[1]
fake_candidates = parser.parse(can... | OSSOS/MOP | src/ossos/utils/compare_cands_reals.py | Python | gpl-3.0 | 1,577 |
import time
import subprocess
import functools
DEFAULT_NUM_CONFS = 6
DEFAULT_PEER_PORT = 10011
CMD_SHUTDOWN_TIME = 10
def debug(func):
@functools.wraps(func)
def inner(*args, **kwargs):
print("{}: executing".format(func.__name__))
result = func(*args, **kwargs)
print("{}: OK".format(f... | BitfuryLightning/lnd-simnet-env | python-grpc-client/tools.py | Python | mit | 995 |
from typing import Dict
from urllib.parse import quote
def request_path(env: Dict):
return quote('/' + env.get('PATH_INFO', '').lstrip('/'))
| bugsnag/bugsnag-python | bugsnag/wsgi/__init__.py | Python | mit | 147 |
# Rename to local_settings.py, adjust settings below
# Add django_extensions for ./manage.py runserver_plus, shell_plus, etc.
LOCAL_INSTALLED_APPS = ['django_extensions']
# Use PostGIS for backend
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'explore',
... | inmagik/django-multi-gtfs | examples/explore/exploreproj/local_settings.example.py | Python | apache-2.0 | 436 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-14 14:16
from __future__ import unicode_literals
from django.db import migrations
def move_region_to_regions(apps, schema_editor):
PublicBody = apps.get_model("publicbody", "PublicBody")
for pb in PublicBody.objects.filter(region__isnull=False)... | fin/froide | froide/publicbody/migrations/0024_auto_20181114_1516.py | Python | mit | 556 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, has_common, comma_or
from frappe import session, _
from erpnext.utilities.transaction_base import Tran... | patilsangram/erpnext | erpnext/setup/doctype/authorization_control/authorization_control.py | Python | gpl-3.0 | 9,892 |
#!/usr/bin/env python
### ClassMethod.py
#---------------------------- class X ---------------------------------
class X: #(A)
def foo(cls): #(B)
print "foo() called on object", cls.__name__ ... | acabey/acabey.github.io | projects/demos/engineering.purdue.edu/scriptingwithobjects/swocode/chap7/ClassMethod.py | Python | gpl-3.0 | 1,078 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import random
liczba = random.randint(1, 10)
#print "Wylosowana liczba:",liczba
odp = raw_input("Jaką liczbę od 1 do 10 mam na myśli? ")
| roninek/python101 | docs/podstawy/podstawy/toto03.py | Python | mit | 190 |
import sqlite3
from datetime import datetime
import threading
import node
import settings
import GeoIP
dbname = settings.Database_path + settings.Database_name
def createdb():# Create database
conn= sqlite3.connect(dbname)
conn.commit()
conn.close()
def trunc(tab):# Truncate tables in database
c... | luisan00/webit | sqlite.py | Python | mit | 5,248 |
from django.core.management.base import BaseCommand
# Own imports
from ...models import PriceTracker
class Command(BaseCommand):
def handle(self, **options):
trackers = ['Kauppalehti', 'GoogleFinance', 'AlphaVantage' ]
for tracker in trackers:
if not PriceTracker.objects.filter(nam... | jokimies/django-pj-portfolio | portfolio/management/commands/update_price_trackers.py | Python | bsd-3-clause | 443 |
heatmap_tidy = heatmap_prep_sns.reset_index().melt(id_vars=["year"], value_name="count")
heatmap_tidy.head() | jorisvandenbossche/DS-python-data-analysis | notebooks/_solutions/case2_biodiversity_analysis17.py | Python | bsd-3-clause | 108 |
from auvsi_suas.views.login import Login
from auvsi_suas.views.index import Index
from auvsi_suas.views.map import MapImage
from auvsi_suas.views.missions import Evaluate
from auvsi_suas.views.missions import ExportKml
from auvsi_suas.views.missions import LiveKml
from auvsi_suas.views.missions import LiveKmlUpdate
fro... | auvsi-suas/interop | server/auvsi_suas/views/urls.py | Python | apache-2.0 | 2,663 |
# -*- coding: utf-8 -*-#
__author__ = 'dolacmeo'
| dolaCmeo/quick_flask | flask_site/user/__init__.py | Python | mit | 49 |
from __future__ import division, print_function
import numpy as np
from itertools import product
from sklearn.utils.testing import assert_raises, assert_raises_regex
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_equa... | mbayon/TFG-MachineLearning | venv/lib/python3.6/site-packages/sklearn/metrics/tests/test_regression.py | Python | mit | 8,058 |
###############################################################################
# volumina: volume slicing and editing library
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# modify it und... | jakirkham/volumina | volumina/view3d/slicingPlanesWidget.py | Python | lgpl-3.0 | 6,085 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | mahak/neutron | neutron/db/uplink_status_propagation_db.py | Python | apache-2.0 | 1,393 |
#!/usr/bin/python
#
# (c) 2016 Olaf Kilian <olaf.kilian@symanex.com>
# Chris Houseknecht, <house@redhat.com>
# James Tanner, <jtanner@redhat.com>
#
# 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_func... | kvar/ansible | lib/ansible/modules/cloud/docker/docker_login.py | Python | gpl-3.0 | 11,588 |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm, colors
import sys
if len(sys.argv) == 1:
infile = sys.stdin
else:
infile = open(sys.argv[1])
data = np.genfromtxt(infile, dtype=None, delimiter='\t', names=True)
agents = np.unique(data['agent'])
scalarMap = cm.ScalarMappable(
... | metcalf/loadsim | display.py | Python | mit | 803 |
from pajbot.apiwrappers.base import BaseAPI
class TwitchTMIAPI(BaseAPI):
def __init__(self):
super().__init__(base_url="https://tmi.twitch.tv/")
def get_chatter_logins_by_login(self, login):
response = self.get(["group", "user", login, "chatters"])
# response =
# {
# ... | pajlada/pajbot | pajbot/apiwrappers/twitch/tmi.py | Python | mit | 1,536 |
from tests import LimitedTestCase, main
import eventlet
from eventlet import event
def do_bail(q):
eventlet.Timeout(0, RuntimeError())
try:
result = q.get()
return result
except RuntimeError:
return 'timed out'
class TestQueue(LimitedTestCase):
def test_send_first(self):
... | Cue/eventlet | tests/queue_test.py | Python | mit | 9,929 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from jinja2 import Template
import sys
tmpl = """
{% for link in links %}
{{ loop.index0 }}: <a href="{{link.href}}">{{link.name}}</a>
{{ loop.index }}: <a href="{{link.href}}">{{link.name}}</a>
{% endfor %}
"""
if __name__ == '__main__':
links = [
{'name': 'Google'... | siongui/userpages | content/code/python-jinja2-vs-go-html-template/jinja2-example-3.py | Python | unlicense | 485 |
import catmaid.fields
import django.contrib.postgres.functions
from django.db import migrations
class Migration(migrations.Migration):
"""Update the default values for most timestamp fields so that the
database's transaction start time is used (CURRENT_TIMESTAMP or now()). This
doesn't include any actual ... | tomka/CATMAID | django/applications/catmaid/migrations/0100_update_timestamp_field_default_values.py | Python | gpl-3.0 | 21,115 |
from bibliopixel.drivers.network_receiver import NetworkReceiver
from bibliopixel.drivers.visualizer import *
from bibliopixel.led import Strip
#must init with same number of pixels as sender
driver = Visualizer(10)
led = Strip(driver)
receiver = NetworkReceiver(led)
try:
receiver.start(join = True) #join = True... | rec/BiblioPixel | doc/examples/network_receiver_example.py | Python | mit | 412 |
from collections import OrderedDict
from rest_framework import pagination
from rest_framework.response import Response
__author__ = 'alexandreferreira'
class DetailPagination(pagination.PageNumberPagination):
def get_paginated_response(self, data):
return Response(OrderedDict([
('count', sel... | alexandreferreira/namesearch-example | namesearch/pagination.py | Python | gpl-2.0 | 948 |
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | plumgrid/plumgrid-nova | nova/objects/instance.py | Python | apache-2.0 | 22,814 |
import calendar
import json
from datetime import datetime
from time import gmtime, time
from urlparse import parse_qsl, urlparse
from wsgiref.handlers import format_date_time
import jwt
from browserid.errors import ExpiredSignatureError
from django_statsd.clients import statsd
from receipts import certs
from lib.cef_... | andymckay/zamboni | services/verify.py | Python | bsd-3-clause | 14,089 |
from gdsCAD import *
from sys import *
from numpy import *
import argparse
import datetime
now = datetime.datetime.now()
parser = argparse.ArgumentParser(add_help=False,description='Generates the gds for the quantum bus.\nRefer to the pdf file for all the parametrizations')
parser.add_argument('-h', '--help', action='... | McDermott-Group/Simulation | Mask Automation/Qbus.py | Python | gpl-2.0 | 4,026 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Country'
db.create_table(u'countries_country', (
(u'id', self.gf('django.db.mode... | bennylope/ciafactbook | countries/migrations/0001_initial.py | Python | bsd-2-clause | 4,472 |
#!/usr/bin/env python
'''Translate new cache url format into human readable airport codes
based on Maurizio M. Munafo perl code:
$name =~ tr/0-9a-z/uzpkfa50vqlgb61wrmhc72xsnid83ytoje94/;
'''
import re
from string import maketrans, lowercase
import sys
import os
import logging
from optparse import OptionParser, SU... | Jamlum/pytomo | pytomo/translation_cache_url.py | Python | gpl-2.0 | 4,763 |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# ... | supermari0/ironic | ironic/drivers/modules/fake.py | Python | apache-2.0 | 5,430 |
#!/usr/bin/env python2
"""
richardson_extrapolation.py
Author: Jonah Miller (jonah.maxwell.miller@gmail.com)
Time-stamp: <2014-01-18 00:48:47 (jonah)>
This program takes tensor ascii output from the einstein toolkit and
runs a Richardson extrapolation on the data to extract the convergence
order, the error factor due... | Yurlungur/cactus_scripts | richardson_extrapolation.py | Python | gpl-2.0 | 13,741 |
import datetime
import os
import uuid
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
import reversion
from markitup.fields import MarkupField
from model_util... | NelleV/pyconfr-test | symposion/proposals/models.py | Python | bsd-3-clause | 5,463 |
from setuptools import setup
setup(name='civic_api_client',
version = '0.2.1',
description = 'Examples and tools for using the CIVIC API',
install_requires = [
'requests',
'flask',
],
entry_points = {
'console_scripts': ['civic-api-client=civic_api_client.com... | griffithlab/civic-api-client | setup.py | Python | mit | 780 |
#!/usr/bin/python
# Copyright 2015 Jacob Welsh
#
# This file is part of Bitnomon; see the README for license information.
"""CLI script and setuptools bridge for running unit tests"""
import sys
import unittest
class Loader(unittest.TestLoader):
"Silly glue class to make setuptools support discovery"
def ... | welshjf/bitnomon | run_unit_tests.py | Python | apache-2.0 | 754 |
from pysound import buffer
from pysound import soundfile
from pysound import oscillators
from pysound import envelopes
from pysound.const import Notes as N
params = buffer.BufferParams()
env = envelopes.attack_decay(params, attack=params.t2s(0.01))
data = oscillators.sine_wave(params, frequency=N.C4, amplitude=env)
s... | martinmcbride/pysound | examples/envelopes.py | Python | mit | 365 |
"""
This file contains a minimal set of tests for compliance with the extension
array interface test suite, and should contain no other tests.
The test suite for the full functionality of the array is located in
`pandas/tests/arrays/`.
The tests in this file are inherited from the BaseExtensionTests, and only
minimal ... | pandas-dev/pandas | pandas/tests/extension/test_categorical.py | Python | bsd-3-clause | 9,969 |
# Copyright 2012-2017, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Toolkit for various string activity.
.. versionchanged:: 1.3.0
Dropped the get_* prefix from several function names. The old names still
work, but are deprecated aliases.
**Module Overview:**
::
crop - sho... | ewongbb/stem | stem/util/str_tools.py | Python | lgpl-3.0 | 17,033 |
##########################################################################
#
# Copyright (c) 2013-2014, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | goddardl/gaffer | python/GafferRenderManTest/RenderManRenderTest.py | Python | bsd-3-clause | 21,235 |
#!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... | nuclear-wizard/moose | python/peacock/tests/peacock_app/check_add_variables_and_blocks/test_AddVariableAndBlock.py | Python | lgpl-2.1 | 4,486 |
from .client import AsyncKernelClient
| sserrot/champion_relationships | venv/Lib/site-packages/jupyter_client/asynchronous/__init__.py | Python | mit | 38 |
#!/usr/bin/env python
""" testeven.py: Demonstrate Nose.
"""
def test_evens():
"""Test method check_even."""
for i in range(0, 5):
yield check_even, i, i * 3
def check_even(val1, val2):
"""Determine if either of numbers is even."""
assert val1 % 2 == 0 or val2 % 2 == 0
| showa-yojyo/notebook | source/_sample/nose/testeven.py | Python | mit | 296 |
"""Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions a... | ericlink/adms-server | playframework-dist/play-1.1/python/Lib/distutils/sysconfig.py | Python | mit | 19,643 |
# -*- coding: utf-8 -*-
# Author: Florian Mayer <florian.mayer@bitsrc.org>
#
# This module was developed with funding provided by
# the ESA Summer of Code (2011).
#
# pylint: disable=C0103,R0903
"""
Attributes that can be used to construct VSO queries. Attributes are the
fundamental building blocks of queries that, to... | jslhs/sunpy | sunpy/net/vso/attrs.py | Python | bsd-2-clause | 9,455 |
from __future__ import unicode_literals
from django.db import migrations
from django.contrib.postgres.operations import HStoreExtension
class Migration(migrations.Migration):
dependencies = [
('product', '0020_attribute_data_to_class'),
]
operations = [
HStoreExtension(),
]
| tfroehlich82/saleor | saleor/product/migrations/0021_add_hstore_extension.py | Python | bsd-3-clause | 312 |
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003-2005 The GemRB Project
#
# 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 2
# of the License, or (at your opt... | Tomsod/gemrb | gemrb/GUIScripts/iwd/CharGen.py | Python | gpl-2.0 | 92,820 |
import sys
sys.path.append('../')
from pyhparser.grammar import Grammar
from pyhparser.classParser import ClassParser
from pyhparser.utils import *
class Pyhparser:
def __init__(self, inputText, parseText, classes = [], stringConnector = " "): #constructor
self.inputText = inputText #the inp... | msramalho/pyhparser | pyhparser/pyhparser.py | Python | mit | 5,442 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.random_forest import H2ORandomForestEstimator
def rf_mean_residual_deviance():
cars = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars_20mpg.csv"))
s = cars[0].runif()
train = cars[s > 0.2]
... | madmax983/h2o-3 | h2o-py/tests/testdir_algos/rf/pyunit_mean_residual_devianceRF.py | Python | apache-2.0 | 1,387 |
#!/usr/bin/python
import mock
import sys
class SecurityTest(mock.TestCase):
def setUp(self):
self.setupModules(["_isys", "block", "ConfigParser"])
self.fs = mock.DiskIO()
import pyanaconda.security
pyanaconda.security.log = mock.Mock()
pyanaconda.security.open = self.fs.o... | mattias-ohlsson/anaconda | tests/pyanaconda_test/security_test.py | Python | gpl-2.0 | 2,807 |
alph = "abcdefghijklmnopqrstuvwxyz"
freq = [0.082, 0.015, 0.028, 0.043, 0.127, 0.022, 0.020, 0.061, 0.070, 0.002, 0.008, 0.040, 0.024, 0.067,
0.075, 0.018, 0.001, 0.060, 0.063, 0.091, 0.028, 0.010, 0.023, 0.001, 0.020, 0.001]
def keySize(ct):
l = [0]
sz = len(ct)
for s in range(1,11):
ct_ = ct[-s:]+ct[:-s]
co... | GnsP/NetSec | crypto/attacks/vigenereFriedmanAttack.py | Python | gpl-3.0 | 1,212 |
"""Helper functions for mysensors package."""
from collections import defaultdict
import logging
import voluptuous as vol
from homeassistant.const import CONF_NAME
from homeassistant.core import callback
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistan... | aequitas/home-assistant | homeassistant/components/mysensors/helpers.py | Python | apache-2.0 | 5,210 |
"""
@file
@brief provides some functionalities to upload file to a website
"""
from ftplib import FTP, FTP_TLS, error_perm
import os
import sys
import time
import datetime
from io import BytesIO
from ..loghelper.flog import noLOG
class CannotReturnToFolderException(Exception):
"""
raised when a transfer is in... | sdpython/pyquickhelper | src/pyquickhelper/filehelper/ftp_transfer.py | Python | mit | 17,132 |
# Copyright 2021 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | keras-team/keras | keras/integration_test/tf_trt_test.py | Python | apache-2.0 | 2,379 |
"""
Take multiple crops from an image and combine the results, in an attempt to boost mAP.
"""
from matplotlib import pyplot as plt
from scipy.misc import imresize
import json
import numpy as np
import os
import sys
import tensorflow as tf
import time
import model
import patch_utils
DEBUG = False
def single_image_... | gvanhorn38/inception | v3/detection/dense_test.py | Python | mit | 11,697 |
# Flexlay - A Generic 2D Game Editor
# Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.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
# the Free Software Foundation, either version 3 of the License, or
# (at your option)... | Karkus476/flexlay | tests/test_sexpr.py | Python | gpl-3.0 | 4,985 |
from unittest import TestCase
from spockbot.mcdata import constants
from spockbot.plugins.helpers.clientinfo import PlayerPosition
from spockbot.plugins.helpers.interact import InteractPlugin
from spockbot.vector import Vector3
class DataDict(dict):
def __init__(self, **kwargs):
super(DataDict, self).__i... | Gjum/SpockBot | tests/plugins/helpers/test_interact.py | Python | mit | 6,627 |
"""Provides interface to classification with the model."""
import os
import numpy as np
import torch
from . import models
from .preprocessing import ImageDataPipeline
def predicted_label(prediction_tensor,
label_dict):
"""
Generates the predicted label by comparing the tensor prediction... | MarxSoul55/cats_vs_dogs | cats_vs_dogs/src/pytorch_impl/src/classify.py | Python | apache-2.0 | 3,120 |
# Spacewalk Proxy Server SSL Redirect handler code.
#
# Copyright (c) 2008--2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FO... | dmacvicar/spacewalk | proxy/proxy/redirect/rhnRedirect.py | Python | gpl-2.0 | 17,780 |
#!/usr/bin/env python
# Copyright (c) 2016 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.
"""Bootstrap script to clone and forward to the recipe engine tool.
*************************************************************... | geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/infra/recipes.py | Python | gpl-3.0 | 5,014 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-21 21:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api_v2', '0008_auto_20170101_0105'),
]
operations = [
migrations.AddField(
... | AstroMatt/esa-subjective-time-perception | backend/api_v2/migrations/0009_trial_is_valid.py | Python | mit | 496 |
"""
Project Euler Problem 8: https://projecteuler.net/problem=8
Largest product in a series
The four adjacent digits in the 1000-digit number that have the greatest
product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
8586... | TheAlgorithms/Python | project_euler/problem_008/sol2.py | Python | mit | 3,204 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
import time
BUTTON_PIN=40
def stisknuto_callback(channel):
print "Tlačítko bylo stisknuto"
def main():
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.cleanup()
GPIO.setup(BUTTON_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
print "Tlačít... | HellTech/NAG_IoE_2016 | 30_HellTech_1512_1/03_tlacitko/03_event_detect.py | Python | gpl-3.0 | 694 |
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase
class TestSaleTermsTemplate(TransactionCase):
def setUp(self):
super().setUp()
self.term_template = self.env["sale.terms_template"].create(
{
"name": "My terms... | OCA/sale-workflow | sale_order_note_template/tests/test_sale_terms_template.py | Python | agpl-3.0 | 1,139 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <ale... | BT-rmartin/partner-contact | base_location/__openerp__.py | Python | agpl-3.0 | 1,880 |
import random
import math
import DiscreteCS as dcs
from matplotlib import pyplot as plt
random.seed(128392)
# LIMIT = 100000
LIMIT = 1000
def update_temperature(T, k):
return T - 0.001
def get_neighbors(i, L):
assert L > 1 and i >= 0 and i < L
if i == 0:
return [1]
elif i == L - 1:
r... | rogovski/WscuCalcIII | sim_anneal/main2.py | Python | mit | 2,400 |
import wx
import wx.html
import webbrowser
class FlowAbout(wx.Dialog):
text = '''
<html>
<body bgcolor="#eeeeee">
<center><table bgcolor="#ff9900" width="100%" cellspacing="0"
cellpadding="0" border="1">
<tr>
<td align="center"><h1>Flow!</h1></td>
</tr>
</table>
</center>
<p><b>Flow</b> is a program... | cliburn/flow | src/about.py | Python | gpl-3.0 | 1,574 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-05-05 17:07
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('servico', '0061_Interacao_classificacao'),
]
operations = [
migrations.RenameField... | anselmobd/fo2 | src/servico/migrations/0062_evento_edita_classificacao.py | Python | mit | 452 |
import caffe
import numpy as np
from scipy.ndimage import zoom
import theano
import theano.tensor as T
import cPickle
from krahenbuhl2013 import CRF
min_prob = 0.0001
class SoftmaxLayer(caffe.Layer):
def setup(self, bottom, top):
if len(bottom) != 1:
raise Exception("Need two inputs to ... | kolesman/SEC | pylayers/pylayers/pylayers.py | Python | mit | 7,078 |
# Copyright (c) 2015 FUJITSU LIMITED
# Copyright (c) 2012 EMC Corporation.
# Copyright (c) 2012 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 Licen... | eharney/cinder | cinder/volume/drivers/fujitsu/eternus_dx_common.py | Python | apache-2.0 | 85,493 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.