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 |
|---|---|---|---|---|---|
# Plugin mais feio do mundo, mas é só pra um chat específico.
# Aqui temos comandos que são pequenos demais pra terem seu próprio módulo.
# O stats fora inicialmente implementado aqui, depois fora transferido [Tadeu, 23/Ago]
# A maioria é um port bem rápido de https://github.com/lucasberti/telegrao/blob/master/p... | prppedro/mercurium | plugins/multipurpose.py | Python | mit | 3,764 |
from typing import List
class Solution:
def findMin(self, nums: List[int]) -> int:
first = nums[0]
# Iterate until the next number is less than current.
for num in nums:
if num < first:
return num
return first
| AustinTSchaffer/DailyProgrammer | LeetCode/FindMinimumInRotatedSortedArray2/app.py | Python | mit | 277 |
#!/usr/bin/python
import sys
if len(sys.argv)<2:
print "\nYou need to provide an argument!\nThe syntax is the following:\n\npython password_maker.py [password]"
exit()
import hashlib
import uuid
password = sys.argv[1]
salt = uuid.uuid4().hex
hashed_password = hashlib.sha512(password + salt).hexdigest()
f = open(... | MaximeKjaer/dailyprogrammer-challenges | Challenge-172/02-Intermediate-2/password_maker.py | Python | mit | 774 |
"""
WSGI config for project_2do project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | Dru89/2do | project_2do/wsgi.py | Python | mit | 399 |
# -*- coding: utf-8 -*-
# Licensed under the MIT license
# http://opensource.org/licenses/mit-license.php
# Copyright 2014, Hartmut Goebel <h.goebel@goebel-consult.de>
"""
Test cases for L{upnp.core.msearch}
"""
import time
from twisted.trial import unittest
from twisted.internet import protocol
from twisted.test ... | coherence-project/Coherence | coherence/upnp/core/test/test_msearch.py | Python | mit | 3,566 |
from collections import namedtuple
from graphql import graphql
from graphql.type import (
GraphQLSchema,
GraphQLObjectType,
GraphQLField,
GraphQLNonNull,
GraphQLInt,
GraphQLString,
GraphQLID,
)
from ..node import node_definitions, to_global_id, from_global_id
User = namedtuple('User', ['id... | miracle2k/graphql-relay-py | graphql_relay/node/tests/test_node.py | Python | mit | 7,306 |
#encoding:utf-8
def get_topn(logfile, topn=10):
fhandler = open(logfile, 'r')
rt_dict = {}
# 统计
while True:
line = fhandler.readline()
if line == '':
break
nodes = line.split()
ip, url, code = nodes[0], nodes[6], nodes[8]
key = (ip, ... | 51reboot/actual_09_homework | 07/zhaoyuanhai/cmdb/loganalysis.py | Python | mit | 1,002 |
# -*- coding: utf-8 -*-
from django import forms
from location.models import Address
class AddressAdminForm(forms.ModelForm):
class Meta:
model = Address
widgets = {
'description': forms.Textarea(attrs={'cols': 80, 'rows': 20}),
}
| thoreg/raus-mit-den-kids | rmdk/location/forms.py | Python | mit | 275 |
# -*- coding: utf-8 -*-
# Disable while we have Python 2.x compatability
# pylint: disable=useless-object-inheritance
"""This module contains classes and functionality relating to Sonos Groups."""
from __future__ import unicode_literals
class ZoneGroup(object):
"""
A class representing a Sonos Group. It l... | KennethNielsen/SoCo | soco/groups.py | Python | mit | 6,415 |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from .estimate_parser import EstimateParser
| EvgeniyBlinov/estimate | estimate/__init__.py | Python | mit | 133 |
#!/usr/bin/python
from common import *
import argparse
import sys
def main():
parser = argparse.ArgumentParser(description="Manipulate PC state. Valid PC status options include:"
+ "'Init', 'HTML', 'PDFs', 'Features'. Each indicates which stage has been completed ... | parno/autobid | util.py | Python | mit | 1,972 |
import pkg_resources
import argparse
import logging
import textwrap
import os
import sys
from string import join
import ceph_deploy
from ceph_deploy import exc, validate
from ceph_deploy.util import log
from ceph_deploy.util.decorators import catches
LOG = logging.getLogger(__name__)
__header__ = textwrap.dedent(""... | SUSE/ceph-deploy-to-be-deleted | ceph_deploy/cli.py | Python | mit | 5,580 |
"""
__graph_MT_post__OUT2.py___________________________________________________________
Automatically generated graphical appearance ---> MODIFY DIRECTLY WITH CAUTION
__________________________________________________________________________
"""
import tkFont
from graphEntity import *
from GraphicalForm import ... | levilucio/SyVOLT | UMLRT2Kiltera_MM/graph_MT_post__OUT2.py | Python | mit | 2,604 |
import i18n
class EngineCommand(object):
type = "Engine"
description = "Do nothing with engine"
def execute(self):
pass
def undo(self):
pass
class AddScore(EngineCommand):
def __init__(self, engine, score):
self.engine = engine
self.last_score = engine.score
... | the-dalee/gnome-2048 | core/model/commands/engine.py | Python | mit | 1,148 |
import requests
import re
import json
url = 'http://service.library.mtime.com/Movie.api'
data = {'Ajax_CallBack': 'true',
'Ajax_CallBackType': 'Mtime.Library.Services',
'Ajax_CallBackMethod': 'GetMovieOverviewRating',
'Ajax_CrossDomain': '1',
'Ajax_CallBackArgument0': '156682'}
# 网页... | Wooden-Robot/pop | mtime.py | Python | mit | 865 |
import os
import numpy as np
data = []
for f in os.listdir("."):
if len(f.split("."))==3 and f.split(".")[1]=='o38675' and int(f.split(".")[2])<1000:
with open(f) as file:
lines = file.readlines()
if len(lines) > 2 and len(lines) < 7:
data.append([float(p) for p in [lines[0].split(" ")[1], lines[1].split... | danielfreeman11/convex-nets | LaunchScripts/ParseScript.py | Python | mit | 743 |
"""This module include console commands for DanceCat."""
from __future__ import print_function
import datetime
import sqlalchemy.exc
from dateutil.relativedelta import relativedelta
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
from DanceCat import app, db, Models, Constants
# py... | scattm/DanceCat | DanceCat/Console/__init__.py | Python | mit | 2,383 |
# The MIT License (MIT) # Copyright (c) 2014-2017 University of Bristol
#
# 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... | IRC-SPHERE/HyperStream | hyperstream/tools/aggregate_plate/2016-11-11_v1.0.0.py | Python | mit | 2,699 |
import unittest
from item_32_use_get_attr_for_lazy_attributes import EasyLookup
class TestGetSetAttr(unittest.TestCase):
def test_easy_lookup(self):
"""simple est to make sure it runs"""
d = {'asdf': 1, 'APPLE': 'hi'}
r = EasyLookup(d)
self.assertEqual(r.asdf, 1)
self.asse... | totoro72/pt1 | ep/tests/test_item_32_use_get_attr_for_lazy_attributes.py | Python | mit | 459 |
# -*- coding: utf-8 -*-
import json
import logging
import vobject
from datetime import datetime
from contextlib import contextmanager
from radicale import ical
from yats.shortcuts import get_ticket_model, build_ticket_search_ext, touch_ticket, remember_changes, mail_ticket, jabber_ticket, check_references, add_histo... | mediafactory/yats | modules/yats/caldav/storage.py | Python | mit | 12,605 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# frc_rekt documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 12 00:19:47 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
# a... | jaustinpage/frc_rekt | docs/conf.py | Python | mit | 5,302 |
try:
from . import generic as g
except BaseException:
import generic as g
class ExportTest(g.unittest.TestCase):
def test_export(self):
export_types = list(
g.trimesh.exchange.export._mesh_exporters.keys())
meshes = list(g.get_meshes(8))
# make sure we've got somethin... | mikedh/trimesh | tests/test_export.py | Python | mit | 12,367 |
import os
import signal
import time
import subprocess
import atexit
import logging
import cPickle
try:
import tensorflow
except ImportError:
pass
try:
import pandas as pd
except ImportError:
pass
import scipy
import numpy
import numpy as np
import ssl
if hasattr(ssl, '_create_unverified_context'):
... | tombosc/dict_based_learning | dictlearn/extensions.py | Python | mit | 13,249 |
from copy import deepcopy
import time
from libAnt.message import BroadcastMessage
class ProfileMessage:
def __init__(self, msg, previous):
self.previous = previous
self.msg = deepcopy(msg)
self.count = previous.count + 1 if previous is not None else 1
self.timestamp = time.time()... | half2me/libant | libAnt/profiles/profile.py | Python | mit | 627 |
"""
You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if both the width and height of one envelope is greater than the width and height of the other envelope.
What is the maximum number of envelopes can you Russian doll? (put one in... | franklingu/leetcode-solutions | questions/russian-doll-envelopes/Solution.py | Python | mit | 1,024 |
# Copyright (c) 2012-2014 Tycho Andersen
# Copyright (c) 2013 xarvh
# Copyright (c) 2013 roger
# Copyright (c) 2013 Tao Sauvage
# Copyright (c) 2014 ramnes
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 dequis
# Copyright (c) 2015 Dario Giovannetti
# Copyright (c) 2015 Alexander Lozovskoy
#
# Permission is hereby g... | nxnfufunezn/qtile | libqtile/group.py | Python | mit | 15,212 |
from abc import ABCMeta
from collections import OrderedDict
from collections.abc import Iterable
from copy import deepcopy
from math import sqrt, floor
from numbers import Real, Integral
from xml.etree import ElementTree as ET
import numpy as np
import openmc.checkvalue as cv
import openmc
from openmc._xml import get... | johnnyliu27/openmc | openmc/lattice.py | Python | mit | 53,509 |
__author__ = 'Antony Cherepanov'
from inversionscount import InversionsCounter
from closestpoints import ClosestPoints
| iamantony/PythonNotes | src/algorithms/search/__init__.py | Python | mit | 124 |
from django.db import models
from teams.models import Team
from categories.models import Category
class Competition(models.Model):
competition_name = models.CharField(max_length=100)
categories = models.ManyToManyField(Category)
involved_teams = models.ManyToManyField(Team)
def __unicode__(self):
... | venetay/Photo-Competition | competition/models.py | Python | mit | 434 |
# -*- coding: utf-8 -*-
"""Tests for the Tk UI."""
#
# (C) Pywikibot team, 2008-2019
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import os
import pywikibot
from pywikibot.tools import PY2
from tests.aspects import unittest, TestCase, Default... | PersianWikipedia/pywikibot-core | tests/tk_tests.py | Python | mit | 1,761 |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from... | crowning-/dash | qa/rpc-tests/p2p-acceptblock.py | Python | mit | 12,477 |
from distutils.core import setup
setup(name='robotframework-wiremock',
packages=['WireMockLibrary'],
package_dir={'': 'src'},
version='development',
description='Robot framework library for WireMock',
author='Timo Yrjola',
author_email='timo.yrjola@gmail.com',
classifiers=[])
| tyrjola/robotframework-wiremock | resources/scripts/setup.py | Python | mit | 320 |
from setuptools import setup
setup(
name='x100http',
version='0.2.7',
description='web framework support customing file upload processing',
long_description=open('README.rst').read(),
url='https://github.com/chengang/x100http',
author='Chen Gang',
author_email='yikuyiku.com@gmail.com',
... | chengang/x100http | setup.py | Python | mit | 1,048 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('polls', '0004_pollanswer_zaventemtransport'),
]
operations = [
migrations.AlterField(
model_name='zaventemtransp... | tfiers/arenberg-online | polls/migrations/0005_auto_20150428_0016.py | Python | mit | 510 |
# -*- coding: utf-8 -*-
import six
from flask import g
from flask import request
from nplusone.core import signals
from nplusone.core import listeners
from nplusone.core import notifiers
import nplusone.ext.sqlalchemy # noqa
def get_worker():
try:
return request._get_current_object()
except Runtim... | jmcarp/nplusone | nplusone/ext/flask_sqlalchemy.py | Python | mit | 1,648 |
#!/usr/bin/env python
# Original code was created by Nadeem Douba as part of the Canari Framework
from collections import OrderedDict
from xml.etree.cElementTree import XML
from zipfile import ZipFile
def mtgx2json(graph):
zipfile = ZipFile(graph)
graphs = filter(lambda x: x.endswith('.graphml'), zipfile.n... | SneakersInc/Pandora | modules/exportgraph.py | Python | mit | 2,370 |
#!/usr/bin/env python
try:
# Attempt to load RPi Module
import RPi.GPIO as GPIO
except:
try:
# Attempt to load Beagle Bone Module
import Adafruit_BBIO.GPIO as GPIO
except:
pass
from controller import *
class GPIOCompatible(Controller):
"""GPIO interface compatible Control... | 3dinfluence/opensprinklerlib | opensprinklerlib/controller/gpio_compatible.py | Python | mit | 1,943 |
"""
This example outputs a custom waveform and records the waveform on Channel A.
The output of the AWG must be connected to Channel A.
"""
import os
import numpy as np
# if matplotlib is available then plot the results
try:
import matplotlib.pyplot as plt
except ImportError:
plt = None
from msl.equipment i... | MSLNZ/msl-equipment | msl/examples/equipment/picotech/picoscope/acquire_AWG_custom.py | Python | mit | 2,306 |
"""538. Convert BST to Greater Tree
https://leetcode.com/problems/convert-bst-to-greater-tree/
Given a Binary Search Tree (BST), convert it to a Greater Tree such that
every key of the original BST is changed to the original key plus sum of
all keys greater than the original key in BST.
Example:
Input: The root of a... | isudox/leetcode-solution | python-algorithm/leetcode/problem_538.py | Python | mit | 1,776 |
from rest_framework.serializers import (DateTimeField, ModelSerializer,
PrimaryKeyRelatedField, SerializerMethodField)
from threads.models import Post
from threads.serializers import PostSerializer
from .models import User
class BaseUserSerializer(ModelSerializer):
posts =... | annaelde/forum-app | site/users/serializers.py | Python | mit | 859 |
# The interface file
from embeddings import *
class Embeddings(object):
w2v = Word2Vec()
glove = GloVe()
w2vf = Word2VecF()
# add more here...
def download(emb_type, directory='~/.embeddings'):
"""
Downloads the required pre-trained Embedding
:param emb_type: One of the supported Embeddi... | yanaiela/easyEmbed | easyEmbed/easyEmbed.py | Python | mit | 3,380 |
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 13 21:22:12 2014
%reset -f
%pylab
%clear
%load_ext autoreload
%autoreload 2
@author: isaac
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.interpolate import UnivariateSpline
import time
# to load a... | isaacyeaton/global-dyn-non-equil-gliding | Code/script_kinematic_squirrel.py | Python | mit | 43,039 |
import os
import re
from datetime import *
import feedparser
from newspaper import Article,Config
import newspaper
import urllib.request
def writeFile(outPath,content):
file = open(outPath, 'w')
if file:
file.write(content)
file.close()
else:
print ("Error Opening File " + outPath)
... | ciandcd/ciandcd-web | htmlExtractor/HECommon.py | Python | mit | 5,015 |
# -*- coding: utf-8 -*-
from httoop.semantic.request import ComposedRequest
from httoop.semantic.response import ComposedResponse
__all__ = ('ComposedRequest', 'ComposedResponse')
| spaceone/httoop | httoop/semantic/__init__.py | Python | mit | 181 |
import tensorflow as tf
import numpy as np
#import allguess as al
from datetime import datetime
a = str(datetime.now())[11:19]
print(a) | skywalkerytx/oracle | src/main/python/xgbpredict.py | Python | mit | 138 |
# -*- coding: utf-8 -*-
#
# Galleria documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 22 04:00:02 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | khakhleva/khakhleva.github.io | Ana_photoweb/aino-galleria-fc65989/docs/conf.py | Python | mit | 6,973 |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from .views import (AvailableMapListview, AvailableMapsDetailview,
index_view, MyArmiesListView, ArmyCreateView,
ArmyDetailView, RobotCreateView)
urlpatterns = patterns('',
url(r'maingame/maps$'... | mrjmad/robotswars | maingame/urls.py | Python | mit | 868 |
# author: Adrian Rosebrock
# website: http://www.pyimagesearch.com
# USAGE
# BE SURE TO INSTALL 'imutils' PRIOR TO EXECUTING THIS COMMAND
# python sorting_contours.py
# import the necessary packages
from imutils import contours
import imutils
import cv2
# load the shapes image clone it, convert it to grayscale,... | jrosebr1/imutils | demos/sorting_contours.py | Python | mit | 1,343 |
import json
import pickle
import numpy as np
import pandas as pd
import numpy as np
import datatables.traveltime
def write_model(baserate, model_file):
"""
Write model to file
baserate -- average travel time
output_file -- file
"""
model_params = {
'baserate': baserate
}
model_s... | anjsimmo/simple-ml-pipeline | learners/traveltime_baserate.py | Python | mit | 1,292 |
import autograd.numpy as np
from autograd.scipy.misc import logsumexp
from features import num_atom_features, num_bond_features
from util import memoize, WeightsParser
from mol_graph import graph_from_smiles_tuple, degrees
from build_vanilla_net import build_fingerprint_deep_net, relu, batch_normalize
def fast_array... | HIPS/neural-fingerprint | neuralfingerprint/build_convnet.py | Python | mit | 6,508 |
#! /usr/bin/python
from urlparse import urlparse
def fullPath(baseUrl, link):
# converts baseUrl string to ParseResult (urlparse object)
# for constructing simple links we can ignore everything after
# last slash, i.e. on http://test.com/super.ext?mag=ic
# relative links are constructed with http://test.com/... | nhenezi/pymapper | validator.py | Python | mit | 669 |
# coding=utf-8
from __future__ import unicode_literals
"""
Utility library for interacting with unimate
"""
import socket
import types
class Client(object):
"""
Unimate client
"""
def __init__(self, server, port):
if not isinstance(server, types.StringTypes):
raise TypeError("serv... | smarkets/pyunimate | unimate.py | Python | mit | 1,311 |
# coding=utf-8
import socket
import thread
import time
import Queue
import re
import random
class IrcClient:
def __init__(self, host, port, nick, realname, printAll=True, isMibbitBot=False):
self.nick = nick
self.realname = realname
self.host = host
self.port = port
self.sock = socket.socket()
self.RecvQ... | mkalte666/Dragonflame | IrcClient.py | Python | mit | 3,540 |
#coding: utf-8
__author__ = 'zheng'
import re
import tornado.gen
from tornado.httpclient import AsyncHTTPClient
from BeautifulSoup import BeautifulSoup
from chat.handler import BaseHandler
class TumblrHandler(BaseHandler):
@tornado.gen.coroutine
def get(self):
http_client = AsyncHTTPClie... | yunlzheng/chat | chat/handler/tumblr.py | Python | mit | 664 |
from cap01Lineal import *
def isPerpendicular(A1, A2, B1, B2):
''' Valida si puntos dados forman vectores perpendiculares
Parametros:
A1 punto 1 vector 1
A2 punto 2 vector 1
B1 punto 1 vector 2
B2 punto 2 vector 2
'''
v = Vector(A1, A2)
u = Vector(B1, B2)
ppunto = Punto(v, u)
i... | Jofemago/Computacion-Grafica | ALGEBRA LINEAL/EjCap01.py | Python | mit | 713 |
"""Yelp API setup and random business selection function"""
import io
import json
import random
from yelp.client import Client
from yelp.oauth1_authenticator import Oauth1Authenticator
with io.open('config_yelp_secret.json') as cred:
creds = json.load(cred)
auth = Oauth1Authenticator(**creds)
yelp_clien... | neonbadger/DestinationUnknown | yelp_api.py | Python | mit | 2,082 |
from __future__ import division
from scitbx.linalg import eigensystem
from scitbx.array_family import flex
from libtbx.utils import null_out
from math import acos,pi
from iotbx import pdb
import iotbx.pdb
class fab_elbow_angle(object):
def __init__(self,
pdb_hierarchy,
chain_ID_light='... | youdar/work | work/FAB/cross/fab_elbow_angle.py | Python | mit | 5,657 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1310160000.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/MODEL1310160000 | MODEL1310160000/model.py | Python | cc0-1.0 | 427 |
import sys
import pickle
from nltk.tokenize import word_tokenize
from cleaneddata.remove_stopwords_nltk import read_words, clean_review
from model.generateModel import generatemodel
from validation.validate import predict
review = raw_input("Enter a review to classify: ")
try:
paramfile = open("model/savedmodel.p... | vishnupriyam/review-classification | classify.py | Python | cc0-1.0 | 1,294 |
# -*- encoding:utf-8 -*-
# smart_highlight.py is part of smart-highlighting-gedit.
#
#
# Copyright 2010-2012 swatch
#
# smart-highlighting-gedit 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... | rsgemignani/dotfiles | root/usr/lib/gedit/plugins/smart_highlight/smart_highlight.py | Python | gpl-2.0 | 9,699 |
from boxbranding import getBoxType
from twisted.internet import threads
from enigma import eDBoxLCD, eTimer
from config import config, ConfigSubsection, ConfigSelection, ConfigSlider, ConfigYesNo, ConfigNothing
from Components.SystemInfo import SystemInfo
from Tools.Directories import fileExists
import usb
def IconC... | OpenSPA/dvbapp | lib/python/Components/Lcd.py | Python | gpl-2.0 | 18,578 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# http://www.youtube.com/user/irmaospiologo
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Based on code from youtube addon
#----------------------------------... | cmvac/demagorgon.repository | plugin.video.irmaospiologo/default.py | Python | gpl-2.0 | 1,296 |
# -*- coding: utf-8 -*-
# 大規模疎行列 x 密行列演算の実行速度検証
# @nashibao
# 使い方:
# python mm_performance.py l1 l2 l3 alpha
# l1, l2: 疎行列サイズ
# l2, l3: 密行列サイズ
# alpha: 疎行列充填率
# sp_matrix(l1, l2, alpha) x dense_vec(l2, l3)
# 結果:
# 2013/01/22
# python mm_performance.py 100000 10000 10 0.005
# prepare..
# 0.437 sec
# compute..
# ... | bit-jmm/ttarm | nmf/_mm_performance.py | Python | gpl-2.0 | 1,942 |
import urllib
import urllib2
import json
import difflib
import pylast
class iTunesAlbumArt(object):
def __init__(self):
self.base_url = 'https://itunes.apple.com/search'
self.limit = 50
def _form_url(self, artist):
args_dict = {'limit': self.limit,
'term': artist}... | arfar/art-py | apis.py | Python | gpl-2.0 | 2,779 |
import nacl.encoding
import nacl.public
import nacl.utils
class WhisperKey():
def __init__(self, key=None):
if key is None:
self.generate_keypair()
else:
if isinstance(key, bytes) or isinstance(key, str):
try:
self._private_key = nacl.public.PrivateKey(key, encoder=nacl.encodin... | NoiSek/whisper | whisper/models/whisperkey.py | Python | gpl-2.0 | 5,369 |
# https://codecombat.com/play/level/if-stravaganza?
#
# Debes Comprar & Equipar:
# 1. Reloj de Pulsera Simple
# 2. Programática II
#
# ¡Derrota a los ogros desde dentro de su propio campamento!
while True:
enemy = hero.findNearestEnemy()
# Usa la sentencia if para comprobar si existe un enemigo
# Ataca al ... | inukaze/maestro | Solución/CodeCombat/Python/2.Bosque_Aislado/005 - If-stravaganza.py | Python | gpl-2.0 | 386 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from selenium.common.exceptions import NoSuchElementException
import cfme.tests.configure.test_access_control as tac
from cfme.base.login import BaseLoggedInPage
from cfme import test_requirements
from cfme.utils import error
from cfme.utils.blockers import BZ
... | mfalesni/cfme_tests | cfme/tests/services/test_catalog_item.py | Python | gpl-2.0 | 5,757 |
# Copyright (C) 2012 by Eka A. Kurniawan
# eka.a.kurniawan(ta)gmail(tod)com
#
# 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; version 2 of the License.
#
# This program is distributed in the hop... | ekaakurniawan/Bioinformatics-Tools | plot_conservation/plot_conservation.py | Python | gpl-2.0 | 2,539 |
# -*- coding:utf-8 -*-
'''
x11perf测试工具执行脚本
'''
import os, shutil, re
from test import BaseTest
from lpt.lib.error import *
from lpt.lib import lptxml
from lpt.lib import lptlog
from lpt.lib.share import utils
from lpt.lib import lptreport
import glob
glxgears_keys = ["gears"]
class TestControl(BaseTest):
... | ShaolongHu/lpts | tests/glxgears.py | Python | gpl-2.0 | 3,938 |
#
# Pylint documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 4 20:31:25 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values hav... | PyCQA/pylint | doc/conf.py | Python | gpl-2.0 | 7,748 |
# -*- Mode: Python; test-case-name: flumotion.test.test_component -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General ... | offlinehacker/flumotion | flumotion/component/component.py | Python | gpl-2.0 | 31,473 |
from enigma import getPrevAsciiCode
from Tools.NumericalTextInput import NumericalTextInput
from Tools.Directories import resolveFilename, SCOPE_CONFIG, fileExists
from Components.Harddisk import harddiskmanager
from copy import copy as copy_copy
from os import path as os_path
from time import localtime, strftime
# Co... | kajgan/e2 | lib/python/Components/config.py | Python | gpl-2.0 | 55,036 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_fiscal_retornosstatusecf.ui'
#
# Created: Mon Nov 24 22:26:20 2014
# 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, QtGui
class Ui_ui_FISCAL_Retorno... | edineicolli/daruma-exemplo-python | scripts/fiscal/ui_fiscal_retornosstatusecf.py | Python | gpl-2.0 | 31,540 |
# Summary text hub
#
# Copyright (C) 2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the h... | kparal/anaconda | pyanaconda/ui/tui/hubs/summary.py | Python | gpl-2.0 | 5,735 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from _base import *
class Kinds(db.Model,SessionMixin):
__tablename__ = "kinds" #课程种类和描述
__table_args__ = {
'mysql_engine': 'InnoDB',
'mysql_charset': 'utf8',
'mysql_collate': 'utf8_general_ci'
}
kindid = db.Column(db.String(50), pr... | ihciah/xk-database | models/coursekinds.py | Python | gpl-2.0 | 2,456 |
"""Tests for the unused-variable message in assignment expressions"""
def typed_assignment_in_function_default( # [unused-variable]
param: str = (typed_default := "walrus"), # [unused-variable]
) -> None:
"""An unused annotated assignment expression in a default parameter should emit"""
return param
de... | PyCQA/pylint | tests/functional/u/unused/unused_variable_py38.py | Python | gpl-2.0 | 1,000 |
'''Python sys.excepthook hook to generate apport crash dumps.'''
# Copyright (c) 2006 - 2009 Canonical Ltd.
# Authors: Robert Collins <robert@ubuntu.com>
# Martin Pitt <martin.pitt@ubuntu.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Publ... | windflyer/apport | apport_python_hook.py | Python | gpl-2.0 | 7,544 |
from django.conf.urls import patterns, url
from publicaciones import views
urlpatterns = patterns('',
url(r'^$', views.index, name='index'),
url(r'^(?P<articulo_id>\d+)/$', views.ver_articulo, name='ver_articulo'),
) | rickyrish/rickyblog | build/lib.linux-i686-2.7/publicaciones/urls.py | Python | gpl-2.0 | 226 |
#!/usr/bin/python3
import exhibition
from data import TILE_SIZE
import pygame
import collections
import logging
log = logging.getLogger(__name__)
DEBUG_RENDER_COORDS = True
class Tile:
""" A tile represents one tile in an area's map.
It has an image, a position rectangle, and an optional collision rect... | kjwilcox/digital_heist | src/tile.py | Python | gpl-2.0 | 2,393 |
# -*- coding: utf-8 -*-
"""
werkzeug.contrib.kickstart
~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides some simple shortcuts to make using Werkzeug simpler
for small scripts.
These improvements include predefined `Request` and `Response` objects as
well as a predefined `Application` object whi... | AntonioMtn/NZBMegaSearch | werkzeug/contrib/kickstart.py | Python | gpl-2.0 | 11,308 |
import os
os.chdir('C:/Users/Ramaneek/SkyDrive/Documents/University/Third Year/CSC320/project 2/')
###########################################################################
## Handout painting code.
###########################################################################
from PIL import Image
from pylab import *... | RamaneekGill/CSC320-Winter-2014 | project 2/p2.py | Python | gpl-2.0 | 12,095 |
# Copyright (c) 2010-2011, Emmanuel Blot <emmanuel.blot@free.fr>
# 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
# noti... | CospanDesign/nysa-artemis-usb2-platform | artemis_usb2/spi_flash/serial_flash_manager.py | Python | gpl-2.0 | 5,915 |
# F3AT - Flumotion Asynchronous Autonomous Agent Toolkit
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
# 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... | f3at/feat | src/feat/test/integration/test_simulation_graph.py | Python | gpl-2.0 | 19,012 |
# Patchwork - automated patch tracking system
# Copyright (C) 2020, Stephen Finucane <stephen@that.guru>
#
# SPDX-License-Identifier: GPL-2.0-or-later
from rest_framework.fields import empty
from rest_framework.fields import get_attribute
from rest_framework.fields import SkipField
from rest_framework.relations import... | getpatchwork/patchwork | patchwork/api/__init__.py | Python | gpl-2.0 | 1,807 |
##############################################################################
# Copyright (C) 2005 Adam Smith asmith@agile-software.com
#
# 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; eith... | pdonorio/frapi | imgresize/processor/ZoomifyBase.py | Python | gpl-2.0 | 12,240 |
#!/usr/bin/env python3
# Python 2/3 compatability
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import sys
import argparse
import os
import os.path
import itertools as it
from os.path import join as pjoin
# Make sure *this* versions oomphpy is in the p... | davidshepherd7/oomph-lib-micromagnetics | self_test/nodal_quadrature_bem/validate.py | Python | gpl-2.0 | 1,780 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
import time
def main():
# GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
GPIO.output(18, GPIO.HIGH)
time.sleep(5);
GPIO.output(18, GPIO.LOW)
GPIO.cleanup()
if __name__ == "__main__":
main()
| DzikuVx/PowerCutter | power_cutter.py | Python | gpl-2.0 | 300 |
#!/usr/bin/python
# 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, or
# (at your option) any later version.
#
# This program is distributed in the hope that it w... | bbradbury/yum-utils | debuginfo-install.py | Python | gpl-2.0 | 7,411 |
# This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free ... | UdK-VPT/Open_eQuarter | crow_archive/crow_django/ates/models.py | Python | gpl-2.0 | 33,811 |
from setuptools import setup, find_packages
import os
description = "Make sure all source files have your standard licensing stub "\
"at the top."
long_description = ""
setup(name='plicense',
version='0.2.1',
description=description,
long_description=long_description,
classifier... | dsoprea/LicensePrepend | setup.py | Python | gpl-2.0 | 692 |
# -*- coding: UTF-8 -*-
# Copyright 2007-2008 One Laptop Per Child
# Copyright 2007 Gerard J. Cerchio <www.circlesoft.com>
# Copyright 2008 Andrés Ambrois <andresambrois@gmail.com>
# Copyright 2010 Marcos Orfila <www.marcosorfila.com>
#
# This program is free software; you can redistribute it and/or modify
# it under t... | Daksh/tuxmath | activity.py | Python | gpl-2.0 | 6,945 |
"""Brix quantification extraction from temporal modality."""
from __future__ import division
import numpy as np
from joblib import Parallel, delayed
from scipy.optimize import curve_fit
from .temporal_extraction import TemporalExtraction
from .tofts_quantification_extraction import ToftsQuantificationExtraction
fr... | glemaitre/protoclass | protoclass/extraction/brix_quantification_extraction.py | Python | gpl-2.0 | 11,975 |
##
# Copyright 2009-2020 Ghent University, Forschungszentrum Juelich
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# the... | pescobar/easybuild-easyblocks | easybuild/easyblocks/m/mpich.py | Python | gpl-2.0 | 7,319 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009-2012 Zuza Software Foundation
#
# This file is part of Pootle.
#
# 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... | ttreeagency/PootleTypo3Org | pootle/apps/pootle_app/views/index/index.py | Python | gpl-2.0 | 4,828 |
# Copyright (C) 2009-2010 Mathias Brodala
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope... | exaile/exaile | plugins/minimode/__init__.py | Python | gpl-2.0 | 9,528 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvalacarta - XBMC Plugin
# Canal para Extremadura TV
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,re
import urllib
from core import logger
from ... | titienmiami/mmc.repository | plugin.video.tvalacarta/tvalacarta/channels/extremaduratv.py | Python | gpl-2.0 | 10,295 |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
"""
Get package download statistics from PyPI
"""
# Based on https://github.com/collective/Products.PloneSoftwareCenter\
# /commit/601558870175e35cfa4d05fb309859e580271a1f
# For sorting XML-RPC result... | benjaoming/simple-pypi-statistics | simple_pypi_statistics/api.py | Python | gpl-2.0 | 6,238 |
#
# Copyright 2016 Red Hat, Inc.
#
# 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, or
# (at your option) any later version.
#
# This program is distributed in th... | EdDev/vdsm | tests/osinfo_test.py | Python | gpl-2.0 | 1,439 |
"""
Some utilities used by upgrade scripts
"""
import sys, os, psycopg, glob, subprocess, traceback, time
sys.path.append('..')
def log(msg):
sys.stdout.flush()
sys.stderr.write(msg+'\n')
sys.stderr.flush()
SCODOC_DIR=os.environ.get('SCODOC_DIR', '')
if not SCODOC_DIR:
log('Error: environment var... | denys-duchier/Scolar | config/scodocutils.py | Python | gpl-2.0 | 4,053 |
#!/usr/bin/python
import os
import sys
import getopt
import shutil
import string
# Globals
quiet = 0
test = 0
comments = 0
sysfsprefix = "/sys/devices/system/rttest/rttest"
statusfile = "/status"
commandfile = "/command"
# Command opcodes
cmd_opcodes = {
"schedother" : "1",
"schedfifo" : "2",
"loc... | luckasfb/OT_903D-kernel-2.6.35.7 | kernel/scripts/rt-tester/rt-tester.py | Python | gpl-2.0 | 5,104 |