text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
# -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2011 The GemRB Project
#
# 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) ... | flaing/gemrb | gemrb/GUIScripts/Spellbook.py | Python | gpl-2.0 | 22,628 | 0.033543 |
# Refer to the following link for help:
# http://docs.gunicorn.org/en/latest/settings.html
command = '/home/lucas/www/reddit.lucasou.com/reddit-env/bin/gunicorn'
pythonpath = '/home/lucas/www/reddit.lucasou.com/reddit-env/flask_reddit'
bind = '127.0.0.1:8040'
workers = 1
user = 'lucas'
accesslog = '/home/lucas/logs/red... | codelucas/flask_reddit | server/gunicorn_config.py | Python | mit | 425 | 0 |
import unittest
from katas.kyu_7.guess_my_number import guess_my_number
class GuessMyNumberTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(guess_my_number('0'), '###-###-####')
def test_equals_2(self):
self.assertEqual(guess_my_number('01'), '1##-##1-####')
def test... | the-zebulan/CodeWars | tests/kyu_7_tests/test_guess_my_number.py | Python | mit | 693 | 0 |
# -*- coding: utf-8 -*-
#***********************************************************************
#
# Image Analysis
# ----------------------------------------------------------------------
# QGIS Image Analysis plugin for image segmentation and classification
#
# Vitor Hirota (vitor.hirota [at] gmail.com), INPE 2013
#... | vitorhirota/QgisImageAnalysis | analysis_widget.py | Python | gpl-2.0 | 9,304 | 0.00129 |
#!/usr/bin/env python
#
# GrovePi Example for using the Grove Light Sensor and the LED together to turn the LED On and OFF if the background light is greater than a threshold.
# Modules:
# http://www.seeedstudio.com/wiki/Grove_-_Light_Sensor
# http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit
#
# The GrovePi con... | penoud/GrovePi | Software/Python/grove_light_sensor.py | Python | mit | 2,674 | 0.004114 |
#!/usr/bin/python
import logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
import procgame.game, sys, os
import procgame.config
import random
import procgame.sound
sys.path.insert(0,os.path.pardir)
import bingo_emulator.common.units as units
import bingo_em... | bingopodcast/bingos | bingo_emulator/spelling_bee/game.py | Python | gpl-3.0 | 36,799 | 0.010489 |
# encoding: utf-8
#
# Copyright (C) 2013 midnightBITS/Marcin Zdun
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use, c... | mzdun/uml-seq | src/uml/sequence/_anchor.py | Python | mit | 1,902 | 0.005783 |
# Spectral smoothing functionality
# To do:
# 3) add extra zero-padding for FFT algorithms so they don't go funky at the
# edges?
import numpy as np
from numpy.fft import fft, ifft, fftfreq, rfftfreq
__all__ = ["smoothspec", "smooth_wave", "smooth_vel", "smooth_lsf",
"smooth_wave_fft", "smooth_vel_fft",... | bd-j/prospector | prospect/utils/smoothing.py | Python | mit | 24,897 | 0.000843 |
# -*- coding: utf-8 -*-
'''Python command line tool to maange a local cache of content fom DataONE.
Output is a folder with structure:
cache/
meta.json: Basic metadata about the content in the cache
index.json: An index to entries in the cache. Downlaods are renamed using a
hash of the iden... | DataONEorg/d1LocalCopy | d1_local_copy.py | Python | apache-2.0 | 1,400 | 0.015714 |
def passChecker(password):
import re
passlength = 8
uppercaseRegex = re.compile(r'[A-Z]')
lowercaseRegex = re.compile(r'[a-z]')
numberRegex = re.compile(r'[0-9]')
if ((uppercaseRegex.search(password) == None) or (lowercaseRegex.search(password) == None) or (numberRegex.search(passwor... | Bennson/Projects | Automate the boring stuff/Chapter 7/strongPasswordDetection.py | Python | gpl-2.0 | 410 | 0.012195 |
import win32ras
stateStrings = {
win32ras.RASCS_OpenPort : "OpenPort",
win32ras.RASCS_PortOpened : "PortOpened",
win32ras.RASCS_ConnectDevice : "ConnectDevice",
win32ras.RASCS_DeviceConnected : "DeviceConnected",
win32ras.RASCS_AllDevicesConnected : "AllDevicesConnected",
win32ras.RASCS_Authentica... | JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/rasutil.py | Python | gpl-2.0 | 1,737 | 0.039724 |
"""
Logger di varie info per ogni host
"""
from novaclient import client as novaclient
from ceilometerclient import client as ceiloclient
import os
from os import environ as env
import time
def start(hosts, sleep_sec, base_dir):
print 'You must be admin to use this script'
# start logger
time_dir = get_... | MisterPup/OpenStack-Neat-Ceilometer | alarm_test/info_logger.py | Python | apache-2.0 | 6,034 | 0.009115 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
# import funkcí z jiného adresáře
import os.path
path_to_script = os.path.dirname(os.path.abspath(__file__))
# sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src/"))
import unittest
import numpy as np
import os
from imtools import qmisc
from imtools i... | mjirik/imtools | tests/qmisc_test.py | Python | mit | 3,908 | 0.001281 |
# coding: utf-8
from .graphviz_wrapper import board, add_digraph, add_digraph_node, add_digraph_edge
from .jupyter_helper import jupyter_pan_and_zoom, jupyter_show_as_svg
__author__ = "akimach"
__version__ = "0.0.7"
__license__ = "MIT"
| akimach/tfgraphviz | tfgraphviz/__init__.py | Python | mit | 239 | 0.008368 |
import sys
import os
import socket
import tempfile
import subprocess
import shutil
import email
import threading
import gobject
import struct
import time
import re
sys.path.insert(0, "..")
if __name__=="__main__":
import gettext
gettext.install("D-RATS")
from d_rats import version
from d_rats import platform... | maurizioandreotti/D-Rats-0.3.ev | d_rats/wl2k.py | Python | gpl-3.0 | 16,452 | 0.003404 |
from __future__ import division, print_function
import numpy as np
import nose.tools as nt
import regreg.api as rr
from ..group_lasso import (group_lasso,
selected_targets,
full_targets,
debiased_targets)
from ...tests.instance import... | selective-inference/selective-inference | selectinf/randomized/tests/test_group_lasso.py | Python | bsd-3-clause | 10,569 | 0.011922 |
"""Mac-only module to find the home file of a resource."""
import sstruct
import array
import calldll
import macfs, Res
def HomeResFile(res):
"""Return a path to the file in which resource 'res' lives."""
return GetFileLocation(res.HomeResFile())
def GetFileLocation(refNum):
"""Return a path to the open file id... | stack-of-tasks/rbdlpy | tutorial/lib/python2.7/site-packages/FontTools/fontTools/misc/homeResFile.py | Python | lgpl-3.0 | 2,148 | 0.035847 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | Six_zebra_models/Six_zebra_models_final_output_0.1_-0.1_13000/mtx1_models/Six_zebra_models30110.py | Python | gpl-3.0 | 13,927 | 0.025203 |
import json
from multiprocessing import Pool, Manager
import os
import requests
import Quandl as quandl
# set working directory to script directory.
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)
errors = []
def get_url(url, vars=None):
if vars is not None:
var_string = '?'
... | pjryan126/solid-start-careers | store/api/zillow/extract.py | Python | gpl-2.0 | 1,175 | 0.043404 |
import os, sys
from array import array
try:
from distance import cdistance
except ImportError:
cdistance = None
from distance import _pyimports as pydistance
if sys.version_info.major < 3:
t_unicode = unicode
t_bytes = lambda s: s
else:
t_unicode = lambda s: s
t_bytes = lambda s: s.encode()
all_types = [
("un... | doukremt/distance | tests/tests.py | Python | gpl-2.0 | 5,836 | 0.038897 |
import json
from util import d
import os
__home = os.path.expanduser("~").replace('\\', '/') + "/PixelWeb/"
BASE_SERVER_CONFIG = d({
"id":"server_config",
"display": "server_config",
"preconfig": False,
"presets":[],
"params": [{
"id": "exter... | ManiacalLabs/PixelWeb | pixelweb/config.py | Python | mit | 3,791 | 0.008441 |
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | rajalokan/nova | nova/scheduler/filters/compute_capabilities_filter.py | Python | apache-2.0 | 4,838 | 0 |
#!/usr/bin/env python
"""
.. module:: camerastation.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:: Bence Turak <bence.turak... | zsiki/ulyxes | pyapi/camerastation.py | Python | gpl-2.0 | 5,445 | 0.008448 |
#!/usr/bin/env python
from subprocess import Popen, PIPE
from sys import argv
__autor__ = "Jose Jiménez"
__email__ = "jjimenezlopez@gmail.com"
__date__ = "2012/05/03"
if len(argv) == 1 or len(argv) > 2:
print 'Wrong execution format.'
print 'Correct format: any2utf /path/to/the/files'
exit(0)
path = argv... | jjimenezlopez/pyutils | srt/any2utf.py | Python | apache-2.0 | 2,015 | 0.007448 |
# -*- coding:utf-8 -*-
from . import loading
from . import registry
| neo5g/server-gsrp5 | server-gsrp5/modules/__init__.py | Python | agpl-3.0 | 72 | 0.013889 |
#!/usr/bin/env python
# Note: this module is not a demo per se, but is used by many of
# the demo modules for various purposes.
import wx
#---------------------------------------------------------------------------
class ColoredPanel(wx.Window):
def __init__(self, parent, color):
wx.Window.__init__(se... | dnxbjyj/python-basic | gui/wxpython/wxPython-demo-4.0.1/demo/ColorPanel.py | Python | mit | 577 | 0.008666 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you ... | 3n73rp455/api | manage.py | Python | gpl-3.0 | 535 | 0 |
from skimage.data import coffee, camera
from sklearn_theano.feature_extraction.caffe.googlenet import (
GoogLeNetTransformer, GoogLeNetClassifier)
import numpy as np
from nose import SkipTest
import os
co = coffee().astype(np.float32)
ca = camera().astype(np.float32)[:, :, np.newaxis] * np.ones((1, 1, 3),
... | kastnerkyle/sklearn-theano | sklearn_theano/feature_extraction/caffe/tests/test_googlenet.py | Python | bsd-3-clause | 908 | 0.001101 |
'''
Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
This module creates N nodes and sends X messages randomly between nodes and records
any failures. The messages are sent in blocks of 100 and then it waits and does it again.
Created on Jul 7, 2014
@author... | danfleck/Class-Chord | network-client/src/tests/ParallelStressTest.py | Python | apache-2.0 | 6,454 | 0.01255 |
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse, HttpResponseRedirect
from django.template.context_processors import csrf
from common import post_required, login_required, redirect_if_loggedin, __redirect
# Create your views here.
def index(request):
data = {'title': 'Error', 'p... | amitdhiman000/dais | error/views.py | Python | apache-2.0 | 920 | 0.022826 |
from django import template
from django.conf import settings
from django.db.models import get_model
from django.template import defaultfilters, loader
from .. import library
from .. import renderers
from ..dashboard import forms
ContentType = get_model('contenttypes', 'ContentType')
register = template.Library()
@... | socradev/django-fancypages | fancypages/templatetags/fp_block_tags.py | Python | bsd-3-clause | 2,534 | 0 |
#!/usr/bin/python
## Download files from Amazon S3 (e.g. raw photos for 3D models)
## Andy Bevan 15-Jun-2014, updated 21-Nov-2014
## Daniel Pett updated 05-Jan-2016
__author__ = 'ahb108'
## Currently for Python 2.7.5 (tested on MacOSX 10.9.2) launched in a virtual environment:
from PIL import Image # Pillow with libj... | MicroPasts/MicroPasts-Scripts | photoMasking/photoMasking.py | Python | apache-2.0 | 4,679 | 0.006412 |
"""Copyright 2011 The University of Michigan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... | jieyu/maple | script/maple/systematic/testing.py | Python | apache-2.0 | 3,528 | 0.003401 |
from __future__ import print_function
from ADSOrcid.models import ClaimsLog
from ADSOrcid import tasks
from collections import defaultdict
app = tasks.app
def run():
stats = defaultdict(lambda: 0)
authors = {}
i = 0
with app.session_scope() as session:
for r in session.query(ClaimsLog).or... | adsabs/ADSOrcid | scripts/count.py | Python | gpl-3.0 | 863 | 0.008111 |
from tastypie import fields
from tastypie.bundle import Bundle
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from api.authorization import DateaBaseAuthorization
from api.authentication import ApiKeyPlusWebAuthentication
from api.base_resources import JSONDefaultMixin
from api.serializers import... | lafactura/datea-api | datea_api/apps/comment/resources.py | Python | agpl-3.0 | 3,337 | 0.007192 |
"""
A special type of hypothesis whose value is a function.
The function is automatically eval-ed when we set_value, and is automatically hidden and unhidden when we pickle
This can also be called like a function, as in fh(data)!
"""
from Hypothesis import Hypothesis
from copy import copy
clas... | joshrule/LOTlib | LOTlib/Hypotheses/FunctionHypothesis.py | Python | gpl-3.0 | 3,317 | 0.006331 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Packing metadata for setuptools."""
from io import open
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
with open('README.rst', encoding='utf-8') as readme_file:
readme = readme_file.read()
with open(... | projecthamster/hamster-gtk | setup.py | Python | gpl-3.0 | 1,564 | 0 |
import numpy as np
NR_PER_CONDITION = 1000
neuro_sigma = 4
neuro_mean = 0
satis_sigma = 4
satis_mean = 0
print "Start drawing"
bins = {
5: np.array([-6, -3, 0, 3, 6]),
7: np.array([-6, -4, -2, 0, 2, 4, 6])
}
borders = {
5: np.array([-4.5,-1.5,1.5,4.5]),
7: np.array([-5.,-3.,-1.,1,3,5])
}
'outpu... | mpauly/psych-simulation | simulate.py | Python | apache-2.0 | 1,499 | 0.011341 |
from __future__ import unicode_literals
from django.apps import AppConfig
class ImagerImagesConfig(AppConfig):
name = 'imager_images'
def ready(self):
"""Run when app ready."""
from imager_images import signals
| jaredscarr/django-imager | imagersite/imager_images/apps.py | Python | mit | 238 | 0 |
class ProjectManager(object):
def create(self, project_name):
pass
def delete(self, project_name):
pass
def list_projects(self):
pass
def upload_file(self, project_name, filename):
pass
| octopus-platform/bjoern | python/octopus-tools/octopus/server/project_manager.py | Python | gpl-3.0 | 237 | 0 |
import pytest
class TestService:
@pytest.mark.complete("service ")
def test_1(self, completion):
assert completion
| algorythmic/bash-completion | test/t/test_service.py | Python | gpl-2.0 | 133 | 0 |
from __future__ import print_function, absolute_import
from setuptools import setup, find_packages, Extension, Command
from setuptools.command.build_ext import build_ext
from setuptools.command.egg_info import egg_info
from distutils.file_util import copy_file
from distutils.dir_util import mkpath, remove_tree
from dis... | googlefonts/ots-python | setup.py | Python | bsd-3-clause | 9,371 | 0.00096 |
#!/usr/bin/env python
"""
CsPython Tutorial Example 2
By Mark Gossage (mark@gossage.cjb.net)
A pure-Python script to show the use of Crystal Space.
To use this, ensure that your PYTHONPATH, CRYSTAL, and LD_LIBRARY_PATH
(or DYLD_LIBRARY_PATH for MacOS/X; or PATH for Windows) variables are set
approrpriately, and then ... | baoboa/Crystal-Space | scripts/python/tutorial2.py | Python | lgpl-2.1 | 8,916 | 0.012225 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
import codecs
import xml.sax
import json
import copy
import logging
import math
import atexit
import tarfile
from datetime import datetime
from xml.sax.handler import ContentHandler
class IO(object):
def __init__(self):
self.defers = []
atexit.register... | zizon/TinyTemplate | tiny_template_engine.py | Python | mit | 18,193 | 0.014346 |
#!/usr/bin/python2
"""fkmonthgraph - graph of enemy fighter kills & losses, by month
Requires matplotlib, see http://matplotlib.org or search your package
manager (Debian: apt-get install python-matplotlib)
"""
import sys
import hdata, fighterkill
from extra_data import Fighters as extra
import matplotlib.pyplot as p... | ec429/harris | stats/fkmonthgraph.py | Python | gpl-3.0 | 2,243 | 0.022737 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/attachment/engine/shared_hutt_medium_engine_s02.iff"
result.at... | obi-two/Rebelion | data/scripts/templates/object/tangible/ship/attachment/engine/shared_hutt_medium_engine_s02.py | Python | mit | 470 | 0.046809 |
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=20)
def __unicode__(self):
return self.name
class Book(models.Model):
name = models.CharField(max_length=20)
authors = models.ManyToManyField(Author)
def __unicode__(self):
return self.na... | LethusTI/supportcenter | vendor/django/tests/regressiontests/signals_regress/models.py | Python | gpl-3.0 | 323 | 0.003096 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/responder/responderparam.py | Python | apache-2.0 | 4,282 | 0.031761 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Simple lib to connect to a Zabbix agent and request the value of an item.
"""
import socket
def query_agent(**kwargs):
"""
Open a socket to port 10050 on the remote server and query for the number of
processes running via proc.num[<FOO>], where FOO is either za... | nikatjef/python-zabbix | zabbix/zabbix/get.py | Python | lgpl-2.1 | 990 | 0.014141 |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
trusted_scons_files = [
'src/shared/ppapi/build.scons',
'src/shared/ppapi_proxy/build.scons',
'src/trusted/plugin/build.scons',
'tests/p... | robclark/chromium | ppapi/native_client/ppapi_scons_files.py | Python | bsd-3-clause | 2,682 | 0.000746 |
# Copyright (c) 2015-2016 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | insequent/calico-docker | tests/st/utils/data.py | Python | apache-2.0 | 17,951 | 0.000223 |
"""
kombu.common
============
Common Utilities.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from __future__ import with_statement
import socket
import sys
from collections import defaultdict, deque
from functools import partial
f... | kumar303/rockit | vendor-local/kombu/common.py | Python | bsd-3-clause | 8,390 | 0.001073 |
#!/usr/bin/python
#
# Copyright 2014, Intel 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; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
#... | eurogiciel-oss/Tizen-development-report | bin/checkRpmSrc.py | Python | mit | 3,700 | 0.026216 |
###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http:/... | robtandy/AutobahnPython | examples/twisted/wamp/basic/rpc/complex/backend.py | Python | apache-2.0 | 1,506 | 0.017928 |
# -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | vlegoff/tsunami | src/primaires/scripting/commandes/scripting/alerte_info.py | Python | bsd-3-clause | 3,352 | 0.002688 |
from typing import List, Any, Mapping
from .utils import clean_filters
class DockerTasks(object):
def __init__(self, docker):
self.docker = docker
async def list(self, *, filters: Mapping=None) -> List[Mapping]:
"""
Return a list of tasks
Args:
filters: a collecti... | barrachri/aiodocker | aiodocker/tasks.py | Python | apache-2.0 | 1,131 | 0.001768 |
import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.volume_operations as vol_ops
import zstackwoodpecker.test_util as test_util
volume = None
disconnect = False
host = None
def test():
global disconnec... | zstackio/zstack-woodpecker | integrationtest/vm/mini/multiclusters/test_disconnect_host_volume_create_negative1.py | Python | apache-2.0 | 2,411 | 0.001244 |
# 1. Convert 1024 to binary and hexadecimal representation:
x = 1024
y = bin(x)
z = hex(x) | dmchu/selenium_gr_5 | git_tests/second_file.py | Python | apache-2.0 | 93 | 0.010753 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'designer/getaddons.ui'
#
# Created: Fri Aug 22 00:57:31 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
ex... | weihautin/anki | aqt/forms/getaddons.py | Python | agpl-3.0 | 2,703 | 0.00333 |
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | googleapis/python-websecurityscanner | samples/generated_samples/websecurityscanner_v1alpha_generated_web_security_scanner_get_finding_sync.py | Python | apache-2.0 | 1,528 | 0.001309 |
#
# Copyright (c) 2016-2018 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | nestlabs/nlbuild | scripts/elf_sign.py | Python | apache-2.0 | 10,383 | 0.006549 |
__all__ = ['threshold_adaptive',
'threshold_otsu',
'threshold_yen',
'threshold_isodata',
'threshold_li', ]
import numpy as np
from scipy import ndimage as ndi
from ..exposure import histogram
from .._shared.utils import assert_nD
import warnings
def threshold_adaptive(imag... | ClinicalGraphics/scikit-image | skimage/filters/thresholding.py | Python | bsd-3-clause | 14,107 | 0.000496 |
# -*- coding: utf-8 -*-
#
# privacyIDEA is a fork of LinOTP
# May 08, 2014 Cornelius Kölbel
# License: AGPLv3
# contact: http://www.privacyidea.org
#
# 2014-10-17 Fix the empty result problem
# Cornelius Kölbel, <cornelius@privacyidea.org>
#
# Copyright (C) 2010 - 2014 LSE Leading Security Experts G... | woddx/privacyidea | privacyidea/lib/audit.py | Python | agpl-3.0 | 4,198 | 0.000715 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | ksrajkumar/openerp-6.1 | openerp/addons/itara_multi_payment/__init__.py | Python | agpl-3.0 | 1,080 | 0.000926 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from collections imp... | slyphon/pants | src/python/pants/engine/exp/configuration.py | Python | apache-2.0 | 10,107 | 0.010488 |
#!/usr/bin/env python2
# Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Author: Michael Cohen scudette@google.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... | dsweet04/rekall | rekall-agent/rekall_agent/flows/find.py | Python | gpl-2.0 | 8,647 | 0.000231 |
"""Custom exceptions for ExecutionContext package
"""
from generic_utils.exceptions import GenUtilsException
from generic_utils.exceptions import GenUtilsKeyError
from generic_utils.exceptions import GenUtilsRuntimeError
class ExecutionContextStackEmptyError(GenUtilsException):
"""Raised when stack is empty and ... | kevinseelbach/generic_utils | src/generic_utils/execution_context/exceptions.py | Python | bsd-3-clause | 835 | 0.003593 |
# decodex - simple enigma decoder.
#
# Copyright (c) 2013 Paul R. Tagliamonte <tag@pault.ag>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | paultag/decodex | decodex/utils/words.py | Python | agpl-3.0 | 2,313 | 0.001297 |
# Copyright (c) 2019, CRS4
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribu... | lucalianas/ProMort | promort/clinical_annotations_manager/models.py | Python | mit | 10,721 | 0.003638 |
def transform(dataset, XRANGE=None, YRANGE=None, ZRANGE=None):
"""Define this method for Python operators that
transform input scalars"""
import numpy as np
array = dataset.active_scalars
if array is None:
raise RuntimeError("No scalars found!")
# Transform the dataset.
result = ... | OpenChemistry/tomviz | tomviz/python/ClearVolume.py | Python | bsd-3-clause | 490 | 0 |
#
# Copyright 2011 Twitter, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | twitter/pycascading | python/pycascading/operators.py | Python | apache-2.0 | 2,199 | 0.00091 |
# -*- coding: utf-8 -*-
"""
@file: tasks.py
@author: lyn
@contact: tonylu716@gmail.com
@python: 3.5
@editor: Vim
@create: 3/29/17 2:20 AM
@description:
用于反爬虫的一些异步任务,主要是刷新数据表中某些临时记录。
"""
from __future__ import absolute_import, unicode_literals
from celery import task as celery_task
from .model... | lyn716/deep_stack | django_server/RobotKiller/tasks.py | Python | apache-2.0 | 1,115 | 0 |
import random as rd
class Pile:
def __init__(self, data=None):
if data:
self.data = [i for i in data]
else:
self.data = []
def __repr__(self):
max_sp = len(str(max(self.data)))
out = ""
for i in range(len(self.data) - 1, -1, -1):
out... | bros-bioinfo/bros-bioinfo.github.io | COURS/M1/SEMESTRE1/ALGO_PROG/ALGO/Eliot/anales.py | Python | mit | 7,701 | 0.000781 |
import os
from rbm import RBM
from au import AutoEncoder
import tensorflow as tf
import input_data
from utilsnn import show_image, min_max_scale
import matplotlib.pyplot as plt
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_string('data_dir', '/tmp/data/', 'Directory for storing data')
flags.DEFINE_integer('epo... | Cospel/rbm-ae-tf | test-ae-rbm.py | Python | mit | 4,382 | 0.005933 |
from django.shortcuts import render
from moth.views.base.vulnerable_template_view import VulnerableTemplateView
class EchoHeadersView(VulnerableTemplateView):
description = title = 'Echoes all request headers'
url_path = 'echo-headers.py'
KNOWN_HEADERS = ('CONTENT_LENGTH',)
def is_http_header(self, ... | andresriancho/django-moth | moth/views/vulnerabilities/core/headers.py | Python | gpl-2.0 | 1,103 | 0.00544 |
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# for py2/py3 compatibility
from __future__ import print_function
import signal
from . import base
from testrunner.local import utils
class SignalProc(... | weolar/miniblink49 | v8_7_5/tools/testrunner/testproc/sigproc.py | Python | apache-2.0 | 1,059 | 0.003777 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | FireBladeNooT/Medusa_1_6 | lib/tvdbapiv2/models/series_actors.py | Python | gpl-3.0 | 3,002 | 0.000666 |
import random
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
_largesize = 300
def __init__(self, head):
self.head = head
self.lsize = 0
while head.next:
h... | daicang/Leetcode-solutions | 382-linked-list-random-node.py | Python | mit | 1,372 | 0 |
from setuptools import setup
from os import path, environ
from sys import argv
here = path.abspath(path.dirname(__file__))
try:
if argv[1] == "test":
environ['PYTHONPATH'] = here
except IndexError:
pass
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
... | ya-induhvidual/libfs | setup.py | Python | mit | 1,167 | 0 |
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | ingadhoc/sale | sale_require_purchase_order_number/__manifest__.py | Python | agpl-3.0 | 1,515 | 0 |
# coding=utf-8
import unittest
from types import MethodType
from parameterized import parameterized
from six import StringIO
from conans.client.output import ConanOutput, colorama_initialize
from mock import mock
class ConanOutputTest(unittest.TestCase):
def test_blocked_output(self):
# https://github... | conan-io/conan | conans/test/unittests/client/conan_output_test.py | Python | mit | 3,440 | 0.001453 |
# GUI frame for the hprModel_function.py
try:
# for Python2
from Tkinter import * ## notice capitalized T in Tkinter
import tkFileDialog, tkMessageBox
except ImportError:
# for Python3
from tkinter import * ## notice lowercase 't' in tkinter here
from tkinter import filedialog as tkFileDia... | MTG/sms-tools | software/models_interface/hpsModel_GUI_frame.py | Python | agpl-3.0 | 8,438 | 0.03425 |
number = input()
number_array = [(int)(x) for x in raw_input().split()]
total = 0
for i in range(1, number):
for j in range(i):
ii = number_array[i]
jj = number_array[j]
if ii < jj:
total += i - j
number_array = number_array[:j] + [ii] + [jj] + number_array[j+1:i] + number_array[i+1:]
break
print tot... | xbfool/hackerrank_xbfool | src/algorithms/arrays_and_sorting/running_time_of_algorithms.py | Python | mit | 325 | 0.036923 |
import json
import requests
import time
import csv
from datetime import datetime
#----------------------------------------------------------------------
def login(client_id, client_secret, username, password):
"""logs into reddit using Oauth2"""
client_auth = requests.auth.HTTPBasicAuth(client_id, client_sec... | lbybee/reddit_spelling_index | reddit_spelling_scraper.py | Python | gpl-2.0 | 4,746 | 0.006532 |
a_str1 = "Craig McBean"
a_str2 = "Sheree-Annm Lewis-McBean"
a_str3 = 'Sheyenne Lewis'
a_str4 = raw_input("Enter fourth Name: ")
print "{:>30}".format(a_str1)
print "{:>30}".format(a_str2)
print "{:>30}".format(a_str3)
print "{:>30}".format(a_str4)
| cmcbean/pynet_test | my-str-ex1.py | Python | apache-2.0 | 251 | 0.003984 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | ctrlaltdel/neutrinator | vendor/openstack/tests/unit/identity/v2/test_extension.py | Python | gpl-3.0 | 2,340 | 0 |
#!/usr/bin/env/python
"""
We treat each silica atom as its own residue. As a consequence,
we have more than 10000 residues in the system.
The silly PDB format only allows up to 9999 residues. We solve
this issue by manually creating a .gro file, which allows for
up to 99999 residues
"""
from __future__ import print_f... | jmborr/confinedBSA | simulation/silica/cristobalite/confineBSA/poretop/nobonds/adaptPDB.py | Python | mit | 1,589 | 0.010069 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | xuleiboy1234/autoTitle | tensorflow/tensorflow/python/ops/math_ops.py | Python | mit | 83,640 | 0.004639 |
#
# This file is part of CONCUSS, https://github.com/theoryinpractice/concuss/,
# and is Copyright (C) North Carolina State University, 2015. It is licensed
# under the three-clause BSD license; see LICENSE.
#
from collections import deque
from dp import KPattern, DPTable
from double_count import InclusionExclusion
... | TheoryInPractice/CONCUSS | lib/pattern_counting/pattern_counter.py | Python | bsd-3-clause | 8,882 | 0.000788 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-10 18:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0028_auto_20170113_2133'),
]
operations = [
migrations.RemoveFi... | mitodl/micromasters | profiles/migrations/0029_merge_address_fields.py | Python | bsd-3-clause | 794 | 0 |
__version__ = '1.2.0'
from .oss_authorizers import OssAuthorizer
from .oss_file_operation import OssFileOperation
from .oss_fs import OssFS
from .oss_fs_impl import OssFsImpl
| aliyun/oss-ftp | ossftp/__init__.py | Python | mit | 176 | 0 |
import hashlib
import mimetypes
import os
import posixpath
import re
from time import time
from urlparse import urlsplit, urlunsplit
from werkzeug.exceptions import NotFound
from werkzeug.http import is_resource_modified, http_date
from spa.static.handlers import StaticHandler
from spa.utils import clean_path
class... | dmonroy/spa | spa/static/smart.py | Python | bsd-3-clause | 8,271 | 0.000484 |
from __future__ import unicode_literals
import frappe, unittest
from werkzeug.wrappers import Request
from werkzeug.test import EnvironBuilder
from frappe.website import render
def set_request(**kwargs):
builder = EnvironBuilder(**kwargs)
frappe.local.request = Request(builder.get_environ())
class TestWebsite(uni... | maxtorete/frappe | frappe/tests/test_website.py | Python | mit | 649 | 0.020031 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2009 Gary Burton
# Copyright (C) 2009 Benny Malengier
# Copyright (C) 2010 Nick Hall
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it an... | dermoth/gramps | gramps/gui/editors/editnote.py | Python | gpl-2.0 | 15,225 | 0.00335 |
#!/usr/bin/python
#======================================================================
#
# Project : hpp_IOStressTest
# File : Libs/IOST_WAboutDialog/IOST_AboutDialog.py
# Date : Sep 21, 2016
# Author : HuuHoang Nguyen
# Contact : hhnguyen@apm.com
# : hoangnh.hpp@gmail.com
# License : MIT Licen... | HPPTECH/hpp_IOSTressTest | IOST_0.23/Libs/IOST_AboutDialog/IOST_AboutDialog.py | Python | mit | 3,089 | 0.00777 |
'''
Copyright 2010 - Greg Hellings
This file is part of the Automated FTP Dominator.
The Automated FTP Dominator 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 3 of the License.
The... | greg-hellings/Automated-FTP-Dominator | gui/window.py | Python | gpl-3.0 | 9,748 | 0.029442 |
from collections import OrderedDict
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.translation import ugettext_lazy as _
from oscar.apps.search import facets
FACET_COUNTS = {
u'dates': {},
u'fields': {
'category': [('Fiction', 12), ('Horror', 6), ('... | QLGu/django-oscar | tests/unit/search/munger_tests.py | Python | bsd-3-clause | 3,715 | 0.000269 |
#
# Autogenerated by Thrift Compiler (0.8.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException
from ttypes import *
| humangeo/rawes | rawes/thrift_elasticsearch/constants.py | Python | apache-2.0 | 220 | 0 |
"""
The :mod:`sklearn.lda` module implements Linear Discriminant Analysis (LDA).
"""
# Authors: Matthieu Perrot
# Mathieu Blondel
import warnings
import numpy as np
from scipy import linalg
from .base import BaseEstimator, ClassifierMixin, TransformerMixin
from .utils.extmath import logsumexp
from .utils.fi... | mrshu/scikit-learn | sklearn/lda.py | Python | bsd-3-clause | 9,304 | 0.000215 |
"""
simpleSetup2: runs POST the JS setup
NOTE: for 1.2 USERS (and their signatures) still done here. Next jsSetup will take this over and the User setup part
will be removed from here.
"""
import os
import sys
import logging
import time
sys.path = ['rasUtilities'] + sys.path
import OSEHRASetup
from OSEHRAHelper impo... | vistadataproject/nodeVISTA | setupDocker/pySetup/simpleSetup2.py | Python | agpl-3.0 | 5,139 | 0.018681 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.