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
mdietrichc2c/OCB
addons/delivery/stock.py
27
8776
# -*- 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
kernsuite-debian/lofar
LTA/ltastorageoverview/lib/ingesteventhandler.py
1
5055
# Copyright (C) 2018 ASTRON (Netherlands Institute for Radio Astronomy) # P.O. Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite 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
eriser/marsyas
scripts/Python/scheduler_libs.py
7
17042
# # Copyright (C) 1998-2007 George Tzanetakis <gtzan@cs.uvic.ca> # # 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. # ...
gpl-2.0
rhattersley/iris
lib/iris/tests/unit/fileformats/dot/test__dot_path.py
5
3195
# (C) British Crown Copyright 2016, Met Office # # This file is part of Iris. # # Iris 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 License, or # (at your option) any later ve...
lgpl-3.0
google/slo-generator
samples/custom/custom_exporter.py
1
1585
# Copyright 2019 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 wr...
apache-2.0
tomchor/pymicra
pymicra/algs/auxiliar.py
1
3396
from __future__ import absolute_import, print_function, division """ """ def stripDown(str, final='', args=['_', '-']): """ Auxiliar function to strip down keywords from symbols """ for arg in args: str=str.replace(arg,final) return str def lenYear(year): """ Calculates th...
gpl-3.0
edlabh/SickRage
lib/adba/aniDBfileInfo.py
24
3761
#!/usr/bin/env python # # This file is part of aDBa. # # aDBa 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. # # aDBa is distributed i...
gpl-3.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/bsddb/test/test_sequence.py
68
5274
import unittest import os from test_all import db, test_support, get_new_environment_path, get_new_database_path class DBSequenceTest(unittest.TestCase): def setUp(self): self.int_32_max = 0x100000000 self.homeDir = get_new_environment_path() self.filename = "test" self.dbenv = d...
mit
guacamoleo/clBLAS
src/scripts/perf/plotPerformance.py
16
12286
# ######################################################################## # Copyright 2013 Advanced Micro Devices, 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.apach...
apache-2.0
paulmartel/voltdb
tools/git-remove-branches-script.py
10
6165
#!/usr/bin/python # Print out scripts for removing either # - branches already merged to trunk # - branches not merged, but with no current checkins # This script DOES NOT do the removals - you need to run the # console output. #TODO: Make it handle incorrect password the 1st time, then abort #from datetime import...
agpl-3.0
Beyond-Imagination/BlubBlub
ChatbotServer/ChatbotEnv/Lib/site-packages/pip-9.0.1-py3.6.egg/pip/vcs/mercurial.py
514
3472
from __future__ import absolute_import import logging import os import tempfile from pip.utils import display_path, rmtree from pip.vcs import vcs, VersionControl from pip.download import path_to_url from pip._vendor.six.moves import configparser logger = logging.getLogger(__name__) class Mercurial(VersionControl...
gpl-3.0
Show-Me-the-Code/python
Liez-python-code/0020/0020.py
2
2223
import xlrd import re from pylab import * def get_xls_data(filename): # 读取xls数据 book = xlrd.open_workbook(filename) sheet = book.sheet_by_index(0) content = {} for i in range(sheet.nrows): content[i+1] = sheet.row_values(i)[1:] #print(content[i+1]) print("Liez的3月话费单:"...
mit
LevinJ/Supply-demand-forecasting
preprocess/splittrainvalidation.py
1
7482
from sklearn.cross_validation import KFold import numpy as np from datetime import datetime from datetime import timedelta from enum import Enum class HoldoutSplitMethod(Enum): KFOLD_BYDATE = 4 kFOLD_FORWARD_CHAINING = 5 IMITTATE_TEST2_MIN = 6 IMITTATE_TEST2_FULL = 7 IMITTATE_TEST2_PLUS1 = 8 ...
mit
npiganeau/odoo
addons/website_mail/controllers/main.py
203
4237
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
Endika/odoo
addons/event/report/report_event_registration.py
310
4079
# -*- 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
schultetwin/hostap-open
wpa_supplicant/examples/wpas-dbus-new.py
114
4272
#!/usr/bin/python import dbus import sys, os import time import gobject from dbus.mainloop.glib import DBusGMainLoop WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1" WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1" WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1" WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1.Interface" ...
gpl-2.0
Timtam/cards-against-humanity
editor/cardlist_toolbar.py
1
8855
from shared.card import CARD_BLACK, CARD_WHITE from .const import * class SearchCtrl(wx.SearchCtrl): def __init__(self, *args, **kwargs): wx.SearchCtrl.__init__(self, *args, **kwargs) frame = self.GetTopLevelParent() self.SetName(frame.translator.translate("Card search")) self.DescriptiveText...
mit
bguillot/OpenUpgrade
addons/hr/res_config.py
377
3452
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
brain-research/fisher-rao-regularization
plot_utils.py
1
3485
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
nanolearning/edx-platform
common/lib/xmodule/xmodule/tests/test_fields.py
41
6359
"""Tests for classes defined in fields.py.""" import datetime import unittest from django.utils.timezone import UTC from xmodule.fields import Date, Timedelta, RelativeTime from xmodule.timeinfo import TimeInfo import time class DateTest(unittest.TestCase): date = Date() def compare_dates(self, dt1, dt2, exp...
agpl-3.0
kyvinh/home-assistant
homeassistant/components/mqtt/__init__.py
3
18406
""" Support for MQTT message handling. For more details about this component, please refer to the documentation at https://home-assistant.io/components/mqtt/ """ import logging import os import socket import time import voluptuous as vol from homeassistant.core import callback from homeassistant.bootstrap import pre...
apache-2.0
asimshankar/tensorflow
tensorflow/python/feature_column/feature_column_v2_test.py
1
329782
# Copyright 2017 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
macronucleus/chromagnon
Chromagnon/PriCommon/decon.py
1
13529
#!/usr/bin/env priithon from __future__ import print_function import os, sys, tempfile import six from Priithon.all import Mrc from PriCommon import priismCommands, ppro26 as ppro #, byteSwap import imgio PRINTOUT=False EXT_BLT='_blt' EXT_DCN='_decon' DECON_OPT=['wiener', 'method', 'ncycl', 'smooth', 'sub'] FFT_OPT=[...
mit
mlavin/django-qjoin
setup.py
1
1339
import os from setuptools import setup, find_packages def read_file(filename): """Read a file into a string""" path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() except IOError: return '' setup( name='dj...
bsd-2-clause
lief-project/LIEF
tests/elf/test_core.py
1
16506
#!/usr/bin/env python import itertools import logging import os import random import stat import subprocess import sys import tempfile import unittest from unittest import TestCase import lief from utils import get_sample lief.logging.set_level(lief.logging.LOGGING_LEVEL.INFO) class TestCore(TestCase): LOGGER = ...
apache-2.0
NicolasDorier/bitcoin
qa/rpc-tests/test_framework/key.py
63
8487
# Copyright (c) 2011 Sam Rushing """ECC secp256k1 OpenSSL wrapper. WARNING: This module does not mlock() secrets; your private keys may end up on disk in swap! Use with caution! This file is modified from python-bitcoinlib. """ import ctypes import ctypes.util import hashlib import sys ssl = ctypes.cdll.LoadLibrary...
mit
ingenioustechie/zamboni
mkt/prices/tests/test_utils.py
19
1084
from StringIO import StringIO from nose.tools import eq_ from mkt.prices.models import Price, PriceCurrency from mkt.prices.utils import update, update_from_csv from mkt.site.tests import TestCase tiers = [ {'USD': '0.99', 'BRL': '1.99'}, # This row should be ignored, no tier of value 3. {'USD': '3.00'},...
bsd-3-clause
cainmatt/django
django/core/files/move.py
554
2794
""" Move a file in the safest way possible:: >>> from django.core.files.move import file_move_safe >>> file_move_safe("/tmp/old_file", "/tmp/new_file") """ import os from shutil import copystat from django.core.files import locks __all__ = ['file_move_safe'] def _samefile(src, dst): # Macintosh, Unix....
bsd-3-clause
ywcui1990/nupic
tests/unit/nupic/data/utils_test.py
15
3120
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013-15, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This pro...
agpl-3.0
vitan/hue
desktop/core/ext-py/guppy-0.1.10/guppy/heapy/test/test_View.py
37
6127
from guppy.heapy.test import support class TestCase(support.TestCase): def setUp(self): support.TestCase.setUp(self) self.types = self.heapy.UniSet.types class FirstCase(TestCase): def test_cal_hiding(self): V = self.View iso = self.iso # Tests that our workspace nodesets are hidden. a = [] b = [] a...
apache-2.0
talumbau/datashape
datashape/validation.py
2
2031
# -*- coding: utf-8 -*- """ Datashape validation. """ from .error import DataShapeError from . import coretypes as T def traverse(f, t): """ Map f over t, calling `f` with type `t` and the map result of the mapping `f` over `t`s parameters. """ if isinstance(t, T.Mono) and not isinstance(t, T.Un...
bsd-2-clause
NcLang/vimrc
sources_non_forked/YouCompleteMe/third_party/ycmd/third_party/JediHTTP/jedihttp.py
4
2764
# Copyright 2015 Cedraro Andrea <a.cedraro@gmail.com> # 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...
mit
benschmaus/catapult
third_party/Paste/tests/test_cgitb_catcher.py
47
2249
from paste.fixture import * from paste.cgitb_catcher import CgitbMiddleware from paste import lint from .test_exceptions.test_error_middleware import clear_middleware def do_request(app, expect_status=500): app = lint.middleware(app) app = CgitbMiddleware(app, {}, display=True) app = clear_middleware(app) ...
bsd-3-clause
haripradhan/MissionPlanner
Lib/site-packages/scipy/special/tests/test_lambertw.py
61
3879
# # Tests for the lambertw function, # Adapted from the MPMath tests [1] by Yosef Meller, mellerf@netvision.net.il # Distributed under the same license as SciPy itself. # # [1] mpmath source code, Subversion revision 992 # http://code.google.com/p/mpmath/source/browse/trunk/mpmath/tests/test_functions2.py?spec=svn9...
gpl-3.0
zerobatu/edx-platform
common/djangoapps/edxmako/paths.py
59
2665
""" Set up lookup paths for mako templates. """ import hashlib import os import pkg_resources from django.conf import settings from mako.lookup import TemplateLookup from . import LOOKUP class DynamicTemplateLookup(TemplateLookup): """ A specialization of the standard mako `TemplateLookup` class which allo...
agpl-3.0
debugger06/MiroX
tv/lib/test/utiltest.py
1
41766
# coding=latin-1 # The above comment is required, because it includes non-latin characters # as an inline string in the source, we need to have this here as per PEP 263. import itertools import os import tempfile import time import signal import shutil import unittest import sys import zipfile from miro.test.framework...
gpl-2.0
adamhaney/airflow
tests/hooks/test_s3_hook.py
6
11351
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
sairuk/webcade
cherrypy/scaffold/__init__.py
16
1839
"""<MyProject>, a CherryPy application. Use this as a base for creating new CherryPy applications. When you want to make a new app, copy and paste this folder to some other location (maybe site-packages) and rename it to the name of your project, then tweak as desired. Even before any tweaking, this should serve a fe...
gpl-2.0
dydek/django
tests/file_storage/models.py
219
1603
""" Storing files according to a custom storage system ``FileField`` and its variations can take a ``storage`` argument to specify how and where files should be stored. """ import random import tempfile from django.core.files.storage import FileSystemStorage from django.db import models class CustomValidNameStorag...
bsd-3-clause
akrv/uniArt
node_modules/node-gyp/gyp/pylib/gyp/common.py
1292
20063
# 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. from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing d...
mit
murphy-wang/aws-ec2
lib/boto-2.34.0/tests/unit/ec2/test_address.py
109
5950
from tests.compat import mock, unittest from boto.ec2.address import Address class AddressTest(unittest.TestCase): def setUp(self): self.address = Address() self.address.connection = mock.Mock() self.address.public_ip = "192.168.1.1" def check_that_attribute_has_been_set(self, name, ...
apache-2.0
KrzysztofStachanczyk/Sensors-WWW-website
www/env/lib/python2.7/site-packages/setuptools/__init__.py
219
3317
"""Extensions to the 'distutils' for large or complex distributions""" import os import sys import distutils.core import distutils.filelist from distutils.core import Command as _Command from distutils.util import convert_path import setuptools.version from setuptools.extension import Extension from setuptools.dist i...
gpl-3.0
redox/mongo-connector
tests/util.py
69
1175
# Copyright 2013-2014 MongoDB, 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 writin...
apache-2.0
JingJunYin/tensorflow
tensorflow/python/ops/state_ops.py
10
14884
# 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
Shipow/coderbits2pdf
coderbits2pdf.py
2
7274
#!/usr/bin/env python """ Coderbits2PDF - Convert your coderbits profile to pdf. Added option of adding your github repos. Usage - python coderbits2pdf.py --make username # create resume python coderbits2pdf.py --add username # add user python coderbits2pdf.py --del username # delete user python code...
mit
RaitoBezarius/crossbar
crossbar/test/test_logger.py
2
13107
##################################################################################### # # Copyright (C) Tavendo GmbH # # Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you # have purchased a commercial license), the license terms below apply. # # Should you enter into a separate licen...
agpl-3.0
kernel-hut/android_kernel_xiaomi_dior
scripts/build-all.py
1474
10189
#! /usr/bin/env python # Copyright (c) 2009-2013, The Linux Foundation. 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 # ...
gpl-2.0
gilshwartz/tortoisehg-caja
tortoisehg/util/i18n.py
2
2909
# i18n.py - TortoiseHg internationalization code # # Copyright 2009 Steve Borho <steve@borho.org> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2, incorporated herein by reference. import gettext, os, locale from mercurial import util from tortoisehg.u...
gpl-2.0
terry2012/DECAF
decaf/scripts/qapi-types.py
47
6007
# # QAPI types generator # # Copyright IBM, Corp. 2011 # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. from ordereddict import OrderedDict from qapi import * import sys import os import getopt impor...
gpl-3.0
Linphone-sync/webrtc
build/version.py
50
1895
#!/usr/bin/env python # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All ...
bsd-3-clause
Davidjohnwilson/sympy
sympy/printing/pretty/pretty.py
20
70073
from __future__ import print_function, division from sympy.core import S from sympy.core.containers import Tuple from sympy.core.function import _coeff_isneg from sympy.core.mul import Mul from sympy.core.numbers import Rational from sympy.core.power import Pow from sympy.core.relational import Equality from sympy.cor...
bsd-3-clause
Aristocles/CouchPotatoServer
libs/requests/packages/chardet/mbcharsetprober.py
2924
3268
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
PaulMcMillan/tasa
setup.py
1
1301
#!/usr/bin/env python from setuptools import setup, find_packages version = '0.3.3.dev0' setup( name="tasa", version=version, description="A simple framework for distributed task workflow using redis.", long_description=open("README.rst").read(), url='https://github.com/PaulMcMillan/tasa', lic...
bsd-2-clause
brianr747/SFC_models
sfc_models/external.py
1
12661
# coding=utf-8 from sfc_models.models import Country from sfc_models.sector import Sector import sfc_models.utils as utils class ExternalSector(Country): """ All international concepts live within an "ExternalSector" It is a Country, with code = EXT (default) The "currency" of ExternalSector is 'NUM...
apache-2.0
srene/ns-3-inrpp
src/visualizer/visualizer/hud.py
189
5462
import goocanvas import core import math import pango import gtk class Axes(object): def __init__(self, viz): self.viz = viz self.color = 0x8080C0FF self.hlines = goocanvas.Path(parent=viz.canvas.get_root_item(), stroke_color_rgba=self.color) self.hlines.lower(None) self.vl...
gpl-2.0
tmpgit/intellij-community
python/lib/Lib/site-packages/django/views/i18n.py
73
9565
import os import gettext as gettext_module from django import http from django.conf import settings from django.utils import importlib from django.utils.translation import check_for_language, activate, to_locale, get_language from django.utils.text import javascript_quote from django.utils.encoding import smart_unicod...
apache-2.0
pwasiewi/dokerz
codelite-vnc/image/usr/lib/noVNC/utils/websockify/tests/test_websockifyserver.py
4
12769
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright(c)2013 NTT corp. 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/licen...
unlicense
ceremcem/aktos-led-panel
MAX7219fonts.py
1
51355
#!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------- # Filename: MAX7219fonts.py # ----------------------------------------------------------- # Fonts data for use by the MAX7219array.py library # # v1.0 # JLC Archibald # -------------------------------------------...
mit
arve0/matrixscreener
tests/test_cam.py
1
1611
"""Test cam module.""" import pytest from matrixscreener.cam import * class EchoSocket(object): """Dummy echo socket for mocking.""" msg = '' def send(self, msg): self.msg = msg return len(msg) def recv(self, buffer_size): return self.msg[0:buffer_size] def connect(sel...
mit
interfect/cjdns
node_build/dependencies/libuv/build/gyp/test/mac/gyptest-xcode-gcc.py
212
1781
#!/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. """ Verifies that xcode-style GCC_... settings are handled properly. """ import TestGyp import os import subprocess import sys def Ignore...
gpl-3.0
gpetretto/pymatgen
pymatgen/core/tests/test_operations.py
8
10000
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import unicode_literals from pymatgen.util.testing import PymatgenTest from pymatgen.core.operations import SymmOp, MagSymmOp from pymatgen.electronic_structure.core import Magmom import numpy ...
mit
subutai/htmresearch
projects/union_path_integration/run_capacity_heatmap.py
4
2457
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2018, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/django/core/management/base.py
78
13744
""" Base classes for writing management commands (named commands which can be executed through ``django-admin.py`` or ``manage.py``). """ from __future__ import with_statement import os import sys from optparse import make_option, OptionParser import traceback import django from django.core.exceptions import Imprope...
agpl-3.0
GiedriusM/openthread
tests/scripts/thread-cert/Cert_6_1_04_REEDAttachConnectivity.py
5
4488
#!/usr/bin/python # # Copyright (c) 2016, The OpenThread 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: # 1. Redistributions of source code must retain the above copyright # not...
bsd-3-clause
m0tive/cug
scons/scons-local-1.3.0/SCons/PathList.py
5
8427
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # 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 li...
gpl-3.0
puiterwijk/bugwarrior
bugwarrior/services/activecollab2.py
1
6773
import itertools import json import time import urllib2 import six from twiggy import log from bugwarrior.services import IssueService, Issue from bugwarrior.config import die class ActiveCollab2Client(object): def __init__(self, url, key, user_id, projects): self.url = url self.key = key ...
gpl-3.0
wakatime/wakatime
wakatime/packages/py26/pygments/console.py
27
1809
# -*- coding: utf-8 -*- """ pygments.console ~~~~~~~~~~~~~~~~ Format colored console output. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ esc = "\x1b[" codes = {} codes[""] = "" codes["reset"] = esc + "39;49;00m" codes["bold"] = ...
bsd-3-clause
gbitzes/root
interpreter/llvm/src/bindings/python/llvm/core.py
53
18523
#===- core.py - Python LLVM Bindings -------------------------*- python -*--===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # #===--------------------------------------------------------------...
lgpl-2.1
gcode-mirror/audacity
lib-src/lv2/sord/waflib/Tools/flex.py
314
1057
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import waflib.TaskGen,os,re def decide_ext(self,node): if'cxx'in self.features: return['.lex.cc'] return['.lex.c'] def flexfun(tsk): env=tsk.env bld=tsk.generator.bld w...
gpl-2.0
EKiefer/edge-starter
py34env/Lib/site-packages/django/core/management/commands/loaddata.py
43
13406
from __future__ import unicode_literals import glob import gzip import os import warnings import zipfile from itertools import product from django.apps import apps from django.conf import settings from django.core import serializers from django.core.exceptions import ImproperlyConfigured from django.core.management.b...
mit
brakhane/python-mode
pymode/libs2/rope/contrib/changestack.py
115
1392
"""For performing many refactorings as a single command `changestack` module can be used to perform many refactorings on top of each other as one bigger command. It can be used like:: stack = ChangeStack(project, 'my big command') #.. stack.push(refactoring1.get_changes()) #.. stack.push(refactoring2.get_...
lgpl-3.0
pygeek/django
django/views/csrf.py
235
3802
from django.http import HttpResponseForbidden from django.template import Context, Template from django.conf import settings # We include the template inline since we need to be able to reliably display # this error message, especially for the sake of developers, and there isn't any # other way of making it available ...
bsd-3-clause
taigaio/taiga-back
taiga/projects/services/projects.py
1
10901
# -*- coding: utf-8 -*- # Copyright (C) 2014-present Taiga Agile LLC # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later ver...
agpl-3.0
miipl-naveen/optibizz
addons/mrp/mrp.py
145
73675
# -*- 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
pwwang/bioprocs
bioprocs/scripts/fastx/pFastqSE2Sam.py
1
6035
import re from os import path, symlink from sys import stdout, stderr from time import sleep from shutil import move from diot import Diot from bioprocs.utils import runcmd, cmdargs, reference, logger from bioprocs.utils.poll import Poll # variables infile = {{i.fq | quote}} outfile = {{o.outfile | quote}} outfmt ...
mit
anandology/tornado
demos/helloworld/helloworld.py
100
1222
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
apache-2.0
felixonmars/braintree_python
braintree/address_gateway.py
4
2495
import re import braintree from braintree.address import Address from braintree.error_result import ErrorResult from braintree.exceptions.not_found_error import NotFoundError from braintree.resource import Resource from braintree.successful_result import SuccessfulResult class AddressGateway(object): def __init__(...
mit
pytest-dev/pytest
testing/test_pathlib.py
2
20859
import os.path import pickle import sys import unittest.mock from pathlib import Path from textwrap import dedent from types import ModuleType from typing import Any from typing import Generator import pytest from _pytest.monkeypatch import MonkeyPatch from _pytest.pathlib import bestrelpath from _pytest.pathlib impor...
mit
pombredanne/taskflow-1
taskflow/tests/unit/patterns/test_unordered_flow.py
1
4659
# -*- coding: utf-8 -*- # Copyright (C) 2014 Yahoo! 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...
apache-2.0
nikro56/android_kernel_acer_t30s
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
ubuntudesign/tour.ubuntu.com
translate-html/translate_html/translate_htmlconfig.py
4
3130
#! /usr/bin/env python # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2011 David Planella <david.planella@ubuntu.com> # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as ...
gpl-2.0
caidongyun/pylearn2
pylearn2/sandbox/cuda_convnet/tests/test_response_norm.py
44
2518
import numpy import theano from nose.plugins.skip import SkipTest from theano.tests.unittest_tools import verify_grad try: from pylearn2.sandbox.cuda_convnet.response_norm import ( CrossMapNorm, CrossMapNormUndo ) from theano.sandbox.cuda import CudaNdarrayType, CudaNdarray from theano....
bsd-3-clause
tinkerinestudio/Tinkerine-Suite
TinkerineSuite/python/Lib/os2emxpath.py
192
4603
# Module 'os2emxpath' -- common operations on OS/2 pathnames """Common pathname manipulations, OS/2 EMX version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import stat from genericpath import * from ntpath import (expanduser, expandvars, isabs, islink, spli...
agpl-3.0
sumonchai/tough
toughradius/manage/tasks/cloudping.py
2
1456
#!/usr/bin/env python #coding:utf-8 import os import sys import time import datetime from urllib import urlencode from toughlib import utils from twisted.internet import defer from cyclone import httpclient from toughlib import dispatch,logger from toughradius.manage.tasks.task_base import TaseBasic from toughradius.ma...
agpl-3.0
Oizopower/Whitecoin-p2pool
p2pool/networks.py
1
1774
from p2pool.bitcoin import networks from p2pool.util import math # CHAIN_LENGTH = number of shares back client keeps # REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout # REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH # REAL_CHAIN_LENGTH must be changed in sync with all other clients # ...
gpl-3.0
reinout/django
tests/select_for_update/tests.py
23
18968
import threading import time from unittest import mock from multiple_database.routers import TestRouter from django.core.exceptions import FieldError from django.db import ( DatabaseError, NotSupportedError, connection, connections, router, transaction, ) from django.test import ( TransactionTestCase, ove...
bsd-3-clause
tysonclugg/django
django/contrib/gis/utils/layermapping.py
57
27125
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
bsd-3-clause
40223137/cdag7test37
static/Brython3.1.1-20150328-091302/Lib/ui/slider.py
603
2394
from . import widget from browser import doc,html class Slider(widget.Widget): def __init__(self, id=None, label=False): self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all") widget.Widget.__init__(self, self._div_shell, 'slider', id) self._h...
gpl-3.0
utecuy/edx-platform
lms/djangoapps/courseware/tests/test_footer.py
63
2297
""" Tests related to the basic footer-switching based off SITE_NAME to ensure edx.org uses an edx footer but other instances use an Open edX footer. """ from mock import patch from nose.plugins.attrib import attr from django.conf import settings from django.test import TestCase from django.test.utils import override_...
agpl-3.0
kisel/trex-core
scripts/external_libs/pyzmq-14.5.0/python3/ucs4/64bit/zmq/utils/jsonapi.py
44
1393
"""Priority based json library imports. Always serializes to bytes instead of unicode for zeromq compatibility on Python 2 and 3. Use ``jsonapi.loads()`` and ``jsonapi.dumps()`` for guaranteed symmetry. Priority: ``simplejson`` > ``jsonlib2`` > stdlib ``json`` ``jsonapi.loads/dumps`` provide kwarg-compatibility wit...
apache-2.0
VanirAOSP/external_chromium_org
chrome/test/pyautolib/chromeos/suid_actions.py
70
5373
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Helper script to perform actions as a super-user on ChromeOS. Needs to be run with superuser privileges, typically using the su...
bsd-3-clause
Azure/azure-sdk-for-python
sdk/synapse/azure-synapse-monitoring/azure/synapse/monitoring/aio/_configuration.py
1
3161
# 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 may ...
mit
xxsergzzxx/python-for-android
python3-alpha/extra_modules/gdata/apps/__init__.py
285
21144
#!/usr/bin/python # # Copyright (C) 2007 SIOS Technology, 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 appli...
apache-2.0
mayankcu/Django-social
venv/Lib/site-packages/django/core/serializers/json.py
81
2532
""" Serialize data to/from JSON """ import datetime import decimal from StringIO import StringIO from django.core.serializers.base import DeserializationError from django.core.serializers.python import Serializer as PythonSerializer from django.core.serializers.python import Deserializer as PythonDeserializer from dj...
bsd-3-clause
omerhasan/namebench
nb_third_party/jinja2/compiler.py
199
61044
# -*- coding: utf-8 -*- """ jinja2.compiler ~~~~~~~~~~~~~~~ Compiles nodes into python code. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from cStringIO import StringIO from itertools import chain from copy import deepcopy from jinja2 import nodes from j...
apache-2.0
AnupBansod/linux-btrfs
Documentation/target/tcm_mod_builder.py
2358
40707
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...
gpl-2.0
DreamerKing/LightweightHtmlWidgets
publish-rc/v1.0/files/Ipy.Lib/email/base64mime.py
118
5792
# Copyright (C) 2002-2006 Python Software Foundation # Author: Ben Gertzfield # Contact: email-sig@python.org """Base64 content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit ch...
gpl-3.0
grace-/opencv-3.0.0-cvpr
opencv/modules/ts/misc/perf_tests_timing.py
19
6236
#!/usr/bin/env python import testlog_parser, sys, os, xml, glob, re from table_formatter import * from optparse import OptionParser from operator import itemgetter, attrgetter from summary import getSetName, alphanum_keyselector import re if __name__ == "__main__": usage = "%prog <log_name>.xml [...]" parser ...
bsd-3-clause
juampatronics/theano_exercises
01_basics/01_building_expressions/03_tensor_soln.py
14
1292
import numpy as np from theano import function import theano.tensor as T def make_tensor(dim): """ Returns a new Theano tensor with no broadcastable dimensions. dim: the total number of dimensions of the tensor. """ return T.TensorType(broadcastable=tuple([False] * dim), dtype='float32')() def br...
bsd-3-clause
thanhpete/selenium
py/selenium/webdriver/chrome/webdriver.py
16
3413
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0