repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
ogenstad/ansible | lib/ansible/modules/packaging/os/apt.py | 2 | 41022 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Flowroute LLC
# Written by Matthew Williams <matthew@flowroute.com>
# Based on yum module written by Seth Vidal <skvidal at fedoraproject.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ ... | gpl-3.0 |
glove747/liberty-neutron | neutron/tests/functional/agent/linux/test_async_process.py | 7 | 2816 | # Copyright 2013 Red Hat, 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 agre... | apache-2.0 |
x54621/shadowsocks | setup.py | 929 | 1321 | import codecs
from setuptools import setup
with codecs.open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(
name="shadowsocks",
version="2.8.2",
license='http://www.apache.org/licenses/LICENSE-2.0',
description="A fast tunnel proxy that help you get through firewalls",
... | apache-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/django/core/mail/__init__.py | 80 | 4678 | """
Tools for sending email.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
# Imported for backwards compatibility, and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the int... | agpl-3.0 |
czayas/agenda | repl.py | 1 | 3955 | #!/usr/bin/env python3
"""
Módulo repl: Interfaz de usuario en modo consola (vista).
Proyecto de ejemplo - Paradigmas de la Programación
Autor: Carlos Zayas (czayas en gmail)
"""
import sys
from traceback import format_exc
from collections.abc import Iterable
try:
# El módulo readline agrega autocompletado e histo... | mit |
DedMemez/ODS-August-2017 | catalog/CatalogBasketItem.py | 1 | 3029 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.catalog.CatalogBasketItem
from panda3d.core import Datagram
import CatalogItem
from toontown.estate import GardenGlobals
from toontown.toonbase import ToontownGlobals
from direct.actor import Actor
from toontown.toonbase import TTLocalizer
from ... | apache-2.0 |
mantidproject/mantid | scripts/test/Muon/fitting_widgets/basic_fitting/basic_fitting_view_test.py | 3 | 7028 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/distutils/tests/test_install_headers.py | 24 | 1238 | """Tests for distutils.command.install_headers."""
import os
import unittest
from distutils.command.install_headers import install_headers
from distutils.tests import support
from test.support import run_unittest
class InstallHeadersTestCase(support.TempdirManager,
support.LoggingSilencer... | gpl-3.0 |
odoo-turkiye/odoo | addons/share/ir_model.py | 439 | 2272 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
HiSPARC/station-software | user/python/Lib/site-packages/pythonwin/pywin/framework/mdi_pychecker.py | 15 | 26319 | ######################################################################
##
## The Pychecker MDI Plug-In UserModule for Pythonwin
##
## contributed by Robert Kiendl
##
## Style is similar to (and inherited) from the SGrepMDI UserModule
##
## Usage:
##
## Start Pychecker on current file: Menu/File/New../Pychecker.
## Use ... | gpl-3.0 |
BonexGu/Blik2D-SDK | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/__init__.py | 8 | 3143 | # 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... | mit |
javenfeng/shadowsocks | tests/test.py | 1016 | 5029 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | apache-2.0 |
cbingos/cpro | haystack/management/commands/build_solr_schema.py | 9 | 2770 | from __future__ import print_function
from __future__ import unicode_literals
from optparse import make_option
import sys
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand
from django.template import loader, Context
from haystack.backends.solr_backend import So... | mit |
ebar0n/django | tests/invalid_models_tests/test_ordinary_fields.py | 21 | 20908 | import unittest
from django.core.checks import Error, Warning as DjangoWarning
from django.db import connection, models
from django.test import SimpleTestCase, TestCase, skipIfDBFeature
from django.test.utils import isolate_apps, override_settings
from django.utils.timezone import now
@isolate_apps('invalid_models_t... | bsd-3-clause |
dfdx2/django | tests/gis_tests/gdal_tests/test_driver.py | 21 | 2356 | import unittest
from unittest import mock
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.gdal import Driver, GDALException
valid_drivers = (
# vector
'ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN', 'Memory', 'CSV',
'GML', 'KML',
# raster
'GTiff', '... | bsd-3-clause |
lowhrtz/gm | systems/OSRIC/Db.py | 2 | 580654 | # -*- coding: utf-8 -*-
from DbDefs import Table
class characters(Table):
table_name = 'Characters'
cols = ['unique_id','Name','Level','XP','Gender','Alignment','Classes','Race','HP','Age','Height','Weight','Portrait','Portrait_Image_Type','STR','INT','WIS','DEX','CON','CHA']
colDefs = ['VARCHAR(20) UNIQUE... | gpl-2.0 |
ibm-research/SwiftHLM | swifthlm/dummy_connector.py | 1 | 11621 | #!/usr/bin/python
# (C) Copyright 2017 IBM Corp.
#
# 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 ag... | apache-2.0 |
cactusbin/nyt | matplotlib/examples/axes_grid/demo_curvelinear_grid2.py | 15 | 1839 | import numpy as np
#from matplotlib.path import Path
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid.grid_helper_curvelinear import GridHelperCurveLinear
from mpl_toolkits.axes_grid.axislines import Subplot
import mpl_toolkits.axes_grid.angle_helper as angle_helper
def curvelinear_test1(fig):
"""
... | unlicense |
Berrrry/NDroid | gen-skin.py | 102 | 1676 | #!/usr/bin/python
#
# a python script used to generate the "default-skin.h' header file
# from a given skin directory
#
# usage:
# progname skin-directory-path > default-skin.h
#
import sys, os, string, re
header = """\
/* automatically generated, do not touch */
"""
footer = """\
static const FileEntry _file_... | gpl-2.0 |
southpawtech/TACTIC-DEV | src/tactic/ui/app/plugin_wdg.py | 1 | 81627 | ###########################################################
#
# Copyright (c) 2010, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
daemonmaker/pylearn2 | pylearn2/scripts/tutorials/stacked_autoencoders/tests/test_dae.py | 45 | 2062 | """
This module tests stacked_autoencoders.ipynb
"""
import os
from pylearn2.testing import skip
from pylearn2.testing import no_debug_mode
from pylearn2.config import yaml_parse
@no_debug_mode
def train_yaml(yaml_file):
train = yaml_parse.load(yaml_file)
train.main_loop()
def train_layer1(yaml_file_path... | bsd-3-clause |
ajerneck/rand-art | scrape.py | 1 | 2246 | import requests
import bs4
import re
import random
URL = 'http://longform.org'
def parse_page(url):
page = requests.get(url)
soup = bs4.BeautifulSoup(page.text)
posts = soup.select('div.post')
## filter out posts whose second class element is not empty, because those are collections or sponsored posts... | gpl-2.0 |
tuskar/tuskar-ui | openstack_dashboard/dashboards/infrastructure/models.py | 1 | 1639 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Red Hat, 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
#
#... | apache-2.0 |
DalenWBrauner/FloridaDataOverlay | Website/Florida_Data_Overlay/Overlay/migrations/0003_auto__del_document__add_upload.py | 1 | 2765 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Document'
db.delete_table(u'Overlay_document')
... | mit |
gaddman/ansible | test/units/modules/network/nxos/test_nxos_acl_interface.py | 68 | 2902 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
gavin-feng/odoo | addons/gamification/wizard/update_goal.py | 386 | 1848 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/encodings/raw_unicode_escape.py | 852 | 1208 | """ Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is ... | mit |
wavelets/zipline | zipline/finance/performance/period.py | 3 | 16164 | #
# Copyright 2014 Quantopian, 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 |
Boussadia/weboob | tools/boilerplate.py | 2 | 7847 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright(C) 2013 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... | agpl-3.0 |
emon10005/scikit-image | skimage/_shared/tests/test_safe_as_int.py | 36 | 1771 | import numpy as np
from skimage._shared.utils import safe_as_int
def test_int_cast_not_possible():
np.testing.assert_raises(ValueError, safe_as_int, 7.1)
np.testing.assert_raises(ValueError, safe_as_int, [7.1, 0.9])
np.testing.assert_raises(ValueError, safe_as_int, np.r_[7.1, 0.9])
np.testing.assert_r... | bsd-3-clause |
shravan-achar/servo | components/script/dom/bindings/codegen/parser/tests/test_variadic_constraints.py | 170 | 1564 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface VariadicConstraints1 {
void foo(byte... arg1, byte arg2);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw,
"Should... | mpl-2.0 |
tadamic/sokoenginepy | docs/conf.py | 1 | 12722 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# sokoenginepy documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 10 21:02:00 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this... | gpl-3.0 |
MartinHjelmare/home-assistant | tests/components/http/test_real_ip.py | 15 | 3351 | """Test real IP middleware."""
from aiohttp import web
from aiohttp.hdrs import X_FORWARDED_FOR
from ipaddress import ip_network
from homeassistant.components.http.real_ip import setup_real_ip
from homeassistant.components.http.const import KEY_REAL_IP
async def mock_handler(request):
"""Return the real IP as te... | apache-2.0 |
hyejin930107/ardupilot | Tools/autotest/param_metadata/htmlemit.py | 148 | 2754 | #!/usr/bin/env python
import re
from param import *
from emit import Emit
import cgi
# Emit docs in a form acceptable to the APM wordpress docs site
class HtmlEmit(Emit):
def __init__(self):
html_fname = 'Parameters.html'
self.f = open(html_fname, mode='w')
self.preamble = '''<!-- Dyn... | gpl-3.0 |
2013Commons/hue | desktop/core/ext-py/pysqlite/pysqlite2/test/dbapi.py | 45 | 27943 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/dbapi.py: tests for DB-API compliance
#
# Copyright (C) 2004-2009 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages... | apache-2.0 |
felipecocco/oppia | extensions/rules/real_test.py | 30 | 2928 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
michaelb-01/pipe | scripts/python/createThumbnails_v004.py | 1 | 2986 | import os
import subprocess
import json
import shlex
import math
import nuke
def probeFile(file):
cmd = "ffprobe -v quiet -print_format json -show_streams"
# find video duration
# ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1
# find video frame rate (no... | mit |
StefanoRaggi/Lean | Algorithm.Python/Alphas/GreenblattMagicFormulaAlpha.py | 3 | 9868 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Licen... | apache-2.0 |
alsrgv/tensorflow | tensorflow/python/kernel_tests/batch_scatter_ops_test.py | 22 | 4576 | # 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 |
pronobis/linux_kernel_arm_N8000 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # 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 |
mpuig/python-goose | goose/images/ImageUtils.py | 1 | 4157 | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.c... | apache-2.0 |
EntityFXCode/arsenalsuite | cpp/lib/PyQt4/pyuic/uic/widget-plugins/phonon.py | 8 | 1892 | #############################################################################
##
## Copyright (c) 2012 Riverbank Computing Limited <info@riverbankcomputing.com>
##
## This file is part of PyQt.
##
## This file may be used under the terms of the GNU General Public
## License versions 2.0 or 3.0 as published by the Fre... | gpl-2.0 |
lcapps-luke/js13k-glitch | util/package.py | 1 | 1491 | import os
import sys
import zipfile
import subprocess
if __name__ == '__main__':
jsFile = "bin/g.js"
jsFileMin = "bin/g_min.js"
indexFile = "bin/index.html"
indexFileMin = "bin/index_min.html"
#minify javascript
subprocess.call([
"uglifyjs",
"--compress",
"--mangle",
"--o", jsFileMin,
jsFile
], shel... | mit |
fbsder/openthread | tools/harness-automation/cases/leader_5_1_1.py | 16 | 1875 | #!/usr/bin/env 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
# notic... | bsd-3-clause |
Arcanemagus/plexpy | lib/dns/rdtypes/IN/PX.py | 18 | 3394 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
beatrizjesus/my-first-blog | pasta/Lib/site-packages/django/db/backends/base/features.py | 79 | 9569 | from django.db.models.aggregates import StdDev
from django.db.utils import ProgrammingError
from django.utils.functional import cached_property
class BaseDatabaseFeatures(object):
gis_enabled = False
allows_group_by_pk = False
# True if django.db.backends.utils.typecast_timestamp is used on values
# r... | mit |
tuborgclassic/carlsberg | settings.py | 1 | 2487 | from os.path import exists, abspath, dirname, join
import misc
THIS_DIR = dirname(abspath(__file__))
# this is a personal access token used by chaosbot to perform merges and other
# api requests. it is a secret, and lives on the server, but since chaosbot has
# access to this secret file, it can be manipulated into... | mit |
ArcherSys/ArcherSys | Lib/site-packages/pip/_vendor/packaging/markers.py | 76 | 7341 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import operator
import os
import platform
import sys
from pip._vendor.pyp... | mit |
tuxfux-hlp-notes/python-batches | archieves/batch-56/modules/sheets/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/euckrprober.py | 2931 | 1675 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
arbrandes/edx-platform | openedx/core/djangoapps/waffle_utils/tests/test_models.py | 5 | 1944 | """
Tests for waffle utils models.
"""
from ddt import data, ddt, unpack
from django.test import TestCase
from edx_django_utils.cache import RequestCache
from opaque_keys.edx.keys import CourseKey
from ..models import WaffleFlagCourseOverrideModel
@ddt
class WaffleFlagCourseOverrideTests(TestCase):
"""
Test... | agpl-3.0 |
quanvm009/codev7 | openerp/addons/base/res/res_request.py | 63 | 6261 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
sunghan-chang/TizenRT | external/iotivity/iotivity_1.2-rel/extlibs/gtest/gtest-1.7.0/test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | apache-2.0 |
wuhengzhi/chromium-crosswalk | tools/perf/page_sets/top_25_smooth.py | 8 | 6837 | # Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
from page_sets.login_helpers import g... | bsd-3-clause |
UstadMobile/exelearning-extjs5-mirror | exe/webui/testquestionelement.py | 11 | 6565 | # ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... | gpl-2.0 |
8u1a/plaso | plaso/parsers/skydrivelogerr.py | 1 | 8915 | # -*- coding: utf-8 -*-
"""This file contains SkyDrive error log file parser in plaso."""
import logging
import pyparsing
from plaso.events import time_events
from plaso.lib import eventdata
from plaso.lib import timelib
from plaso.parsers import manager
from plaso.parsers import text_parser
__author__ = 'Francesc... | apache-2.0 |
pandeyadarsh/sympy | sympy/physics/vector/functions.py | 74 | 23381 | from __future__ import print_function, division
from sympy import (sympify, diff, sin, cos, Matrix, Symbol, integrate,
trigsimp, Function, symbols)
from sympy.core.basic import S
from sympy.core.compatibility import reduce
from .vector import Vector, _check_vector
from .frame import CoordinateSym, _... | bsd-3-clause |
alistairlow/tensorflow | tensorflow/compiler/tests/cholesky_op_test.py | 19 | 4872 | # 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 |
yaii/yai | share/extensions/dxf_input.py | 3 | 29081 | #!/usr/bin/env python
'''
dxf_input.py - input a DXF file >= (AutoCAD Release 13 == AC1012)
Copyright (C) 2008, 2009 Alvin Penner, penner@vaxxine.com
Copyright (C) 2009 Christian Mayer, inkscape@christianmayer.de
- thanks to Aaron Spike for inkex.py and simplestyle.py
- without which this would not have been possible
... | gpl-2.0 |
brianbeliveau/OligoMiner | probeTm.py | 1 | 7717 | #!/usr/bin/env python
# --------------------------------------------------------------------------
# OligoMiner
# probeTm.py
#
# (c) 2017 Molecular Systems Lab
#
# Wyss Institute for Biologically-Inspired Engineering
# Harvard University
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
#... | mit |
thaim/ansible | lib/ansible/module_utils/network/cnos/cnos.py | 38 | 20105 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by
# Ansible still belong to the author of the module, and may assign their own
# license to the complete wo... | mit |
lpantano/bcbio-nextgen | bcbio/distributed/ipythontasks.py | 1 | 13270 | """Ipython parallel ready entry points for parallel execution
"""
import contextlib
try:
from ipyparallel import require
except ImportError:
from IPython.parallel import require
from bcbio import heterogeneity, hla, chipseq, structural, upload
from bcbio.bam import callable
from bcbio.rnaseq import sailfish
f... | mit |
rizumu/django | django/template/backends/dummy.py | 480 | 2037 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import errno
import io
import string
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import Origin, TemplateDoesNotExist
from django.utils... | bsd-3-clause |
larsmans/scikit-learn | sklearn/externals/joblib/pool.py | 10 | 23255 | """Custom implementation of multiprocessing.Pool with custom pickler
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if multiprocessing is not
available... | bsd-3-clause |
Zloool/manyfaced-honeypot | manyfaced/common/utils.py | 1 | 1349 | import time
import pickle
from socket import error as socket_error
from status import CLIENT_TIMEOUT
def dump_file(data):
try:
with file('temp.db') as f:
string_file = f.read()
db = pickle.loads(string_file)
except:
db = list()
db.append(data)
with open('temp.db', ... | mit |
srinathv/bokeh | bokeh/models/callbacks.py | 4 | 1810 | """ Client-side interactivity. """
from __future__ import absolute_import
from ..plot_object import PlotObject
from ..properties import abstract
from ..properties import Dict, Instance, String, Enum
from ..enums import ScriptingLanguage
@abstract
class Callback(PlotObject):
""" Base class for interactive callbac... | bsd-3-clause |
Danisan/odoo-1 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/tiny_socket.py | 386 | 3270 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
mitsuhiko/solace | solace/badges.py | 1 | 7311 | # -*- coding: utf-8 -*-
"""
solace.badges
~~~~~~~~~~~~~
This module implements the badge system.
:copyright: (c) 2010 by the Solace Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from operator import attrgetter
from solace.i18n import lazy_gettext, _
from sol... | bsd-3-clause |
chesman12/ufop-faltas | node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | gpl-3.0 |
bakkerjarr/ACLSwitch | Ryu_Application/controller.py | 1 | 11192 | # Copyright 2015 Jarrod N. Bakker
#
# 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 writ... | apache-2.0 |
OpenWinCon/OpenWinNet | web-gui/myvenv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | apache-2.0 |
cpritam/moose | framework/scripts/fixup_headers.py | 9 | 2599 | #!/usr/bin/env python
# This script checks and can optionally update MOOSE source files.
# You should always run this script without the "-u" option
# first to make sure there is a clean dry run of the files that should
# be updated
import os, string
from optparse import OptionParser
global_ignores = ['contrib', '.s... | lgpl-2.1 |
rajendrant/ArduinoControl | python/ArduinoControlClient/example.py | 1 | 1250 | import ArduinoControlClient
import time
b = ArduinoControlClient.UDPClient('192.168.1.106', 6666)
def ping_test(b):
for i in range(4):
latency = b.ping_test()
print 'ping_test', 'PASSED latency=%d'%(latency) if latency else 'FAILED'
time.sleep(0.5)
def blink_led(b):
pin=b.get_pin(2)
... | gpl-3.0 |
s0enke/boto | boto/ec2/image.py | 92 | 16222 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# 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
# w... | mit |
thaumos/ansible | test/units/vars/test_module_response_deepcopy.py | 118 | 1473 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.vars.clean import module_response_deepcopy
import pytest
def... | gpl-3.0 |
jcrudy/grm | grm/binomial_earth_example.py | 1 | 1250 | import numpy
from grm import GeneralizedRegressor, BinomialLossFunction, LogitLink
import scipy.stats
from pyearth.earth import Earth
numpy.seterr(all='raise')
m = 1000
n = 10
p = 10
def earth_basis(X, vars, parents, knots, signs):
p = vars.shape[0]
B = numpy.empty(shape=(m,p+1))
B[:,0] = 1.0
for i in ... | gpl-3.0 |
pcolmant/repanier | repanier/xlsx/xlsx_stock.py | 1 | 24914 | import repanier.apps
from django.db import transaction
from django.utils.translation import ugettext_lazy as _
from repanier.const import *
from repanier.models.offeritem import OfferItemReadOnly
from repanier.models.product import Product
from repanier.packages.openpyxl import load_workbook
from repanier.packages.open... | gpl-3.0 |
drodarie/nest-simulator | pynest/nest/tests/test_sp/test_conn_builder.py | 11 | 3449 | # -*- coding: utf-8 -*-
#
# test_conn_builder.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Licen... | gpl-2.0 |
syapse/django-storages | storages/backends/image.py | 4 | 1822 | import os
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import FileSystemStorage
from django.utils.deconstruct import deconstructible
try:
from PIL import ImageFile as PILImageFile
except ImportError:
raise ImproperlyConfigured("Could not load PIL depen... | bsd-3-clause |
1and1/confluencer | src/confluencer/tools/content.py | 1 | 10540 | # -*- coding: utf-8 -*-
# pylint: disable=bad-continuation
""" Tools to discover and modify content.
"""
# Copyright © 2015 1&1 Group <git@1and1.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 Lic... | apache-2.0 |
zakuro9715/lettuce | tests/integration/lib/Django-1.3/django/utils/html.py | 202 | 8105 | """HTML utilities suitable for global use."""
import re
import string
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.http import urlquote
# Configuration for urlize() function.
LEADING_PUNCTUATIO... | gpl-3.0 |
joyeshmishra/spark-tk | regression-tests/generatedata/gmm_datagen.py | 14 | 1129 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
waytai/django | django/utils/inspect.py | 323 | 4195 | from __future__ import absolute_import
import inspect
from django.utils import six
def getargspec(func):
if six.PY2:
return inspect.getargspec(func)
sig = inspect.signature(func)
args = [
p.name for p in sig.parameters.values()
if p.kind == inspect.Parameter.POSITIONAL_OR_KEYWOR... | bsd-3-clause |
untitaker/beets | beetsplug/lastgenre/__init__.py | 8 | 14464 | # This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# 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, ... | mit |
nanolearningllc/edx-platform-cypress-2 | lms/djangoapps/instructor/views/instructor_task_helpers.py | 133 | 5257 | """
A collection of helper utility functions for working with instructor
tasks.
"""
import json
import logging
from util.date_utils import get_default_time_display
from bulk_email.models import CourseEmail
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from instructor_... | agpl-3.0 |
kaushik94/sympy | sympy/utilities/autowrap.py | 3 | 40995 | """Module for compiling codegen output, and wrap the binary for use in
python.
.. note:: To use the autowrap module it must first be imported
>>> from sympy.utilities.autowrap import autowrap
This module provides a common interface for different external backends, such
as f2py, fwrap, Cython, SWIG(?) etc. (Curren... | bsd-3-clause |
iwaseyusuke/ryu-book | zh_tw/source/sources/simple_switch_igmp_13.py | 4 | 3917 | from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib import igmplib
from ryu.lib.dpid import str_to_dpi... | apache-2.0 |
kewisch/bedrock | vendor-local/packages/beautifulsoup4/bs4/tests/test_html5lib.py | 293 | 2929 | """Tests to ensure that the html5lib tree builder generates good trees."""
import warnings
try:
from bs4.builder import HTML5TreeBuilder
HTML5LIB_PRESENT = True
except ImportError, e:
HTML5LIB_PRESENT = False
from bs4.element import SoupStrainer
from bs4.testing import (
HTML5TreeBuilderSmokeTest,
... | mpl-2.0 |
biorack/metatlas | metatlas/io/write_utils.py | 1 | 2914 | """ Utility functions used in writing files"""
import filecmp
import logging
import os
import tempfile
logger = logging.getLogger(__name__)
def make_dir_for(file_path):
"""makes directories for file_path if they don't already exist"""
directory = os.path.dirname(file_path)
if directory != "":
os... | bsd-3-clause |
Tagar/incubator-airflow | airflow/ti_deps/deps/not_running_dep.py | 5 | 1579 | # -*- 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 |
PetePriority/home-assistant | homeassistant/components/zone/zone.py | 1 | 3191 | """Component entity and functionality."""
from homeassistant.const import ATTR_HIDDEN, ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.helpers.entity import Entity
from homeassistant.loader import bind_hass
from homeassistant.util.async_ import run_callback_threadsafe
from homeassistant.util.location import distance
... | apache-2.0 |
mwana/django-tables | docs/conf.py | 4 | 6357 | # -*- coding: utf-8 -*-
#
# django-tables documentation build configuration file, created by
# sphinx-quickstart on Fri Mar 26 08:40:14 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#... | bsd-2-clause |
jmsleiman/hypercube-election | hypercube.py | 1 | 5446 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Joseph M. Sleiman
# This program is free software; you can redistribute it and/or
# modify it under the terms of the LGPLv2.1 or LGPLv3 License.
import math
import node
class HyperCube(object):
def __init__(self, dimension, nodeValues):
### ... | lgpl-2.1 |
liuzz1983/open_vision | openvision/facenet/models/network.py | 4 | 8807 | """Functions for building the face recognition network.
"""
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# 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, includ... | mit |
Hikari-no-Tenshi/android_external_skia | tools/skpbench/_hardware_nexus_6p.py | 12 | 3664 | # Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from _hardware import HardwareException, Expectation
from _hardware_android import HardwareAndroid
CPU_CLOCK_RATE = 1728000
GPU_CLOCK_RATE = 510000000
class HardwareNexus6P(HardwareAnd... | bsd-3-clause |
Manuel4131/youtube-dl | youtube_dl/extractor/ign.py | 107 | 5415 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class IGNIE(InfoExtractor):
"""
Extractor for some of the IGN sites, like www.ign.com, es.ign.com de.ign.com.
Some videos of it.ign.com are also supported
"""
_VALID_URL = r'https?://.+?\.ign\.com/(?P<type>video... | unlicense |
c0defreak/python-for-android | python3-alpha/python3-src/Lib/wsgiref/validate.py | 51 | 15151 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middlew... | apache-2.0 |
sgml/popcorn_maker | vendor-local/lib/python/debug_toolbar/panels/profiling.py | 12 | 6627 | from __future__ import division
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from debug_toolbar.panels import DebugPanel
try:
from line_profiler import LineProfiler, show_func
DJ_PROFILE_USE_LINE_PROFILER = True
except ImportError:
DJ_PROFILE_USE_LI... | bsd-3-clause |
svn2github/gyp | test/mac/gyptest-objc-gc.py | 165 | 1586 | #!/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 GC objc settings are handled correctly.
"""
import TestGyp
import TestMac
import sys
if sys.platform == 'darwin':
# s... | bsd-3-clause |
ChillarAnand/junction | junction/base/emailer.py | 1 | 1236 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Standard Library
from os import path
# Third Party Stuff
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
def send_email(to, context, template_dir):
"""Re... | mit |
m00re/ns-3-stdma | sources/src/virtual-net-device/bindings/modulegen__gcc_ILP32.py | 24 | 204643 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.