code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
"""
This module tests for compability with Ethereum's Smart Contracts.
"""
"""
import os
import pytest
from pyethereum import tester
import serpent
import logging
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, format='%(message)s')
logger = logging.getLogger()
# customize VM log output ... | tokenly/counterparty-lib | counterpartylib/test/contracts_test.py | Python | mit | 17,887 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from io import BytesIO
import os
import unittest
import png
import properties
class TestImages(unittest.TestCase):
def test_png(self):
dirname, _ = os.pa... | aranzgeo/properties | tests/test_images.py | Python | mit | 2,064 |
import json
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import redirect
from django.shortcuts import render
from contentcuration.models import Channel
from contentcuration.utils.policies import check_pol... | fle-internal/content-curation | contentcuration/contentcuration/decorators.py | Python | mit | 3,115 |
# testWebSocketOperations.py
#----------------------------------------------------------------------------------------------------
import sys
import time
from websocket import create_connection
from json import *
if(len(sys.argv)< 2):
print "test requires sitename: python testWebSocketOperations_server.py <url>"
sys.... | LisaMc/Oncoscape | Oncoscape/inst/unitTests/testWebSocketOperations_server.py | Python | mit | 46,285 |
"""
> using PyCall
> pyinitialize("python3")
For reload - jjulia can be changed for appropriate type
> jjulia = pyimport(:jjulia)
# This can be used for import and reload both.
# If @pyimport is used, reload is not workinng since lib names are assigned as constant variales.
> jjulia = pywrap(PyObject(ccall(pysym(:Py... | jskDr/jamespy_py3 | jjulia.py | Python | mit | 1,493 |
__author__ = 'abhin'
| Uberlearner/uberlearner | uberlearner/tastypie_camelcase/__init__.py | Python | mit | 21 |
__author__ = 'ShJashiashvili'
| unixxxx/simplecms | models/__init__.py | Python | mit | 30 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from flask import current_app, redirect
from indico.modules.even... | mvidalgarcia/indico | indico/modules/events/contributions/controllers/compat.py | Python | mit | 1,524 |
#!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import hashlib
import sys
import os
from random import SystemRandom
import base64
import hmac
if len(sys.a... | mitocoinorg/mitocoin | share/rpcuser/rpcuser.py | Python | mit | 1,111 |
import click
import inspect
import os
import requests
from onecodex.exceptions import OneCodexException, UnboundObject
def as_uri(uuid, base_class):
return base_class._resource._schema._uri.rstrip("#") + "/" + uuid
def coerce_search_value(search_value, field_name, base_class):
from onecodex.models import O... | onecodex/onecodex | onecodex/models/helpers.py | Python | mit | 7,845 |
#ImportModules
import ShareYourSystem as SYS
#Define
@SYS.ClasserClass()
class MakerClass(object):
def default_init(self,
_MakingMyFloat={
'DefaultValueType':property,
'PropertyInitVariable':3.,
'PropertyDocStr':'I am doing the thing here'
},
_MakingMyList={
'DefaultValueType... | Ledoux/ShareYourSystem | Pythonlogy/build/lib/ShareYourSystem/Standards/Classors/Classer/03_ExampleDoc.py | Python | mit | 1,832 |
"""
Support for Wink lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.wink/
"""
import logging
from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, \
Light, ATTR_RGB_COLOR
from homeassistant.const import CONF_ACCE... | mikaelboman/home-assistant | homeassistant/components/light/wink.py | Python | mit | 3,371 |
#!/usr/bin/env python
# -*-coding: UTF-8 -*-
import BaseHTTPServer, json, time, threading, pprint
from urlparse import urlparse, parse_qs
class ReqHandler( BaseHTTPServer.BaseHTTPRequestHandler):
def __init__(self, request, client_address, server):
BaseHTTPServer.BaseHTTPRequestHandler.__init__( self... | vinni-pux/builds | app/testserver.py | Python | mit | 2,103 |
#### 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 = Ship()
result.template = "object/ship/shared_decimator_tier5.iff"
result.attribute_template_id = -1
result.stfNa... | anhstudios/swganh | data/scripts/templates/object/ship/shared_decimator_tier5.py | Python | mit | 412 |
try:
from builtins import object
except ImportError:
pass
from unittest import TestCase
from transitions.extensions import MachineFactory
class TestFactory(TestCase):
def setUp(self):
self.factory = MachineFactory()
def test_mixins(self):
machine_cls = self.factory.get_predefined()
... | tyarkoni/transitions | tests/test_factory.py | Python | mit | 1,960 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Created on Mar 8, 2012
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Sh... | sonium0/pymatgen | pymatgen/io/tests/test_ase.py | Python | mit | 1,649 |
"""
Definition of views.
"""
from django.shortcuts import render
from django.http import HttpRequest
from django.template import RequestContext
from datetime import datetime
def home(request):
"""Renders the home page."""
assert isinstance(request, HttpRequest)
return render(
request,
'app... | LimaHenrique/devops-sample-vestibulares | app/views.py | Python | mit | 1,564 |
#### 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_devaronian_male.iff"
result.attribute_template_id = 9
result.... | anhstudios/swganh | data/scripts/templates/object/mobile/shared_devaronian_male.py | Python | mit | 445 |
#!/usr/bin/python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': '',
'author': 'Christopher Woodall',
'url': '',
'download_url': '',
'author_email': 'chris@cwoodall.com',
'version': '0.1',
'install_requires': ['nose'... | roman3017/doppler-gestures-py | setup.py | Python | mit | 520 |
#------------------------------------------------------------
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# Download Tools
# Based on the code from VideoMonkey XBMC Plugin
#------------------------------------------------------------
# pelisalacarta
# http://blog.tvalacarta.inf... | corvorepack/REPOIVAN | plugin.video.movie.ultra.7k/resources/lib/scrapertools.py | Python | gpl-2.0 | 53,179 |
# -*- coding: utf-8 -*-
"""Functional/E2E Tests for the API."""
import unittest
import webtest
import endpoints
import main
# from src.api import models
from google.appengine.api import memcache
from google.appengine.ext import db
from google.appengine.ext import testbed
# All the requests to the api **must** be do... | AEHO/traintool | traintool/tests/test_api_v1_integration.py | Python | gpl-2.0 | 13,786 |
# Embedded file name: /usr/lib/enigma2/python/ItalySat/ItalysatWeatherSearch.py
import urllib2
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.ActionMap import ActionMap
from enigma import eTimer
from Plugins.Plugin import PluginDescriptor
from Screens.Screen import Screen
from Components.Lab... | kingvuplus/boom | lib/python/ItalySat/ItalysatWeatherSearch.py | Python | gpl-2.0 | 5,752 |
import numpy as np
def convert_cost_vw(cost_matrix):
f=open('liguifan','w')
_,col=cost_matrix.shape
print 'the col value is ', col
for i in range(len(cost_matrix)):
#m_temp=[]
for j in range(col):
if cost_matrix[i][j]!=0:
#m_temp.append(`j+1`+':'+`cost_matrix... | vmr2117/nnet | src/adaboost/test_function.py | Python | gpl-2.0 | 628 |
##########################################################################
# Author: Jane Curry, jane.curry@skills-1st.co.uk
# Date: February 3rd, 2011
# Revised:
#
# ApcPduDevice modler plugin
#
# This program can be used under the GNU General Public License version 2
# You can find full... | anksp21/Community-Zenpacks | ZenPacks.ZenSystems.ApcPdu/ZenPacks/ZenSystems/ApcPdu/modeler/plugins/ApcPduDeviceMap.py | Python | gpl-2.0 | 1,903 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | mitya57/debian-buildbot | buildbot/test/unit/test_master.py | Python | gpl-2.0 | 21,889 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVectorLayer.
.. note:: 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.
"""
__... | NaturalGIS/QGIS | tests/src/python/test_qgsvectorlayer.py | Python | gpl-2.0 | 137,317 |
from archimedes import use_merlin
use_merlin()
from merlin import setup, find_packages
setup(
name = 'Exchanger',
version = '1.0',
zip_safe = False,
packages = find_packages(),
install_requires = [
'pythia[mpi] >= 0.8.1.0, < 0.8.2a',
],
author = 'Eh Tan',
author_email... | bmi-forum/bmi-pyre | Exchanger-1.0.1/setup.py | Python | gpl-2.0 | 447 |
# This file is part of Copernicus
# http://www.copernicus-computing.org/
#
# Copyright (C) 2011, Sander Pronk, Iman Pouya, Erik Lindahl, and others.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published
# by the Free Soft... | soellman/copernicus | cpc/network/request_handler.py | Python | gpl-2.0 | 14,607 |
# -*- coding: utf-8 -*-
# Automatically generated - don't edit.
# Use `python setup.py build_ui` to update it.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_AcousticBrainzOptionsPage(object):
def setupUi(self, AcousticBrainzOptionsPage):
AcousticBrainzOptionsPage.setObjectName("AcousticBrainzOpti... | musicbrainz/picard | picard/ui/ui_options_acousticbrainz.py | Python | gpl-2.0 | 3,118 |
#python
# Sample RenderEngineScript input
#
# Use the following context variables for rendering:
#
# "context.document" - a reference to the owning document.
# "context.node" - a reference to the owning node.
# "context.visible_nodes" - the collection of nodes that should be
# rendered, if pos... | barche/k3d | modules/scripting/render_engine_script.py | Python | gpl-2.0 | 937 |
# -*- coding: utf-8 -*-
## This file is part of B2SHARE.
## Copyright (C) 2013 EPCC, The University of Edinburgh.
##
## B2SHARE 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
## Lic... | cjhak/b2share | invenio/b2share/modules/abuse/views.py | Python | gpl-2.0 | 1,555 |
../../../../share/pyshared/debian/debian_support.py | 2ndy/RaspIM | usr/lib/python2.7/dist-packages/debian/debian_support.py | Python | gpl-2.0 | 51 |
#
# geometry.py
# Python bindings for libparted (built on top of the _ped Python module).
#
# Copyright (C) 2009 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 ... | damouse/pyparted | src/parted/alignment.py | Python | gpl-2.0 | 5,275 |
#!/usr/local/bin/python
#CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2016, Intel Corporation
#
#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.
#
#This program is... | EmadHelmi/chipsec_gui | chipsec/hal/pci.py | Python | gpl-2.0 | 16,930 |
#
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of IGE - Outer Space.
#
# IGE - Outer Space is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... | OuterDeepSpace/OuterDeepSpace | libs/client/osci/MiniMap.py | Python | gpl-2.0 | 5,801 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~... | bmi-forum/bmi-pyre | pythia-0.8/packages/pyre/pyre/geometry/solids/Block.py | Python | gpl-2.0 | 858 |
# -*- coding: utf-8 -*-
#
# NFD - Named Data Networking Forwarding Daemon documentation build configuration file, created by
# sphinx-quickstart on Sun Apr 6 19:58:22 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are prese... | srene/ndnSIM-inrpp | src/ndnSIM/NFD/docs/conf.py | Python | gpl-2.0 | 9,397 |
import requests as r
from bs4 import BeautifulSoup as bs
import json
import os
import wget
from spider import Site
import toolkit
import time
class ReplaysDownloader:
def __init__(self,url,params):
self.url = url
self.keys = ('dmg','xp','frags')
self.params = params
self.targets = []
self.site = None
self... | Hateman31/wotreplays-RD | ReplaysDownloader.py | Python | gpl-2.0 | 1,489 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Centroids.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... | dracos/QGIS | python/plugins/processing/algs/qgis/Centroids.py | Python | gpl-2.0 | 2,904 |
#!/usr/bin/python
from os import popen
from os import mkdir
from sys import argv
N = int(argv[1])
popen('killall p200')
popen('rm -rf team*')
for t in range(N):
popen('userdel p200t%d'%t)
| kadircet/HackMETU-15 | Pwnable/200/clear.py | Python | gpl-2.0 | 190 |
#!/usr/bin/env python
# -*- coding: Latin-1 -*-
"""
This scripts starts a small http-server that serves the current-playlist as
HTML. Start it and point your browser to http://localhost:4773/
Author: André Kelpe fs111 at web dot de
: Jonas Drewsen kde at xspect dot dk
License: GPL
"""
import SimpleHTTPSe... | lwh/Pana | src/scripts/webcontrol/RequestHandler.py | Python | gpl-2.0 | 7,729 |
from main import _
from utils.HIGDialog import HIGDialog
import gtk
#
# Class for the display configurator. It displays the configurators of the
# sensors of a display.
#
class DisplayConfigurator(HIGDialog):
def __init__(self, sensorconfigurators):
HIGDialog.__init__(self, buttons=(gtk.STOCK_CLOSE, gt... | RaumZeit/gdesklets-core | display/DisplayConfigurator.py | Python | gpl-2.0 | 1,457 |
{
"name": "IMP.em2d"
}
| shanot/imp | modules/em2d/.imp_info.py | Python | gpl-3.0 | 27 |
import numpy as np
import sys
sys.path.append('../')
import boomerang as bm
from quaternion_integrator.quaternion import Quaternion
from . import mobility as mob
try:
import mobility_fmm as fmm
fmm_found = True
except ImportError:
fmm_found = False
def get_r_vectors(location, orientation):
'''
'''
initia... | stochasticHydroTools/RotationalDiffusion | mobility/test.py | Python | gpl-3.0 | 4,012 |
import json
import os.path
from res.enkf.data import ExtParam
from res.enkf.data import EnkfNode
from res.enkf.config import ExtParamConfig, EnkfConfigNode
from ecl.util.test import TestAreaContext
from tests import ResTest
class EnkfNodeTest(ResTest):
def test_config(self):
keys = ["Key1" , "Key2" , "K... | Statoil/libres | python/tests/res/enkf/data/test_enkf_node.py | Python | gpl-3.0 | 790 |
N=int(input())
A=[]
for i in range(N):
A.append(list(map(float,input().strip().split())))
A.sort(key= lambda g:g[0],reverse=True)
A.sort(key= lambda g:g[1])
for i in range(N):
B=[str("%.2f" % A[i][0]),str("%.3f" % A[i][1])]
print(' '.join(B)) | alekseik1/python_mipt_study_1-2 | 1sem/contest_8/I.py | Python | gpl-3.0 | 254 |
#!/usr/bin/env python
""" This module returns one of 4 extent elements (latN, latS, lonW, lonE) based on input raster.
Example:
as script:
$ python getExtent.py "/home/joel/sim/topomap_test/predictors/ele.tif" "latN"
or, as import:
import getExtent as ext
ext.main("/home... | joelfiddes/toposubv2 | topoMAPP/getERA/extractEraBbox.py | Python | gpl-3.0 | 1,550 |
# Copyright 2010-2017, The University of Melbourne
# Copyright 2010-2017, Brian May
#
# This file is part of Karaage.
#
# Karaage 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... | brianmay/karaage | karaage/people/views/groups.py | Python | gpl-3.0 | 6,388 |
#from django.conf.urls import patterns, include, url
from django import VERSION
from django.urls import re_path, include
import flat.modes.metadata.views
urlpatterns = [
re_path(r'^(?P<namespace>[\w\d\-_\./@]+)/(?P<docid>[\w\d\-_\.]+)/?$', flat.modes.metadata.views.view, name='view'),
]
| proycon/flat | flat/modes/metadata/urls.py | Python | gpl-3.0 | 294 |
#!/usr/bin/python
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],... | bregman-arie/ansible | lib/ansible/modules/network/iosxr/iosxr_config.py | Python | gpl-3.0 | 11,963 |
# -*- coding: utf-8 -*-
from __future__ import with_statement
import re
from urllib2 import build_opener
from MultipartPostHandler import MultipartPostHandler
from module.plugins.Container import Container
from module.utils import fs_encode, save_join
class CCF(Container):
__name__ = "CCF"
__type__ ... | immenz/pyload | module/plugins/container/CCF.py | Python | gpl-3.0 | 1,458 |
from time import sleep
from pci import Popit
from requests import HTTPError
from oktest import test, ok, NG, DIFF
__author__ = 'guglielmo'
# load configuration
import config_test
keys = [
x for x in dir(config_test)
if x.startswith("popit__") and not x.startswith("__")
]
vals = map(lambda x: eval('config_tes... | ciudadanointeligente/poplus-pci | test_popit.py | Python | gpl-3.0 | 7,843 |
# Use of this source code is governed by the MIT license.
__license__ = "MIT"
__all__ = [
'HTML5TreeBuilder',
]
import warnings
import re
from ..builder import (
PERMISSIVE,
HTML,
HTML_5,
HTMLTreeBuilder,
)
from ..element import (
NamespacedAttribute,
nonwhitespace_re,
)
import htm... | SickGear/SickGear | lib/bs4_py2/builder/_html5lib.py | Python | gpl-3.0 | 18,764 |
# vi: ts=4 expandtab
#
# Copyright (C) 2009-2010 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# ... | pwyliu/cloud-init-0.6.3 | cloudinit/CloudConfig/cc_ssh_import_id.py | Python | gpl-3.0 | 1,692 |
# encoding: utf8
from __future__ import unicode_literals
from pygubu.builder.builderobject import *
from pygubu.widgets.tkscrollbarhelper import TkScrollbarHelper
class TKSBHelperBO(BuilderObject):
class_ = TkScrollbarHelper
container = False
maxchildren = 1
allowed_children = ('tk.Entry', 'ttk.Entry... | mhcrnl/pygubu | pygubu/builder/widgets/tkscrollbarhelper.py | Python | gpl-3.0 | 1,130 |
from django.core.management.base import BaseCommand, CommandError
from django.core.paginator import Paginator
try:
# django >= 1.7
from django.apps import apps
get_model = apps.get_model
except ImportError:
# django < 1.7
from django.db.models import get_model
import gc
def queryset_iterator(querys... | thesgc/chembiohub_ws | cbh_utils/management/commands/add_ids_to_existing_compounds.py | Python | gpl-3.0 | 1,609 |
"""
Copyright 2017 Oliver Smith
This file is part of pmbootstrap.
pmbootstrap 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.
pmbootstrap ... | lawl/pmbootstrap | test/test_config_user.py | Python | gpl-3.0 | 3,113 |
# Copyright 2012 Tom Hayward <tom@tomh.us>
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program is distrib... | mach327/chirp_fork | chirp/drivers/generic_tpe.py | Python | gpl-3.0 | 2,016 |
from robocompdsl.templates.common.templatedict import TemplateDict
class README_md(TemplateDict):
def __init__(self, component):
super(README_md, self).__init__()
self.component = component
self['component_name'] = self.component.name
| robocomp/robocomp | tools/cli/robocompdsl/robocompdsl/templates/templatePython/plugins/base/functions/README_md.py | Python | gpl-3.0 | 266 |
from rule import Rule
from opcodes import *
from util import *
"""
Overflow checked signed integer subtraction.
"""
n_bits = 256
type_bits = 8
while type_bits <= n_bits:
rule = Rule()
# Input vars
X_short = BitVec('X', type_bits)
Y_short = BitVec('Y', type_bits)
# Z3's overflow and underflow conditions
actu... | winsvega/solidity | test/formal/checked_int_sub.py | Python | gpl-3.0 | 975 |
import io
from pytest import raises
from mock import (
patch, Mock, MagicMock, call
)
from kiwi.container.appx import ContainerImageAppx
from kiwi.exceptions import KiwiContainerSetupError
class TestContainerImageAppx:
@patch('kiwi.container.appx.RuntimeConfig')
@patch('os.path.exists')
def setup(sel... | b1-systems/kiwi | test/unit/container/appx_test.py | Python | gpl-3.0 | 2,936 |
#!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2018- Martin Sinn m.sinn@gmx.de
#########################################################################
# ... | robert-budde/smarthome | modules/admin/api_services.py | Python | gpl-3.0 | 11,810 |
# -*- coding: utf-8 -*-
# Ege Öz
from PyQt4 import QtCore, QtGui
import os
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, di... | vishnumani2009/OpenSource-Open-Ended-Statistical-toolkit | FRONTEND/browser.py | Python | gpl-3.0 | 11,328 |
# -*- encoding: utf-8 -*-
import time
from abjad.tools.abctools import AbjadObject
class DateTimeToken(AbjadObject):
'''A LilyPond file date / time token.
.. container:: example
>>> lilypondfiletools.DateTimeToken()
DateTimeToken()
'''
### CLASS VARIABLES ###
__slots__ = (
... | mscuthbert/abjad | abjad/tools/lilypondfiletools/DateTimeToken.py | Python | gpl-3.0 | 2,117 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
__author__ = 'James Iter'
__date__ = '2016/10/2'
__contact__ = 'james.iter.cn@gmail.com'
__copyright__ = '(c) 2016 by James Iter.'
class CURD(object):
__metaclass__ = ABCMeta
def __init__(self):
pass
@abstr... | jamesiter/jimauth | models/interface.py | Python | gpl-3.0 | 842 |
#!/usr/bin/env python
import unittest
import os, sys
sys.path.insert(0, os.path.abspath("../../"))
import core.ns3.Node
class NS3TestCase(unittest.TestCase):
def setUp(self):
self.node = core.ns3.Node.ImalseNetnsSimNode()
# @unittest.skip("demonstrating skipping")
def test_create_sockt(self):
... | hbhzwj/imalse | core/ns3/test.py | Python | gpl-3.0 | 430 |
import json
import os
import unittest
from contextlib import contextmanager
from subprocess import CalledProcessError
import mock
from golem.docker.manager import DockerManager, FALLBACK_DOCKER_MACHINE_NAME, VirtualBoxHypervisor, XhyveHypervisor, \
Hypervisor, logger
from golem.testutils import TempDirFixture
from... | scorpilix/Golemtest | tests/golem/docker/test_docker_manager.py | Python | gpl-3.0 | 27,094 |
import urllib.request
from bs4 import BeautifulSoup
import os, shutil
from tqdm import tqdm
class BLEACH(object):
def __init__(self):
self.prefix = 'http://tieba.baidu.com'
'''
Make dir for comics
'''
def mkdir(self, name):
cwdir = os.getcwd()
self.path = cwdir + '/BLE... | CCharlieLi/Funny-Tool.py | funny_tool/bleach.py | Python | gpl-3.0 | 2,664 |
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This pr... | keremispirli/autokey-py3 | src/lib/qtui/configwindow.py | Python | gpl-3.0 | 55,610 |
# This file is part of beets.
# Copyright 2016, Matt Lichtenberg.
#
# 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... | rembo10/headphones | lib/beetsplug/freedesktop.py | Python | gpl-3.0 | 1,374 |
import pyjsparser
#from pyesprima import esprima
import translating_nodes
DEFAULT_HEADER = u'''import js2py.pyjs, sys
# Redefine builtin objects... Do you have a better idea?
for m in sys.modules.keys():
if m.startswith('js2py'):
del sys.modules[m]
del js2py.pyjs
del js2py
from js2py.pyjs import *
# setting scope
v... | junalmeida/Sick-Beard | lib/js2py/translators/translator.py | Python | gpl-3.0 | 1,583 |
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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 th... | ezequielpereira/Time-Line | timelinelib/wxgui/dialogs/textdisplay/view.py | Python | gpl-3.0 | 1,673 |
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Passwordresetcodes(models.Model):
code = models.CharField(max_length=32)
email = models.CharField(max_length = 120)
time = models.DateTimeField()
username = models.CharField(max_length=50)
pas... | jadijadi/todoer | web/models.py | Python | gpl-3.0 | 1,219 |
import os
from setuptools import setup
__version__ = None
exec(open("ripe/atlas/sagan/version.py").read())
name = "ripe.atlas.sagan"
install_requires = [
"python-dateutil",
"pytz",
]
tests_require = ["nose"]
if "SAGAN_WITHOUT_SSL" not in os.environ:
install_requires.append("cryptography")
# Allow setup... | RIPE-NCC/ripe.atlas.sagan | setup.py | Python | gpl-3.0 | 2,216 |
#!/usr/bin/env python
# coding: utf-8
import sys
import socket
import signal
import os
import logging
import time
from lockfile.pidlockfile import PIDLockFile
from config import config
from utils import generate_code
pidfile = PIDLockFile(
os.path.join(config.pidfile_path, 'dynamic-dns-agent.pid')
)
def on_term(... | btyh17mxy/dynamic-dns | dynamic_dns_agent.py | Python | gpl-3.0 | 1,010 |
from math import sqrt
import numpy as np
def slice2enlist(s):
"""Convert a slice object into a list of (new, old) tuples."""
if isinstance(s, (list, tuple)):
return enumerate(s)
if s.step == None:
step = 1
else:
step = s.step
return enumerate(range(s.start, s.stop, step))
... | freephys/python_ase | ase/constraints.py | Python | gpl-3.0 | 18,566 |
from flask import url_for
from decksite.view import View
from magic import oracle
# pylint: disable=no-self-use
class Bugs(View):
def __init__(self) -> None:
super().__init__()
self.github_icon = url_for('static', filename='images/github.svg')
self.cards = oracle.bugged_cards()
se... | PennyDreadfulMTG/Penny-Dreadful-Tools | decksite/views/bugs.py | Python | gpl-3.0 | 537 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | cmvelo/ansible | lib/ansible/vars/__init__.py | Python | gpl-3.0 | 27,183 |
# -*- coding: utf-8 -*-
############################################################################
#
# Copyright (C) 2008-2014
# Christian Kohlöffel
# Vinzenz Schulz
# Jean-Paul Schouwstra
#
# This file is part of DXF2GCODE.
#
# DXF2GCODE is free software: you can redistribute it and/or modif... | oryxr/dxf2gcode | Core/LineGeo.py | Python | gpl-3.0 | 7,572 |
# Copyright 2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 list of conditions and t... | eethomas/eucalyptus | admin-tools/eucalyptus_admin/commands/empyrean/describeservices.py | Python | gpl-3.0 | 9,408 |
# 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 https://mozilla.org/MPL/2.0/.
# Copyright (c) 2017 Mozilla Corporation
import json
import os
from lib.config import ES
from mozdef_util.query_model... | mozilla/MozDef | alerts/plugins/port_scan_enrichment.py | Python | mpl-2.0 | 5,993 |
# -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... | odoousers2014/odoo_addons-2 | clv_tray/clv_tag/clv_tag.py | Python | agpl-3.0 | 2,002 |
# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, 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.
from __future__ import unicode_literals
import logging
from django import fo... | janusnic/shoop | shoop/notify/actions/email.py | Python | agpl-3.0 | 3,320 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.contrib import admin
import models
admin.site.register(models.Author)
admin.site.register(models.Book)
admin.site.register(models.Publisher)
admin.site.register(models.Authorship)
| andensinlimite/metaespacio | metaespacio/bibliotheca/admin.py | Python | agpl-3.0 | 242 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import flt, getdate
from frappe import _
from erpnext.utilities.transaction_base import delete_events
from frappe.m... | mbauskar/internal-hr | erpnext/projects/doctype/project/project.py | Python | agpl-3.0 | 2,017 |
############################################################################
#
# 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 bu... | uclouvain/OSIS-Louvain | education_group/views/achievement/delete.py | Python | agpl-3.0 | 3,697 |
# -*- coding: utf-8 -*-
from email.header import decode_header
from email.utils import formataddr
import logging
from openerp import _, api, fields, models, SUPERUSER_ID
from openerp import tools
from openerp.exceptions import UserError, AccessError
_logger = logging.getLogger(__name__)
def decode(text):
"""R... | optima-ict/odoo | addons/mail/models/mail_message.py | Python | agpl-3.0 | 46,897 |
from rest_framework import generics, mixins
from .mixins import UpdateModelMixin
class RetrieveUpdateAPIView(mixins.RetrieveModelMixin,
UpdateModelMixin,
generics.GenericAPIView):
"""
Concrete view for retrieving, updating a model instance.
"""
... | jessamynsmith/boards-backend | blimp_boards/utils/generics.py | Python | agpl-3.0 | 625 |
import hashlib
import os
import re
def needs_quote(s):
try:
s.encode('ascii')
except (UnicodeDecodeError, UnicodeEncodeError):
return True
return re.search(r'\s', s) is not None
def get_md5(file_object):
m = hashlib.md5()
while True:
data = file_object.read(8192)
... | wumpus/internetarchive | internetarchive/utils.py | Python | agpl-3.0 | 900 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 So... | gst/alignak | test/test_passive_pollers.py | Python | agpl-3.0 | 11,544 |
"""
unittests for xmodule
Run like this:
paver test_lib -l common/lib/xmodule
"""
import json
import os
import pprint
import unittest
from mock import Mock
from path import path
from xblock.field_data import DictFieldData
from xblock.fields import ScopeIds, Scope, Reference, ReferenceList, ReferenceValueDict
... | epam-mooc/edx-platform | common/lib/xmodule/xmodule/tests/__init__.py | Python | agpl-3.0 | 14,674 |
"""Django management command to force certificate generation"""
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locator import CourseLocator
from pdfgen.certificate import CertificatePDF
#from resource import... | nttks/edx-platform | lms/djangoapps/pdfgen/management/commands/create_certs.py | Python | agpl-3.0 | 2,968 |
import abc
from datetime import datetime
from sqlalchemy import Column, DateTime, String, inspect
from sqlalchemy.ext.hybrid import hybrid_property, Comparator
from inbox.sqlalchemy_ext.util import Base36UID, generate_public_id, ABCMixin
from inbox.models.constants import MAX_INDEXABLE_LENGTH
from inbox.util.addr impo... | EthanBlackburn/sync-engine | inbox/models/mixins.py | Python | agpl-3.0 | 4,408 |
from __future__ import unicode_literals
from datetime import datetime, timedelta
from django.utils import timezone
import json
import time
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User, Group
from .models import Schedule
from dateutil.relativedelta import relativedelta
from t... | Stanford-Legal-Tech-Design/legaltech-rapidpro | temba/schedules/tests.py | Python | agpl-3.0 | 9,844 |
""""Some helper classes for writing scrapers.
These have been used to write scrapers from several sources for
sayit.mysociety.org including The Leveson Inquiry and the trial of Charles
Taylor.
WARNING: They're provided here in case they are useful to anyone writing
scrapers of their own, but should definitely not be ... | opencorato/sayit | speeches/utils/scraping.py | Python | agpl-3.0 | 8,754 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | krafczyk/spack | var/spack/repos/builtin/packages/tinyxml/package.py | Python | lgpl-2.1 | 2,111 |
# Project SWG: Jem Levar Place Spawn
# (C)2014 ProjectSWG
import sys
from resources.datatables import Options
from resources.datatables import State
def addPlanetSpawns(core, planet):
stcSvc = core.staticService
objSvc = core.objectService
# TODO Check all NPCs for personalized scripting, change format.
je... | ProjectSWGCore/NGECore2 | scripts/static_spawns/tatooine/jem_lavar_place.py | Python | lgpl-3.0 | 1,861 |
import simplejson as json
import logging
import logging.config
from vFense import VFENSE_LOGGING_CONFIG
from vFense.core.api.base import BaseHandler
from vFense.db.client import *
from vFense.utils.common import *
from vFense.core.logger.logger import vFenseLogger, VFENSE_LOGGING_CONFIG
from vFense.core.decorators imp... | dtklein/vFense | tp/src/server/api/log_api.py | Python | lgpl-3.0 | 2,159 |
from math import sqrt
from ase import Atoms
from ase.constraints import StrainFilter
from ase.optimize.mdmin import MDMin
from ase.io import Trajectory
try:
from asap3 import EMT
except ImportError:
pass
else:
a = 3.6
b = a / 2
cu = Atoms('Cu', cell=[(0,b,b),(b,0,b),(b,b,0)], pbc=1) * (6, 6, 6)
... | suttond/MODOI | ase/test/strain.py | Python | lgpl-3.0 | 800 |
# Databricks notebook source
# MAGIC %md
# MAGIC
# MAGIC # [SDS-2.2, Scalable Data Science](https://lamastex.github.io/scalable-data-science/sds/2/2/)
# MAGIC
# MAGIC This is used in a non-profit educational setting with kind permission of [Adam Breindel](https://www.linkedin.com/in/adbreind).
# MAGIC This is not lic... | raazesh-sainudiin/scalable-data-science | db/2/2/061_DLByABr_05b-LSTM-Language.py | Python | unlicense | 3,986 |