repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
ChenJunor/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/PublicKey/__init__.py | 114 | 1842 | # -*- coding: utf-8 -*-
#
# SelfTest/PublicKey/__init__.py: Self-test for public key crypto
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedic... | apache-2.0 |
Dhivyap/ansible | lib/ansible/modules/cloud/google/gcp_pubsub_topic.py | 3 | 12632 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
NvanAdrichem/networkx | networkx/algorithms/components/tests/test_subgraph_copies.py | 52 | 3497 | """ Tests for subgraphs attributes
"""
from copy import deepcopy
from nose.tools import assert_equal
import networkx as nx
class TestSubgraphAttributesDicts:
def setUp(self):
self.undirected = [
nx.connected_component_subgraphs,
nx.biconnected_component_subgraphs,
]
... | bsd-3-clause |
chronossc/openpyxl | openpyxl/tests/test_dump.py | 2 | 3020 |
# file openpyxl/tests/test_dump.py
# Copyright (c) 2010 openpyxl
#
# 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, co... | mit |
HeraclesHX/scikit-learn | examples/linear_model/plot_sgd_weighted_samples.py | 344 | 1458 | """
=====================
SGD: Weighted samples
=====================
Plot decision function of a weighted dataset, where the size of points
is proportional to its weight.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model
# we create 20 points
np.random.seed(0)
X ... | bsd-3-clause |
olgabrani/synnefo | snf-cyclades-app/synnefo/logic/management/commands/server-import.py | 9 | 9169 | # Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed i... | gpl-3.0 |
sorenk/ansible | test/units/modules/packaging/os/test_rhn_channel.py | 101 | 5661 | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Pierre-Louis Bonicoli <pierre-louis@libregerbil.fr>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from itertools import product
import json
from ansible.modules.packaging.os import rhn_channel
import pytest
pytestmark = pyt... | gpl-3.0 |
DataONEorg/d1_python | client_cli/src/d1_cli/impl/command_processor.py | 1 | 20132 | #!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... | apache-2.0 |
cristiana214/cristianachavez214-cristianachavez | python/src/Lib/shlex.py | 306 | 11137 | # -*- coding: iso-8859-1 -*-
"""A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, March 2000
# push_source() and pop_source() made explicit by ESR, January 2001.
# Posix compliance, split(), st... | apache-2.0 |
zhwsh00/DirectFire-android | cocos2d-2.1beta3-x-2.1.0/cocos2dx/platform/third_party/marmalade/freetype/src/tools/docmaker/tohtml.py | 395 | 18731 | # ToHTML (c) 2002, 2003, 2005, 2006, 2007, 2008
# David Turner <david@freetype.org>
from sources import *
from content import *
from formatter import *
import time
# The following defines the HTML header used by all generated pages.
html_header_1 = """\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/... | mit |
Inspq/ansible | lib/ansible/modules/system/selinux_permissive.py | 69 | 4355 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Michael Scherer <misc@zarb.org>
# inspired by code of github.com/dandiker/
#
# 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 Softwar... | gpl-3.0 |
aforalee/keystone | keystone/server/eventlet.py | 9 | 5534 |
# Copyright 2013 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... | apache-2.0 |
shorelinedev/aosp_kernel_hammerhead | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
Metrological/qtwebkit | Tools/QueueStatusServer/model/queuelog.py | 122 | 3843 | # Copyright (C) 2013 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 of conditions and the ... | lgpl-3.0 |
osvalr/odoo | openerp/service/__init__.py | 380 | 1613 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you c... | agpl-3.0 |
zenodo/zenodo | zenodo/modules/deposit/receivers.py | 2 | 2671 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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) any later... | gpl-2.0 |
mzizzi/ansible | test/units/playbook/role/test_include_role.py | 54 | 8862 | # (c) 2016, Daniel Miranda <danielkza2@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) any later v... | gpl-3.0 |
pepetreshere/odoo | addons/stock/wizard/stock_quantity_history.py | 6 | 1561 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, fields, models
from odoo.osv import expression
class StockQuantityHistory(models.TransientModel):
_name = 'stock.quantity.history'
_description = 'Stock Quantity History'
inventory_date... | agpl-3.0 |
chalmers-revere/opendlv.miniature | thirdparty/cxxtest/doc/include_anchors.py | 54 | 2903 | #-------------------------------------------------------------------------
# CxxTest: A lightweight C++ unit testing library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the LGPL License v3
# For more information, see the COPYING file in the top CxxTest directory.
# Under the terms of ... | gpl-2.0 |
3dfxmadscientist/CBSS | addons/portal/tests/__init__.py | 177 | 1108 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
fajoy/horizon-example | openstack_dashboard/dashboards/project/volumes/tabs.py | 3 | 1719 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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 |
procangroup/edx-platform | lms/djangoapps/learner_dashboard/tests/test_programs.py | 5 | 9285 | # -*- coding: utf-8 -*-
"""
Unit tests covering the program listing and detail pages.
"""
import json
import re
from urlparse import urljoin
from uuid import uuid4
import mock
from bs4 import BeautifulSoup
from django.conf import settings
from django.core.urlresolvers import reverse, reverse_lazy
from django.test impo... | agpl-3.0 |
LordDamionDevil/Lony | lib/pip/_vendor/requests/packages/urllib3/packages/six.py | 2715 | 30098 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | gpl-3.0 |
antinucleon/shadowsocks | shadowsocks/crypto/util.py | 1032 | 4287 | #!/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 |
deniszgonjanin/moviepy | moviepy/video/io/gif_writers.py | 14 | 9110 | import os
import subprocess as sp
from tqdm import tqdm
from moviepy.config import get_setting
from moviepy.decorators import (requires_duration,use_clip_fps_by_default)
from moviepy.tools import verbose_print, subprocess_call
import numpy as np
try:
from subprocess import DEVNULL # py3k
except ImportError:
D... | mit |
j5shi/Thruster | plugins/python/lib/PyQt4/__init__.py | 1 | 1424 | # Copyright (c) 2010 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 Free Software
# Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
... | gpl-2.0 |
mhils/pytest | testing/test_monkeypatch.py | 29 | 7614 | import os, sys
import pytest
from _pytest.monkeypatch import monkeypatch as MonkeyPatch
def pytest_funcarg__mp(request):
cwd = os.getcwd()
sys_path = list(sys.path)
def cleanup():
sys.path[:] = sys_path
os.chdir(cwd)
request.addfinalizer(cleanup)
return MonkeyPatch()
def test_set... | mit |
MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Doc/includes/tzinfo-examples.py | 32 | 5063 | from datetime import tzinfo, timedelta, datetime
ZERO = timedelta(0)
HOUR = timedelta(hours=1)
# A UTC class.
class UTC(tzinfo):
"""UTC"""
def utcoffset(self, dt):
return ZERO
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return ZERO
utc = UTC()
# A class building... | gpl-2.0 |
anryko/ansible | lib/ansible/module_utils/network/exos/argspec/l2_interfaces/l2_interfaces.py | 13 | 1555 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is auto generated by ... | gpl-3.0 |
fergalmoran/dss | spa/migrations/0003_auto__add_field_mix_duration.py | 1 | 16192 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Mix.duration'
db.add_column(u'spa_mix', 'duration',
self.gf('django.db... | bsd-2-clause |
state-hiu/geonode-announcements | announcements/models.py | 2 | 2159 | from django.db import models
from django.core.urlresolvers import reverse
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
# support custom user models in django 1.5+
# https://docs.djangoproject.com/en/1.5/topics/auth/customizing/#substituting-a-custom-user-model
try:
from... | mit |
kmoocdev2/edx-platform | lms/djangoapps/courseware/tests/test_context_processor.py | 13 | 1639 | """
Unit tests for courseware context_processor
"""
from django.contrib.auth.models import AnonymousUser
from mock import Mock
from courseware.context_processor import user_timezone_locale_prefs
from openedx.core.djangoapps.user_api.preferences.api import set_user_preference
from student.tests.factories import UserFac... | agpl-3.0 |
jimporter/mkdocs | mkdocs/structure/files.py | 1 | 10501 | import fnmatch
import os
import logging
from functools import cmp_to_key
from urllib.parse import quote as urlquote
from mkdocs import utils
log = logging.getLogger(__name__)
log.addFilter(utils.warning_filter)
class Files:
""" A collection of File objects. """
def __init__(self, files):
self._file... | bsd-2-clause |
thaim/ansible | lib/ansible/plugins/terminal/vyos.py | 191 | 1700 | #
# (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 d... | mit |
N6UDP/cslbot | cslbot/commands/stopwatch.py | 2 | 4831 | # Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# 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 ve... | gpl-2.0 |
Eureka22/ASM_xf | PythonD/lib/python2.4/idlelib/configSectionNameDialog.py | 150 | 3720 | """
Dialog that allows user to specify a new config file section name.
Used to get new highlight theme and keybinding set names.
"""
from Tkinter import *
import tkMessageBox
class GetCfgSectionNameDialog(Toplevel):
def __init__(self,parent,title,message,usedNames):
"""
message - string, informatio... | gpl-2.0 |
rrrene/django | django/templatetags/cache.py | 471 | 3389 | from __future__ import unicode_literals
from django.core.cache import InvalidCacheBackendError, caches
from django.core.cache.utils import make_template_fragment_key
from django.template import (
Library, Node, TemplateSyntaxError, VariableDoesNotExist,
)
register = Library()
class CacheNode(Node):
def __in... | bsd-3-clause |
django-cratis/cratis | tests/test_init.py | 1 | 1147 | import os
from subprocess import check_output
from cratis.bootstrap import init_app, run_env_command
from tests._markers import slow
@slow
def test_init_in_empty_dir(tmpdir):
"""
Test check simple operations like open file by path,
load and save on existing file.
:param tmpdir:
:return:
"""
... | bsd-2-clause |
vuolter/pyload | src/pyload/core/scheduler.py | 2 | 2825 | # -*- coding: utf-8 -*-
import time
from heapq import heappop, heappush
from threading import Lock
from _thread import start_new_thread
from .utils.struct.lock import lock
class AlreadyCalled(Exception):
pass
class Deferred:
def __init__(self):
self.call = []
self.result = ()
def add... | agpl-3.0 |
RAPD/RAPD | src/old_agents/subcontractors/xdsme/new/xdsme-0.4.9/XIO/plugins/pycgtypes/vec4.py | 12 | 12333 | ####################################################################
# vec4 - 4-dimensional vector
#
# Copyright (C) 2002, Matthias Baas (baas@ira.uka.de)
#
# You may distribute under the terms of the BSD license, as
# specified in the file license.txt.
##################################################################... | agpl-3.0 |
rosswhitfield/mantid | scripts/Engineering/gui/engineering_diffraction/tabs/focus/model.py | 3 | 17365 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2019 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 |
karthik-sethuraman/ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_path_computation_context_augmentation3.py | 4 | 2512 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_path_computation_path_computation_context import TapiPathComputationPathComputationContext... | apache-2.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/numpy/distutils/command/build_ext.py | 149 | 22493 | """ Modified version of build_ext that handles fortran source files.
"""
from __future__ import division, absolute_import, print_function
import os
import sys
from glob import glob
from distutils.dep_util import newer_group
from distutils.command.build_ext import build_ext as old_build_ext
from distutils.errors impo... | bsd-3-clause |
davasqueza/eriskco_conector_CloudSQL | lib/jinja2/testsuite/inheritance.py | 414 | 8248 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.inheritance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the template inheritance feature.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Env... | apache-2.0 |
JoyTeam/metagam | mg/core/applications.py | 1 | 27519 | #!/usr/bin/python2.6
# This file is a part of Metagam project.
#
# Metagam 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
# any later version.
#
# Metagam is distributed ... | gpl-3.0 |
vitan/hue | apps/oozie/src/oozie/urls.py | 4 | 9202 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
screwt/tablib | tablib/packages/odf3/script.py | 56 | 1106 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# 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 you... | mit |
django-leonardo/horizon | horizon/test/tests/notifications.py | 17 | 1885 | # Copyright (C) 2015 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.0
#
# Unless required by applicable law... | apache-2.0 |
Atomistica/user-gfmd | tests/TEST_Hertz_sc100_128x128/eval.py | 1 | 2434 | # ======================================================================
# USER-GFMD - Elastic half-space methods for LAMMPS
# https://github.com/Atomistica/user-gfmd
#
# Copyright (2011-2016,2021)
# Lars Pastewka <lars.pastewka@imtek.uni-freiburg>,
# Tristan A. Sharp and others.
# See the AUTHORS file in the top... | gpl-2.0 |
8ojangles/grunt-template-project | node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py | 1824 | 3474 | # Copyright (c) 2011 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... | mit |
Axam/nsx-web | nailgun/nailgun/openstack/common/db/sqlalchemy/test_migrations.py | 7 | 11462 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM 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 Li... | apache-2.0 |
davidgbe/scikit-learn | sklearn/datasets/tests/test_samples_generator.py | 181 | 15664 | from __future__ import division
from collections import defaultdict
from functools import partial
import numpy as np
import scipy.sparse as sp
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing imp... | bsd-3-clause |
jmr0/servo | tests/wpt/css-tests/tools/html5lib/html5lib/treeadapters/sax.py | 1835 | 1661 | from __future__ import absolute_import, division, unicode_literals
from xml.sax.xmlreader import AttributesNSImpl
from ..constants import adjustForeignAttributes, unadjustForeignAttributes
prefix_mapping = {}
for prefix, localName, namespace in adjustForeignAttributes.values():
if prefix is not None:
pre... | mpl-2.0 |
gregvonkuster/tools-iuc | deprecated/tools/htseq/htseqsams2mx.py | 25 | 19952 | # May 2013
# Change to htseq as the counting engine - wrap so arbitrary number of columns created
# borged Simon Anders' "count.py" since we need a vector of counts rather than a new sam file as output
# note attribution for htseq and count.py :
# Written by Simon Anders (sanders@fs.tum.de), European Molecular Biology
... | mit |
aldencolerain/boringmanclan | project/views/profiles.py | 1 | 1401 | from django.contrib.auth import authenticate, login, update_session_auth_hash
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from project.extensions.shortcuts import sensitiv... | mit |
dbaxa/GitPython | git/index/base.py | 3 | 48462 | # index.py
# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import tempfile
import os
import sys
import subprocess
import glob
from cStringIO import StringIO
from... | bsd-3-clause |
BrotherPhil/django | tests/gis_tests/maps/tests.py | 322 | 2099 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.test import SimpleTestCase
from django.test.utils import modify_settings, override_settings
from django.utils.encoding import force_text
GOOGLE_MAPS_API_KEY = 'XXXX... | bsd-3-clause |
zeroblade1984/LG_MSM8974 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
charleswhchan/ansible | lib/ansible/plugins/inventory/__init__.py | 50 | 2727 | # (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 |
suto/infernal-twin | build/pip/build/lib.linux-i686-2.7/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## 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... | gpl-3.0 |
hvy/chainer | chainer/types.py | 4 | 2253 | import numbers
import typing as tp # NOQA
import typing_extensions as tpe # NOQA
try:
from typing import TYPE_CHECKING # NOQA
except ImportError:
# typing.TYPE_CHECKING doesn't exist before Python 3.5.2
TYPE_CHECKING = False
# import chainer modules only for type checkers to avoid circular import
if TY... | mit |
yongshengwang/hue | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_dateformat.py | 57 | 6340 | from __future__ import unicode_literals
from datetime import datetime, date
import os
import time
from django.utils.dateformat import format
from django.utils import dateformat, translation, unittest
from django.utils.timezone import utc
from django.utils.tzinfo import FixedOffset, LocalTimezone
class DateFormatTes... | apache-2.0 |
channing/gyp | test/make/gyptest-noload.py | 362 | 2023 | #!/usr/bin/env python
# Copyright (c) 2010 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.
"""
Tests the use of the NO_LOAD flag which makes loading sub .mk files
optional.
"""
# Python 2.5 needs this for the with statement.
from ... | bsd-3-clause |
atmark-techno/atmark-dist | user/python/Demo/sgi/video/VFile.py | 3 | 30270 | # Classes to read and write CMIF video files.
# (For a description of the CMIF video format, see cmif-file.ms.)
# Layers of functionality:
#
# VideoParams: maintain essential parameters of a video file
# Displayer: display a frame in a window (with some extra parameters)
# BasicVinFile: read a CMIF video file
# Basic... | gpl-2.0 |
TangXT/edx-platform | common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py | 9 | 14097 | """
Tests for the wrapping layer that provides the XBlock API using XModule/Descriptor
functionality
"""
# For tests, ignore access to protected members
# pylint: disable=protected-access
import webob
import ddt
from factory import (
BUILD_STRATEGY,
Factory,
lazy_attribute,
LazyAttributeSequence,
p... | agpl-3.0 |
flaviostutz/openalpr | src/bindings/python/openalpr/openalpr.py | 9 | 3694 | import ctypes
import json
import platform
class Alpr():
def __init__(self, country, config_file, runtime_dir):
# Load the .dll for Windows and the .so for Unix-based
if platform.system().lower().find("windows") != -1:
self._openalprpy_lib = ctypes.cdll.LoadLibrary("openalprpy.dll")
... | agpl-3.0 |
jasonmccampbell/numpy-refactor-sprint | numpy/distutils/unixccompiler.py | 75 | 3651 | """
unixccompiler - can handle very long argument lists for ar.
"""
import os
from distutils.errors import DistutilsExecError, CompileError
from distutils.unixccompiler import *
from numpy.distutils.ccompiler import replace_method
from numpy.distutils.compat import get_exception
if sys.version_info[0] < 3:
impor... | bsd-3-clause |
butterflypay/bitcoin | qa/rpc-tests/p2p-acceptblock.py | 49 | 12364 | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import time
from... | mit |
wlerin/streamlink | src/streamlink/plugins/pluzz.py | 3 | 8697 | import logging
import re
import sys
import time
from streamlink.plugin import Plugin, PluginArguments, PluginArgument
from streamlink.plugin.api import validate
from streamlink.stream import DASHStream, HDSStream, HLSStream, HTTPStream
from streamlink.stream.ffmpegmux import MuxedStream
log = logging.getLogger(__name... | bsd-2-clause |
acenario/Payable | lib/python2.7/site-packages/django/http/multipartparser.py | 105 | 24204 | """
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
from __future__ import unicode_literals
import base64
import binascii
import cgi
import sys
from django.conf import settings
from django.core.exceptions imp... | mit |
ericzundel/pants | tests/python/pants_test/engine/legacy/test_address_mapper.py | 1 | 7395 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import uni... | apache-2.0 |
fzalkow/scikit-learn | examples/calibration/plot_calibration.py | 225 | 4795 | """
======================================
Probability calibration of classifiers
======================================
When performing classification you often want to predict not only
the class label, but also the associated probability. This probability
gives you some kind of confidence on the prediction. However,... | bsd-3-clause |
GbalsaC/bitnamiP | common/lib/xmodule/xmodule/modulestore/exceptions.py | 120 | 2736 | """
Exceptions thrown by KeyStore objects
"""
class ItemNotFoundError(Exception):
pass
class ItemWriteConflictError(Exception):
pass
class InsufficientSpecificationError(Exception):
pass
class OverSpecificationError(Exception):
pass
class InvalidLocationError(Exception):
pass
class NoPat... | agpl-3.0 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/v8/tools/testrunner/local/commands.py | 7 | 4293 | # Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | gpl-3.0 |
TeamEOS/external_chromium_org | tools/deep_memory_profiler/lib/symbol.py | 99 | 7171 | # Copyright 2013 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.
import logging
import os
import sys
_BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
_FIND_RUNTIME_SYMBOLS_PATH = os.path.join(_BASE... | bsd-3-clause |
gorczynski/dotfiles | vim/bundle/powerline/tests/test_listers.py | 8 | 5049 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import powerline.listers.i3wm as i3wm
from tests.lib import Args, replace_attr, Pl
from tests import TestCase
class TestI3WM(TestCase):
@staticmethod
def get_workspaces():
return iter([
{'name':... | gpl-3.0 |
GhostThrone/django | tests/string_lookup/models.py | 281 | 1533 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def... | bsd-3-clause |
y0sh1/iozone-results-comparator | src/regression_line.py | 8 | 2379 | #!/usr/bin/python
# Copyright (C) 2013
# Adam Okuliar aokuliar at redhat dot com
# Jiri Hladky hladky dot jiri at gmail dot com
# Petr Benas petrbenas at gmail dot com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | gpl-3.0 |
liangazhou/django-rdp | packages/PyDev/plugins/org.python.pydev.jython_4.4.0.201510052309/Lib/unittest/main.py | 115 | 9083 | """Unittest main program"""
import sys
import os
import types
from . import loader, runner
from .signals import installHandler
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
CATCHBREAK = " -c, --catch Catch control-C and display results\n"
BUFFEROUTPUT = " -b, --buffer Bu... | apache-2.0 |
volcanoauthors/volcano-ci-tests | src/gn/toolchain/win/recursive_mirror.py | 2 | 1029 | #!/usr/bin/env python
# Copyright (c) 2017-2018 the Volcano Authors. All rights reserved.
# Licensed under the GPLv3.
import os
import shutil
import sys
def main(source, dest):
"""Emulation of rm -rf out && cp -af in out."""
if os.path.exists(dest):
if os.path.isdir(dest):
def _on_error(fn, path, excinfo... | gpl-3.0 |
kvar/ansible | hacking/build_library/build_ansible/command_plugins/porting_guide.py | 4 | 3254 | # coding: utf-8
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import argparse
import os.path
import sys
from ji... | gpl-3.0 |
bhavin04890/finaldashboard | modules/eden/vulnerability.py | 3 | 17256 | # -*- coding: utf-8 -*-
""" Sahana Eden Vulnerability Model
@copyright: 2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software with... | mit |
shermanng10/superathletebuilder | env/lib/python2.7/site-packages/pip/download.py | 279 | 31936 | from __future__ import absolute_import
import cgi
import email.utils
import hashlib
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
try:
import ssl # noqa
HAS_TLS = True
except ImportError:
HAS_TLS = False
from pip._... | mit |
deepakkv07/Implementation-of-UDP-Lite-in-ns-3 | src/core/bindings/modulegen__gcc_ILP32.py | 4 | 321492 | 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 |
projectatomic/atomic-reactor | atomic_reactor/utils/odcs.py | 1 | 7754 | """
Copyright (c) 2017, 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import absolute_import
from atomic_reactor.util import get_retrying_requests_session
from textwrap import dedent
impo... | bsd-3-clause |
potash/scikit-learn | sklearn/neighbors/tests/test_ball_tree.py | 159 | 10196 | import pickle
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors.ball_tree import (BallTree, NeighborsHeap,
simultaneous_sort, kernel_norm,
nodeheap_sort, DTYPE, ITYPE)
from sklearn.neighbors.dis... | bsd-3-clause |
manojgudi/sandhi | modules/gr36/gnuradio-core/src/python/gnuradio/gr/qa_pipe_fittings.py | 18 | 4143 | #!/usr/bin/env python
#
# Copyright 2005,2007,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... | gpl-3.0 |
a7xtony1/plugin.video.ELECTROMERIDAtv | modules/libraries/subtitles.py | 5 | 5236 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any ... | gpl-2.0 |
blazewicz/micropython | tests/wipy/pin.py | 65 | 4862 | """
This test need a set of pins which can be set as inputs and have no external
pull up or pull down connected.
GP12 and GP17 must be connected together
"""
from machine import Pin
import os
mch = os.uname().machine
if 'LaunchPad' in mch:
pin_map = ['GP24', 'GP12', 'GP14', 'GP15', 'GP16', 'GP17', 'GP28', 'GP8'... | mit |
liyi193328/seq2seq | seq2seq/contrib/learn/datasets/synthetic_test.py | 110 | 5314 | # 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 |
Daniel-CA/commission | sale_commission/wizard/wizard_invoice.py | 1 | 2593 | # -*- coding: utf-8 -*-
# © 2011 Pexego Sistemas Informáticos (<http://www.pexego.es>)
# © 2015 Pedro M. Baeza (<http://www.serviciosbaeza.com>)
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api, _
class SaleCommissionMakeInvoice(models.TransientModel):
_nam... | agpl-3.0 |
QGuLL/samba | python/samba/tests/kcc/__init__.py | 22 | 3381 | # Unix SMB/CIFS implementation. Tests for samba.kcc core.
# Copyright (C) Andrew Bartlett 2015
#
# Written by Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
#
# 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 Softw... | gpl-3.0 |
VentureCranial/system-status-dashboard | ssd/urls.py | 1 | 5628 | #
# Copyright 2013 - Tom Alessi
#
# 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 |
quattor/aquilon | tests/broker/test_constraints_network.py | 1 | 7564 | #!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | apache-2.0 |
ifduyue/sentry | src/sentry/api/endpoints/organization_member_details.py | 2 | 10426 | from __future__ import absolute_import
from django.db import transaction
from django.db.models import Q
from rest_framework import serializers
from rest_framework.response import Response
from sentry import roles
from sentry.api.bases.organization import (
OrganizationEndpoint, OrganizationPermission)
from sentry... | bsd-3-clause |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Highrise/DeletePeople.py | 5 | 3907 | # -*- coding: utf-8 -*-
###############################################################################
#
# DeletePeople
# Deletes a specified contact from your Highrise CRM.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may ... | gpl-3.0 |
dreamsxin/kbengine | kbe/src/lib/python/Tools/scripts/rgrep.py | 112 | 1476 | #! /usr/bin/env python3
"""Reverse grep.
Usage: rgrep [-i] pattern file
"""
import sys
import re
import getopt
def main():
bufsize = 64 * 1024
reflags = 0
opts, args = getopt.getopt(sys.argv[1:], "i")
for o, a in opts:
if o == '-i':
reflags = reflags | re.IGNORECASE
if len(a... | lgpl-3.0 |
openmaraude/APITaxi | APITaxi2/default_settings.py | 1 | 1390 | # SQLALCHEMY_ECHO = True
# Warning is displayed when SQLALCHEMY_TRACK_MODIFICATIONS is the default.
# Future SQLAlchemy version will set this value to False by default anyway.
SQLALCHEMY_TRACK_MODIFICATIONS = False
INFLUXDB_DATABASE = 'taxis'
INFLUXDB_CREATE_DATABASE = False
_ONE_MINUTE = 60
_ONE_HOUR = _ONE_MINUTE ... | agpl-3.0 |
denys-duchier/django | django/core/management/color.py | 43 | 1821 | """
Sets up the terminal color scheme.
"""
import functools
import os
import sys
from django.utils import termcolors
def supports_color():
"""
Return True if the running system's terminal supports color,
and False otherwise.
"""
plat = sys.platform
supported_platform = plat != 'Pocket PC' an... | bsd-3-clause |
Lekanich/intellij-community | python/lib/Lib/ast.py | 139 | 11347 | # -*- coding: utf-8 -*-
"""
ast
~~~
The `ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with
each Python release; this module helps to find out programmatically what
the current grammar looks like and allows... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.