code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#!/usr/bin/python
# 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 version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | evax/ansible-modules-core | cloud/amazon/rds.py | Python | gpl-3.0 | 42,330 |
#!/usr/bin/env python
""" cdecl.py - parse c declarations
(c) 2002, 2003, 2004, 2005 Simon Burton <simon@arrowtheory.com>
Released under GNU LGPL license.
version 0.xx
"""
import string
class Node(list):
" A node in a parse tree "
def __init__(self,*items,**kw):
list.__init__( self, items )
... | jpflori/mpir | yasm/tools/python-yasm/pyxelator/node.py | Python | gpl-3.0 | 8,966 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Lexing error finder
~~~~~~~~~~~~~~~~~~~
For the source files given on the command line, display
the text where Error tokens are being generated, along
with some context.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:licens... | johnny-bui/pygments-sablecc | scripts/find_error.py | Python | bsd-2-clause | 5,593 |
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=20)
def __unicode__(self):
return self.name
class Book(models.Model):
name = models.CharField(max_length=20)
authors = models.ManyToManyField(Author)
def __unicode__(self):
return self.na... | LethusTI/supportcenter | vendor/django/tests/regressiontests/signals_regress/models.py | Python | gpl-3.0 | 323 |
""" Tests for library reindex command """
import ddt
from django.core.management import call_command, CommandError
import mock
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from common.test.utils... | ahmadiga/min_edx | cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py | Python | agpl-3.0 | 6,713 |
# stdlib
import logging
import unittest
# project
from dogstream.cassandra import parse_cassandra
logger = logging.getLogger(__name__)
class TestCassandraDogstream(unittest.TestCase):
def testStart(self):
events = parse_cassandra(logger, " INFO [main] 2012-12-11 21:46:26,995 StorageService.java (line 6... | GabrielNicolasAvellaneda/dd-agent | tests/checks/mock/test_cassandra.py | Python | bsd-3-clause | 5,234 |
#
# QAPI visitor generator
#
# Copyright IBM, Corp. 2011
#
# Authors:
# Anthony Liguori <aliguori@us.ibm.com>
# Michael Roth <mdroth@linux.vnet.ibm.com>
#
# This work is licensed under the terms of the GNU GPLv2.
# See the COPYING.LIB file in the top-level directory.
from ordereddict import OrderedDict
from qapi ... | KernelAnalysisPlatform/KlareDbg | tracers/qemu/decaf/scripts/qapi-visit.py | Python | gpl-3.0 | 6,227 |
"""
Test for User Creation from Micro-Sites
"""
from django.test import TestCase
from student.models import UserSignupSource
import mock
import json
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
FAKE_MICROSITE = {
"SITE_NAME": "openedx.localhost",
"university": "fakeu... | tiagochiavericosta/edx-platform | common/djangoapps/student/tests/test_microsite.py | Python | agpl-3.0 | 3,772 |
# -*- coding: latin-1 -*-
#
# Copyright (C) AB Strakt
# Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
"""
Simple SSL client, using blocking I/O
"""
from OpenSSL import SSL
import sys, os, select, socket
def verify_cb(conn, cert, errnum, depth, ok):
# This obviously has to be updated
print 'Got... | mhnatiuk/phd_sociology_of_religion | scrapper/build/pyOpenSSL/examples/simple/client.py | Python | gpl-2.0 | 1,260 |
class A:
pass
class B(A):
def m(self, x):
"""
Parameters:
x (int): number
"""
return x
| asedunov/intellij-community | python/testData/refactoring/pullup/abstractMethodDocStringIndentationPreserved.py | Python | apache-2.0 | 141 |
#
# This is minimal MicroPython variant of run-tests script, which uses
# .exp files as generated by run-tests --write-exp. It is useful to run
# testsuite on systems which have neither CPython3 nor unix shell.
# This script is intended to be run by the same interpreter executable
# which is to be tested, so should use... | infinnovation/micropython | tests/run-tests-exp.py | Python | mit | 2,697 |
# $Id: 311_srtp1_recv_avp.py 2036 2008-06-20 17:43:55Z nanang $
import inc_sip as sip
import inc_sdp as sdp
sdp = \
"""
v=0
o=- 0 0 IN IP4 127.0.0.1
s=tester
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=crypto:1 AES_CM_128_HMAC_... | lxki/pjsip | tests/pjsua/scripts-sendto/311_srtp1_recv_avp.py | Python | gpl-2.0 | 826 |
""" Test the change_enrollment command line script."""
import ddt
import unittest
from uuid import uuid4
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError
from enrollment.api import get_enrollment
from student.tests.factories import ... | defance/edx-platform | common/djangoapps/enrollment/management/tests/test_enroll_user_in_course.py | Python | agpl-3.0 | 2,563 |
"""engine.SCons.Variables.PackageVariable
This file defines the option type for SCons implementing 'package
activation'.
To be used whenever a 'package' may be enabled/disabled and the
package path may be specified.
Usage example:
Examples:
x11=no (disables X11 support)
x11=yes (will search for the... | xifle/greensc | tools/scons/scons-local-2.0.1/SCons/Variables/PackageVariable.py | Python | gpl-3.0 | 3,612 |
# Copyright 2015, Google 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | kidaa/kythe | third_party/grpc/src/python/src/grpc/framework/common/cardinality.py | Python | apache-2.0 | 1,930 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/distributions/python/kernel_tests/sample_stats_test.py | Python | apache-2.0 | 9,019 |
class MyClass():
@classmethod
def foo_method(cls):
spam = "eggs" | caot/intellij-community | python/testData/refactoring/extractsuperclass/moveAndMakeAbstractImportExistsPy3/source_module.py | Python | apache-2.0 | 80 |
#===- enumerations.py - Python LLVM Enumerations -------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===--------------------------------------------------------------... | vinutah/apps | tools/llvm/llvm_39/opt/bindings/python/llvm/enumerations.py | Python | gpl-3.0 | 4,249 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | diogocs1/comps | web/addons/email_template/wizard/email_template_preview.py | Python | apache-2.0 | 3,851 |
# -*- coding: utf-8 -*-
#
# PyTips documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 26 20:55:10 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | gthank/pytips | docs/source/conf.py | Python | isc | 7,815 |
#!/usr/bin/env python
# coding: utf-8
from .src import *
def plugin_loaded():
distractionless.plugin_loaded(reload=False)
def plugin_unloaded():
distractionless.plugin_unloaded()
| jrappen/sublime-distractionless | main.py | Python | isc | 195 |
"""
This version of julian is currently in development and is not considered stable.
""" | ithinksw/philo | philo/contrib/julian/__init__.py | Python | isc | 89 |
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.6.8 on Thu Apr 2 20:01:32 2015
#
import wx
# begin wxGlade: dependencies
# end wxGlade
# begin wxGlade: extracode
# end wxGlade
class SocketFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: SocketFrame.__init__
kwds["style"] ... | xenobyter/xbWeatherSocket | SocketFrame.py | Python | isc | 3,029 |
# coding=utf-8
import logging; logger = logging.getLogger("robots.introspection")
import threading
introspection = None
# disable introspection for now
if False:
try:
import Pyro4
import Pyro4.errors
uri = "PYRONAME:robots.introspection" # uses name server
try:
introspec... | chili-epfl/pyrobots | src/robots/introspection.py | Python | isc | 885 |
from django.db import models
from django.utils.translation import ugettext as _
from common import models as common_models
from hosts import models as hosts_models
class Project(common_models.TimestampedModel):
name = models.CharField(_('Name'), max_length=254)
description = models.TextField(_('Name'), blank... | mQuadrics/videplo | projects/models.py | Python | mit | 1,122 |
import unittest
from click.testing import CliRunner
from make_dataset import main
class TestMain(unittest.TestCase):
def test_main_runs(self):
runner = CliRunner()
result = runner.invoke(main, ['.', '.'])
assert result.exit_code == 0
| dddTESTxx/Gym-Final | src/data/tests.py | Python | mit | 268 |
# -*- encoding: utf-8 -*-
'''
Created on: 2015
Author: Mizael Martinez
'''
from pyfann import libfann
from login import Login
from escribirArchivo import EscribirArchivo
import inspect, sys, os
sys.path.append("../model")
from baseDatos import BaseDatos
class CtrlEntrenarRNANormalizado:
def __init__(self):
... | martinezmizael/Escribir-con-la-mente | object/entrenarFannNormalizado.py | Python | mit | 5,218 |
from threading import Thread
from flask_mail import Message
from flask import render_template, current_app
from . import mail
from .decorators import async
@async
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, **kwargs):
app = current_app.... | delitamakanda/socialite | app/email.py | Python | mit | 678 |
"""
Useful Utils
==============
"""
from setuptools import setup, find_packages
setup(
name='utilitybelt',
version='0.2.6',
author='Halfmoon Labs',
author_email='hello@halfmoonlabs.com',
description='Generally useful tools. A python utility belt.',
keywords=('dict dictionary scrub to_dict tod... | onenameio/utilitybelt | setup.py | Python | mit | 747 |
# Copyright 2009 Max Klymyshyn, Sonettic
# 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... | Edzvu/Edzvu.github.io | APNSWrapper-0.6.1/APNSWrapper/connection.py | Python | mit | 7,014 |
#This script is for produsing a new list of sites extracted from alexa top site list
import re
prefix = 'http://'
#suffix = '</td><td></td></tr><tr><td>waitForPageToLoad</td><td></td><td>3000</td></tr>'
with open('top100_alexa.txt','r') as f:
newlines = []
for line in f.readlines():
found=re.sub(r'\d+... | gizas/CSS_Extractor | replace.py | Python | mit | 580 |
from flask import Flask
from flask_compress import Compress
from .. import db
app = Flask(__name__)
app.config.from_pyfile('../config.py')
from . import views
Compress(app)
@app.before_first_request
def initialize_database():
db.init_db()
| steinitzu/aptfinder | aptfinder/web/__init__.py | Python | mit | 249 |
#!/usr/bin/env python3
# Copyright (c) 2016 The nealcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Specialized SipHash-2-4 implementations.
This implements SipHash-2-4 for 256-bit integers.
"""
def rotl64... | appop/bitcoin | qa/rpc-tests/test_framework/siphash.py | Python | mit | 2,010 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
#
# Python script to compile and compare locally installed programs with files listed in the repository
# If the file doesn't exist in the repository, delete it, or move it to another folder
#
import os
import platform
import re
import chardet
import argparse
import loggin... | TheShellLand/pies | v3/scripts/clean-repo.py | Python | mit | 1,569 |
#!/usr/bin/python
import RPi.GPIO as GPIO
import subprocess
# Starting up
GPIO.setmode(GPIO.BCM)
GPIO.setup(3, GPIO.IN)
# Wait until power button is off
# Recommended to use GPIO.BOTH for cases with switch
GPIO.wait_for_edge(3, GPIO.BOTH)
# Shutting down
subprocess.call(['shutdown', '-h', 'now'], shell=False)
| UBayouski/RaspberryPiPowerButton | power_button.py | Python | mit | 315 |
import os.path
import pygame.image
import time
import ConfigParser
from helpers import *
from modules import Module
class Animation(Module):
def __init__(self, screen, folder, interval = None, autoplay = True):
super(Animation, self).__init__(screen)
if folder[:-1] != '/':
folder = folder + '/'
self.fold... | marian42/pixelpi | modules/animation.py | Python | mit | 2,315 |
#!/usr/bin/python
import argparse
###basic parser for parent help statement###
def parentArgs():
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
description='''\
Suzanne's pipeline to identify somatic CNVs from single-cell whole-genome sequencing data
=============... | suzannerohrback/somaticCNVpipeline | bin/arguments.py | Python | mit | 9,538 |
import sys
import os
import pkg_resources
VERSION = 0.5
script_path = os.path.dirname(sys.argv[0])
def resource_path(relative_path):
base_path = getattr(sys, '_MEIPASS', script_path)
full_path = os.path.join(base_path, relative_path)
if os.path.isfile(full_path):
return full_path
else:
... | JiapengLi/pqcom | pqcom/util.py | Python | mit | 387 |
#!/usr/bin/env python3
# Copyright (c) 2012-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.
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by... | ftrader-bitcoinabc/bitcoin-abc | share/qt/extract_strings_qt.py | Python | mit | 2,747 |
"""
WSGI config for django_mailing 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.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANG... | Aladom/django-mailing | django_mailing/wsgi.py | Python | mit | 405 |
# -*- coding: utf-8 -*-
#
# Python 101 documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 16 15:47:34 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated... | koduj-z-klasa/python101 | docs/conf.py | Python | mit | 9,897 |
'''
The MIT License (MIT)
Copyright (c) 2014 NTHUOJ team
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, modify, merge, ... | Changron/NTHUOJ_web | problem/views.py | Python | mit | 16,676 |
# -*- 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 'Item'
db.create_table('books_item', (
('id', self.gf('django.db.models.fields.Au... | carquois/blobon | blobon/books/migrations/0004_auto__add_item__add_time.py | Python | mit | 9,603 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RandomPasswordGenerator.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other... | AgapiGit/RandomPasswordGenerator | RandomPasswordGenerator/manage.py | Python | mit | 843 |
import os;
link = "http://media.blizzard.com/heroes/images/battlegrounds/maps/haunted-mines-v2/underground/6/"
column = 0;
rc_column = 0;
while (rc_column == 0):
row = 0;
rc_column = os.system('wget ' + link + str(column) + '/' + str(row) + '.jpg -O ' + str(1000 + column) + '-' + str(1000 + row) + '.jpg')
rc_row =... | karellodewijk/wottactics | extra/download_hots_map/haunted-mines-underground/download_hots_map.py | Python | mit | 1,381 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import graph
class TestGraph(unittest.TestCase):
'''
Unit test for graph.py
'''
def setUp(self):
'''
This method sets up the test graph data
'''
test_graph_data = {'1': [], '2': ['1'], '3': ['1', '4'], '4': [... | hirosassa/graph_search | test_graph.py | Python | mit | 858 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from config.template_middleware import TemplateResponse
from gaecookie.decorator import no_csrf
from gaepermission.decorator import login_not_required
from routes.campapel.home import returnIndex
from tekton import router
from tekton.gae.m... | marcelosandoval/tekton | backend/appengine/routes/campapel/show.py | Python | mit | 2,187 |
from rest_framework import routers
from . import views
router = routers.DefaultRouter(trailing_slash=False)
router.register(r'complaints', views.ComplaintViewSet)
urlpatterns = router.urls
| danjac/ownblock | ownblock/ownblock/apps/complaints/urls.py | Python | mit | 192 |
#! /usr/bin/python3
'''
automate_scrape.py - runs throught the online verision of the text book, 'Automate the boring stuff with python' and pulls out all of the projects and stores them in a file.
'''
import requests, os, bs4, sys
def page_download(web_page, chapter_num, no_project_count, no_chapter_projects):
... | ZorbaTheStrange/automate_scrape | automate_scrape.py | Python | mit | 2,297 |
#!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the Litecoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
in... | gwangjin2/gwangcoin-core | share/qt/clean_mac_info_plist.py | Python | mit | 900 |
import numpy as np
import tensorflow as tf
from agent.forward import Forward
from config import *
_EPSILON = 1e-6 # avoid nan
# local network for advantage actor-critic which are also know as A2C
class Framework(object):
def __init__(self, access, state_size, action_size, scope_name):
self.Access = acc... | AlphaSmartDog/DeepLearningNotes | Note-6 A3CNet/Note-6.2 A3C与HS300指数择时/agent/framework.py | Python | mit | 6,700 |
from collections import Counter
from clarify_python.helper import get_embedded_items, get_link_href
MAX_METADATA_STRING_LEN = 2000
def default_to_empty_string(val):
return val if val is not None else ''
class ClarifyBrightcoveBridge:
def __init__(self, clarify_client, bc_client):
self.clarify_clie... | Clarify/clarify_brightcove_sync | clarify_brightcove_sync/clarify_brightcove_bridge.py | Python | mit | 6,892 |
"""Softmax."""
scores = [3.0, 1.0, 0.2]
import numpy as np
def softmax(x):
"""Compute softmax values for each sets of scores in x."""
return np.exp(x) / sum(np.exp(x))
print(softmax(scores))
# Plot softmax curves
import matplotlib.pyplot as plt
x = np.arange(-2.0, 6.0, 0.1)
scores = np.vstack([x, np.ones_... | ds-hwang/deeplearning_udacity | python_practice/quiz1.py | Python | mit | 409 |
'''
Authors: Donnie Marino, Kostas Stamatiou
Contact: dmarino@digitalglobe.com
Unit tests for the gbdxtools.Idaho class
'''
from gbdxtools import Interface
from gbdxtools.idaho import Idaho
from auth_mock import get_mock_gbdx_session
import vcr
from os.path import join, isfile, dirname, realpath
import tempfile
impor... | michaelconnor00/gbdxtools | tests/unit/test_idaho.py | Python | mit | 2,604 |
import json
from django_api_tools.APIModel import APIModel, UserAuthCode
from django_api_tools.APIView import APIUrl, ReservedURL, StatusCode
from django_api_tools.tests.models import Foo, Bar, Baz, Qux, TestProfile
from django_api_tools.tests.views import TestAPIView
from django.test import TestCase
from django.test... | szpytfire/django-api-tools | django_api_tools/tests/tests.py | Python | mit | 24,690 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from django.utils.translation import ugettext as _
class UserProfile(models.Model):
'''
... | duoduo369/django-scaffold | myauth/models.py | Python | mit | 1,991 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of convertdate.
# http://github.com/fitnr/convertdate
# Licensed under the GPL-v3.0 license:
# http://opensource.org/licenses/MIT
# Copyright (c) 2016, fitnr <fitnr@fakeisthenewreal>
from math import trunc
from .utils import ceil, jwday, monthcalendarh... | mpercich/Calendarize | ios/dateparser/lib/python2.7/site-packages/convertdate/islamic.py | Python | mit | 1,668 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# @file ut.py
# @brief The main unit test program of whole project
# README: organize the unit tests in the number range
# refer UTGeneral functions
# print the suggested procedure in the console
# print the suggested check procedure in the console
# support c... | LinkItONEDevGroup/LASS | LASS-Simulator/codes/ut.py | Python | mit | 1,669 |
import asyncio
import unittest
import random
from gremlinpy import Gremlin
from . import ConnectionTestCases, EntityTestCases, MapperTestCases
from gizmo import Mapper, Request, Collection, Vertex, Edge
from gizmo.mapper import EntityMapper
class BaseTests(unittest.TestCase):
def setUp(self):
self.requ... | emehrkay/Gizmo | gizmo/test/integration/tinkerpop.py | Python | mit | 1,104 |
"""
This is used to pack testlib into a json
Then you can load into database by using:
manage.py loaddata <fixturename>
fixturename here is `testlib.json`
"""
import hashlib
import json
from os import path, listdir
def hash(binary):
return hashlib.sha256(binary).hexdigest()
category = ['checker', 'genera... | ultmaster/eoj3 | problem/testlib/pack.py | Python | mit | 1,142 |
"""ShipToasting web handlers."""
import os
import sys
import atexit
import random
import traceback
import gevent
from flask import Response
from flask import redirect
from flask import render_template
from flask import request
from flask import session
from apscheduler.schedulers.gevent import GeventScheduler
from ... | ccpgames/shiptoasting | shiptoasting/web.py | Python | mit | 4,504 |
"""
flask.ext.acl
=============
This extension provides an Access Control implementation for `tipfy <http://www.tipfy.org/>`_.
Links
-----
* `Documentation <http://www.tipfy.org/wiki/extensions/acl/>`_
* `Source Code Repository <http://code.google.com/p/tipfy-ext-acl/>`_
* `Issue Tracker <http://code.google.com/p/tip... | guotie/flask-acl | setup.py | Python | mit | 1,588 |
# -*- coding: utf-8 -*-
from django.db import models
from ..Models import *
from center.Exceptions.ModelsExceptions import *
class Tools_todo(models.Model):
STATUS_TYPES = (
(1, u'New'),
(2, u'Doing'),
(3, u'Waiting'),
(4, u'Done'),
)
SPECIES_TYPES = (
(1, u'Task')... | swxs/web | cloudplat/center/Models/Tools_todo_Model.py | Python | mit | 1,457 |
#!/usr/bin/env python
telescope = "ATCA"
latitude_deg = -30.312906
diameter_m = 22.0
import os
import sys
from util_misc import ascii_dat_read
#-----------------------------------------------------------------------------#
def main():
# Read the station lookup table
col, dummy = ascii_dat_read("ATCA_statio... | crpurcell/friendlyVRI | arrays/array_data/ATCA/mk_ATCA_array_configs.py | Python | mit | 3,761 |
__author__ = 'USER'
from learning.mlp.neuralnetwork import NeuralNetwork
from learning.mlp import learning
number_of_layers = 3
size_array = [2, 2, 1]
learning_rate = 0.3
momentum = 0.1
bnn = NeuralNetwork(number_of_layers, size_array, learning_rate, momentum)
xor_in = [
[0, 0],
[0, 1],
[1, 0],
[1, ... | ParkJinSang/Logle | sample/mlp_learn.py | Python | mit | 498 |
import os
import unittest
from conans.model.ref import ConanFileReference, PackageReference
from conans.test.utils.conanfile import TestConanFile
from conans.test.utils.tools import TestClient, TestServer,\
NO_SETTINGS_PACKAGE_ID
from conans.util.files import set_dirty
class PackageIngrityTest(unittest.TestCase)... | memsharded/conan | conans/test/functional/old/package_integrity_test.py | Python | mit | 2,451 |
#coding=utf-8
#author='Shichao-Dong'
import unittest
import Web_Method_Baspd
import Public_Base_Method
import requests
import time
import HTMLTestRunner
class ST_Bas_pd(unittest.TestCase):
u'商品功能性测试'
def setUp(self):
global cookie
r = Public_Base_Method.login_func("172.31.3.73:6020", "dongshi... | NJ-zero/Android | Request/Test_pd/TestCase_Web_Baspd.py | Python | mit | 1,855 |
# from index import db
# class MyObject():
# def __init__(self):
# pass
# @staticmethod
# def get_something(arg1, arg2):
# return something
| tferreira/Flask-Redis | application/models.py | Python | mit | 170 |
import glob
import numpy as np
import pandas as pd
from numpy import nan
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/RRBS_anno_clean")
repeats = pd.read_csv("repeats_hg19.csv")
annofiles = glob.glob("RRBS_NormalBCD19pCD27mcell23_44_GTAGAGGA.A*")
def between_range(row):
subset = repeats.... | evanbiederstedt/RRBSfun | scripts/repeat_finder_scripts/repeat_finder_RRBS_NormalBCD19pCD27mcell23_44_GTAGAGGA.A.py | Python | mit | 706 |
#!/usr/bin/env python
from livereload import Server, shell
server = Server()
style = ("style.scss", "style.css")
script = ("typing-test.js", "typing-test-compiled.js")
server.watch(style[0], shell(["sass", style[0]], output=style[1]))
server.watch(script[0], shell(["babel", script[0]], output=script[1]))
server.wat... | daschwa/typing-test | server.py | Python | mit | 395 |
"""
EXAMPLE: Working with the uiverse class
"""
from universe import universe
import pandas as pd
# Create Instance of universe for US Equities
usEqUniverse = universe('usEquityConfig.txt')
# Get Summary Statistics
usEqUniverse.computeSummary()
# Plot Return
usEqUniverse.assetReturns.AA.plot() | pli1988/portfolioFactory | portfolioFactory/universe/example_generateUSEquityUniverse.py | Python | mit | 298 |
#!/usr/bin/python3
import sys
import getpass
import helper
from argparse import ArgumentParser
if __name__ == "__main__":
parser = ArgumentParser(description="Simple file password based encryption/decryption tools. When run as pipe, use standard in/out.")
parser.add_argument("-a", "--action", choices=["encrypt... | tingtingths/cipherhelper | demo.py | Python | mit | 2,028 |
import logging
from requests_oauthlib import OAuth1Session
from django.http import HttpResponse, HttpResponseRedirect
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from .models import QuickbooksToken, get_quickbooks_token
from... | grue/django-quickbooks-online | quickbooks/views.py | Python | mit | 4,488 |
import re
import abc
from collections import deque
from copy import copy
from rdp.ast import Node
from rdp.exceptions import ParseError, UnexpectedToken
from rdp.utils import chain
def to_symbol(str_or_symbol, copy_if_not_created=False):
if isinstance(str_or_symbol, Symbol):
if copy_if_not_created:
... | emulbreh/rdp | rdp/symbols.py | Python | mit | 9,473 |
from logging import getLogger
from yarl import URL
from aiohttp import BasicAuth
try:
from aiosocks import Socks4Auth, Socks5Auth
except ImportError:
class Socks4Auth(Exception):
def __init__(*args, **kwargs):
raise ImportError(
'You must install aiosocks to use a SOCKS prox... | bellowsj/aiopogo | aiopogo/pgoapi.py | Python | mit | 6,917 |
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from direct.fsm import StateData
from toontown.toontown... | ksmit799/Toontown-Source | toontown/trolley/Trolley.py | Python | mit | 7,361 |
from __future__ import unicode_literals
from httoop import URI
def test_simple_uri_comparision(uri):
u1 = URI(b'http://abc.com:80/~smith/home.html')
u2 = URI(b'http://ABC.com/%7Esmith/home.html')
u3 = URI(b'http://ABC.com:/%7esmith/home.html')
u4 = URI(b'http://ABC.com:/%7esmith/./home.html')
u5 = URI(b'http://... | spaceone/httoop | tests/uri/test_uri.py | Python | mit | 930 |
# Copyright (c) 2017, Udacity
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the fol... | squared9/Robotics | Follow_Me-Semantic_Segmentation/code/utils/plotting_tools.py | Python | mit | 6,172 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from user import make_anonymous_user
from exeptions import HttpStatusError, RegexError
def make_subject_url(url):
if url.endswith("/"):
return url + "subject.txt"
else:
return url + "/subject.txt"
def parse_board(string):
if not is... | rezoo/twopy | twopy/board.py | Python | mit | 1,589 |
from tehbot.plugins import *
import tehbot.plugins as plugins
import wolframalpha
import prettytable
class WolframAlphaPlugin(StandardPlugin):
def __init__(self):
StandardPlugin.__init__(self)
self.parser.add_argument("query", nargs="+")
def initialize(self, dbconn):
StandardPlugin.ini... | spaceone/tehbot | tehbot/plugins/wolframalpha/__init__.py | Python | mit | 2,727 |
#!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | tuaris/suncoin | contrib/spendfrom/spendfrom.py | Python | mit | 10,053 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Detect same images and try to merge metadatas before deleting duplicates"""
import PIL.Image as Image
import PIL.ImageChops as ImageChops
import sys
import os
import pyexiv2
import datetime
import logging
#Handler for merging properties
def handler_mergeList(a, b):
... | pzia/keepmydatas | src/KmdImages.py | Python | mit | 7,111 |
import pykka
from rx.subjects import *
from TorrentPython.DownloadManager import *
from TorrentPython.RoutingTable import *
class DownloaderActor(pykka.ThreadingActor):
def __init__(self, downloader):
super(DownloaderActor, self).__init__()
self.downloader = downloader
self.download_mana... | reignofmiracle/RM_Torrent | TorrentPython/TorrentPython/Downloader.py | Python | mit | 1,176 |
'''
Created by auto_sdk on 2014-12-17 17:22:51
'''
from top.api.base import RestApi
class ItemUpdateDelistingRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.num_iid = None
def getapiname(self):
return 'taobao.item.update.delisting'
| CooperLuan/devops.notes | taobao/top/api/rest/ItemUpdateDelistingRequest.py | Python | mit | 318 |
# -*- coding: utf-8 -*-
# GMate - Plugin Based Programmer's Text Editor
# Copyright © 2008 Alexandre da Silva / Carlos Antonio da Silva
#
# This file is part of Gmate.
#
# See LICENTE.TXT for licence information
import os
import gnomevfs
from datetime import datetime
def get_file_info(uri):
"""Return the File in... | lexrupy/gmate-editor | GMATE/files.py | Python | mit | 2,328 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'video_gallery.tests.south_settings')
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| bitmazk/cmsplugin-video-gallery | manage.py | Python | mit | 294 |
# python -m unittest discover
import unittest
from datetime import datetime
from tasks import old_issues as c
class TestCloseOldIssue(unittest.TestCase):
def test_is_closed_issue(self):
self.assertEquals(c.is_closed({'closed_at': None}), False)
self.assertEquals(c.is_closed({'closed_at': "2014-1... | driftyco/ionitron-issues | tests/test_close_old_issue.py | Python | mit | 3,578 |
# (c) 2016 Douglas Roark
# Licensed under the MIT License. See LICENSE for the details.
from __future__ import print_function, division # Valid as of 2.6
import sys
sys.path.insert(0, '/home/droark/Projects/etotheipi-BitcoinArmory')
import binascii, hashlib, string, os
from collections import namedtuple
from math impo... | droark/Misc-Blockchain-Parse-Tools | Find-Unusual-Scripts.py | Python | mit | 33,452 |
'''
Online link spider test
'''
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import next
import unittest
from unittest import TestCase
import time
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__... | istresearch/scrapy-cluster | crawler/tests/online.py | Python | mit | 3,708 |
# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text.
# Copyright (c) 2016, Gluu
#
# Author: Yuriy Movchan
#
from org.gluu.model.custom.script.type.user import CacheRefreshType
from org.gluu.util import StringHelper, ArrayHelper
from java.util import Arrays, ArrayLis... | GluuFederation/oxExternal | cache_refresh/sample/SampleScript.py | Python | mit | 2,443 |
import _plotly_utils.basevalidators
class ShowtickprefixValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="showtickprefix", parent_name="layout.yaxis", **kwargs
):
super(ShowtickprefixValidator, self).__init__(
plotly_name=plotly_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/layout/yaxis/_showtickprefix.py | Python | mit | 562 |
from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class ShopifyAccount(ProviderAccount):
pass
class ShopifyProvider(OAuth2Provider):
id = 'shopify'
name = 'Shopify'
a... | wli/django-allauth | allauth/socialaccount/providers/shopify/provider.py | Python | mit | 1,032 |
import math
import copy
def print_matrix(matrix):
"""
This function prettyprints a matrix
:param matrix: The matrix to prettyprint
"""
for i in range(len(matrix)):
print(matrix[i])
def transpose(matrix):
"""
This function transposes a matrix
:param matrix: The matrix to trans... | aziflaj/numberoid | src/matrix/pymatrix.py | Python | mit | 5,173 |
from django.contrib import admin
from .models import User
# Register your models here.
admin.site.register(User) | aaronsnig501/foreign-guides | apps/accounts/admin.py | Python | mit | 113 |
# This is a separate module for parser functions to be added.
# This is being created as static, so only one parser exists for the whole game.
from nota import Nota
from timingpoint import TimingPoint
from tools import *
import random
import math
def get_Name (osufile):
Splitlines = osufile.split('\n')
for Line in ... | danielpontello/beatfever-legacy | FileParser.py | Python | mit | 4,395 |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="size", parent_name="histogram2d.xbins", **kwargs):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/histogram2d/xbins/_size.py | Python | mit | 394 |
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioTaskRouterClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
... | teoreteetik/api-snippets | rest/taskrouter/statistics/workspace/example-1/example-1.5.x.py | Python | mit | 685 |
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2011, Luis Pedro Coelho <luis@luispedro.org>
# vim: set ts=4 sts=4 sw=4 expandtab smartindent:
#
# License: MIT. See COPYING.MIT file in the milk distribution
import numpy as np
__all__ = [
'multi_view_learner',
]
class multi_view_model(object):
def __init__(s... | arnaudsj/milk | milk/supervised/multi_view.py | Python | mit | 1,957 |
"""
The MIT License (MIT)
Copyright (c) 2015 Ricardo Yorky
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, modify, merge... | ricardoyorky/emailqueue | emailqueue/mongodb.py | Python | mit | 2,778 |
import os
import copy
import scipy.interpolate as spi
import math
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
data_root = 'toneclassifier'
train_data_path = "%s/train" % data_root
val_data_path = "%s/test" % data_root
test_data_path = "%s/test_new" % data_root
def SetPath(r... | BreakVoid/DL_Project | data_utils.py | Python | mit | 12,608 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.