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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
"""Simple PNG Canvas for Python"""
__version__ = "0.8"
__author__ = "Rui Carmo (http://the.taoofmac.com)"
__copyright__ = "CC Attribution-NonCommercial-NoDerivs 2.0 Rui Carmo"
__contributors__ = ["http://collaboa.weed.rbse.com/repository/file/branches/pgsql/lib/spark_pr.rb"], ["Eli Bendersk... | ybak/myblog | app/pngcanvas.py | Python | mit | 9,000 |
#! /usr/bin/python
#Copyright 2010, Meka Robotics
#All rights reserved.
#http://mekabot.com
#Redistribution and use in source and binary forms, with or without
#modification, are permitted.
#THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDI... | CentralLabFacilities/m3meka | python/scripts/demo/m3_demo_behaviors.py | Python | mit | 2,341 |
# -*- coding: utf-8 -*-
"""
===============================================
.. module::
:platform: Unix, Windows
:synopsis:
:deprecated:
.. moduleauthor:: (C) 2014 Oliver Gutiérrez
"""
from pyevo.http import nvp_request
def translate(apikey,text,from_lang,to_lang):
"""
Translation to english fu... | olivergs/pyevo | pyevo/api/googletranslate.py | Python | mit | 730 |
import asyncio
import functools
import logging
from aiohttp import request
from .packet import ControlPacket
PING_TIMEOUT = 10
PING_INTERVAL = 5
class Pinger:
"""
Pinger to send ping packets to an endpoint and inform if the timeout has occurred
"""
def __init__(self, handler, interval, timeout, lo... | technomaniac/trellio | trellio/pinger.py | Python | mit | 4,311 |
import json
import os.path
import requests
from subprocess import call
from urllib.parse import urljoin
import xml.etree.ElementTree as ET
from i3pystatus import IntervalModule
from i3pystatus.core.util import user_open
class Syncthing(IntervalModule):
"""
Check Syncthing's online status and start/stop Syncth... | eBrnd/i3pystatus | i3pystatus/syncthing.py | Python | mit | 4,026 |
"""
Tests for the upgrade of L{SIPDispatcherService} from version 2 to version 3.
"""
from axiom.test.historic import stubloader
from axiom.userbase import LoginSystem
from sine.sipserver import SIPDispatcherService
class SIPServerTest(stubloader.StubbedTest):
def test_upgrade(self):
ss = self.store.fin... | twisted/sine | sine/test/historic/test_sipDispatcherService2to3.py | Python | mit | 412 |
"""SCons.Tool.Perforce.py
Tool-specific initialization for Perforce Source Code Management system.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of ... | datalogics/scons | src/engine/SCons/Tool/Perforce.py | Python | mit | 3,456 |
from __future__ import absolute_import, print_function, division
class AntiCache:
def __init__(self):
self.enabled = False
def configure(self, options, updated):
self.enabled = options.anticache
def request(self, flow):
if self.enabled:
flow.request.anticache()
| dufferzafar/mitmproxy | mitmproxy/builtins/anticache.py | Python | mit | 314 |
#### 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 = Creature()
result.template = "object/mobile/shared_dressed_rebel_brigadier_general_rodian_female_01.iff"
result.a... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_dressed_rebel_brigadier_general_rodian_female_01.py | Python | mit | 476 |
'''Trains a simple convnet on the MNIST dataset.
Gets to 99.25% test accuracy after 12 epochs
(there is still a lot of margin for parameter tuning).
16 seconds per epoch on a GRID K520 GPU.
'''
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from... | rsteed11/GAT | gat/scraping/ArabicTextExtractor/DeepMNISTKeras.py | Python | mit | 2,269 |
import numpy as np
import pandas as pd
import scipy as sp
import pickle
from scipy import fft
from time import localtime, strftime
import matplotlib.pyplot as plt
from skimage.feature import match_template
import wave
###########################
# Folder Name Setting
###########################
folder = 'J:/DATAMIN... | jonathanwoodard/MLSP_2013 | 2b_data_preparation_logarithm.py | Python | mit | 7,483 |
#### 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/wearables/backpack/shared_backpack_s01.iff"
result.attribute_templa... | anhstudios/swganh | data/scripts/templates/object/tangible/wearables/backpack/shared_backpack_s01.py | Python | mit | 462 |
from __future__ import unicode_literals
import unittest
import scorched.testing
import mock
class TestTesting(unittest.TestCase):
def test_solr(self):
self.assertRaises(Exception,
scorched.testing.is_solr_available("http://foo"))
def test_solr_decorator(self):
with ... | mamico/scorched | scorched/tests/test_testing.py | Python | mit | 599 |
#! /usr/bin/env python
import sys
from sfa.client.sfi_commands import Commands
from sfa.rspecs.rspec import RSpec
from sfa.planetlab.plxrn import xrn_to_hostname
command = Commands(usage="%prog [options]",
description="List all nodes in the RSpec. " +
"Use this to display th... | onelab-eu/sfa | clientbin/sfiListNodes.py | Python | mit | 812 |
from fabric.api import lcd, local
from fabric.decorators import runs_once
import os
fabfile_dir = os.path.dirname(__file__)
def i18n_push_source():
"""rebuild and push the source language to transifex"""
with lcd('readthedocs'):
local('rm -rf rtd_tests/tests/builds/')
local('django-admin mak... | safwanrahman/readthedocs.org | fabfile.py | Python | mit | 979 |
# coding: utf-8
from __future__ import unicode_literals
from _pydev_bundle._pydev_completer import (isidentifier, extract_token_and_qualifier,
TokenAndQualifier)
from _pydevd_bundle.pydevd_constants import IS_PY2
def test_isidentifier():
assert isidentifier('abc')
assert not isidentifier('<')
assert n... | fabioz/PyDev.Debugger | tests_python/test_extract_token.py | Python | epl-1.0 | 2,852 |
#
# Copyright 2016-2017 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 ... | oVirt/vdsm | lib/vdsm/metrics/hawkular.py | Python | gpl-2.0 | 2,524 |
import os
import time
import cPickle
from Plugins.Plugin import PluginDescriptor
from Screens.Console import Console
from Screens.ChoiceBox import ChoiceBox
from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Screens.Standby import TryQuitMainloop
from Screens.Ipkg import Ipkg
from Screens.... | Taapat/enigma2-openpli-fulan | lib/python/Plugins/SystemPlugins/SoftwareManager/plugin.py | Python | gpl-2.0 | 81,511 |
# Copyright (C) 2011 Google Inc. All rights reserved.
# Copyright (c) 2015, 2016 Apple Inc. 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... | Debian/openjfx | modules/web/src/main/native/Tools/Scripts/webkitpy/port/driver.py | Python | gpl-2.0 | 32,610 |
# 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... | pierg75/pier-sosreport | sos/plugins/tomcat.py | Python | gpl-2.0 | 2,298 |
# ONLY FOR DOCUMANTATION PURPOSE
#
#import os
#import re
#
#class CommandsLinuxSelenium(Commands):
#
# def run_selenium(self, ssn):
# """Some general info.
# There are ways to define Firefox options globaly:
#
# * /usr/lib64/firefox/defaults/preferences/<anyname>.js
# * /etc/firef... | spiceqa/tp-spice | spice/lib/utils_selenium.py | Python | gpl-2.0 | 2,480 |
# -*- encoding: utf-8 -*-
from __future__ import division
import math
from FrameshiftSite import *
class FrameshiftSequence( object ):
def __init__( self, sequence, path ):
self.path = path
self.path_str = ",".join( map( str, [ a for a,b in path ]))
self.frameshifted_sequence, self.fragments, self.fragment_posi... | polarise/BioClasses | FrameshiftSequence.py | Python | gpl-2.0 | 4,907 |
#!/usr/bin/env python
# encoding: utf-8
#
# pmatic - Python API for Homematic. Easy to use.
# Copyright (C) 2016 Lars Michelsen <lm@larsmichelsen.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 Found... | LaMi-/pmatic | update-file-headers.py | Python | gpl-2.0 | 2,611 |
#!/usr/bin/env python
'''
Copyright (C) 2014, Digium, Inc.
John Bigelow <jbigelow@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
'''
import logging
import pjsua as pj
from twisted.internet import reactor
LOGGER = logging.getLogger(__name__)
URI = [... | kickstandproject/asterisk-testsuite-temporary | tests/channels/pjsip/transfers/blind_transfer/caller_refer_only/transfer.py | Python | gpl-2.0 | 6,588 |
import sys
import re
from subprocess import Popen, PIPE
import os.path
import glob
totalflowsum=0
fi = open("Hflowstart.txt","r")
for line in fi:
if line.strip()!= "":
Flow=line.strip().split(" ")
totalflowsum=totalflowsum+float(Flow[0])
print totalflowsum
| ashishtanwer/DFS | conf/flowDurationPercentile.py | Python | gpl-2.0 | 280 |
from django.conf import settings
from django.conf.urls import include, patterns, url
from django.contrib import admin
from django.views.decorators.cache import cache_page
import apps.api.urls
from apps.core.views import (HomePageView, JobDetailView, JobHistoryView,
JobsDiffView, JobsListVi... | lhellebr/GreenTea | tttt/urls.py | Python | gpl-2.0 | 3,215 |
"""Dynamic visualization of Theano graphs.
Author: Christof Angermueller <cangermueller@gmail.com>
"""
import os
import shutil
import re
from six import iteritems
from theano.d3viz.formatting import PyDotFormatter
__path__ = os.path.dirname(os.path.realpath(__file__))
def replace_patterns(x, replace):
"""Repl... | valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/Theano-0.7.0-py3.4.egg/theano/d3viz/d3viz.py | Python | gpl-2.0 | 3,909 |
r"""
This is based on SmartyPants.py by `Chad Miller`_.
Copyright and License
=====================
SmartyPants_ license::
Copyright (c) 2003 John Gruber
(http://daringfireball.net/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitt... | creasyw/IMTAphy | documentation/doctools/tags/0.2/sphinx/util/smartypants.py | Python | gpl-2.0 | 9,819 |
import ppc_commands
ppc_model = 'ppc405gp'
funcs = {}
ppc_commands.setup_local_functions(ppc_model, funcs)
class_funcs = { ppc_model: funcs }
ppc_commands.enable_generic_ppc_commands(ppc_model)
ppc_commands.enable_4xx_tlb_commands(ppc_model)
| iniverno/RnR-LLC | simics-3.0-install/simics-3.0.31/amd64-linux/lib/python/mod_ppc405gp_turbo_commands.py | Python | gpl-2.0 | 245 |
from __future__ import division, absolute_import, unicode_literals
import os
from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
from cola import core
from cola import cmds
from cola import hotkeys
from cola import qtutils
from cola.i18n import N_
from cola.widgets import defs
from cola.widg... | muralidcis/git-cola | cola/widgets/patch.py | Python | gpl-2.0 | 6,379 |
import mymodel
reload(mymodel)
| Akagi201/akcode | python/test_model/usemodel.py | Python | gpl-2.0 | 33 |
import numpy as np
from tyssue import Sheet, Monolayer
from tyssue.generation import three_faces_sheet, extrude
from tyssue.utils import connectivity
from tyssue.config.geometry import bulk_spec
def test_ef_connect():
data, specs = three_faces_sheet()
sheet = Sheet("test", data, specs)
ef_connect = conne... | CellModels/tyssue | tests/utils/test_connectivity.py | Python | gpl-2.0 | 2,530 |
# Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de>
# See COPYING for license information.
import os
from tempfile import mkstemp
from lxml import etree
from . import tmpfiles
from . import xmlutil
from . import utils
from . import config
from .utils import ext_cmd, show_dot_graph, page_string
from .msg... | dmuhamedagic/crmsh | crmsh/cibstatus.py | Python | gpl-2.0 | 12,096 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-24 07:01
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0001_initial'),
]
operations = [
migrations.RemoveField(
mode... | ytsapras/robonet_site | events/migrations/old/0002_auto_20170524_0701.py | Python | gpl-2.0 | 454 |
import codecs
import json
import os
import random
import asyncio
import re
from cloudbot import hook
from cloudbot.util import textgen
@hook.on_start()
def load_attacks(bot):
"""
:type bot: cloudbot.bot.CloudBot
"""
global larts, insults, flirts, kills, slaps, moms
with codecs.open(os.path.join(... | nidhididi/CloudBot | plugins/attacks.py | Python | gpl-3.0 | 3,577 |
##
# Copyright (C) 2014, 2015 Matt Molyneaux
#
# This file is part of CimCity.
#
# CimCity 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 versi... | xray7224/CimCity | cim/items/civics.py | Python | gpl-3.0 | 1,199 |
from django.dispatch import Signal
# Sent when a payment is successfully processed.
alipay_ptn_successful = Signal()
alipay_ptn_flagged = Signal()
| tualatrix/django-alipay | alipay/trade_create_by_buyer/ptn/signals.py | Python | gpl-3.0 | 149 |
# -*- coding: utf-8 -*-
# Copyright (c) 2011 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the rebase extension interface.
"""
from __future__ import unicode_literals
import os
from PyQt5.QtWidgets import QDialog
from ..HgExtension import HgExtension
from ..HgDialog import HgDialog
... | testmana2/test | Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py | Python | gpl-3.0 | 4,473 |
# Copyright (c) 2011 Oregon State University Open Source Lab
#
# 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, mod... | BITalinoWorld/python-serverbit | twisted-ws/txws.py | Python | gpl-3.0 | 19,519 |
"""
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 |
#!/usr/bin/env python2
# -*- coding:utf-8 -*-
import signal
import json
import argparse
import threading
import requests
from settings import load_config
from app import GDanmakuApp
from server_selection import ServerSelectionWindow
from danmaku_ui import Danmaku
from gi.repository import Gtk, GLib, GObject
class Ma... | tuna/gdanmaku | gdanmaku/danmaku.py | Python | gpl-3.0 | 3,347 |
from .base import BaseOp
from .. import excepttypes
from ..constraints import ObjectConstraint
from ..constraints import returnOrThrow, maybeThrow, throw, return_
class TryReturn(BaseOp):
def __init__(self, parent, canthrow=True):
super(TryReturn, self).__init__(parent, [], makeException=True)
self... | difcareer/Krakatau | Krakatau/ssa/ssa_ops/tryreturn.py | Python | gpl-3.0 | 506 |
from rule import Rule
from opcodes import *
"""
Shift left workaround that Solidity implements
due to a bug in Boost.
"""
rule = Rule()
n_bits = 8
bigint_bits = 16
# Input vars
X = BitVec('X', n_bits)
A = BitVec('A', n_bits)
B = BitVec('B', bigint_bits)
# Compute workaround
workaround = Int2BV(
BV2Int(
(Int2BV(... | winsvega/solidity | test/formal/shl_workaround_8.py | Python | gpl-3.0 | 487 |
# -*- coding: utf-8 -*-
# Copyright 2014-2016 The HyperSpyUI developers
#
# This file is part of HyperSpyUI.
#
# HyperSpyUI 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
#... | jat255/hyperspyUI | hyperspyui/widgets/dataviewwidget.py | Python | gpl-3.0 | 17,266 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'SiteSettings.font_size'
db.alter_column('cyclope_sitesettings', 'font_size', self.gf('dja... | CodigoSur/cyclope | cyclope/migrations/0026_auto__chg_field_sitesettings_font_size.py | Python | gpl-3.0 | 13,275 |
# roleBonusCDLinksPGReduction
#
# Used by:
# Ships from group: Command Destroyer (4 of 4)
# Ship: Porpoise
type = "passive"
def handler(fit, src, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Leadership"), "power",
src.getModifiedItemAttr("roleBonusC... | Ebag333/Pyfa | eos/effects/rolebonuscdlinkspgreduction.py | Python | gpl-3.0 | 325 |
"""Utilities for accessing and working with JSON schemas."""
import abc
from collections import namedtuple, OrderedDict
from functools import wraps
import importlib
import json
import os.path
import pkgutil
import jsl
import jsonschema
def added_in(role):
"""Provide helper for schema fields added in a particula... | miteshvp/fabric8-analytics-worker | f8a_worker/schemas.py | Python | gpl-3.0 | 15,518 |
import os.path
from crumbs.utils.bin_utils import create_get_binary_path
from bam_crumbs.settings import get_setting
BIN_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..', '..', 'bin'))
get_binary_path = create_get_binary_path(os.path.split(__file__)[0],
... | pziarsolo/bam_crumbs | bam_crumbs/utils/bin.py | Python | gpl-3.0 | 370 |
from jinja2 import Environment, PackageLoader
class BaseRenderer(object):
"""
Base Renderer class
Renderers are used to generate a string
which represents the router configuration
"""
def __init__(self, backend):
self.config = backend.config
self.backend = backend
@proper... | openwisp/netjsonconfig | netjsonconfig/backends/base/renderer.py | Python | gpl-3.0 | 1,401 |
from chill import *
source('include.c')
destination('includemodified.c')
procedure('main')
loop(0)
original()
print_code()
| CtopCsUtahEdu/chill-dev | examples/chill/testcases/include.script.py | Python | gpl-3.0 | 129 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.forms.widgets import TextInput
from django.template import loader
from django.utils.safestring import mark_safe
class TagAutocompleteWidget(TextInput):
# TODO: template_name supported from django 1.11
template_name = "tagging/forms/w... | hzlf/openbroadcast.org | website/tools/tagging_extra/widgets.py | Python | gpl-3.0 | 986 |
# -*- coding: utf-8 -*-
# Copyright 2007-2022 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 y... | jat255/hyperspy | hyperspy/learn/ornmf.py | Python | gpl-3.0 | 13,811 |
# -*- test-case-name: twisted.test.test_process -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
http://isometri.cc/strips/gates_in_the_head
"""
import os
# Win32 imports
import win32api
import win32con
import win32event
import win32file
import win32pipe
import win32process
import win3... | Architektor/PySnip | venv/lib/python2.7/site-packages/twisted/internet/_dumbwin32proc.py | Python | gpl-3.0 | 12,502 |
# -*- coding: utf-8 -*-
from outwiker.gui.baseaction import BaseAction
from outwiker.gui.pagedialog import createSiblingPage
class AddSiblingPageAction (BaseAction):
"""
Добавить страницу того же уровня, что и выбранная
"""
stringId = u"AddSiblingPage"
def __init__(self, application):
se... | unreal666/outwiker | src/outwiker/actions/addsiblingpage.py | Python | gpl-3.0 | 690 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-7 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | arjclark/rose | etc/rose-meta/rose-demo-baked-alaska-sponge/vn1.0/lib/python/macros/desoggy.py | Python | gpl-3.0 | 1,653 |
import sys
import os
from functools import partial, reduce
import numpy
from AnyQt.QtGui import QPainter
from AnyQt.QtCore import QObject, QSize, QThread, QThreadPool, Slot
import pyqtgraph as pg
import Orange.data
from Orange.widgets import widget, gui, settings
from Orange.widgets.utils import concurrent
from .... | ales-erjavec/orange-bio | orangecontrib/bio/widgets3/OWMAPlot.py | Python | gpl-3.0 | 18,714 |
"""Install script interpreter package."""
| daniel-j/lutris | lutris/installer/__init__.py | Python | gpl-3.0 | 42 |
#!/usr/bin/env python2.7
#
# Aaron Blair
# RIoT Solutions
#
# aaron@aaronpb.me
#
# get-vlans.py - A simple Python script to get VLANs from Appliance Networks
# 15/03/2017
import argparse
import csv
import pprint
import requests
import signal
import sys
import json
count = 0
checknet = 0
paramslist = []
vlanoutput = ... | xiskoct/Meraki | python-2.7/get-vlans.py | Python | gpl-3.0 | 3,070 |
# -*- encoding: utf-8 -*-
from abjad.tools import sequencetools
from abjad.tools import datastructuretools
from abjad.tools import selectiontools
from abjad.tools.abctools import AbjadValueObject
class CountsSelectorCallback(AbjadValueObject):
r'''A counts selector callback.
::
>>> callback = select... | mscuthbert/abjad | abjad/tools/selectortools/CountsSelectorCallback.py | Python | gpl-3.0 | 3,980 |
""" Batch convert FF files to image files, jpg, png, etc. """
import os
import argparse
from RMS.Formats.FFfile import read as readFF
from RMS.Formats.FFfile import validFFName
from RMS.Routines.Image import saveImage
def batchFFtoImage(dir_path, fmt, add_timestamp=False):
# Go through all files in the given fo... | apevec/RMS | Utils/BatchFFtoImage.py | Python | gpl-3.0 | 1,783 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Test for anglerfish.get_public_ip()."""
import unittest
from anglerfish import get_public_ip
class TestName(unittest.TestCase):
maxDiff, __slots__ = None, ()
def test_get_public_ip(self):
# Travis has an invalid certificate, and it fails because... | mktoni/anglerfish | tests/test_get_public_ip.py | Python | gpl-3.0 | 440 |
# s-*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para Youtube
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import re
import urllib
import urlparse
from core import c... | Hernanarce/pelisalacarta | python/main-classic/servers/youtube.py | Python | gpl-3.0 | 8,299 |
from kallithea.tests import *
from kallithea.model.db import User, Notification, UserNotification
from kallithea.model.user import UserModel
from kallithea.model.meta import Session
from kallithea.model.notification import NotificationModel
class TestNotifications(BaseTestCase):
def __init__(self, methodName='... | msabramo/kallithea | kallithea/tests/models/test_notifications.py | Python | gpl-3.0 | 7,833 |
#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distribut... | whereismyjetpack/ansible | lib/ansible/modules/network/nxos/nxos_nxapi.py | Python | gpl-3.0 | 9,509 |
from feeddb.feed.models import SonoChannel, EventChannel
from feeddb.feed.admin import feed_get_admin
from django.conf import settings
def clone_supported_object(obj, recurse=True, created_by=None):
modelname = type(obj).__name__.lower()
if modelname == 'session':
return clone_session(obj, recurse=recu... | Squishymedia/feedingdb | src/feeddb/feed/cloning.py | Python | gpl-3.0 | 8,610 |
"""
WSGI config for vcert project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` se... | managai/myCert | vcert/wsgi.py | Python | mpl-2.0 | 1,416 |
#!/usr/bin/python
# This was originally created to target inclusion in soumith's benchmarks as
# https://github.com/soumith/convnet-benchmarks
# extending this to handle also a couple of clarke and storkey type layers
# and some plausible mnist layers
from __future__ import print_function
import os
import sys
import ... | MiniLight/DeepCL | python/benchmarking/deepcl_benchmark2.py | Python | mpl-2.0 | 11,420 |
#!/bin/false
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers
#
# Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at h... | luetgendorf/Espruino | boards/ESP32.py | Python | mpl-2.0 | 4,723 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
import pytest
from shuup.core.models import (
AnonymousContact, get_pe... | shawnadelic/shuup | shuup_tests/core/test_products.py | Python | agpl-3.0 | 3,884 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Alignak backend client CLI examples
This folder contains some example files to be used with the backend client CLI.
"""
| Alignak-monitoring-contrib/alignak-backend-client | alignak_backend_client/examples/__init__.py | Python | agpl-3.0 | 181 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Dhaval Patel (dhpatel82 at gmail.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole ... | odoousers2014/LibrERP | hr_document/__openerp__.py | Python | agpl-3.0 | 1,974 |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_l10n_nl_xaf_auditfile_export
| OCA/l10n-netherlands | l10n_nl_xaf_auditfile_export/tests/__init__.py | Python | agpl-3.0 | 118 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it und... | jobiols/management-system | mgmtsystem_action/mgmtsystem_action.py | Python | agpl-3.0 | 3,754 |
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public t... | kadhikari/navitia | source/jormungandr/jormungandr/georef.py | Python | agpl-3.0 | 5,482 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2017-11-17 17:25
from __future__ import unicode_literals
import django.core.validators
import django.db.models.deletion
import re
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('campaigns', '0009_h... | shoopio/shoop | shuup/campaigns/migrations/0010_hourbasketcondition.py | Python | agpl-3.0 | 1,137 |
# Generated by Django 3.0.4 on 2020-11-05 15:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0022_uploadedimage'),
('wagtailcore', '0052_pagelogentry'),
('pages', '0003_merge_20200930_... | openstax/openstax-cms | pages/migrations/0004_llphpage.py | Python | agpl-3.0 | 1,307 |
import urllib
from math import ceil
from flask import request
from flask.ext import restful
from sqlalchemy.orm.exc import NoResultFound
from .app import app
from .models import db, Dataset, Distribution
api = restful.Api(app, prefix='/api/1')
class ModelResource(restful.Resource):
"""
Common methods for ... | rshk/ckan3-poc-experiments | ckan/catalog/api.py | Python | agpl-3.0 | 6,354 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/OSIS-Louvain | base/models/enums/learning_container_year_types.py | Python | agpl-3.0 | 2,804 |
# -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa 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... | stitchfix/pybossa | pybossa/sched.py | Python | agpl-3.0 | 7,613 |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... | arskom/spyne | spyne/util/tdict.py | Python | lgpl-2.1 | 2,861 |
#!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; version 2.1 only.
#
# This program is distributed in the hope that it will be u... | pritha-srivastava/sm | drivers/lvhdutil.py | Python | lgpl-2.1 | 13,256 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import os
from nose.tools import assert_almost_equal, eq_
import mapnik
from .utilities import execution_path, run_all
def setup():
# All of the paths used are relative, if we run the tests
# from another ... | mapnik/python-mapnik | test/python_tests/topojson_plugin_test.py | Python | lgpl-2.1 | 3,919 |
#!/usr/bin/env python
import sys, os
# get the location of this script
app_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), ".."))
# Set the name of the application here and moose directory relative to the application
app_name = 'falcon'
MOOSE_DIR = os.path.abspath(os.path.join(app_path, '..' 'moose... | aeslaughter/falcon | scripts/generate_input_syntax.py | Python | lgpl-2.1 | 949 |
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | subodhchhabra/glances | glances/snmp.py | Python | lgpl-3.0 | 4,837 |
import abc
import unittest
class FinderTests(metaclass=abc.ABCMeta):
"""Basic tests for a finder to pass."""
@abc.abstractmethod
def test_module(self):
# Test importing a top-level module.
pass
@abc.abstractmethod
def test_package(self):
# Test importing a... | Orav/kbengine | kbe/src/lib/python/Lib/test/test_importlib/abc.py | Python | lgpl-3.0 | 2,382 |
"""
UN Flag
-------
A demonstration of the power of Matplotlib combined with cartopy's Azimuthal
Equidistant projection to reproduce the UN flag.
"""
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
from matplotlib.patches import PathPatch
import matplotlib.path
import mat... | pelson/cartopy | lib/cartopy/examples/un_flag.py | Python | lgpl-3.0 | 7,435 |
attr = 'parent child three'
| Orav/kbengine | kbe/src/lib/python/Lib/test/test_importlib/namespace_pkgs/project3/parent/child/three.py | Python | lgpl-3.0 | 29 |
import numpy as np
__all__ = ['vanDerWaalsMixing']
def vanDerWaalsMixing(kij=0):
"""Simple van der Waals mixing rules, returns a mixingrule function.
kij is an numpy array of binary interaction parameters"""
def vdw_mixing(molefraction, theta, TdthetadT, B, delta=None, epsilon=None, eta=None):
"... | selenized/clausius | clausius/eos/basicmixing.py | Python | unlicense | 877 |
# Copyright (C) 2011, 2012 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 late... | Insanityandme/dotfiles | vim/bundle/YouCompleteMe/python/ycm/youcompleteme.py | Python | unlicense | 25,635 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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/LICE... | DirectXMan12/nova-hacking | nova/tests/virt/xenapi/test_volumeops.py | Python | apache-2.0 | 8,113 |
from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import Preparation
from django.contrib.auth.models import User, Group
class InlinePreparationTestCase(TestCase):
"""
Test that the Inline Preparation form works as expected.
Things teste... | iCHAIT/whats-fresh-api | whats_fresh/whats_fresh_api/tests/views/entry/test_inline_preparation.py | Python | apache-2.0 | 4,294 |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Eldar Nugaev
# 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://... | sacharya/nova | nova/tests/api/openstack/compute/contrib/test_floating_ips.py | Python | apache-2.0 | 29,801 |
#!/usr/bin/env python
from django.core.management import execute_manager
from os import environ
from sys import argv
environ['DJANGO_LOCAL'] = ''
if argv[1] == 'runserver':
environ['DJANGO_LOCAL'] = '1'
if argv[1].startswith('local'):
environ['DJANGO_LOCAL'] = '1'
argv[1] = argv[1][5:]
try:
import s... | linkedin/indextank-service | storefront/manage.py | Python | apache-2.0 | 776 |
#!/usr/bin/env python
#
# Copyright (c) 2018 The heketi Authors
#
# This file is licensed to you under your choice of the GNU Lesser
# General Public License, version 3 or any later version (LGPLv3 or
# later), or the GNU General Public License, version 2 (GPLv2), in all
# cases as published by the Free Software Founda... | enj/origin | vendor/github.com/heketi/heketi/extras/tools/comparison.py | Python | apache-2.0 | 5,562 |
from __future__ import unicode_literals
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises # flake8: noqa
from nose.tools import assert_raises
import boto3
import boto
from boto.exception import EC2ResponseError
import sure # noqa
from moto import mock_ec2
SAMPLE_DO... | riccardomc/moto | tests/test_ec2/test_vpcs.py | Python | apache-2.0 | 8,856 |
#! /usr/bin/python3.4
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
... | Kamik423/uni_plan | plan/plan/lib64/python3.4/base64.py | Python | apache-2.0 | 20,167 |
# 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
# d... | ecerulm/python-heatclient | heatclient/tests/functional/base.py | Python | apache-2.0 | 1,527 |
# 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... | llhe/tensorflow | tensorflow/python/ops/array_ops.py | Python | apache-2.0 | 79,903 |
import unittest
from jsonschema import SchemaError
from minibus import MiniBusClient
class SyntaxTest(unittest.TestCase):
def setUp(self):
self.client = MiniBusClient()
def callback(self):
pass
def callback2(self):
pass
def test_sub_good(self):
self.client.subscribe("... | allohakdan/minibus | test/test_syntax.py | Python | apache-2.0 | 1,148 |
# Copyright 2017 Google 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, s... | thenenadx/forseti-security | google/cloud/security/common/data_access/group_dao.py | Python | apache-2.0 | 3,871 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.