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 |
|---|---|---|---|---|---|
# Copyright (c) 2010 <jonathan.stoppani@gmail.com>
# See LICENSE for details.
"""
Shortcuts to rapidly deploy and access remote services over BERT-RPC.
@author: Jonathan Stoppani <jonathan.stoppani@edu.hefr.ch>
"""
import re
from txbert import server, client
from txbert.resolvers.tcp import TCPResolver
def serve... | GaretJax/txBERT-RPC | txbert/shortcuts.py | Python | mit | 1,002 |
# coding: utf-8
import os
from django.core import serializers
from django.db import migrations
fixture_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../fixtures'))
fixture_filename = 'test_data.json'
def load_fixture(apps, schema_editor):
fixture_fil... | njoyard/django-rql-filter | tests/migrations/0002_test_data.py | Python | mit | 724 |
"""Declarative ORM event decorators and event registration.
SQLAlchemy features an ORM event API but one thing that is lacking is a way to
register event handlers in a declarative way inside the Model's class
definition. To bridge this gap, this module contains a collection of decorators
that enable this kind of funct... | dgilland/alchy | alchy/events.py | Python | mit | 9,832 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
This module provides classes to create phase diagrams.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2011, The Materials Project"
__version... | xhqu1981/pymatgen | pymatgen/phasediagram/maker.py | Python | mit | 18,066 |
from discord import Client, Status
from utils.colourthief import get_embed_colour
from utils.messaging import notify_owner
class DiscordRelay:
def __init__(self, bot, config):
self.bot = bot
self.config = config
self.config["embed_colour"] = get_embed_colour(self.config["logo_url"])
... | randomic/antinub-gregbot | ext/pings/discordrelay.py | Python | mit | 1,628 |
# 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_04_01/operations/_subnets_operations.py | Python | mit | 21,781 |
import logging
log = logging.getLogger(__name__)
import numpy
import operator
import westpa, west
from westpa.yamlcfg import check_bool
from westpa.kinetics import RateAverager
from westext.weed.ProbAdjustEquil import probAdjustEquil
EPS = numpy.finfo(numpy.float64).eps
class WEEDDriver:
def __init__(self, ... | westpa/westpa | src/westext/weed/weed_driver.py | Python | mit | 7,221 |
#!/usr/bin/env python
"""
Derived from pimoroni/unicorn-hat
https://github.com/pimoroni/unicorn-hat/blob/master/examples/rainbow.py
"""
import math
import os
import time
from collections import defaultdict
# import unicornhat as unicorn
# print("""Rainbow
# Displays a beautiful rainbow across your HAT/pHAT :D
# If ... | Mystopia/resin-rpi-fadecandy-server | partyhat/rainbow.py | Python | mit | 2,768 |
import requests
from logging import getLogger
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from . import settings
from .models import TwitterAccount, InstagramAccount
from .services.twitter import TwitterAPI
log = getLogger('social.views')
def begin_auth(request):
... | MadeInHaus/django-social | social/views.py | Python | mit | 2,951 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Country',
fields=[
('iso', models.CharField(max... | cordery/django-countries-plus | countries_plus/migrations/0001_initial.py | Python | mit | 2,245 |
from tabpy.tabpy_server.handlers import BaseHandler
import json
import simplejson
import logging
from tabpy.tabpy_server.common.util import format_exception
import requests
from tornado import gen
from datetime import timedelta
from tabpy.tabpy_server.handlers.util import AuthErrorStates
class RestrictedTabPy:
de... | tableau/TabPy | tabpy/tabpy_server/handlers/evaluation_plane_handler.py | Python | mit | 5,906 |
#!/usr/bin/env python
# Example script for pulling in tasks from GitHub into TheHitList
import commands
import TheHitList
try:
from github2.client import Github
except ImportError:
exit('Fatal Error: Requires github module. http://github.com/ask/python-github2')
# Read in configuration information from git's configu... | kfdm-archive/thehitlist | examples/github.py | Python | mit | 1,753 |
import _plotly_utils.basevalidators
class AutocolorscaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="autocolorscale", parent_name="scatter.marker.line", **kwargs
):
super(AutocolorscaleValidator, self).__init__(
plotly_name=plotly_name,... | plotly/python-api | packages/python/plotly/plotly/validators/scatter/marker/line/_autocolorscale.py | Python | mit | 549 |
# -*- coding: utf-8 -*-
#
# inventory/accounts/forms.py
#
"""
Account Forms
"""
__docformat__ = "restructuredtext en"
from django import forms
from django.utils.translation import gettext_lazy as _
from .models import Question, Answer
#
# Question
#
class QuestionForm(forms.ModelForm):
def __init__(self, *arg... | cnobile2012/inventory | inventory/accounts/forms.py | Python | mit | 850 |
# coding=utf-8
from datetime import date, datetime, timedelta
from django import forms
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import Q
from djang... | feinheit/feincms-elephantagenda | elephantagenda/backends/agenda/models.py | Python | mit | 7,328 |
"""Trials class."""
from collections import OrderedDict
from .variations import vtypes as default_vtypes
from .stats import statistic_funcs
class Trials(object):
"""Main A/B test class."""
class UnsupportedVariationType(Exception):
pass
class UnsupportedStatistic(Exception):
pass
... | bogdan-kulynych/trials | trials/trials.py | Python | mit | 1,460 |
import pymongo
import argparse
import json
import os
import subprocess
from pymongo import MongoClient
def allBooks():
client = MongoClient()
db = client['shopr-dev']
pages = db['pages']
books = [page['_id'] for page in pages.aggregate({'$group':{'_id':'$book'}})['result'] ]
return books
def stat(book):
client... | samsface/reads | scrapers/job.py | Python | mit | 1,283 |
# -*- coding: utf-8 -*-
from .my_test_case import MyTestCase
from sqlalchemy import Column, Integer, String, Float, Boolean, TIMESTAMP, text
from flask_sqlalchemy import SQLAlchemy
from flask_restful_extend.model_validates import complex_validates, ModelInvalid
from flask_restful_extend import register_model_converter,... | anjianshi/flask-restful-extend | tests/model_test.py | Python | mit | 20,151 |
def bSearch(L, e, low, high):
if high - low < 2:
return L[low] == e or L[high] == e
mid = low + int((high - low)/2)
if L[mid] == e:
return True
if L[mid] > e:
return bSearch(L, e, low, mid - 1)
else:
return bSearch(L, e, mid + 1, high)
def selSort(L):
"""Assumes ... | sheva29/Introduction_to_Computational_Thinking | unit1_9_memory_and_search_methods.py | Python | mit | 2,745 |
import glob
import dicom
from django.db import models
from django.utils._os import safe_join
from rest_framework import serializers
class ImageSeries(models.Model):
"""
Model representing a certain image series
"""
patient_id = models.CharField(max_length=64)
series_instance_uid = models.CharFie... | antonow/concept-to-clinic | interface/backend/images/models.py | Python | mit | 2,146 |
# Copyright 2011 Jeff Garzik
#
# RawProxy has the following improvements over python-jsonrpc's ServiceProxy
# class:
#
# - HTTP connections persist for the life of the RawProxy object (if server
# supports HTTP/1.1)
# - sends protocol 'version', per JSON-RPC 1.1
# - sends proper, incrementing 'id'
# - sends Basic HTT... | petertodd/stealth-addresses-ref-implementation | lib/python-bitcoinlib/bitcoin/rpc.py | Python | mit | 16,669 |
import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="family",
parent_name="scatter3d.line.colorbar.title.font",
**kwargs
):
super(FamilyValidator, self).__init__(
plotly_nam... | plotly/python-api | packages/python/plotly/plotly/validators/scatter3d/line/colorbar/title/font/_family.py | Python | mit | 602 |
# ex:set ts=4 sw=4: <- for vim
#
# EPANET File Utility
# Uses EPAENTOutputFile.py to read the EPANET output file into memory and
# then displays the content in different ways.
#
# Dependencies:
# - Python 2.6 or 2.7 (32- or 64-bit)
# - wxPython 3.0.0 (32- or 64-bit to match installed version of Python)
# - EPA... | WaterSums/EPANETFileUtility | DataPage.py | Python | mit | 24,740 |
# -*- coding: utf-8 -*-
# packages
import numpy as np
import seawater as sw
def BCinst(U,N2,z,Qy,k,lat,s,L=np.inf,ct=50):
''' Computes 1-d baroclinic instability of a vertical velocity profile
===========================================================================
Input :
-> U: velocity... | LaDO-IOUSP/Curious | Python/BCinst.py | Python | mit | 5,161 |
from aiida import load_dbenv
load_dbenv()
from aiida.orm import Code, DataFactory
import numpy as np
StructureData = DataFactory('structure')
ParameterData = DataFactory('parameter')
codename = 'lammps_optimize@boston'
############################
# Define input parameters #
############################
# GaN
ce... | abelcarreras/aiida_extensions | plugins/launcher/launch_lammps_optimization_gan.py | Python | mit | 3,755 |
import os
import shutil
from conans.client.file_copier import FileCopier
from conans.client.output import ScopedOutput
from conans.client.packager import report_files_from_manifest
from conans.errors import ConanException, conanfile_exception_formatter
from conans.model.conan_file import get_env_context_manager
from c... | conan-io/conan | conans/client/conanfile/package.py | Python | mit | 3,785 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-10 18:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('main', '0019_auto_20170611_0113'),
]
operations = [
... | TRIOrganization/TRI | TRI/main/migrations/0020_aim_pub_date.py | Python | mit | 565 |
'''
Tool to migrate QA data from the TaskStatus table to the QA table.
You could just rerun the QA to populate the new QA table, but you'd miss key
information - resources that are no longer available but had the format
detected in the past.
'''
from optparse import OptionParser
import logging
import json
import date... | ckan/ckanext-qa | ckanext/qa/bin/migrate_task_status.py | Python | mit | 6,550 |
__author__ = 'katharine'
import os.path
import errno
class FileSync(object):
def __init__(self, root_dir):
assert isinstance(root_dir, basestring)
self.root_dir = root_dir
def apply_patches(self, patch_sequence):
# TODO: optimisations, if we care.
# We can keep the files in m... | pebble/cloudpebble-ycmd-proxy | filesync.py | Python | mit | 2,665 |
#!/usr/bin/python
from participantCollection import ParticipantCollection
import re
import datetime
import pyperclip
# Edit Me!
# This script gets run on the first day of the following month, and that month's URL is
# what goes here. E.g. If this directory is the directory for February, this script gets
# run on Marc... | foobarbazblarg/stayclean | stayclean-2016-july/display-final-after-month-is-over.py | Python | mit | 2,952 |
# -*- coding: utf-8 -*-
from django.conf.urls import url
from .views import Home
urlpatterns = [
url(r'^$', Home.as_view(), name='index'),
]
| koichi-ezato/DevDoc | home/urls.py | Python | mit | 146 |
import aquests
def finish_request (response):
print (response.version, response.status_code, response.reason, len (response.content))
print (response.content [:180])
print (response.content)
def test_get_proxypass_post ():
aquests.configure (1, callback = finish_request, force_http1 = 0)
for i in range (5):
... | hansroh/aquests | tests/test_get_proxypass_post.py | Python | mit | 511 |
from pyhy.api.model.object import HyvesObject
class User(HyvesObject):
"""Represents an Hyves User"""
| valhallasw/pyhy | pyhy/api/model/user.py | Python | mit | 107 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-20 10:11
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import positions.fields
import simple_cms.models
import taggit.ma... | 3atmospheres/django-simple-cms | simple_cms/migrations/0001_initial.py | Python | mit | 13,911 |
# -*- coding: utf-8 -*-
"""This module contains constants in mbio.
* :func:`.getconstantfunc` - get constant from file by name
"""
__author__ = 'Wenzhi Mao'
__all__ = []
def getconstantfunc(name, **kwargs):
"""Get constants from file by name."""
from . import __path__ as path
from numpy import fromf... | wzmao/mbio | mbio/Constant/__init__.py | Python | mit | 650 |
import argparse
import os
import fontforge
TEX_HEADER = """
\\documentclass{article}
\\usepackage{fullpage}
\\renewcommand{\\arraystretch}{1.5}
\\begin{document}
\\LARGE
\\font\\test="[%s]" at 16pt
\\test
"""
TEX_FOOTER = """
\\end{document}
"""
def TeXtt(s):
return '\\texttt{%s}' % s
def TeXbf(s):
retur... | bateni/qalam-tarash | tools/maketextable.py | Python | mit | 1,914 |
"""
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results.
Note: The input string may contain letters other than the parentheses ( and ).
Example 1:
Input: "()())()"
Output: ["()()()", "(())()"]
Example 2:
Input: "(a)())()"
Output: ["(a)()()", "(a())()... | franklingu/leetcode-solutions | questions/remove-invalid-parentheses/Solution.py | Python | mit | 2,042 |
#!/usr/bin/env python
import nxt.locator
import twitter
from time import sleep
import sys
class NXTtwitter():
def __init__(self, username, password):
self.twitter_username = username
self.twitter_password = password
self.nxt_mailbox = 5 # mailbox 6 on the NXT
self.interval = 5
def start(self):
alive =... | lupeke/nxt-twitter | nxt_twitter.py | Python | mit | 1,892 |
import time
import abc
import logging
import subprocess
import re
import os
import ccm.util
from xml.dom import minidom
class Rev(object):
def __init__(self):
self.revision = self.author = None
self.when = None
self.added = self.removed = 0
def __repr__(self):
return `self.rev... | djmitche/code-change-monitor | ccm/vcs.py | Python | mit | 4,597 |
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import click
import requests
from platformio import __version__
from platformio.exception import GetLatestVersionError
from platformio.util import exec_command
@click.command("upgrade",
short_help="Upgrade PlatformIO to the lat... | aphelps/platformio | platformio/commands/upgrade.py | Python | mit | 1,372 |
from branca.element import MacroElement
from folium.elements import JSCSSMixin
from folium.utilities import parse_options
from jinja2 import Template
class MeasureControl(JSCSSMixin, MacroElement):
""" Add a measurement widget on the map.
Parameters
----------
position: str, default 'topright'
... | python-visualization/folium | folium/plugins/measure_control.py | Python | mit | 1,833 |
from __future__ import print_function
import argparse
import os
import h5py
import numpy as np
import pandas as pd
from molecules.model import MoleculeVAE
from molecules.vectorizer import SmilesDataGenerator
from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau
NUM_EPOCHS = 1
EPOCH_SIZE = 500000
BATCH_SIZE ... | pechersky/keras-molecules | train_gen.py | Python | mit | 3,312 |
# -*- coding: utf-8 -*-
def generate_spiral_stream(card, posX, posY):
"""Generate spiral from a selected location on the card"""
x = y = 0
dx, dy = 0, -1
data = []
matrix = card.m.tolist()
for i in range(max(card.rows, card.columns) ** 2):
if (-card.rows / 2 < x <= card.rows / 2) and (... | gszathmari/munchkin | munchkin/core/strategies/spiral.py | Python | mit | 1,216 |
# ******************************************************************************
# pysimm.apps.equilibrate module
# ******************************************************************************
#
# 21-step equilibration algorithm written using pysimm tools
#
# **********************************************************... | polysimtools/pysimm | pysimm/apps/equilibrate.py | Python | mit | 3,594 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, sys
from setuptools import setup
from setuptools.extension import Extension
from glob import glob
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements... | deisi/SFG2D | setup.py | Python | mit | 1,588 |
import numpy
n, m = map(int, input().split())
arr = numpy.array([list(map(int, input().split())) for _ in range(n)])
arr = numpy.min(arr, axis=1)
arr = numpy.max(arr)
print(arr)
| avtomato/HackerRank | Python/_16_Numpy/_10_Min_and_Max/solution.py | Python | mit | 180 |
# coding: utf-8
from .base import *
# DEBUG CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
TEMPLATE_DEBUG = DEBUG
# END DEBUG CONFIGURATION
# EMAIL CONFIGURATION
# See: https://docs.djangoproject.... | zokis/mapa_do_cidadao | mapa_cidadao/mapa_cidadao/settings/local.py | Python | mit | 1,040 |
from collections import OrderedDict
import random
def get_random_rgb():
"""Generate a random RGB value
Returns
-------
list of float
Random RGB array
"""
return [round(random.random() * 255) for _ in range(0, 3)]
def assign_random_colors(data_vector):
"""Produces lookup table ke... | uber-common/deck.gl | bindings/pydeck/pydeck/data_utils/color_scales.py | Python | mit | 875 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import json
import sys
import time
import vk_api
def captcha_handler(captcha):
key = input("Enter Captcha {0}: ".format(captcha.get_url())).strip()
return captcha.try_again(key)
# getting pazans
pazanIds = None
pazansFileName = sys.argv[1]
with open(pazansFileNam... | AlekseyLobanov/gotohack | audio-fetcher.py | Python | mit | 1,642 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
REPO_CHOICES = (
('git', _('Git')),
('hg', _('Mercurial')),
('svn', _('Subversion')),
('pypi', _('PyPI')),
)
class Package(models.Model):
"""
Packages app
"""
name = models.CharField(_("Name"), ... | jonathanchu/pickleback | apps/packages/models.py | Python | mit | 901 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'scrape_dialog.v1.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromU... | nuncjo/random_code_repo | example_qt_scraper/cython_qt_example/gui/scrape_dialog.py | Python | mit | 2,032 |
print "We are now playing with comments" #blah. this is for completeness's sake
#print "This won't run."
print "This will run"
'''
This
is
how
you
make
multiline
comments
in
python.
Even though the \''' actually has a different purpose as well.
'''
| isaac-friedman/lphw | ex2.py | Python | mit | 267 |
import os
import unittest
from gitviewfs_objects import Directory
import dir_structure.default
from tests.structs.default import paths
from tests.structs.default.utils import BaseDefaultDirStructTest,\
BaseDefaultDirStructIntegrationTest
class CommitAuthorDirPathTest(BaseDefaultDirStructTest):
def test_path(self... | erdavila/gitviewfs | tests/structs/default/test_commit_author_dir.py | Python | mit | 1,081 |
from django.db import models
from django.template.defaultfilters import slugify
from django.conf import settings
from django.db.models.signals import pre_save
import datetime
class Category(models.Model):
name = models.CharField(max_length=255)
icon = models.CharField(max_length=255)
slug = models.CharF... | les-patissiers-du-web/django-website | patissiers/blog/models.py | Python | mit | 5,905 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Shawling'
import sys
import asyncio
import functools
import inspect
import logging
import os
from urllib import parse
from aiohttp import web
from apis import APIError
def get(path):
'''
Define decorator @get('/path')
'''
def decorator(... | Shawling/STAMS | www/coroweb.py | Python | mit | 7,409 |
#!/usr/bin/env python
#coding: utf-8
import setting
import logging
import os
def hexo(item):
log = logging.getLogger(setting.log_hdr)
title = item["pg_title"]
invalid = "\\/:*?\"<>|"
newtitle = ""
for i in title:
if i not in invalid:
newtitle += i
title =... | buf1024/xinpinla-crawler | src/hexo.py | Python | mit | 1,854 |
import config
from facepy import GraphAPI
import json
#import facebook
class facebooks:
def __init__(self):
c = config.config()
self.access_token_Shashank = c.access_token_Shashank
self.access_token_Moskie = c.access_token_Moskie
self.access_token_Mike = c.access_token_Mike
#self.graph = GraphAPI(self.acce... | ShashankSanjay/HOLLERVERSE-HACKMIT | facebook/facebooks.py | Python | mit | 1,428 |
#!/usr/bin/env python3
from participantCollection import ParticipantCollection
import re
import datetime
import string
import pyperclip
# If this directory is the directory for November, this script gets run on December 1,
# and currentMonthIndex gets the index of November, i.e. 11.
currentMonthIndex = datetime.date.t... | foobarbazblarg/stayclean | backup-of-python-before-refactoring-2020-december/python-backup-before-running-flynt/display-congratulations-after-month-is-over.py | Python | mit | 2,839 |
#!/usr/bin/env python
if __name__ == "__main__":
import unittest
from subprocess import check_output
bampath = "FINAL_S376x3_Unpurified_GCATAACG-GCATAACG_L001_R1_001.R1.rsq.bam"
class Test(unittest.TestCase):
def test_empty_filter(self):
pre_count = check_output("samtools view -cF... | ARUP-NGS/BMFtools | sample_test/filter_test.py | Python | mit | 2,275 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# (c) 2020 Mike Lewis
import logging
log = logging.getLogger(__name__)
from . import BaseAuthenticatedEndpointTestCase, BaseUserlessEndpointTestCase
class RateLimitTestCase(BaseAuthenticatedEndpointTestCase):
"""
General
"""
def test_rate_limit(self):
... | mLewisLogic/foursquare | foursquare/tests/test_ratelimit.py | Python | mit | 629 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Peter Rowlands
"""
#pokegoons sopel module
Author: Peter "astroman" Rowlands <peter@pmrowla.com>
"""
from __future__ import unicode_literals, absolute_import, division
from sopel import web
from sopel.module import commands, example
from sopel.config import ConfigurationE... | pmrowla/pokegoons-bot | sopel_modules/pokegoons/pokegoons.py | Python | mit | 9,551 |
import sys
import os
from os.path import join
from SpectraStackingSDSSOnly import *
import glob
hdus_eb67 = fits.open("/uufs/chpc.utah.edu/common/home/u0936736/stack_eBOSSELG/elg270_eboss67summaryTable_stack_comparison.fits")
hdus_eb17 = fits.open("/uufs/chpc.utah.edu/common/home/u0936736/stack_eBOSSELG/elg270_eboss... | JohanComparat/pySU | galaxy/bin_stack/inDev/stack_spectra_SDSS.py | Python | cc0-1.0 | 7,789 |
# peppy Copyright (c) 2006-2010 Rob McMullen
# Licenced under the GPLv2; see http://peppy.flipturn.org for more info
"""Extension to SearchMode to allow searching through numeric values in a
file using comparison operators
"""
import os, re
import wx
from wx.lib.pubsub import Publisher
from peppy.debug import debugm... | robmcmullen/peppy | peppy/plugins/numeric_search.py | Python | gpl-2.0 | 4,160 |
############################################################################
# #
# File : scidavisrc.py #
# Project : SciDAVis #
# Descriptio... | fmeynadier/scidavis | scidavis/scidavisrc.py | Python | gpl-2.0 | 12,899 |
# #####
# This file is part of the RobotDesigner developed in the Neurorobotics
# subproject of the Human Brain Project (https://www.humanbrainproject.eu).
#
# The Human Brain Project is a European Commission funded project
# in the frame of the Horizon2020 FET Flagship plan.
# (http://ec.europa.eu/programmes/hori... | HBPNeurorobotics/BlenderRobotDesigner | robot_designer_plugin/export/osim/osim_import.py | Python | gpl-2.0 | 14,494 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2011-2012 Paul Franklin
#
# This program is free software; you can redistribute it and/or modify
# it under the terms o... | Forage/Gramps | gramps/gen/plug/report/_book.py | Python | gpl-2.0 | 15,603 |
from django import template
register = template.Library()
@register.simple_tag()
def multiply(v1, v2):
return v1 * v2
| vmassuchetto/dnstorm | dnstorm/app/templatetags/math.py | Python | gpl-2.0 | 124 |
"""
Tests the capability to use the case recorders to dump out larger amounts of information
from a driver's workflow.
"""
import StringIO
import unittest
from openmdao.lib.casehandlers.api import DumpCaseRecorder
from openmdao.main.api import Component, Assembly, Driver, set_as_top
from openmdao.main.datatypes.api im... | HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/openmdao.lib-0.13.0-py2.7.egg/openmdao/lib/casehandlers/test/test_datadump.py | Python | gpl-2.0 | 16,990 |
#!/usr/bin/env python
from nunja.core import engine
from nunja.testing import model
data = model.DummyTableData([
['id', 'Id'],
['name', 'Given Name'],
], [
['1', 'John Smith'],
['2', 'Eve Adams'],
])
print("Content-Type: text/html")
print("")
body = engine.execute('nunja.molds/table', data=data.to_j... | calmjs/nunja.serve | examples/table.py | Python | gpl-2.0 | 520 |
#!/usr/bin/python2
"""Entry point for system-config-cluster.
This application creates and edits the cluster.conf file,
and provides an interface to resource management.
"""
__author__ = 'Jim Parsons (jparsons@redhat.com)'
import sys
import types
import select
import signal
import string
import os
import Mess... | andyvand/cygsystem-config-cluster | src/system-config-cluster.py | Python | gpl-2.0 | 25,860 |
# # ! #/usr/bin/python3
import UH.w1.find_sensors as w1fs
# if __name__ == "__main__":
#print(__name__ + "\n")
w1s = w1fs.FindSensors
w1s.get_that()
import rrdtool
# in real life data_sources would be populated in loop or something similar
data_sources = ['DS:speed1:COUNTER:600:U:U',
'DS:speed2:COU... | uherting/RasPi | FridgeMonitoring/t.py | Python | gpl-2.0 | 555 |
import os
from stgit.commands.common import (
CmdException,
DirectoryAnywhere,
DirectoryHasRepository,
)
from stgit.lib.git import clone
from stgit.lib.stack import Stack
__copyright__ = """
Copyright (C) 2009, Catalin Marinas <catalin.marinas@gmail.com>
This program is free software; you can redistribut... | emacsmirror/stgit | stgit/commands/clone.py | Python | gpl-2.0 | 1,957 |
#!/usr/bin/env python
from PIL import Image
import argparse
import h5py
import io
import itertools
import matplotlib.pyplot as plt
import numpy as np
import sys
parser = argparse.ArgumentParser()
parser.add_argument('-f','--filename', default='training_data.h5', help='Name of the file to open')
parser.add_argument('-... | kaikai581/NOvA | NovaPixelmapUtilities/read_nova_pixelmap_hdf5.py | Python | gpl-2.0 | 2,425 |
import getLogInfo as log
import MySQLdb
class mysqlConnector:
def __init__(self, customerId):
self.dbUsername = "root"
self.dbPassword = "amigos02"
self.dbDatabase = "auto"
self.dbHost = "localhost"
self.customerId = customerId
def startConnection(self):
self.d... | ragazzid/nginxLogParser | mysqlParser.py | Python | gpl-2.0 | 1,146 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 散点图
import matplotlib.pyplot as plt
import numpy as np
'''
# 例子1,显示散点图 (身高-体重) 可看出有明显的正相关性
height = [161, 170, 182, 175, 173, 165]
weight = [50, 58, 80, 70, 69, 55]
plt.scatter(height, weight)
plt.show()
'''
'''
# 例子2,显示相关性:正相关,负相关,不相关
N = 1000
x = np.random.randn(... | weiqiangdragonite/blog_tmp | python/matplotlib/课件/3_散点图/ex.py | Python | gpl-2.0 | 1,453 |
import math
for a in range(1,1000):
for b in range(a,1000):
c = math.sqrt(a**2 + b**2)
if a + b + c == 1000:
print (a*b*c)
| DavidZeferino/euler | 09.py | Python | gpl-2.0 | 140 |
from struct import *
import ctypes
import pft_c
import getopt
import pdb
MAX_STRLEN = 256
PFT_NAMELEN = 16
PF_STATE_STR_MAX = 128
PF_STATE_SET = 1
PF_STATE_REMOVE = 2
PF_STATE_NONE = 0
PF_STATE_ADD = 1
PF_STATE_SUBTRACT = 2
PF_VALUE_GIVEN = 0
PF_VALUE_FROM_CONTEXT = 1
class value_union(ctypes.Union):
_fields_ =... | siis/pfwall | tools/pfwall/pftables/modules/target/state_target.py | Python | gpl-2.0 | 2,709 |
# 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... | seankelly/buildbot | master/buildbot/util/giturlparse.py | Python | gpl-2.0 | 1,773 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of t... | EUDAT-B2SHARE/invenio-old | modules/bibindex/lib/bibindex_engine_config.py | Python | gpl-2.0 | 2,237 |
from .dispatch_container_register_admin import DispatchContainerRegisterAdmin
from .dispatch_item_register_admin import DispatchItemRegisterAdmin
| botswana-harvard/edc-dispatch | edc_dispatch/admin/__init__.py | Python | gpl-2.0 | 146 |
# -*- coding: utf-8 -*-
import threading
import logging
import xbmc
from traktapi import traktAPI
import globals
from rating import rateMedia
from scrobbler import Scrobbler
import sqlitequeue
from sync import Sync
import utilities
import time
import gui_utils
import xbmcgui
import json
logger = logging.getLogger(__... | AMOboxTV/AMOBox.LegoBuild | script.trakt/service.py | Python | gpl-2.0 | 27,044 |
# coding: utf-8
# In[5]:
import sys, os
sys.path.append('../../../libs/')
sys.path.append('../libs/')
sys.path.append('../../libs/')
import os.path
import IO_class
from IO_class import FileOperator
from sklearn import cross_validation
import sklearn
import csv
from dateutil import parser
from datetime import timede... | magic2du/contact_matrix | Contact_maps/DeepLearning/DeepLearningTool/DL_contact_matrix_New_Server_test_0518.py | Python | gpl-2.0 | 47,388 |
from importlib import import_module
import json
import re
import requests
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.validators import validate_email as validate_email_content
from django.utils.translation import ungettext, ugettext_lazy as _
from django.contrib.auth import ... | alff0x1f/Misago | misago/users/validators.py | Python | gpl-2.0 | 5,278 |
################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
NAME = "ZenPacks.community.Memcached_Template"
VERSION = "1.0"
AUTHOR = "Fredrik Wollsen"
LICENSE = "GPLv2"
NAMESPACE_PACKAGES = ['ZenPacks', 'ZenPacks.community']
PAC... | zenoss/ZenPacks.community.Memcached_Template | setup.py | Python | gpl-2.0 | 2,673 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
no_dry_run = True
def forwards(self, orm):
# Adding field 'Drink.duration'
db.add_column('core_drink', 'duration', self.gf('dj... | Alwnikrotikz/kegbot | pykeg/src/pykeg/core/migrations/0037_add_drink_duration.py | Python | gpl-2.0 | 18,905 |
# -*- coding: utf-8 -*-
"""
(c) 2014-2016 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
Ralph Bean <rbean@redhat.com>
"""
import anitya.lib.xml2dict as xml2dict
from anitya.lib.backends import BaseBackend
from anitya.lib.exceptions import AnityaPluginException
class PypiBacken... | pombredanne/anitya | anitya/lib/backends/pypi.py | Python | gpl-2.0 | 3,501 |
"""
pyPardy
Helper classes for the gui of pyPardy.
@author: Christian Wichmann
"""
import logging
import time
from PyQt4 import QtCore
from PyQt4 import QtGui
from buzzer import buzzer
from data import config
logger = logging.getLogger('pyPardy.gui')
# duration for the animation of widgets
ANIMATION_TIME = 75... | wichmann/pyPardy | gui/helper.py | Python | gpl-2.0 | 6,504 |
# Copyright 2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = (
'case_insensitive_vars', 'default_globals', 'env_blacklist', \
'environ_filter', 'environ_whitelist', 'environ_whitelist_re',
)
import re
env_blacklist = frozenset((
"A", "AA", "CATEGORY", "DEPEND", "... | Neuvoo/legacy-portage | pym/portage/package/ebuild/_config/special_env_vars.py | Python | gpl-2.0 | 5,390 |
# Copyright 2010-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
__all__ = ['cacheddir', 'listdir']
import errno
import stat
import time
from portage import os
from portage.const import VCS_DIRS
from portage.exception import DirectoryNotFound, PermissionDenied, PortageExcept... | funtoo/portage-funtoo | pym/portage/util/listdir.py | Python | gpl-2.0 | 4,064 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2013 Zuza Software Foundation
#
# This file is part of Pootle.
#
# Pootle 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 th... | ttreeagency/PootleTypo3Org | pootle/apps/staticpages/models.py | Python | gpl-2.0 | 4,105 |
from .main import t411
from .updater import ST411Updater
from couchpotato.core.logger import CPLog
from couchpotato.core.event import fireEventAsync
log = CPLog(__name__)
def autoload():
log.info('Checking if new update available')
update = ST411Updater()
if update.check() and update.isEnabled():
... | cocazoulou/couchpotato.provider.t411 | t411/__init__.py | Python | gpl-2.0 | 2,715 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
'''
Created on 2015-3-24
@author: Ben
'''
import py_compile
py_compile.compile(r'test.py') | piaoyidage/hello-world | compile.py | Python | gpl-2.0 | 137 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0034_campaign_public'),
]
operations = [
migrations.AlterField(
model_name='visualmetric',
n... | wavesoft/creditpiggy | creditpiggy-server/creditpiggy/core/migrations/0035_auto_20151029_1626.py | Python | gpl-2.0 | 481 |
#!/bin/python
from util.ObsFile import ObsFile
from util.FileName import FileName
from util.popup import PopUp,plotArray
import util.utils
import matplotlib.pyplot as plt
import numpy as np
import datetime
import tables
import ephem
import matplotlib
import matplotlib.cm as cm
import os
import hotpix.hotPixels as hp
d... | bmazin/ARCONS-pipeline | flatcal/test/beforeAfterPlots.py | Python | gpl-2.0 | 2,789 |
# -*- coding: utf-8 -*-
#
# tsodyks_facilitating.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Li... | lekshmideepu/nest-simulator | pynest/examples/tsodyks_facilitating.py | Python | gpl-2.0 | 5,630 |
# encoding: utf-8
# (c) 2017-2019 Open Risk (https://www.openriskmanagement.com)
#
# portfolioAnalytics is licensed under the Apache 2.0 license a copy of which is included
# in the source distribution of TransitionMatrix. This is notwithstanding any licenses of
# third-party software included in this distribution. Yo... | open-risk/portfolio_analytics_library | portfolioAnalytics/settings.py | Python | gpl-2.0 | 821 |
# -*- coding: utf-8 -*-
"""
brickv (Brick Viewer)
Copyright (C) 2013 Olaf Lüke <olaf@tinkerforge.com>
Copyright (C) 2014-2015 Matthias Bolte <matthias@tinkerforge.com>
spin_box_hex.py: SpinBoxHex implementation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General ... | D4wN/brickv | src/brickv/spin_box_hex.py | Python | gpl-2.0 | 1,552 |
"""
2231 : 분해합
URL : https://www.acmicpc.net/problem/2231
Input :
216
Output :
198
"""
n = input()
cipher = len(n)
n = int(n)
answer = None
for i in range(max(0, n - (cipher * 9)), n + 1):
array = list(map(int, str(i)))
number = i + sum(array)
if n == number:
answer... | 0x1306e6d/Baekjoon | baekjoon/2231.py | Python | gpl-2.0 | 394 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "snapbook.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| katychuang/django-snapbook | manage.py | Python | gpl-2.0 | 251 |
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, SylvainCecchetto
# GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt)
# This file is part of Catch-up TV & More
from __future__ import unicode_literals
import re
import json
import urlquick
from codequick import Resolver
URL... | Catch-up-TV-and-More/plugin.video.catchuptvandmore | resources/lib/channels/ma/telemaroc.py | Python | gpl-2.0 | 893 |