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 |
|---|---|---|---|---|---|
#!BPY
# -*- coding: UTF-8 -*-
# import pose bone constraints
#
# 2017.10.22 Natukikazemizo
import bpy
import os
import utils_log
import utils_io_csv
# Constants
WORK_FILE_NAME = "pose_constraints.csv"
BONE_NAME = 0
CONSTRAINT_NAME = 1
MUTE = 2
TARGET = 3
SUBTARGET_BONE_NAME = 4
EXTRAPOLATE = 5
FROM_MIN_X = 6
FROM_... | natukikazemizo/sedna | Sedna/src/python/pose_constraints_imp.py | Python | mit | 3,583 |
# !/usr/bin/python
# -*- coding: utf-8 -*-
import sys
from PySide.QtGui import *
from emokit.emotiv import Emotiv
from PlottingWidget import PlottingWidget
from HeadStatusWidget import HeadStatusWidget
import pyqtgraph as pg
import datetime
import time
sys.path.append('../util')
from PacketParser import PacketParser
... | EmokitAlife/EmokitVisualizer | UI/Record.py | Python | mit | 5,654 |
#!/usr/bin/env python
import csv
import sys
from datetime import datetime, timedelta
import itertools
import operator
import os
use_colors = sys.stdout.isatty()
if use_colors:
try:
import colorama
if os.name == 'nt':
colorama.init(strip=True, convert=True)
else:
co... | bqqbarbhg/workcalc | workcalc.py | Python | mit | 3,917 |
from bottle import route, run, template, static_file, response, request
from json import dumps
#import serial
import time
#ser = serial.Serial('COM3', 9600, timeout=0)
#ser.readlines()
@route('/assets/:path#.+#', name='assets')
def static(path):
return static_file(path, root='assets')
@route('/')
def index():
... | brunoliveira8/nasa-challenge | rover-system.py | Python | mit | 795 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from keras.models import model_from_yaml
def generate_nnet(feats):
"""Generate a neural network.
Parameters
----------
feats : list with at least one feature vector
Returns
-------
Neural network object
"""
# Load it h... | TensorVision/MediSeg | AP4/model-401-sst/sliding_window_keras.py | Python | mit | 1,915 |
#!/usr/bin/env python
from distutils.core import setup
from pip.req import parse_requirements
install_reqs = parse_requirements('requirements.txt')
setup(
name='hadoop-parallel',
version='0.0.1',
author='Alex Pirozhenko',
author_email='alex.pirozhenko@gmail.com',
packages=['hadoop_paral... | alex-pirozhenko/hadoop-parallel | setup.py | Python | mit | 442 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
import tempfile
import sys
import subprocess
import logging
try:
from unittest import mock # py3
except ImportError:
import mock # NOQA - requires "pip install mock"
from os.path import join as pathjoin
import codecs
import difflib
impo... | btimby/fulltext | fulltext/test/__init__.py | Python | mit | 30,303 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# RushHourGame documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 24 19:39:09 2017.
#
# 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... | yasshi2525/rushhourgame | docs/spec/conf.py | Python | mit | 6,528 |
# -*- coding: utf-8 -*-
from .feature_extractor import FeatureExtractor
class Char(FeatureExtractor):
"""Feature vectors for normalization as character-based tagging.
"""
def _get_sequenced(self, seq, pos, history=None):
joined = ''.join(history).replace("__EPS__", "")
features = {}
... | mbollmann/perceptron | mmb_perceptron/feature_extractor/norm_char.py | Python | mit | 1,020 |
import sys
from setuptools import setup, find_packages
deps = ["jinja2", "distribute", "virtualenv", "beautifulsoup4"]
if sys.version_info[:2] == (2, 6):
deps.append('argparse')
setup(
name='pywizard',
version='0.7.1',
packages=find_packages(exclude=("test.*",)),
entry_points={
'cons... | pywizard/pywizard | setup.py | Python | mit | 882 |
import enchant
TWITTER = 'twitter'
INSTAGRAM = 'instagram'
FACEBOOK = 'facebook'
WECHAT = 'wechat'
WHATSAPP = 'whatsapp'
GOOGLE = 'google'
LINKEDIN = 'linkedin'
LINKDIN = 'linkdin'
SOCIAL_MEDIAS = [TWITTER, INSTAGRAM, FACEBOOK, WECHAT, WHATSAPP, GOOGLE, LINKEDIN, LINKDIN]
class SocialExtractor:
def __init__(self, ... | r-kapoor/dig-socialmedia-id-extractor | digSocialMediaIdExtractor/social_extractor.py | Python | mit | 2,890 |
# -*- coding: utf-8 -*-
msg = {
'en': {
'add_text-adding': u'Robot: Adding %(adding)s',
},
# Author: Csisc
'qqq': {
'add_text-adding': u'Edit summary when the bot adds text to a given page. %(adding)s is the added text truncated to 200 characters.',
},
# Author: Csisc
'aeb': {
'add_text-adding': u'بوت: إضا... | legoktm/pywikipedia-rewrite | scripts/i18n/add_text.py | Python | mit | 15,557 |
import unittest
import mock
import copy
import itertools
from biokbase.workspace.baseclient import ServerError
from biokbase.narrative.app_util import map_inputs_from_job, map_outputs_from_state
from biokbase.narrative.jobs.job import (
Job,
COMPLETED_STATUS,
EXCLUDED_JOB_STATE_FIELDS,
JOB_ATTRS,
JO... | kbase/narrative | src/biokbase/narrative/tests/test_job.py | Python | mit | 32,811 |
import sys
from file_assistant import *
from settings import settings
from parser import ShotParser
class Shot:
def __init__(self, filename, logging=False):
self.filename = get_template_path(shotify(filename))
self.logging = logging
if settings.developing or not isfile(htmlify(self.filena... | davidsteinberg/shots | shots/shot.py | Python | mit | 1,723 |
import time
from datetime import timedelta
try:
from HTMLParser import HTMLParser
from urlparse import urljoin, urldefrag
except ImportError:
from html.parser import HTMLParser
from urllib.parse import urljoin, urldefrag
from tornado import httpclient, gen, ioloop, queues
base_url = 'http://docs.ansi... | tao12345666333/Talk-Is-Cheap | python/tornado/spider/ansible_doc_spider.py | Python | mit | 2,956 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'C:/Users/Zeke/Google Drive/dev/python/zeex/zeex/core/ui/file.ui'
#
# Created: Mon Nov 13 22:57:14 2017
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, ... | zbarge/zeex | zeex/core/ui/file_ui.py | Python | mit | 10,990 |
from ann_util import *
use_bias = 1
class ANN(object):
"""docstring for ANN"""
def __init__(self, layer_sizes):
self.layers =[]
self.learn_rate = 0.1
self.squash = sigmoid
self.deriv_squash = deriv_sigmoid
for i in range(len(layer_sizes)):
layer_size = layer_sizes[i]
prev_layer_size = 0 if i == 0 els... | ssreza/insights | ann.py | Python | mit | 3,940 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import re
import string
from math import ceil
import sys
from PyQt4 import QtGui
class Converter():
def main(self, folder):
conFilePath, jpgPaths = self.read_folder_contents(folder)
numFiles, splitCoords = self.read_con_file(conFilePath)
... | JRMeyer/Autotrace | under-development/analysis/edgetrak_converter.py | Python | mit | 5,041 |
import requests
import json
from hamper.interfaces import ChatCommandPlugin, Command
class Timez(ChatCommandPlugin):
name = 'timez'
priority = 2
def setup(self, loader):
try:
self.api_key = loader.config['timez']['api-key']
except (KeyError, TypeError):
self.api_k... | hamperbot/hamper | hamper/plugins/timez.py | Python | mit | 2,000 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of the web2py Web Framework
Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
This file is based, although a rewrite, on MIT-licensed code from the Bottle web framework.
"""
import os,... | SEA000/uw-empathica | empathica/anyserver.py | Python | mit | 11,418 |
import _plotly_utils.basevalidators
class LabelValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="label", parent_name="splom.dimension", **kwargs):
super(LabelValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/splom/dimension/_label.py | Python | mit | 398 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
import shutil
import pytest
from icon_font_to_png import command_line
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
# Tests
def test_list_option(capfd):
"""Test listing CSS icons"""
css_file = os.path.join... | Pythonity/icon-font-to-png | icon_font_to_png/test/test_command_line.py | Python | mit | 4,426 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import sys
from cli_app import log
from cli_app import options
from cli_app import output
LOG = log.Logger.get()
def main():
# configargparse raises a SystemExit on error
args = options.Options().parse()
LOG.debug(args)
out = output.Output(args.text)
... | xamurej/py3-cli-skel | cli_app/cli.py | Python | mit | 390 |
"""Test script for DanceCatConsole."""
from __future__ import print_function
import os
import pytest
import datetime
from dateutil.relativedelta import relativedelta
from os import remove
from sqlalchemy import inspect
from DanceCat import Console
db_test_path = os.getcwd() + '/.test_console'
if not os.path.exists(d... | scattm/DanceCat | tests/test_dance_cat_console.py | Python | mit | 3,472 |
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired()])
password = PasswordField('Password', validators=[DataRequired()])
... | frainfreeze/studying | home/python/microblog/app/forms.py | Python | mit | 398 |
# coding=utf-8
import os
import unittest
from conans.model.ref import ConanFileReference
from conans.test.utils.tools import TestClient, GenConanfile
from conans.util.files import mkdir
class TransitiveEditableTest(unittest.TestCase):
def test_transitive_editables(self):
# https://github.com/conan-io/c... | conan-io/conan | conans/test/integration/editable/transitive_editable_test.py | Python | mit | 1,341 |
# -*- coding: utf-8 -*-
import humanize
import gevent
from datetime import datetime, timedelta
from disco.bot import CommandLevels
from disco.util.sanitize import S
from disco.types.message import MessageEmbed
from disco.types.channel import ChannelType
from rowboat.plugins import RowboatPlugin as Plugin, CommandFai... | ThaTiemsz/jetski | rowboat/plugins/reminders.py | Python | mit | 11,141 |
# import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215)
import multiprocessing
assert multiprocessing
import re
from setuptools import setup, find_packages
def get_version():
"""
Extracts the version number from the version.py file.
"""
VERSION_FILE = 'rabbitmq_admin/v... | ambitioninc/rabbitmq-admin | setup.py | Python | mit | 1,954 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Bartosz Janda
#
# 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 w... | bartoszj/Mallet | mallet/UIKit/UITableViewCell.py | Python | mit | 3,568 |
import argparse
import logging
from rpi_twitter.helpers import authenticate, timestamp
def post_tweet(contents, add_time_stamp=False, reply_to=None, conf_file=None):
api = authenticate(conf_file=conf_file)
# Add a time stamp to the beginning
time_stamp = ""
if add_time_stamp:
time_stamp = ti... | agude/raspberry-pi-twitter-bot | rpi_twitter/t.py | Python | mit | 2,208 |
import logging
from collections import defaultdict
from django.core.urlresolvers import reverse
from django.template import TemplateSyntaxError, Variable
from mezzanine.pages.models import Page
from mezzanine import template
from mezzanine.template.loader import get_template
register = template.Library()
@registe... | cartwheelweb/mezzanine_superfish | mezzanine_superfish/templatetags/mezzanine_superfish_tags.py | Python | mit | 2,839 |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012 Cloudscaling Group, Inc.
# All Rights Reserved.
#
# Licens... | xgfone/snippet | snippet/example/python/sqlalchemy-orm-model.py | Python | mit | 3,895 |
import requests
import csv
import time
import re
from bs4 import BeautifulSoup
CSE_CATALOG_URL = 'https://cse.ucsd.edu/undergraduate/courses/prerequisites-cse-undergraduate-classes'
def clean(string, utf8=None):
string = string.encode('utf-8')
replace_values = [(u"\xa0".encode('utf-8'), " "), (u"\u2014".encode('u... | jeff4elee/course_path | course_path/home/catalog_scraper.py | Python | mit | 3,958 |
__author__ = 'Kovachev'
from django.conf.urls import patterns, include, url
from django.views.generic import ListView, DetailView
from apps.post.models import Post
urlpatterns = [
url(r'^$', ListView.as_view(
queryset=Post.objects.filter(approved=True).order_by("created")[:5],
template_name='index... | Lyudmil-Kovachev/vertuto | vertuto/apps/home/urls.py | Python | mit | 346 |
""" Base class for all taemin plugin """
import itertools
MAX_MSG_LENGTH = 400
class TaeminPlugin(object):
helper = {}
def __init__(self, taemin):
self.taemin = taemin
def start(self):
pass
def stop(self):
pass
def on_join(self, connection):
pass
def on_pu... | ningirsu/taemin | taemin/plugin.py | Python | mit | 1,367 |
# -*- coding: utf-8 -*-:
from django.contrib.auth import get_user_model
from resrc.userprofile.models import Profile
def karma_rate(user_pk, diff):
user = Profile.objects.get(user__pk=user_pk)
if user.karma:
user.karma += diff
else:
user.karma = diff
user.save()
| sergiolimajr/resrc | resrc/utils/karma.py | Python | mit | 297 |
from django.conf.urls import url, include
from django.contrib import admin
from . import views
urlpatterns = [
# index images
url(r'^$', views.index, name = 'image_index'),
url(r'^imageboard/$', views.index, name = 'image_index'),
# images urls
url(r'^imageboard/(?P<image_id>[0-9]+)/$', views.det... | gmunumel/django_imageboard | imageboard/urls.py | Python | mit | 1,402 |
import os
import json
import argparse
import cPickle as pkl
from collections import defaultdict
from tqdm import tqdm
from dataset import VidVRD
from baseline import segment_video, get_model_path
from baseline import trajectory, feature, model, association
def load_object_trajectory_proposal():
"""
Test loa... | xdshang/VidVRD-helper | baseline.py | Python | mit | 4,731 |
# Copyright (c) 2016 Fabian Kochem
| conceptsandtraining/libtree | tests/__init__.py | Python | mit | 35 |
# -*- coding: utf-8 -*-
import os
import sys
from logging import getLogger
import Consts
import App
import util
logger = getLogger(__name__)
def _add_new(builder, module_id, new, curdeps, cur):
if module_id in curdeps:
entry = curdeps[module_id]
if entry['revision'] == new['revision']:
... | nishemon/marun | marun/sub_install.py | Python | mit | 4,561 |
"""
Django settings for Asteria project.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
For considerations when deploying to production, see
https://docs.djangoprojec... | elespike/Asteria | asteria/settings.py | Python | mit | 6,095 |
from sympy import symbols, integrate, pi, lambdify, Number, sin
from numpy.polynomial.legendre import leggauss
import scipy.sparse.linalg as sparse_la
import lega.fourier_basis as fourier
import lega.shen_basis as shen
import lega.legendre_basis as leg
from lega.common import tensor_product, function
from lega.legendr... | MiroK/lega | sandbox/fourier_legendre.py | Python | mit | 1,358 |
import b64cy
import b64_mod
import en_word
import grouper
def keyfreq(filename , flag = 0):
if flag == 0:
canadateList = []
thefile = open(filename)
linenumber = 0
total = 0
greatestvalL = []
greatestnumber = 0
greatestnumberL = []
glinenumberL = [... | Stbot/PyCrypt | first writes/keyfinder.py | Python | mit | 4,888 |
from collections import namedtuple
"""
G = (E, V)
"""
Edge = namedtuple("Edge", ['to', 'weight'])
class Graph(object):
def __init__(self):
self.vertices = {}
def add_vertex(self, v):
if v not in self.vertices:
self.vertices[v] = []
def get_edges(self, v):
if v in sel... | fcaneto/py_data_structures | graphs/graphs.py | Python | mit | 1,215 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import django
from django import forms
from django.core.urlresolvers import reverse
from django.forms.models import formset_factory
from django.middleware.csrf import _get_new_csrf_key
from django.template import (
TemplateSyntaxError, Conte... | RamezIssac/django-crispy-forms | crispy_forms/tests/test_form_helper.py | Python | mit | 22,508 |
__author__ = 'rochelle'
#!/usr/bin/env python
import datetime, time, calendar
import optparse, sys, os, traceback, errno
_defaults = {
'gdal_dir' : 'C:\\OSGeo4W\\bin',
'mrt_dir' : 'C:\\Program Files\\MODIS_MRT\\bin',
'temp_dir' : 'T:\WFP2\WFP2\Temp',
'base_data_dir' : 'T:\WFP2\VAMPIRE\data\Download',
... | spatialexplore/idn_vam_wfp | python/vampire/configGenerator.py | Python | mit | 22,343 |
from nose.tools import assert_equal
from .... import make
from ....core.mod import mod
from ...ut import need_scrapyd
from .. import name
@need_scrapyd
def test_spy_rss():
app = make()
with app.app_context():
for query in [
'CLASSIC MILK+PEACE and ALIEN',
'Beyond the SKY 混沌',
... | Answeror/torabot | torabot/mods/tora/test/test_spy.py | Python | mit | 453 |
from login import login
from logout import logout
from facebook import fbconnect, fbdisconnect
from google import gconnect, gdisconnect
from github import ghconnect, ghdisconnect
| stonescar/item-catalog | modules/views/login/__init__.py | Python | mit | 179 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "atlas.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| brainy-minds/brainy-atlas | atlas/manage.py | Python | mit | 248 |
import DoesNotComputeLocations
print DoesNotComputeLocations.locs[1].getDesc()
print DoesNotComputeLocations.locs[1].whatItemNeeded() | MrFlash67/Does-Not-Compute | locations1_test.py | Python | mit | 133 |
import os
from setuptools import setup, find_packages
VERSION = __import__('psi').__version__
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(name='django-psi',
version=VERSION,
description='Google Pagespeed Insights for your Django project.',
author='Kevin F... | montylounge/django-psi | setup.py | Python | mit | 849 |
class ftpinformation:
def __init__(self):
self.url = "YOUR-URL"
self.user = "YOUR-USERNAME"
self.password = "YOUR-PASSWORD"
self.port = 21
| ShashankSanjay/HOLLERVERSE-HACKMIT | twilio/sftpinfo.py | Python | mit | 148 |
# -*- encoding: utf-8 -*-
"""
Cron function
"""
import urllib2
from presence_analyzer.config import (
USERS_XML_FILE,
USERS_XML_URL,
)
def update_users_file():
"""
Download actual users data XML.
"""
remote_file = urllib2.urlopen(USERS_XML_URL)
local_file = open(USERS_XML_FILE, "w")
... | stxnext-kindergarten/presence-analyzer-klogaciuk | src/presence_analyzer/cron.py | Python | mit | 489 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-01 04:34
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('app.core', '0001_initial'),
]
operations = [
migrations.RenameField(
mo... | agustinhansen/SIDECO | app/core/migrations/0002_auto_20171001_0134.py | Python | mit | 415 |
"""
This module holds all of the networking code for the game. It has the following
submodules:
#. :mod:`.server`: This is the actual code for the server and it handles the
webhosting and creating connections.
#. :mod:`.websocket`: This contains the code for creating and handling all the
websocket based connecti... | Energy-Transistion/etg | etg/server/__init__.py | Python | mit | 772 |
"""Runs the PyExtTest project against all installed python instances."""
import sys, subprocess, python_installations
if __name__ == '__main__':
num_failed_tests = 0
for installation in python_installations.get_python_installations():
# Skip versions with no executable.
if installation.exec_pa... | SeanCline/PyExt | test/scripts/run_all_tests.py | Python | mit | 1,630 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-18 14:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('orders', '0001_initial'),
]
operations = [
migrations.AlterField(
... | pauljherrera/avantiweb | orders/migrations/0002_auto_20170318_1137.py | Python | mit | 1,360 |
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, o... | tlksio/tlksio | env/lib/python3.4/site-packages/pylint/checkers/__init__.py | Python | mit | 5,546 |
from datetime import datetime
import yaml
from concurrent.futures.thread import ThreadPoolExecutor
from tornado import ioloop, concurrent
from yaml.error import YAMLError
import re
from pipelines.api import PIPELINES_EXT
import os.path
import json
import logging
from uuid import uuid4
import base64
from tornado.web i... | Wiredcraft/pipelines | pipelines/api/utils.py | Python | mit | 5,447 |
from .r_dependencies import *
from .r_base import r_base
class r_geneticAlgorithm(r_base):
def calculate_geneticAlgorithm(self):
'''genetic algorithm
requires the GA or genalg package
e.g. http://www.r-bloggers.com/genetic-algorithms-a-simple-r-example/
'''
# TODO
# C... | dmccloskey/r_statistics | r_statistics/r_geneticAlgorithm.py | Python | mit | 691 |
def gameMode(gameModeID):
return {
-1: 'skipped',
0 : 'Unknown',
1 : 'All Pick',
2 : 'Captains Mode',
3 : 'Random Draft',
4 : 'Single Draft',
5 : 'All Random',
6 : '?? INTRO/DEATH ??',
7 : 'The Diretide',
8 : 'Reverse Captains Mode',
... | NNTin/Reply-Dota-2-Reddit | misc/idnamedict.py | Python | mit | 769 |
from django.conf.urls import url, include
from rest_framework import routers
from apps.api import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
] | daniel-afana/modern-django | apps/api/urls.py | Python | mit | 247 |
__version__ = '0.12.0'
default_app_config = 'mjml.apps.MJMLConfig'
| liminspace/django-mjml | mjml/__init__.py | Python | mit | 68 |
"""
Terminal-related utilities
--------------------------
"""
import os
import sys
from plumbum import local
from .progress import Progress
from .termsize import get_terminal_size
__all__ = (
"readline",
"ask",
"choose",
"prompt",
"get_terminal_size",
"Progress",
"get_terminal_size",
)
... | tomerfiliba/plumbum | plumbum/cli/terminal.py | Python | mit | 7,197 |
#/usr/local/env python
# Problem link: https://oj.leetcode.com/problems/merge-intervals/
# Definition for an interval.
class Interval:
def __init__(self, s=0, e=0):
self.start = s
self.end = e
def __repr__(self):
return "["+str(self.start)+","+str(self.end)+"]"
class Solution:
... | erichoco/LeetCodeOJ | Merge Intervals/merge_intervals.py | Python | cc0-1.0 | 1,413 |
from setuptools import setup, find_packages
setup(name='MODEL0848279215',
version=20140916,
description='MODEL0848279215 from BioModels',
url='http://www.ebi.ac.uk/biomodels-main/MODEL0848279215',
maintainer='Stanley Gu',
maintainer_url='stanleygu@gmail.com',
packages=find_packages(... | biomodels/MODEL0848279215 | setup.py | Python | cc0-1.0 | 377 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015-2018 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2... | unioslo/cerebrum | Cerebrum/config/loader.py | Python | gpl-2.0 | 6,272 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#... | MDAnalysis/mdanalysis | testsuite/MDAnalysisTests/utils/test_meta.py | Python | gpl-2.0 | 3,092 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | Frodox/buildbot | master/buildbot/steps/worker.py | Python | gpl-2.0 | 11,828 |
from languages import language
def input_float(text="", lang="en"):
lan = language[lang]
is_num = False
while is_num == False:
try:
num = float(input(text))
is_num = True
except ValueError:
print(lan["error_input_num"])
is_num = False
... | Nestyko/Root_Locus_Plot | user_input.py | Python | gpl-2.0 | 748 |
#!/usr/bin/env python
###
# Copyright 2015, EMBL-EBI
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | olgamelnichuk/NGSPyEasy | ngspyeasy/settings.py | Python | gpl-2.0 | 726 |
# -*- encoding: utf-8 -*-
"""
Equipe MCRSoftwares - AcadSocial
Versão do Código: 01v003a
Responsável: Victor Ferraz
Auxiliar: -
Requisito(s): -
Caso(s) de Uso: -
Descrição:
Definição dos formulários relacionados à aplicação de grupos e eventos.
"""
from django import forms
from datetime import datetime
from g... | MCRSoftwares/AcadSocial | grupos/forms.py | Python | gpl-2.0 | 8,770 |
"""
Copyright (C) 2014, Web Bender Consulting, LLC. - All Rights Reserved
Unauthorized copying of this file, via any medium is strictly prohibited
Proprietary and confidential
Written by Elijah Ethun <elijahe@gmail.com>
"""
from RPIO import PWM
from Sven.Module.RaspberryPi.Base import Base
from Sven.Methods import *
... | yarhajile/sven-daemon | Sven/Module/RaspberryPi/PWM.py | Python | gpl-2.0 | 8,241 |
import matplotlib
matplotlib.interactive(False)
matplotlib.use('WXAgg')
import wx
from pyoscope import PyOscope
from gui.mainframe import MainFrame
from gui.graphframe import GraphFrame
from gui.bindings import Binder
from wx.lib.mixins.inspection import InspectionMixin #DELME
class CPApp(wx.App, InspectionMixin)... | jlazear/cp | gui/app.py | Python | gpl-2.0 | 1,332 |
# ===========================================================================
import swap
import os,cPickle,atpy
# ======================================================================
"""
NAME
io
PURPOSE
Useful general functions to streamline file input and output.
COMMENTS
... | zooniverse/SpaceWarps | analysis/swap/io.py | Python | gpl-2.0 | 8,164 |
import sys, DNS
while 1:
query = raw_input("Enter domain name:")
DNS.DiscoverNameServers()
reqobj = DNS.Request()
answerobj = reqobj.req(name = query, qtype = DNS.Type.ANY)
print type(answerobj)
#if not len(answerobj):
# print "Not found."
for item in answerobj.answers:
print "%-5s... | sunzhongyu99/pythonscripts | dns-basic.py | Python | gpl-2.0 | 359 |
import random
import unittest
from sr.bitstr.generator import BitStringGenerator
from sr.bitstr.crossover import BitStringCrossover
class BitStringCrossoverTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
random.seed(10)
def setUp(self):
self.config = {
"max_popula... | chutsu/sr | sr/tests/bitstr/crossover_tests.py | Python | gpl-2.0 | 4,011 |
from builtins import map
from builtins import str
import subprocess
import os
import glob
from timemanager.utils.tmlogging import info, error
from timemanager.utils.os_util import get_os, WINDOWS
from timemanager.conf import FRAME_FILENAME_PREFIX, FRAME_EXTENSION
IMAGEMAGICK = "convert"
FFMPEG = "ffmpeg"
DEFAULT_ANI... | anitagraser/TimeManager | animation/animate.py | Python | gpl-2.0 | 2,804 |
#!/usr/bin/python
from __future__ import division
import matplotlib, sys
if not 'show' in sys.argv:
matplotlib.use('Agg')
from pylab import *
figure(figsize=(7,4))
eos = loadtxt("../../papers/hughes-saft/figs/equation-of-state.dat")
eos_exp = loadtxt("../../papers/hughes-saft/figs/experimental-equation-of-state.da... | droundy/deft | talks/colloquium/figs/equation-of-state.py | Python | gpl-2.0 | 799 |
#!/usr/bin/env python3
import matplotlib.pyplot as plt
def string_to_list(string):
return [int(i) for i in string.split(',')]
def get_data(path):
f = open(path)
f.readline()
data = []
for line in f:
data.append(string_to_list(line))
data = list(zip(*data))
subtract = 3
means =... | Lebuin/project-robotica | plot_part1.py | Python | gpl-2.0 | 1,984 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import time
import os
import subprocess
# print nice messages
def LogPrint(Message, Type = "INFO"):
print("[{DateOfMessage}] - [{TypeOfMessage}] - "
"{Message}".format(
DateOfMessage = time.strftime("%d.%m... | TheRedFireFox/AnimeSubBot | src/setup.py | Python | gpl-2.0 | 4,486 |
from . import GenericNameSet, GenericXMLParser, GenericLeafNode, GenericTerm
class GML(GenericXMLParser):
def __init__(self, xml_gml):
self.xml_gml = xml_gml
self.attributes = self.get_attributes_as_dict(self.xml_gml)
self.lang = self.get_attribute_from_dict('xml:lang', self.xml_gml)
... | pieterdp/LidoParser | parser/lido_elements/event_sub/event_place.py | Python | gpl-2.0 | 2,647 |
import yaml
import yaml.constructor
from collections import OrderedDict, MutableMapping
class OrderedDictYAMLLoader(yaml.Loader):
"""
A YAML loader that loads mappings into ordered dictionaries.
"""
def __init__(self, *args, **kwargs):
yaml.Loader.__init__(self, *args, **kwargs)
self... | DMS-Aus/Roam | src/roam/structs.py | Python | gpl-2.0 | 4,030 |
import unittest
import sys
from stackless import *
from support import StacklessTestCase
#test that thread state is restored properly
class TestExceptionState(StacklessTestCase):
def Tasklet(self):
try:
1/0
except Exception, e:
self.ran = True
ei = sys.exc_i... | newerthcom/savagerebirth | libs/python-2.72/Stackless/unittests/test_tstate.py | Python | gpl-2.0 | 1,948 |
"""SCons.Tool
SCons tool selection.
This looks for modules that define a callable object that can modify
a construction environment as appropriate for a given tool (or tool
chain).
Note that because this subsystem just *selects* a callable that can
modify a construction environment, it's possible for people to defin... | IljaGrebel/OpenWrt-SDK-imx6_HummingBoard | staging_dir/host/lib/scons-2.3.5/SCons/Tool/__init__.py | Python | gpl-2.0 | 34,232 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | sbesson/zeroc-ice | java/test/Glacier2/router/run.py | Python | gpl-2.0 | 1,753 |
""" NOTICE: port of 'contrib' Pygments lexer available below:
- https://github.com/miyuchina/mistletoe/tree/master/contrib
"""
from mistletoe import HTMLRenderer
from pygments import highlight
from pygments.styles import get_style_by_name as get_style
from pygments.lexers import get_lexer_by_name as get_lexer, gue... | cschmautz/homepage | src/app/utils/renderext.py | Python | gpl-2.0 | 837 |
import io
import os
import time
class liveFile(io.FileIO):
def getTimestamp(self):
return os.path.getmtime(self.path)
def _getContents(self):
self.seek(0)
return super().read().decode()
def __init__(self, name, mode = "r", closefd=True, opener=None):
super().__init__(name, mode, closefd, opener)
self.... | jessestowe/pyfile | pyfile.py | Python | gpl-2.0 | 1,098 |
# Copyright: Martin Matusiak <numerodix@gmail.com>
from __future__ import absolute_import
import re
class FilepathTransformer(object):
@classmethod
def to_unicode(self, s):
us = s.decode('utf-8', 'ignore')
return us
@classmethod
def from_unicode(self, us):
s = us.encode('utf... | numerodix/nametrans | nametrans/filepathtrans.py | Python | gpl-2.0 | 2,302 |
#!/usr/bin/python
from select import epoll, EPOLLHUP, EPOLLERR, EPOLLIN, EPOLLOUT, EPOLLET
class EpollReactor(object):
EV_DISCONNECTED = (EPOLLHUP | EPOLLERR)
EV_IN = EPOLLIN# | EPOLLET
EV_OUT = EPOLLOUT# | EPOLLET
def __init__(self):
self._poller = epoll()
def poll(self, timeo... | hfutsuchao/Python2.6 | fastpy/fastpy/跨平台/reactor/epollreactor.py | Python | gpl-2.0 | 591 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/tkralidi/work/foss4g/MetaSearch/MetaSearch/plugin/MetaSearch/ui/recorddialog.ui'
#
# Created: Thu Mar 20 21:56:35 2014
# by: PyQt4 UI code generator 4.9.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import... | luca76/QGIS | python/plugins/MetaSearch/ui/recorddialog.py | Python | gpl-2.0 | 1,849 |
from cli import *
def del_file_cdrom_cmd(obj):
name = obj.name
try:
SIM_delete_object(obj)
print "File CD-ROM object '%s' deleted." % name
except Exception, msg:
print "Failed deleting file CD-ROM object '%s': %s" % (name, msg)
new_command("delete", del_file_cdrom_cmd,
... | iniverno/RnR-LLC | simics-3.0-install/simics-3.0.31/amd64-linux/lib/python/mod_file_cdrom_commands.py | Python | gpl-2.0 | 630 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-03-02 04:25
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('listings', '0006_auto_20160228_2238'),
]
operations = [
migrations.AlterFiel... | NilsJPWerner/Sublet-Uchicago | listings/migrations/0007_auto_20160302_0425.py | Python | gpl-2.0 | 473 |
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (... | lbjay/cds-invenio | modules/webaccess/lib/access_control_config.py | Python | gpl-2.0 | 17,296 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import users.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', mode... | 7Pros/circuit | users/migrations/0001_initial.py | Python | gpl-2.0 | 1,392 |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 18 00:00:32 2014
@author: Trent
"""
import numpy as np
from scipy.spatial.distance import pdist, squareform
import sys, csv
def getdata(inf, delimiter=','):
'''read data, calc distances from all pts to all other pts,
convert to symmetric square matrix'''
... | tweber225/fast-dp | distance_convert.py | Python | gpl-2.0 | 1,712 |
import re
from django import forms
from django.db.models import OneToOneField, ForeignKey
from django.db.models.query import QuerySet
from edc_base.form.classes import LogicCheck
from edc_constants.constants import YES, NO, OTHER, NOT_APPLICABLE
from edc_visit_tracking.models import VisitModelMixin
class BaseModelF... | botswana-harvard/microbiome | microbiome/apps/mb/base_model_form.py | Python | gpl-2.0 | 12,711 |
#!/usr/bin/env python
###############################################################################
#
# Project: GDAL/OGR Test Suite
# Purpose: Test DB2 vector driver
#
# Author: David Adler <dadler@adtechgeospatial.com>
#
###############################################################################
# Copyright... | nextgis-extra/tests | lib_gdal/ogr/ogr_db2.py | Python | gpl-2.0 | 8,591 |
#!/usr/bin/env python
from django.contrib import admin
from .models import Office, Document, DocumentFile
admin.site.register(Office)
admin.site.register(Document)
admin.site.register(DocumentFile) | PatchRanger/declarator-test-task | office/admin.py | Python | gpl-2.0 | 199 |
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
# Práctica Final: Raquel Galán Montes
"""
Clase (y programa principal) para un servidor SIP
"""
import SocketServer
import socket
import sys
import os
import time
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
class XMLHandler(ContentHandler)... | raquelgalan/ptavi-pfinal | uaserver.py | Python | gpl-2.0 | 8,062 |