code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!flask/bin/python
from gb import app
app.run(debug=True)
| mbiokyle29/geno-browser | runserver.py | Python | mit | 58 |
# Started based on this sample:
# http://stackoverflow.com/questions/27628053/uploading-and-downloading-files-with-flask
from flask import Flask, request, redirect, url_for, Response, session
import openpyxl # using version 1.6.1
import docx # using python-docx 0.8.4
import os
import zipstream
import zipfile
import tim... | tacksoo/excel2pdf | flask_app.py | Python | mit | 4,839 |
# Copyright (C) 2006-2011, University of Maryland
#
# 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,... | reflectometry/direfl | direfl/gui/simulation_page.py | Python | mit | 41,666 |
import os
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import numpy as np
import threading
import time
##########################################################
##########################################################
##########################################################
##... | miltonsarria/dsp-python | informatica/class_python/ejemplo_qt_server.py | Python | mit | 2,390 |
# -*- coding: utf-8 -*-
# Exercise 6: Calculate model performance indexes with PyGeoC
from pygeoc.utils import MathClass
def cal_model_performance(obsl, siml):
"""Calculate model performance indexes."""
nse = MathClass.nashcoef(obsl, siml)
r2 = MathClass.rsquare(obsl, siml)
rmse = MathClass.r... | lreis2415/PyGeoC | examples/ex06_model_performace_index.py | Python | mit | 874 |
from tensorboardX import SummaryWriter
import unittest
from tensorboardX.record_writer import S3RecordWriter, make_valid_tf_name, GCSRecordWriter
import os
import boto3
from moto import mock_s3
os.environ.setdefault("AWS_ACCESS_KEY_ID", "foobar_key")
os.environ.setdefault("AWS_SECRET_ACCESS_KEY", "foobar_secret")
cl... | lanpa/tensorboardX | tests/test_record_writer.py | Python | mit | 1,257 |
import json
from twisted.web.resource import Resource
class HailMetricsResource(Resource):
def __init__(self, population, status):
Resource.__init__(self)
self.population = population
self.status = status
def render_GET(self, request):
hails = [h for h in self.population.hails... | aj-michael/Hailstorm | server/hailmetricsresource.py | Python | mit | 413 |
#!/usr/bin/env python
#
# Copyright 2010 Eric Entzel <eric@ubermac.net>
#
from google.appengine.api import mail
from google.appengine.ext.webapp import template
from google.appengine.api import memcache
from datetime import datetime
import os
from_address = '"EventBot" <admin@myeventbot.com>'
email_interval = 10
#... | eentzel/myeventbot | outgoing_mail.py | Python | mit | 1,865 |
#!/usr/local/bin/python
# Code Fights Weak Numbers Problem
def weakNumbers(n):
def get_divisors(n):
divs = []
for i in range(1, n + 1):
count = 0
for d in range(1, i + 1):
if i % d == 0:
count += 1
divs.append(count)
r... | HKuz/Test_Code | CodeFights/weakNumbers.py | Python | mit | 1,030 |
# -*- coding: utf-8 -*-
'''
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
'''
from ..request_base import RequestBase
from ..model.item import Ite... | OneDrive/onedrive-sdk-python | src/python2/request/item_request.py | Python | mit | 3,549 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | tysonholub/twilio-python | twilio/rest/video/v1/room/recording/__init__.py | Python | mit | 17,859 |
import json
import sys
from controller.framework.ControllerModule import ControllerModule
import controller.framework.ipoplib as ipoplib
class TincanDispatcher(ControllerModule):
def __init__(self, CFxHandle, paramDict):
super(TincanDispatcher, self).__init__()
self.CFxHandle = CFxHandle
... | kyuhojeong/controllers | controller/modules/svpn/TincanDispatcher.py | Python | mit | 6,334 |
import os
BOT_NAME = 'harvest'
SPIDER_MODULES = ['harvest.spiders']
NEWSPIDER_MODULE = 'harvest.spiders'
DOWNLOAD_DELAY = 3
CONCURRENT_REQUESTS = 4
COOKIES_ENABLED = False
_src = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
_target = os.path.join(os.path.dirname(_src), 'target')
JOBDIR = os.path.join... | neysofu/qetesh | src/harvest/settings.py | Python | mit | 404 |
""" EXAMPLE USAGE:
opts = Opts(environ,
opt('q', default=''),
opt('pages', default=2),
opt('split', default=0),
opt('simple', default=0),
opt('max_topics', default=40),
opt('ncol', default=3),
opt('save', default=False),
opt('load', default=False),
opt('smoothing... | ActiveState/code | recipes/Python/576784_WSGI_optiparsing__type/recipe-576784.py | Python | mit | 2,550 |
import numpy as np
import uncertainties.unumpy as unp
from uncertainties import ufloat
import math
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
from pint import UnitRegistry
u = UnitRegistry()
Q_ = u.Quantity
#umrechnung einheiten mit var.to('unit')
# Einheiten für pint:dimensionless, meter, s... | stefangri/s_s_productions | PHY341/V_302_Brueckenschaltung/Messdaten/auswertung.py | Python | mit | 10,629 |
from common.models import Tag
from .client import SalesforceClient
import json
import requests
import threading
''' Contributor model maps to the Contact object in Salesforce '''
client = SalesforceClient()
def run(request):
response = SalesforceClient().send(request)
def save(contributor: object):
data = {... | DemocracyLab/CivicTechExchange | salesforce/contact.py | Python | mit | 1,381 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
from django.utils import timezone
from snisi_core.models.Reporting import (ExpectedReporting,
... | yeleman/snisi | snisi_reprohealth/aggregations.py | Python | mit | 7,786 |
#!usr/local/bin
#sidgan
from pylab import *
import pylab
import scipy
import os
import numpy
import sys
import sklearn
from sklearn.kernel_approximation import RBFSampler
import sklearn.cluster
import optparse
from sklearn.decomposition import RandomizedPCA
from sklearn.neighbors import KNeighborsClassifier
fr... | sidgan/opencosmics | opencosmics.py | Python | mit | 8,249 |
import urllib
from bs4 import BeautifulSoup
page_url = 'http://www.blic.rs/'
page = urllib.urlopen(page_url)
soup = BeautifulSoup(page)
a = soup.find(id="cat_boxes")
b = a.find_all('a')
def firstHeadline():
text1 = soup.select("#home_main_article_text")[0].h1.text
href1 = soup.select("#home_main_article_te... | Lazar-T/blic_news | storiesText.py | Python | mit | 2,806 |
# Claire Jaja
# 11/1/2014
#
# Project Euler
# Problem 2
# Even Fibonacci numbers
#
# Each new term in the Fibonacci sequence is generated by adding
# the previous two terms.
# By starting with 1 and 2, the first 10 terms will be:
# 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
# By considering the terms in the Fibonacci seque... | clairejaja/project-euler | src/main/python/problem2/even_fibonacci_numbers.py | Python | mit | 876 |
"""
This is the (unofficial) Python API for Yatedo.com Website.
Using this code, you can manage to retrieve employees from a specific company
"""
import requests
from bs4 import BeautifulSoup
import re
class YatedoAPI(object):
"""
YatedoAPI Main Handler
"""
_instance = None
_verbose = False... | PaulSec/API-Yatedo | yatedoAPI.py | Python | mit | 2,867 |
import datetime
from dateutil.relativedelta import relativedelta
import urllib
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse, reverse_lazy
from django.db import ... | gaga3966/django-timepiece | timepiece/crm/views.py | Python | mit | 21,298 |
from django import forms
class SongForm(forms.Form):
track = forms.IntegerField(label='Track', required=False)
title = forms.CharField(label='Title')
duration = forms.CharField(label='Duration', max_length=15, required=False)
| octaflop/django_music | apps/web_app/forms.py | Python | mit | 240 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from .models import Post, Tag, Category
# # 添加blogs models
# myapp = apps.get_app_config('blogs')
# for model in myapp.get_models():
# admin.site.register(model)
class PostAdmin(admin.ModelAdmin):
list_display = ['title', 'publish_time', 'category', '... | pylixm/liBlog | liBlog/blogs/admin.py | Python | mit | 523 |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../tools'))
import fasta
import genetics
import table
def main(argv):
codon = table.codon(argv[0])
strings = fasta.read_ordered(argv[1])
dna = strings[0]
introns = strings[1:]
for intron in introns:
dna ... | cowboysmall/rosalind | src/stronghold/rosalind_splc.py | Python | mit | 466 |
import math
import numpy as np
import matplotlib
matplotlib.use('SVG')
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
x1 = 2.
x = np.linspace(0, x1, 100)
ax.plot(x, np.exp(-5. * x), linewidth=2, label = '$x(t)$')
N = 4
h = x1 / N
sx = np.linspace(0, x1, N + 1)
sy = [(1 + 5. * h)**(-n) for n in range(N +... | rekka/intro-fortran-2016 | web/python/implicit_euler.py | Python | mit | 1,047 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import codecs
import xml.sax
import json
import copy
import logging
import math
import atexit
import tarfile
from datetime import datetime
from xml.sax.handler import ContentHandler
class IO(object):
def __init__(self):
self.defers = []
atexit.register... | zizon/TinyTemplate | tiny_template_engine.py | Python | mit | 18,193 |
# Copyright (c) 2014 Tycho Andersen
# Copyright (c) 2014 dequis
# Copyright (c) 2014-2015 Joseph Razik
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2015 reus
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
... | cortesi/qtile | libqtile/widget/launchbar.py | Python | mit | 9,180 |
"""
WSGI config for yearendsite 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | menzenski/django-year-end-site | yearendsite/wsgi.py | Python | mit | 399 |
#!/usr/bin/env python
# All (current) configuration settings take the form of paths to specific files
# or directories. Aside from BASE itself, all paths are assumed to be relative
# to BASE unless specified as absolute.
# Windows examples:
# BASE = r"C:\MCP"
# USER = r"mcp_rebuild\My Projects"
# TARGET = r"Z:\My Mo... | FunnyMan3595/mcp_rebuild | settings.py | Python | mit | 2,293 |
import datetime
import unittest
from django.http import Http404
from . import AppEngineTestCase
from pasty.models import LexerConfig, Paste, PastyFile, make_relative_path
class PasteTestCase(AppEngineTestCase):
def test_unicode(self):
obj = Paste(author='alice@example.com', filename='example.txt')
... | davidwtbuxton/captain-pasty | pasty/tests/test_models.py | Python | mit | 4,489 |
from sklearn import tree, ensemble
from randomforest import *
import numpy as np
from pprint import pprint
class HierarchicalRandomForest(object):
def __init__(self, n_estimators=100, n_procs=1):
self.classifiers = [ensemble.RandomForestClassifier(n_estimators=n_estimators, n_jobs=n_procs) for i in range(... | grantathon/computer_vision_machine_learning | project/HierarchicalRandomForest_sklearn.py | Python | mit | 5,309 |
from flask.ext.login import LoginManager
lm = LoginManager()
from flask.ext.restless import APIManager
api = APIManager()
from flask.ext.heroku import Heroku
heroku = Heroku()
from flask.ext.travis import Travis
travis = Travis()
from flask.ext.mail import Mail
mail = Mail()
from cachecore import SimpleCache
cache... | waxhax/waxhax | app/extensions.py | Python | mit | 502 |
# Utilities
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# 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, c... | ddboline/Garmin-Forerunner-610-Extractor_fork | scripting.py | Python | mit | 2,490 |
from flask import Flask
app = Flask('sapling', static_folder='public/static')
import views # noqa
| deMenschRutger/sapling | public/__init__.py | Python | mit | 101 |
# -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import CashbillService, PopbillException
cashbillService = CashbillService(testValue.LinkID, te... | linkhub-sdk/popbill.cashbill.example.py | getChargeInfo.py | Python | mit | 1,259 |
import json
import os
import sys
from jupyter_client.kernelspec import install_kernel_spec
from IPython.utils.tempdir import TemporaryDirectory
kernel_json = {
"display_name": "Gauche",
"language": "gauche",
"argv": [sys.executable, "-m", "jupyter_gauche", "-f", "{connection_file}"],
"codemirror_mode"... | ara-ta3/jupyter-gauche | jupyter_gauche/install.py | Python | mit | 1,024 |
""" maze behaviors modules"""
#print "\nPackage at%s" % __path__[0]
__all__ = ['behaving',]
for m in __all__:
exec "from . import %s" % m #relative import
| ioflo/maze | maze/__init__.py | Python | mit | 162 |
from .base import FunctionalTest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class NewVisitorTest(FunctionalTest):
def test_can_start_a_list_and_retrieve_it_later(self):
# Edith has heard about a cool new online to-do app. She goes
# to check out its homepage
... | talaniz/django-tdd | functional_tests/test_simple_list_creation.py | Python | mit | 3,306 |
#!env/bin/python
import sys
from portfolio import create_app
class ProductionConfig(object):
DEBUG = False
TESTING = False
app = create_app(config=ProductionConfig)
if __name__ == '__main__':
if len(sys.argv) > 1 and sys.argv[1] == '-p':
print(' * Running in production mode')
app = crea... | timesqueezer/portfolio | run.py | Python | mit | 417 |
'''
Created on Jan 11, 2012
@author: mchrzanowski
'''
__LIMIT = 999999 # as 999999 > 6 * 9 ^ 5 , this is our ceiling.
__POWER = 5
def main():
winners = set([])
for number in xrange(2, __LIMIT): # exclude 1 as it's not a sum (but would qualify)
numberString = str(number)
addedValue = 0
... | mchrzanowski/ProjectEuler | src/python/Problem030.py | Python | mit | 579 |
from django.contrib import admin
from .models import HangupsApiUser, HangupsApiToken
admin.site.register(HangupsApiUser)
admin.site.register(HangupsApiToken)
| sokky/hangups_api | api/admin.py | Python | mit | 161 |
from __future__ import division
import numpy as np
# import matplotlib.pyplot as plt
from scipy.integrate import odeint
# from scipy.interpolate import interp1d
from scipy.optimize import minimize
from ktr_shuttle_ode import main_ode, ParamHolder
# Parameters
'''r_total: Ths can be inferred experimentally or from the ... | braysia/covertrace | covertrace/utils/kinase_estimation_inh.py | Python | mit | 4,757 |
# # 1. Define a function max() that takes two numbers as arguments and returns the largest of them.
# # Use the if-then-else construct available in Python.
# # (It is true that Python has the max() function built in, but writing it yourself is nevertheless a good exercise.)
#
# def max (a, b):
# if a>b:
# r... | openUniverse/singularity | BensPractice/Practise2.py | Python | mit | 2,825 |
#!/user/bin/python
# coding: utf8
class Simulation:
"""docstring for Simulation"""
def __init__(self, arg):
self.arg = arg
| sheplu/Anthill | Python/utils/Simulation.py | Python | mit | 130 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def hasPathSum(self, root, sum):
"""
:type root: TreeNode
:type sum: int
:rtype: bool
... | hawkphantomnet/leetcode | PathSum/Solution.py | Python | mit | 625 |
from __future__ import unicode_literals
from django.apps import AppConfig
class ImagerImagesConfig(AppConfig):
name = 'imager_images'
def ready(self):
"""Run when app ready."""
from imager_images import signals
| jaredscarr/django-imager | imagersite/imager_images/apps.py | Python | mit | 238 |
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseForbidden
from django.views.generic import ListView, DetailView
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.core.urlresolvers import reverse_lazy
from django.utils.decorators import m... | io07/BOJ-V4 | problem/views.py | Python | mit | 15,626 |
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Notice(models.Model):
text = models.TextField(_(u'Заметка'))
user = models.ForeignKey('account.User', verbose_name=_(u'Пользователь'))
picture = models.ForeignKey('picture.Picture', verbose_... | scailer/picarchive | apps/notice/models.py | Python | mit | 582 |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "histogram.legendgrouptitle"
_path_str = "histogram.legendgrouptitle.font"
_valid_props = {"col... | plotly/plotly.py | packages/python/plotly/plotly/graph_objs/histogram/legendgrouptitle/_font.py | Python | mit | 8,487 |
"""Helpers for making Skyfield tests stable."""
import datetime as dt
import sys
from skyfield import earthlib
import skyfield.api
import skyfield.timelib
IS_32_BIT = (sys.maxsize == 0x7fffffff)
_real_datetime_class = dt.datetime
class datetime(dt.datetime):
_fake_now = None
@staticmethod
def now():
... | skyfielders/python-skyfield | skyfield/tests/fixes.py | Python | mit | 1,886 |
# Handy for debugging setup.py
"""Utilities creating reusable, DRY, setup.py installation scripts
Typical usage in setup.py:
>>> global_env, local_env = {}, {}
>>> execfile(join('pug', 'setup_util.py'), global_env, local_env)
>>> get_variable = local_env['get_variable']
"""
import os
def s... | hobson/pug | pug/setup_util.py | Python | mit | 915 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Initialize the LCD.
import Adafruit_CharLCD as LCD
import Adafruit_GPIO.MCP230xx as MCP
import RPi.GPIO as io # For standard GPIO methods.
# Define the MCP pins connected to the LCD.
lcd_rs = 0
lcd_en = 1
lcd_d4 = 2
lcd_d5 = 3
lcd_d6 = 4
lcd_d7 = 5
lcd_red = 6
lcd_gre... | ssharpjr/loader-controller | examples/lcd_mcp.py | Python | mit | 749 |
#! /usr/bin/python3
def main():
try:
while True:
line1 = input().strip().split(' ')
n = int(line1[0])
name_list = []
num_list = [0]
for i in range(1, len(line1)):
if i % 2 == 1:
name_list.append(line1[i... | zyoohv/zyoohv.github.io | code_repository/tencent_ad_contest/tencent_contest/model/main.py | Python | mit | 1,329 |
import shutil
import logging
from followthemoney import model
from ingestors.support.temp import TempFileSupport
from ingestors.support.encoding import EncodingSupport
from ingestors.directory import DirectoryIngestor
log = logging.getLogger(__name__)
class PackageSupport(TempFileSupport, EncodingSupport):
def ... | alephdata/ingestors | ingestors/support/package.py | Python | mit | 1,257 |
import json
read_files = ["data_" + str(x) + ".json" for x in range(700)]
with open("libros.json", "w") as outfile:
dic = {}
for f in read_files:
dic.update( json.loads(open(f, "r",).read()))
outfile.write(json.dumps(dic))
| yabirgb/maths-books | p_scrap/merger.py | Python | mit | 245 |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^$', 'builder.views.metadataIdx'), # Approot, not listview
(r'^submissions/', include('builder.urls')),
(r'^keepAlive$', 'builder.views... | edac-epscor/nmepscor-data-collection-form | application/base/urls.py | Python | mit | 945 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Customer.deleted'
db.add_column(u'django_fastbill_custome... | phelmig/django-fastbill | django_fastbill/migrations/0004_auto__add_field_customer_deleted.py | Python | mit | 10,979 |
from __future__ import absolute_import
from agms.configuration import Configuration
from agms.agms import Agms
from agms.transaction import Transaction
from agms.safe import SAFE
from agms.report import Report
from agms.recurring import Recurring
from agms.hpp import HPP
from agms.version import Version
| agmscode/agms_python | agms/__init__.py | Python | mit | 305 |
#-*- coding: utf-8 -*-
class Schema(object):
def get_word_present(self,conj_type, forma, liczba, osoba, base_word):
new_end = self.conjugation[conj_type]['forma'][forma][liczba][osoba]
return base_word.replace(str(self.conjugation[conj_type]['koncowka']), str(new_end))
def get_wor... | perfidia/andip | src/andip/wiki/schema.py | Python | mit | 67,882 |
import sys
import importlib
import inspect
class Process(object):
def __init__(self):
pass
def process(self, _in):
pass
def get_id(self):
return self._id
class Simulator(object):
def __init__(self, processes, links, commands):
self._cur_time = 0
self... | airekans/paxosim | simulator.py | Python | mit | 10,270 |
import numpy as np
import infrastructure.intake as intake
import infrastructure.log as log
import core.topology as topology
import core.satisfaction as satisfaction
def run(graph, img):
graph = topology.simplify_junctures(graph)
log.hsvOrGreyImage(img,
points=(node for node in graph.nodes() if graph... | cdglabs/tableVision | ddp/pipeline/hv_lines.py | Python | mit | 831 |
"""
WSGI config for djangochat 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.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | scarescrow/LongPollChat | djangochat/wsgi.py | Python | mit | 398 |
from django.forms.utils import ErrorDict
from django.utils.html import format_html
from djng.forms.angular_base import NgFormBaseMixin, SafeTuple
class NgModelFormMixin(NgFormBaseMixin):
"""
Add this NgModelFormMixin to every class derived from ``forms.Form``, if that custom ``Form``
shall be managed thro... | jrief/django-angular | djng/forms/angular_model.py | Python | mit | 4,211 |
from electrum.util import print_msg
from .digitalbitbox import DigitalBitboxPlugin
class DigitalBitboxCmdLineHandler:
def stop(self):
pass
def show_message(self, msg):
print_msg(msg)
def get_passphrase(self, msg, confirm):
import getpass
print_msg(msg)
return getpa... | dabura667/electrum | plugins/digitalbitbox/cmdline.py | Python | mit | 415 |
from __future__ import unicode_literals
from django.db.models import fields
from django.utils.translation import ugettext_lazy as _
from ...models.field import FieldDefinition
class _BooleanMeta:
defined_field_category = _('Boolean')
class BooleanFieldDefinition(FieldDefinition):
class Meta(_BooleanMeta):... | charettes/django-mutant | mutant/contrib/boolean/models.py | Python | mit | 610 |
"""
A micro tk app with a list driven by the model.
"""
import logging
from Tkinter import *
from ttk import Treeview
import hotlist
class MVCList(Treeview):
def __init__(self, parent, model):
Treeview.__init__(
self,
parent,
columns=["COL0", "COL1"]... | petrblahos/modellerkit | step02/tkl.py | Python | mit | 3,894 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/vault_secret_group_py3.py | Python | mit | 1,468 |
# Copyright (C) 2020 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import time
from datetime import datetime
from typing import Optional, Any
from PyQt5.QtCore import Qt, QDateTime
from PyQt5.QtGui import... | vialectrum/vialectrum | electrum_ltc/gui/qt/locktimeedit.py | Python | mit | 5,781 |
# Locking mechanism to ensure no two compilations occur simultaneously
# in the same compilation directory (which can cause crashes).
import atexit
import os
import socket # only used for gethostname()
import time
import logging
from contextlib import contextmanager
import numpy as np
from theano import config
fro... | nke001/attention-lvcsr | libs/Theano/theano/gof/compilelock.py | Python | mit | 14,977 |
import landlab.components.vegetation_ca.CA_Veg
from landlab.components.vegetation_ca.CA_Veg import VegCA
| decvalts/landlab | landlab/components/vegetation_ca/__init__.py | Python | mit | 106 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class ReservationTestCase(Integ... | tysonholub/twilio-python | tests/integration/taskrouter/v1/workspace/worker/test_reservation.py | Python | mit | 9,315 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='pygments-red',
version='0.2',
description='Pygments lexer for Ruby + Red.',
keywords='pygments ruby red lexer',
license='MIT',
author='Aleksandar Milicevic',
author_email='aleks@csail.mit.edu',
url='https:... | aleksandarmilicevic/pygments-red | setup.py | Python | mit | 1,246 |
import os
import sys
import time
print(f"running {sys.argv[0]}")
import cellpy
from cellpy import cellreader, log
from cellpy.parameters import prms
# -------- defining overall path-names etc ----------
current_file_path = os.path.dirname(os.path.realpath(__file__))
relative_test_data_dir = "../testdata"
test_data_d... | jepegit/cellpy | dev_utils/helpers/performance.py | Python | mit | 2,592 |
# encoding: utf-8
"""
Objects related to mouse click and hover actions on a shape or text.
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals
)
from .enum.action import PP_ACTION
from .opc.constants import RELATIONSHIP_TYPE as RT
from .shapes import Subshape
from .util impor... | neerajvashistha/pa-dude | lib/python2.7/site-packages/pptx/action.py | Python | mit | 7,551 |
# def p(a, b):
# if b is 0:
# return a
# else:
# return a * p(a, b -1)
#
# w = 5
# print(p(w, 8))
# # 5*(2 - 1)
#
# def universe(input, apples, bread):
# if input == "hello":
# print("hi")
# else:
# print("f u")
# if apples == "red":
# print("yum")
# else:... | openUniverse/singularity | BensPractice/Practise.py | Python | mit | 2,283 |
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='dane_doctor',
version='0.1',
classifiers=["Private :: Do Not Upload"],
entry_points={
'console_scripts': [
'danex = danex.__main__:main',
]
},
packages=[
'danex',
],
install_requires=... | hynek/tnw | setup.py | Python | mit | 425 |
__author__ = 'saftophobia'
| Saftophobia/shunting | data/__init__.py | Python | mit | 28 |
"""
WSGI config for cloudlynt project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | drunken-pypers/cloudlynt | cloudlynt/wsgi.py | Python | mit | 1,140 |
from django.shortcuts import render
from django.urls import resolve
def just_redirect_by_name(request):
url_name = resolve(request.path_info).url_name
return render(request, f"{url_name}.html", {})
| hakancelik96/coogger | coogger/utils.py | Python | mit | 208 |
# candidate/controllers.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
import datetime as the_other_datetime
import json
import urllib.request
from socket import timeout
from django.http import HttpResponse
from django.utils.timezone import now
import wevote_functions.admin
from apis_v1.views.views_ex... | wevote/WeVoteServer | candidate/controllers.py | Python | mit | 134,381 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/servicebus/azure-mgmt-servicebus/azure/mgmt/servicebus/v2021_01_01_preview/aio/operations/_topics_operations.py | Python | mit | 39,140 |
# -*- coding: utf-8 -*-
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = ['--strict', '--verbose', '--tb=long']
self.test_suite = True... | tomislater/RandomWords | setup.py | Python | mit | 1,658 |
# -----> * Filing * <-----
print("Enter game's name:")
name_file = input("")
name_file_string = str(name_file)
file_name = name_file_string + ".txt"
safile = open(file_name, "w")
safile.write("This game's stats were:\n")
# -----> * INTRODUCTION * <-----
Commands = ''' STAT ------------> COMMAND
Penalt... | mangafas/siball-analysis-archive | text-based/alpha/0.4/0.4.2.py | Python | mit | 33,681 |
from os.path import dirname
"""
Process MPDatClient responses
"""
def get_files_and_dirs_from_db(items):
"""
Returns (files, directories) from a source with files and directories mixed.
"""
files = []
dirs = []
for item in items:
if "directory" in item:
dirs.append(item["... | laurentb/mpdat | mpdat/process.py | Python | mit | 735 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'ghost'
import tornado.web
from app import router
from app.helper import BaseAuthHandler
from app.models.auth import User
@router.Route('/auth/login')
class AuthLoginHandler(BaseAuthHandler):
def get(self, *args, **kwargs):
html = ('<form meth... | rsj217/tornado--scaffold | tornapro/tiger/app/views/auth.py | Python | mit | 1,227 |
"""Imports for Python API.
This file is MACHINE GENERATED! Do not edit.
Generated by: tensorflow/tools/api/generator/create_python_api.py script.
"""
from tensorflow.python.keras._impl.keras.estimator import model_to_estimator | ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/tensorflow/tools/api/generator/api/keras/estimator/__init__.py | Python | mit | 227 |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import time... | Azure/azure-sdk-for-python | sdk/eventhub/azure-eventhub/tests/livetest/synctests/test_reconnect.py | Python | mit | 4,935 |
# Generated by Django 2.0.13 on 2021-08-08 15:41
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("ddcz", "0102_letters_of_postal_service"),
]
operations = [
migrations.RenameField(
model_name="letters",
old_name="datum",
... | dracidoupe/graveyard | ddcz/migrations/0103_letters_col_rename.py | Python | mit | 800 |
"""
Algorithm that finds kth to last element in a singly linked list
"""
from linkedlist import LinkedList
def findKelementh(list, k):
"""
:param list:
:type list: LinkedList
:param k:
:type k: int
:return:
"""
i = 0
node = list.head
kth_node = None
while node is not None:... | MFry/pyAlgoDataStructures | Cracking the Coding Interview/Linked_Lists/question2.py | Python | mit | 941 |
# Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
from __future__ import absolute_import, print_function
from tweepy.utils import parse_datetime, parse_html_value, parse_a_href
class ResultSet(list):
"""A list like object that holds results from a Twitter API query."""
def __init__(... | LikeABird/tweepy | tweepy/models.py | Python | mit | 14,292 |
import sqlite3
conn = sqlite3.connect('factbook.db')
import pandas as pd
import math
df = pd.read_sql_query('select * from facts;', conn)
conn.close()
print(df.shape)
df = df.dropna()
print(df.shape)
def growth(population,growth_rate):
N = population * pow(math.e,(growth_rate /100)*35)
return N
pop = []
for ind... | vipmunot/Data-Analysis-using-Python | SQL and Databases Begineer/Working with a SQLite database/growth.py | Python | mit | 562 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-18 20:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0056_auto_20160118_2012'),
]
operations = [
migrations.AddField(... | n2o/guhema | products/migrations/0057_auto_20160118_2025.py | Python | mit | 2,432 |
#!/usr/bin/env python
import csv
import click # pip install click -- assumes version 5.x
@click.command()
@click.option('--incsv', type=click.File(mode='rU', lazy=True), help='input csv (the larger of the csv files)')
@click.option('--subcsv', type=click.File(mode='rU', lazy=True), help='subquery csv (the smaller ... | curtisalexander/csvsubquery | csvsubquery.py | Python | mit | 1,220 |
from django_mfa.models import *
from django.test import TestCase, Client
from django.contrib.auth.models import User
from django.contrib import auth
class Test_Models_Mfa_U2f(TestCase):
def setUp(self):
self.client = Client()
self.user = User.objects.create_user(
username='djangomfa@m... | MicroPyramid/django-mfa | django_mfa/tests/test_models.py | Python | mit | 2,572 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('addressesapp', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='person',
name='... | xianjunzhengbackup/code | data science/machine_learning_for_the_web/chapter_6/test_server/addressesapp/migrations/0002_remove_person_mobilephone.py | Python | mit | 351 |
'''Generate truth data from a truth_data_file.
A truth_data_file may be produced by a human being, so sometimes
it should be considered truth data. This file provides
utilities for turning a truth_data_file of a certain format into
truth data the harness understands.
'''
from __future__ import absolute_import
import ... | trec-dd/trec-dd-simulation-harness | trec_dd/harness/truth_data.py | Python | mit | 4,988 |
#!/usr/bin/env python3
"""
Created on 20 Jan 2020
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import os
from scs_core.sys.tail import Tail
# --------------------------------------------------------------------------------------------------------------------
path = os.path.expanduser('~/SCS/scs... | south-coast-science/scs_core | tests/sys/tail_test.py | Python | mit | 547 |
<<<<<<< HEAD
<<<<<<< HEAD
"""Unit tests for the copy module."""
import copy
import copyreg
import weakref
import abc
from operator import le, lt, ge, gt, eq, ne
import unittest
from test import support
order_comparisons = le, lt, ge, gt
equality_comparisons = eq, ne
comparisons = order_comparisons + equality_compari... | ArcherSys/ArcherSys | Lib/test/test_copy.py | Python | mit | 67,430 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('fruit', '0003_apple_size'),
('fruit', '0002_cranberry_bacon'),
]
operations = [
]
| donkirkby/djsquash | fruit/migrations/0100_prepare_squash.py | Python | mit | 274 |