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 |
|---|---|---|---|---|---|
import sys
import shlex
import platform
from time import strftime
import traceback
import socket
if __name__ == '__main__':
sys.path.insert(0, '/netapp/home/klabqb3backrub/pythonlibs/')
from klab.process import Popen_raw
def make_simple_xml_open_tag(tagname, attributes = {}):
attstring = ""
if attribute... | Kortemme-Lab/klab | klab/cluster/info.py | Python | mit | 2,287 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2013 Spotify AB
#
# 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 requ... | pombredanne/sparkey-python | test/binary_test.py | Python | apache-2.0 | 2,128 |
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Verge test f... | vergecurrency/VERGE | test/functional/test_framework/messages.py | Python | mit | 38,458 |
# *****************************************************************************
# Copyright (c) 2020, Intel Corporation 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 sou... | IntelLabs/hpat | examples/series_iloc/series_iloc_slice.py | Python | bsd-2-clause | 1,781 |
#
# I'd rather use pipx to install things outside of a virtualenv
#
from thefuck.utils import for_app
from thefuck.specific.sudo import sudo_support
needs_venv_strings = [
"""ERROR: Could not find an activated virtualenv (required)."""
]
@sudo_support
@for_app("pip", "pip3")
def match(command):
return "insta... | rpdelaney/dotfiles | home/.config/thefuck/rules/pip2pipx.py | Python | gpl-3.0 | 564 |
from dotmap import DotMap
TEST_SERVICES = [DotMap({
'name': sname,
'host': 'host_{}'.format(sname),
'port': str(101 + i),
}) for i, sname in enumerate(('1', '2', '3'))]
| flypenguin/python-rancon | test/test_data.py | Python | mit | 182 |
from OpenGLCffi.GL import params
@params(api='gl', prms=['target', 'id', 'pname', 'param'])
def glQueryObjectParameteruiAMD(target, id, pname, param):
pass
| cydenix/OpenGLCffi | OpenGLCffi/GL/EXT/AMD/occlusion_query_event.py | Python | mit | 159 |
from django.db import models
from django.core.urlresolvers import reverse
from jsonfield import JSONField
import collections
# Create your models here.
class YelpvisState(models.Model):
title=models.CharField(max_length=255)
slug=models.SlugField(unique=True,max_length=255)
description = models.CharField(max_lengt... | intuinno/vistalk | yelpvis/models.py | Python | mit | 881 |
from __future__ import division, absolute_import, print_function
import numpydoc.plot_directive
# No tests at the moment...
| AdaptiveApplications/carnegie | tarc_bus_locator_client/numpy-1.8.1/doc/sphinxext/numpydoc/tests/test_plot_directive.py | Python | mit | 126 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contrib... | odoousers2014/odoo | addons/l10n_hr/__init__.py | Python | agpl-3.0 | 1,096 |
#!/usr/bin/python
# gunakan perintah python portfwd [port asal] [port tujuan]
# methode di bawah ini maksudnya kalau ada methode yang kebawa akan di hapus
import socket,asyncore,sys
methode=['CONNECT','HEAD','GET','DELETE','POST','OPTIONS','PUT','TRACE']
class forwarder(asyncore.dispatcher):
def __init__(... | micky24/debian7os | portfwd.py | Python | gpl-3.0 | 2,956 |
# coding=utf-8
"""
Tests for digital signatures used to validate messages to/from credit providers.
"""
from nose.plugins.attrib import attr
from django.test import TestCase
from django.test.utils import override_settings
from openedx.core.djangoapps.credit import signature
@attr('shard_2')
@override_settings(CRE... | solashirai/edx-platform | openedx/core/djangoapps/credit/tests/test_signature.py | Python | agpl-3.0 | 1,731 |
#!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Train&Test a Fast R-CNN network on an image d... | zimenglan-sysu-512/pose_action_caffe | tools/train_test_action_net.py | Python | mit | 4,350 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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) any ... | kaplun/inspire-next | inspirehep/modules/authors/views.py | Python | gpl-3.0 | 13,517 |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 Yahoo! 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.apache.org/licenses/LICENSE-2... | junneyang/taskflow | taskflow/exceptions.py | Python | apache-2.0 | 11,224 |
# Created by zaizai at 2017/9/26
from datetime import datetime, timedelta;
from pymongo import MongoClient, errors;
from com.anjie.utils.elog import Elog;
from com.anjie.mode.e_request import ERequest;
import pickle
from bson.binary import Binary
import zlib;
class MongoQueue:
# OUTSTANDING 未完成的,PROCESSING处理中,COM... | anzaizai/EasySpider | com/anjie/mode/MongoQueue.py | Python | apache-2.0 | 2,334 |
# -*- coding: utf-8 -*-
positions = set([u"პარტნიორი",
u"შეზღუდული პარტნიორები",
u"სრული პარტნიორები",
u"ხელმძღვანელი",
u"კომანდიტი",
u"კომპლემენტარი",
u"დამფუძნებელი/დამფუძნებლები",
u"დირექტორი",
u"წარმომადგენელი",
... | tigeorgia/GeorgiaCorporationScraper | registry/terms.py | Python | mit | 18,013 |
"""
Given a string which consists of lowercase or uppercase letters, find the length
of the longest palindromes that can be built with those letters.
This is case sensitive, for example "Aa" is not considered a palindrome here.
Note:
Assume the length of given string will not exceed 1,010.
Example:
Input:
"... | ufjfeng/leetcode-jf-soln | python/409_longest_palindrome.py | Python | mit | 965 |
from .gpu import *
from metaomr import forest, components, music
import copy
import music21
CMAJOR = dict((n + 'n', n + 'n') for n in list('abcdefg'))
class PitchState:
""" Stores clef, key signature, and accidental information """
BASS = 50 # middle staff line is D3
TREBLE = 71 # middle staff line is B4
... | ringw/MetaOMR | metaomr/note.py | Python | gpl-3.0 | 6,848 |
#
# 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 us... | nchammas/spark | python/pyspark/mllib/regression.py | Python | apache-2.0 | 33,400 |
# Copyright 2017 Capital One Services, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | jimmyraywv/cloud-custodian | tests/test_ecr.py | Python | apache-2.0 | 5,347 |
"""Home Assistant command line scripts."""
import importlib
import os
def run(args):
"""Run a script."""
scripts = [fil[:-3] for fil in os.listdir(os.path.dirname(__file__))
if fil.endswith('.py') and fil != '__init__.py']
if not args:
print('Please specify a script to run.')
... | deisi/home-assistant | homeassistant/scripts/__init__.py | Python | mit | 642 |
#!/usr/bin/env python
import sys
# import particle restart
sys.path.append('../../src/utils')
import particle_restart as pr
# read in particle restart file
if len(sys.argv) > 1:
p = pr.Particle(sys.argv[1])
else:
p = pr.Particle('particle_12_842.binary')
# set up output string
outstr = ''
# write out pro... | shenqicang/openmc | tests/test_particle_restart_eigval/results.py | Python | mit | 1,055 |
import serial
import array
class ICSC:
port = 0
station = 0
rxstate = 0
rxsoh = 0
rxdestination = 0
rxsource = 0
rxcommand = 0
rxlen = 0
rxsot = 0
rxcs = 0
rxdata = array.array('B')
rxgot = 0
rxcsin = 0
functions = {}
def begin(self, port, baud, station):
self.port = serial.Serial(port = port, baud... | MajenkoLibraries/ICSC | other/python/ICSC.py | Python | bsd-3-clause | 2,362 |
from django.contrib import admin
from zds.forum.models import ForumCategory, Forum, Post, Topic, TopicRead
class TopicAdmin(admin.ModelAdmin):
list_display = ("title", "author", "forum", "pubdate")
list_filter = ("is_locked", "is_sticky")
raw_id_fields = ("forum", "author", "last_message", "tags", "solve... | ChantyTaguan/zds-site | zds/forum/admin.py | Python | gpl-3.0 | 1,098 |
#!/usr/bin/env python
import argparse
import os
import subprocess
import sys
from lib.config import MIPS64EL_GCC, get_target_arch, build_env
from lib.util import electron_gyp, import_vs_env
CONFIGURATIONS = ['Release', 'Debug']
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
VENDOR_DIR = o... | Floato/electron | script/build.py | Python | mit | 2,585 |
# # -*- coding: utf-8 -*-
| Lamzin/orpheus | recognizer/__init__.py | Python | gpl-3.0 | 26 |
from flask import Flask
from flask import render_template
from flask import Markup
import markdown
app = Flask(__name__)
@app.route("/")
@app.route("/<name>")
def hello(name=None):
f = open('README.md', 'r')
htmlmarkdown=f.read()
content = Markup(markdown.markdown(htmlmarkdown))
return render_template... | xkid/learn-flask-online | main.py | Python | mit | 413 |
"""
Tests for Version Based App Upgrade Middleware
"""
from datetime import datetime
import ddt
import mock
from django.core.cache import caches
from django.http import HttpRequest, HttpResponse
from pytz import UTC
from mobile_api.middleware import AppVersionUpgrade
from mobile_api.models import AppVersionConfig
fro... | miptliot/edx-platform | lms/djangoapps/mobile_api/tests/test_middleware.py | Python | agpl-3.0 | 7,969 |
from .app import IOTileApp
__all__ = ['IOTileApp']
| iotile/coretools | iotilecore/iotile/core/hw/app/__init__.py | Python | gpl-3.0 | 52 |
# Copyright 2005-2006 Daniel Henninger <jadestorm@nc.rr.com>
# Licensed for distribution under the GPL version 2, check COPYING for details
import utils
from twisted.words.xish.domish import Element
from twisted.words.protocols.jabber.jid import internJID
from debug import LogEvent, INFO, WARN, ERROR
import config
imp... | Alwnikrotikz/pyicqt | src/legacy/services/EmailLookup.py | Python | gpl-2.0 | 4,342 |
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
from django.http import HttpResponseRedirect
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
]
urlpatterns += i18n_patterns(
url(r'^$', lambda r: HttpResponseRedirect('gymnasti... | saechtner/turn-events | Turnauswertung-py3/Turnauswertung/urls.py | Python | mit | 666 |
"""
WSGI config for maio project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
import sys
import site
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "maio.settings")
... | jonmsawyer/maio | maio/wsgi.py | Python | mit | 1,643 |
# Formats number values into dollar currency
# e.g. 123690 is changed to $123,690M
def format_currency(value):
return "${:,}".format((round((value),-4)))
| MonicaHsu/truvaluation | app/templates/filters.py | Python | mit | 158 |
'''
Use Case: Exploring the Concept of Serializing and De-Serializing in Python
Shortly called as pickling, the needs is to store the object and later resurrect it
----> Use dump for serializing the records into a file
----> Use dumps for serializing the records into a string
---->... | arunchandramouli/fanofpython | code/features/classes/serialize.py | Python | gpl-3.0 | 2,846 |
import re
import itertools
from lxml import html
from scrapy.http.request.form import _get_inputs
class GenericForm:
def __init__(self, **kwargs):
self.kwargs = kwargs
def _pick_node(self, doc, selector):
nodes = doc.xpath(selector['xpath'])
if nodes:
return nodes[0]
... | CENDARI/portia | slybot/slybot/generic_form.py | Python | bsd-3-clause | 2,782 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('atados_core', '0052_uploadedimage'),
]
operations = [
migrations.AddField(
model_name='uploadedimage',
... | atados/api | atados_core/migrations/0053_auto_20160728_1309.py | Python | mit | 687 |
# -*- coding: utf-8 -*-
"""The base16 decoder object implementation."""
import base64
from dfvfs.encoding import decoder
from dfvfs.encoding import manager
from dfvfs.lib import definitions
from dfvfs.lib import errors
class Base16Decoder(decoder.Decoder):
"""Class that implements a base16 decoder using base64.""... | manashmndl/dfvfs | dfvfs/encoding/base16_decoder.py | Python | apache-2.0 | 1,090 |
# -*- coding:Utf-8 -*-
import numpy as np
import scipy as sp
import time
import pdb
import os
import sys
import pickle as pk
import matplotlib.pyplot as plt
from matplotlib.collections import PolyCollection # scenario CDF mode 3D
from matplotlib.colors import colorConverter # scenario CDF mode 3D
from pylayers.l... | pylayers/pylayers | pylayers/location/geometric/Scenario_base.py | Python | mit | 39,343 |
from uuid import uuid4
import boto
import os
import os.path
from flask import current_app as app
from werkzeug.utils import secure_filename
from boto.s3.key import Key
from mimetypes import MimeTypes
def s3_upload(source_file, acl='public-read'):
""" Uploads WTForm File Object to Amazon S3
Exp... | Mouleshwar/Flask-S3-Uploader | tools.py | Python | mit | 2,245 |
import random
import math
import scipy.stats
class SlotMachine(object):
pass
class BernoulliMachine(SlotMachine):
def __init__(self, theta=.5):
self.theta = theta
def pull(self):
r = random.random();
if r<=self.theta:
return 1
return 0
def expected_payo... | eowagner/python-bandit-problems | slot_machines.py | Python | mit | 905 |
import click
import codecs
import json
import subprocess
from music21 import note, stream
from constants import *
@click.command()
@click.option('-i', '--infile', type=click.File('rb'), default=SCRATCH_DIR + '/concat_corpus.txt')
@click.option('-o', '--outdir', type=click.Path(exists=True), default=SCRATCH_DIR)
def ... | feynmanliang/bachbot | scripts/torch_rnn.py | Python | mit | 2,097 |
"""URLs for local development of the reverification block. """
from django.conf.urls import include, patterns, url
from django.contrib import admin
import workbench.urls
import stub_verification.urls
admin.autodiscover()
urlpatterns = patterns(
'',
# Django built-in
url(r'^admin/', include(admin.site.u... | GbalsaC/bitnamiP | venv/src/edx-reverification-block/urls.py | Python | agpl-3.0 | 507 |
from Logger import zMQLogger
from time import sleep
A = zMQLogger()
A.addLocalPort("10101") # GPS1->GPSNav
A.addLocalPort("10102") # GPS2->GPSNav
A.addLocalPort("10105") # GPSNav->Main
A.addLocalPort("10110") # Main->GPSNav & GPS1 & GPS2
A.addLocalPort("10201") # Mbed->Main
A.addLocalPort("10210") # Main->Mbed
A.ad... | TeaPackCZ/RobotZed | zmqLogger.py | Python | mit | 375 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2015 CERN.
##
## Invenio 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) a... | dset0x/invenio-checker-old | invenio_checker/checkerext/checks/testsuite/test_scoap3_find_erratum.py | Python | gpl-2.0 | 3,172 |
#!/usr/bin/env python
import cgi
import os
import subprocess
import socket
import fcntl
import struct
import SocketServer
import sys
import time
import urllib
from SimpleHTTPServer import SimpleHTTPRequestHandler
from StringIO import StringIO
PROG_VER = "ver 11.00 written by Claude Pageau"
'''
SimpleHTTPServer pytho... | pageauc/pi-timolo | source/webserver.py | Python | mit | 12,615 |
import urllib.request
import urllib.parse
params = urllib.parse.urlencode({'fname': 'Green', 'lname': 'Adams', 'exp': '24'})
binary_data = params.encode('utf-8')
f = urllib.request.urlopen("http://sweb.uky.edu/~sra258/Chart/samples/insertpy1.php", binary_data)
print(f.read()) | rsangeetha28/Radiation-Dosage-Tracking-System | samples/sample.py | Python | mit | 277 |
#--
# Copyright (c) 2012-2014 Net-ng.
# All rights reserved.
#
# This software is licensed under the BSD License, as described in
# the file LICENSE.txt, which you should have received as part of
# this distribution.
#--
import url
from .components_repository import Service
from .services_repository import ServicesRe... | droodle/kansha | kansha/services/__init__.py | Python | bsd-3-clause | 378 |
from os.path import join
from setuptools import find_packages, setup
def get_version_and_cmdclass(package_path):
"""Load version.py module without importing the whole package.
Template code from miniver
"""
import os
from importlib.util import module_from_spec, spec_from_file_location
spec ... | menpo/landmarkerio-server | setup.py | Python | bsd-3-clause | 1,606 |
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | liuluheng/codereading | lemon/.ycm_extra_conf.py | Python | mit | 5,881 |
#self.select2d(1)
#self.setShifter(0.000040)
#self.left_shift(True)
#self.select2d(0)
#point2d = self.echo_find(True)
#self.auto_phase(point2d)
self.auto_phase()
#self.setShifter(0.000256)
#self.sqr_apodization()
self.setShifter(0.000017)
self.left_shift(True)
self.zerofill()
self.exp_apodization()
self.fourier(Tr... | Pymatteo/QtNMR | script1.py | Python | gpl-3.0 | 340 |
# Copyright (c) 2001-2016, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... | ballouche/navitia | source/jormungandr/tests/stif_tests.py | Python | agpl-3.0 | 7,566 |
from django.conf.urls import patterns, url
from coffees import views
urlpatterns = patterns('',
# GET /api
url(r'^$', views.index, name='coffees_index'),
# POST /api/coffees
url(r'^coffees/$', views.create, name='coffees_create'),
# GET /api/<username>
url(r'^(?P<username>[\w-]+)/$', views.detail, name='coffees_... | chrisenytc/coffy | coffees/urls.py | Python | mit | 331 |
# This is a template config file for jetperf production
config = {
"datazilla_urls": ['http://10.8.73.32/jetperf/load_test'],
"exes": {
'python': '/tools/buildbot/bin/python',
'virtualenv': ['/tools/buildbot/bin/python', '/tools/misc-python/virtualenv.py'],
},
"find_links": ["http://... | ctalbert/mozharness | configs/jetperf/prod_config.py | Python | mpl-2.0 | 614 |
#Code that plots the RR reconstruction to the spectrum , including the RR fit and the best
#fit solution to the problem in real space
###################################################################
#Import modules
import matplotlib
matplotlib.use('agg')
import emcee_1
import matplotlib.pyplot as plt
import cPickle... | elizabethswann/RR_fitter | codes/plot_spectrum.py | Python | mit | 6,288 |
"""
A module to handle translations, using Christopher Gohlke's transforms3d as far
as possible, but also trying to respect the intent of the algorithms used in
OpenStudio for the sake of consistency between tools based on EnergyPlus.
"""
from typing import Any, Optional, Union # noqa
import numpy as np
from transf... | jamiebull1/geomeppy | geomeppy/geom/transformations.py | Python | mit | 4,416 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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) any later version.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/ocil_2_0/NumericQuestionTestActionElement.py | Python | gpl-3.0 | 972 |
#!/usr/bin/python2.7
#coding:utf-8
import logging
import multiprocessing
from dummy import BASEDIR
from autoProxyRequests_class import AutoProxyRequests
# 主进程
# ListenTask子进程 TaskDeal子进程
# SubTarget子进程
# SubRunPlugin子进程
#
# server info
# 主进程中初始化之后,不需要修改
server = ''
token = ''
#
... | GHubgenius/Hammer | lib/globalVar.py | Python | gpl-2.0 | 2,546 |
'''
This programs runs LOFAR regressions tests in a standalone fashion.
Usage: regression_test_runner.py pipeline_type
Run the regressions test for pipeline_type. Perform the work on host1 and host2 (default localhost)
pipeline_type select any one of:
msss_calibratior_pipeline
msss_target_pipeline
msss_... | jjdmol/LOFAR | CEP/Pipeline/test/regression_tests/regression_test_runner.py | Python | gpl-3.0 | 14,183 |
#encoding=utf-8
from __future__ import print_function
import sys
sys.path.append("../")
import jieba
import jieba.posseg as pseg
words=pseg.cut("又跛又啞")
for w in words:
print(w.word,w.flag)
| scmsqhn/changhongmall | jieba-0.38/test/test_bug.py | Python | mit | 209 |
__author__ = 'Roman Arkharov'
from twisted.web.resource import Resource
from pymongo import MongoClient
import simplejson as json
class LeaderboardsWebserver(Resource):
isLeaf = True
def __init__(self, db_name, db_host, db_port):
self.db_name = db_name
self.db_host = db_host
... | romka/leaderboards-server | http_responder.py | Python | mit | 2,074 |
from __future__ import division
import datetime
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http.response import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.views.generic.base import TemplateView
from card... | DummyDivision/Tsune | deckglue/views.py | Python | mit | 5,360 |
"""Tests that the IPython printing module is properly loaded. """
from sympy.core.compatibility import u
from sympy.interactive.session import init_ipython_session
from sympy.external import import_module
from sympy.utilities.pytest import raises
# run_cell was added in IPython 0.11
ipython = import_module("IPython",... | kaichogami/sympy | sympy/interactive/tests/test_ipythonprinting.py | Python | bsd-3-clause | 6,263 |
'''
Add in /edx/app/edxapp/edx-platform/lms/envs/aws.py:
ORA2_SWIFT_URL = AUTH_TOKENS["ORA2_SWIFT_URL"]
ORA2_SWIFT_KEY = AUTH_TOKENS["ORA2_SWIFT_KEY"]
Add in /edx/app/edxapp/lms.auth.json
"ORA2_SWIFT_URL": "https://EXAMPLE",
"ORA2_SWIFT_KEY": "EXAMPLE",
ORA2_SWIFT_KEY should correspond to Meta Temp-Url-Key configure ... | Stanford-Online/edx-ora2 | openassessment/fileupload/backends/swift.py | Python | agpl-3.0 | 3,388 |
##
# Copyright (c) 2012-2017 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | macosforge/ccs-calendarserver | txdav/caldav/datastore/scheduling/ischedule/test/test_utils.py | Python | apache-2.0 | 4,568 |
from __future__ import absolute_import
from __future__ import print_function
from .nodes import Node
from ..utils import stringutil
#==============================================================================#
class Selector(Node):
_fields = ('children',)
__slots__ = _fields
def __init__(self, children... | colossalbit/cssypy | cssypy/nodes/selectors.py | Python | bsd-3-clause | 7,631 |
class Config(dict):
def __init__ (self):
self['server'] = 'chat.freenode.com'
self['port'] = 6667
self['debug'] = False
self['verbose'] = False
self['web_host'] = '0.0.0.0'
self['web_port'] = 8080
def __getattr__(self, attr):
try:
return se... | citruspi/ReactIRC | ReactIRC/config.py | Python | mit | 643 |
import requests
import json
import time
import subprocess
import re
import os
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
from test_framework.smtp_server import SMTP_DUMPFILE
class SMTPTest(OpenBazaarTestFramework):
def __init__(self):
... | OpenBazaar/openbazaar-go | qa/smtp_notification.py | Python | mit | 6,891 |
import time
import os
import ContentDb
from Debug import Debug
from Config import config
class ContentDbDict(dict):
def __init__(self, site, *args, **kwargs):
s = time.time()
self.site = site
self.cached_keys = []
self.log = self.site.log
self.db = ContentDb.getContentDb()... | OliverCole/ZeroNet | src/Content/ContentDbDict.py | Python | gpl-2.0 | 4,975 |
#!/usr/bin/env python
"""
UMAP on the MNIST Digits dataset
--------------------------------
A simple example demonstrating how to use UMAP on a larger
dataset such as MNIST. We first pull the MNIST dataset and
then use UMAP to reduce it to only 2-dimensions for
easy visualisation.
Note that UMAP manages to both grou... | lmcinnes/umap | examples/mnist_transform_new_data.py | Python | bsd-3-clause | 1,586 |
# -*- coding: utf-8 -*-
# pylint: disable=C0111,C0103,R0205
import functools
import logging
import json
import pika
from pika.exchange_type import ExchangeType
LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) '
'-35s %(lineno) -5d: %(message)s')
LOGGER = logging.getLogger(__name__)
... | pika/pika | examples/asynchronous_publisher_example.py | Python | bsd-3-clause | 14,507 |
# Copyright (C) 2014 Linaro Limited
#
# Author: Neil Williams <neil.williams@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher 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 ver... | Linaro/lava-dispatcher | lava_dispatcher/test/test_retries.py | Python | gpl-2.0 | 20,396 |
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 1 15:01:22 2017
@author: lancel
"""
import numpy as np
import argparse
import cv2
import os
from imutils import paths
from sklearn.preprocessing import LabelEncoder
from sklearn.cross_validation import train_test_split
from keras.models import Sequential
from keras.laye... | lancezlin/ml_on_lc | CNN/cnn_cat_vs_dog.py | Python | mit | 3,382 |
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import os
from powerline.bindings.vim import vim_getbufoption, buffer_name
def help(matcher_info):
return vim_getbufoption(matcher_info, 'buftype') == 'help'
def cmdwin(matcher_info):
name = buffer... | zeroc0d3/docker-lab | vim/rootfs/usr/lib/python2.7/dist-packages/powerline/matchers/vim/__init__.py | Python | mit | 495 |
from __future__ import print_function, division
import numpy as np
import os
import argparse
import json
from scipy.io.wavfile import read as wavread
from scipy.signal import resample
from features import mfcc
import post_process_rnn_error
import run_rnn
import preprocess
import arguments
from seg_eval import run_ev... | Mandrathax/neural-seg | neural-seg.py | Python | mit | 7,274 |
class FArray:
def __init__(self, size=100):
self.count = 0
self.arr = range(0, size)
# print out fixed array not including blanks
def __str__(self):
return str(self.arr[0:self.count])
# insert value at the end of the unsorted fixed array
def insert(self, value)... | daveho8888/PyData | ds/FixedArray.py | Python | gpl-3.0 | 1,788 |
# Copyright 2011 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.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | scripnichenko/nova | nova/db/sqlalchemy/types.py | Python | apache-2.0 | 2,488 |
#!/usr/bin/python
# The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
#
# This example program shows how to find frontal human faces in an image and
# estimate their pose. The pose takes the form of 68 landmarks. These are
# points on the face such as the corners of the mo... | mkdubik/multinet | multinet/lib/dlib/python_examples/face_landmark_detection.py | Python | gpl-2.0 | 3,808 |
# 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
# distributed under t... | jumpstarter-io/keystone | keystone/contrib/revoke/core.py | Python | apache-2.0 | 9,306 |
from random import randint
from sys import stderr as log_error
import gzip
import datetime
#needed external deps
import pymongo
from pymongo.errors import CollectionInvalid
import bson
class Config(object):
"""
Used to configure the mongodb curator.
Configuration class should only be used directly
wh... | lmco/python-mongor | mongor/__init__.py | Python | mit | 23,999 |
#!/usr/bin/env python
#
# VMEncryption extension
#
# Copyright 2015 Microsoft Corporation
#
# 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
#
... | varunkumta/azure-linux-extensions | VMEncryption/main/CommandExecutor.py | Python | apache-2.0 | 2,709 |
# Copyright 2015 Dustin Spicuzza <dustin@virtualroadside.com>
# 2018 Nikita Churaev <lamefun.x0r@gmail.com>
# 2018 Christoph Reiter <reiter.christoph@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as... | GNOME/pygobject | gi/_gtktemplate.py | Python | lgpl-2.1 | 10,172 |
from midx.notify.common import iter_modified_files
| mikeboers/midx | midx/notify/__init__.py | Python | bsd-3-clause | 51 |
# 係り元の文節と係り先の文節のテキストをタブ区切り形式ですべて抽出せよ.
# ただし,句読点などの記号は出力しないようにせよ.
import ex041
def main():
sentences = ex041.generate_chunks_whole_sentence()
for sentence in sentences:
for chunk in sentence:
dst = chunk.dst
if dst == -1: continue
dst_chunk = sentence[dst]
... | yusekiya/nlp100_2015 | Ch5/ex042.py | Python | gpl-3.0 | 660 |
"""
Experimental module to expose R's math functions (mostly relating to
statistical distributions) via Python's ctypes library.
After downloading the R source code from CRAN, unpack it and do:
./configure --enable-R-static-lib --enable-static --with-readline=no
cd src/nmath/standalone/
make
cp libRma... | iwd32900/powrs | pygr/rmath.py | Python | bsd-3-clause | 4,906 |
"""
LibNix
Copyright (C) 2017 Mark Biciunas
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) any later version.
This program is distributed in th... | mbiciunas/libnix | src/libnix/config/script/run_script.py | Python | gpl-3.0 | 1,491 |
import lsst.sims.maf.db as db
from lsst.sims.maf.viz import MafTracking
trackingDbAddress = "sqlite:///maf_cadence/trackingDb_sqlite.db"
trackingDb = db.TrackingDb(trackingDbAddress=trackingDbAddress)
runlist = MafTracking(trackingDbAddress) | nanchenchen/lsst-comaf | test.py | Python | mit | 242 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.
def readfile(filename):
f = open(filename)
try:
data = f.read(6000)
finally:
f.close()
return data.split()
S = 0
for i in readfile('numbers.txt'):
prin... | anomen-s/programming-challenges | projecteuler.net/0013-Large_sum/solution.py | Python | gpl-2.0 | 392 |
# -*- coding: utf-8 -*-
#
from .common import *
from .django import *
from .encode import *
from .http import *
from .ipip import *
from .crypto import *
| skyoo/jumpserver | apps/common/utils/__init__.py | Python | gpl-2.0 | 155 |
# A revised version of CPython's turtle module written for Brython
#
# Note: This version is not intended to be used in interactive mode,
# nor use help() to look up methods/functions definitions. The docstrings
# have thus been shortened considerably as compared with the CPython's version.
#
# All public methods/func... | brython-dev/brython | www/src/Lib/turtle.py | Python | bsd-3-clause | 51,962 |
# Copyright (c) 2013 Ankur Sethi <contact@ankursethi.in>
# Licensed under the terms of the MIT license.
# See the file LICENSE for copying permissions.
from django.conf.urls import patterns, include, url
from tastypie.api import Api
from tracker.api import TaskResource, WorkSessionResource, \
ApiTokenResource, Pr... | GeneralMaximus/secondhand | secondhand/urls.py | Python | mit | 891 |
import json
import webapp2
from controllers.api.api_base_controller import ApiBaseController
from consts.district_type import DistrictType
from consts.event_type import EventType
from datetime import datetime
from database.event_query import DistrictEventsQuery
from google.appengine.ext import ndb
from database.tea... | synth3tk/the-blue-alliance | controllers/api/api_district_controller.py | Python | mit | 7,325 |
'''
This module provides the exceptions raised by the package, this avoids a cyclic dependancy from being
created between the vaious sub-modules.
'''
class IsamException(Exception):
'General exception raised by ISAM'
class IsamNotOpen(IsamException):
'Exception raised when ISAM table not open'
class IsamOpened(I... | rpmoseley/pyisam | pyisam/error.py | Python | gpl-3.0 | 1,532 |
#!/usr/bin/env python
from setuptools import setup
setup(
name='Judgish',
version='0.1',
description='Analyze and judge the people you follow on Twitter',
license='MIT',
author='Kirk Strauser',
author_email='kirk@strauser.com',
url='https://github.com/kstrauser/judgish',
package_dir={'... | kstrauser/judgish | setup.py | Python | mit | 549 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Ma'
import json
import os
import time
class Config:
config_dir = ""
read_time = 0
config = {}
def __init__(self):
self.config_dir = os.path.join(os.path.dirname(__file__), "config/")
def read(self):
filename = self.conf... | logwood/SLS | config.py | Python | apache-2.0 | 727 |
#
# Copyright (c) 2013 Markus Eliasson, http://www.quarterapp.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) any later version... | ricjon/quarterapp | quarterapp/storage.py | Python | gpl-3.0 | 21,170 |
import os.path
import time
import threading
import cv2
import numpy as np
import logging
logger = logging.getLogger('cscore.storage')
class ImageWriter:
'''
Creates a thread that periodically writes images to a specified
directory. Useful for looking at images after a match has
complete... | Ironpulse/CRC2017 | Cam/imagewriter.py | Python | agpl-3.0 | 4,698 |
# -*- coding: utf-8 -*-
# Copyright (C) 2003 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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 ... | bks/veusz | veusz/windows/mainwindow.py | Python | gpl-2.0 | 53,469 |
# Copyright 2013 Midokura PTE LTD.
# 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 applicable law o... | celebdor/python-midonetclient | src/midonetclient/port.py | Python | apache-2.0 | 4,653 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'clockwork.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| xarus01/clockwork | clockwork/urls.py | Python | apache-2.0 | 278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.