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 |
|---|---|---|---|---|---|
kronat/ns-3-dev-git | waf-tools/boost.py | 88 | 13889 | #!/usr/bin/env python
# encoding: utf-8
#
# partially based on boost.py written by Gernot Vormayr
# written by Ruediger Sonderfeld <ruediger@c-plusplus.de>, 2008
# modified by Bjoern Michaelsen, 2008
# modified by Luca Fossati, 2008
# rewritten for waf 1.5.1, Thomas Nagy, 2008
# rewritten for waf 1.6.2, Sylvain Rouquet... | gpl-2.0 |
stweil/ol3 | build.py | 4 | 28719 | #!/usr/bin/env python
from cStringIO import StringIO
import glob
import gzip
import json
import multiprocessing
import os
import re
import shutil
import sys
from pake import Target
from pake import ifind, main, output, rule, target, variables, virtual, which
from Queue import Queue
from threading import Thread
clas... | bsd-2-clause |
t11e/django | django/contrib/localflavor/us/us_states.py | 93 | 4958 | """
A mapping of state misspellings/abbreviations to normalized abbreviations, and
an alphabetical list of states for use as `choices` in a formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
STATE_CHOICES = (
('AL', 'Alabama'),
('AK', 'Alaska'),
... | bsd-3-clause |
egabancho/invenio | invenio/modules/jsonalchemy/jsonext/parsers/parse_first_parser.py | 2 | 1982 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio 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) a... | gpl-2.0 |
surgebiswas/poker | PokerBots_2017/Johnny/scipy/spatial/__init__.py | 29 | 3126 | """
=============================================================
Spatial algorithms and data structures (:mod:`scipy.spatial`)
=============================================================
.. currentmodule:: scipy.spatial
Nearest-neighbor Queries
========================
.. autosummary::
:toctree: generated/
... | mit |
jwinzer/OpenSlides | server/openslides/agenda/models.py | 1 | 20000 | from collections import defaultdict
from typing import Dict, List, Set
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models, transact... | mit |
liorvh/raspberry_pwn | src/pentest/voiper/sulley/requests/ldap.py | 18 | 2324 | from sulley import *
"""
Application number Application
0 BindRequest
1 BindResponse
2 UnbindRequest
3 SearchRequest
4 SearchResponse
5 ModifyRequest
6 ModifyResponse
7 AddRequest
8 AddResponse
9 DelRequest
10 DelResponse
11 ModifyRDNRequest
12 ModifyRDNResponse
13 CompareRequest
14 CompareResponse
15 AbandonRequest
"... | gpl-3.0 |
mylukin/Creeper | requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | apache-2.0 |
ARTFL-Project/PhiloLogic4 | python/philologic/runtime/QuerySyntax.py | 3 | 1707 | #!/usr/bin/env python3
import re
patterns = [
("QUOTE", r'".+?"'),
("QUOTE", r'".+'),
("NOT", "NOT"),
("OR", r"\|"),
("RANGE", r"[^|\s]+?\-[^|\s]+"),
("RANGE", r"\d+\-\Z"),
("RANGE", r"\-\d+\Z"),
("NULL", r"NULL"),
("TERM", r'[^\-|\s"]+'),
]
def parse_query(qstring):
buf = qs... | gpl-3.0 |
XeCycle/indico | indico/core/settings/models/settings_test.py | 2 | 1258 | # This file is part of Indico.
# Copyright (C) 2002 - 2015 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 |
cga-harvard/cga-worldmap | geonode/contrib/datatables/column_checker.py | 2 | 9848 | """
Before attempting a SQL join between a Layer column and a DataTable column,
compare the column types--the Postgres data types.
Check that a character column isn't going to be joined to a numeric column.
(see "ColumnChecker.are_join_columns_compatible()")
Attempting such a join will throw a Postgres error anyway--... | gpl-3.0 |
nonnib/eve-metrics | web2py/applications/admin/controllers/debug.py | 9 | 7904 | import os
import sys
import cStringIO
import gluon.contrib.shell
import gluon.dal
import gluon.html
import gluon.validators
import code
import thread
from gluon.debug import communicate, web_debugger, qdb_debugger
import pydoc
if DEMO_MODE or MULTI_USER_MODE:
session.flash = T('disabled in demo mode')
redirec... | mit |
vikatory/kbengine | kbe/res/scripts/common/Lib/turtle.py | 70 | 143547 | #
# turtle.py: a Tkinter based turtle graphics module for Python
# Version 1.1b - 4. 5. 2009
#
# Copyright (C) 2006 - 2010 Gregor Lingl
# email: glingl@aon.at
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from th... | lgpl-3.0 |
ptitjano/bokeh | examples/plotting/server/geojson_points.py | 7 | 1195 | # You must first run "bokeh serve" to view this example
import json
from bokeh.client import push_session
from bokeh.driving import repeat
from bokeh.io import curdoc
from bokeh.models import GeoJSONDataSource
from bokeh.plotting import figure
from bokeh.sampledata.sample_geojson import geojson as original
updated =... | bsd-3-clause |
jicahoo/numpy | numpy/lib/tests/test_arraypad.py | 41 | 41880 | """Tests for the array padding functions.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (assert_array_equal, assert_raises, assert_allclose,
TestCase)
from numpy.lib import pad
class TestConditionalShortcuts(TestCase):
... | bsd-3-clause |
tdm/kernel_huawei_msm8928 | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/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 |
MattRijk/django-ecomsite | lib/python2.7/site-packages/django/core/management/commands/runserver.py | 52 | 5801 | from __future__ import unicode_literals
from optparse import make_option
from datetime import datetime
import errno
import os
import re
import sys
import socket
from django.core.management.base import BaseCommand, CommandError
from django.core.servers.basehttp import run, get_internal_wsgi_application
from django.uti... | cc0-1.0 |
beiko-lab/gengis | bin/Lib/SocketServer.py | 3 | 24036 | """Generic socket server classes.
This module tries to capture the various aspects of defining a server:
For socket-based servers:
- address family:
- AF_INET{,6}: IP (Internet Protocol) sockets (default)
- AF_UNIX: Unix domain sockets
- others, e.g. AF_DECNET are conceivable (see <s... | gpl-3.0 |
lukasmonk/lucaschess | Code/GestorTurnOnLights.py | 1 | 12214 | import time
from Code import ControlPosicion
from Code import Gestor
from Code import Jugada
from Code import TurnOnLights
from Code.QT import QTUtil
from Code.QT import QTUtil2
from Code.Constantes import *
class GestorTurnOnLights(Gestor.Gestor):
def inicio(self, num_theme, num_block, tol):
if hasattr... | gpl-2.0 |
gcodetogit/depot_tools | third_party/boto/sts/credentials.py | 55 | 7559 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011, 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
# withou... | bsd-3-clause |
kalrey/swift | swift/common/db_replicator.py | 3 | 32008 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | apache-2.0 |
mattrobenolt/python-sourcemap | tests/test_objects.py | 1 | 1747 | try:
import unittest2 as unittest
except ImportError:
import unittest
from sourcemap.objects import Token, SourceMapIndex
class TokenTestCase(unittest.TestCase):
def test_eq(self):
assert Token(1, 1, 'lol.js', 1, 1, 'lol') == Token(1, 1, 'lol.js', 1, 1, 'lol')
assert Token(99, 1, 'lol.js',... | bsd-2-clause |
skosukhin/spack | var/spack/repos/builtin/packages/r-mzid/package.py | 1 | 2260 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Jionglun/-w16b_test | static/Brython3.1.3-20150514-095342/Lib/xml/sax/__init__.py | 637 | 3505 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | agpl-3.0 |
gdgellatly/OCB1 | addons/stock_location/stock_location.py | 8 | 7528 | # -*- 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 |
frewsxcv/python-geojson | tests/test_strict_json.py | 1 | 1529 | """
GeoJSON produces and consumes only strict JSON. NAN and Infinity are not
permissible values according to the JSON specification.
"""
import unittest
import geojson
class StrictJsonTest(unittest.TestCase):
def test_encode_nan(self):
"""
Ensure Error is raised when encoding nan
"""
... | bsd-3-clause |
crdoconnor/olympia | apps/paypal/tests/test_views.py | 15 | 5454 | # -*- coding: utf-8 -*-
import urllib
from django import http, test
from django.conf import settings
from django.core import mail
from mock import Mock, patch
from nose.tools import eq_
import amo.tests
from addons.models import Addon
from amo.urlresolvers import reverse
from stats.models import Contribution
URL_E... | bsd-3-clause |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_cProfile.py | 51 | 7028 | """Test suite for the cProfile module."""
import sys
from test.test_support import run_unittest, TESTFN, unlink
# rip off all interesting stuff from test_profile
import cProfile
from test.test_profile import ProfileTest, regenerate_expected_output
class CProfileTest(ProfileTest):
profilerclass = cProfile.Profile... | apache-2.0 |
gugaucb/wd32 | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | mit |
poljeff/odoo | addons/hr_expense/tests/test_journal_entries.py | 251 | 2923 | from openerp.tests.common import TransactionCase
from openerp import netsvc, workflow
class TestCheckJournalEntry(TransactionCase):
"""
Check journal entries when the expense product is having tax which is tax included.
"""
def setUp(self):
super(TestCheckJournalEntry, self).setUp()
... | agpl-3.0 |
jason-weirather/py-seq-tools | seqtools/cli/legacy/bed_depth_to_bias_table.py | 2 | 7435 | #!/usr/bin/python
import argparse, sys, os
from shutil import rmtree
from multiprocessing import cpu_count
from tempfile import mkdtemp, gettempdir
from subprocess import Popen, PIPE
from Bio.Format.GPD import GPD
from Bio.Range import Bed
from Bio.Statistics import average
def main():
#do our inputs
args = do_in... | apache-2.0 |
pschwartz/ansible | lib/ansible/cli/__init__.py | 9 | 20079 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
Nirvedh/CoarseCoherence | src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py | 88 | 7298 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
xiaoyaozi5566/GEM5_DRAMSim2 | tests/quick/se/60.rubytest/test.py | 90 | 1564 | # Copyright (c) 2010 Advanced Micro Devices, 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 of conditions... | bsd-3-clause |
piniGitHUB/volatility | vol.py | 44 | 6142 | #!/usr/bin/env python
# -*- mode: python; -*-
#
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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;... | gpl-2.0 |
jjaner/essentia-musicbricks | test/src/unittest/io/test_yamloutput.py | 10 | 9003 | #!/usr/bin/env python
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | agpl-3.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/curses/textpad.py | 212 | 7338 | """Simple textbox editing widget with Emacs-like keybindings."""
import curses
import curses.ascii
def rectangle(win, uly, ulx, lry, lrx):
"""Draw a rectangle with corners at the provided upper-left
and lower-right coordinates.
"""
win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
win.hline(u... | gpl-2.0 |
hanhlh/hadoop-0.20.2_FatBTree | src/contrib/hod/hodlib/RingMaster/idleJobTracker.py | 182 | 9106 | #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
#"License"); you may not use thi... | apache-2.0 |
celiafish/VisTrails | vistrails/db/versions/v0_9_0/domain/abstraction.py | 6 | 2662 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... | bsd-3-clause |
ojengwa/sympy | sympy/physics/tests/test_gaussopt.py | 12 | 3762 | from sympy import atan2, factor, Float, I, Matrix, N, oo, pi, sqrt, symbols
from sympy.physics.gaussopt import (BeamParameter, CurvedMirror,
CurvedRefraction, FlatMirror, FlatRefraction, FreeSpace, GeometricRay,
RayTransferMatrix, ThinLens, conjugate_gauss_beams,
gaussian_conj, geometric_conj_ab, geometric_conj_... | bsd-3-clause |
scls19fr/blaze | blaze/tests/test_interactive.py | 8 | 9834 | from blaze.interactive import Data, compute, concrete_head, expr_repr, to_html
import datetime
from odo import into, append
from odo.backends.csv import CSV
from blaze import discover
from blaze.compute.core import compute
from blaze.compute.python import compute
from blaze.expr import symbol
from datashape import dsh... | bsd-3-clause |
kanjie128/test | pymavlink/mavextra.py | 4 | 30215 | #!/usr/bin/env python
'''
useful extra functions for use by mavlink clients
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import os, sys
from math import *
try:
# rotmat doesn't work on Python3.2 yet
from rotmat import Vector3, Matrix3
except Exception:
pass
def kmh(mps):... | lgpl-3.0 |
sg-/project_generator | project_generator/builders/gccarm.py | 1 | 1789 | # Copyright 2014 0xc0170
#
# 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 |
erkrishna9/odoo | addons/crm/base_partner_merge.py | 12 | 30005 | #!/usr/bin/env python
from __future__ import absolute_import
from email.utils import parseaddr
import functools
import htmlentitydefs
import itertools
import logging
import operator
import re
from ast import literal_eval
from openerp.tools import mute_logger
# Validation Library https://pypi.python.org/pypi/validate_e... | agpl-3.0 |
pu239ppy/authentic2 | authentic2/migrations/0011_auto__add_authenticationevent.py | 1 | 4418 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
from authentic2.compat import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'AuthenticationEvent'
db.create_table(u'authentic2_authenticationevent', (
(u'i... | agpl-3.0 |
MattsFleaMarket/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_dict.py | 140 | 3816 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for dict methods.
d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())
d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())
d.v... | apache-2.0 |
Omegaphora/external_chromium_org | third_party/tlslite/tlslite/integration/pop3_tls.py | 115 | 3162 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""TLS Lite + poplib."""
import socket
from poplib import POP3, POP3_SSL_PORT
from tlslite.tlsconnection import TLSConnection
from tlslite.integration.clienthelper import ClientHelper
class POP3_TLS(POP3, ClientHelper):
... | bsd-3-clause |
github-borat/cinder | cinder/tests/api/v1/test_types.py | 11 | 7100 | # Copyright 2011 OpenStack Foundation
# 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 requ... | apache-2.0 |
RannyeriDev/Solfege | solfege/mpd/track.py | 4 | 23185 | # GNU Solfege - free ear training software
# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008, 2011 Tom Cato Amundsen
#
# 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 versi... | gpl-3.0 |
schlos/eden | controllers/default.py | 8 | 53315 | # -*- coding: utf-8 -*-
"""
Default Controllers
"""
module = "default"
# -----------------------------------------------------------------------------
def call():
"Call an XMLRPC, JSONRPC or RSS service"
# If webservices don't use sessions, avoid cluttering up the storage
#session.forget()
return... | mit |
martinwicke/tensorflow | tensorflow/contrib/rnn/python/ops/lstm_ops.py | 5 | 22996 | # 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 |
mmezzavilla/ns3-mmwave | src/visualizer/bindings/modulegen__gcc_ILP32.py | 38 | 385398 | 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 |
Hubert51/AutoGrading | learning/web_Haotian/venv/Lib/hashlib.py | 25 | 9477 | #. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
__doc__ = """hashlib module - A common interface to many hash functions.
new(name, data=b'', **kwargs) - returns a new hash object implementing the
given hash function; ... | mit |
dimazalfrianz/namebench | nb_third_party/dns/rdtypes/ANY/NSEC3PARAM.py | 248 | 3161 | # Copyright (C) 2004-2007, 2009, 2010 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 ... | apache-2.0 |
bertyhell/moviepy | moviepy/video/fx/accel_decel.py | 16 | 1224 | def f_accel_decel(t, old_d, new_d, abruptness=1, soonness=1.0):
"""
abruptness
negative abruptness (>-1): speed up down up
zero abruptness : no effect
positive abruptness: speed down up down
soonness
for positive abruptness, determines how soon the
speedup occurs (0<soon... | mit |
bthirion/nipy | nipy/algorithms/clustering/tests/test_ggm.py | 3 | 2170 | #!/usr/bin/env python
import numpy as np
import numpy.random as nr
from ..ggmixture import GGGM, GGM, Gamma
import scipy.stats as st
def test_GGM1(verbose=0):
shape = 1
scale = 1
mean = 0
var = 1
G = GGM(shape,scale,mean,var)
sx = 1000
x = -2.5 + nr.randn(sx)
G.estimate(x)
b = np.... | bsd-3-clause |
delletenebre/xbmc-addon-kilogramme | script.module.html5lib/lib/html5lib/tests/tokenizertotree.py | 483 | 1965 | from __future__ import absolute_import, division, unicode_literals
import sys
import os
import json
import re
import html5lib
from . import support
from . import test_tokenizer
p = html5lib.HTMLParser()
unnamespaceExpected = re.compile(r"^(\|\s*)<html ([^>]+)>", re.M).sub
def main(out_path):
if not os.path.ex... | gpl-3.0 |
LimKyungWoo/linux-2.6.39 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
dfalt974/SickRage | lib/sqlalchemy/util/langhelpers.py | 75 | 37513 | # util/langhelpers.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to help with the creation, loading and introspection of
modules, class... | gpl-3.0 |
mvidalgarcia/indico | indico/util/marshmallow_test.py | 2 | 1079 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import absolute_import, unicode_literals
from datetime import datetime
import pytest
imp... | mit |
jing-bao/pa-chromium | tools/json_schema_compiler/code.py | 11 | 4798 | # 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.
class Code(object):
"""A convenience object for constructing code.
Logically each object should be a block of code. All methods except |Render|
an... | bsd-3-clause |
bgris/ODL_bgris | odl/trafos/util/ft_utils.py | 1 | 23184 | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL 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.
... | gpl-3.0 |
ChanChiChoi/scikit-learn | sklearn/datasets/twenty_newsgroups.py | 72 | 13586 | """Caching loader for the 20 newsgroups text classification dataset
The description of the dataset is available on the official website at:
http://people.csail.mit.edu/jrennie/20Newsgroups/
Quoting the introduction:
The 20 Newsgroups data set is a collection of approximately 20,000
newsgroup documents,... | bsd-3-clause |
FujitsuEnablingSoftwareTechnologyGmbH/tempest | tempest/api/baremetal/admin/test_api_discovery.py | 4 | 1779 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
named-data-ndnSIM/ns-3-dev | src/aodv/bindings/modulegen__gcc_ILP32.py | 2 | 585174 | 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 |
Medigate/cutiuta-server | cutiuta-server/env/lib/python3.4/site-packages/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## 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 |
miaoski/shadowsocks | shadowsocks/crypto/rc4_md5.py | 1042 | 1339 | #!/usr/bin/env python
#
# 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 by applicable law or ... | apache-2.0 |
TinyOS-Camp/DDEA-DEV | Development/shared_constants.py | 2 | 3918 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 14 02:04:12 2014
@author: deokwoo
* Description
- This file defines constant values shared among python modules.
- Should be included all python modules first.
"""
###############################################################################
# Constant global variab... | gpl-2.0 |
1stvamp/pip | pip/_vendor/requests/packages/chardet/utf8prober.py | 2919 | 2652 | ######################## 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... | mit |
siramatu/goalshare | GSCollaborationApplication/node_modules/restify/node_modules/bunyan/tools/cutarelease.py | 171 | 22043 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2012 Trent Mick
"""cutarelease -- Cut a release of your project.
A script that will help cut a release for a git-based project that follows
a few conventions. It'll update your changelog (CHANGES.md), add a git
tag, push those changes, update your ver... | mit |
elit3ge/SickRage | lib/hachoir_parser/audio/id3.py | 86 | 16705 | """
ID3 metadata parser, supported versions: 1.O, 2.2, 2.3 and 2.4
Informations: http://www.id3.org/
Author: Victor Stinner
"""
from hachoir_core.field import (FieldSet, MatchError, ParserError,
Enum, UInt8, UInt24, UInt32,
CString, String, RawBytes,
Bit, Bits, NullBytes, NullBits)
from hachoir_core.text... | gpl-3.0 |
lukw00/shogun | tests/integration/generator/kernel.py | 21 | 16052 | """
Generator for Kernel
A word about args: it is organised as two correlated tuples, because the
order of the elements of dicts in Python is arbitrary, meaning that the item
added first might be the last when iterating over the dict.
"""
import numpy
import shogun.Kernel as kernel
from shogun.Features import Combine... | gpl-3.0 |
Permutatrix/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/pulldom.py | 1729 | 2302 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... | mpl-2.0 |
kewisch/bedrock | bedrock/legal/views.py | 4 | 2653 | # 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/.
from lib import l10n_utils
import jingo
from django.core.mail import EmailMessage
from django.shortcuts import redirect... | mpl-2.0 |
geertj/rhevsh | lib/rhevsh/command/show.py | 2 | 2796 | #
# This file is part of rhevsh. rhevsh is free software that is made
# available under the MIT license. Consult the file "LICENSE" that is
# distributed together with this file for the exact licensing terms.
#
# rhevsh is copyright (c) 2011 by the rhevsh authors. See the file
# "AUTHORS" for a complete overview.
from... | mit |
AkhilHector/Rex.Inc | .env/lib/python2.7/site-packages/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## 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... | mit |
StanfordBioinformatics/xppf | utils/setup.py | 2 | 4545 | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... | agpl-3.0 |
gomiero/PTVS | Python/Tests/TestData/DjangoDebugProject/DjangoDebugProject/settings.py | 18 | 5544 | # Django settings for DjangoDebugProject project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
... | apache-2.0 |
SantosDevelopers/sborganicos | venv/lib/python3.5/site-packages/pip/req/req_file.py | 343 | 11926 | """
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import sys
import optparse
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from ... | mit |
naparuba/opsbro | opsbro/misc/internalrsa/pyasn1/debug.py | 185 | 1541 | import sys
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Debug:
defaultPr... | mit |
djabber/Dashboard | bottle/dash/local/lib/pif-0.7/build/lib.linux-x86_64-2.7/pif/utils.py | 4 | 1686 | from __future__ import print_function
__title__ = 'pif.utils'
__author__ = 'Artur Barseghyan'
__copyright__ = 'Copyright (c) 2013 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = ('ensure_autodiscover', 'list_checkers', 'get_public_ip')
from pif.base import registry
from pif.discover import autodiscover
... | mit |
wuhengzhi/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/pep8.py | 88 | 75073 | #!/usr/bin/env python
# pep8.py - Check Python source code formatting, according to PEP 8
# Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net>
# Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this soft... | bsd-3-clause |
equialgo/scikit-learn | examples/datasets/plot_random_dataset.py | 348 | 2254 | """
==============================================
Plot randomly generated classification dataset
==============================================
Plot several randomly generated 2D classification datasets.
This example illustrates the :func:`datasets.make_classification`
:func:`datasets.make_blobs` and :func:`datasets.... | bsd-3-clause |
837468220/python-for-android | python3-alpha/python3-src/Lib/encodings/utf_8_sig.py | 266 | 4133 | """ Python 'utf-8-sig' Codec
This work similar to UTF-8 with the following changes:
* On encoding/writing a UTF-8 encoded BOM will be prepended/written as the
first three bytes.
* On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these
bytes will be skipped.
"""
import codecs
### Codec APIs
... | apache-2.0 |
scikit-xray/scikit-xray | skbeam/core/fitting/__init__.py | 5 | 3675 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# @author: Li Li (lili@bnl.g... | bsd-3-clause |
xodus7/tensorflow | tensorflow/python/keras/__init__.py | 16 | 2111 | # 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 |
nitzmahone/ansible | lib/ansible/modules/network/meraki/meraki_vlan.py | 10 | 13653 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.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
ANSIBLE_METADATA = {
... | gpl-3.0 |
Johnzero/erp | openerp/addons/fetchmail_crm_claim/__openerp__.py | 3 | 1461 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP S.A. (<http://www.openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it un... | agpl-3.0 |
allenai/document-qa | docqa/text_preprocessor.py | 1 | 7061 | from collections import Counter
from typing import List, Optional, Tuple
import numpy as np
from tqdm import tqdm
from docqa.utils import flatten_iterable
from docqa.data_processing.document_splitter import ExtractedParagraphWithAnswers, MergeParagraphs, ExtractedParagraph
from docqa.data_processing.multi_paragraph_q... | apache-2.0 |
thedep2/CouchPotatoServer | libs/tornado/httpclient.py | 23 | 26019 | """Blocking and non-blocking HTTP client interfaces.
This module defines a common interface shared by two implementations,
``simple_httpclient`` and ``curl_httpclient``. Applications may either
instantiate their chosen implementation class directly or use the
`AsyncHTTPClient` class from this module, which selects an... | gpl-3.0 |
kmonsoor/python-for-android | python3-alpha/extra_modules/gdata/contacts/service.py | 120 | 17345 | #!/usr/bin/env python
#
# Copyright 2009 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... | apache-2.0 |
onceuponatimeforever/oh-mainline | vendor/packages/Django/django/utils/html_parser.py | 231 | 4546 | from django.utils.six.moves import html_parser as _html_parser
import re
import sys
current_version = sys.version_info
use_workaround = (
(current_version < (2, 7, 3)) or
(current_version >= (3, 0) and current_version < (3, 2, 3))
)
HTMLParseError = _html_parser.HTMLParseError
if not use_workaround:
HTM... | agpl-3.0 |
django-nonrel/django | django/utils/unittest/case.py | 219 | 42502 | """Test case implementation"""
import sys
import difflib
import pprint
import re
import unittest
import warnings
from django.utils.unittest import result
from django.utils.unittest.util import\
safe_repr, safe_str, strclass,\
unorderable_list_difference
from django.utils.unittest.compatibility import wraps
... | bsd-3-clause |
FranMachio/Plugin.video.Machio. | keepalive.py | 333 | 19919 | # This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it w... | gpl-2.0 |
Nesiehr/osf.io | admin/meetings/views.py | 5 | 5412 | from __future__ import unicode_literals
from copy import deepcopy
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.views.generic import ListView, FormView
from django.core.urlresolvers import reverse
from django.http import Http404
from framework.auth.core import get_user
from osf.models.con... | apache-2.0 |
chrippa/livestreamer | src/livestreamer/plugins/afreecatv.py | 18 | 2147 | import re
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.plugin.api.utils import parse_query
from livestreamer.stream import RTMPStream
VIEW_LIVE_API_URL = "http://api.afreeca.tv/live/view_live.php"
VIEW_LIVE_API_URL_TW = "http://api.afreecatv.com.tw/live/... | bsd-2-clause |
hylje/tekis | tekis/flatpages/migrations/0003_auto_20160221_0250.py | 1 | 1533 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-21 00:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('flatpages', '0002_auto_20160221_0006'),
]
operations = [
migrations.CreateMo... | bsd-3-clause |
kowey/attelo | attelo/harness/parse.py | 1 | 5021 | '''
Control over attelo parsers as might be needed for a test harness
'''
from __future__ import print_function
from os import path as fp
import os
import sys
from joblib import (delayed)
from ..io import (write_predictions_output)
from attelo.decoding.util import (prediction_to_triples)
from attelo.fold import (sel... | gpl-3.0 |
dimagi/rapidsms-old | setup.py | 7 | 3953 | #!/usr/bin/env python
# RapidSMS setup.py -- adapted from Django's with our heartfelt thanks
from distutils.core import setup
from distutils.command.build_py import build_py as _build_py
from distutils.command.install import INSTALL_SCHEMES
import os
import sys
import commands
def fullsplit(path, result=None):
""... | lgpl-3.0 |
dulems/hue | desktop/core/ext-py/Django-1.6.10/tests/context_processors/tests.py | 63 | 1328 | """
Tests for Django's bundled context processors.
"""
from django.test import TestCase
class RequestContextProcessorTests(TestCase):
"""
Tests for the ``django.core.context_processors.request`` processor.
"""
urls = 'context_processors.urls'
def test_request_attributes(self):
"""
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.