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 |
|---|---|---|---|---|---|
jamslevy/gsoc | app/django/contrib/gis/geos/__init__.py | 8 | 2734 | """
The goal of this module is to be a ctypes wrapper around the GEOS library
that will work on both *NIX and Windows systems. Specifically, this uses
the GEOS C api.
I have several motivations for doing this:
(1) The GEOS SWIG wrapper is no longer maintained, and requires the
installation of SWIG.
(2) ... | apache-2.0 |
Yannig/ansible | test/runner/lib/cover.py | 44 | 7160 | """Code coverage utilities."""
from __future__ import absolute_import, print_function
import os
import re
from lib.target import (
walk_module_targets,
walk_compile_targets,
)
from lib.util import (
display,
ApplicationError,
run_command,
common_environment,
)
from lib.config import (
C... | gpl-3.0 |
Hodorable/0602 | openstack_dashboard/dashboards/project/routers/ports/forms.py | 32 | 7792 | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... | apache-2.0 |
lowRISC/manticore | util/license-checker.py | 2 | 17721 | #!/usr/bin/env python3
#
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
import fnmatch
import logging
import re
import subprocess
from pathlib import Path
from types import SimpleNamespace
import hjson
... | apache-2.0 |
Smarsh/django | tests/regressiontests/forms/localflavor/cz.py | 18 | 4319 | # -*- coding: utf-8 -*-
# Tests for the contrib/localflavor/ CZ Form Fields
tests = r"""
# CZPostalCodeField #########################################################
>>> from django.contrib.localflavor.cz.forms import CZPostalCodeField
>>> f = CZPostalCodeField()
>>> f.clean('84545x')
Traceback (most recent call las... | bsd-3-clause |
jithinbp/vLabtool-v0 | v0/utilitiesClass.py | 1 | 2985 | import time,random,functools
import numpy as np
from PyQt4 import QtCore, QtGui
import pyqtgraph as pg
import pyqtgraph.opengl as gl
class utilitiesClass():
"""
This class contains methods that simplify setting up and running
an experiment.
"""
timers=[]
viewBoxes=[]
plots3D=[]
plots2D=[]
axisItems=[]
t... | gpl-3.0 |
Flumotion/flumotion | flumotion/component/combiners/switch/patternswitch.py | 3 | 2611 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | lgpl-2.1 |
techdragon/sphinx-gui | docs/conf.py | 2 | 7947 | # -*- coding: utf-8 -*-
#
# sphinx-gui documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 4 11:11:57 2013.
#
# 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-3-clause |
en0/Supybot_sasl | plugins/Unix/__init__.py | 16 | 2528 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# 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 co... | bsd-3-clause |
makinacorpus/odoo | addons/product_extended/wizard/__init__.py | 374 | 1078 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | agpl-3.0 |
clearcare/twilio-python | twilio/rest/__init__.py | 3 | 5995 | import logging
import os
import platform
from twilio import TwilioException
from twilio import __version__ as LIBRARY_VERSION
from twilio.rest.resources import make_request
from twilio.rest.resources import Accounts
from twilio.rest.resources import Applications
from twilio.rest.resources import AuthorizedConnectApps
f... | mit |
jrha/aquilon | tests/broker/test_dump_dns.py | 2 | 5412 | #!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2011,2013 Contributor
#
# 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... | apache-2.0 |
irzaip/cipi | Other/mos_pub_test.py | 2 | 2605 | import time
#!/usr/bin/python
# Copyright (c) 2010,2011 Roger Light <roger@atchoo.org>
# 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 abov... | lgpl-3.0 |
areski/cdr-stats | cdr_stats/user_profile/tests.py | 2 | 4281 | #
# CDR-Stats License
# http://www.cdr-stats.org
#
# 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/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The Initial Develope... | mpl-2.0 |
devilry/devilry-django | devilry/apps/core/tests/test_groupinvite.py | 1 | 24874 | from django.core import mail
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.utils import timezone
from django.utils.timezone import timedelta
from django.urls import reverse
from model_bakery import baker
from devilry.apps.core import devilry_core_baker_factories as cor... | bsd-3-clause |
koduj-z-klasa/python101 | docs/webflask/quiz_orm/quiz2_pw/views.py | 1 | 4117 | # -*- coding: utf-8 -*-
# quiz-orm/views.py
from flask import render_template, request, redirect, url_for, abort, flash
from app import app
from models import Pytanie, Odpowiedz
from forms import *
@app.route('/')
def index():
"""Strona główna"""
return render_template('index.html')
@app.route('/lista')
de... | mit |
ajjl/ITK | Documentation/Migration/InitializeXMLGuide.py | 12 | 12324 | #!/usr/bin/env python
#
# InitializeXMLGuide.py
#
# This script will parse the Git commits on the current branch and initializes
# an XML migration guide document with the apropriate content.
from __future__ import print_function
import os.path
import sys
import subprocess
import datetime
####################
# Help... | apache-2.0 |
mateon1/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/test_util.py | 449 | 7538 | #!/usr/bin/env python
#
# Copyright 2011, 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... | mpl-2.0 |
leppa/home-assistant | homeassistant/components/mobile_app/sensor.py | 5 | 2003 | """Sensor platform for mobile_app."""
from functools import partial
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import (
ATTR_SENSOR_STATE,
ATTR_SENSOR_TYPE_SENSOR as ENTITY_TYPE,
... | apache-2.0 |
dan1/horizon-proto | openstack_dashboard/test/test_data/cinder_data.py | 21 | 13932 | # 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
#
# Unless required by applicable law or agree... | apache-2.0 |
gfyoung/numpy | numpy/distutils/command/build.py | 187 | 1618 | from __future__ import division, absolute_import, print_function
import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', ... | bsd-3-clause |
BigBearGCU/googletest | test/gtest_env_var_test.py | 2408 | 3487 | #!/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... | bsd-3-clause |
Workday/OpenFrame | build/gyp_chromium_test.py | 27 | 2026 | #!/usr/bin/env python
# Copyright 2015 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 os
import sys
import unittest
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
SRC_DIR = os.path.dirname(SCRIPT_DIR)
sy... | bsd-3-clause |
dermoth/gramps | gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py | 2 | 3255 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | gpl-2.0 |
aperigault/ansible | lib/ansible/modules/cloud/opennebula/one_vm.py | 7 | 51120 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
"""
(c) 2017, Milan Ilic <milani@nordeus.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the ter... | gpl-3.0 |
Event38/MissionPlanner | Lib/site-packages/numpy/polynomial/chebyshev.py | 53 | 40135 | """
Objects for dealing with Chebyshev series.
This module provides a number of objects (mostly functions) useful for
dealing with Chebyshev series, including a `Chebyshev` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in... | gpl-3.0 |
allenlavoie/tensorflow | tensorflow/contrib/keras/api/keras/datasets/reuters/__init__.py | 73 | 1061 | # 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 |
boneknuckleskin/libforensics | code/lf/win/ole/ps/ctypes.py | 13 | 3684 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | gpl-3.0 |
brownman/selenium-webdriver | selenium/src/py/lib/docutils/parsers/rst/__init__.py | 5 | 6660 | # Author: David Goodger
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 4445 $
# Date: $Date: 2006-03-23 15:28:36 +0100 (Thu, 23 Mar 2006) $
# Copyright: This module has been placed in the public domain.
"""
This is ``docutils.parsers.rst`` package. It exports a single class, `Parser`,
the reSt... | apache-2.0 |
AllenDowney/HeriReligion | archive/thinkplot.py | 3 | 22756 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import math
import matplotlib
import matplotlib.pyplot as plt
import numpy as np... | mit |
h3biomed/ansible | lib/ansible/modules/cloud/amazon/aws_acm_facts.py | 13 | 11677 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
module: aws... | gpl-3.0 |
cyberark-bizdev/ansible | lib/ansible/parsing/mod_args.py | 20 | 12115 | # (c) 2014 Michael DeHaan, <michael@ansible.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 ve... | gpl-3.0 |
etkirsch/scikit-learn | sklearn/utils/estimator_checks.py | 21 | 51976 | from __future__ import print_function
import types
import warnings
import sys
import traceback
import inspect
import pickle
from copy import deepcopy
import numpy as np
from scipy import sparse
import struct
from sklearn.externals.six.moves import zip
from sklearn.externals.joblib import hash, Memory
from sklearn.ut... | bsd-3-clause |
arvinsingla/CouchPotatoServer | couchpotato/core/media/_base/providers/nzb/nzbclub.py | 36 | 4241 | import time
from bs4 import BeautifulSoup
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.nzb.base import NZBProvider
from date... | gpl-3.0 |
40223119/2015w13-1 | static/Brython3.1.0-20150301-090019/Lib/unittest/mock.py | 739 | 71473 | # mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# http://pypi.python.org/pypi/mock
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
... | gpl-3.0 |
bholley/servo | python/servo/bootstrap_commands.py | 48 | 11721 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
JFriel/honours_project | networkx/build/lib/networkx/algorithms/connectivity/tests/test_kcomponents.py | 50 | 8395 | # Test for Moody and White k-components algorithm
from nose.tools import assert_equal, assert_true, raises
import networkx as nx
from networkx.algorithms.connectivity.kcomponents import (
build_k_number_dict,
_consolidate,
)
##
## A nice synthetic graph
##
def torrents_and_ferraro_graph():
# Graph from htt... | gpl-3.0 |
GitHublong/hue | desktop/core/ext-py/Django-1.6.10/tests/syndication/tests.py | 49 | 15644 | from __future__ import absolute_import, unicode_literals
from xml.dom import minidom
from django.contrib.syndication import views
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase
from django.test.utils import requires_tz_support
from django.utils import tzinfo
from django.utils... | apache-2.0 |
abenzbiria/clients_odoo | addons/auth_ldap/__openerp__.py | 108 | 4839 | ##############################################################################
#
# 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 Affero General Public L... | agpl-3.0 |
Shrhawk/edx-platform | cms/djangoapps/contentstore/management/commands/migrate_to_split.py | 185 | 2174 | """
Django management command to migrate a course from the old Mongo modulestore
to the new split-Mongo modulestore.
"""
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.split_migrato... | agpl-3.0 |
PyQuake/earthquakemodels | code/runExperiments/histogramMagnitude.py | 1 | 1982 | import matplotlib.pyplot as plt
import models.model as model
import earthquake.catalog as catalog
from collections import OrderedDict
def histogramMagnitude(catalog_, region):
"""
Creates the histogram of magnitudes by a given region.
Saves the histogram to the follwing path ./code/Zona2/histograms/'+regio... | bsd-3-clause |
antoyo/qutebrowser | qutebrowser/browser/webkit/webkitinspector.py | 4 | 1310 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
Skyscanner/pages | test/utils/hamcrest_matchers.py | 1 | 2357 | ############################################################################
# Copyright 2015 Skyscanner Ltd #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may no... | apache-2.0 |
gylian/sickrage | lib/github/tests/Gist.py | 39 | 6592 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
wildchildyn/autism-website | yanni_env/lib/python3.6/site-packages/sqlalchemy/testing/suite/test_types.py | 33 | 25733 | # coding: utf-8
from .. import fixtures, config
from ..assertions import eq_
from ..config import requirements
from sqlalchemy import Integer, Unicode, UnicodeText, select
from sqlalchemy import Date, DateTime, Time, MetaData, String, \
Text, Numeric, Float, literal, Boolean, cast, null, JSON, and_, type_coerce
fr... | gpl-3.0 |
socrocket/trap-gen | processors/LEON2/LEONCoding.py | 1 | 5555 | ################################################################################
#
# _/_/_/_/_/ _/_/_/ _/ _/_/_/
# _/ _/ _/ _/_/ _/ _/
# _/ _/ _/ _/ _/ _/ _/
# _/ _/_/_/ _/_/_/_/ _/_/_/
# _/ _/ _/ _/ _/ _/
# ... | gpl-3.0 |
Vogeltak/pauselan | lib/python3.4/site-packages/cffi/vengine_cpy.py | 10 | 41164 | import sys, imp
from . import model, ffiplatform
class VCPythonEngine(object):
_class_key = 'x'
_gen_python_module = True
def __init__(self, verifier):
self.verifier = verifier
self.ffi = verifier.ffi
self._struct_pending_verification = {}
self._types_of_builtin_functions ... | gpl-2.0 |
jedie/pypyjs-standalone | website/js/pypy.js-0.3.0/lib/modules/pipes.py | 179 | 9582 | """Conversion pipeline templates.
The problem:
------------
Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format. Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode). Some of the conversion steps may require th... | mit |
tornadozou/tensorflow | tensorflow/contrib/training/python/training/sampling_ops.py | 46 | 17246 | # 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 |
thatneat/dotfiles | other_applications/sublime-text-3/Packages/Anaconda/anaconda_lib/jedi/parser/pgen2/pgen.py | 49 | 13966 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
# Modifications:
# Copyright 2014 David Halter. Integration into Jedi.
# Modifications are dual-licensed: MIT and PSF.
# Pgen imports
from . import grammar
from jedi.parser import token
from jedi.parse... | mit |
jamesblunt/edx-platform | lms/djangoapps/mobile_api/social_facebook/friends/tests.py | 128 | 14336 | # pylint: disable=E1101
"""
Tests for friends
"""
import json
import httpretty
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.factories import CourseFactory
from ..test_utils import SocialFacebookTestCase
class TestFriends(SocialFacebookTestCase):
"""
Tests for /api/mobile/v0.5/fr... | agpl-3.0 |
bdang2012/taiga-back-casting | taiga/projects/milestones/api.py | 1 | 6149 | # Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
miyabe/poppler | regtest/HTMLReport.py | 2 | 12193 | # HTMLReport.py
#
# Copyright (C) 2012 Carlos Garcia Campos <carlosgc@gnome.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any late... | gpl-2.0 |
Cinntax/home-assistant | homeassistant/components/eufy/__init__.py | 2 | 2175 | """Support for Eufy devices."""
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_ACCESS_TOKEN,
CONF_ADDRESS,
CONF_DEVICES,
CONF_NAME,
CONF_PASSWORD,
CONF_TYPE,
CONF_USERNAME,
)
from homeassistant.helpers import discovery
import homeassistant.helpers.config_val... | apache-2.0 |
rsampaio/cobbler | tests/pycallgraph_mod.py | 21 | 7104 | #!/usr/bin/env python
"""
pycallgraph
http://pycallgraph.slowchop.com/
Copyright Gerald Kaszuba 2007
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your optio... | gpl-2.0 |
Lenovo-K3/android_kernel_lenovo_msm8916 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
marc-sensenich/ansible | test/units/modules/network/vyos/test_vyos_config.py | 68 | 5136 | #
# (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... | gpl-3.0 |
smarinac/root | interpreter/llvm/src/tools/clang/docs/tools/dump_format_style.py | 2 | 4355 | #!/usr/bin/env python
# A tool to parse the FormatStyle struct from Format.h and update the
# documentation in ../ClangFormatStyleOptions.rst automatically.
# Run from the directory in which this file is located to update the docs.
import collections
import re
import urllib2
FORMAT_STYLE_FILE = '../../include/clang/F... | lgpl-2.1 |
overtherain/scriptfile | software/googleAppEngine/google/appengine/api/search/QueryLexer.py | 2 | 32125 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit |
qiankunshe/sky_engine | sky/tools/mojo_cache_linker.py | 13 | 4321 | #!/usr/bin/env python
# Copyright 2015 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 argparse
import logging
import os
import sys
import subprocess
import json
import platform
def library_paths(build_dir):
f... | bsd-3-clause |
mgit-at/ansible | hacking/update_bundled.py | 37 | 1309 | #!/usr/bin/env python
import glob
import json
import os.path
from distutils.version import LooseVersion
from ansible.module_utils.urls import open_url
basedir = os.path.dirname(__file__)
for filename in glob.glob(os.path.join(basedir, '../lib/ansible/compat/*/__init__.py')):
if 'compat/tests' in filename:
... | gpl-3.0 |
isoriss123/namebench | libnamebench/config.py | 173 | 11391 | #!/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 required... | apache-2.0 |
liangjiaxing/sympy | examples/galgebra/print_check_latex.py | 72 | 5127 | #!/usr/bin/env python
from __future__ import print_function
from sympy import sin, cos, sinh, cosh, symbols, expand, simplify
from sympy.galgebra import xdvi
from sympy.galgebra import MV, Format, Com
def main():
Format()
(ex, ey, ez) = MV.setup('e*x|y|z')
A = MV('A', 'mv')
print(r'\bm{A} =', A)
... | bsd-3-clause |
farhaanbukhsh/bodhi | bodhi/services/stacks.py | 4 | 7448 | # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-2.0 |
sbidoul/odoo | addons/auth_openid/__openerp__.py | 313 | 1628 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 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 |
dcifuen/cloudbday | src/lib/requests/packages/charade/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# 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
# versio... | mit |
qbektrix/namebench | nb_third_party/dns/rdtypes/ANY/AFSDB.py | 248 | 1847 | # Copyright (C) 2003-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 |
walterbender/turtle3D | plugins/accelerometer/accelerometer.py | 2 | 3302 | #!/usr/bin/env python
#Copyright (c) 2011 Walter Bender
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This progr... | mit |
TribeMedia/sky_engine | mojo/tools/deploy_domokit_site.py | 8 | 4933 | #!/usr/bin/env python
# Copyright 2015 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.
"""Deploy domokit.github.io"""
# NOTE: Requires that download_material_design_icons to have been run from
# $build_dir/gen/dart-dpkg/s... | bsd-3-clause |
rahul-c1/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
rven/odoo | addons/sale_expense/models/sale_order.py | 4 | 1639 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo import SUPERUSER_ID
from odoo.osv import expression
class SaleOrder(models.Model):
_inherit = 'sale.order'
expense_ids = fields.One2many('hr.expense', 'sale_order... | agpl-3.0 |
DStauffman/dstauffman | dstauffman/estimation/kalman.py | 1 | 8438 | r"""
Functions related to Kalman Filter analysis.
Notes
-----
#. Written by David C. Stauffer in April 2019.
"""
#%% Imports
import doctest
import unittest
from dstauffman import HAVE_NUMPY
from dstauffman.numba import ncjit
from dstauffman.estimation.linalg import mat_divide
if HAVE_NUMPY:
import numpy as np... | lgpl-3.0 |
tktrungna/leetcode | Python/range-sum-query-immutable.py | 1 | 1146 | """
QUESTION:
Given an integer array nums, find the sum of the elements between indices i and j (i < j), inclusive.
Example:
Given nums = [-2, 0, 3, -5, 2, -1]
sumRange(0, 2) -> 1
sumRange(2, 5) -> -1
sumRange(0, 5) -> -3
Note:
You may assume that the array does not change.
There are many calls to sumRange function.
... | mit |
roadmapper/ansible | lib/ansible/modules/commands/raw.py | 59 | 3247 | # This is a virtual module that is entirely implemented server side
# Copyright: (c) 2012, Ansible Project
# 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 = {'metadata_... | gpl-3.0 |
dcsommer/linux-kernel-cwnd-issues | 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 |
aeischeid/servo | tests/wpt/web-platform-tests/tools/py/testing/path/test_local.py | 160 | 29652 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import py
import pytest
import os, sys
from py.path import local
import common
failsonjython = py.test.mark.xfail("sys.platform.startswith('java')")
failsonjywin32 = py.test.mark.xfail("sys.platform.startswith('java') "
"and getattr(os, '_name', No... | mpl-2.0 |
AlexSnet/FabricDeployer | projects/migrations/0020_auto.py | 18 | 9853 | # -*- 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 M2M table for field hosts on 'Stage'
m2m_table_name = db.shorten_name(u'projects_stage_hosts')
... | mit |
stephenliu1989/HK_DataMiner | hkdataminer/Nystrom_code/microToMacroBySHC_v2.0b.py | 1 | 41931 | #!/usr/bin/env python
#######################################################
#Written by Daniel Silva
#Based in the original SHC code from Yuan YAO and Xuhui Huang:
# Proceedings of the Pacific Symposium on Biocomputing, 15, 228-239, (2010)
#
#Intended to be used in the SimTK project
#Ver. 1.5b 21/Apr/2011
#########... | apache-2.0 |
Endika/mitmproxy | test/tools/memoryleak.py | 4 | 1152 | import gc
import threading
from pympler import muppy, refbrowser
from OpenSSL import SSL
# import os
#os.environ["TK_LIBRARY"] = r"C:\Python27\tcl\tcl8.5"
#os.environ["TCL_LIBRARY"] = r"C:\Python27\tcl\tcl8.5"
# Also noteworthy: guppy, objgraph
step = 0
__memory_locals__ = True
def str_fun(obj):
if isinstance(o... | mit |
pranjalpatil/scrapy | tests/test_settings/__init__.py | 98 | 12165 | import six
import unittest
import warnings
from scrapy.settings import Settings, SettingsAttribute, CrawlerSettings
from tests import mock
from . import default_settings
class SettingsAttributeTest(unittest.TestCase):
def setUp(self):
self.attribute = SettingsAttribute('value', 10)
def test_set_gre... | bsd-3-clause |
jarshwah/django | django/contrib/postgres/validators.py | 115 | 2772 | import copy
from django.core.exceptions import ValidationError
from django.core.validators import (
MaxLengthValidator, MaxValueValidator, MinLengthValidator,
MinValueValidator,
)
from django.utils.deconstruct import deconstructible
from django.utils.translation import ugettext_lazy as _, ungettext_lazy
clas... | bsd-3-clause |
jmancewicz/DIGITS | tools/test_analyze_db.py | 4 | 1510 | # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
import os.path
import shutil
import tempfile
import caffe.io
import lmdb
import numpy as np
from . import analyze_db
# Must import after importing digits.config
import caffe_pb2
class BaseTestWithDB(object):
SAME_SHAPE = True
PASS_DEFAULT... | bsd-3-clause |
simone/django-gb | tests/admin_widgets/widgetadmin.py | 68 | 1222 | from django.contrib import admin
from . import models
class WidgetAdmin(admin.AdminSite):
pass
class CarAdmin(admin.ModelAdmin):
list_display = ['make', 'model', 'owner']
list_editable = ['owner']
class CarTireAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs... | bsd-3-clause |
benrudolph/commcare-hq | custom/_legacy/pact/api.py | 2 | 17441 | from datetime import datetime, time
import logging
import uuid
import tempfile
import dateutil
from lxml import etree
from django.core.servers.basehttp import FileWrapper
from django.utils.decorators import method_decorator
from casexml.apps.phone.middleware import LAST_SYNCTOKEN_HEADER
from dimagi.utils.parsing impor... | bsd-3-clause |
pyq881120/Empire | lib/modules/credentials/mimikatz/dcsync.py | 3 | 2901 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Mimikatz DCsync',
'Author': ['@gentilkiwi', '@JosephBialek'],
'Description': ("Runs PowerSploit's Invoke-Mimikatz function "
... | bsd-3-clause |
edx/ease | ease/model_creator.py | 1 | 7903 | #Provides interface functions to create and save models
import numpy
import re
import nltk
import sys
from sklearn.feature_extraction.text import CountVectorizer
import pickle
import os
import sklearn.ensemble
from itertools import chain
base_path = os.path.dirname(__file__)
sys.path.append(base_path)
from .essay_s... | agpl-3.0 |
AsimmHirani/ISpyPi | tensorflow/contrib/tensorflow-master/tensorflow/contrib/distributions/python/kernel_tests/dirichlet_test.py | 35 | 9106 | # 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 |
thehyve/variant | eggs/werkzeug-0.7.1-py2.7.egg/werkzeug/templates.py | 95 | 13713 | # -*- coding: utf-8 -*-
r"""
werkzeug.templates
~~~~~~~~~~~~~~~~~~
A minimal template engine.
:copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD License.
"""
import sys
import re
import __builtin__ as builtins
from compiler import ast, parse
from compiler.pycode... | apache-2.0 |
russellb/nova | nova/ipv6/api.py | 1 | 1342 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 Openstack, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | apache-2.0 |
yhe39/crosswalk-test-suite | tools/build/resource_only.py | 14 | 4418 | #!/usr/bin/env python
#
# Copyright (c) 2016 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
guillaume-philippon/aquilon | lib/aquilon/aqdb/model/operating_system.py | 1 | 2257 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013,2014,2016 Contributor
#
# 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... | apache-2.0 |
CaliOpen/CaliOpen | src/backend/tools/py.CLI/caliopen_cli/commands/dump_indexes_mappings.py | 1 | 1108 | import json
from caliopen_storage.helpers.json import JSONEncoder
def dump_indexes(**kwargs):
# Discover base core classes
from caliopen_main.user.core import User
from caliopen_main.contact.objects.contact import Contact
from caliopen_main.message.objects.message import Message
from caliopen_main... | gpl-3.0 |
huonw/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/command.py | 258 | 3985 | """Dispatches requests to remote WebDriver endpoint."""
import exceptions
import httplib
import json
import urlparse
import webelement
class CommandExecutor(object):
"""Dispatches requests to remote WebDriver endpoint."""
_HEADERS = {
"User-Agent": "Python WebDriver Local End",
"Content-Type... | mpl-2.0 |
Mausy5043/bonediagd | daemon13.py | 1 | 4546 | #!/usr/bin/env python
# Based on previous work by
# Charles Menguy (see: http://stackoverflow.com/questions/10217067/implementing-a-full-python-unix-style-daemon-process)
# and Sander Marechal (see: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/)
# Adapted by M.Hendrix [2015]
# daemon13.... | mit |
simbha/mAngE-Gin | lib/django/contrib/gis/management/commands/inspectdb.py | 40 | 1493 | from django.core.management.commands.inspectdb import Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row):
field_type, field_params, field_notes = super(Command, self).get_field_type... | mit |
fossoult/odoo | addons/website_event_track/controllers/event.py | 332 | 8323 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
fqul/scrapy | scrapy/commands/check.py | 79 | 3422 | from __future__ import print_function
import time
import sys
from collections import defaultdict
from unittest import TextTestRunner, TextTestResult as _TextTestResult
from scrapy.commands import ScrapyCommand
from scrapy.contracts import ContractsManager
from scrapy.utils.misc import load_object
from scrapy.utils.con... | bsd-3-clause |
grigorisg9gr/menpo | menpo/image/test/image_basics_test.py | 1 | 4345 | import warnings
import numpy as np
from numpy.testing import assert_allclose
from nose.tools import raises
from pathlib import Path
import menpo
from menpo.image import Image, MaskedImage, BooleanImage
from menpo.shape import PointCloud
from menpo.transform import UniformScale, Translation
def test_image_as_masked(... | bsd-3-clause |
Airphrame/mapnik | scons/scons-local-2.3.4/SCons/Platform/cygwin.py | 9 | 1989 | """SCons.Platform.cygwin
Platform-specific initialization for Cygwin systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is here... | lgpl-2.1 |
kaushik94/boto | tests/unit/glacier/test_vault.py | 18 | 7346 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.