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 |
|---|---|---|---|---|---|
import numpy as np
from .datastructure import DataStructure
from . import utilities
def convert_data_for_combined(data, current_type, desired_type, len_of_x):
if current_type == desired_type:
return data
if DataStructure.is_valid(desired_type) and DataStructure.is_combined(current_type):
if Da... | MaximilianDenninger/mllib | mllib/basics/converter.py | Python | mit | 3,141 |
# Copyright (c) 2015, Michael Boyle
# See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE>
import pytest
import numpy as np
from numpy import *
import quaternion
import spherical_functions as sf
import scri
from conftest import linear_waveform, constant_waveform, random_waveform, delta_wa... | moble/scri | tests/test_rotations.py | Python | mit | 10,004 |
# 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-monitor/azure/mgmt/monitor/models/activity_log_alert_resource.py | Python | mit | 3,303 |
from tagsetbench import ShellPath
class Makefile:
def __init__(self, path=None, recipes=None):
self.path = path # TODO: všechny budou ve working_dir, stačí 'name'
# TODO: self.declarations? (pomocí slovníku, aby na ně šlo odkazovat)
# split_corpora=' \\\n\t'.join(self.split_corpora)... | lenoch/tagsetbench | makefile.py | Python | mit | 5,682 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-01 07:08
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial =... | gamaio/gama_api | core/migrations/0001_initial.py | Python | mit | 2,293 |
#!/usr/bin/env python
import numpy.ma as ma
import os,sys, subprocess, math, datetime
from os.path import basename
import numpy as np
import time as tt
import gdal
import h5py
from datetime import timedelta
from gdalconst import GDT_Float32, GA_Update
from osgeo import ogr, osr
import logging
#TODO: change for handli... | SISTEMAsw/TAMP | pep.lib/proc/procGOME_L2.py | Python | mit | 4,971 |
from .base import * # noqa
INTERNAL_IPS = INTERNAL_IPS + ('', )
ALLOWED_HOSTS = []
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'app_kdl_liv',
'USER': 'app_kdl',
'PASSWORD': '',
'HOST': ''
},
}
# ------------------------------... | kingsdigitallab/kdl-django | kdl/settings/liv.py | Python | mit | 1,127 |
# encoding=utf-8
from tsundiary import app
app.jinja_env.globals.update(theme_nicename = {
'classic': 'Classic Orange',
'tsun-chan': 'Classic Orange w/ Tsundiary-chan',
'minimal': 'Minimal Black/Grey',
'misato-tachibana': 'Misato Tachibana',
'rei-ayanami': 'Rei Ayanami',
'rei-ayanami-2': 'Rei A... | neynt/tsundiary | tsundiary/jinja_env.py | Python | mit | 1,603 |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 9 21:31:53 2015
Create random synthetic velocity profile + linear first guesses
@author: alex
"""
import random
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def savitzky_golay(y, window_size, order, deriv=0, rate=1):
r... | bottero/IMCMCrun | examples/Synthetic1/createSyntheticRandomProfile.py | Python | mit | 6,749 |
import json
from flask import Flask, request
from two1.lib.wallet import Wallet
from two1.lib.bitserv.flask import Payment
from scipy.stats import norm
from math import *
app = Flask(__name__)
wallet = Wallet()
payment = Payment(app, wallet)
@app.route('/bs')
@payment.required(10)
def BlackScholes():
data = {}
... | davemc84/bitcoin-payable-black-scholes | bs.py | Python | mit | 1,318 |
from flask import Flask, jsonify
app = Flask(__name__)
@app.route('/')
def index():
return 'Flask is running on gunicorn!'
@app.route('/data')
def names():
data = {"names": ["John", "Jacob", "Julie", "Jennifer"]}
return jsonify(data)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
| SkiftCreative/docker-gunicorn-examples | flask/app/app.py | Python | mit | 319 |
from samples.models import Insurance, Patient, Specimen
from django.contrib import admin
admin.site.register(Insurance)
admin.site.register(Patient)
admin.site.register(Specimen)
| timothypage/etor | etor/samples/admin.py | Python | mit | 182 |
import theano
import numpy as np
from sklearn.preprocessing import OneHotEncoder
from sklearn import cross_validation, metrics, datasets
from neupy import algorithms, layers, environment
environment.reproducible()
theano.config.floatX = 'float32'
mnist = datasets.fetch_mldata('MNIST original')
target_scaler = OneHo... | stczhc/neupy | examples/gd/mnist_cnn.py | Python | mit | 1,657 |
"""AFOS Database Workflow."""
# 3rd Party
from twisted.internet import reactor
from txyam.client import YamClient
from pyiem.util import LOG
from pyiem.nws import product
# Local
from pywwa import common
from pywwa.ldm import bridge
from pywwa.database import get_database
DBPOOL = get_database("afos", cp_max=5)
MEMCA... | akrherz/pyWWA | parsers/pywwa/workflows/afos_dump.py | Python | mit | 2,891 |
for cislo in range(4):
print('Řádek', cislo)
| Ajuska/pyladies | 04/vypisrange.py | Python | mit | 52 |
# https://oj.leetcode.com/problems/add-two-numbers/
# 1555 / 1555 test cases passed.
# You are given two linked lists representing two non-negative numbers.
# The digits are stored in reverse order and each of their nodes contain
# a single digit. Add the two numbers and return it as a linked list.
#
# Input: (2 -> 4 -... | saruberoz/leetcode-oj | leetcode-solutions/python/add_two_numbers.py | Python | mit | 1,303 |
number = int(input("Give me a number and I will tellyou if it is even or odd. Your number: "))
divisor = int(input("What divisor would you like to check? "))
if number % 2 == 0:
print("%d is EVEN" % number)
else:
print("%d is ODD" % number)
if number % 4 == 0:
print("%d is evenly divisible by 4." % number... | stackingfunctions/practicepython | src/02-even_odd.py | Python | mit | 415 |
from route53.change_set import ChangeSet
from route53.exceptions import Route53Error
class ResourceRecordSet(object):
"""
A Resource Record Set is an entry within a Hosted Zone. These can be
anything from TXT entries, to A entries, to CNAMEs.
.. warning:: Do not instantiate this directly yourself. Go ... | EricSchles/python-route53 | route53/resource_record_set.py | Python | mit | 10,055 |
import os
import math
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
import util
import util.paths as paths
def save_figure(fig, filename):
filename = str(filename)
fig.savefig('{filename}.svg'.format(filename=filename), fo... | justanothercoder/LSTM-Optimizer-TF | plotting.py | Python | mit | 9,450 |
"""Development settings and globals."""
from os.path import join, normpath
from base import *
########## LOCAL DATABASE CONFIGURATION, OVERIDES BASE
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': joi... | josven/phx | phx/settings/local.py | Python | mit | 1,642 |
import os, sys
from setuptools import setup, find_packages
version = '0.4'
install_requires = ['setuptools', 'PyYAML']
if sys.version_info < (2, 7):
install_requires.append('simplejson')
install_requires.append('argparse')
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read(... | conversis/varstack | setup.py | Python | mit | 697 |
def change_counter():
print("Determine the value of your pocket change.")
quarters = int(input("Enter the number of quarters: "))
dimes = int(input("Enter the number of dimes: "))
nickels = int(input("Enter the number of nickels: "))
pennies = int(input("Enter the number of pennies: "))
value... | SeattleCentral/ITC110 | examples/lecture04b.py | Python | mit | 508 |
from collections import OrderedDict, Callable
class DefaultOrderedDict(OrderedDict):
# Source: http://stackoverflow.com/a/6190500/562769
# http://code.activestate.com/recipes/523034-emulate-collectionsdefaultdict/
def __init__(self, default_factory=None, *a, **kw):
if (default_factory is not None a... | Jenselme/mappyfile | mappyfile/ordereddict.py | Python | mit | 1,542 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-27 19:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0005_post_author'),
]
operations = [
migrations.CreateModel(
... | jokuf/hack-blog | posts/migrations/0006_auto_20170327_1906.py | Python | mit | 843 |
#!/usr/bin/env python
# encoding: utf-8
"""
networking_Test.py
Created by Nikolaus Sonnenschein on 2008-05-8.
Copyright (c) 2008 Jacobs University of Bremen. All rights reserved.
"""
import unittest
from ifba.distributedFBA import networking
class test_Networking(unittest.TestCase):
def setUp(self):
pass... | phantomas1234/fbaproject | ifba/distributedFBA/networking_Test.py | Python | mit | 684 |
__author__ = 'Victoria'
#Decorator Pattern in Characters
class BarDecorators(Barbarian):
pass
class ImageBarDecorator(BarDecorators):
def __init__(self, decorated, picFile):
self.decorated = decorated
self.picFile = picFile
super(ImageBarDecorator, self).__init__(self.decorated.canvas,
... | victorianorton/SimpleRPGGame | src/game/Decorators.py | Python | mit | 1,582 |
from raptiformica.settings import conf
from raptiformica.settings.load import purge_local_config_mapping
from tests.testcase import TestCase
class TestPurgeLocalConfigMapping(TestCase):
def setUp(self):
self.remove = self.set_up_patch(
'raptiformica.settings.load.remove'
)
def tes... | vdloo/raptiformica | tests/unit/raptiformica/settings/load/test_purge_local_config_mapping.py | Python | mit | 698 |
# problem19.py
import datetime
sun = 0
for y in range(1901, 2001):
for m in range(1, 13):
if datetime.date(y, m, 1).isoweekday() == 7:
sun += 1
print(sun)
| anpe9592/projectEuler | 11-20/problem19.py | Python | mit | 183 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Admin model views for records."""
import json
from flask import flash
from flask... | tiborsimko/invenio-records | invenio_records/admin.py | Python | mit | 2,051 |
#!/usr/bin/python
import sys
import xml.etree.ElementTree as ET
# XML parsing test
# See https://hadoop.apache.org/docs/current/api/org/apache/hadoop/mapreduce/lib/aggregate/package-tree.html
def main(argv):
root = ET.parse(sys.stdin).getroot()
period_start = root.attrib.get('periodstart')
for road_link... | gofore/aws-emr | src/streaming-programs/02-xml-parse-test_map.py | Python | mit | 765 |
import numpy as np
import tensorflow as tf
def pairwise_add(u, v=None, is_batch=False):
"""
performs a pairwise summation between vectors (possibly the same)
Parameters:
----------
u: Tensor (n, ) | (n, 1)
v: Tensor (n, ) | (n, 1) [optional]
is_batch: bool
a flag for whether the ve... | thaihungle/deepexp | deep-process/utility.py | Python | mit | 3,652 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from nose.tools import ok_
import os
from py_utilities.fs.path_utilities import expanded_abspath
from py_utilities.fs.path_utilities import filename
from py_utilities.fs.path_utilities import get_first_dir_path
from py_utilities.fs.path_utilities import get_first_file_path... | ryankanno/py-utilities | tests/fs/test_path_utilities.py | Python | mit | 1,597 |
'''
Created by auto_sdk on 2015.04.24
'''
from top.api.base import RestApi
class TradeAmountGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.fields = None
self.tid = None
def getapiname(self):
return 'taobao.trade.amount.get'
| colaftc/webtool | top/api/rest/TradeAmountGetRequest.py | Python | mit | 317 |
BACKUPPC_DIR = "/usr/share/backuppc"
TARGET_HOST = "192.168.1.65"
BACKUPPC_USER_UID = 110
BACKUPPC_USER_GID = 116
DEBUG = False
TRANSLATIONS = {
'Status_idle': 'inattivo',
'Status_backup_starting': 'avvio backup',
'Status_backup_in_progress': 'backup in esecuzione',
'Status_restore_starting': 'avvio ri... | GiorgioAresu/backuppc-pi-display | settings.py | Python | mit | 1,278 |
# coding=utf-8
import multiprocessing
workers = multiprocessing.cpu_count() * 2 + 1
# worker_class = "gaiohttp"
max_requests = 1000
max_requests_jitter = 100
preload = True
sendfile = True
pidfile = "pid/app.pid"
accesslog = "log/access.log"
errorlog = "log/error.log"
| kavu/okeetee | gunicorn.config.py | Python | mit | 275 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Module containing methods for comment preprocessing (cleaning) """
class Comment(object):
"""
Comment Entity.
Besides getters and setters it handlers simple preprocessing methods
"""
def __init__(self, comment_string):
self._comment = comme... | rluch/InfoMine | infomine/comment.py | Python | mit | 1,716 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
import os
import logging
from textwrap import dedent
import collections
import pytest
import mock
from gcdt_testtools.helpers import temp_folder, create_tempfile, cleanup_tempfiles
from gcdt_testtools import helpers
from gcdt_bundler.pyth... | glomex/gcdt-bundler | tests/test_python_bundler.py | Python | mit | 7,149 |
from django.apps import AppConfig
from django.utils.translation import ugettext as __, ugettext_lazy as _
class TaskerConfig(AppConfig):
name = 'django_tasker'
verbose_name = _('tasker')
| wooyek/django-tasker | django_tasker/apps.py | Python | mit | 197 |
# 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/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/aio/operations/_express_route_gateways_operations.py | Python | mit | 22,493 |
"""reactor URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | largetalk/tenbagger | capital/reactor/reactor/urls.py | Python | mit | 861 |
"""
Django settings for detest project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | tahpee/detest | detest/detest/settings.py | Python | mit | 2,968 |
import os
from airtng_flask.config import config_env_files
from flask import Flask
from flask_bcrypt import Bcrypt
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
db = SQLAlchemy()
bcrypt = Bcrypt()
login_manager = LoginManager()
def create_app(config_name='development', p_db=db, p_bcry... | TwilioDevEd/airtng-flask | airtng_flask/__init__.py | Python | mit | 801 |
"""Test cltk.phonology."""
__author__ = ['Jack Duff <jmunroeduff@gmail.com>', "Clément Besnier <clemsciences@aol.com>"]
__license__ = 'MIT License. See LICENSE.'
import unicodedata
from cltk.phonology.arabic.romanization import transliterate as AarabicTransliterate
from cltk.phonology.greek import transcription as gr... | TylerKirby/cltk | cltk/tests/test_nlp/test_phonology.py | Python | mit | 40,764 |
import c_interface_functions as CI
| MichaelDAlbrow/pyDIA | Code/DIA_CPU_header.py | Python | mit | 35 |
# 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/network/azure-mgmt-network/azure/mgmt/network/v2018_02_01/operations/_route_tables_operations.py | Python | mit | 29,837 |
# 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/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/__init__.py | Python | mit | 706 |
from test_schematic_base import TestSchematicBase
from unittest.mock import call, patch
from werkzeug.datastructures import OrderedMultiDict
from io import BytesIO
import os
import pytest
class TestSchematicUpload(TestSchematicBase):
def setup(self):
TestSchematicBase.setup(self)
self.uploads_dir = self.ap... | Frumple/mrt-file-server | tests/test_schematic_upload.py | Python | mit | 9,055 |
class Solution(object):
def hammingDistance(self, x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
x = x ^ y # Logical XOR
y = 0
while x:
y += 1
x = x & (x-1)
return y
| DJ-Tai/practice-problems | leet-code/python/solution-461-hamming-distance.py | Python | mit | 293 |
#!/usr/bin/env python
import random
import socket
import struct
import sys
import time
CABINET_VERSION='1.0b'
START_MSG='## Cabinet version %s ##' % (CABINET_VERSION)
MCAST_GRP = ('224.19.79.1', 9999)
DRAWERS = 9
USE_PULLUPS = 1
WAIT_DELAY = 0.5 #seconds
count = 0
if __name__ == '__main__':
c_state = [T... | simbits/Lumiere | cabinet_test.py | Python | mit | 4,132 |
"""
TW Interaction Puller
by @tonsai
License : MIT License
"""
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
from config import config, pushbullet_token
from pushbullet import PushBullet
import json
class StdOutListener(StreamListener):
""" A listener hand... | ton212/TW-Interaction-Pull | main.py | Python | mit | 2,254 |
# Third party
import astropy.units as u
import pytest
import numpy as np
# This project
from ..core import PotentialBase, CompositePotential
from ...common import PotentialParameter
from ..builtin import (KeplerPotential, HernquistPotential,
HenonHeilesPotential)
from ..ccompositepotential impo... | adrn/gala | gala/potential/potential/tests/test_composite.py | Python | mit | 5,631 |
from kerapu.boom.boom_parameter.BoomParameter import BoomParameter
from kerapu.lbz.Subtraject import Subtraject
class ZorgActiviteitCode(BoomParameter):
"""
Klasse voor boomparameter zorgactiviteit.
Boomparameternummers: 300, 400, 500.
"""
# ------------------------------------------------------... | SetBased/py-kerapu | kerapu/boom/boom_parameter/ZorgActiviteitCode.py | Python | mit | 1,545 |
# Say hello to Django
| obiwanus/django-qurl | qurl/models.py | Python | mit | 22 |
"""
WSGI config for VinTwitta 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
from whitenoise.django import Dj... | lucabezerra/VinTwitta | VinTwitta/wsgi.py | Python | mit | 500 |
#!/usr/bin/env python2.7
#Author:Steven Jimenez
#Subject: Python Programming
#HW 1
#Merge Sort that Calls a non-recursive function to sort lists
def mergesort(a):
#if singleton return singleton
if len(a)==1:
return a
#find mindpoint of list
n = len(a)/2
#split the list into sorted halves. left-... | Bedrock02/General-Coding | Sorting/mergesort.py | Python | mit | 1,720 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-07 19:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('posts', '0001_initial'),
]
operations = [
migrations.AlterField(
... | rodriguesrl/reddit-clone-udemy | posts/migrations/0002_auto_20170307_1920.py | Python | mit | 419 |
#!/usr/bin/env python
#
# Jetduino Example for using the Grove Thumb Joystick (http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick)
#
# The Jetduino connects the Jetson and Grove sensors. You can learn more about the Jetduino here: http://www.NeuroRoboticTech.com/Projects/Jetduino
#
# Have a question about t... | NeuroRoboticTech/Jetduino | Software/Python/grove_thumb_joystick.py | Python | mit | 3,602 |
import os
import sys
import errno
import random
import glob
import tkinter
from tkinter import filedialog
import pyautogui
import time
import configparser
root = tkinter.Tk()
root.withdraw()
#Setting current Dir
dir_path = os.path.dirname(os.path.realpath(__file__))
#Move mouse to upper left screen to kill in case ... | toptotem/randinterq | randinterq.py | Python | mit | 7,003 |
# -*- coding: utf-8 -*-
"""Define the top-level function for the ``sync-npm`` cli.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import time
from aspen import log
from gratipay import wireup
from gratipay.sync_npm import consume_change_stream, get_last_seq, production_change_... | gratipay/gratipay.com | gratipay/cli/sync_npm.py | Python | mit | 1,160 |
from price_monitor.models import Site, Price, SiteQuery
import json
from os import path
import os
import logging
logging.basicConfig(level=logging.DEBUG, filename="logfile", filemode="a+",
format="%(asctime)-15s %(levelname)-8s %(message)s")
logger = logging.getLogger(__name__)
class DataLoader(o... | jasonljc/enterprise-price-monitor | django_monitor/price_monitor/spider/data_loader.py | Python | mit | 3,067 |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class NavConfig(AppConfig):
name = 'cms.nav'
verbose_name = _('Navigation')
| HurtowniaPixeli/pixelcms-server | cms/nav/apps.py | Python | mit | 176 |
"""This is a wrapper for the pyusb-implementation of the seabreeze-library
"""
from .wrapper import (SeaBreezeError,
SeaBreezeDevice,
initialize,
shutdown,
device_list_devices,
device_open,
... | TobiasNils/python-seabreeze | seabreeze/pyseabreeze/__init__.py | Python | mit | 3,030 |
"""
Created on Dec 19, 2014
@author: rgeorgi
This script is used to point at a dump of the ODIN database and extract the specified language from it.
"""
# Built-in imports -------------------------------------------------------------
import argparse, re, logging
import sys
EXTR_LOG = logging.getLogger('LANG_EXTRACT... | rgeorgi/intent | intent/scripts/igt/extract_lang.py | Python | mit | 2,741 |
"""
Yanker
Usage:
yanker [--threads=<tnum>]
"""
__version__ = '1.0.1'
import Queue
import threading
import youtube_dl as ydl
import pyperclip as clip
import time
from docopt import docopt
class ErrLogger(object):
def debug(self, msg):
pass
def warning(self, msg):
pass
def error(sel... | Battleroid/yanker | yanker/yanker.py | Python | mit | 2,508 |
import pywikibot
pywikibot.config.family = "wikipedia"
pywikibot.config.mylang = "en"
site = pywikibot.Site()
site.login()
class AFDRelistedNullEditor(object):
"""Makes a null edit to AfDs transcluded in the logs on [[Category:Relisted AfD debates]]"""
def __init__(self):
self.afd_prefix = "Wikiped... | HazardSJ/HazardBot | enwiki/afd_relisted_null_editor.py | Python | mit | 1,048 |
"""
Django settings for web-application project.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import environ
# (chaosdorf-pizza/config/settings/base.py - 3 = ... | chaosdorf/chaospizza | src/config/settings/base.py | Python | mit | 5,807 |
#!/usr/bin/env
#(C) Mugfoundation 2014
#Available under MIT license
import click
import hashlib
c = hashlib.sha512()
@click.command()
@click.option('--setup', 'setup', help='Setup new project', type=str)
@click.option('-x', '--major', 'major', help='major version setter', type=int)
@click.option('-y', '--minor', 'min... | MugFoundation/versioneer | cli/versioneer.py | Python | mit | 743 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-12 20:09
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('eventstatistics', '0004_auto_20170112_2007'),
]
operations = [
migrations.RenameFie... | awyrough/xsoccer | xsoccer/eventstatistics/migrations/0005_auto_20170112_2009.py | Python | mit | 461 |
from cherrypy.process.plugins import PIDFile
import argparse
import cherrypy
from PressUI.cherrypy.PressConfig import PressConfig
import PressUI.cherrypy.PressProduction as PressProduction
parser = argparse.ArgumentParser()
parser.add_argument(
'--production',
help = 'Run app in production mode',
action =... | maarons/pressui | cherrypy/server.py | Python | mit | 1,340 |
# Copyright 2004 by Bob Bussell. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""NOEtools: For predicting NOE coordinates from assignment data.
The input and output are model... | zjuchenyuan/BioWeb | Lib/Bio/NMR/NOEtools.py | Python | mit | 3,420 |
#!/usr/bin/env python
# encoding: utf-8
import re
import os
try:
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
except ImportError:
from distutils.core import setup, Extension
from distutils.command.build_ext import build_ext as _build_ext
de... | timothydmorton/transit | setup.py | Python | mit | 4,320 |
import json
from ..compatpatch import ClientCompatPatch
class CollectionsEndpointsMixin(object):
"""For endpoints in related to collections functionality."""
def list_collections(self):
return self._call_api('collections/list/')
def collection_feed(self, collection_id, **kwargs):
"""
... | ping/instagram_private_api | instagram_private_api/endpoints/collections.py | Python | mit | 3,411 |
import json
import numpy as np
import matplotlib.pyplot as plt
j = json.load(open('scripts/fullTrials.json', 'r'))
for scenario in j[-6:]:
obst = []
ave_score = []
for t in scenario['results']:
obst.append(t['obstacles'])
ave_score.append(np.mean(t['scores']))
plt.plot(obst, ave_score, label=scenario['scenar... | brychanrobot/orrt-star-cpp | scripts/plot_trials.py | Python | mit | 437 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-02 14:37
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.postgres.fields.hstore
from django.db import migrations, models
import django.db.models.deletion
from django.contrib.postgres.operations import HStoreEx... | ayarshabeer/drf_shop | products/migrations/0001_initial.py | Python | mit | 5,291 |
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from .__version__ import __author__, __copyright__, __email__, __license__, __version__
from ._align import Align
from ._align_getter import align_getter
from ._column import ColumnDataProperty
from ._common import MAX_STRICT_LEVEL_MAP, MIN_STRICT... | thombashi/DataProperty | dataproperty/__init__.py | Python | mit | 792 |
# Template loader to retrieve templates from the database
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from pages.models import Page
from appearance.models import Template
class DBTemplateLoader(BaseLoader):
is_usable = True
def load_template_source(self, te... | bevenky/dev-cms | dev_cms/loader.py | Python | mit | 890 |
# 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/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_models_py3.py | Python | mit | 123,002 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Entity',
fields=[
('id', models.AutoField(verbo... | mattwaite/CanvasStoryArchive | stories/migrations/0001_initial.py | Python | mit | 1,746 |
# --------------------------------------------------------------------------------------------
# Copyright (c) jehama. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------------------------... | jehama/OSINThadoop | FieldModifiers/edit_heartbleed_timestamp.py | Python | mit | 4,926 |
#!/usr/bin/env python2.7
import sys, getopt
if len(sys.argv) < 3:
print """
Usage: compare_blast.py <input1.b6> <input2.b6>
"""
blast1= sys.argv[1]
blast2= sys.argv[2]
dict1= {}
for line in open(blast1):
line= line.strip().split("\t")
query= line[0].split()[0]
dict1[query]= line
dict2= {}
for line ... | alexherns/biotite-scripts | compare_blasts.py | Python | mit | 1,490 |
from FuXi.Horn.HornRules import HornFromN3
rules = HornFromN3(
'http://www.agfa.com/w3c/euler/rdfs-rules.n3')
for rule in rules:
print(rule)
| mpetyx/pyrif | 3rdPartyLibraries/FuXi-master/examples/example7.py | Python | mit | 149 |
"""simpleneed URL Configuration.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | b3j0f/simpleneed | www/simpleneed/urls.py | Python | mit | 1,471 |
from flask import Flask, jsonify, request
from btree import Tree
from asteval_wrapper import Script
# Startup stuff
app = Flask(__name__)
app.config.from_object('config')
# Jinja initialization to use PyJade
app.jinja_env.add_extension('pyjade.ext.jinja.PyJadeExtension')
# Global jinja functions
app.jinja_env.global... | Snuggert/moda | project/app/__init__.py | Python | mit | 1,446 |
# 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... | ininex/geofire-python | resource/lib/python2.7/site-packages/test/test_api_callable.py | Python | mit | 15,734 |
# DOCUMENTATION (explain args too)
from bidict import bidict
import sys
pieces = []
kmers = []
debruijn = bidict()
# filename = raw_input("Filename: ")
filename = sys.argv[1]
if filename[-4:] == ".csv":
with open(filename, "r") as infile:
for line in infile:
line = line.strip()
... | qwertie64982/Coding4Medicine-2017 | Jigsaw/debruijn.py | Python | mit | 2,134 |
from django import db
#from django.core.management.base import NoArgsCommand
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Sum
from data.models import CffrRaw, CffrProgram, CffrState, State, County, Cffr, CffrIndividualCounty, CffrIndividualState
from django.db import co... | npp/npp-api | data/management/commands/load_cffr.py | Python | mit | 12,123 |
#!/usr/bin/python3
#
# Copyright (c) 2014-2022 The Voxie Authors
#
# 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,... | voxie-viewer/voxie | filters/downsample.py | Python | mit | 3,821 |
#!/usr/bin/python3
import json
import numpy as np
import random
class Payload():
'''
Instance contains altitude data for a balloon flight. Use alt() method
to get interpolated data.
'''
addr = None
name = "Payload"
time_index = 0.0 # index into the flight profile data, in seconds.
tim... | liberza/bacon | simulator/payload.py | Python | mit | 4,318 |
"""
"""
import os
import sys
import argparse
from roblib import bcolors, stream_blast_results
__author__ = 'Rob Edwards'
def self_bit_scores(blastf, verbose=False):
"""
Generate a dict of self:self bitscores
"""
ss = {}
for b in stream_blast_results(blastf, verbose):
if b.query == b.db:
... | linsalrob/EdwardsLab | phage_clustering/bit_score.py | Python | mit | 3,193 |
from mock import patch, Mock
from nose.tools import istest
from unittest import TestCase
from structominer import Document, Field
class DocumentTests(TestCase):
@istest
def creating_document_object_with_string_should_automatically_parse(self):
html = '<html></html>'
with patch('structom... | aGHz/structominer | tests/test_document.py | Python | mit | 1,199 |
import pypm
from bl.utils import getClock
from bl.debug import debug
__all__ = ['init', 'initialize', 'getInput', 'getOutput', 'printDeviceSummary',
'ClockSender', 'MidiDispatcher', 'FUNCTIONS', 'ChordHandler',
'MonitorHandler', 'NoteEventHandler']
class PypmWrapper:
"""
Simple wrapper... | djfroofy/beatlounge | bl/midi.py | Python | mit | 11,595 |
import os
import logging
import argparse
from gii.core import Project, app
from gii.core.tools import Build
cli = argparse.ArgumentParser(
prog = 'gii build',
description = 'Build GII Host(s) for current project'
)
cli.add_argument( 'targets',
type = str,
nargs = '*',
default = 'native'
)
cli.add_argument( ... | tommo/gii | tools/build/__init__.py | Python | mit | 1,086 |
#!/usr/bin/env python
# Copyright (C) 2007 Giampaolo Rodola' <g.rodola@gmail.com>.
# Use of this source code is governed by MIT license that can be
# found in the LICENSE file.
import contextlib
import errno
import select
import socket
import sys
import time
from pyftpdlib._compat import PY3
from pyftpdlib.ioloop im... | aliyun/oss-ftp | python36/unix/lib/pyftpdlib/test/test_ioloop.py | Python | mit | 19,088 |
#
# Copyright 2019 XEBIALABS
#
# 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, publish, distribute, subli... | xebialabs-community/xlr-xldeploy-plugin | src/main/resources/xlr_xldeploy/XLDVersionsTile.py | Python | mit | 1,585 |
#!/usr/bin/env python
"""
role of player
"""
ROLE_ADMIN = 'admin'
ROLE_USER = 'user'
| marlboromoo/basinboa | basinboa/user/role.py | Python | mit | 87 |
# -*- noplot -*-
# print png to standard out
# usage: python print_stdout.py > somefile.png
import sys
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
plt.savefig(sys.stdout)
plt.show()
| bundgus/python-playground | matplotlib-playground/examples/pylab_examples/print_stdout.py | Python | mit | 233 |
from aimacode.logic import PropKB
from aimacode.planning import Action
from aimacode.search import (
Node, Problem,
)
from aimacode.utils import expr
from lp_utils import (
FluentState, encode_state, decode_state,
)
from my_planning_graph import PlanningGraph
class AirCargoProblem(Problem):
def __init__(s... | fbrei/aind | planning/my_air_cargo_problems.py | Python | mit | 11,755 |
# Copyright 2017 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... | xuleiboy1234/autoTitle | tensorflow/tensorflow/examples/speech_commands/train.py | Python | mit | 16,617 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Julien Chaumont"
__copyright__ = "Copyright 2014, Julien Chaumont"
__licence__ = "MIT"
__version__ = "1.0.2"
__contact__ = "julienc91 [at] outlook.fr"
import flickrapi
import os, sys
import re
from config import *
class ShFlickr:
##
# Connexion to F... | julienc91/ShFlickr | main.py | Python | mit | 6,714 |
from OpenGLCffi.GL import params
@params(api='gl', prms=['len', 'string'])
def glStringMarkerGREMEDY(len, string):
pass
| cydenix/OpenGLCffi | OpenGLCffi/GL/EXT/GREMEDY/string_marker.py | Python | mit | 123 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.