code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
import time
import random
import uuid
def timefunc(f):
def f_timer(*args, **kwargs):
start = time.time()
result = f(*args, **kwargs)
end = time.time()
return result
return f_timer
with open("write.test", 'w') as sample:
for _ in range(10000):
sample.write("%s %s\n"... | fcaneto/can_i_beat_redis | gen_test.py | Python | mit | 506 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import signal
import tornado.ioloop
import tornado.web
import tornado.httpserver
import tornadoredis
import torndb
from tornado.options import options, define
import log
import handlers.test
from settings import (
DEBUG, PORT, HOST,
MYSQL_CONFIG, REDIS_CONFIG
)
... | zhkzyth/storm_maker | template/src/app.py | Python | mit | 1,540 |
QUERY_LOGGING = {
'formatters': {
'wrapper_verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'wrapper_simple': {
'format': '%(levelname)s %(message)s'
},
'wrapper_json': {
'()': 'jsonlogger.J... | MattBlack85/django-query-logger | query_logger/settings.py | Python | mit | 981 |
import os
import subprocess
from plank import task, depends
@task
def unit_tests():
# Run tests in subprocess since we've imported some of the code we are testing
# and coverage will not accurately reflect the lines we test
exit_status = subprocess.check_call(['py.test', '--cov', 'plank', '--cov-report='... | atbentley/plank | planks.py | Python | mit | 1,270 |
import os
from flask import jsonify
from systemetapi import app
from systemetapi import config
@app.route("/")
def index():
return jsonify(version=config.VERSION, status='ok')
if __name__ == "__main__":
app.run(debug=True)
| br0r/systemet-api | server.py | Python | mit | 230 |
# -*- coding: utf-8 -*-
__author__ = """JanFan"""
__email__ = 'guangyizhang.jan@gmail.com'
__version__ = '0.1.0'
| JanFan/py-aho-corasick | py_aho_corasick/__init__.py | Python | mit | 114 |
import meistermind
def show_menu (games):
print "Hello!"
print "Choose your game or press Q and Enter to quit."
for g in games:
print "\t" + g + ") " + games[g]
quit = False
while not (quit):
games = {
"1": "Meistermind",
"2": "No Game Here",
}
show_menu(games)
cho... | posiputt/Sandbox | games.py | Python | mit | 454 |
from setuptools import setup, find_packages
import sys, os
"""
打包的用的setup必须引入
"""
VERSION = '0.0.1'
with open('README.md') as f:
long_description = f.read()
setup(
name='rfw_utils', # 文件名
version=VERSION, # 版本(每次更新上传Pypi需要修改)
description="Speed up restframework develop",
long_description... | h3l/rfw_utils | setup.py | Python | mit | 1,054 |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def isBalanced(self, root):
"""
:type root: TreeNode
:rtype: bool
"""
return self... | liupangzi/codekata | leetcode/Algorithms/110.BalancedBinaryTree/Solution.py | Python | mit | 712 |
# -*- coding: utf-8 -*-
"""
priority: HTTP/2 priority implementation for Python
"""
from .priority import ( # noqa
Stream,
PriorityTree,
DeadlockError,
PriorityLoop,
PriorityError,
DuplicateStreamError,
MissingStreamError,
TooManyStreamsError,
BadWeightError,
PseudoStreamError,
... | python-hyper/priority | src/priority/__init__.py | Python | mit | 346 |
from tqdm import tqdm
from collections import defaultdict
import h5py
import networkx as nx
import struct
import numpy as np
# hl = None
# ml = None
# with h5py.File('/usr/people/it2/seungmount/research/datasets/blended_piriform_157x2128x2128/all/human_semantic_labels.h5','r') as f:
# hl = f['main'][:]
# with h5py.F... | tartavull/tigertrace | tigertrace/util/rehuman_semantics.py | Python | mit | 1,483 |
#!/usr/bin/env ganga
import getpass
from distutils.util import strtobool
polarity='MagDown'
datatype='MC'
substitution='None'
channel='11164031'
b=Job()
b.application=DaVinci(version="v36r5")
if datatype=='MC':
b.application.optsfile='NTupleMaker_{0}.py'.format(polarity)
if datatype=='Data':
if substitution... | Williams224/davinci-scripts | kstaretappipig/JobSubmit.py | Python | mit | 1,942 |
#!/usr/bin/env python
# created by chris@drumminhands.com
# modified by varunmehta
# see instructions at http://www.drumminhands.com/2014/06/15/raspberry-pi-photo-booth/
import atexit
import glob
import logging
import math
import os
import subprocess
import sys
import time
import traceback
from time import sleep
impo... | varunmehta/photobooth | photobooth.py | Python | mit | 12,204 |
__author__ = 'moskupols'
__all__ = ['morphology', 'cognates', 'pymystem'] | hatbot-team/hatbot_resources | preparation/lang_utils/__init__.py | Python | mit | 74 |
import os
import xbmc, xbmcgui, mc
import ConfigParser
import common
available_providers = ['Addic7ed', 'BierDopje', 'OpenSubtitles', 'SubsWiki', 'Subtitulos', 'Undertexter']
# Set some default values for the subtitles handling
def register_defaults():
subtitle_provider("get", "default")
subtitle_provider("ge... | boxeehacks/boxeehack | hack/boxee/skin/boxee/720p/scripts/boxeehack_settings.py | Python | mit | 14,393 |
from bpy_extras.view3d_utils import location_3d_to_region_2d
def render_get_resolution_(r):
xres = int(r.resolution_x * r.resolution_percentage * 0.01)
yres = int(r.resolution_y * r.resolution_percentage * 0.01)
return xres, yres
def render_get_aspect_(r, camera=None, x=-1, y=-1):
if x != -1 and y... | prman-pixar/RenderManForBlender | rfb_utils/camera_utils.py | Python | mit | 2,235 |
# Generated by Django 2.1.11 on 2019-08-23 11:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('sliders', '0007_slide_name_sub'),
]
operations = [
migrations.AlterField(
model_name='link',
... | rouxcode/django-cms-plugins | cmsplugins/sliders/migrations/0008_auto_20190823_1324.py | Python | mit | 977 |
#!/usr/bin/env python
'''
The MIT License (MIT)
Copyright (c) <2018> <Mathias Lesche>
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
... | mlesche/dsp | dsp/src/database_scripts/archive_analysis.py | Python | mit | 4,536 |
import numpy as np
import os
import scipy.misc
import shutil
import tensorflow as tf
from functools import reduce
from operator import mul
def read_image(path, mode='RGB', size=None):
img = scipy.misc.imread(path, mode=mode)
if size is not None:
img = scipy.misc.imresize(img, size)
return img
def ... | tonypeng/tensorstyle | utils.py | Python | mit | 1,610 |
from bokeh.charts import Scatter, output_file, show
x = [1, 2, 3, 4, 5, 6, 7, 8]
y = [2.1, 6.45, 3, 1.4, 4.55, 3.85, 5.2, 0.7]
z = [.5, 1.1, 1.9, 2.5, 3.1, 3.9, 4.85, 5.2]
species = ['cat', 'cat', 'cat', 'dog', 'dog', 'dog', 'mouse', 'mouse']
country = ['US', 'US', 'US', 'US', 'UK', 'UK', 'BR', 'BR']
df = {'time': x,... | Serulab/Py4Bio | code/ch14/scatter.py | Python | mit | 618 |
#! /usr/bin/env python
from distutils.core import setup, Extension
m = Extension('netdev',
sources = ['netdev.c']
)
setup(name = 'netdev',
version = '1.0',
description = 'python native library for network device',
ext_modules = [m])
| maliubiao/python_netlink | setup.py | Python | mit | 277 |
# Copyright (c) 2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import opcodes
from decompiler.basicblock import find_basic_blocks
from decompiler.dataflow import analyze_basic_block, BBInput, IOutput,... | laanwj/sundog | tools/decompile.py | Python | mit | 18,090 |
#!/usr/bin/env python3
import os
import sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'models/research/slim'))
import time
import datetime
import logging
from tqdm import tqdm
import numpy as np
import cv2
import simplejson as json
from sklearn.met... | aaalgo/cls | train-slim-fcn.py | Python | mit | 13,078 |
from node_view import NodeGraphView
from node_scene import NodeGraphScene
from items.node_item import NodeItem
from items.connection_item import ConnectionItem
from items.connector_item import BaseConnectorItem, IOConnectorItem, InputConnectorItem, OutputConnectorItem
import node_utils | allebacco/PyNodeGraph | pynodegraph/__init__.py | Python | mit | 286 |
"""Replacement for ``django.template.loader`` that uses Jinja 2.
The module provides a generic way to load templates from an arbitrary
backend storage (e.g. filesystem, database).
"""
from coffin.template import Template as CoffinTemplate
from jinja2 import TemplateNotFound
def find_template_source(name, dirs=None)... | AbleCoder/pyjade_coffin | pyjade_coffin/template/loader.py | Python | mit | 2,320 |
# coding: UTF-8
import unittest
from usig_normalizador_amba.NormalizadorDireccionesAMBA import NormalizadorDireccionesAMBA
from usig_normalizador_amba.Direccion import Direccion
from usig_normalizador_amba.Errors import ErrorCruceInexistente, ErrorCalleInexistente
from usig_normalizador_amba.settings import CALLE_Y_C... | usig/normalizador-amba | tests/NormalizadorDireccionesAMBACalleYCalleTestCase.py | Python | mit | 3,432 |
import numbers
from collections.abc import Iterable
import numpy as np
from taichi._lib import core as ti_core
from taichi.lang import expr, impl
from taichi.lang import ops as ops_mod
from taichi.lang import runtime_ops
from taichi.lang._ndarray import Ndarray, NdarrayHostAccess
from taichi.lang.common_ops import Tai... | yuanming-hu/taichi | python/taichi/lang/matrix.py | Python | mit | 54,017 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import abc
import os
import glob
import logging
import json
import warnings
from monty.io import zopen
from pymatgen.io.vasp.inputs import Incar, Potcar, Poscar
from pymatgen.io.vasp.outputs import Vasprun, O... | blondegeek/pymatgen | pymatgen/apps/borg/hive.py | Python | mit | 15,762 |
from django.conf import settings
import hashlib
import hmac
import base64
import urllib
import time
import random
import string
import requests
def _parse_response(text):
return dict( [(k[0], k[1]) for k in [i.split('=') for i in text.split('&')]] )
def get_request_token():
url = 'https://api.twitter.com/o... | p2pu/mechanical-mooc | twitter/utils.py | Python | mit | 3,949 |
import _plotly_utils.basevalidators
class TokenValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="token", parent_name="histogram2d.stream", **kwargs):
super(TokenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/plotly.py | packages/python/plotly/plotly/validators/histogram2d/stream/_token.py | Python | mit | 499 |
import xbmc
#use this if you are running Weather+ to avoid a startup conflict
#xbmc.executebuiltin('AlarmClock(ustvvodupdatelibrary,XBMC.RunScript(script.ustvvodlibraryautoupdate),1,true)')
#otherwise this one should be fine
xbmc.executebuiltin('RunScript(script.ustvvodlibraryautoupdate)')
| moneymaker365/script.ustvvodlibraryautoupdate | autoexec.py | Python | mit | 300 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "debug_server.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| bungoume/debug-server | debug_server/manage.py | Python | mit | 255 |
# Simple example of reading the MCP3008 analog input channels and printing
# them all out.
# Author: Tony DiCola
# License: Public Domain
import time
# Import SPI library (for hardware SPI) and MCP3008 library.
import Adafruit_GPIO.SPI as SPI
import Adafruit_MCP3008
# Software SPI configuration:
CLK = 18
MISO = 23
... | andycavatorta/oratio | Roles/avl-settings/mcp3008Adafruit_test.py | Python | mit | 1,191 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-18 15:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("froide_campaign", "0007_campaign_subject_template"),
]
operations = [
migra... | okfde/froide-campaign | froide_campaign/migrations/0008_campaignpage.py | Python | mit | 1,181 |
# This program extracts UF email addresses from a CSV file and prints them organized by class sections.
import os
import re
COURSE_NAME = "EEE3308C"
def extractEmailAddress(list):
for item in list:
if "@ufl.edu" in item:
return item
raise RuntimeError
def extractCVSInfo(namePattern):
... | Babtsov/Python-Scripts | emailExtract.py | Python | mit | 2,106 |
"""
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
"""
from .base import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default=True)
TEMPLATES[0]['OPT... | hqpr/findyour3d | config/settings/local.py | Python | mit | 1,853 |
import time
import glob
import os
import types
import socket
def read_paths ():
fulllist = []
for file in glob.glob("*96*messages"):
print 'reading ' + file
fullfile = (open(file).read().splitlines())
for x in fullfile:
if 'RPD_MPLS_LSP_CHANGE'in x and 'Sep 1... | shashankjagannath/shashankfoo | genresigpath.py | Python | cc0-1.0 | 1,485 |
from tests.unit.dataactcore.factories.staging import DetachedAwardFinancialAssistanceFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs28_detached_award_financial_assistance_1'
def test_column_headers(database):
expected_subset = {'row_number', 'assistance_type', ... | fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_fabs28_detached_award_financial_assistance_1.py | Python | cc0-1.0 | 2,049 |
text = input("Enter something ")
if (text.strip()):
print("This text is not empty")
else:
print("This text is EMPTY")
| alaudo/coderdojo-python | code/11 - empty.py | Python | cc0-1.0 | 126 |
import graphlab as gl
import time
def pagerank_update_fn(src, edge, dst):
if src['__id'] != dst['__id']: # ignore self-links
dst['pagerank'] += src['prev_pagerank'] * edge['weight']
return (src, edge, dst)
def sum_weight(src, edge, dst):
if src['__id'] != dst['__id']: # ignore self-links
s... | dato-code/how-to | triple_apply_weighted_pagerank.py | Python | cc0-1.0 | 2,161 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import get_fullname, flt, cstr
from frappe.model.document import Document
from erpnext.hr.utils imp... | Aptitudetech/ERPNext | erpnext/hr/doctype/expense_claim/expense_claim.py | Python | cc0-1.0 | 8,629 |
# -*- coding: utf-8 -*-
from chat.models import Message
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth.models import User
from django.views.generic.list import ListView
# Uncomment the next two lines to enable the admin:
admin.autodiscover()
urlpatterns ... | rewiko/chat_django | chat/urls.py | Python | gpl-2.0 | 881 |
# -*- coding: utf-8 -*-
from __future__ import division, unicode_literals, absolute_import
import sys, os
import copy
import numpy as np
try:
import scipy
from scipy import interpolate
# print (scipy.__version__)
# print (dir(interpolate))
except:
print('picture_functions.py: scipy is not avail'... | dimonaks/siman | siman/picture_functions.py | Python | gpl-2.0 | 47,676 |
# Copyright (C) 2017 Linaro Limited
#
# Author: Remi Duraffort <remi.duraffort@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher 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 v... | Linaro/lava-dispatcher | lava_dispatcher/actions/boot/docker.py | Python | gpl-2.0 | 5,291 |
#!/usr/bin/env python
###############################################################################
# $Id: ogr_sde.py 33793 2016-03-26 13:02:07Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test OGR ArcSDE driver.
# Author: Howard Butler <hobu.inc@gmail.com>
#
############################################... | nextgis-extra/tests | lib_gdal/ogr/ogr_sde.py | Python | gpl-2.0 | 10,401 |
# coding: utf-8
import configureEnvironnement
configureEnvironnement.setup()
from restaurant.models import Fourniture, Fournisseur
fs = Fournisseur.objects.all()
for f in fs:
print(f.id, ") " + f.nom)
res = input("Entrez le num fournisseur: ")
idee = int(res)
print(idee)
f = Fournisseur.objects.get(id=idee)
pri... | simonpessemesse/seguinus | programmesStandaloneUtilitaires/ajoutFourniture.py | Python | gpl-2.0 | 509 |
#!/usr/bin/env python
# coding: utf8
import logging
import signal
import time
import xmpp
from xmpp.browser import (
ERR_ITEM_NOT_FOUND,
ERR_JID_MALFORMED,
NS_COMMANDS,
NS_VERSION,
Browser,
Error,
Message,
NodeProcessed,
Presence,
)
from .common import jid_to_data
_log = logging.... | HoverHell/pyimapsmtpt | pyimapsmtpt/xmpptransport.py | Python | gpl-2.0 | 8,036 |
#
# sundtek control center
# coded by giro77
#
#
from Screens.Screen import Screen
from Screens.Console import Console
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Components.ActionMap import ActionMap
from Components.Input import Input
from Components.MenuList import MenuLis... | Mariusz1970/enigma2 | lib/python/Plugins/Extensions/Infopanel/sundtek.py | Python | gpl-2.0 | 11,219 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgspointdisplacementrenderer.py
-----------------------------
Date : September 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at... | myarjunar/QGIS | tests/src/python/test_qgspointdisplacementrenderer.py | Python | gpl-2.0 | 9,082 |
# Datetime configuration spoke class
#
# Copyright (C) 2012-2013 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 i... | M4rtinK/anaconda | pyanaconda/ui/gui/spokes/datetime_spoke.py | Python | gpl-2.0 | 35,325 |
import StringIO
import traceback
from java.lang import StringBuffer #@UnresolvedImport
from java.lang import String #@UnresolvedImport
import java.lang #@UnresolvedImport
import sys
from _pydev_tipper_common import DoFind
try:
False
True
except NameError: # version < 2.3 -- didn't have the True/False builtins... | AMOboxTV/AMOBox.LegoBuild | script.module.pydevd/lib/_pydev_jy_imports_tipper.py | Python | gpl-2.0 | 16,814 |
# -*- coding: utf-8 -*-
# BankCSVtoQif - Smart conversion of csv files from a bank to qif
# Copyright (C) 2015-2016 Nikolai Nowaczyk
#
# 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 v... | niknow/BankCSVtoQif | setup.py | Python | gpl-2.0 | 1,329 |
#!/usr/bin/env python
# encoding=utf-8
# locations.urls
from django.conf.urls import patterns, url
urlpatterns = patterns('',
# ex: /afp/
) | eHealthAfrica/LMIS | LMIS/locations/urls.py | Python | gpl-2.0 | 151 |
'''
Copyright 2011 Mikel Azkolain
This file is part of Spotimc.
Spotimc 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 3 of the License, or
(at your option) any later version.
Spotimc ... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/script.audio.spotimc.smallplayer/default.py | Python | gpl-2.0 | 3,422 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
.. module:: angle.py
:platform: Unix, Windows
:synopsis: Ulyxes - an open source project to drive total stations and
publish observation results.
GPL v2.0 license
Copyright (C) 2010- Zoltan Siki <siki.zoltan@epito.bme.hu>
.. moduleauthor:: dr. Zoltan ... | zsiki/ulyxes | pyapi/angle.py | Python | gpl-2.0 | 7,587 |
from django.db import models
from fluxbb import FLUXBB_PREFIX
class SearchWord(models.Model):
"""
FluxBB Search Word
Fields on this model match exactly with those defined by fluxbb, see the
[fluxbb dbstructure](http://fluxbb.org/docs/v1.5/dbstructure#users).
"""
id = models.AutoField(primary_... | kalhartt/django-fluxbb | fluxbb/models/search_word.py | Python | gpl-2.0 | 481 |
# -*- coding: utf-8 -*-
#
# Plugins' module file for serverApplet.
# Copyright (C) 2015 Gergely Bódi
#
# 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 ... | vendelin8/serverApplet | plugin/__init__.py | Python | gpl-2.0 | 1,584 |
"""
Django settings for magicserver project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...... | nvl1109/testmagic | magicserver/settings.py | Python | gpl-2.0 | 2,220 |
import re
def convert(path):
f = open(path)
FUNCTION_RE = re.compile(r'(\S*?)\s*=\s*\w+dll.\w+.(\S*)')
import ctypes
dlls = \
{
'user32' : ctypes.windll.user32,
'shell32' : ctypes.windll.shell32,
'kernel32' : ctypes.windll.kernel32,
'gdi32' : ctypes... | gregorlarson/loxodo | src/frontends/ppygui/ppygui_winxp/converttonwin32.py | Python | gpl-2.0 | 1,317 |
from buildbot.status import tests
from buildbot.process.step import SUCCESS, FAILURE, BuildStep
from buildbot.process.step_twisted import RunUnitTests
from zope.interface import implements
from twisted.python import log, failure
from twisted.spread import jelly
from twisted.pb.tokens import BananaError
from twisted.w... | gward/buildbot | buildbot/process/step_twisted2.py | Python | gpl-2.0 | 6,316 |
#!/usr/bin/env python
#coding:utf-8
import commands
import os
import base
class SystemStat(object):
'系统基本性能数据收集'
def __init__(self,interval = 30 , cpu_core = True ):
self.interval = interval
self.cpu_core = cpu_core
def _read_cpu_usage(self):
'''
从/proc/stat 读取CPU状态
返回值为列表: [ ['cpu', 'total_value','use_... | secisland/HostMonitor | system.py | Python | gpl-2.0 | 4,072 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Glencoe Software, Inc. All rights reserved.
#
# This software is distributed under the terms described by the LICENCE file
# you can find at the root of the distribution bundle.
# If the file is missing please request a copy by contacting
# jason@glen... | openmicroscopy/omero-marshal | omero_marshal/decode/decoders/permissions.py | Python | gpl-2.0 | 817 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
proximity.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... | siliconsmiley/QGIS | python/plugins/processing/algs/gdal/proximity.py | Python | gpl-2.0 | 4,529 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# @author Viktor Zharina <viktorz1986@gmail.com>
# CC-BY-SA License
settings = {
'currencys' : ['usd', 'eur'],
'operations' : ['buy', 'sell'],
}
lang = {
'ru': {
'usd_buy' : u'USD покупка',
'usd_sell' : u'USD продажа',
'eu... | ViktorZharina/BestBankExchange | src/config/settings.py | Python | gpl-2.0 | 427 |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from nextgisweb_compulink.compulink_video_producer.default_video_page import DefaultVideoPage, UNITS
from nextgisweb_compulink.compulink_video_producer.model import VideoProduceTask
from nextgisweb_compulink.compulink_video_producer.video_options import ... | nextgis/nextgisweb_compulink | nextgisweb_compulink/compulink_video_producer/command.py | Python | gpl-2.0 | 1,716 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... | claudep/translate | translate/storage/placeables/parse.py | Python | gpl-2.0 | 3,307 |
# 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.
import time
from pathlib import Path
from typing import Generator, Set,... | Mellthas/quodlibet | quodlibet/library/file.py | Python | gpl-2.0 | 15,337 |
from cx_Freeze import setup, Executable
setup(name = "PyPet" ,
version = "0.0.1" ,
description = "PyPet by PhoenixIgnis, Indev: 0.0.1 " ,
executables = [Executable("main.py")])
##cmd...
## python Setup.py build | PhoenixIgnis/Phoenix-Repo | Pygame/PyPet/Setup.py | Python | gpl-2.0 | 247 |
# Copyright (C) 2016 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of the GNU General... | nijinashok/sos | sos/plugins/dracut.py | Python | gpl-2.0 | 862 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*- #
#####################################################################
# #
# Frets on Fire X #
# Copyright (C) 20... | evilynux/fofix | setup.py | Python | gpl-2.0 | 17,079 |
from mom.Collectors.GuestIoTune import GuestIoTune
class GuestIoTuneOptional(GuestIoTune):
"""
This Collector gets IoTune statistics in the same way GuestIoTune does.
The only difference is that it reports all the fields as optional and thus
allows the policy to be evaluated even when the balloon devi... | oVirt/mom | mom/Collectors/GuestIoTuneOptional.py | Python | gpl-2.0 | 528 |
import numpy as np
import dnfpy.core.utils as utils
from dnfpyUtils.stats.trajectory import Trajectory
class TargetCenterList(Trajectory):
"""
Input:
inputMap (constructor)
targetList (children)
Output:
the center of the followed track from tar... | bchappet/dnfpy | src/dnfpyUtils/stats/targetCenterList.py | Python | gpl-2.0 | 1,152 |
## Script (Python) "filterObjectValues"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=values=None
##title=
##
from ZTUtils import LazyFilter
from AccessControl import getSecurityManager
checkPermission=getSecurityManager().checkPerm... | jfisher-usgs/DigitalLibrary | filterObjectValues.py | Python | gpl-2.0 | 552 |
# -*- coding: utf-8 -*-
# Distributed under the MIT licesnse.
# Copyright (c) 2013 Dave McCoy (dave.mccoy@cospandesign.com)
#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,... | CospanDesign/nysa-gui | NysaGui/common/nysa_bus_view/wishbone_controller.py | Python | gpl-2.0 | 21,215 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 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 the
# License, or (at your option) any later... | lnielsen/invenio3 | setup.py | Python | gpl-2.0 | 4,365 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015, 2018 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 the
# License, or (at your optio... | CERNDocumentServer/cds-videos | cds/version.py | Python | gpl-2.0 | 1,027 |
data = [
b'\x04\x0e\x04\x01\x05 \x00',
b'\x04\x0e\x04\x01\x0b \x00',
b'\x04\x0e\x04\x01\x0c \x00',
b'\x04>+\x02\x01\x03\x01\x97\xe7/s\x18b\x1f\x1e\xff\x06\x00\x01\t \x02[=cdI\xb9kQl\x977W\xc2V?\xa2k\xe7\x1c\xf4\x9d\xd7\x85\xc9',
b'\x04>\x1a\x02\x01\x00\x01\x07\xbb\xd8!p\\\x0e\x02\x01\x06\n\xffL\x00\... | ukBaz/ble_beacon | tests/data/pkt_capture.py | Python | gpl-2.0 | 39,109 |
import inspect
#public symbols
__all__ = ["Factory"]
class Factory(object):
"""Base class for objects that know how to create other objects
based on a type argument and several optional arguments (version,
server id, and resource description).
"""
def __init__(self):
pass
def create(... | HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/openmdao.main-0.13.0-py2.7.egg/openmdao/main/factory.py | Python | gpl-2.0 | 2,382 |
#!env python
import optparse
import logging
from . import wamp
from . import db
from . import rpcs
logging.basicConfig(level=logging.INFO)
# Options parsing:
parser = optparse.OptionParser()
parser.add_option('-W', '--router',
help="URL to WAMP router",
default='ws://localhost:10... | cleberzavadniak/eolo-app-db | eolo_db/__main__.py | Python | gpl-2.0 | 934 |
# Evonic plugin written by Mentality
# -*- coding: utf-8 -*-
import re,os,urllib,urllib2
import xbmcplugin,xbmcgui
import xbmcaddon
import evonic as enter
from BeautifulSoup import BeautifulSoup as BS
__settings__ = xbmcaddon.Addon(id="plugin.video.Evonic")
status = __settings__.getSetting("status")
def ge... | noba3/KoTos | addons/plugin.video.Evonic/default.py | Python | gpl-2.0 | 4,008 |
# Copyright © 2007-2019 Red Hat, Inc. and others.
#
# This file is part of Bodhi.
#
# 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 lat... | fedora-infra/bodhi | bodhi-server/bodhi/server/validators.py | Python | gpl-2.0 | 51,555 |
# Copyright (C) 2009 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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
# ... | OpenReliability/OpenReliability | veusz/document/emf_export.py | Python | gpl-2.0 | 14,999 |
import os
IGNORE = (
"/test/",
"/tests/gtests/",
"/BSP_GhostTest/",
"/release/",
"/xembed/",
"/TerraplayNetwork/",
"/ik_glut_test/",
# specific source files
"extern/Eigen2/Eigen/src/Cholesky/CholeskyInstantiations.cpp",
"extern/Eigen2/Eigen/src/Core/CoreInstantiations.cpp",
... | pawkoz/dyplom | blender/build_files/cmake/cmake_consistency_check_config.py | Python | gpl-2.0 | 4,572 |
# (C) 2015, 2016 Elke Schaper
"""
:synopsis: The Plate Class.
.. moduleauthor:: Elke Schaper <elke.schaper@isb-sib.ch>
"""
import itertools
import logging
import pickle
import random
import re
import string
import GPy
import numpy as np
import pylab
import scipy.stats
import hts.data_tasks.gaussian_process... | elkeschaper/hts | hts/plate/plate.py | Python | gpl-2.0 | 35,353 |
import pytest
def pytest_runtest_setup(item):
if 'notfixed' in item.keywords:
pytest.skip("Skipping tests that are not fixed yet.")
| elkeschaper/tral | tral/conftest.py | Python | gpl-2.0 | 146 |
#! /usr/bin/python
"""This Module Contains Address Base Class
This is a base class whose
methods will be overridden by
derived classes customized to
different address formats
This module contains the following funcstions and classes
1) _get_field_separator - internal function to return the defaul... | goffersoft/common-utils-python | experimental/com/goffersoft/utils/address.py | Python | gpl-2.0 | 5,816 |
#!/usr/bin/env python
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2007 1&1 Internet AG, Germany, http://www.1and1.org
#
# License:
# LGPL: http://www.gnu.org/licenses/lgpl.html
# EPL: h... | technosaurus/samba4-GPL2 | webapps/qooxdoo-0.6.5-sdk/frontend/framework/tool/icon/modules/kde-to-freedesktop.py | Python | gpl-2.0 | 3,279 |
def search3(L, e):
if L[0] == e:
return True
elif L[0] > e:
return False
else:
return search3(L[1:], e)
def search(L, e):
for i in range(len(L)):
if L[i] == e:
return True
if L[i] > e:
return False
return False | arielisidro/myprograms | python/6.00.1x Files/Week05/search.py | Python | gpl-2.0 | 311 |
import binascii
import hashlib
import mmap
import struct
import zlib
from . import delta
from .sixx import byte2int
class Error(Exception):
"""Pack Error"""
OBJ_TYPE_COMMIT = 1
OBJ_TYPE_TREE = 2
OBJ_TYPE_BLOB = 3
OBJ_TYPE_TAG = 4
OBJ_TYPE_OFS_DELTA = 6
OBJ_TYPE_REF_DELTA = 7
object_types = {
1: 'commit',
... | suutari/gitexpy | gitexpy/pack.py | Python | gpl-2.0 | 8,148 |
import yaml
# We try to load using the CSafeLoader for speed improvements.
try:
from yaml import CSafeLoader as Loader
except ImportError: #pragma: no cover
from yaml import SafeLoader as Loader #pragma: no cover
from hepdata_validator import LATEST_SCHEMA_VERSION
from hepdata_validator.submission_file_validat... | HEPData/hepdata-converter | hepdata_converter/parsers/yaml_parser.py | Python | gpl-2.0 | 4,770 |
import bottle
@bottle.route('/')
def home_page():
mythings = ['apple','orange','banana','peach']
return bottle.template('hello_world', username='Todd',things=mythings)
bottle.debug(True)
bottle.run(host='localhost', port=8082)
| tdoughty1/mongodb_M101P | Week1/Lecture/hello_world/hello_world.py | Python | gpl-2.0 | 237 |
# 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 will be useful,
# but... | jds2001/sos | sos/plugins/filesys.py | Python | gpl-2.0 | 2,190 |
__all__=['ResponseWriter','serverSets'] | sourabhg/HelpSet | app/Utils/__init__.py | Python | gpl-2.0 | 39 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangoaudio.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| DESHRAJ/Audio-Scraper | djangoaudio/manage.py | Python | gpl-2.0 | 254 |
# #
# Copyright 2018-2020 Ghent University
#
# 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),
# Flemish Research Foundation (... | pescobar/easybuild-framework | test/framework/lib.py | Python | gpl-2.0 | 5,005 |
# -*- coding: utf-8 -*-
# This file is part of the Horus Project
__author__ = 'Jesús Arroyo Torrens <jesus.arroyo@bq.com>'
__copyright__ = 'Copyright (C) 2014-2015 Mundo Reader S.L.'
__license__ = 'GNU General Public License v2 http://www.gnu.org/licenses/gpl2.html'
import wx._core
from horus.gui.wizard.wizardPage i... | 3cky/horus | src/horus/gui/wizard/scanningPage.py | Python | gpl-2.0 | 5,007 |
import parole
from parole.colornames import colors
from parole.display import interpolateRGB
import pygame, random
import sim_creatures, main, random
from util import *
description = \
"""
This guy should really look into another line of work.
"""
nagLines = [
'*sigh*',
"It's not been the same 'round... | tectronics/nyctos | src/data.res/scripts/npcs/retiredminer.py | Python | gpl-2.0 | 1,428 |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from computes.models import Compute
from networks.forms import AddNetPool
from vrtManager.network import wvmNetwork, wv... | harry-ops/opencloud | webvirtcloud/networks/views.py | Python | gpl-2.0 | 4,905 |
# -*- coding: utf-8 -*-
###################################################################################
#
# Init.py
#
# Copyright 2015 Shai Seger <shaise at gmail dot com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | shaise/FreeCAD_FastenersWB | Init.py | Python | gpl-2.0 | 1,063 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para rapidgator
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core im... | dknlght/dkodi | src/plugin.video.animehere/servers/rapidgator.py | Python | gpl-2.0 | 1,401 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.