repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
ThiagoGarciaAlves/intellij-community
python/helpers/pydev/_pydev_bundle/pydev_console_utils.py
3
24235
import os import sys import traceback from _pydev_bundle.pydev_imports import xmlrpclib, _queue, Exec from _pydev_bundle._pydev_calltip_util import get_description from _pydev_imps._pydev_saved_modules import thread from _pydevd_bundle import pydevd_vars from _pydevd_bundle import pydevd_xml from _pydevd_bundle.pydevd...
apache-2.0
user-none/calibre
src/calibre/ebooks/unihandecode/pykakasi/jisyo.py
24
1340
# -*- coding: utf-8 -*- # jisyo.py # # Copyright 2011 Hiroshi Miura <miurahr@linux.com> import cPickle, marshal from zlib import decompress class jisyo (object): kanwadict = None itaijidict = None kanadict = None jisyo_table = {} # this class is Borg _shared_state = {} def __new__(cls, *p, *...
gpl-3.0
Naburimannu/beyaz-dag
ai.py
1
7905
""" AI routines, AI data, and monster death. """ # Copyright 2016 Thomas C. Hudson # Governed by the license described in LICENSE.txt import libtcodpy as libtcod import log from components import * import actions # Might make sense to have this defined # in spells.py instead, dropping the # default argument? CONFUSE...
bsd-3-clause
lustigo/stochastik_sim
Marriage.py
1
4201
from random import shuffle class Marriage(): # Simulation by Bernoulli # simulates how many marriages break if at a specific time 10 of 20 people die # schoolbook p.32 def __init__(self,max): self.complete = [] #List of all rounds self.marriages = [1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,...
apache-2.0
ramcn/demo3
venv/lib/python3.4/site-packages/django/core/serializers/xml_serializer.py
95
15035
""" XML serializer. """ from __future__ import unicode_literals from xml.dom import pulldom from xml.sax import handler from xml.sax.expatreader import ExpatParser as _ExpatParser from django.apps import apps from django.conf import settings from django.core.serializers import base from django.db import DEFAULT_DB_A...
mit
pleaseproject/python-for-android
python-modules/zope/zope/interface/common/sequence.py
50
4735
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
apache-2.0
lcgong/domainics
domainics/db/pgsql.py
3
2095
# -*- coding: utf-8 -*- import logging _logger = logging.getLogger(__name__) import re from .sqlblock import BaseSQLBlock from .dtable import dsequence import psycopg2.extensions import psycopg2.extras psycopg2.extensions.register_adapter(dict, psycopg2.extras.Json) from psycopg2.pool import ThreadedConnectionPoo...
apache-2.0
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_10_01/models/application_gateway_backend_health_pool_py3.py
1
1696
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
espadrine/opera
chromium/src/third_party/v8-i18n/tools/js2c.py
4
3030
#!/usr/bin/env python # # Copyright 2011 the v8-i18n authors. # # 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 applicab...
bsd-3-clause
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/mail/scripts/mailmail.py
3
9870
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """ Implementation module for the `newtexaco` command. The name is preliminary and subject to change. """ import os import sys import rfc822 import socket import getpass from ConfigParser import ConfigParser try: import cStrin...
bsd-3-clause
poo12138/gem5-stable
util/cscope-index.py
80
2619
#! /usr/bin/python # Copyright (c) 2006 The Regents of The University of Michigan # 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 #...
bsd-3-clause
NelisVerhoef/scikit-learn
sklearn/datasets/tests/test_svmlight_format.py
228
11221
from bz2 import BZ2File import gzip from io import BytesIO import numpy as np import os import shutil from tempfile import NamedTemporaryFile from sklearn.externals.six import b from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert...
bsd-3-clause
tarzan0820/odoo
addons/point_of_sale/wizard/pos_open_statement.py
387
4217
# -*- 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...
agpl-3.0
kazuoteramoto/alot
alot/settings/theme.py
1
5323
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com> # This file is released under the GNU GPL, version 3 or a later revision. # For further details see the COPYING file import os from utils import read_config from checks import align_mode from checks import attr_triple from checks import width_tuple fr...
gpl-3.0
andmos/ansible
lib/ansible/modules/crypto/openssh_keypair.py
5
10351
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, David Kainz <dkainz@mgit.at> <dave.jokain@gmx.at> # 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 = { 'metadat...
gpl-3.0
marcusmueller/gnuradio
gr-digital/python/digital/psk_constellations.py
7
7252
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
StevenVanAcker/mitmproxy
mitmproxy/net/socks.py
2
6870
import struct import array import ipaddress from mitmproxy.net import check from mitmproxy.types import bidi class SocksError(Exception): def __init__(self, code, message): super().__init__(message) self.code = code VERSION = bidi.BiDi( SOCKS4=0x04, SOCKS5=0x05 ) CMD = bidi.BiDi( C...
mit
druuu/django
tests/template_tests/filter_tests/test_wordwrap.py
324
1666
from django.template.defaultfilters import wordwrap from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class WordwrapTests(SimpleTestCase): @setup({'wordwrap01': '{% autoescape off %}{{ a|wordwrap:"3" }} {{ b|wordwrap:"3" }}{% endautoescape %}'...
bsd-3-clause
kissbac/upm
examples/python/biss0001.py
16
1865
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 limi...
mit
raymondnijssen/QGIS
tests/src/python/test_authmanager_pki_ows.py
21
7815
# -*- coding: utf-8 -*- """ Tests for auth manager WMS/WFS using QGIS Server through PKI enabled qgis_wrapped_server.py. This is an integration test for QGIS Desktop Auth Manager WFS and WMS provider and QGIS Server WFS/WMS that check if QGIS can use a stored auth manager auth configuration to access an HTTP Basic pro...
gpl-2.0
adgaudio/mongo-connector
setup.py
5
1907
# Copyright 2012 10gen, 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, soft...
apache-2.0
haudren/scipy
scipy/weave/examples/swig2_example.py
100
1596
"""Simple example to show how to use weave.inline on SWIG2 wrapped objects. SWIG2 refers to SWIG versions >= 1.3. To run this example you must build the trivial SWIG2 extension called swig2_ext. To do this you need to do something like this:: $ swig -c++ -python -I. -o swig2_ext_wrap.cxx swig2_ext.i $ g++ -Wall ...
bsd-3-clause
jmsanger/cosbycoin
contrib/pyminer/pyminer.py
23
6436
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
dqnykamp/sympy
sympy/combinatorics/polyhedron.py
16
28179
from __future__ import print_function, division from sympy.core import Basic, Tuple from sympy.sets import FiniteSet from sympy.core.compatibility import as_int from sympy.combinatorics import Permutation as Perm from sympy.combinatorics.perm_groups import PermutationGroup from sympy.utilities.iterables import (minlex...
bsd-3-clause
walac/build-mozharness
mozharness/mozilla/testing/testbase.py
1
28711
#!/usr/bin/env python # ***** BEGIN LICENSE BLOCK ***** # 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 http://mozilla.org/MPL/2.0/. # ***** END LICENSE BLOCK ***** import copy import os import pla...
mpl-2.0
uclaros/QGIS
python/processing/__init__.py
45
1256
# -#- coding: utf-8 -#- ########################################################################### # __init__.py # --------------------- # Date : November 2018 # Copyright : (C) 2018 by Nathan Woodrow # Email : woodrow dot nathan at gmail dot com ##############...
gpl-2.0
ryfeus/lambda-packs
Tensorflow_LightGBM_Scipy_nightly/source/scipy/interpolate/fitpack.py
21
25622
from __future__ import print_function, division, absolute_import __all__ = ['splrep', 'splprep', 'splev', 'splint', 'sproot', 'spalde', 'bisplrep', 'bisplev', 'insert', 'splder', 'splantider'] import warnings import numpy as np from ._fitpack_impl import bisplrep, bisplev, dblint from . import _fitpack_i...
mit
gencer/sentry
src/sentry/utils/datastructures.py
4
1814
from __future__ import absolute_import from collections import Hashable, MutableMapping __unset__ = object() class BidirectionalMapping(MutableMapping): """\ An associative data structure in which the ``(key, value)`` pairs form a one-to-one correspondence in both directions. For example, when ``(a...
bsd-3-clause
kizniche/Mycodo
mycodo/mycodo_flask/utils/utils_camera.py
1
11466
# -*- coding: utf-8 -*- import datetime import logging import os import subprocess import sqlalchemy from flask import flash from flask import url_for from mycodo.config import PATH_CAMERAS from mycodo.config_translations import TRANSLATIONS from mycodo.databases.models import Camera from mycodo.mycodo_client import ...
gpl-3.0
saulgray/nemio-flask-old
lib/python2.7/site-packages/jinja2/_compat.py
638
4042
# -*- coding: utf-8 -*- """ jinja2._compat ~~~~~~~~~~~~~~ Some py2/py3 compatibility support based on a stripped down version of six so we don't have to depend on a specific version of it. :copyright: Copyright 2013 by the Jinja team, see AUTHORS. :license: BSD, see LICENSE for details. ""...
mit
mhugent/Quantum-GIS
python/plugins/db_manager/table_viewer.py
9
3214
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
laszlokiraly/OffenesParlament
offenesparlament/op_scraper/management/commands/export_person_data.py
2
1294
from django.core.management.base import BaseCommand from op_scraper.models import Person, Inquiry, LegislativePeriod import csv from os import system class Command(BaseCommand): help = 'Exports Data' def get_person_cur_mandates(self, person): llp = [LegislativePeriod.objects.get(number=x) for x in se...
bsd-2-clause
CartoDB/mapnik
scons/scons-local-3.0.1/SCons/Platform/sunos.py
5
1932
"""engine.SCons.Platform.sunos Platform-specific initialization for Sun systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001 - 2017 The SCons Foundation # # Permission is h...
lgpl-2.1
pavelchristof/gomoku-ai
tensorflow/python/kernel_tests/random_ops_test.py
49
11766
# 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...
apache-2.0
andybak/ansible-modules-extras
cloud/amazon/s3_lifecycle.py
27
15168
#!/usr/bin/python # # This is a 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 Ansible library is distributed in the hope that i...
gpl-3.0
yasoob/PythonRSSReader
venv/lib/python2.7/dist-packages/twisted/trial/test/test_assertions.py
8
42551
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for assertions provided by C{SynchronousTestCase} and C{TestCase}, provided by L{twisted.trial.unittest}. L{TestFailureTests} demonstrates that L{SynchronousTestCase.fail} works, so that is the only method on C{twisted.trial.unittest.Sy...
mit
nouiz/pydy
examples/Kane1985/Chapter6/Ex11.3.py
1
3430
#!/usr/bin/env python # -*- coding: utf-8 -*- """Exercise 11.3 from Kane 1985.""" from __future__ import division from sympy import Matrix, symbols from sympy.physics.mechanics import ReferenceFrame, Point from sympy.physics.mechanics import dynamicsymbols R_SQ, R_QE, R_EM, R_Ee, R_Mm = symbols('R_SQ R_QE R_EM R_Ee ...
bsd-3-clause
mudzi42/pynet_class
class8/class8_ex7.py
1
1415
#!/usr/bin/env python """ 7. Repeat exercise #6 except use processes. (applied_python)[chudgins@ip-172-30-0-251 class8]$ ./class8_ex7.py ... <Process(Process-7, stopped)> Final elapsed time: 0:00:08.456718 """ __author__ = 'Chip Hudgins' __email__ = 'mudzi42@gmail.com' import django from net_system.models import Ne...
apache-2.0
schae234/PonyTools
scripts/Make670.py
1
3208
import MNEcTools.Tools as tools import pandas as pd def main(): # Read in the The SNP List TSL = pd.read_table("THE_SNP_LIST.tsv",sep=',') INFO = pd.DataFrame(tools.read_vcf("/project/mccuelab/DataRepository/Variant/000_SNP/SNP_LIST.0.9.vcf")) INFO = INFO.convert_objects(convert_numeric=True) TSL =...
mit
bgris/ODL_bgris
lib/python3.5/turtledemo/paint.py
94
1291
#!/usr/bin/env python3 """ turtle-example-suite: tdemo_paint.py A simple event-driven paint program - left mouse button moves turtle - middle mouse button changes color - right mouse button toogles betweem pen up (no line drawn when the turtle moves) and pen down (line is drawn). If pen up follows...
gpl-3.0
jideobs/twilioAngular
venv/lib/python2.7/site-packages/pip/utils/logging.py
199
3326
from __future__ import absolute_import import contextlib import logging import logging.handlers import os try: import threading except ImportError: import dummy_threading as threading from pip.compat import WINDOWS from pip.utils import ensure_dir try: from pip._vendor import colorama # Lots of differen...
mit
peteflorence/flight
scripts/logs/log_to_mat.py
2
12556
#!/usr/bin/python # #Converts a LCM log to a "matrix" format that is easier to work with in external #tools such as Matlab. The set of messages on a given channel can be represented #as a matrix, where the columns of this matrix are the the fields of the lcm type #with one message per row import os import sys import b...
bsd-3-clause
hds-lab/coding-ml
msgvis/apps/coding/utils.py
1
3911
import numpy from sklearn import svm from sklearn.externals import joblib from django.db.models import Q from operator import or_ def get_formatted_X(dictionary, source, messages, feature_index_map, feature_num, use_tfidf=False, master_messages=[]): message_num = len(messages) + len(master_messages) source_...
mit
oloendithas/SM-T705_Exynos5420
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
tvalacarta/tvalacarta
python/main-classic/lib/youtube_dl/extractor/foxsports.py
20
1097
from __future__ import unicode_literals from .common import InfoExtractor class FoxSportsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?foxsports\.com/(?:[^/]+/)*video/(?P<id>\d+)' _TEST = { 'url': 'http://www.foxsports.com/tennessee/video/432609859715', 'md5': 'b49050e955bebe32c301972...
gpl-3.0
joxer/Baka-No-Voltron
tmp/android.dist/private/renpy/audio/sound.py
1
2603
# Copyright 2004-2015 Tom Rothamel <pytom@bishoujo.us> # # 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, m...
gpl-2.0
tst-ahernandez/earthenterprise
earth_enterprise/src/portableserver/build.py
1
9019
#! /usr/bin/python #-*- Python -*- # # Copyright 2017 GEE Open Source Team <github.com/google/earthenterprise> # # 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/l...
apache-2.0
dsullivan7/scikit-learn
sklearn/tests/test_kernel_ridge.py
342
3027
import numpy as np import scipy.sparse as sp from sklearn.datasets import make_regression from sklearn.linear_model import Ridge from sklearn.kernel_ridge import KernelRidge from sklearn.metrics.pairwise import pairwise_kernels from sklearn.utils.testing import ignore_warnings from sklearn.utils.testing import assert...
bsd-3-clause
tq-systems/linux-mxs
tools/perf/scripts/python/syscall-counts.py
944
1429
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
shoz/cache_it
cache_it/__init__.py
1
3024
# -*- coding: utf-8 -*- __all__ = ['init_cache', 'cache_it'] import pylibmc import functools import inspect cache = None def init_cache(hosts=['127.0.0.1:11211']): global cache cache = _make_cache(hosts) if cache == None: raise Exception("Can't connect cache servers. %s" % hosts) def _make_cach...
mit
eviljeff/zamboni
mkt/webpay/tasks.py
7
3612
from datetime import datetime, timedelta import logging import os import tempfile from django.conf import settings from django.core.files.storage import default_storage as storage from django.db import transaction from celery import task import requests from mkt.site.utils import ImageCheck, resize_image from .mode...
bsd-3-clause
kvar/ansible
lib/ansible/modules/cloud/google/gcp_compute_instance_group_manager.py
7
19843
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
jobiols/odoomrp-wip
mrp_production_add_middle_stuff_lot/wizard/wizard_addition.py
6
2031
# -*- coding: utf-8 -*- ############################################################################## # # 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 L...
agpl-3.0
def-/commandergenius
project/jni/python/src/Tools/msi/schema.py
88
83800
from msilib import Table _Validation = Table('_Validation') _Validation.add_field(1,'Table',11552) _Validation.add_field(2,'Column',11552) _Validation.add_field(3,'Nullable',3332) _Validation.add_field(4,'MinValue',4356) _Validation.add_field(5,'MaxValue',4356) _Validation.add_field(6,'KeyTable',7679) _Validation.add_...
lgpl-2.1
c0defreak/python-for-android
python3-alpha/python3-src/Lib/turtledemo/penrose.py
150
3540
#!/usr/bin/env python3 """ xturtle-example-suite: xtx_kites_and_darts.py Constructs two aperiodic penrose-tilings, consisting of kites and darts, by the method of inflation in six steps. Starting points are the patterns "sun" consisting of five kites and "star" consisting of five darts. For more inf...
apache-2.0
tmpgit/intellij-community
python/lib/Lib/site-packages/django/views/generic/list_detail.py
229
5577
from django.template import loader, RequestContext from django.http import Http404, HttpResponse from django.core.xheaders import populate_xheaders from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist import warnings warnings.warn( 'Function-based generic v...
apache-2.0
Reagankm/KnockKnock
venv/lib/python3.4/site-packages/matplotlib/tests/test_png.py
10
1259
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import glob import os import numpy as np from matplotlib.testing.decorators import image_comparison from matplotlib import pyplot as plt import matplotlib.cm as cm @image_comparison(baseline_ima...
gpl-2.0
RondaStrauch/landlab
landlab/grid/tests/test_raster_grid/test_fixed_link_boundary.py
6
2600
import numpy as np from numpy.testing import assert_array_equal from landlab import RasterModelGrid from landlab import FIXED_VALUE_BOUNDARY as FV from landlab import CLOSED_BOUNDARY as CB from landlab import FIXED_GRADIENT_BOUNDARY as FG def test_fixed_link_boundaries_at_grid_edges(): '''test setting fixed link...
mit
ArcEye/MK-Qt5
lib/python/gladevcp/offsetwidget.py
21
6515
#!/usr/bin/env python # GladeVcp Widget - DRO label widget # This widgets displays linuxcnc axis position information. # # Copyright (c) 2012 Chris Morley # # 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 F...
lgpl-2.1
blckshrk/Weboob
modules/youtube/test.py
3
1888
# -*- coding: utf-8 -*- # Copyright(C) 2010-2013 Romain Bignon, Laurent Bachelier # # This file is part of weboob. # # weboob 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 Lic...
agpl-3.0
alincalinciuc/packstack
packstack/installer/setup_controller.py
5
5731
""" Controller class is a SINGLETON which handles all groups, params, sequences, steps and replaces the CONF dictionary. """ from setup_params import Group from .core.sequences import Sequence def steps_new_format(steplist): # we have to duplicate title to name parameter and also only sigle # function is allo...
apache-2.0
MER-GROUP/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/pytree.py
325
29039
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """ Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. There's also a pattern matching implementation here. """ __autho...
apache-2.0
mrquim/repository.mrquim
repo/script.module.exodus/lib/resources/lib/sources/en/imdark.py
12
3082
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
gpl-2.0
alanjds/fen
fen.py
1
11437
#!/usr/bin/env python import sys import StringIO import tempfile import os import pdb from PIL import Image from PIL import ImageDraw import cairo import rsvg import argparse from images import * def open_svgstring_as_image(string, width, height): try: tmpfd, tmppath = tempfile.mkstemp(".svg") tm...
gpl-3.0
affo/nova
nova/db/sqlalchemy/migrate_repo/versions/234_add_expire_reservations_index.py
12
1900
# 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 applicable law or agreed to in...
apache-2.0
codenrhoden/ceph-deploy
ceph_deploy/tests/test_install.py
8
4368
from mock import Mock from ceph_deploy import install class TestSanitizeArgs(object): def setup(self): self.args = Mock() # set the default behavior we set in cli.py self.args.default_release = False self.args.stable = None def test_args_release_not_specified(self): ...
mit
sunny94/temp
sympy/stats/crv_types.py
7
60436
""" Continuous Random Variables - Prebuilt variables Contains ======== Arcsin Benini Beta BetaPrime Cauchy Chi ChiNoncentral ChiSquared Dagum Erlang Exponential FDistribution FisherZ Frechet Gamma GammaInverse Kumaraswamy Laplace Logistic LogNormal Maxwell Nakagami Normal Pareto QuadraticU RaisedCosine Rayleigh Studen...
bsd-3-clause
GuessWhoSamFoo/pandas
pandas/core/dtypes/inference.py
1
10105
""" basic inference routines """ from numbers import Number import re import numpy as np from pandas._libs import lib from pandas.compat import ( PY2, Set, re_type, string_and_binary_types, string_types, text_type) from pandas import compat is_bool = lib.is_bool is_integer = lib.is_integer is_float = lib.is_...
bsd-3-clause
faun/django_test
build/lib/django/contrib/gis/gdal/error.py
169
1517
""" This module houses the OGR & SRS Exception objects, and the check_err() routine which checks the status code returned by OGR methods. """ #### OGR & SRS Exceptions #### class GDALException(Exception): pass class OGRException(Exception): pass class SRSException(Exception): pass class OGRIndexError(OGRException, K...
bsd-3-clause
Unidata/MetPy
v1.0/_downloads/f7fb7b4e11b9030fa7c1b08f65033c97/Station_Plot.py
4
4574
# Copyright (c) 2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Station Plot ============ Make a station plot, complete with sky cover and weather symbols. The station plot itself is pretty straightforward, but there is a bit of code t...
bsd-3-clause
nozuono/calibre-webserver
src/calibre/gui2/lrf_renderer/text.py
4
21105
__license__ = 'GPL v3' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' import sys, collections, operator, copy, re from PyQt4.QtCore import Qt, QRectF, QString from PyQt4.QtGui import QFont, QColor, QPixmap, QGraphicsPixmapItem, \ QGraphicsItem, QFontMetrics, QPen, QBrush, QGrap...
gpl-3.0
msabramo/ansible
lib/ansible/modules/network/panos/panos_admpwd.py
78
5971
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
nop33/indico-plugins
chat/indico_chat/controllers/base.py
1
1497
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
NeuralEnsemble/neuroConstruct
lib/jython/Lib/MimeWriter.py
315
6482
"""Generic MIME writer. This module defines the class MimeWriter. The MimeWriter class implements a basic formatter for creating MIME multi-part files. It doesn't seek around the output file nor does it use large amounts of buffer space. You must write the parts out in the order that they should occur in the final f...
gpl-2.0
nvoron23/node-gyp
gyp/pylib/gyp/mac_tool.py
377
19309
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
mit
jmbeuken/abinit
scripts/post_processing/appa/gui/conv.py
3
9987
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Abinit Post Process Application author: Martin Alexandre last edited: May 2013 """ import sys,os import string, math from PyQt4 import Qt,QtGui,QtCore from numpy import pi class Conversion(QtGui.QWidget): def __init__(self, parent = None): self.i...
gpl-3.0
almeidapaulopt/erpnext
erpnext/demo/setup/manufacture.py
1
3828
from __future__ import unicode_literals import random, json import frappe from frappe.utils import nowdate, add_days from erpnext.demo.setup.setup_data import import_json from six import iteritems def setup_data(): import_json("Asset Category") setup_item() setup_workstation() setup_asset() import_json('Operati...
gpl-3.0
pkshiu/pktest
piglowserver/pg_control.py
1
2958
""" Web server with a browser interface to control a PiGlow board by talking to the PiGlow RESTful API server. """ import requests import json from flask import (Flask, url_for, redirect) from flask import (render_template, request) app = Flask(__name__) app.config.from_object('config') # You can override co...
mit
idaholab/raven
framework/CodeInterfaceBaseClass.py
1
12456
# Copyright 2017 Battelle Energy Alliance, 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 agreed t...
apache-2.0
xodus7/tensorflow
tensorflow/contrib/learn/python/learn/estimators/kmeans_test.py
39
20233
# Copyright 2016 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...
apache-2.0
Zarokka/exaile
xlgui/menu.py
1
10352
# Copyright (C) 2010 Adam Olsen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it w...
gpl-2.0
astronaut1712/taiga-back
taiga/mdrender/extensions/emojify.py
21
14195
# -*- coding: utf-8 -*- # Tested on Markdown 2.3.1 # # Copyright (c) 2014, Esteban Castro Borsani # Copyright (c) 2014, Jesús Espino García # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to...
agpl-3.0
rory/pirate-l10n
pirate-your-po.py
1
1851
#! /usr/bin/env python __author__ = 'Rory McCann <rory@technomancy.org>' __version__ = '1.0' __licence__ = 'GPLv3' import polib, subprocess, re, sys def translate_subpart(string): """Converts the whole of the string to pirate speak by (a) passing it through our custom replacements and (b) passing it through pira...
gpl-3.0
prasidh09/cse506
unionfs-3.10.y/tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
ruibarreira/linuxtrail
usr/lib/python3/dist-packages/mako/pygen.py
13
9939
# mako/pygen.py # Copyright (C) 2006-2014 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for generating and formatting literal Python code.""" import re from mako import excep...
gpl-3.0
dav1x/ansible
lib/ansible/modules/network/panos/panos_security_policy.py
32
16234
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
eliquious/go-v8
v8-3.28/tools/run-deopt-fuzzer.py
8
16892
#!/usr/bin/env python # # Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
mit
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/copy.py
253
11519
"""Generic (shallow and deep) copying operations. Interface summary: import copy x = copy.copy(y) # make a shallow copy of y x = copy.deepcopy(y) # make a deep copy of y For module specific errors, copy.Error is raised. The difference between shallow and deep copying is only relev...
gpl-3.0
IronLanguages/ironpython3
Src/StdLib/Lib/asyncio/tasks.py
1
26558
"""Support for tasks, coroutines and the scheduler.""" __all__ = ['Task', 'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED', 'wait', 'wait_for', 'as_completed', 'sleep', 'gather', 'shield', 'ensure_future', 'run_coroutine_threadsafe', 'timeout', ] import conc...
apache-2.0
ehashman/oh-mainline
vendor/packages/twisted/twisted/conch/test/test_recvline.py
17
21575
# -*- test-case-name: twisted.conch.test.test_recvline -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.conch.recvline} and fixtures for testing related functionality. """ import sys, os from twisted.conch.insults import insults from twisted.conch import recvline f...
agpl-3.0
peeyush-tm/shinken
modules/dummy_poller/module.py
18
4992
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
agpl-3.0
imruahmed/microblog
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py
678
9406
import logging try: # Python 3 from urllib.parse import urljoin except ImportError: from urlparse import urljoin from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_scheme from .exceptions import LocationValue...
bsd-3-clause
martydill/url_shortener
code/venv/lib/python2.7/site-packages/IPython/nbconvert/exporters/tests/test_rst.py
6
1499
"""Tests for RSTExporter""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import io from IPython import nbformat from IPython.nbformat import v4 from .base import ExportersTestsBase from ..rst import RSTExporter from IPython.testing.decorators import onlyif_cmd...
mit
usc-isi/nova
nova/tests/api/openstack/volume/contrib/test_admin_actions.py
7
7954
import webob from nova import context from nova import db from nova import exception from nova.openstack.common import jsonutils from nova import test from nova.tests.api.openstack import fakes def app(): # no auth, just let environ['nova.context'] pass through api = fakes.volume.APIRouter() mapper = fak...
apache-2.0
GREO/gnuradio-git
gnuradio-examples/python/pfb/interpolate.py
8
8126
#!/usr/bin/env python # # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) ...
gpl-3.0
darmaa/odoo
addons/analytic_user_function/__openerp__.py
119
2056
# -*- 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...
agpl-3.0
optima-ict/odoo
addons/l10n_br/account.py
43
2652
# -*- encoding: utf-8 -*- import openerp from openerp.osv import fields, osv TAX_DEFAULTS = { 'base_reduction': 0, 'amount_mva': 0, 'amount_type': 'percent', } class account_tax_template(osv.osv): """ Add fields used to define some brazilian taxes ...
agpl-3.0
ericsubach/googlemock
scripts/generator/gmock_gen.py
1159
1091
#!/usr/bin/env python # # Copyright 2008 Google 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 requir...
bsd-3-clause
tootedom/moto
moto/iam/responses.py
1
28879
from __future__ import unicode_literals from moto.core.responses import BaseResponse from .models import iam_backend class IamResponse(BaseResponse): def create_role(self): role_name = self._get_param('RoleName') path = self._get_param('Path') assume_role_policy_document = self._get_para...
apache-2.0
iut-ibk/CityDrain3
bench/plot-compare-speedup.py
5
1333
#!/usr/bin/env python import matplotlib as mpl mpl.use('cairo') from pylab import * import glob import sys import os import re inch=2.54 if len(sys.argv) < 3: print "usage plot.py model pid" exit(-1) format="pdf" if len(sys.argv) > 3: format=sys.argv[3] rc('font', size=8) rc('figure.subplot', left=0.12, righ...
gpl-2.0